@salla.sa/twilight-components 2.14.563 → 2.14.565
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/{apple-pay-order-options-DVyeUqBh.js → apple-pay-order-options-B036Wu4O.js} +15 -6
- package/dist/cjs/{filepond-DDjPDNMW.js → filepond-BOtBFq7k.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BVNh-Hu4.js → filepond-plugin-file-poster-DWqXLSRO.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-Oob5x06X.js → filepond-plugin-file-validate-size-TkDVc9ih.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-WxO8IEZf.js → filepond-plugin-file-validate-type-B1TuLFJS.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-Btg3AmB2.js → filepond-plugin-image-edit-BtLH803a.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-B1eJhME_.js → filepond-plugin-image-exif-orientation-BJvccc13.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Cu5NsVcD.js → filepond-plugin-image-preview-DPgKIIC8.js} +1 -1
- package/dist/cjs/{index-Dm01liwE.js → index-BZ_aKmCD.js} +6 -6
- package/dist/cjs/{intlTelInput-mcmUzBhl.js → intlTelInput-CKLiJAA1.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 +3 -3
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +98 -18
- 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-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +18 -18
- package/dist/cjs/salla-badge.cjs.entry.js +2 -2
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +46 -18
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +4 -4
- 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_2.cjs.entry.js +231 -42
- 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 +4 -4
- 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_10.cjs.entry.js +15 -15
- package/dist/cjs/salla-loyalty-exchange-product-card.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.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
- package/dist/cjs/salla-map_3.cjs.entry.js +4 -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_2.cjs.entry.js +2 -2
- 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-cancel.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-order-shipments.cjs.entry.js +1 -1
- 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-card.cjs.entry.js +6 -6
- 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-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +2 -2
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- 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/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-D0r86yPu.js → vanilla-picker-C7y_2HXu.js} +1 -1
- 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 +2 -2
- 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-bullet-delivery/salla-bullet-delivery.css +7 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +40 -12
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +2 -2
- 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-exchange-product-card.js +2 -2
- 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 +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 +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 +15 -6
- package/dist/collection/components/salla-order-options-modal/free-product-payload.js +49 -0
- package/dist/collection/components/salla-order-options-modal/order-options-gate.js +33 -8
- package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.css +192 -15
- package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.js +260 -48
- 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-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 +15 -5
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- 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/apple-pay-order-options.js +15 -6
- package/dist/components/index.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 +35 -11
- 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-bullet-delivery.js +41 -13
- package/dist/components/salla-cart-coupons.js +2 -2
- 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 +1 -1
- 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-exchange-product-card2.js +2 -2
- package/dist/components/salla-loyalty-hero2.js +3 -3
- package/dist/components/salla-loyalty-point2.js +4 -4
- 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-reward.js +2 -2
- 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 +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 +1 -1
- 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-modal2.js +234 -40
- 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 +5 -5
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input2.js +1 -1
- package/dist/components/salla-quick-buy2.js +62 -6
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-review-factors-tags2.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reward-card2.js +1 -1
- package/dist/components/salla-reward-details2.js +3 -3
- package/dist/components/salla-reward-exchange2.js +1 -1
- 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 +1 -1
- 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/{apple-pay-order-options-Bg2HuLRr.js → apple-pay-order-options-s0kn7yr8.js} +15 -6
- package/dist/esm/{filepond-CY6pyFip.js → filepond-UQa5G279.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CB4IOEW6.js → filepond-plugin-file-poster-DuTq7hGp.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CGmjBUqY.js → filepond-plugin-file-validate-size-CmrW5aIv.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-44ynhS6w.js → filepond-plugin-file-validate-type-C4wrsR8y.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BaOXEOuD.js → filepond-plugin-image-edit-CFUxRm-l.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CswLPc6C.js → filepond-plugin-image-exif-orientation-eHT2qXpP.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DzvMpIJw.js → filepond-plugin-image-preview-CX0Er_bj.js} +1 -1
- package/dist/esm/{index-GfnuORRm.js → index-BC0OSCdw.js} +6 -6
- package/dist/esm/{intlTelInput-Cb2bEpkc.js → intlTelInput-DnPEdiN8.js} +1 -1
- 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 +3 -3
- package/dist/esm/salla-add-product-button_5.entry.js +98 -18
- 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-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +18 -18
- package/dist/esm/salla-badge.entry.js +2 -2
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +46 -18
- package/dist/esm/salla-cart-coupons.entry.js +3 -3
- package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +4 -4
- 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_2.entry.js +231 -42
- 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 +4 -4
- 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_10.entry.js +15 -15
- package/dist/esm/salla-loyalty-exchange-product-card.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.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +2 -2
- package/dist/esm/salla-map_3.entry.js +4 -4
- 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_2.entry.js +2 -2
- 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-cancel.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-order-shipments.entry.js +1 -1
- 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-card.entry.js +6 -6
- 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-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +2 -2
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +2 -2
- 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/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-Dn1KYUfg.js → vanilla-picker-BCMDEwEz.js} +1 -1
- package/dist/twilight/{p-ddc4c979.entry.js → p-00ade9ab.entry.js} +1 -1
- package/dist/twilight/{p-b108585a.entry.js → p-02b4c53f.entry.js} +1 -1
- package/dist/twilight/{p-a0ebb943.entry.js → p-040a60fa.entry.js} +1 -1
- package/dist/twilight/{p-eaf6405f.entry.js → p-077bba56.entry.js} +1 -1
- package/dist/twilight/p-08283d58.entry.js +4 -0
- package/dist/twilight/{p-c51e2840.entry.js → p-092e3574.entry.js} +1 -1
- package/dist/twilight/{p-9fe06cfd.entry.js → p-0ce7ec43.entry.js} +1 -1
- package/dist/twilight/{p-9420d204.entry.js → p-0cff28ab.entry.js} +1 -1
- package/dist/twilight/{p-a37c0015.entry.js → p-128c99f8.entry.js} +1 -1
- package/dist/twilight/{p-24a13f9a.entry.js → p-12d5856d.entry.js} +1 -1
- package/dist/twilight/{p-3bbcf3b5.entry.js → p-1678e509.entry.js} +1 -1
- package/dist/twilight/{p-0ccb9482.entry.js → p-1b61fdb7.entry.js} +1 -1
- package/dist/twilight/{p-79eca83e.entry.js → p-1c5df94c.entry.js} +1 -1
- package/dist/twilight/{p-4701b1db.entry.js → p-1e3f96f6.entry.js} +1 -1
- package/dist/twilight/{p-836528db.entry.js → p-217e8d6b.entry.js} +1 -1
- package/dist/twilight/{p-722afe08.entry.js → p-22454aab.entry.js} +1 -1
- package/dist/twilight/{p-15c3013e.entry.js → p-28cadf49.entry.js} +1 -1
- package/dist/twilight/p-29683d1e.entry.js +4 -0
- package/dist/twilight/{p-BwCPM9Ea.js → p-2LY0VWl8.js} +1 -1
- package/dist/twilight/{p-1494774e.entry.js → p-2ade195d.entry.js} +1 -1
- package/dist/twilight/{p-2b11beb9.entry.js → p-2c3bd065.entry.js} +1 -1
- package/dist/twilight/{p-b0c7b762.entry.js → p-2ddf12c9.entry.js} +1 -1
- package/dist/twilight/{p-9070affa.entry.js → p-2e68382e.entry.js} +1 -1
- package/dist/twilight/{p-0478a9d7.entry.js → p-39df1337.entry.js} +1 -1
- package/dist/twilight/{p-9b4ac3ed.entry.js → p-3cae6c0b.entry.js} +1 -1
- package/dist/twilight/{p-46a6e2f3.entry.js → p-3ccaf56b.entry.js} +1 -1
- package/dist/twilight/{p-d7bd8af5.entry.js → p-477fbe60.entry.js} +1 -1
- package/dist/twilight/{p-97ad1b5a.entry.js → p-4e53c800.entry.js} +1 -1
- package/dist/twilight/{p-ff54150b.entry.js → p-4ec4c29d.entry.js} +1 -1
- package/dist/twilight/p-4f9e25a2.entry.js +4 -0
- package/dist/twilight/{p-2c721e1a.entry.js → p-4fe6b957.entry.js} +1 -1
- package/dist/twilight/{p-f4b1dd6e.entry.js → p-512dffba.entry.js} +1 -1
- package/dist/twilight/{p-0c5747b1.entry.js → p-5258eb5b.entry.js} +1 -1
- package/dist/twilight/{p-2c00673b.entry.js → p-52abc216.entry.js} +1 -1
- package/dist/twilight/{p-46992827.entry.js → p-55c0c4d5.entry.js} +1 -1
- package/dist/twilight/{p-81dcaf69.entry.js → p-55ecefaf.entry.js} +1 -1
- package/dist/twilight/{p-d142c7d2.entry.js → p-5912c685.entry.js} +1 -1
- package/dist/twilight/{p-65d1043b.entry.js → p-596695cb.entry.js} +1 -1
- package/dist/twilight/{p-e9fe2027.entry.js → p-59a7515b.entry.js} +1 -1
- package/dist/twilight/{p-28ce2f83.entry.js → p-5aff8807.entry.js} +1 -1
- package/dist/twilight/p-5de36f11.entry.js +4 -0
- package/dist/twilight/{p-e23cd8b4.entry.js → p-60f4c8b0.entry.js} +1 -1
- package/dist/twilight/{p-ef20497a.entry.js → p-66460e90.entry.js} +1 -1
- package/dist/twilight/{p-deec864c.entry.js → p-6ef17286.entry.js} +1 -1
- package/dist/twilight/{p-6c27051d.entry.js → p-6fe42bfe.entry.js} +1 -1
- package/dist/twilight/{p-35c011ed.entry.js → p-717258c4.entry.js} +1 -1
- package/dist/twilight/{p-bd56d44c.entry.js → p-73795f51.entry.js} +1 -1
- package/dist/twilight/{p-c1baa245.entry.js → p-77540bba.entry.js} +1 -1
- package/dist/twilight/{p-c84cc730.entry.js → p-7785635d.entry.js} +1 -1
- package/dist/twilight/{p-24e0386e.entry.js → p-77a708f4.entry.js} +1 -1
- package/dist/twilight/{p-1b10f9dc.entry.js → p-7a7b9917.entry.js} +1 -1
- package/dist/twilight/{p-2ad08012.entry.js → p-810fca9f.entry.js} +1 -1
- package/dist/twilight/{p-33513478.entry.js → p-84aa1f0f.entry.js} +1 -1
- package/dist/twilight/{p-8b781b69.entry.js → p-85df7952.entry.js} +1 -1
- package/dist/twilight/{p-a916380a.entry.js → p-8628e5d7.entry.js} +1 -1
- package/dist/twilight/{p-d53cf9bd.entry.js → p-87638789.entry.js} +1 -1
- package/dist/twilight/{p-6afefa1b.entry.js → p-8872ae84.entry.js} +1 -1
- package/dist/twilight/p-8b6d7dbc.entry.js +4 -0
- package/dist/twilight/{p-87ab3986.entry.js → p-8bd738dd.entry.js} +1 -1
- package/dist/twilight/{p-9d304f36.entry.js → p-8e3ceb05.entry.js} +1 -1
- package/dist/twilight/{p-1fb98623.entry.js → p-8ea86806.entry.js} +1 -1
- package/dist/twilight/{p-1f46c7f4.entry.js → p-913f0e67.entry.js} +1 -1
- package/dist/twilight/{p-60307b84.entry.js → p-928bdd13.entry.js} +1 -1
- package/dist/twilight/{p-83ddc4e1.entry.js → p-94bab301.entry.js} +1 -1
- package/dist/twilight/{p-0ae5c8c4.entry.js → p-9549fe7d.entry.js} +1 -1
- package/dist/twilight/{p-DKRQn16d.js → p-B4qhqpMO.js} +1 -1
- package/dist/twilight/p-BC0OSCdw.js +5 -0
- package/dist/twilight/{p-CaG1mvtI.js → p-BQ2uPuvt.js} +1 -1
- package/dist/twilight/p-BqsrYTv0.js +9 -0
- package/dist/twilight/{p-DWBrx3up.js → p-CJ9itb04.js} +1 -1
- package/dist/twilight/{p-Y8Y3Lce-.js → p-CbE9Aa2n.js} +1 -1
- package/dist/twilight/{p-BOL1voLy.js → p-Cfn7Ybxi.js} +1 -1
- package/dist/twilight/{p-CktZCPMt.js → p-DdkjVgyM.js} +1 -1
- package/dist/twilight/{p-BJIMNMji.js → p-Dz1PaIS6.js} +1 -1
- package/dist/twilight/{p-eb43d534.entry.js → p-a4bea3d2.entry.js} +1 -1
- package/dist/twilight/{p-5f96b566.entry.js → p-a72038c1.entry.js} +1 -1
- package/dist/twilight/{p-e32cef83.entry.js → p-a7340ba8.entry.js} +1 -1
- package/dist/twilight/{p-3d3ae480.entry.js → p-a94e4fc8.entry.js} +1 -1
- package/dist/twilight/{p-bc2766e2.entry.js → p-ad92b347.entry.js} +1 -1
- package/dist/twilight/{p-fc4b2479.entry.js → p-b65a15cb.entry.js} +1 -1
- package/dist/twilight/p-b92eb535.entry.js +4 -0
- package/dist/twilight/{p-caa21010.entry.js → p-bb8f6167.entry.js} +1 -1
- package/dist/twilight/{p-8eafdb6b.entry.js → p-bbfd1991.entry.js} +1 -1
- package/dist/twilight/{p-76bbf673.entry.js → p-beb9023e.entry.js} +1 -1
- package/dist/twilight/{p-e7d359d0.entry.js → p-ca540632.entry.js} +1 -1
- package/dist/twilight/{p-43ddc1a9.entry.js → p-d32ba4d6.entry.js} +1 -1
- package/dist/twilight/{p-9755cd5c.entry.js → p-dbe87ffe.entry.js} +1 -1
- package/dist/twilight/{p-4f5734c8.entry.js → p-dd4e8765.entry.js} +1 -1
- package/dist/twilight/{p-435538fc.entry.js → p-de3cd06e.entry.js} +1 -1
- package/dist/twilight/{p-fe28663a.entry.js → p-e0600f10.entry.js} +1 -1
- package/dist/twilight/{p-2a56105f.entry.js → p-e0a3937a.entry.js} +1 -1
- package/dist/twilight/{p-a69fada2.entry.js → p-e5ae8c3b.entry.js} +1 -1
- package/dist/twilight/{p-eb3b0f9a.entry.js → p-e67ba69c.entry.js} +1 -1
- package/dist/twilight/p-e77d4dbc.entry.js +4 -0
- package/dist/twilight/{p-d465b5f4.entry.js → p-eb5d5edc.entry.js} +1 -1
- package/dist/twilight/{p-119c92ea.entry.js → p-ed39f8fd.entry.js} +1 -1
- package/dist/twilight/{p-a8bd25ca.entry.js → p-f1b8972a.entry.js} +1 -1
- package/dist/twilight/{p-09adb410.entry.js → p-f66a6f43.entry.js} +1 -1
- package/dist/twilight/{p-08b78fdb.entry.js → p-f9aa9b5b.entry.js} +1 -1
- package/dist/twilight/{p-1a3b5964.entry.js → p-f9d778ec.entry.js} +1 -1
- package/dist/twilight/{p-5f6e61c1.entry.js → p-fcf32a4c.entry.js} +25 -25
- package/dist/twilight/{p-fc04f809.entry.js → p-fd38337e.entry.js} +1 -1
- package/dist/twilight/p-s0kn7yr8.js +4 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-order-options-modal/apple-pay-order-options.d.ts +9 -4
- package/dist/types/components/salla-order-options-modal/free-product-payload.d.ts +19 -0
- package/dist/types/components/salla-order-options-modal/order-options-gate.d.ts +11 -1
- package/dist/types/components/salla-order-options-modal/salla-order-options-modal.d.ts +76 -21
- package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +2 -0
- package/dist/types/components.d.ts +59 -22
- package/package.json +5 -5
- package/dist/twilight/p-1e1ba8b7.entry.js +0 -4
- package/dist/twilight/p-2f76a067.entry.js +0 -4
- package/dist/twilight/p-9c50b57e.entry.js +0 -4
- package/dist/twilight/p-Bg2HuLRr.js +0 -4
- package/dist/twilight/p-GfnuORRm.js +0 -5
- package/dist/twilight/p-a1a4a1a8.entry.js +0 -4
- package/dist/twilight/p-bf4174b7.entry.js +0 -4
- package/dist/twilight/p-e2e741f7.entry.js +0 -4
- package/dist/twilight/p-fba00709.entry.js +0 -4
- package/dist/twilight/p-m9gfUJP2.js +0 -9
|
@@ -3,12 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h } from "@stencil/core";
|
|
5
5
|
/**
|
|
6
|
-
* Modal that collects
|
|
6
|
+
* Modal that collects order options and/or free product options before checkout.
|
|
7
|
+
*
|
|
8
|
+
* Wizard mode (CP-2836): when free products are provided alongside orderOptions, the modal
|
|
9
|
+
* runs one step per free product Y, then a final step for the store-level order options:
|
|
10
|
+
* Steps 1..N — free product Y card + its product options (inFreeStep drives this)
|
|
11
|
+
* Step N+1 — store-level order options (inFreeStep cleared, orderOptions swapped)
|
|
12
|
+
*
|
|
13
|
+
* `advance_free_product` is a LIST — one entry per qualifying offer, ordered by the offer's
|
|
14
|
+
* effective priority and capped by the store's offers limit — so N is not always 1.
|
|
15
|
+
*
|
|
16
|
+
* Single-step mode (CHOD-11650 compat): no free products → original behavior.
|
|
7
17
|
*
|
|
8
18
|
* Usage:
|
|
9
|
-
* const
|
|
10
|
-
*
|
|
11
|
-
* //
|
|
19
|
+
* const { orderOptions, freeProducts } = await modal.open({
|
|
20
|
+
* orderOptions, // store-level order options (final step)
|
|
21
|
+
* freeProducts, // [{ product, options, offer_name, quantity }, ...] (optional)
|
|
22
|
+
* basePrice,
|
|
23
|
+
* });
|
|
24
|
+
* // freeProducts = [{ productId, quantity, options: { [optionId]: value } }, ...]
|
|
12
25
|
*/
|
|
13
26
|
export class SallaOrderOptionsModal {
|
|
14
27
|
constructor() {
|
|
@@ -16,20 +29,48 @@ export class SallaOrderOptionsModal {
|
|
|
16
29
|
this.rejectFn = null;
|
|
17
30
|
this.optionsRefs = new Map();
|
|
18
31
|
this.changeHandler = null;
|
|
19
|
-
/** Sync hook for callers that need to act under the submit user gesture (Apple Pay). */
|
|
20
32
|
this.submitCallback = null;
|
|
33
|
+
/** Wizard bookkeeping — not @State, only used for logic */
|
|
34
|
+
this._realOrderOptions = [];
|
|
35
|
+
this._collectedFreeOptions = [];
|
|
36
|
+
this._isWizard = false;
|
|
37
|
+
/** Pending free-product steps and where we are in them. */
|
|
38
|
+
this._freeQueue = [];
|
|
39
|
+
this._freeIndex = 0;
|
|
40
|
+
this._collectedFreeProducts = [];
|
|
41
|
+
/**
|
|
42
|
+
* The product's own price, held across the wizard. Gift steps show a 0 base (the gift is
|
|
43
|
+
* free), so without this the final total — which Apple Pay charges — would omit the product.
|
|
44
|
+
*/
|
|
45
|
+
this._orderBasePrice = 0;
|
|
46
|
+
/** Surcharges picked on gift steps already left behind, folded into the final total. */
|
|
47
|
+
this._accumulatedExtra = 0;
|
|
48
|
+
/** @State — all rendering decisions are driven by these */
|
|
21
49
|
this.orderOptions = [];
|
|
22
50
|
this.basePrice = 0;
|
|
23
51
|
this.liveTotal = 0;
|
|
24
52
|
this.isSubmitting = false;
|
|
25
|
-
/** Bumped each open() so the inner <salla-product-options> remounts. */
|
|
26
53
|
this.sessionId = 0;
|
|
27
54
|
this.paymentMode = 'default';
|
|
55
|
+
/** Card data for the free product being configured right now (null on the final step). */
|
|
56
|
+
this.freeProduct = null;
|
|
57
|
+
/**
|
|
58
|
+
* True while a free-product step is active. Tracked separately from `freeProduct` so an
|
|
59
|
+
* entry that arrives without card data still runs as its own step instead of silently
|
|
60
|
+
* rendering as the order-options step.
|
|
61
|
+
*/
|
|
62
|
+
this.inFreeStep = false;
|
|
28
63
|
this.title = '';
|
|
29
64
|
this.subtitle = '';
|
|
30
65
|
this.submitLabel = '';
|
|
31
66
|
this.totalLabel = '';
|
|
32
67
|
this.requiredMessage = '';
|
|
68
|
+
// Hardcode Arabic defaults — salla.lang.get() returns the key string itself when a key is
|
|
69
|
+
// missing, so `|| fallback` never fires. Defaults here guarantee correct text even before
|
|
70
|
+
// translations load or when the keys don't exist in the store's language file yet.
|
|
71
|
+
this.freeProductTitle = 'خيارات المنتج المجاني';
|
|
72
|
+
this.freeProductSubtitle = 'اختر ما يناسبك من خيارات المنتج';
|
|
73
|
+
this.freeProductContinueLabel = 'تابع واحصل على هديتك الان';
|
|
33
74
|
this.handleClose = () => {
|
|
34
75
|
if (this.isSubmitting)
|
|
35
76
|
return;
|
|
@@ -44,41 +85,109 @@ export class SallaOrderOptionsModal {
|
|
|
44
85
|
componentWillLoad() {
|
|
45
86
|
this.loadTranslations();
|
|
46
87
|
}
|
|
88
|
+
/** True when the page reads right-to-left, so directional icons can mirror. */
|
|
89
|
+
isRtl() {
|
|
90
|
+
return document?.documentElement?.getAttribute('dir') === 'rtl';
|
|
91
|
+
}
|
|
92
|
+
/** Returns the translated value only when the key actually resolves (not the key string itself). */
|
|
93
|
+
t(key, fallback) {
|
|
94
|
+
const val = salla.lang.get(key);
|
|
95
|
+
return val && val !== key ? val : fallback;
|
|
96
|
+
}
|
|
47
97
|
loadTranslations() {
|
|
48
98
|
this.title = salla.lang.get('blocks.order_options.title');
|
|
49
99
|
this.subtitle = salla.lang.get('blocks.order_options.subtitle');
|
|
50
100
|
this.submitLabel = salla.lang.get('blocks.order_options.continue');
|
|
51
101
|
this.totalLabel = salla.lang.get('blocks.order_options.total');
|
|
52
102
|
this.requiredMessage = salla.lang.get('blocks.order_options.required_message');
|
|
103
|
+
this.freeProductTitle = this.t('pages.products.free_product_options_title', 'خيارات المنتج المجاني');
|
|
104
|
+
this.freeProductSubtitle = this.t('pages.products.free_product_options_subtitle', 'اختر ما يناسبك من خيارات المنتج');
|
|
105
|
+
this.freeProductContinueLabel = this.t('pages.products.free_product_cta', 'تابع واحصل على هديتك الان');
|
|
53
106
|
}
|
|
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
107
|
async open(payload) {
|
|
60
|
-
|
|
61
|
-
// `details`, which product-options dereferences unguarded.
|
|
62
|
-
this.orderOptions = (Array.isArray(payload.orderOptions) ? payload.orderOptions : [])
|
|
108
|
+
const normalize = (arr) => (Array.isArray(arr) ? arr : [])
|
|
63
109
|
.map((o) => ({ ...o, details: o.details ?? [] }));
|
|
64
|
-
|
|
65
|
-
|
|
110
|
+
const realOrderOptions = normalize(payload.orderOptions);
|
|
111
|
+
const freeQueue = this.buildFreeQueue(payload, normalize);
|
|
112
|
+
this._realOrderOptions = realOrderOptions;
|
|
113
|
+
this._collectedFreeOptions = [];
|
|
114
|
+
this._collectedFreeProducts = [];
|
|
115
|
+
this._freeQueue = freeQueue;
|
|
116
|
+
this._freeIndex = 0;
|
|
117
|
+
this._orderBasePrice = Number(payload.basePrice) || 0;
|
|
118
|
+
this._accumulatedExtra = 0;
|
|
119
|
+
// The step bar appears whenever there is more than one step to walk — N gifts alone
|
|
120
|
+
// still needs it, not just the gift + order-options pairing.
|
|
121
|
+
this._isWizard = (freeQueue.length + (realOrderOptions.length > 0 ? 1 : 0)) > 1;
|
|
66
122
|
this.isSubmitting = false;
|
|
67
|
-
this.sessionId++;
|
|
68
123
|
this.optionsRefs.clear();
|
|
69
124
|
this.submitCallback = payload.onSubmit ?? null;
|
|
70
125
|
this.paymentMode = payload.paymentMode ?? 'default';
|
|
126
|
+
if (freeQueue.length > 0) {
|
|
127
|
+
this.loadFreeStep(0);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
// Single step: store order options
|
|
131
|
+
this.sessionId++;
|
|
132
|
+
this.inFreeStep = false;
|
|
133
|
+
this.orderOptions = realOrderOptions;
|
|
134
|
+
this.freeProduct = null;
|
|
135
|
+
this.basePrice = Number(payload.basePrice) || 0;
|
|
136
|
+
this.liveTotal = this.basePrice + this.seedOptionsPrice(this.orderOptions);
|
|
137
|
+
}
|
|
71
138
|
await this.modal?.open();
|
|
139
|
+
// salla-modal reads modal-title once in its constructor (@State, not @Prop) so it
|
|
140
|
+
// won't react to attribute changes. Push the correct title imperatively after open().
|
|
141
|
+
this.modal?.setTitle(this.inFreeStep ? this.freeProductTitle : this.title);
|
|
72
142
|
this.attachChangeListener();
|
|
73
143
|
return new Promise((resolve, reject) => {
|
|
74
144
|
this.resolveFn = resolve;
|
|
75
145
|
this.rejectFn = reject;
|
|
76
146
|
});
|
|
77
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Normalize `freeProducts` (and the legacy single-gift pair) into the step queue.
|
|
150
|
+
* Entries without options are dropped — there is nothing to ask, and the offer still
|
|
151
|
+
* auto-adds that product with its defaults.
|
|
152
|
+
*/
|
|
153
|
+
buildFreeQueue(payload, normalize) {
|
|
154
|
+
const queue = [];
|
|
155
|
+
(Array.isArray(payload.freeProducts) ? payload.freeProducts : []).forEach((entry) => {
|
|
156
|
+
const options = normalize(entry?.options);
|
|
157
|
+
if (!options.length)
|
|
158
|
+
return;
|
|
159
|
+
queue.push({
|
|
160
|
+
product: entry?.product
|
|
161
|
+
? { ...entry.product, offer_name: entry.offer_name ?? entry.product.offer_name ?? null }
|
|
162
|
+
: null,
|
|
163
|
+
options,
|
|
164
|
+
// The offer decides how many of Y are granted.
|
|
165
|
+
quantity: Number(entry?.quantity) > 0 ? Number(entry.quantity) : 1,
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
if (queue.length)
|
|
169
|
+
return queue;
|
|
170
|
+
const legacyOptions = normalize(payload.freeProductOptions);
|
|
171
|
+
if (legacyOptions.length) {
|
|
172
|
+
queue.push({ product: payload.freeProduct ?? null, options: legacyOptions, quantity: 1 });
|
|
173
|
+
}
|
|
174
|
+
return queue;
|
|
175
|
+
}
|
|
176
|
+
/** Swap the modal onto free-product step `index`. */
|
|
177
|
+
loadFreeStep(index) {
|
|
178
|
+
const step = this._freeQueue[index];
|
|
179
|
+
this._freeIndex = index;
|
|
180
|
+
this.optionsRefs.clear();
|
|
181
|
+
this.inFreeStep = true;
|
|
182
|
+
this.orderOptions = step.options;
|
|
183
|
+
this.freeProduct = step.product;
|
|
184
|
+
this.basePrice = 0;
|
|
185
|
+
this.liveTotal = this.seedOptionsPrice(step.options);
|
|
186
|
+
this.sessionId++;
|
|
187
|
+
}
|
|
78
188
|
async close() {
|
|
79
189
|
await this.modal?.close();
|
|
80
190
|
}
|
|
81
|
-
/** Sync walk of inputs — avoids `await` through the @Method that would consume the AP user gesture. */
|
|
82
191
|
collectOrderOptionsSync() {
|
|
83
192
|
const result = [];
|
|
84
193
|
for (const [, el] of this.optionsRefs) {
|
|
@@ -86,9 +195,8 @@ export class SallaOrderOptionsModal {
|
|
|
86
195
|
continue;
|
|
87
196
|
const inputs = el.querySelectorAll('[name^="options["],[name*="[options]["]');
|
|
88
197
|
inputs.forEach((input) => {
|
|
89
|
-
if (input instanceof HTMLInputElement && (input.type === 'radio' || input.type === 'checkbox') && !input.checked)
|
|
198
|
+
if (input instanceof HTMLInputElement && (input.type === 'radio' || input.type === 'checkbox') && !input.checked)
|
|
90
199
|
return;
|
|
91
|
-
}
|
|
92
200
|
const match = input.name.match(/(?:^|\[)options\]?\[(\d+)\]/);
|
|
93
201
|
if (!match)
|
|
94
202
|
return;
|
|
@@ -104,7 +212,6 @@ export class SallaOrderOptionsModal {
|
|
|
104
212
|
}
|
|
105
213
|
return result;
|
|
106
214
|
}
|
|
107
|
-
/** Sync native validity — keeps the AP user gesture intact. */
|
|
108
215
|
validateSync() {
|
|
109
216
|
let pass = true;
|
|
110
217
|
for (const [, el] of this.optionsRefs) {
|
|
@@ -112,8 +219,6 @@ export class SallaOrderOptionsModal {
|
|
|
112
219
|
continue;
|
|
113
220
|
const requiredInputs = el.querySelectorAll('[required]');
|
|
114
221
|
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
222
|
if (input.disabled || input.closest('.hidden'))
|
|
118
223
|
return;
|
|
119
224
|
if ('reportValidity' in input && !input.reportValidity())
|
|
@@ -122,11 +227,6 @@ export class SallaOrderOptionsModal {
|
|
|
122
227
|
}
|
|
123
228
|
return pass;
|
|
124
229
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Sum the per-quantity fee (total_price = additional_price × qty) of any pre-selected details.
|
|
127
|
-
* Uses total_price so the total scales with product quantity; falls back to the per-unit
|
|
128
|
-
* additional_price only when total_price is absent. (CHOD-13172)
|
|
129
|
-
*/
|
|
130
230
|
seedOptionsPrice(orderOptions) {
|
|
131
231
|
let sum = 0;
|
|
132
232
|
orderOptions.forEach((opt) => {
|
|
@@ -137,7 +237,6 @@ export class SallaOrderOptionsModal {
|
|
|
137
237
|
});
|
|
138
238
|
return sum;
|
|
139
239
|
}
|
|
140
|
-
/** salla.event.on is global — attach per open, detach on close to avoid stacking. */
|
|
141
240
|
attachChangeListener() {
|
|
142
241
|
this.detachChangeListener();
|
|
143
242
|
this.changeHandler = () => this.recomputeTotal();
|
|
@@ -158,7 +257,6 @@ export class SallaOrderOptionsModal {
|
|
|
158
257
|
? await el.getSelectedOptions()
|
|
159
258
|
: [];
|
|
160
259
|
(selected || []).forEach((s) => {
|
|
161
|
-
// total_price already includes the product-quantity multiplier (CHOD-13172).
|
|
162
260
|
selectedPrice += Number(s.total_price ?? s.additional_price) || 0;
|
|
163
261
|
});
|
|
164
262
|
}
|
|
@@ -171,44 +269,148 @@ export class SallaOrderOptionsModal {
|
|
|
171
269
|
salla.notify?.error?.(this.requiredMessage);
|
|
172
270
|
return;
|
|
173
271
|
}
|
|
272
|
+
if (this.inFreeStep) {
|
|
273
|
+
const step = this._freeQueue[this._freeIndex];
|
|
274
|
+
const selected = this.collectOrderOptionsSync();
|
|
275
|
+
// Legacy single-gift callers still read the flat list off the first gift.
|
|
276
|
+
if (this._freeIndex === 0)
|
|
277
|
+
this._collectedFreeOptions = selected;
|
|
278
|
+
// A step left entirely empty is not forced into products[] — the offer still
|
|
279
|
+
// auto-adds that gift with its defaults.
|
|
280
|
+
if (selected.length && step?.product?.id) {
|
|
281
|
+
const options = {};
|
|
282
|
+
selected.forEach(({ id, value }) => { options[id] = value; });
|
|
283
|
+
this._collectedFreeProducts.push({
|
|
284
|
+
productId: step.product.id,
|
|
285
|
+
quantity: step.quantity,
|
|
286
|
+
options,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
// Bank this step's surcharges — the gift's own base is 0, so liveTotal is pure surcharge.
|
|
290
|
+
this._accumulatedExtra += Math.max(0, this.liveTotal - this.basePrice);
|
|
291
|
+
// More gifts to configure — advance to the next one.
|
|
292
|
+
const next = this._freeIndex + 1;
|
|
293
|
+
if (next < this._freeQueue.length) {
|
|
294
|
+
this.loadFreeStep(next);
|
|
295
|
+
this.modal?.setTitle(this.freeProductTitle);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (this._realOrderOptions.length) {
|
|
299
|
+
// Gifts done — advance to the store order-options step.
|
|
300
|
+
this.optionsRefs.clear();
|
|
301
|
+
this.inFreeStep = false;
|
|
302
|
+
this.freeProduct = null; // @State → re-render to the final step
|
|
303
|
+
this.orderOptions = this._realOrderOptions; // @State → swaps to store order options
|
|
304
|
+
// Restore the product's price: this step's total is what the shopper pays, and in
|
|
305
|
+
// apple-pay mode it becomes the sheet amount.
|
|
306
|
+
this.basePrice = this._orderBasePrice;
|
|
307
|
+
this.liveTotal = this._orderBasePrice + this.seedOptionsPrice(this._realOrderOptions);
|
|
308
|
+
this.sessionId++; // forces salla-product-options remount
|
|
309
|
+
this.modal?.setTitle(this.title); // update header: "خيارات الطلب"
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
// Gifts only, no store order options — this was the last step, so fire the submit hook
|
|
313
|
+
// (Apple Pay starts its session in there) before resolving.
|
|
314
|
+
this.isSubmitting = true;
|
|
315
|
+
// This step's surcharge is already banked above, so swap liveTotal for the product price
|
|
316
|
+
// rather than adding it — otherwise the surcharge is counted twice.
|
|
317
|
+
this.liveTotal = this._orderBasePrice;
|
|
318
|
+
this.fireSubmitCallback([]);
|
|
319
|
+
this.resolveAndClose([]);
|
|
320
|
+
this.isSubmitting = false;
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
// Step 2 (or single step) — resolve
|
|
174
324
|
this.isSubmitting = true;
|
|
175
325
|
const orderOptions = this.collectOrderOptionsSync();
|
|
176
|
-
|
|
177
|
-
|
|
326
|
+
this.fireSubmitCallback(orderOptions);
|
|
327
|
+
this.resolveAndClose(orderOptions);
|
|
328
|
+
this.isSubmitting = false;
|
|
329
|
+
}
|
|
330
|
+
/** Product price + every surcharge picked across the wizard. This is what Apple Pay charges. */
|
|
331
|
+
finalTotal() {
|
|
332
|
+
return Math.round((this.liveTotal + this._accumulatedExtra) * 100) / 100;
|
|
333
|
+
}
|
|
334
|
+
/** Fire the sync submit hook — Apple Pay opens its session inside this call, so never await. */
|
|
335
|
+
fireSubmitCallback(orderOptions) {
|
|
178
336
|
try {
|
|
179
|
-
this.submitCallback?.(orderOptions,
|
|
337
|
+
this.submitCallback?.(orderOptions, this.finalTotal(), this._collectedFreeProducts);
|
|
180
338
|
}
|
|
181
339
|
catch (err) {
|
|
182
340
|
salla?.logger?.warn?.('order-options modal onSubmit threw', err);
|
|
183
341
|
}
|
|
184
|
-
|
|
342
|
+
}
|
|
343
|
+
/** Hand the collected selections back to the caller and tear the modal down. */
|
|
344
|
+
resolveAndClose(orderOptions) {
|
|
345
|
+
this.resolveFn?.({
|
|
346
|
+
orderOptions,
|
|
347
|
+
freeProductOptions: this._collectedFreeOptions,
|
|
348
|
+
freeProducts: this._collectedFreeProducts,
|
|
349
|
+
});
|
|
185
350
|
this.resolveFn = null;
|
|
186
351
|
this.rejectFn = null;
|
|
187
352
|
this.submitCallback = null;
|
|
188
353
|
this.detachChangeListener();
|
|
189
354
|
this.modal?.close().then(() => this.reset());
|
|
190
|
-
this.isSubmitting = false;
|
|
191
355
|
}
|
|
192
|
-
/** Clear options on close so the inner <salla-product-options> unmounts. */
|
|
193
356
|
reset() {
|
|
194
357
|
this.orderOptions = [];
|
|
358
|
+
this.freeProduct = null;
|
|
359
|
+
this.inFreeStep = false;
|
|
195
360
|
this.optionsRefs.clear();
|
|
196
361
|
this.liveTotal = 0;
|
|
362
|
+
this._realOrderOptions = [];
|
|
363
|
+
this._collectedFreeOptions = [];
|
|
364
|
+
this._collectedFreeProducts = [];
|
|
365
|
+
this._freeQueue = [];
|
|
366
|
+
this._freeIndex = 0;
|
|
367
|
+
this._isWizard = false;
|
|
197
368
|
}
|
|
198
369
|
render() {
|
|
199
|
-
// salla.money returns HTML (sicon-sar icon) → render via innerHTML. Round
|
|
200
|
-
// first so floating-point sum doesn't show as 1174.3799999999999.
|
|
201
370
|
const totalHtml = salla.money(Math.round(this.liveTotal * 100) / 100);
|
|
202
|
-
|
|
371
|
+
const isStep1 = this.inFreeStep;
|
|
372
|
+
const productIdAttr = isStep1
|
|
373
|
+
? String(this.freeProduct?.id || `free-prod-${this.orderOptions[0]?.id}`)
|
|
374
|
+
: `order-options-${this.orderOptions[0]?.id}`;
|
|
375
|
+
// Distinct per gift so consecutive steps can't share a stale options ref.
|
|
376
|
+
const uniqueKey = isStep1 ? `free-product-options-${this._freeIndex}` : 'order-options';
|
|
377
|
+
// One chip per gift, then one for the store order options. `current` is the index of
|
|
378
|
+
// the step on screen; anything before it is done.
|
|
379
|
+
const stepLabels = [
|
|
380
|
+
...this._freeQueue.map(() => this.freeProductTitle),
|
|
381
|
+
...(this._realOrderOptions.length ? [this.title] : []),
|
|
382
|
+
];
|
|
383
|
+
const current = isStep1 ? this._freeIndex : this._freeQueue.length;
|
|
384
|
+
// Apple Pay must be offered on whichever step is genuinely last. With gifts but no store
|
|
385
|
+
// order options the last step IS a gift step, and gating on `!isStep1` would leave the
|
|
386
|
+
// shopper on a plain Continue button that never opens the payment sheet.
|
|
387
|
+
const isLastStep = current === Math.max(0, stepLabels.length - 1);
|
|
388
|
+
const showApplePay = this.paymentMode === 'apple-pay' && isLastStep;
|
|
389
|
+
// In wizard mode the step chips live in the modal header (slot="icon") so they appear
|
|
390
|
+
// next to the close button. A non-breaking space triggers salla-modal to render the
|
|
391
|
+
// header-inner container; the empty title div is hidden via .s-oom-wizard-modal CSS.
|
|
392
|
+
// In single-step mode the header shows the relevant title text directly.
|
|
393
|
+
const modalTitle = this._isWizard ? ' ' : (isStep1 ? this.freeProductTitle : this.title);
|
|
394
|
+
return (h("salla-modal", { key: '60e626bb49f8592c952182c182e6d73ddcaadeed', ref: el => (this.modal = el), class: `s-order-options-modal-host${this._isWizard ? ' s-oom-wizard-modal' : ''}`, width: "md", "modal-title": modalTitle, onModalVisibilityChanged: (e) => {
|
|
203
395
|
if (!e.detail)
|
|
204
396
|
this.handleClose();
|
|
205
|
-
} },
|
|
397
|
+
} }, this._isWizard && (h("div", { key: 'a842b5d1566c8bb0bd68d5986fb092c14f8a01d6', slot: "icon", class: "s-oom-steps" }, stepLabels.map((label, index) => [
|
|
398
|
+
index > 0 && h("div", { class: "s-oom-connector" }),
|
|
399
|
+
h("div", { class: `s-oom-step ${index === current ? 'active' : (index < current ? 'done' : '')}` }, h("span", { class: "s-oom-step-num" }, index + 1), h("span", { class: "s-oom-step-label" }, label)),
|
|
400
|
+
]))), h("div", { key: '1f61a756dcf824bf4d8be71ccbd9a0c2742851d2', class: "s-order-options-modal-body" }, isStep1 && this.freeProduct && (h("div", { key: '667841475dff0deda06d8d04e0a2841f33ec54b6', class: "s-oom-free-product-card" }, this.freeProduct.thumbnail && (h("img", { key: '129b99226216f0c1ca59fccbc0ba35d5af8cdee7', class: "s-oom-free-product-thumb", src: this.freeProduct.thumbnail, alt: this.freeProduct.name })), h("div", { key: 'ae385e2d4fb967144743d67eadd50f31c23332ec', class: "s-oom-free-product-info" }, h("span", { key: '4f48a3fd0af91435060a0d303a6d0f77f5afd1bc', class: "s-oom-free-product-name" }, this.freeProduct.name), h("div", { key: 'de62961aba2246c1d52d411461d6a45aed620eab', class: "s-oom-free-product-tags" }, h("span", { key: 'db1af48cc1a7583a7f2d026159ff01f03ad216bf', class: "s-oom-free-badge" }, this.t('common.elements.free', 'مجاني')), this.freeProduct.offer_name && (h("span", { key: 'ce595bccd755e908deb1c566758ca3629171962b', class: "s-oom-free-offer-name" }, this.freeProduct.offer_name)))))), h("p", { key: '161740bddbf25369392f362f9613f2e9c6a94fc1', class: "s-order-options-modal-subtitle" }, isStep1 ? this.freeProductSubtitle : this.subtitle), h("div", { key: '20d3f92f0f3782d599ec5ce923c2dad93f7c7608', class: "s-order-options-modal-fields" }, this.orderOptions.length > 0 && (h("salla-product-options", { key: this.sessionId, ref: el => {
|
|
206
401
|
if (!el)
|
|
207
402
|
return;
|
|
208
|
-
this.optionsRefs.set(
|
|
209
|
-
// Without seeding, first multi-select toggle wipes pre-selected defaults.
|
|
403
|
+
this.optionsRefs.set(uniqueKey, el);
|
|
210
404
|
el.seedSelectedOptions?.();
|
|
211
|
-
}, "product-id":
|
|
405
|
+
}, "product-id": productIdAttr, "unique-key": uniqueKey, options: JSON.stringify(this.orderOptions), "hide-out-label": "1", "no-padding": true })))), h("div", { key: 'c80a0c1f1b32e5396483171196879bc43713c2f4', slot: "footer", class: "s-order-options-modal-footer" }, showApplePay ? (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" }, isStep1 ? this.freeProductContinueLabel : this.submitLabel), isStep1
|
|
406
|
+
? h("i", { class: {
|
|
407
|
+
's-oom-cta-arrow': true,
|
|
408
|
+
// "Forward" is left in RTL and right in LTR; hardcoding arrow-left made
|
|
409
|
+
// English stores show a back-pointing arrow (CP-3813).
|
|
410
|
+
'sicon-arrow-left': this.isRtl(),
|
|
411
|
+
'sicon-arrow-right': !this.isRtl(),
|
|
412
|
+
} })
|
|
413
|
+
: h("span", { class: "s-order-options-modal-cta-total", innerHTML: totalHtml })))))));
|
|
212
414
|
}
|
|
213
415
|
static get is() { return "salla-order-options-modal"; }
|
|
214
416
|
static get originalStyleUrls() {
|
|
@@ -229,21 +431,26 @@ export class SallaOrderOptionsModal {
|
|
|
229
431
|
"isSubmitting": {},
|
|
230
432
|
"sessionId": {},
|
|
231
433
|
"paymentMode": {},
|
|
434
|
+
"freeProduct": {},
|
|
435
|
+
"inFreeStep": {},
|
|
232
436
|
"title": {},
|
|
233
437
|
"subtitle": {},
|
|
234
438
|
"submitLabel": {},
|
|
235
439
|
"totalLabel": {},
|
|
236
|
-
"requiredMessage": {}
|
|
440
|
+
"requiredMessage": {},
|
|
441
|
+
"freeProductTitle": {},
|
|
442
|
+
"freeProductSubtitle": {},
|
|
443
|
+
"freeProductContinueLabel": {}
|
|
237
444
|
};
|
|
238
445
|
}
|
|
239
446
|
static get methods() {
|
|
240
447
|
return {
|
|
241
448
|
"open": {
|
|
242
449
|
"complexType": {
|
|
243
|
-
"signature": "(payload: { orderOptions: any[]; basePrice?: number; paymentMode?: \"default\" | \"apple-pay\"; onSubmit?: (orderOptions: OrderOptionEntry[], total: number) => void; }) => Promise<{ orderOptions: OrderOptionEntry[]; }>",
|
|
450
|
+
"signature": "(payload: { orderOptions: any[]; freeProducts?: any[]; freeProductOptions?: any[]; freeProduct?: any; basePrice?: number; paymentMode?: \"default\" | \"apple-pay\"; onSubmit?: (orderOptions: OrderOptionEntry[], total: number, freeProducts: FreeProductSelection[]) => void; }) => Promise<{ orderOptions: OrderOptionEntry[]; freeProductOptions: OrderOptionEntry[]; freeProducts: FreeProductSelection[]; }>",
|
|
244
451
|
"parameters": [{
|
|
245
452
|
"name": "payload",
|
|
246
|
-
"type": "{ orderOptions: any[]; basePrice?: number; paymentMode?: \"default\" | \"apple-pay\"; onSubmit?: (orderOptions: OrderOptionEntry[], total: number) => void; }",
|
|
453
|
+
"type": "{ orderOptions: any[]; freeProducts?: any[]; freeProductOptions?: any[]; freeProduct?: any; basePrice?: number; paymentMode?: \"default\" | \"apple-pay\"; onSubmit?: (orderOptions: OrderOptionEntry[], total: number, freeProducts: FreeProductSelection[]) => void; }",
|
|
247
454
|
"docs": ""
|
|
248
455
|
}],
|
|
249
456
|
"references": {
|
|
@@ -255,12 +462,17 @@ export class SallaOrderOptionsModal {
|
|
|
255
462
|
"location": "local",
|
|
256
463
|
"path": "/home/runner/_work/twilight/twilight/packages/twilight-components/src/components/salla-order-options-modal/salla-order-options-modal.tsx",
|
|
257
464
|
"id": "src/components/salla-order-options-modal/salla-order-options-modal.tsx::OrderOptionEntry"
|
|
465
|
+
},
|
|
466
|
+
"FreeProductSelection": {
|
|
467
|
+
"location": "local",
|
|
468
|
+
"path": "/home/runner/_work/twilight/twilight/packages/twilight-components/src/components/salla-order-options-modal/salla-order-options-modal.tsx",
|
|
469
|
+
"id": "src/components/salla-order-options-modal/salla-order-options-modal.tsx::FreeProductSelection"
|
|
258
470
|
}
|
|
259
471
|
},
|
|
260
|
-
"return": "Promise<{ orderOptions: OrderOptionEntry[]; }>"
|
|
472
|
+
"return": "Promise<{ orderOptions: OrderOptionEntry[]; freeProductOptions: OrderOptionEntry[]; freeProducts: FreeProductSelection[]; }>"
|
|
261
473
|
},
|
|
262
474
|
"docs": {
|
|
263
|
-
"text": "
|
|
475
|
+
"text": "",
|
|
264
476
|
"tags": []
|
|
265
477
|
}
|
|
266
478
|
},
|
|
@@ -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: '96ce5c2d31f1908bd1522ad2f87094ab7d37cbd5', 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
|
}
|
|
@@ -42,12 +42,12 @@ export class SallaPayments {
|
|
|
42
42
|
render() {
|
|
43
43
|
const madeInKSA = !this.exclude.includes('made-in-ksa') && salla.config.get('store.settings.made_in_ksa');
|
|
44
44
|
const sbcId = this.exclude.includes('sbc') ? null : salla.config.get('store.settings.certificate.id');
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '7b48366eb122743315532e53cfcf05ac31c5ad60', class: "s-payments-list-wrap" }, h("ul", { key: 'e278c90249fa655ede607689afd366e5dc538532', class: "s-payments-list" }, madeInKSA && h("li", { key: '6a2494479aaef3dbe8557feaf07b290b9a7fc3a9', class: "s-payments-list-item" }, h("img", { key: '386ee723fce881bf4206a3113ff8e611bf48c0c8', 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.filter(payment => !this.exclude.includes(payment)).map((payment) => (payment == "cod" ?
|
|
46
46
|
h("div", { id: "cod-slot", innerHTML: this.codSlot
|
|
47
47
|
.replace(/\{image\}/g, this.paymentLogo(`cod`)) }) :
|
|
48
48
|
h("div", { id: "payment-slot", innerHTML: this.paymentSlot
|
|
49
49
|
.replace(/\{image\}/g, this.paymentLogo(payment))
|
|
50
|
-
.replace(/\{payment\}/g, payment) }))), sbcId && h("div", { key: '
|
|
50
|
+
.replace(/\{payment\}/g, payment) }))), sbcId && h("div", { key: '7a355da7a8f0ee873264807504d2d353739331bf', id: "sbc-slot", innerHTML: this.sbcSlot
|
|
51
51
|
.replace(/\{image\}/g, salla.url.cdn(`images/sbc.png`, 58, 58))
|
|
52
52
|
.replace(/\{link\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${sbcId}`) }))));
|
|
53
53
|
}
|
|
@@ -35,7 +35,7 @@ export class SallaPlaceholder {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: 'bb1e87ff964770b00667e5ba934e025a184056fe', class: this.alignmentClass() }, h("div", { key: '6a75cef023d5f1a719ebb8d91a8b2181e1635161', class: `s-placeholder-icon s-placeholder-icon-${this.iconSize}`, innerHTML: this.icon }), h("div", { key: 'cb68c4045df8dac84cd7c0626d9d8c322202e73d', class: "s-placeholder-title" }, h("slot", { key: '09f95446b63392eee020fa7d970e5387f83c4769', name: 'title' }, h("span", { key: 'b72e61aeabcc48fd5b3e14d76f4dcfab7c37703b' }, salla.lang.get('common.elements.no_options')))), h("div", { key: 'c9ba74e9a6dbe65c3e3d7994364182919bbbf3b0', class: "s-placeholder-description" }, h("slot", { key: '5441dc166551ead2f1386a58417d991fb62065f9', name: 'description' }, h("span", { key: 'd823d7f9bb6afa98df3307265b734ac06b3361ff' }, 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: 'b03ebb94bc24463935ff1ef49872ebc85343276f' }, 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: '701869c55602ed0ef68d2a1495b76f2159cf8d9d', class: "flex justify-center items-center" }, h("div", { key: '956a0ca9ab38e364baa9c1e7427c428143de2d64', class: "relative max-w-xl w-full" }, h("div", { key: '454523dfd41c249bc3ee984d9ebc908e257da655', class: "s-price-range-inputs" }, h("div", { key: 'f0047855d712ce0c637da08e0b5087253a4fa2d4', class: "s-price-range-relative" }, h("div", { key: '79d5ca39cb0da6b31523ae69f2ea62a1d49f4eed', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), h("input", { key: '5caa99eb839a0bfb651b7080fc51f8a99102380d', 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: '8df49030aa912e646a82a16b75416f5b86a54735', class: "s-price-range-gray-text" }, " -"), h("div", { key: '9c7eaa41986246f5d1e0f42c8f917c83643abf83', class: "s-price-range-relative" }, h("div", { key: '79de4f4520d63e038a51153372b1aabf729aeaff', class: "s-price-range-currency" }, " ", salla.config.currency().symbol), h("input", { key: '497d516b45de96f205021cace76604a04887aeb4', 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: '3179fd8523d7aabe0a61f496752294416a02edd5', color: 'gray', shape: 'icon', size: 'small', fill: 'outline', onClick: (event) => this.changedEventHandler(event) }, h("span", { key: 'd3a4660e76c1baef73e24ff23d79622535d80cfc', 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: '646195e9982d709d58b12eae7ee0649f85a76d93', 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()));
|
|
@@ -136,14 +136,14 @@ export class SallaProductCard {
|
|
|
136
136
|
's-product-card-out-of-stock': this.productData?.is_out_of_stock,
|
|
137
137
|
};
|
|
138
138
|
const hrefProp = this.productData?.url ? { href: this.productData.url, title: `Learn more about ${this.productData?.name}` } : {};
|
|
139
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: 'd1564818d562c0fb87d85b91b8b555834d89dc97', id: `product-${this.productData?.id}`, class: classes }, h("div", { key: '207349279fc7c23f085aa6ac3b3d7ef35af1bf30', class: !this.fullImage ? 's-product-card-image' : 's-product-card-image-full' }, h("a", { key: '175253af991d2bc48ea0e325adf2e16bc6f9bb9d', ...hrefProp }, h("img", { key: 'f5d5effc090a5b47287e8c9fbb1b929335c73037', class: `s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)
|
|
140
140
|
? 'contain'
|
|
141
141
|
: this.fitImageHeight
|
|
142
142
|
? this.fitImageHeight
|
|
143
|
-
: '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: '
|
|
144
|
-
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: '
|
|
143
|
+
: '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: 'b8157ea9f720c219d4217b2a1f5c7d11c2093cae', ...hrefProp, class: "s-product-card-overlay" }), !this.horizontal && !this.fullImage ?
|
|
144
|
+
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: 'fb21d4c6290a05721f10a30c1321d9f5558d7b41', class: "s-product-card-content" }, this.isSpecial && this.productData?.quantity ?
|
|
145
145
|
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" })))
|
|
146
|
-
: '', h("div", { key: '
|
|
146
|
+
: '', h("div", { key: 'fca467f3f2407870d9c203f1ba8533f15b01d180', class: { 's-product-card-content-main': true, 's-product-card-content-extra-padding': this.isSpecial } }, h("h3", { key: '34d89df8c8a1f8372ea53f1811b7246d27f36639', class: "s-product-card-content-title" }, h("a", { key: '24ff6f134a33ca108c3ff15649d7bee101fa3d2f', ...hrefProp }, this.getDisplayTitle())), this.productData?.subtitle && !this.minimal ?
|
|
147
147
|
h("p", { class: "s-product-card-content-subtitle" }, this.productData?.subtitle)
|
|
148
148
|
: ''), this.productData?.donation && !this.minimal && !this.fullImage ?
|
|
149
149
|
[h("salla-progress-bar", { donation: this.productData?.donation }), h("div", { class: "s-product-card-donation-input" }, this.productData?.donation?.can_donate ?
|
|
@@ -152,7 +152,7 @@ export class SallaProductCard {
|
|
|
152
152
|
this.addBtn.donatingAmount = e.target.value;
|
|
153
153
|
}, id: "donation-amount", name: "donating_amount", class: "s-form-control", placeholder: this.donationAmount })]
|
|
154
154
|
: '')]
|
|
155
|
-
: '', h("div", { key: '
|
|
155
|
+
: '', h("div", { key: '10ee13faf57862712b3ce80d5ef6cb7b542090d9', class: { 's-product-card-content-sub': true, 's-product-card-content-extra-padding': this.isSpecial } }, this.getProductPrice(), this.showOutOfStockBesidePrice && this.productData?.is_out_of_stock ?
|
|
156
156
|
h("span", { class: "s-product-card-out-of-stock-label" }, this.outOfStock)
|
|
157
157
|
: '', this.productData?.rating?.stars && !this.minimal ?
|
|
158
158
|
h("div", { class: "s-product-card-rating" }, h("span", { innerHTML: Star }), h("span", null, this.productData.rating.stars))
|
|
@@ -94,7 +94,7 @@ export class SallaProductCardEmbed {
|
|
|
94
94
|
's-product-card-embed-card-align-right': this.align === 'right',
|
|
95
95
|
's-product-card-embed-card-align-center': this.align === 'center',
|
|
96
96
|
};
|
|
97
|
-
return (h(Host, { key: '
|
|
97
|
+
return (h(Host, { key: 'd001e10a89c192004bfdfdcbeeb83d2d9c695d95' }, this.hasError && h("span", { key: '2c35003750483da3d17d6df0ee5add7a3aaf530b', class: "s-product-card-embed-fallback" }), h("div", { key: 'ff5743f1a26421488677a28503f448d410b49abb', class: cardClasses, ref: (el) => {
|
|
98
98
|
this.cardContainer = el;
|
|
99
99
|
} })));
|
|
100
100
|
}
|