@salla.sa/twilight-components 2.14.470 → 2.14.472
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-jdX95qxM.js → filepond-Cy1e6Ro5.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DC9ozntr.js → filepond-plugin-file-poster-CLtWPKuV.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DxUUyj2Z.js → filepond-plugin-file-validate-size-VaxUnQB7.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DB4YCfw-.js → filepond-plugin-file-validate-type-qjNEM_4Q.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-QlnXOcNf.js → filepond-plugin-image-edit-DZdFIpzD.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-D6HJ47N2.js → filepond-plugin-image-exif-orientation-CMDdMoTf.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DCaj9jNI.js → filepond-plugin-image-preview-CckneKBe.js} +1 -1
- package/dist/cjs/{functions-C_kzehHT.js → functions-DDLs9J1M.js} +1 -1
- package/dist/cjs/{index-CmPl0fIy.js → index-BLZPuy15.js} +10 -14
- package/dist/cjs/{index-SIy6bIWx.js → index-MGCYfYcr.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-accordion_6.cjs.entry.js +24 -8
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +422 -49
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +4 -4
- 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-badge.cjs.entry.js +2 -2
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +18 -18
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +2 -2
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +5 -5
- 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-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +2 -2
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +2 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +2 -2
- package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +9 -9
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +4 -4
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
- package/dist/cjs/{salla-map.cjs.entry.js → salla-map_2.cjs.entry.js} +70 -4
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
- package/dist/cjs/salla-next-order-coupon.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-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.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 +2 -2
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/{salla-product-card_2.cjs.entry.js → salla-order-options-modal_3.cjs.entry.js} +209 -6
- 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-placeholder.cjs.entry.js +2 -2
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-reward-action_4.cjs.entry.js +10 -10
- package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
- package/dist/cjs/salla-search.cjs.entry.js +6 -6
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- 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-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
- package/dist/cjs/{tracked-promise-D-gQXgPZ.js → tracked-promise-B-bFT1y-.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-CZ_8m6i_.js → vanilla-picker-CP29RTHf.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-accordion/salla-accordion-body.js +1 -1
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-accordion/salla-accordion.js +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +10 -0
- package/dist/collection/components/salla-alert/salla-alert.js +1 -1
- package/dist/collection/components/salla-badge/salla-badge.js +1 -1
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +1 -1
- package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +2 -2
- package/dist/collection/components/salla-breadcrumb/salla-breadcrumb.js +21 -5
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +1 -1
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
- package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
- package/dist/collection/components/salla-filters/salla-filters.js +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
- package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
- 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-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-loyalty-points-history/salla-loyalty-points-history.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-hero.js +3 -3
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-point.js +4 -4
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-reward.js +2 -2
- package/dist/collection/components/salla-loyalty-program/salla-reward-card.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-reward-details.js +3 -3
- package/dist/collection/components/salla-loyalty-program/salla-reward-exchange.js +3 -3
- 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 +1 -1
- 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.js +1 -1
- package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +1 -1
- package/dist/collection/components/salla-order-options-modal/apple-pay-order-options.js +84 -0
- package/dist/collection/components/salla-order-options-modal/order-options-gate.js +136 -0
- package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.css +35 -0
- package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.js +282 -0
- 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-card-embed/salla-product-card-embed.js +1 -1
- package/dist/collection/components/salla-product-options/availability-utils.js +54 -0
- package/dist/collection/components/salla-product-options/salla-product-options.js +105 -31
- 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 +1 -1
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +70 -16
- 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 +5 -5
- package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -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-settings/salla-user-settings.js +1 -1
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index2.js +2540 -1699
- package/dist/components/index3.js +1699 -2540
- package/dist/components/location.js +2 -2
- package/dist/components/salla-accordion-body2.js +1 -1
- package/dist/components/salla-accordion-head2.js +2 -2
- package/dist/components/salla-accordion2.js +1 -1
- package/dist/components/salla-add-product-button2.js +205 -8
- package/dist/components/salla-alert.js +1 -1
- package/dist/components/salla-badge2.js +1 -1
- package/dist/components/salla-booking-field2.js +1 -1
- package/dist/components/salla-bottom-alert.js +2 -2
- package/dist/components/salla-breadcrumb.js +21 -5
- package/dist/components/salla-bullet-delivery.js +3 -3
- package/dist/components/salla-cart-coupons.js +1 -1
- package/dist/components/salla-cart-summary.js +1 -1
- package/dist/components/salla-color-picker2.js +1 -1
- package/dist/components/salla-comment-form2.js +1 -1
- package/dist/components/salla-conditional-fields2.js +1 -1
- package/dist/components/salla-count-down2.js +1 -1
- package/dist/components/salla-datetime-picker2.js +2 -2
- package/dist/components/salla-file-upload2.js +2 -2
- package/dist/components/salla-filters-widget2.js +2 -2
- package/dist/components/salla-filters.js +1 -1
- package/dist/components/salla-gifting.js +2 -2
- 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-loyalty-hero2.js +3 -3
- package/dist/components/salla-loyalty-panel.js +66 -18
- package/dist/components/salla-loyalty-point2.js +6 -6
- package/dist/components/salla-loyalty-points-history.js +1 -1
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-loyalty-program.js +68 -20
- package/dist/components/salla-loyalty-reward.js +2 -2
- package/dist/components/salla-maintenance-alert.js +1 -1
- package/dist/components/salla-map2.js +4 -4
- 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 +1 -1
- 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 +65 -17
- package/dist/components/salla-order-details.js +1 -1
- package/dist/components/salla-order-edit-product-card.js +1 -1
- package/dist/components/salla-order-options-modal.d.ts +11 -0
- package/dist/components/salla-order-options-modal.js +9 -0
- package/dist/components/salla-order-options-modal2.js +303 -0
- 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-card-embed.js +1 -1
- package/dist/components/salla-product-card2.js +65 -17
- package/dist/components/salla-product-options2.js +120 -30
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-products-slider2.js +62 -14
- package/dist/components/salla-quantity-input2.js +1 -1
- package/dist/components/salla-quick-buy2.js +233 -18
- 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-reward-card2.js +1 -1
- package/dist/components/salla-reward-details2.js +67 -19
- package/dist/components/salla-reward-exchange2.js +3 -3
- package/dist/components/salla-scopes.js +1 -1
- package/dist/components/salla-search.js +5 -5
- package/dist/components/salla-searchable-dropdown2.js +4 -4
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share2.js +1 -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 +2 -2
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/components/salla-wishlist-actions.js +1 -1
- package/dist/esm/{filepond-DLJR7kqO.js → filepond-BOdFx-k4.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BPPxfj_a.js → filepond-plugin-file-poster-B0plGjbP.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CCqZAz2o.js → filepond-plugin-file-validate-size-BFnLP4vL.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-YEjyqpU3.js → filepond-plugin-file-validate-type-CKf0Z8YX.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-tiyoM7iJ.js → filepond-plugin-image-edit-lPLGnaWD.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CESSG4q3.js → filepond-plugin-image-exif-orientation-ad7mrSt5.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CTrGLHaX.js → filepond-plugin-image-preview-D5dtrQjv.js} +1 -1
- package/dist/esm/{functions-iGPmc3ui.js → functions-nnPBSJY6.js} +1 -1
- package/dist/esm/{index-pj-XyI3U.js → index-BtIvUNme.js} +1 -1
- package/dist/esm/{index-Dckjjczv.js → index-CjnbnAFU.js} +10 -14
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +4 -4
- package/dist/esm/salla-accordion_6.entry.js +24 -8
- package/dist/esm/salla-add-product-button_5.entry.js +422 -49
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +4 -4
- 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-badge.entry.js +2 -2
- package/dist/esm/salla-booking-field_7.entry.js +18 -18
- package/dist/esm/salla-bullet-delivery_2.entry.js +5 -5
- package/dist/esm/salla-cart-coupons.entry.js +2 -2
- package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +5 -5
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +2 -2
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +2 -2
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +2 -2
- package/dist/esm/salla-localization-modal.entry.js +2 -2
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner.entry.js +2 -2
- package/dist/esm/salla-loyalty-hero_2.entry.js +9 -9
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +2 -2
- package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +4 -4
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +2 -2
- package/dist/esm/{salla-map.entry.js → salla-map_2.entry.js} +70 -5
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
- package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
- package/dist/esm/salla-next-order-coupon.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-modal.entry.js +2 -2
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.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 +2 -2
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +2 -2
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/{salla-product-card_2.entry.js → salla-order-options-modal_3.entry.js} +209 -7
- 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-placeholder.entry.js +2 -2
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card-embed.entry.js +2 -2
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-reward-action_4.entry.js +10 -10
- package/dist/esm/salla-scopes.entry.js +2 -2
- package/dist/esm/salla-search.entry.js +6 -6
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- 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-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +2 -2
- package/dist/esm/{tracked-promise-CfOFv_ZQ.js → tracked-promise-DxK5ancc.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-BwAhzkb2.js → vanilla-picker-BNKvceoq.js} +1 -1
- package/dist/twilight/{p-193f4672.entry.js → p-01995780.entry.js} +1 -1
- package/dist/twilight/{p-46b75509.entry.js → p-02822e9f.entry.js} +1 -1
- package/dist/twilight/p-080444bb.entry.js +4 -0
- package/dist/twilight/{p-e573c23d.entry.js → p-0d01c327.entry.js} +1 -1
- package/dist/twilight/{p-9ac3d874.entry.js → p-0dcb8111.entry.js} +1 -1
- package/dist/twilight/p-129c20ed.entry.js +4 -0
- package/dist/twilight/{p-e2e38f7d.entry.js → p-15541ca3.entry.js} +1 -1
- package/dist/twilight/p-155d4693.entry.js +4 -0
- package/dist/twilight/{p-85d1767d.entry.js → p-1982cd13.entry.js} +1 -1
- package/dist/twilight/{p-b1d439e7.entry.js → p-1b8c59cf.entry.js} +1 -1
- package/dist/twilight/{p-3100186f.entry.js → p-1dc58168.entry.js} +1 -1
- package/dist/twilight/{p-768b4a83.entry.js → p-1f3480ba.entry.js} +1 -1
- package/dist/twilight/p-241b94a6.entry.js +4 -0
- package/dist/twilight/{p-69e7eb15.entry.js → p-2b75426a.entry.js} +1 -1
- package/dist/twilight/{p-6e2c05e8.entry.js → p-2dc46abc.entry.js} +1 -1
- package/dist/twilight/p-2eaf114e.entry.js +4 -0
- package/dist/twilight/{p-780abf03.entry.js → p-304f3de9.entry.js} +1 -1
- package/dist/twilight/p-35f30553.entry.js +4 -0
- package/dist/twilight/{p-d059046e.entry.js → p-3adacc75.entry.js} +1 -1
- package/dist/twilight/p-3e9f8d3c.entry.js +4 -0
- package/dist/twilight/{p-6543c5eb.entry.js → p-407a0c14.entry.js} +1 -1
- package/dist/twilight/{p-61bcbf9a.entry.js → p-43affbdd.entry.js} +1 -1
- package/dist/twilight/{p-a8a9b151.entry.js → p-456cfec5.entry.js} +1 -1
- package/dist/twilight/{p-3995c76e.entry.js → p-46c8b2d4.entry.js} +1 -1
- package/dist/twilight/{p-badfd153.entry.js → p-474b22b8.entry.js} +1 -1
- package/dist/twilight/{p-9f8a065c.entry.js → p-49c42118.entry.js} +1 -1
- package/dist/twilight/p-5089b72f.entry.js +4 -0
- package/dist/twilight/{p-c907509d.entry.js → p-5229c8aa.entry.js} +1 -1
- package/dist/twilight/{p-5f989a35.entry.js → p-550a91fe.entry.js} +1 -1
- package/dist/twilight/{p-463cf5ea.entry.js → p-594694e9.entry.js} +1 -1
- package/dist/twilight/{p-6ee5c24d.entry.js → p-5a18c6cc.entry.js} +1 -1
- package/dist/twilight/{p-38b5829a.entry.js → p-5aa08192.entry.js} +1 -1
- package/dist/twilight/p-5bda616b.entry.js +4 -0
- package/dist/twilight/p-5d9b57c8.entry.js +4 -0
- package/dist/twilight/{p-c4c3e16f.entry.js → p-6030f1fd.entry.js} +1 -1
- package/dist/twilight/{p-a756b0a4.entry.js → p-62010e29.entry.js} +1 -1
- package/dist/twilight/{p-df72e6a9.entry.js → p-63f1acc7.entry.js} +1 -1
- package/dist/twilight/p-6790943b.entry.js +4 -0
- package/dist/twilight/{p-fe2a4d07.entry.js → p-67d41cbb.entry.js} +1 -1
- package/dist/twilight/{p-9668a8aa.entry.js → p-6c39606a.entry.js} +1 -1
- package/dist/twilight/{p-fca82074.entry.js → p-6d6184c0.entry.js} +1 -1
- package/dist/twilight/{p-f145dc81.entry.js → p-6eab2444.entry.js} +1 -1
- package/dist/twilight/{p-dcc34752.entry.js → p-72a1b702.entry.js} +1 -1
- package/dist/twilight/{p-30fe7a02.entry.js → p-7442c41a.entry.js} +1 -1
- package/dist/twilight/{p-51b4ab80.entry.js → p-7f4d4e3c.entry.js} +1 -1
- package/dist/twilight/{p-be077285.entry.js → p-7fdeec2b.entry.js} +1 -1
- package/dist/twilight/{p-f4f47286.entry.js → p-83cb6915.entry.js} +1 -1
- package/dist/twilight/{p-017500f8.entry.js → p-88bed460.entry.js} +1 -1
- package/dist/twilight/{p-623b0c48.entry.js → p-8d1c4f93.entry.js} +1 -1
- package/dist/twilight/{p-4d2f0573.entry.js → p-8d427c53.entry.js} +1 -1
- package/dist/twilight/p-929e5aed.entry.js +4 -0
- package/dist/twilight/p-956d6683.entry.js +4 -0
- package/dist/twilight/{p-BPasfwVf.js → p-BKKN_hn3.js} +1 -1
- package/dist/twilight/{p-DVCS8qoq.js → p-BT5S72c8.js} +1 -1
- package/dist/twilight/{p-D2W2ygY1.js → p-ByL3FHQ6.js} +1 -1
- package/dist/twilight/p-CBwG3dWv.js +9 -0
- package/dist/twilight/{p-Dckjjczv.js → p-CjnbnAFU.js} +1 -1
- package/dist/twilight/{p-DNU1AEuR.js → p-ClNJhnhN.js} +1 -1
- package/dist/twilight/{p-DzHsJ03K.js → p-Cq2cbPYZ.js} +1 -1
- package/dist/twilight/p-Czf4a8gg.js +9 -0
- package/dist/twilight/{p--Jfvyk1f.js → p-D6Z2cDb0.js} +1 -1
- package/dist/twilight/{p-BgFqaLNN.js → p-DBxZFsVz.js} +1 -1
- package/dist/twilight/{p-BxhAwisc.js → p-DXVmi29t.js} +1 -1
- package/dist/twilight/{p-CHsBLTlN.js → p-DY6O-SiT.js} +1 -1
- package/dist/twilight/{p-1fa5c385.entry.js → p-a1e520d5.entry.js} +1 -1
- package/dist/twilight/{p-0052df8e.entry.js → p-a26fe1e5.entry.js} +1 -1
- package/dist/twilight/{p-0fa958a8.entry.js → p-a30cfade.entry.js} +1 -1
- package/dist/twilight/{p-eaf8f509.entry.js → p-a9090afd.entry.js} +1 -1
- package/dist/twilight/{p-89dae763.entry.js → p-ae2c963f.entry.js} +1 -1
- package/dist/twilight/{p-0a8fdddc.entry.js → p-b18a446a.entry.js} +1 -1
- package/dist/twilight/{p-9196d137.entry.js → p-b1c97472.entry.js} +1 -1
- package/dist/twilight/{p-bc1725dd.entry.js → p-bc6c4c1c.entry.js} +1 -1
- package/dist/twilight/{p-31fca96b.entry.js → p-be10a9c3.entry.js} +1 -1
- package/dist/twilight/p-c26cf3fa.entry.js +4 -0
- package/dist/twilight/{p-092318cc.entry.js → p-c4655810.entry.js} +1 -1
- package/dist/twilight/{p-ba55e58f.entry.js → p-c5211eca.entry.js} +1 -1
- package/dist/twilight/{p-6ce0ab6e.entry.js → p-cbd793c8.entry.js} +1 -1
- package/dist/twilight/{p-052922a0.entry.js → p-cfb9665f.entry.js} +2 -2
- package/dist/twilight/p-d46fb24a.entry.js +4 -0
- package/dist/twilight/{p-a2ff9abd.entry.js → p-d6cb423a.entry.js} +1 -1
- package/dist/twilight/{p-721ae2c4.entry.js → p-d7a2e982.entry.js} +1 -1
- package/dist/twilight/{p-77db23d2.entry.js → p-d9868f07.entry.js} +1 -1
- package/dist/twilight/{p-ba5d1170.entry.js → p-dbe3a5bb.entry.js} +1 -1
- package/dist/twilight/{p-66d2b9e3.entry.js → p-e041fe56.entry.js} +1 -1
- package/dist/twilight/{p-37299c40.entry.js → p-e058b62c.entry.js} +1 -1
- package/dist/twilight/{p-6f63f391.entry.js → p-e07c9a85.entry.js} +1 -1
- package/dist/twilight/{p-ddbffad3.entry.js → p-e1275bf7.entry.js} +1 -1
- package/dist/twilight/{p-7a75c505.entry.js → p-e5d5a6b3.entry.js} +1 -1
- package/dist/twilight/p-e5e6ea75.entry.js +4 -0
- package/dist/twilight/{p-9a6ea758.entry.js → p-e7a255a3.entry.js} +1 -1
- package/dist/twilight/{p-de70e0f6.entry.js → p-ebebcd55.entry.js} +1 -1
- package/dist/twilight/{p-6f86922a.entry.js → p-f0d7247d.entry.js} +1 -1
- package/dist/twilight/{p-3d65f310.entry.js → p-f222bf9f.entry.js} +1 -1
- package/dist/twilight/{p-1da95f6f.entry.js → p-f2594407.entry.js} +1 -1
- package/dist/twilight/{p-21e43f89.entry.js → p-f4235325.entry.js} +1 -1
- package/dist/twilight/p-fafdeea7.entry.js +4 -0
- package/dist/twilight/{p-ef26e3be.entry.js → p-fb7de7c4.entry.js} +1 -1
- package/dist/twilight/{p-1eadcac5.entry.js → p-fc1e3854.entry.js} +1 -1
- package/dist/twilight/{p-7288ff02.entry.js → p-fc72b631.entry.js} +1 -1
- package/dist/twilight/{p-681a053f.entry.js → p-fce2579c.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +2 -0
- package/dist/types/components/salla-breadcrumb/salla-breadcrumb.d.ts +1 -0
- package/dist/types/components/salla-order-options-modal/apple-pay-order-options.d.ts +26 -0
- package/dist/types/components/salla-order-options-modal/order-options-gate.d.ts +23 -0
- package/dist/types/components/salla-order-options-modal/salla-order-options-modal.d.ts +66 -0
- package/dist/types/components/salla-product-options/availability-utils.d.ts +19 -0
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +14 -0
- package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +14 -0
- package/dist/types/components.d.ts +62 -0
- package/package.json +5 -5
- package/dist/cjs/salla-progress-bar.cjs.entry.js +0 -73
- package/dist/esm/salla-progress-bar.entry.js +0 -71
- package/dist/twilight/p-05ffde56.entry.js +0 -4
- package/dist/twilight/p-0bf6b9ad.entry.js +0 -4
- package/dist/twilight/p-294a3248.entry.js +0 -4
- package/dist/twilight/p-2b2af618.entry.js +0 -4
- package/dist/twilight/p-45a786cd.entry.js +0 -4
- package/dist/twilight/p-476463ea.entry.js +0 -4
- package/dist/twilight/p-56f4d005.entry.js +0 -4
- package/dist/twilight/p-58bcae28.entry.js +0 -4
- package/dist/twilight/p-5d19859e.entry.js +0 -4
- package/dist/twilight/p-63f20aa0.entry.js +0 -4
- package/dist/twilight/p-83222f33.entry.js +0 -4
- package/dist/twilight/p-84dc489a.entry.js +0 -4
- package/dist/twilight/p-869773d3.entry.js +0 -4
- package/dist/twilight/p-97b74b76.entry.js +0 -4
- package/dist/twilight/p-9dca7f59.entry.js +0 -4
- package/dist/twilight/p-BFEfBkEW.js +0 -9
- package/dist/twilight/p-DWcI2hUr.js +0 -9
- package/dist/twilight/p-ad60969e.entry.js +0 -4
- package/dist/twilight/p-dc9b7a8e.entry.js +0 -4
- package/dist/twilight/p-fc7a1f2f.entry.js +0 -4
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Order-options helpers for the Apple Pay quick-buy flow — keeps <salla-quick-buy> to thin AP wiring.
|
|
6
|
+
* Apple Pay resolves options inside the session-started hook (single gesture), so the caller owns
|
|
7
|
+
* the ApplePaySession and drives it via callbacks.
|
|
8
|
+
*/
|
|
9
|
+
/** Get-or-create the singleton order-options modal on <body>. */
|
|
10
|
+
function ensureOrderOptionsModal() {
|
|
11
|
+
let modal = document.querySelector('salla-order-options-modal');
|
|
12
|
+
if (!modal) {
|
|
13
|
+
modal = document.createElement('salla-order-options-modal');
|
|
14
|
+
document.body.appendChild(modal);
|
|
15
|
+
}
|
|
16
|
+
return modal;
|
|
17
|
+
}
|
|
18
|
+
/** Sync PDP-option validity (an `await` would consume the Apple Pay gesture). Skips hidden/disabled inputs. */
|
|
19
|
+
export function reportProductOptionsValiditySync(productId) {
|
|
20
|
+
const optionsElement = document.querySelector(`salla-product-options[product-id="${productId}"]`);
|
|
21
|
+
if (!optionsElement)
|
|
22
|
+
return true;
|
|
23
|
+
const requiredInputs = optionsElement.querySelectorAll('[required]');
|
|
24
|
+
let pass = true;
|
|
25
|
+
requiredInputs.forEach((input) => {
|
|
26
|
+
if (input.disabled || input.closest('.hidden'))
|
|
27
|
+
return;
|
|
28
|
+
if ('reportValidity' in input && !input.reportValidity())
|
|
29
|
+
pass = false;
|
|
30
|
+
});
|
|
31
|
+
return pass;
|
|
32
|
+
}
|
|
33
|
+
/** Merge collected order-options into the quick-purchase payload (FormData or plain object). */
|
|
34
|
+
export function appendOrderOptionsToPayload(data, orderOptions) {
|
|
35
|
+
if (!orderOptions.length)
|
|
36
|
+
return;
|
|
37
|
+
if (data && typeof data.append === 'function') {
|
|
38
|
+
orderOptions.forEach((entry, i) => {
|
|
39
|
+
data.append(`order_options[${i}][id]`, String(entry.id));
|
|
40
|
+
data.append(`order_options[${i}][value]`, String(entry.value));
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (data && typeof data === 'object') {
|
|
45
|
+
data.order_options = orderOptions;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Fetch order options and, if any, collect them via the modal (apple-pay mode). Callbacks drive the
|
|
50
|
+
* caller's pre-created session: `beginPendingSession` (no options), `discardPendingSession` (options
|
|
51
|
+
* found — the modal's AP button starts a fresh one), `onSubmit` (submitted).
|
|
52
|
+
*/
|
|
53
|
+
export async function resolveApplePayOrderOptions(opts) {
|
|
54
|
+
let resp;
|
|
55
|
+
try {
|
|
56
|
+
resp = await salla.api.withoutNotifier(() => salla.product.api.getOrderOptions([{ id: opts.productId, quantity: opts.quantity }]));
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
salla?.logger?.warn?.('order-options: fetch failed', error);
|
|
60
|
+
opts.beginPendingSession();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const items = resp?.data?.order_options || [];
|
|
64
|
+
if (!items.length) {
|
|
65
|
+
opts.beginPendingSession(); // begin() doesn't need a fresh gesture
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
opts.discardPendingSession(); // drop the unused session; the modal builds a fresh one
|
|
69
|
+
const basePrice = Number(opts.amount) > 0
|
|
70
|
+
? Number(opts.amount)
|
|
71
|
+
: Number(resp?.data?.products?.[0]?.price?.amount) || 0;
|
|
72
|
+
const modal = ensureOrderOptionsModal();
|
|
73
|
+
try {
|
|
74
|
+
await modal.open({
|
|
75
|
+
orderOptions: items,
|
|
76
|
+
basePrice,
|
|
77
|
+
paymentMode: 'apple-pay',
|
|
78
|
+
onSubmit: opts.onSubmit,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// dismissed — no live session
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Order-options gate for the fast-checkout widget — keeps <salla-add-product-button> thin.
|
|
6
|
+
* Intercepts the widget click → runs the order-options modal → injects the result → re-fires the click.
|
|
7
|
+
*/
|
|
8
|
+
const PRODUCT_FORM_SELECTOR = 'form.product-form';
|
|
9
|
+
export class OrderOptionsGate {
|
|
10
|
+
constructor(host, productId) {
|
|
11
|
+
this.host = host;
|
|
12
|
+
this.productId = productId;
|
|
13
|
+
/** True on the re-fired click so it passes through instead of re-gating. */
|
|
14
|
+
this.collected = false;
|
|
15
|
+
/** Live PDP price (one onPriceUpdated subscription per widget). */
|
|
16
|
+
this.livePrice = 0;
|
|
17
|
+
}
|
|
18
|
+
/** Attach once to the widget. Returns false when there's no widget (e.g. product cards) so the caller retries. */
|
|
19
|
+
static attach(host, productId) {
|
|
20
|
+
const widget = host.querySelector('salla-mini-checkout-widget');
|
|
21
|
+
if (!widget)
|
|
22
|
+
return false;
|
|
23
|
+
const gate = new OrderOptionsGate(host, String(productId));
|
|
24
|
+
// One subscription per widget (PDP only) — no per-card leak.
|
|
25
|
+
salla.product?.event?.onPriceUpdated?.((response) => {
|
|
26
|
+
gate.livePrice = Number(response?.data?.price) || gate.livePrice;
|
|
27
|
+
});
|
|
28
|
+
widget.addEventListener('click', (event) => gate.handleWidgetClick(event, widget), true);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
/** Quantity from the same form the widget submits (PRODUCT_FORM_SELECTOR), not the button's nearest form. */
|
|
32
|
+
getSelectedQuantity() {
|
|
33
|
+
try {
|
|
34
|
+
const form = document.querySelector(PRODUCT_FORM_SELECTOR);
|
|
35
|
+
const data = form?.getElementSallaData?.();
|
|
36
|
+
const qty = Number(data instanceof FormData ? data.get('quantity') : data?.quantity);
|
|
37
|
+
if (Number.isFinite(qty) && qty > 0)
|
|
38
|
+
return qty;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// fall through to the attribute
|
|
42
|
+
}
|
|
43
|
+
return Number(this.host.getAttribute('quantity')) || 1;
|
|
44
|
+
}
|
|
45
|
+
async handleWidgetClick(event, widget) {
|
|
46
|
+
if (this.collected) {
|
|
47
|
+
this.collected = false;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
event.stopImmediatePropagation();
|
|
52
|
+
if (!await this.validatePdpOptions())
|
|
53
|
+
return;
|
|
54
|
+
if (salla.config.isGuest()) {
|
|
55
|
+
salla.api.auth.requireLoginThen('salla-add-product-button::oo.after-login', () => this.handleWidgetClick(event, widget));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
widget.classList.add('s-add-product-button-busy');
|
|
59
|
+
let resp;
|
|
60
|
+
try {
|
|
61
|
+
resp = await salla.api.withoutNotifier(() => salla.product.api.getOrderOptions([{ id: this.productId, quantity: this.getSelectedQuantity() }]));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
salla?.logger?.warn?.('order-options: fetch failed', error);
|
|
65
|
+
widget.classList.remove('s-add-product-button-busy');
|
|
66
|
+
this.resumeWidget(widget);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
widget.classList.remove('s-add-product-button-busy');
|
|
70
|
+
const items = resp?.data?.order_options || [];
|
|
71
|
+
if (!items.length) {
|
|
72
|
+
this.resumeWidget(widget);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const basePrice = this.livePrice > 0
|
|
76
|
+
? this.livePrice
|
|
77
|
+
: Number(resp?.data?.products?.[0]?.price?.amount) || 0;
|
|
78
|
+
const modal = this.ensureModal();
|
|
79
|
+
try {
|
|
80
|
+
const result = await modal.open({ orderOptions: items, basePrice });
|
|
81
|
+
this.injectIntoMini(result?.orderOptions || []);
|
|
82
|
+
this.resumeWidget(widget);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// user dismissed — widget stays blocked, they re-click to retry.
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async validatePdpOptions() {
|
|
89
|
+
const optionsEl = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
90
|
+
if (!optionsEl)
|
|
91
|
+
return true;
|
|
92
|
+
if (typeof optionsEl.validateAndScroll === 'function') {
|
|
93
|
+
return await optionsEl.validateAndScroll();
|
|
94
|
+
}
|
|
95
|
+
if (typeof optionsEl.reportValidity === 'function') {
|
|
96
|
+
return await optionsEl.reportValidity();
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
/** Inject order_options into the next cart-add payload via `cart::before.add.item` (one-shot, scoped to productId). */
|
|
101
|
+
injectIntoMini(orderOptions) {
|
|
102
|
+
if (!orderOptions.length)
|
|
103
|
+
return;
|
|
104
|
+
const productId = this.productId;
|
|
105
|
+
const onceHandler = (eventData) => {
|
|
106
|
+
if (String(eventData?.id) !== String(productId))
|
|
107
|
+
return;
|
|
108
|
+
try {
|
|
109
|
+
eventData?.payload?.set?.('order_options', orderOptions);
|
|
110
|
+
}
|
|
111
|
+
finally {
|
|
112
|
+
salla.event.off('cart::before.add.item', onceHandler);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
salla.event.on('cart::before.add.item', onceHandler);
|
|
116
|
+
}
|
|
117
|
+
ensureModal() {
|
|
118
|
+
let modal = document.querySelector('salla-order-options-modal');
|
|
119
|
+
if (!modal) {
|
|
120
|
+
modal = document.createElement('salla-order-options-modal');
|
|
121
|
+
document.body.appendChild(modal);
|
|
122
|
+
}
|
|
123
|
+
return modal;
|
|
124
|
+
}
|
|
125
|
+
resumeWidget(widget) {
|
|
126
|
+
this.collected = true;
|
|
127
|
+
// Real click target lives in the widget's shadow DOM.
|
|
128
|
+
const innerBtn = widget.shadowRoot?.querySelector?.('.s-fast-checkout-button');
|
|
129
|
+
if (innerBtn) {
|
|
130
|
+
innerBtn.click();
|
|
131
|
+
}
|
|
132
|
+
else if (typeof widget.click === 'function') {
|
|
133
|
+
widget.click();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Salla Order Options Modal: popup modal that collects cart-level order options
|
|
3
|
+
* before the fast-checkout widget creates the cart via /mini.
|
|
4
|
+
*/
|
|
5
|
+
.s-order-options-modal-host .s-modal-header-inner,
|
|
6
|
+
.s-order-options-modal-host .s-modal-header-content,
|
|
7
|
+
.s-order-options-modal-host .s-modal-title {
|
|
8
|
+
text-align: start !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.s-order-options-modal-apple-pay {
|
|
12
|
+
display: block;
|
|
13
|
+
width: 100%;
|
|
14
|
+
--apple-pay-button-width: 100%;
|
|
15
|
+
--apple-pay-button-height: 44px;
|
|
16
|
+
--apple-pay-button-border-radius: 0.75rem;
|
|
17
|
+
}
|
|
18
|
+
.s-order-options-modal-apple-pay-wrap {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 0.75rem;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
.s-order-options-modal-apple-pay-total {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
gap: 0.5rem;
|
|
29
|
+
}
|
|
30
|
+
.s-order-options-modal-apple-pay-label, .s-order-options-modal-apple-pay-amount {
|
|
31
|
+
font-size: 1.125rem;
|
|
32
|
+
line-height: 1.5rem;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
color: #111827;
|
|
35
|
+
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
/**
|
|
6
|
+
* Modal that collects merchant-configured order options before checkout.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* const modal = document.querySelector('salla-order-options-modal');
|
|
10
|
+
* const { orderOptions } = await modal.open({ orderOptions, basePrice });
|
|
11
|
+
* // orderOptions = [{ id, value }, ...] — ready to send as `order_options`.
|
|
12
|
+
*/
|
|
13
|
+
export class SallaOrderOptionsModal {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.resolveFn = null;
|
|
16
|
+
this.rejectFn = null;
|
|
17
|
+
this.optionsRefs = new Map();
|
|
18
|
+
this.changeHandler = null;
|
|
19
|
+
/** Sync hook for callers that need to act under the submit user gesture (Apple Pay). */
|
|
20
|
+
this.submitCallback = null;
|
|
21
|
+
this.orderOptions = [];
|
|
22
|
+
this.basePrice = 0;
|
|
23
|
+
this.liveTotal = 0;
|
|
24
|
+
this.isSubmitting = false;
|
|
25
|
+
/** Bumped each open() so the inner <salla-product-options> remounts. */
|
|
26
|
+
this.sessionId = 0;
|
|
27
|
+
this.paymentMode = 'default';
|
|
28
|
+
this.title = '';
|
|
29
|
+
this.subtitle = '';
|
|
30
|
+
this.submitLabel = '';
|
|
31
|
+
this.totalLabel = '';
|
|
32
|
+
this.requiredMessage = '';
|
|
33
|
+
this.handleClose = () => {
|
|
34
|
+
if (this.isSubmitting)
|
|
35
|
+
return;
|
|
36
|
+
this.rejectFn?.({ reason: 'dismissed' });
|
|
37
|
+
this.resolveFn = null;
|
|
38
|
+
this.rejectFn = null;
|
|
39
|
+
this.detachChangeListener();
|
|
40
|
+
this.reset();
|
|
41
|
+
};
|
|
42
|
+
salla.lang.onLoaded(() => this.loadTranslations());
|
|
43
|
+
}
|
|
44
|
+
componentWillLoad() {
|
|
45
|
+
this.loadTranslations();
|
|
46
|
+
}
|
|
47
|
+
loadTranslations() {
|
|
48
|
+
this.title = salla.lang.get('blocks.order_options.title');
|
|
49
|
+
this.subtitle = salla.lang.get('blocks.order_options.subtitle');
|
|
50
|
+
this.submitLabel = salla.lang.get('blocks.order_options.continue');
|
|
51
|
+
this.totalLabel = salla.lang.get('blocks.order_options.total');
|
|
52
|
+
this.requiredMessage = salla.lang.get('blocks.order_options.required_message');
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Open the modal. Resolves with selections on submit; rejects on dismiss.
|
|
56
|
+
* `onSubmit` fires sync in the submit click (for Apple Pay user-gesture).
|
|
57
|
+
* `paymentMode: 'apple-pay'` swaps the footer button for <apple-pay-button>.
|
|
58
|
+
*/
|
|
59
|
+
async open(payload) {
|
|
60
|
+
// Normalize here, not in the shared salla-product-options: text/number order options ship no
|
|
61
|
+
// `details`, which product-options dereferences unguarded.
|
|
62
|
+
this.orderOptions = (Array.isArray(payload.orderOptions) ? payload.orderOptions : [])
|
|
63
|
+
.map((o) => ({ ...o, details: o.details ?? [] }));
|
|
64
|
+
this.basePrice = Number(payload.basePrice) || 0;
|
|
65
|
+
this.liveTotal = this.basePrice + this.seedOptionsPrice(this.orderOptions);
|
|
66
|
+
this.isSubmitting = false;
|
|
67
|
+
this.sessionId++;
|
|
68
|
+
this.optionsRefs.clear();
|
|
69
|
+
this.submitCallback = payload.onSubmit ?? null;
|
|
70
|
+
this.paymentMode = payload.paymentMode ?? 'default';
|
|
71
|
+
await this.modal?.open();
|
|
72
|
+
this.attachChangeListener();
|
|
73
|
+
return new Promise((resolve, reject) => {
|
|
74
|
+
this.resolveFn = resolve;
|
|
75
|
+
this.rejectFn = reject;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async close() {
|
|
79
|
+
await this.modal?.close();
|
|
80
|
+
}
|
|
81
|
+
/** Sync walk of inputs — avoids `await` through the @Method that would consume the AP user gesture. */
|
|
82
|
+
collectOrderOptionsSync() {
|
|
83
|
+
const result = [];
|
|
84
|
+
for (const [, el] of this.optionsRefs) {
|
|
85
|
+
if (!el)
|
|
86
|
+
continue;
|
|
87
|
+
const inputs = el.querySelectorAll('[name^="options["],[name*="[options]["]');
|
|
88
|
+
inputs.forEach((input) => {
|
|
89
|
+
if (input instanceof HTMLInputElement && (input.type === 'radio' || input.type === 'checkbox') && !input.checked) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const match = input.name.match(/(?:^|\[)options\]?\[(\d+)\]/);
|
|
93
|
+
if (!match)
|
|
94
|
+
return;
|
|
95
|
+
const raw = input.value;
|
|
96
|
+
if (raw === '' || raw === null || raw === undefined)
|
|
97
|
+
return;
|
|
98
|
+
const numeric = Number(raw);
|
|
99
|
+
result.push({
|
|
100
|
+
id: Number(match[1]),
|
|
101
|
+
value: Number.isFinite(numeric) && raw === String(numeric) ? numeric : raw,
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
/** Sync native validity — keeps the AP user gesture intact. */
|
|
108
|
+
validateSync() {
|
|
109
|
+
let pass = true;
|
|
110
|
+
for (const [, el] of this.optionsRefs) {
|
|
111
|
+
if (!el)
|
|
112
|
+
continue;
|
|
113
|
+
const requiredInputs = el.querySelectorAll('[required]');
|
|
114
|
+
requiredInputs.forEach((input) => {
|
|
115
|
+
// Mirror salla-product-options.reportValidity(): skip hidden/disabled inputs so a
|
|
116
|
+
// required field in a `.hidden` conditional container can't silently block submit.
|
|
117
|
+
if (input.disabled || input.closest('.hidden'))
|
|
118
|
+
return;
|
|
119
|
+
if ('reportValidity' in input && !input.reportValidity())
|
|
120
|
+
pass = false;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return pass;
|
|
124
|
+
}
|
|
125
|
+
/** Sum the additional_price of any pre-selected details. */
|
|
126
|
+
seedOptionsPrice(orderOptions) {
|
|
127
|
+
let sum = 0;
|
|
128
|
+
orderOptions.forEach((opt) => {
|
|
129
|
+
(opt.details || []).forEach((d) => {
|
|
130
|
+
if (d.is_selected)
|
|
131
|
+
sum += Number(d.additional_price) || 0;
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
return sum;
|
|
135
|
+
}
|
|
136
|
+
/** salla.event.on is global — attach per open, detach on close to avoid stacking. */
|
|
137
|
+
attachChangeListener() {
|
|
138
|
+
this.detachChangeListener();
|
|
139
|
+
this.changeHandler = () => this.recomputeTotal();
|
|
140
|
+
salla.event.on('product-options::change', this.changeHandler);
|
|
141
|
+
}
|
|
142
|
+
detachChangeListener() {
|
|
143
|
+
if (!this.changeHandler)
|
|
144
|
+
return;
|
|
145
|
+
salla.event.off('product-options::change', this.changeHandler);
|
|
146
|
+
this.changeHandler = null;
|
|
147
|
+
}
|
|
148
|
+
async recomputeTotal() {
|
|
149
|
+
let selectedPrice = 0;
|
|
150
|
+
for (const [, el] of this.optionsRefs) {
|
|
151
|
+
if (!el)
|
|
152
|
+
continue;
|
|
153
|
+
const selected = typeof el.getSelectedOptions === 'function'
|
|
154
|
+
? await el.getSelectedOptions()
|
|
155
|
+
: [];
|
|
156
|
+
(selected || []).forEach((s) => {
|
|
157
|
+
selectedPrice += Number(s.additional_price) || 0;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
this.liveTotal = this.basePrice + selectedPrice;
|
|
161
|
+
}
|
|
162
|
+
handleSubmit() {
|
|
163
|
+
if (this.isSubmitting)
|
|
164
|
+
return;
|
|
165
|
+
if (!this.validateSync()) {
|
|
166
|
+
salla.notify?.error?.(this.requiredMessage);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
this.isSubmitting = true;
|
|
170
|
+
const orderOptions = this.collectOrderOptionsSync();
|
|
171
|
+
const total = Math.round(this.liveTotal * 100) / 100;
|
|
172
|
+
// Fire onSubmit BEFORE any await — Apple Pay needs the user gesture.
|
|
173
|
+
try {
|
|
174
|
+
this.submitCallback?.(orderOptions, total);
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
salla?.logger?.warn?.('order-options modal onSubmit threw', err);
|
|
178
|
+
}
|
|
179
|
+
this.resolveFn?.({ orderOptions });
|
|
180
|
+
this.resolveFn = null;
|
|
181
|
+
this.rejectFn = null;
|
|
182
|
+
this.submitCallback = null;
|
|
183
|
+
this.detachChangeListener();
|
|
184
|
+
this.modal?.close().then(() => this.reset());
|
|
185
|
+
this.isSubmitting = false;
|
|
186
|
+
}
|
|
187
|
+
/** Clear options on close so the inner <salla-product-options> unmounts. */
|
|
188
|
+
reset() {
|
|
189
|
+
this.orderOptions = [];
|
|
190
|
+
this.optionsRefs.clear();
|
|
191
|
+
this.liveTotal = 0;
|
|
192
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
// salla.money returns HTML (sicon-sar icon) → render via innerHTML. Round
|
|
195
|
+
// first so floating-point sum doesn't show as 1174.3799999999999.
|
|
196
|
+
const totalHtml = salla.money(Math.round(this.liveTotal * 100) / 100);
|
|
197
|
+
return (h("salla-modal", { key: 'a7b7c31da2f5fd9f5f3ee601052f84e512368cee', ref: el => (this.modal = el), class: "s-order-options-modal-host", width: "md", "modal-title": this.title, onModalVisibilityChanged: (e) => {
|
|
198
|
+
if (!e.detail)
|
|
199
|
+
this.handleClose();
|
|
200
|
+
} }, h("div", { key: '9a44c4dcec6f0e49a65217b1e1e2cd19ccc80c76', class: "s-order-options-modal-body" }, h("p", { key: '66c41a32e2130db4dc1aa402a31cfd6d519544b3', class: "s-order-options-modal-subtitle" }, this.subtitle), h("div", { key: 'fffe868427973b6426b8a2f8f33f48c017dfb7fb', class: "s-order-options-modal-fields" }, this.orderOptions.length > 0 && (h("salla-product-options", { key: this.sessionId, ref: el => {
|
|
201
|
+
if (!el)
|
|
202
|
+
return;
|
|
203
|
+
this.optionsRefs.set('order-options', el);
|
|
204
|
+
// Without seeding, first multi-select toggle wipes pre-selected defaults.
|
|
205
|
+
el.seedSelectedOptions?.();
|
|
206
|
+
}, "product-id": `order-options-${this.orderOptions[0]?.id}`, "unique-key": "order-options", options: JSON.stringify(this.orderOptions), "hide-out-label": "1", "no-padding": true })))), h("div", { key: '36f3a18380f05a8420d4bc32fa643bf596ac16fb', slot: "footer", class: "s-order-options-modal-footer" }, this.paymentMode === 'apple-pay' ? (h("div", { class: "s-order-options-modal-apple-pay-wrap" }, h("div", { class: "s-order-options-modal-apple-pay-total" }, h("span", { class: "s-order-options-modal-apple-pay-label" }, this.totalLabel), h("span", { class: "s-order-options-modal-apple-pay-amount", innerHTML: totalHtml })), h("apple-pay-button", { locale: salla?.config?.get?.('user.language_code') || 'ar', buttonstyle: "black", type: "buy", class: "s-order-options-modal-apple-pay", onClick: () => this.handleSubmit() }))) : (h("salla-button", { type: "button", color: "primary", fill: "solid", width: "wide", loading: this.isSubmitting, onClick: () => this.handleSubmit() }, h("span", { class: "s-order-options-modal-cta-content" }, h("span", { class: "s-order-options-modal-cta-text" }, this.submitLabel), h("span", { class: "s-order-options-modal-cta-total", innerHTML: totalHtml })))))));
|
|
207
|
+
}
|
|
208
|
+
static get is() { return "salla-order-options-modal"; }
|
|
209
|
+
static get originalStyleUrls() {
|
|
210
|
+
return {
|
|
211
|
+
"$": ["salla-order-options-modal.scss"]
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
static get styleUrls() {
|
|
215
|
+
return {
|
|
216
|
+
"$": ["salla-order-options-modal.css"]
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
static get states() {
|
|
220
|
+
return {
|
|
221
|
+
"orderOptions": {},
|
|
222
|
+
"basePrice": {},
|
|
223
|
+
"liveTotal": {},
|
|
224
|
+
"isSubmitting": {},
|
|
225
|
+
"sessionId": {},
|
|
226
|
+
"paymentMode": {},
|
|
227
|
+
"title": {},
|
|
228
|
+
"subtitle": {},
|
|
229
|
+
"submitLabel": {},
|
|
230
|
+
"totalLabel": {},
|
|
231
|
+
"requiredMessage": {}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
static get methods() {
|
|
235
|
+
return {
|
|
236
|
+
"open": {
|
|
237
|
+
"complexType": {
|
|
238
|
+
"signature": "(payload: { orderOptions: any[]; basePrice?: number; paymentMode?: \"default\" | \"apple-pay\"; onSubmit?: (orderOptions: OrderOptionEntry[], total: number) => void; }) => Promise<{ orderOptions: OrderOptionEntry[]; }>",
|
|
239
|
+
"parameters": [{
|
|
240
|
+
"name": "payload",
|
|
241
|
+
"type": "{ orderOptions: any[]; basePrice?: number; paymentMode?: \"default\" | \"apple-pay\"; onSubmit?: (orderOptions: OrderOptionEntry[], total: number) => void; }",
|
|
242
|
+
"docs": ""
|
|
243
|
+
}],
|
|
244
|
+
"references": {
|
|
245
|
+
"Promise": {
|
|
246
|
+
"location": "global",
|
|
247
|
+
"id": "global::Promise"
|
|
248
|
+
},
|
|
249
|
+
"OrderOptionEntry": {
|
|
250
|
+
"location": "local",
|
|
251
|
+
"path": "/home/runner/_work/twilight/twilight/packages/twilight-components/src/components/salla-order-options-modal/salla-order-options-modal.tsx",
|
|
252
|
+
"id": "src/components/salla-order-options-modal/salla-order-options-modal.tsx::OrderOptionEntry"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"return": "Promise<{ orderOptions: OrderOptionEntry[]; }>"
|
|
256
|
+
},
|
|
257
|
+
"docs": {
|
|
258
|
+
"text": "Open the modal. Resolves with selections on submit; rejects on dismiss.\n`onSubmit` fires sync in the submit click (for Apple Pay user-gesture).\n`paymentMode: 'apple-pay'` swaps the footer button for <apple-pay-button>.",
|
|
259
|
+
"tags": []
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"close": {
|
|
263
|
+
"complexType": {
|
|
264
|
+
"signature": "() => Promise<void>",
|
|
265
|
+
"parameters": [],
|
|
266
|
+
"references": {
|
|
267
|
+
"Promise": {
|
|
268
|
+
"location": "global",
|
|
269
|
+
"id": "global::Promise"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"return": "Promise<void>"
|
|
273
|
+
},
|
|
274
|
+
"docs": {
|
|
275
|
+
"text": "",
|
|
276
|
+
"tags": []
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
static get elementRef() { return "host"; }
|
|
282
|
+
}
|
|
@@ -62,7 +62,7 @@ export class SallaOrderSummary {
|
|
|
62
62
|
this.copyCodeButtonTimeout && clearTimeout(this.copyCodeButtonTimeout);
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return (h("ul", { key: '
|
|
65
|
+
return (h("ul", { key: 'c95c9ab867fda65d1db9e61addec2e5f8e5135a6', class: "s-order-summary-wrapper" }, this.noItemFound ? h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" })) :
|
|
66
66
|
this.order_items.map((item) => (this.isDigitalCard(item) ? (h("li", { key: item.product.id, class: "s-order-summary-item" }, h("h2", { class: "s-order-summary-item-title" }, this.codes_text, " (", item.name, ")"), item.codes.map((code) => (h("div", { key: code.code, class: "s-order-summary-code-item-wrapper" }, h("p", null, h("span", { innerHTML: iconCreditCard }), h("span", null, code.code)), h("salla-button", { class: `s-order-summary-item-copy-button ${this.codeCopied === code.code ? 'copied' : ''}`, onClick: () => this.copyToClipboardHandler(code.code), shape: "link" }, h("span", { innerHTML: this.codeCopied === code.code ? iconCheck : iconCopy }), h("span", null, this.copy_text))))))) :
|
|
67
67
|
this.isDigitalProduct(item) ? (h("li", { key: item.product.id, class: "s-order-summary-item" }, h("h2", { class: "s-order-summary-item-title" }, this.files_text, " (", item.name, ")"), h("ul", null, item.files.map((file) => (h("li", { class: "s-order-summary-digital-item-wrapper" }, h("div", null, h("span", { innerHTML: iconFileArchive }), h("span", null, file.name)), h("a", { href: file.url, target: "_blank", class: "s-order-summary-item-download" }, h("span", { innerHTML: iconDownload }), h("span", null, this.download_text)))))))) : null))));
|
|
68
68
|
}
|
|
@@ -35,12 +35,12 @@ export class SallaPayments {
|
|
|
35
35
|
render() {
|
|
36
36
|
const madeInKSA = !this.exclude.includes('made-in-ksa') && salla.config.get('store.settings.made_in_ksa');
|
|
37
37
|
const sbcId = this.exclude.includes('sbc') ? null : salla.config.get('store.settings.certificate.id');
|
|
38
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: 'dcf34aa7bf20914e9413c39c5429b66067a29ec5', class: "s-payments-list-wrap" }, h("ul", { key: '523fef26ce20eedcdbf2701f64f0be3ee04dc62a', class: "s-payments-list" }, madeInKSA && h("li", { key: 'feb443128cf1820f22b076acd10681e5a3b401c8', class: "s-payments-list-item" }, h("img", { key: 'c82b844706cd47ee4633ea896352611defe21685', width: 58, height: 58, decoding: "async", loading: "lazy", src: salla.url.cdn(`images/made-in-ksa.svg`, 58, 58), alt: "made in KSA certified" })), this.payments.map((payment) => (payment == "cod" ?
|
|
39
39
|
h("div", { id: "cod-slot", innerHTML: this.codSlot
|
|
40
40
|
.replace(/\{image\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 58, 58)) }) :
|
|
41
41
|
h("div", { id: "payment-slot", innerHTML: this.paymentSlot
|
|
42
42
|
.replace(/\{image\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 58, 58))
|
|
43
|
-
.replace(/\{payment\}/g, payment) }))), sbcId && h("div", { key: '
|
|
43
|
+
.replace(/\{payment\}/g, payment) }))), sbcId && h("div", { key: 'c439bed0cf4cf57c206a44008b4daaaa28559e2f', id: "sbc-slot", innerHTML: this.sbcSlot
|
|
44
44
|
.replace(/\{image\}/g, salla.url.cdn(`images/sbc.png`, 58, 58))
|
|
45
45
|
.replace(/\{link\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${sbcId}`) }))));
|
|
46
46
|
}
|
|
@@ -35,7 +35,7 @@ export class SallaPlaceholder {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: 'f2fb77ca80d28fcc5f5505f4588bef72a4a26690', class: this.alignmentClass() }, h("div", { key: 'b2a1b41baf2a78087fd1f41f2f7244a36eb20846', class: `s-placeholder-icon s-placeholder-icon-${this.iconSize}`, innerHTML: this.icon }), h("div", { key: '65d106c0700890b7033ffb17ad7497db11cbdc65', class: "s-placeholder-title" }, h("slot", { key: 'aaa421d74b1c1c7e506adaee5efd6e7e1fe367e9', name: 'title' }, h("span", { key: '5e8232ebceffa33a1a997faf302e66f7f7d6112d' }, salla.lang.get('common.elements.no_options')))), h("div", { key: '47f7267ff9aef10baff8a5d555cd116c569790c9', class: "s-placeholder-description" }, h("slot", { key: '8f54838b8258e2f2a42a0da120186a9a7b71503f', name: 'description' }, h("span", { key: '6a5b79c1a69449ea4cd20d96f6149dfe89425ec3' }, salla.lang.get('common.errors.empty_results'))))));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "salla-placeholder"; }
|
|
41
41
|
static get originalStyleUrls() {
|
|
@@ -146,9 +146,9 @@ export class SallaPriceRange {
|
|
|
146
146
|
this.maxPrice = value === undefined ? '' : value;
|
|
147
147
|
}
|
|
148
148
|
render() {
|
|
149
|
-
return (h(Host, { key: '
|
|
149
|
+
return (h(Host, { key: 'ecc44cf63ea7788f00aa33a19c06579c887c59dd' }, this.filterValues.map((filterValue, index) => {
|
|
150
150
|
return h("label", { class: "s-filters-label", htmlFor: `${this.option.key}-${index}`, key: index }, h("input", { id: `${this.option.key}-${index}`, name: "price", type: "radio", checked: this.isChecked(filterValue), class: "s-filters-radio", onChange: e => this.handleMinMaxPrice(e, filterValue) }), h("span", { innerHTML: this.getPriceLabel(filterValue) }));
|
|
151
|
-
}), h("div", { key: '
|
|
151
|
+
}), h("div", { key: 'c4b6d75b11a2625f429caf6bba9e0dd625f6f646', class: "flex justify-center items-center" }, h("div", { key: '4e85f9c05415daf235ab965ebe185c7171f08e06', class: "relative max-w-xl w-full" }, h("div", { key: '44b7747bfa4ec0e46da70dcf25f5325562bb0be9', class: "s-price-range-inputs" }, h("div", { key: '08a9afa0ea579f31eba87561283162b1d47f123f', class: "s-price-range-relative" }, h("div", { key: '54540065c16484f01e356fb2094f3163357ffd95', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), h("input", { key: '851b957d076c25808edba4e763ae31286047782f', type: "number", maxlength: "5", ref: el => this.minInput = el, onBlur: (e) => this.handleMinPrice(e), value: this.minPrice, placeholder: this.fromLabel, class: "s-price-range-number-input" })), h("div", { key: 'f8a910aca554ae21657a19115d7f9607efb0566d', class: "s-price-range-gray-text" }, " -"), h("div", { key: '7d1561634459c15862bc0455b4bd9248d44a8446', class: "s-price-range-relative" }, h("div", { key: '7ca1fb8056b8af71f6f57524ed9d5fdfdc641ef2', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), h("input", { key: 'e6411b0e1b0e36b45a6879c1b257f394ec94007f', type: "number", maxlength: "5", ref: el => this.maxInput = el, onBlur: (e) => this.handleMaxPrice(e), value: this.maxPrice, placeholder: this.toLabel, class: "s-price-range-number-input", "aria-describedby": "price-currency" })), h("salla-button", { key: '63bc422c8d82c820bd984d5af68f8081add164c3', color: 'gray', shape: 'icon', size: 'small', fill: 'outline', onClick: (event) => this.changedEventHandler(event) }, h("span", { key: 'b81d3813cb2ff9523f232cf0a615c58576b14177', innerHTML: this.isRTL ? arrowLeft : arrowRight })))))));
|
|
152
152
|
}
|
|
153
153
|
componentDidLoad() {
|
|
154
154
|
this.isReady = true;
|
|
@@ -137,7 +137,7 @@ export class SallaProductAvailability {
|
|
|
137
137
|
field.nextElementSibling['innerText'] = '* ' + errorMsg;
|
|
138
138
|
}
|
|
139
139
|
render() {
|
|
140
|
-
return (h(Host, { key: '
|
|
140
|
+
return (h(Host, { key: '0779c3aef2637bfcd30ecf110d0cd31d819a82a5', class: "s-product-availability-wrap" }, this.isSubscribedToProduct
|
|
141
141
|
? h("div", { class: "s-product-availability-subscribed" }, h("span", { innerHTML: BellRingIcon, class: "s-product-availability-subs-icon" }), salla.lang.get('pages.products.notify_availability_success'))
|
|
142
142
|
:
|
|
143
143
|
h("salla-button", { width: "wide", onClick: () => this.isUser ? this.submit() : this.openModel() }, salla.lang.get('pages.products.notify_availability')), this.isUser || this.isSubscribedToProduct ? '' : this.renderModal()));
|
|
@@ -105,14 +105,14 @@ export class SallaProductCard {
|
|
|
105
105
|
's-product-card-out-of-stock': this.productData?.is_out_of_stock,
|
|
106
106
|
};
|
|
107
107
|
const hrefProp = this.productData?.url ? { href: this.productData.url, title: `Learn more about ${this.productData?.name}` } : {};
|
|
108
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: '0f4b4f64ee342da10905dee73db8a2b4bebdfc9e', id: `product-${this.productData?.id}`, class: classes }, h("div", { key: 'ed5cfb208c6241ca6ccd2c8f2205f76d1f81ca2a', class: !this.fullImage ? 's-product-card-image' : 's-product-card-image-full' }, h("a", { key: '865376db3deadd97c23480e9226a50abe9371284', ...hrefProp }, h("img", { key: 'ad314a97956853e26b3a3c4ecb9f1d427bf748fb', class: `s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)
|
|
109
109
|
? 'contain'
|
|
110
110
|
: this.fitImageHeight
|
|
111
111
|
? this.fitImageHeight
|
|
112
|
-
: 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && h("a", { key: '
|
|
113
|
-
h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, h("span", { innerHTML: Heart })) : ''), h("div", { key: '
|
|
112
|
+
: 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && h("a", { key: 'eef3edab8f4cc75c385928dcdbd9d29c318b68cc', ...hrefProp, class: "s-product-card-overlay" }), !this.horizontal && !this.fullImage ?
|
|
113
|
+
h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, h("span", { innerHTML: Heart })) : ''), h("div", { key: '208f74738cd81bb68ec63f4fdadedbd9b19e6dad', class: "s-product-card-content" }, this.isSpecial && this.productData?.quantity ?
|
|
114
114
|
h("div", { class: "s-product-card-content-pie", ref: pie => this.pie = pie }, h("span", null, h("b", null, salla.helpers.number(this.productData?.quantity)), this.remained), h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -1 36 34", class: "s-product-card-content-pie-svg" }, h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-base" }), h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-bar" })))
|
|
115
|
-
: '', h("div", { key: '
|
|
115
|
+
: '', h("div", { key: '6b00056661ebe29db89377f858bfefda80ed365f', class: { 's-product-card-content-main': true, 's-product-card-content-extra-padding': this.isSpecial } }, h("h3", { key: 'a1a7a2d363a009c3254df7728e80f958be76a012', class: "s-product-card-content-title" }, h("a", { key: 'c3c8a4b862cf6a0b78bafb6f30bd5a04d437257d', ...hrefProp }, this.productData?.name)), this.productData?.subtitle && !this.minimal ?
|
|
116
116
|
h("p", { class: "s-product-card-content-subtitle" }, this.productData?.subtitle)
|
|
117
117
|
: ''), this.productData?.donation && !this.minimal && !this.fullImage ?
|
|
118
118
|
[h("salla-progress-bar", { donation: this.productData?.donation }), h("div", { class: "s-product-card-donation-input" }, this.productData?.donation?.can_donate ?
|
|
@@ -121,7 +121,7 @@ export class SallaProductCard {
|
|
|
121
121
|
this.addBtn.donatingAmount = e.target.value;
|
|
122
122
|
}, id: "donation-amount", name: "donating_amount", class: "s-form-control", placeholder: this.donationAmount })]
|
|
123
123
|
: '')]
|
|
124
|
-
: '', h("div", { key: '
|
|
124
|
+
: '', h("div", { key: '2ab7701aac64f90667627f0a0b3bfc031e30d835', class: { 's-product-card-content-sub': true, 's-product-card-content-extra-padding': this.isSpecial } }, this.getProductPrice(), this.productData?.rating?.stars && !this.minimal ?
|
|
125
125
|
h("div", { class: "s-product-card-rating" }, h("span", { innerHTML: Star }), h("span", null, this.productData.rating.stars))
|
|
126
126
|
: ''), this.isSpecial && this.productData.discount_ends
|
|
127
127
|
? h("salla-count-down", { date: this.formatDate(this.productData.discount_ends), "end-of-day": true, boxed: true, labeled: true })
|