@salla.sa/twilight-components 2.14.573 → 2.14.575
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/{Helper-N5wrs9vm.js → Helper-8U7zlpC3.js} +171 -117
- package/dist/cjs/{filepond-B2iMbV1F.js → filepond-NMq4bM2q.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-rXYiM_Ob.js → filepond-plugin-file-poster-TEelNjjG.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BF5dedmz.js → filepond-plugin-file-validate-size-DRVxzFUc.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DJHYRny2.js → filepond-plugin-file-validate-type-75J1mHEB.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BgtH5f4u.js → filepond-plugin-image-edit-CvC-CZjk.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C9JH8EBn.js → filepond-plugin-image-exif-orientation-D7mJeHKx.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CpSCiqfj.js → filepond-plugin-image-preview-QxURSuZ4.js} +1 -1
- package/dist/cjs/heart-ClVn_Co8.js +13 -0
- package/dist/cjs/{index-DpXwHFVO.js → index-Bt8A6pnr.js} +14 -10
- package/dist/cjs/index-CIbBkRPw.js +4413 -0
- package/dist/cjs/{intlTelInput-CdZOfaWd.js → intlTelInput-Dq8y3YHO.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +9 -4403
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- 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-gift-card-redeem.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- 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 +30 -4
- package/dist/cjs/salla-offer.cjs.entry.js +116 -24
- 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 +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.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 +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +2 -2
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +5 -11
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +5 -6
- package/dist/cjs/salla-rating-modal.cjs.entry.js +5 -6
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- 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-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +48 -0
- package/dist/cjs/{shipping-fast-CsqEQE78.js → star-tn5w5Um0.js} +8 -0
- package/dist/cjs/translate-BeU1QX_r.js +20 -0
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-BT9OjZCy.js → vanilla-picker-BkJyQVMl.js} +1 -1
- package/dist/collection/Helpers/Helper.js +171 -117
- package/dist/collection/Helpers/translate.js +16 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +8 -4
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.css +1 -1
- package/dist/collection/components/salla-offer/salla-offer.css +86 -0
- package/dist/collection/components/salla-offer/salla-offer.js +119 -22
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.css +32 -0
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +28 -2
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -1
- package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.css +62 -0
- package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.js +65 -0
- package/dist/components/Helper.js +171 -117
- package/dist/components/heart.js +11 -0
- package/dist/components/index.js +2 -2
- package/dist/components/index2.js +4322 -2471
- package/dist/components/index3.js +2553 -0
- package/dist/components/salla-bullet-delivery.js +44 -4438
- package/dist/components/salla-cart-summary.js +1 -1
- package/dist/components/salla-datetime-picker2.js +1 -1
- package/dist/components/salla-offer-modal.js +29 -3
- package/dist/components/salla-offer.js +120 -23
- package/dist/components/salla-product-card2.js +4 -10
- package/dist/components/salla-rating-modal-v2.js +1 -1
- package/dist/components/salla-rating-modal-v22.js +9 -3
- package/dist/components/salla-rating-modal2.js +2 -3
- package/dist/components/salla-user-menu.js +2 -2
- package/dist/components/salla-wishlist-summary.d.ts +11 -0
- package/dist/components/salla-wishlist-summary.js +67 -0
- package/dist/components/translate.js +18 -0
- package/dist/esm/{Helper-Cql-WbqR.js → Helper-ivBHT_nn.js} +171 -117
- package/dist/esm/{filepond-BsuscqtG.js → filepond-kmpJTY5p.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-DZ4ckjsP.js → filepond-plugin-file-poster-8M0TsTUo.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BV6807xx.js → filepond-plugin-file-validate-size-CPVDzrMj.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-cWCM2RqT.js → filepond-plugin-file-validate-type-D0qUdWNB.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-aQvaKLxK.js → filepond-plugin-image-edit-K8nFORG9.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-FgW7hBXK.js → filepond-plugin-image-exif-orientation-BSvnwKAw.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DxogdDqd.js → filepond-plugin-image-preview-hArDoD8N.js} +1 -1
- package/dist/esm/heart-00vBRoH3.js +11 -0
- package/dist/esm/{index-DSEA3vdh.js → index-a6lSRQK4.js} +14 -10
- package/dist/esm/index-wXSgmenB.js +4404 -0
- package/dist/esm/{intlTelInput-BLEGv9EO.js → intlTelInput-CC5xRRkd.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +2 -2
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +2 -2
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +11 -11
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +53 -4447
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +2 -2
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- 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 +30 -4
- package/dist/esm/salla-offer.entry.js +116 -24
- 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 +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +2 -2
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +2 -8
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +2 -2
- package/dist/esm/salla-products-slider.entry.js +2 -2
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +3 -4
- package/dist/esm/salla-rating-modal.entry.js +3 -4
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- 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-product-card.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +5 -5
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +46 -0
- package/dist/esm/{shipping-fast-lMgMt31Q.js → star-cq6TcfoH.js} +8 -1
- package/dist/esm/translate-CrSV-tno.js +18 -0
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-BpgJFvog.js → vanilla-picker-CDhGfTst.js} +1 -1
- package/dist/twilight/{p-901a961f.entry.js → p-004584f5.entry.js} +1 -1
- package/dist/twilight/{p-77dc1637.entry.js → p-00e68964.entry.js} +1 -1
- package/dist/twilight/p-00vBRoH3.js +4 -0
- package/dist/twilight/{p-4a3701ca.entry.js → p-01cae03e.entry.js} +1 -1
- package/dist/twilight/{p-db53fade.entry.js → p-0a38d353.entry.js} +1 -1
- package/dist/twilight/{p-7e0698c6.entry.js → p-0f1981ee.entry.js} +1 -1
- package/dist/twilight/p-0f9bfeeb.entry.js +4 -0
- package/dist/twilight/{p-82455313.entry.js → p-109472c5.entry.js} +1 -1
- package/dist/twilight/{p-2304f0a4.entry.js → p-10968d1c.entry.js} +1 -1
- package/dist/twilight/{p-ec341307.entry.js → p-127f0000.entry.js} +1 -1
- package/dist/twilight/{p-f173ada5.entry.js → p-12ab7c1a.entry.js} +1 -1
- package/dist/twilight/{p-4a447633.entry.js → p-21e6b2e7.entry.js} +1 -1
- package/dist/twilight/{p-c15d08ae.entry.js → p-24bd13b8.entry.js} +1 -1
- package/dist/twilight/{p-663aa63b.entry.js → p-2541db96.entry.js} +1 -1
- package/dist/twilight/{p-dd3aacf3.entry.js → p-254e6e0c.entry.js} +1 -1
- package/dist/twilight/{p-5d0fd545.entry.js → p-2591eead.entry.js} +1 -1
- package/dist/twilight/{p-3c5e2710.entry.js → p-25a4633f.entry.js} +1 -1
- package/dist/twilight/{p-9fe36a97.entry.js → p-28875055.entry.js} +1 -1
- package/dist/twilight/{p-6fb16543.entry.js → p-2af75479.entry.js} +1 -1
- package/dist/twilight/{p-bbb72d38.entry.js → p-2af98444.entry.js} +1 -1
- package/dist/twilight/{p-5d97cf2d.entry.js → p-2bf8f0ed.entry.js} +1 -1
- package/dist/twilight/{p-6a605835.entry.js → p-2c480419.entry.js} +1 -1
- package/dist/twilight/{p-4557e342.entry.js → p-312e8678.entry.js} +1 -1
- package/dist/twilight/{p-e5bb52fb.entry.js → p-3357d33a.entry.js} +1 -1
- package/dist/twilight/p-338f727b.entry.js +4 -0
- package/dist/twilight/{p-06419603.entry.js → p-34d33337.entry.js} +1 -1
- package/dist/twilight/{p-d9be4036.entry.js → p-3500065c.entry.js} +1 -1
- package/dist/twilight/{p-3eb55e32.entry.js → p-3a113599.entry.js} +1 -1
- package/dist/twilight/{p-ad930532.entry.js → p-3bd153c1.entry.js} +1 -1
- package/dist/twilight/{p-d654b4b0.entry.js → p-3ff2b8b6.entry.js} +1 -1
- package/dist/twilight/{p-a89fb313.entry.js → p-426acd77.entry.js} +1 -1
- package/dist/twilight/{p-6cdc7f8a.entry.js → p-44b8d453.entry.js} +1 -1
- package/dist/twilight/{p-6cc3e44d.entry.js → p-45b97699.entry.js} +1 -1
- package/dist/twilight/{p-3040407e.entry.js → p-4a60be6d.entry.js} +1 -1
- package/dist/twilight/{p-e0b085e4.entry.js → p-4bf58226.entry.js} +1 -1
- package/dist/twilight/{p-8ae70528.entry.js → p-50816838.entry.js} +1 -1
- package/dist/twilight/{p-51434773.entry.js → p-5134aae8.entry.js} +1 -1
- package/dist/twilight/{p-69e8750f.entry.js → p-540138a1.entry.js} +1 -1
- package/dist/twilight/{p-1f1dda08.entry.js → p-55e0745e.entry.js} +1 -1
- package/dist/twilight/{p-0764c46b.entry.js → p-583a63e5.entry.js} +1 -1
- package/dist/twilight/{p-0b514a47.entry.js → p-5b1a0560.entry.js} +1 -1
- package/dist/twilight/{p-78ee03f8.entry.js → p-5d72b7d7.entry.js} +1 -1
- package/dist/twilight/{p-aadeb35a.entry.js → p-5ddd9aa0.entry.js} +1 -1
- package/dist/twilight/{p-f306bfe3.entry.js → p-5fe0908b.entry.js} +1 -1
- package/dist/twilight/{p-5b949ccc.entry.js → p-6051a92c.entry.js} +1 -1
- package/dist/twilight/p-63a315e1.entry.js +4 -0
- package/dist/twilight/{p-47b1aa89.entry.js → p-6958e848.entry.js} +1 -1
- package/dist/twilight/{p-3b3a1c87.entry.js → p-69594ced.entry.js} +1 -1
- package/dist/twilight/{p-75652fd4.entry.js → p-6a7eacbd.entry.js} +1 -1
- package/dist/twilight/{p-d1c973ce.entry.js → p-6f371a84.entry.js} +1 -1
- package/dist/twilight/{p-3c665085.entry.js → p-6f741b21.entry.js} +1 -1
- package/dist/twilight/p-71ecb477.entry.js +4 -0
- package/dist/twilight/{p-360b6388.entry.js → p-742f2c15.entry.js} +1 -1
- package/dist/twilight/{p-fac05e8f.entry.js → p-7a19ef45.entry.js} +1 -1
- package/dist/twilight/{p-09e126b0.entry.js → p-7b373051.entry.js} +1 -1
- package/dist/twilight/{p-6e43f8a7.entry.js → p-7cc8b82b.entry.js} +1 -1
- package/dist/twilight/{p-8f2b2e42.entry.js → p-7f69cf5d.entry.js} +1 -1
- package/dist/twilight/{p-901217bc.entry.js → p-7f861ac0.entry.js} +1 -1
- package/dist/twilight/{p-855a9db7.entry.js → p-81c88f97.entry.js} +1 -1
- package/dist/twilight/{p-6be347e5.entry.js → p-8271e127.entry.js} +1 -1
- package/dist/twilight/{p-62a44e65.entry.js → p-84599aa5.entry.js} +1 -1
- package/dist/twilight/{p-fc6adc90.entry.js → p-86ad5af2.entry.js} +1 -1
- package/dist/twilight/p-8d30dbac.entry.js +4 -0
- package/dist/twilight/{p-4944d10a.entry.js → p-96cac80e.entry.js} +1 -1
- package/dist/twilight/{p-84ec7be7.entry.js → p-977e3e76.entry.js} +1 -1
- package/dist/twilight/{p-89ed6dbc.entry.js → p-9b04ed7f.entry.js} +1 -1
- package/dist/twilight/{p-7afeb088.entry.js → p-9e53d7a6.entry.js} +1 -1
- package/dist/twilight/{p-BF2su8FM.js → p-BG1dHHdm.js} +1 -1
- package/dist/twilight/{p-B3sbQMcp.js → p-BokV7EHy.js} +1 -1
- package/dist/twilight/{p-Bt0GXtZG.js → p-CSuif4Xw.js} +1 -1
- package/dist/twilight/p-CbVZf-Q4.js +4 -0
- package/dist/twilight/{p-BZt79QeE.js → p-CfhebjBE.js} +1 -1
- package/dist/twilight/p-CrSV-tno.js +4 -0
- package/dist/twilight/p-DI6PJLEJ.js +1024 -0
- package/dist/twilight/{p-Bj6lP8RV.js → p-DNjWzZsK.js} +1 -1
- package/dist/twilight/{p-WgGO2Pjy.js → p-DOF2UkI4.js} +1 -1
- package/dist/twilight/{p-VBuS91fQ.js → p-DWPp9ZjN.js} +1 -1
- package/dist/twilight/{p-DDcSXlpO.js → p-DZHubgN5.js} +1 -1
- package/dist/twilight/{p-1063f3d1.entry.js → p-a0d39b81.entry.js} +1 -1
- package/dist/twilight/{p-68aecf40.entry.js → p-a177b13f.entry.js} +1 -1
- package/dist/twilight/{p-5c863789.entry.js → p-a391b31d.entry.js} +1 -1
- package/dist/twilight/{p-bb2170ac.entry.js → p-a47b910f.entry.js} +1 -1
- package/dist/twilight/{p-DSEA3vdh.js → p-a6lSRQK4.js} +2 -2
- package/dist/twilight/{p-f919f0b5.entry.js → p-aee0c658.entry.js} +1 -1
- package/dist/twilight/{p-54c36ba4.entry.js → p-af99726d.entry.js} +1 -1
- package/dist/twilight/{p-e90a201a.entry.js → p-b0c86557.entry.js} +1 -1
- package/dist/twilight/{p-1acd987a.entry.js → p-b7624eb6.entry.js} +1 -1
- package/dist/twilight/{p-b3063b70.entry.js → p-bc54fc8b.entry.js} +1 -1
- package/dist/twilight/{p-e5c07741.entry.js → p-c500e5fe.entry.js} +1 -1
- package/dist/twilight/{p-b414760b.entry.js → p-c9779211.entry.js} +1 -1
- package/dist/twilight/{p-2c07e8ac.entry.js → p-c9ba30cd.entry.js} +1 -1
- package/dist/twilight/{p-5d41dc4e.entry.js → p-cbcbc9f8.entry.js} +1 -1
- package/dist/twilight/{p-2733e78f.entry.js → p-cc15290b.entry.js} +1 -1
- package/dist/twilight/{p-lMgMt31Q.js → p-cq6TcfoH.js} +1 -1
- package/dist/twilight/{p-77323c2a.entry.js → p-d0fce326.entry.js} +1 -1
- package/dist/twilight/{p-e676c627.entry.js → p-d1a0bd97.entry.js} +1 -1
- package/dist/twilight/{p-457a256d.entry.js → p-d56cb23a.entry.js} +1 -1
- package/dist/twilight/{p-66561f9e.entry.js → p-d6803c56.entry.js} +1 -1
- package/dist/twilight/{p-bc0f3f06.entry.js → p-d7e5b860.entry.js} +1 -1
- package/dist/twilight/{p-276171ac.entry.js → p-dc86737c.entry.js} +1 -1
- package/dist/twilight/{p-61580839.entry.js → p-e0b5a06d.entry.js} +1 -1
- package/dist/twilight/{p-b1c21e5c.entry.js → p-e155a1a6.entry.js} +1 -1
- package/dist/twilight/{p-5329003d.entry.js → p-e9d73e7d.entry.js} +1 -1
- package/dist/twilight/p-ea1c06ab.entry.js +4 -0
- package/dist/twilight/p-eb11b8be.entry.js +4 -0
- package/dist/twilight/{p-909ae4c5.entry.js → p-ebd9a6c2.entry.js} +1 -1
- package/dist/twilight/p-ef037207.entry.js +4 -0
- package/dist/twilight/{p-c419a909.entry.js → p-f1a3cf9e.entry.js} +1 -1
- package/dist/twilight/{p-b6ece925.entry.js → p-f2f6f502.entry.js} +1 -1
- package/dist/twilight/{p-6904ad04.entry.js → p-fc13e706.entry.js} +1 -1
- package/dist/twilight/{p-DdScDjtA.js → p-wx2L9ZB0.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/Helpers/Helper.d.ts +14 -12
- package/dist/types/Helpers/translate.d.ts +10 -0
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +0 -1
- package/dist/types/components/salla-offer/salla-offer.d.ts +42 -1
- package/dist/types/components/salla-offer-modal/offer-schema.d.ts +12 -0
- package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +7 -0
- package/dist/types/components/salla-wishlist-summary/salla-wishlist-summary.d.ts +18 -0
- package/dist/types/components.d.ts +45 -0
- package/package.json +5 -5
- package/dist/cjs/star-DMzrN05M.js +0 -13
- package/dist/components/star.js +0 -11
- package/dist/esm/star-CeFAfcTv.js +0 -11
- package/dist/twilight/p-010fa509.entry.js +0 -4
- package/dist/twilight/p-035b561c.entry.js +0 -4
- package/dist/twilight/p-5a86a794.entry.js +0 -4
- package/dist/twilight/p-8ed45c28.entry.js +0 -4
- package/dist/twilight/p-CUSw0W26.js +0 -4
- package/dist/twilight/p-CeFAfcTv.js +0 -4
- package/dist/twilight/p-b98ae2c1.entry.js +0 -4
- package/dist/twilight/p-e91bba7e.entry.js +0 -1024
- package/dist/twilight/p-f10fca84.entry.js +0 -4
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h } from "@stencil/core";
|
|
5
5
|
import { PageType, OfferType } from "./interfaces";
|
|
6
|
+
import { translate } from "../../Helpers/translate";
|
|
6
7
|
/**
|
|
7
8
|
* `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.
|
|
8
9
|
* It uses the `salla-slider` component for carousel functionality.
|
|
@@ -43,8 +44,13 @@ export class SallaOffer {
|
|
|
43
44
|
this.special_offer_text = salla.lang.get('pages.products.special_offer');
|
|
44
45
|
this.buy_quantity_text = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity });
|
|
45
46
|
this.products_link_text = salla.lang.get('pages.offer.included_products', 'المنتجات المشمولة');
|
|
46
|
-
this.min_spend_text = (
|
|
47
|
-
this.min_items_text = (items) =>
|
|
47
|
+
this.min_spend_text = (money) => translate('pages.offer.min_spend_amount', { amount: money, currency: '' }, `بحد أدنى ${money} من مبلغ الشراء`);
|
|
48
|
+
this.min_items_text = (items) => translate('pages.offer.min_items', { items }, `بحد أدنى ${items} منتجات`);
|
|
49
|
+
this.max_discount_text = (money) => translate('pages.offer.max_discount_amount', { amount: money, currency: '' }, `بحد أقصى ${money} للخصم`);
|
|
50
|
+
this.branches_text = translate('pages.offer.available_branches', {}, 'الفروع المتاحة');
|
|
51
|
+
this.buy_from_text = translate('pages.offer.buy_from_categories', {}, 'اشترِ من:');
|
|
52
|
+
this.get_from_text = translate('pages.offer.get_from_categories', {}, 'احصل من:');
|
|
53
|
+
this.payment_methods_text = translate('pages.offer.payment_methods', {}, 'طرق الدفع');
|
|
48
54
|
this.product_text = salla.lang.get('common.elements.product', 'منتج');
|
|
49
55
|
// Language
|
|
50
56
|
salla.lang.onLoaded(() => {
|
|
@@ -54,8 +60,13 @@ export class SallaOffer {
|
|
|
54
60
|
this.special_offer_text = salla.lang.get('pages.products.special_offer');
|
|
55
61
|
this.buy_quantity_text(0);
|
|
56
62
|
this.products_link_text = salla.lang.get('pages.offer.included_products', 'المنتجات المشمولة');
|
|
57
|
-
this.min_spend_text = (
|
|
58
|
-
this.min_items_text = (items) =>
|
|
63
|
+
this.min_spend_text = (money) => translate('pages.offer.min_spend_amount', { amount: money, currency: '' }, `بحد أدنى ${money} من مبلغ الشراء`);
|
|
64
|
+
this.min_items_text = (items) => translate('pages.offer.min_items', { items }, `بحد أدنى ${items} منتجات`);
|
|
65
|
+
this.max_discount_text = (money) => translate('pages.offer.max_discount_amount', { amount: money, currency: '' }, `بحد أقصى ${money} للخصم`);
|
|
66
|
+
this.branches_text = translate('pages.offer.available_branches', {}, 'الفروع المتاحة');
|
|
67
|
+
this.buy_from_text = translate('pages.offer.buy_from_categories', {}, 'اشترِ من:');
|
|
68
|
+
this.get_from_text = translate('pages.offer.get_from_categories', {}, 'احصل من:');
|
|
69
|
+
this.payment_methods_text = translate('pages.offer.payment_methods', {}, 'طرق الدفع');
|
|
59
70
|
this.product_text = salla.lang.get('common.elements.product', 'منتج');
|
|
60
71
|
});
|
|
61
72
|
salla.onReady(() => {
|
|
@@ -133,7 +144,9 @@ export class SallaOffer {
|
|
|
133
144
|
const details = offer.details;
|
|
134
145
|
return (details.apply_to === 'category' && details.targets) ||
|
|
135
146
|
(details.apply_to === 'categories' && details.targets) ||
|
|
136
|
-
(offer.type === OfferType.BuyXGetY &&
|
|
147
|
+
(offer.type === OfferType.BuyXGetY &&
|
|
148
|
+
(details.get?.source === 'categories' || details.get?.source === 'category' ||
|
|
149
|
+
details.buy?.source === 'categories' || details.buy?.source === 'category'));
|
|
137
150
|
});
|
|
138
151
|
if (needsCategories) {
|
|
139
152
|
const res = await salla.product.api.categories();
|
|
@@ -199,6 +212,11 @@ export class SallaOffer {
|
|
|
199
212
|
if ((buyX.source === 'products' || buyX.source === 'product') && buyX.source_value) {
|
|
200
213
|
buyX.products = buyX.source_value.map(id => allProducts[id]).filter(Boolean);
|
|
201
214
|
}
|
|
215
|
+
else if ((buyX.source === 'categories' || buyX.source === 'category') && allCategories && buyX.source_value) {
|
|
216
|
+
// Without this the buy side stayed unresolved and the card could only
|
|
217
|
+
// ever show the get-side categories.
|
|
218
|
+
buyX.categories = this.findCategories(allCategories, buyX.source_value);
|
|
219
|
+
}
|
|
202
220
|
}
|
|
203
221
|
}
|
|
204
222
|
return this.offersList;
|
|
@@ -282,6 +300,21 @@ export class SallaOffer {
|
|
|
282
300
|
// For categories, we'll return empty array as we handle categories separately
|
|
283
301
|
return [];
|
|
284
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Title-adjacent description row.
|
|
305
|
+
*
|
|
306
|
+
* For a discount table the design sits the included-products link on the same
|
|
307
|
+
* line as the short description, rather than below the tier grid.
|
|
308
|
+
*/
|
|
309
|
+
renderCardDescriptionRow(offer, withProductsLink = false) {
|
|
310
|
+
const inlineLink = withProductsLink && offer.type === OfferType.DiscountsTable
|
|
311
|
+
? this.renderProductsLinkForModalCard(offer, false)
|
|
312
|
+
: null;
|
|
313
|
+
if (!offer.description && !inlineLink) {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
return (h("div", { class: "s-offer-card-description-row" }, offer.description && h("p", { class: "s-offer-card-description" }, offer.description), inlineLink));
|
|
317
|
+
}
|
|
285
318
|
renderProductsLinkForModalCard(offer, isInDrawer) {
|
|
286
319
|
const products = this.getOfferProducts(offer);
|
|
287
320
|
if (!products || products.length === 0) {
|
|
@@ -304,23 +337,31 @@ export class SallaOffer {
|
|
|
304
337
|
const products = this.getOfferProducts(offer);
|
|
305
338
|
const hasProducts = products && products.length > 0;
|
|
306
339
|
const isCollapsed = this.collapsedOffers[offer.id] !== false; // Default to collapsed
|
|
307
|
-
return (h("div", { class: "s-offer-drawer-card" }, h("div", { class: "s-offer-card-main", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title),
|
|
340
|
+
return (h("div", { class: "s-offer-drawer-card" }, h("div", { class: "s-offer-card-main", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title), this.renderCardDescriptionRow(offer), offer.type === OfferType.DiscountsTable ? (h("div", { class: "s-offer-card-details" }, this.renderDiscountTableOfferContent(offer), this.renderOfferPaymentMethods(offer), this.renderOfferBranches(offer))) : (offer.type === OfferType.PercentageOrFixed || offer.type === OfferType.Percentage || offer.type === OfferType.FixedAmount) ? (h("div", { class: "s-offer-card-details" }, this.renderPercentageOrFixedOfferContent(offer), this.renderOfferCategories(offer), this.renderOfferBrands(offer), this.renderOfferTags(offer), this.renderOfferPaymentMethods(offer), this.renderOfferBranches(offer))) : (h("div", { class: "s-offer-card-details" }, this.renderOfferCategories(offer), this.renderOfferBrands(offer), this.renderOfferTags(offer), this.renderOfferPaymentMethods(offer), this.renderOfferBranches(offer))))), hasProducts && (h("salla-accordion", { collapsed: isCollapsed, collapsible: true, size: "sm", onClick: (e) => e.stopPropagation(), onAccordionToggle: (e) => this.handleAccordionToggle(offer.id, e.detail.payload.collapsed) }, h("salla-accordion-head", { collapsible: true, collapsed: isCollapsed }, h("div", { slot: "title", class: "s-offer-products-thumbnails" }, h("span", { class: "s-offer-products-title" }, this.products_link_text, h("i", { class: `sicon-keyboard_arrow_${isCollapsed ? 'down' : 'up'} s-offer-products-link-icon` })), h("div", { class: "s-offer-products-thumbnails-stack" }, products.slice(0, 3).map((product, index) => (h("div", { class: "s-offer-product-thumbnail", style: { zIndex: `${index + 1}` } }, h("img", { src: product.thumbnail || product.image?.url || salla.url.cdn('images/s-empty.png'), alt: product.name })))), products.length > 3 && (h("div", { class: "s-offer-products-more-count", style: { zIndex: '7' } }, "+", products.length - 3))))), h("salla-accordion-body", null, h("div", { class: "s-offer-products-content" }, h("salla-products-list", { source: "selected", "source-value": JSON.stringify(products.map(p => p.id)), "product-card-component": this.productCardComponent, "horizontal-cards": true, "compact-cards": true, includes: ["images"] })))))));
|
|
308
341
|
}
|
|
309
342
|
renderOfferCard(offer, position = 1) {
|
|
310
|
-
return (h("div", { class: "s-offer-slide-one-fourth swiper-slide", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card" }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title),
|
|
311
|
-
?
|
|
343
|
+
return (h("div", { class: "s-offer-slide-one-fourth swiper-slide", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card" }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title), this.renderCardDescriptionRow(offer, true), h("div", { class: "s-offer-card-details" }, offer.type === OfferType.DiscountsTable
|
|
344
|
+
? [
|
|
345
|
+
this.renderDiscountTableOfferContent(offer),
|
|
346
|
+
this.renderOfferPaymentMethods(offer),
|
|
347
|
+
this.renderOfferBranches(offer)
|
|
348
|
+
]
|
|
312
349
|
: (offer.type === OfferType.PercentageOrFixed || offer.type === OfferType.Percentage || offer.type === OfferType.FixedAmount)
|
|
313
350
|
? [
|
|
314
351
|
this.renderPercentageOrFixedOfferContent(offer),
|
|
315
352
|
this.renderOfferCategories(offer),
|
|
316
353
|
this.renderOfferBrands(offer),
|
|
317
|
-
this.renderOfferTags(offer)
|
|
354
|
+
this.renderOfferTags(offer),
|
|
355
|
+
this.renderOfferPaymentMethods(offer),
|
|
356
|
+
this.renderOfferBranches(offer)
|
|
318
357
|
]
|
|
319
358
|
: [
|
|
320
359
|
this.renderOfferCategories(offer),
|
|
321
360
|
this.renderOfferBrands(offer),
|
|
322
|
-
this.renderOfferTags(offer)
|
|
323
|
-
|
|
361
|
+
this.renderOfferTags(offer),
|
|
362
|
+
this.renderOfferPaymentMethods(offer),
|
|
363
|
+
this.renderOfferBranches(offer)
|
|
364
|
+
], offer.type !== OfferType.DiscountsTable && this.renderProductsLinkForModalCard(offer, false))))));
|
|
324
365
|
}
|
|
325
366
|
getOfferIcon(offerType) {
|
|
326
367
|
const iconMap = {
|
|
@@ -339,13 +380,13 @@ export class SallaOffer {
|
|
|
339
380
|
const discounts = details.discounts || [];
|
|
340
381
|
if (!discounts.length)
|
|
341
382
|
return null;
|
|
342
|
-
return (h("div", null, h("div", { class: "s-offer-card-description" }, salla.lang.get('pages.offer.discount_table_subtitle', '
|
|
383
|
+
return (h("div", null, !offer.description && (h("div", { class: "s-offer-card-description" }, salla.lang.get('pages.offer.discount_table_subtitle', 'وفِّر أكثر بشراء منتجات أكثر'))), h("table", { class: "s-offer-discount-table" }, h("tbody", null, this.groupDiscountsByRows(discounts, 3).map((row, rowIndex) => (h("tr", { key: rowIndex }, row.map((discount, colIndex) => (h("td", { key: colIndex }, h("div", { class: "s-offer-discount-percentage" }, discount.percentage, "%"), h("div", { class: "s-offer-discount-condition" }, this.formatDiscountCondition(discount))))))))))));
|
|
343
384
|
}
|
|
344
385
|
renderPercentageOrFixedOfferContent(offer) {
|
|
345
386
|
const details = offer.details;
|
|
346
|
-
if (!details.discount_value && !(details.min_spend > 0) && !(details.min_items > 0))
|
|
387
|
+
if (!details.discount_value && !(details.min_spend > 0) && !(details.min_items > 0) && !(details.max_discount_amount > 0))
|
|
347
388
|
return null;
|
|
348
|
-
return (h("div", { class: "s-offer-percentage-fixed-content" }, details.min_spend > 0 && (h("div", { class: "s-offer-min-spend"
|
|
389
|
+
return (h("div", { class: "s-offer-percentage-fixed-content" }, details.min_spend > 0 && (h("div", { class: "s-offer-min-spend", innerHTML: this.min_spend_text(this.money(details.min_spend)) })), details.min_items > 0 && (h("div", { class: "s-offer-min-items" }, this.min_items_text(details.min_items))), details.max_discount_amount > 0 && (h("div", { class: "s-offer-max-discount", innerHTML: this.max_discount_text(this.money(details.max_discount_amount)) }))));
|
|
349
390
|
}
|
|
350
391
|
groupDiscountsByRows(discounts, itemsPerRow) {
|
|
351
392
|
const rows = [];
|
|
@@ -354,15 +395,31 @@ export class SallaOffer {
|
|
|
354
395
|
}
|
|
355
396
|
return rows;
|
|
356
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* A tier is labelled by its item count ("20 منتج"), with the percentage above
|
|
400
|
+
* it saying what the shopper gets. `discounted_amount` is the resulting price;
|
|
401
|
+
* returning that here took the condition's place and hid the item count
|
|
402
|
+
* entirely, which is what the tiers used to render on the product page.
|
|
403
|
+
*/
|
|
404
|
+
/**
|
|
405
|
+
* Money the way the rest of the storefront renders it.
|
|
406
|
+
*
|
|
407
|
+
* `salla.money()` returns markup — it swaps the currency for
|
|
408
|
+
* `<i class=sicon-sar></i>` when the store has the SAR symbol enabled — so the
|
|
409
|
+
* result has to be set with innerHTML. Printing it as text is what showed the
|
|
410
|
+
* riyal icon as raw code on the offer card and in the popup.
|
|
411
|
+
*/
|
|
412
|
+
money(amount) {
|
|
413
|
+
return typeof salla?.money === 'function'
|
|
414
|
+
? salla.money(amount)
|
|
415
|
+
: `${amount} ${this.userCurrency?.symbol || ''}`;
|
|
416
|
+
}
|
|
357
417
|
formatDiscountCondition(discount) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
return this.buy_quantity_text(discount.quantity);
|
|
364
|
-
}
|
|
365
|
-
return `1 ${this.product_text}`;
|
|
418
|
+
return `${discount.quantity ?? 1} ${this.product_text}`;
|
|
419
|
+
}
|
|
420
|
+
/** One labelled row of category links, used when buy and get differ. */
|
|
421
|
+
renderCategoryGroup(offer, categories, label) {
|
|
422
|
+
return (h("div", { class: "s-offer-categories-group" }, h("span", { class: "s-offer-categories-label" }, label), h("div", { class: "s-offer-categories-list" }, categories.map((category, index) => (h("a", { key: `${offer.id}-${index}`, class: "s-offer-category-item", href: category.url || salla.url.create('categories', category.id || category.id_) }, category.name))))));
|
|
366
423
|
}
|
|
367
424
|
renderOfferCategories(offer) {
|
|
368
425
|
const details = offer.details;
|
|
@@ -372,6 +429,17 @@ export class SallaOffer {
|
|
|
372
429
|
if (offer.type === OfferType.BuyXGetY && details.get?.categories) {
|
|
373
430
|
categories = details.get.categories;
|
|
374
431
|
}
|
|
432
|
+
// "Buy 2 from A, get 1 from B" needs both sides named; one flat list reads as
|
|
433
|
+
// if the whole offer were scoped to B. Only split when the sides really
|
|
434
|
+
// differ, so same-category offers keep rendering as a single list.
|
|
435
|
+
if (offer.type === OfferType.BuyXGetY) {
|
|
436
|
+
const buySide = details.buy?.categories || [];
|
|
437
|
+
const getSide = details.get?.categories || [];
|
|
438
|
+
const idsOf = (list) => list.map(c => c.id || c.id_).join(',');
|
|
439
|
+
if (buySide.length && getSide.length && idsOf(buySide) !== idsOf(getSide)) {
|
|
440
|
+
return (h("div", { class: "s-offer-categories" }, this.renderCategoryGroup(offer, buySide, this.buy_from_text), this.renderCategoryGroup(offer, getSide, this.get_from_text)));
|
|
441
|
+
}
|
|
442
|
+
}
|
|
375
443
|
if (!categories.length)
|
|
376
444
|
return null;
|
|
377
445
|
const maxVisible = 3; // Show only first 3 categories initially
|
|
@@ -399,6 +467,30 @@ export class SallaOffer {
|
|
|
399
467
|
this.toggleCategoryExpansion(offer.id);
|
|
400
468
|
} }, isExpanded ? (h("span", null, h("i", { class: "sicon-keyboard_arrow_up" }), ' ', salla.lang.get('common.elements.hide', 'إخفاء'))) : (h("span", null, salla.lang.get('common.elements.show', 'عرض'), " ", `+${brands.length - maxVisible}`, ' ', h("i", { class: "sicon-keyboard_arrow_down" }))))))));
|
|
401
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* Payment methods the offer is conditioned on. Reads `payment_methods` rather
|
|
472
|
+
* than `targets`: for a payment-method offer `targets` holds bare encoded ids
|
|
473
|
+
* with no label to show.
|
|
474
|
+
*/
|
|
475
|
+
renderOfferPaymentMethods(offer) {
|
|
476
|
+
const details = offer.details;
|
|
477
|
+
const methods = details.payment_methods || [];
|
|
478
|
+
if (!methods.length)
|
|
479
|
+
return null;
|
|
480
|
+
return (h("div", { class: "s-offer-payment-methods" }, h("span", { class: "s-offer-payment-methods-label" }, this.payment_methods_text), h("div", { class: "s-offer-payment-methods-list" }, methods.map((method, index) => (h("span", { key: index, class: "s-offer-payment-method-item" }, method.name))))));
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Branch restriction. Rendered for every offer type because the restriction is
|
|
484
|
+
* a condition on the offer itself, not on what it discounts. Branches carry no
|
|
485
|
+
* storefront URL, so these are plain badges rather than links.
|
|
486
|
+
*/
|
|
487
|
+
renderOfferBranches(offer) {
|
|
488
|
+
const details = offer.details;
|
|
489
|
+
const branches = details.branches || [];
|
|
490
|
+
if (!branches.length)
|
|
491
|
+
return null;
|
|
492
|
+
return (h("div", { class: "s-offer-branches" }, h("span", { class: "s-offer-branches-label" }, this.branches_text), h("div", { class: "s-offer-branches-list" }, branches.map((branch, index) => (h("span", { key: index, class: "s-offer-branch-item" }, branch.name))))));
|
|
493
|
+
}
|
|
402
494
|
renderOfferTags(offer) {
|
|
403
495
|
const details = offer.details;
|
|
404
496
|
const tags = details.tags || [];
|
|
@@ -484,6 +576,11 @@ export class SallaOffer {
|
|
|
484
576
|
"products_link_text": {},
|
|
485
577
|
"min_spend_text": {},
|
|
486
578
|
"min_items_text": {},
|
|
579
|
+
"max_discount_text": {},
|
|
580
|
+
"branches_text": {},
|
|
581
|
+
"buy_from_text": {},
|
|
582
|
+
"get_from_text": {},
|
|
583
|
+
"payment_methods_text": {},
|
|
487
584
|
"product_text": {}
|
|
488
585
|
};
|
|
489
586
|
}
|
|
@@ -518,3 +518,35 @@
|
|
|
518
518
|
.s-offer-modal-type-discounts-table .s-modal-body {
|
|
519
519
|
position: relative !important;
|
|
520
520
|
}
|
|
521
|
+
.s-offer-modal-conditions {
|
|
522
|
+
margin-top: 1rem;
|
|
523
|
+
display: flex;
|
|
524
|
+
flex-direction: column;
|
|
525
|
+
gap: 0.5rem;
|
|
526
|
+
text-align: center;
|
|
527
|
+
}
|
|
528
|
+
.s-offer-modal-condition {
|
|
529
|
+
font-size: 13px;
|
|
530
|
+
line-height: 17px;
|
|
531
|
+
--tw-text-opacity: 1;
|
|
532
|
+
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
|
|
533
|
+
}
|
|
534
|
+
.s-offer-modal-condition-group {
|
|
535
|
+
display: flex;
|
|
536
|
+
flex-direction: column;
|
|
537
|
+
align-items: center;
|
|
538
|
+
gap: 0.25rem;
|
|
539
|
+
}
|
|
540
|
+
.s-offer-modal-condition-label {
|
|
541
|
+
font-size: 13px;
|
|
542
|
+
font-weight: 700;
|
|
543
|
+
--tw-text-opacity: 1;
|
|
544
|
+
color: rgb(107 114 128 / var(--tw-text-opacity, 1));
|
|
545
|
+
}
|
|
546
|
+
.s-offer-modal-condition-items {
|
|
547
|
+
display: flex;
|
|
548
|
+
flex-wrap: wrap;
|
|
549
|
+
justify-content: center;
|
|
550
|
+
column-gap: 0.75rem;
|
|
551
|
+
row-gap: 0.25rem;
|
|
552
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { h } from "@stencil/core";
|
|
5
|
+
import { translate } from "../../Helpers/translate";
|
|
5
6
|
import SpecialDiscountIcon from "../../assets/svg/special-discount.svg";
|
|
6
7
|
import Tag from "../../assets/svg/tag.svg";
|
|
7
8
|
import Cart2 from "../../assets/svg/cart2.svg";
|
|
@@ -124,6 +125,30 @@ export class SallaOfferModal {
|
|
|
124
125
|
this.emitPromotionClicked(this.offer);
|
|
125
126
|
salla.api.withoutNotifier(() => salla.cart.quickAdd(this.productID, qty, this.offer_type)).then(() => this.modal.close());
|
|
126
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Conditions attached to the offer — spend floor, discount ceiling, eligible
|
|
130
|
+
* payment methods and branch restriction. Rendered outside `getOfferContent()`
|
|
131
|
+
* because that method returns a single element per offer shape, while these
|
|
132
|
+
* apply across all of them.
|
|
133
|
+
*/
|
|
134
|
+
getOfferConditions() {
|
|
135
|
+
const buy = this.offer.buy || {};
|
|
136
|
+
const get = this.offer.get || {};
|
|
137
|
+
const branches = this.offer.branches || [];
|
|
138
|
+
const paymentMethods = buy.payment_methods || [];
|
|
139
|
+
const hasMinAmount = buy.min_amount > 0;
|
|
140
|
+
const hasMinItems = buy.min_items > 0;
|
|
141
|
+
const hasMaxDiscount = get.max_discount_amount > 0;
|
|
142
|
+
if (!hasMinAmount && !hasMinItems && !hasMaxDiscount && !paymentMethods.length && !branches.length) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
return h("div", { class: "s-offer-modal-conditions" }, hasMinAmount &&
|
|
146
|
+
h("p", { class: "s-offer-modal-condition", innerHTML: translate('pages.offer.min_spend_amount', { amount: salla.money(buy.min_amount), currency: '' }, `بحد أدنى ${salla.money(buy.min_amount)} من مبلغ الشراء`) }), hasMinItems &&
|
|
147
|
+
h("p", { class: "s-offer-modal-condition" }, translate('pages.offer.min_items', { items: buy.min_items }, `بحد أدنى ${buy.min_items} منتجات`)), hasMaxDiscount &&
|
|
148
|
+
h("p", { class: "s-offer-modal-condition", innerHTML: translate('pages.offer.max_discount_amount', { amount: salla.money(get.max_discount_amount), currency: '' }, `بحد أقصى ${salla.money(get.max_discount_amount)} للخصم`) }), !!paymentMethods.length &&
|
|
149
|
+
h("div", { class: "s-offer-modal-condition-group" }, h("span", { class: "s-offer-modal-condition-label" }, translate('pages.offer.payment_methods', {}, 'طرق الدفع')), h("div", { class: "s-offer-modal-condition-items" }, paymentMethods.map((method) => h("span", { class: "s-offer-modal-badge-text" }, method.name)))), !!branches.length &&
|
|
150
|
+
h("div", { class: "s-offer-modal-condition-group" }, h("span", { class: "s-offer-modal-condition-label" }, translate('pages.offer.available_branches', {}, 'الفروع المتاحة')), h("div", { class: "s-offer-modal-condition-items" }, branches.map((branch) => h("span", { class: "s-offer-modal-badge-text" }, branch.name)))));
|
|
151
|
+
}
|
|
127
152
|
getOfferContent() {
|
|
128
153
|
if (this.offer.get.discounts_table) {
|
|
129
154
|
return h("div", { class: "s-offer-modal-discount-table" }, h("table", null, h("tbody", null, this.offer.get.discounts_table?.map(discount => h("tr", null, h("td", null, discount.text), h("td", { class: "s-offer-modal-discount-table-cell" }, h("salla-button", { fill: "outline", shape: "btn", color: "primary", size: "medium", width: "normal", onClick: () => this.addToCart(discount.quantity) }, this.addToCartLabel)))))));
|
|
@@ -205,8 +230,9 @@ export class SallaOfferModal {
|
|
|
205
230
|
// '</div>';
|
|
206
231
|
// }
|
|
207
232
|
render() {
|
|
208
|
-
return h("salla-modal", { key: '
|
|
209
|
-
? [h("span", { slot: 'icon', class: "s-offer-modal-header-icon", innerHTML: SpecialDiscountIcon }), this.getOfferContent(),
|
|
233
|
+
return h("salla-modal", { key: '65f0a5622466ab72be96f7a251e6ebab29c3f30c', "has-skeleton": true, "sub-title": this.offer_message, ref: modal => this.modal = modal, isLoading: true, class: `s-offer-modal-type-${this.offer_type ? this.offer_type : ''}` }, h("div", { key: 'cb235e4d13b95673bde9bd5eeac1ee1ff7e0c1f4', slot: 'loading' }, h("div", { key: '249ced69c178e7071cb100c11829120f2b0a52b6', class: "s-offer-modal-skeleton" }, h("div", { key: '44da044786147e7b693866a7b3e776742622a7d2', class: "s-offer-modal-skeleton-header" }, h("salla-skeleton", { key: 'cca94fa75f1086118dcce2dd6e4099cc09d9db7c', type: 'circle', height: '80px', width: '80px' }), h("salla-skeleton", { key: 'a0e1548a9f168c724b9353fca617ed55407b8537', height: '15px', width: '50%' }), h("salla-skeleton", { key: '72fd306f044249a568fc5ddf75eed898685955a5', height: '10px', width: '30%' })), h("div", { key: 'c54ceb5db0887372d487448c39cf1f2fe2b9cfd6', class: "s-offer-modal-skeleton-items" }, [...Array(3)].map(() => h("div", { class: "s-offer-modal-skeleton-item" }, h("salla-skeleton", { height: '9rem' }), h("div", { class: "s-offer-modal-skeleton-item-title" }, h("salla-skeleton", { height: '15px', width: '100%' })), h("div", { class: "s-offer-modal-skeleton-item-subtitle" }, h("salla-skeleton", { height: '9px', width: '50%' }), h("div", { innerHTML: Cart2 }))))), h("div", { key: '82400b8a1b032ce266cbd093d04607cabd4334ce', class: "s-offer-modal-skeleton-footer" }, h("salla-skeleton", { key: '1898c3045f98af8a5fa70fc96544bdc93c8e21d2', height: '15px', width: '50%' }), h("salla-skeleton", { key: '2b3746f994eb9baaf5c8ed62e9b779fe6746a0a4', height: '15px', width: '30%' })))), !this.hasError && this.offer !== null
|
|
234
|
+
? [h("span", { slot: 'icon', class: "s-offer-modal-header-icon", innerHTML: SpecialDiscountIcon }), this.getOfferContent(),
|
|
235
|
+
this.getOfferConditions(), h("div", { class: "s-offer-modal-footer", slot: "footer" }, this.offer.formatted_date ?
|
|
210
236
|
h("p", { class: "s-offer-modal-expiry" }, salla.lang.get('pages.products.offer_expires_in'), " ", this.offer.formatted_date)
|
|
211
237
|
: '', h("label", { class: "s-offer-modal-remember-label" }, h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-modal-remember-input" }), "\u00A0 ", salla.lang.get('common.elements.remember_my_choice'))),
|
|
212
238
|
] :
|
|
@@ -7,7 +7,7 @@ import ArrowDown from "../../assets/svg/keyboard_arrow_down.svg";
|
|
|
7
7
|
import BellRing from "../../assets/svg/bell-ring.svg";
|
|
8
8
|
import OrderIcon from "../../assets/svg/box-bankers.svg";
|
|
9
9
|
import PendingOrdersIcon from "../../assets/svg/cart.svg";
|
|
10
|
-
import WishListIcon from "../../assets/svg/
|
|
10
|
+
import WishListIcon from "../../assets/svg/heart.svg";
|
|
11
11
|
import ProfileIcon from "../../assets/svg/user-circle.svg";
|
|
12
12
|
import LogoutIcon from "../../assets/svg/send-out.svg";
|
|
13
13
|
import Cancel from "../../assets/svg/cancel.svg";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!twlt*/:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
margin-inline-start: 1rem;
|
|
5
|
+
}
|
|
6
|
+
.hidden {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
.s-wishlist-summary-wrapper {
|
|
10
|
+
position: relative;
|
|
11
|
+
margin-inline-start: 0.75rem;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
border-style: none;
|
|
15
|
+
text-decoration-line: none;
|
|
16
|
+
outline: 2px solid transparent;
|
|
17
|
+
outline-offset: 2px;
|
|
18
|
+
transition-property: opacity;
|
|
19
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
20
|
+
transition-duration: 200ms;
|
|
21
|
+
}
|
|
22
|
+
.s-wishlist-summary-wrapper:hover {
|
|
23
|
+
opacity: 0.8;
|
|
24
|
+
}
|
|
25
|
+
.s-wishlist-summary-icon {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
height: 2.5rem;
|
|
28
|
+
width: 2.5rem;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
border-radius: 9999px;
|
|
32
|
+
border-width: 1px;
|
|
33
|
+
border-color: var(--color-border,#e5e7eb);
|
|
34
|
+
color: var(--color-text-primary,#374151);
|
|
35
|
+
}
|
|
36
|
+
.s-wishlist-summary-icon svg {
|
|
37
|
+
height: 1.25rem;
|
|
38
|
+
width: 1.25rem;
|
|
39
|
+
fill: currentColor;
|
|
40
|
+
}
|
|
41
|
+
.s-wishlist-summary-count {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: -4px;
|
|
44
|
+
left: -6px;
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
height: 1.25rem;
|
|
47
|
+
width: 1.25rem;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
border-radius: 9999px;
|
|
51
|
+
--tw-bg-opacity: 1;
|
|
52
|
+
background-color: rgb(248 113 113 / var(--tw-bg-opacity, 1));
|
|
53
|
+
padding: 0.25rem;
|
|
54
|
+
font-size: 0.75rem;
|
|
55
|
+
line-height: 1.25rem;
|
|
56
|
+
--tw-text-opacity: 1;
|
|
57
|
+
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
|
58
|
+
}
|
|
59
|
+
.s-wishlist-summary-count:where([dir="rtl"], [dir="rtl"] *) {
|
|
60
|
+
left: unset;
|
|
61
|
+
right: -6px;
|
|
62
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { Host, h } from "@stencil/core";
|
|
5
|
+
import HeartIcon from "../../assets/svg/heart.svg";
|
|
6
|
+
import Helper from "../../Helpers/Helper";
|
|
7
|
+
/**
|
|
8
|
+
* Standalone wishlist ("Fav") icon, meant to sit at the outer nav-bar level
|
|
9
|
+
* next to `salla-user-menu` and `salla-cart-summary` — not nested inside the
|
|
10
|
+
* account dropdown.
|
|
11
|
+
*
|
|
12
|
+
* A/B test: shown only on basic/plus stores (see Helper.getPlanName()) —
|
|
13
|
+
* pro/special stores keep the pre-existing wishlist-in-menu-only experience.
|
|
14
|
+
* TODO: confirm before/after click-count reporting comes from analytics.
|
|
15
|
+
*/
|
|
16
|
+
export class SallaWishlistSummary {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.isEnabled = false;
|
|
19
|
+
this.wishlistCount = 0;
|
|
20
|
+
this.wishlistLabel = salla.lang.get('common.titles.wishlist');
|
|
21
|
+
salla.wishlist.event.onAdded(() => this.syncCount());
|
|
22
|
+
salla.wishlist.event.onRemoved(() => this.syncCount());
|
|
23
|
+
// Server hydration (packages/twilight/src/api/wishlist.js syncStorageFromServer)
|
|
24
|
+
// rewrites `salla::wishlist` in storage after the add/remove events above have
|
|
25
|
+
// already fired, or without either firing at all — re-sync once it settles so
|
|
26
|
+
// the badge doesn't stay stale.
|
|
27
|
+
salla.event.on('wishlist::storage.synced', () => this.syncCount());
|
|
28
|
+
}
|
|
29
|
+
componentWillLoad() {
|
|
30
|
+
return new Promise(resolve => salla.onReady(() => {
|
|
31
|
+
const plan = Helper.getPlanName();
|
|
32
|
+
this.isEnabled = !!plan && ['basic', 'plus'].includes(plan);
|
|
33
|
+
this.syncCount();
|
|
34
|
+
resolve();
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
syncCount() {
|
|
38
|
+
this.wishlistCount = (salla.storage.get('salla::wishlist', []) || []).length;
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
const is_guest = salla.config.isGuest();
|
|
42
|
+
if (!this.isEnabled || is_guest) {
|
|
43
|
+
return h(Host, { hidden: true });
|
|
44
|
+
}
|
|
45
|
+
return (h(Host, null, h("a", { class: "s-wishlist-summary-wrapper", href: salla.url.get('account/wishlist'), "aria-label": this.wishlistLabel }, h("i", { class: "s-wishlist-summary-icon", innerHTML: HeartIcon }), this.wishlistCount > 0 && (h("span", { class: "s-wishlist-summary-count" }, salla.helpers.number(this.wishlistCount))))));
|
|
46
|
+
}
|
|
47
|
+
static get is() { return "salla-wishlist-summary"; }
|
|
48
|
+
static get originalStyleUrls() {
|
|
49
|
+
return {
|
|
50
|
+
"$": ["salla-wishlist-summary.scss"]
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static get styleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["salla-wishlist-summary.css"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get states() {
|
|
59
|
+
return {
|
|
60
|
+
"isEnabled": {},
|
|
61
|
+
"wishlistCount": {},
|
|
62
|
+
"wishlistLabel": {}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|