@salla.sa/twilight-components 2.14.439 → 2.14.440
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-DdDLuiM5.js → filepond-DOOLwTpX.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-yMQqced-.js → filepond-plugin-file-poster-D7nMzJ2p.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-ySnuQivZ.js → filepond-plugin-file-validate-size-DpCJ71im.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DZR1JS8f.js → filepond-plugin-file-validate-type-CDZ5OaBc.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-D1I8S80L.js → filepond-plugin-image-edit-BzGZimte.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C9XMlwy1.js → filepond-plugin-image-exif-orientation-D1fPPBi_.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Bb0GALoo.js → filepond-plugin-image-preview-CEhIwZKp.js} +1 -1
- package/dist/cjs/{functions-wi2J1iyx.js → functions-CdVaIsQM.js} +1 -1
- package/dist/cjs/{index-gyLHvjDh.js → index-E66k07Rj.js} +1 -1
- package/dist/cjs/{index-CzYs-dhm.js → index-oqqfD8M2.js} +2 -2
- 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 +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- 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-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-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 +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.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 +1 -1
- 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.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- 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.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 +247 -42
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +86 -25
- 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.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-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-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-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 +2 -2
- package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
- 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 +1 -1
- package/dist/cjs/salla-slider.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 +1 -1
- 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/{tracked-promise-DT3W4yYx.js → tracked-promise-DV0VuqZL.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-BdKuUhUF.js → vanilla-picker-DvOQTQXG.js} +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +278 -41
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +18 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +107 -20
- package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.css +32 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-multiple-bundle-product-details2.js +250 -42
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +18 -4
- package/dist/components/salla-multiple-bundle-product-slider2.js +69 -20
- package/dist/components/salla-product-card-embed.js +1 -1
- package/dist/esm/{filepond-CuxNx4T_.js → filepond-Crf00c7G.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-B0bm9HVP.js → filepond-plugin-file-poster-B3uKBJe-.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Ndd8bi5G.js → filepond-plugin-file-validate-size-CWVDRdsV.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DrPPjEtZ.js → filepond-plugin-file-validate-type-VQGNZwF9.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C96YLlHm.js → filepond-plugin-image-edit-DOhXVk8j.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BufhQyn4.js → filepond-plugin-image-exif-orientation-Co8jzTVW.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-xyGt-4PS.js → filepond-plugin-image-preview-gQWAQlCp.js} +1 -1
- package/dist/esm/{functions-BXvEy71U.js → functions-D8zpoRMj.js} +1 -1
- package/dist/esm/{index-BVmIkaqr.js → index-DX6k_dv6.js} +1 -1
- package/dist/esm/{index-D0jpoyIT.js → index-XEcnGv2r.js} +2 -2
- 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 +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- 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-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +10 -10
- package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-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 +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.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 +1 -1
- 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.entry.js +2 -2
- package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map.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 +247 -42
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +86 -25
- 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.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-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-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +2 -2
- package/dist/esm/salla-product-card_2.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-reward-action_4.entry.js +3 -3
- 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 +1 -1
- package/dist/esm/salla-slider.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 +1 -1
- 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/{tracked-promise-2BTc0cKI.js → tracked-promise-DhOWivzL.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DN-pQ4Fw.js → vanilla-picker-C0njJzZd.js} +1 -1
- package/dist/twilight/{p-b44d2016.entry.js → p-00b633b2.entry.js} +1 -1
- package/dist/twilight/{p-9dc45b4d.entry.js → p-0238a9dd.entry.js} +1 -1
- package/dist/twilight/{p-0831e5fc.entry.js → p-05ae76f4.entry.js} +1 -1
- package/dist/twilight/{p-5eec5519.entry.js → p-06f77f81.entry.js} +1 -1
- package/dist/twilight/{p-5f7466cf.entry.js → p-07d26676.entry.js} +1 -1
- package/dist/twilight/{p-81985743.entry.js → p-07f973b1.entry.js} +1 -1
- package/dist/twilight/{p-7bdb6aca.entry.js → p-0c342e2d.entry.js} +1 -1
- package/dist/twilight/{p-1567d3b0.entry.js → p-11da2f39.entry.js} +1 -1
- package/dist/twilight/{p-9c6752e6.entry.js → p-1d8eb252.entry.js} +1 -1
- package/dist/twilight/{p-4b6e6fb8.entry.js → p-203d6ae6.entry.js} +1 -1
- package/dist/twilight/{p-19ab0abc.entry.js → p-2cae7b1c.entry.js} +1 -1
- package/dist/twilight/{p-04e8106c.entry.js → p-2dce17b0.entry.js} +1 -1
- package/dist/twilight/{p-bfe0be2b.entry.js → p-2eddcffd.entry.js} +1 -1
- package/dist/twilight/{p-4a9379a1.entry.js → p-31b06705.entry.js} +1 -1
- package/dist/twilight/{p-2ab53408.entry.js → p-33362e8b.entry.js} +1 -1
- package/dist/twilight/{p-0597375e.entry.js → p-39498902.entry.js} +1 -1
- package/dist/twilight/{p-79197700.entry.js → p-3ba87443.entry.js} +1 -1
- package/dist/twilight/{p-d9569632.entry.js → p-3e054be0.entry.js} +1 -1
- package/dist/twilight/{p-33a52238.entry.js → p-3edb7319.entry.js} +1 -1
- package/dist/twilight/{p-adc138bc.entry.js → p-461cd74c.entry.js} +1 -1
- package/dist/twilight/{p-6073673e.entry.js → p-476c4acb.entry.js} +1 -1
- package/dist/twilight/{p-078450b0.entry.js → p-4a3b5eca.entry.js} +1 -1
- package/dist/twilight/p-4e52fd6c.entry.js +4 -0
- package/dist/twilight/{p-77f85461.entry.js → p-55dfaddd.entry.js} +1 -1
- package/dist/twilight/{p-378a7e72.entry.js → p-56bd83f4.entry.js} +1 -1
- package/dist/twilight/{p-228413fa.entry.js → p-57a9293b.entry.js} +1 -1
- package/dist/twilight/{p-1ba82c7d.entry.js → p-5c972b65.entry.js} +1 -1
- package/dist/twilight/{p-0c174f16.entry.js → p-5df17c20.entry.js} +1 -1
- package/dist/twilight/{p-cd47fec2.entry.js → p-5e643edb.entry.js} +1 -1
- package/dist/twilight/{p-f81452e9.entry.js → p-5fd650c4.entry.js} +1 -1
- package/dist/twilight/{p-5b106fd4.entry.js → p-60d7a5e2.entry.js} +1 -1
- package/dist/twilight/{p-2dabb075.entry.js → p-6ab3e94b.entry.js} +1 -1
- package/dist/twilight/{p-baed03c3.entry.js → p-6c63e8a6.entry.js} +1 -1
- package/dist/twilight/{p-2a511b8a.entry.js → p-6d35b20c.entry.js} +1 -1
- package/dist/twilight/{p-90afbf42.entry.js → p-6fed57e8.entry.js} +1 -1
- package/dist/twilight/{p-637168d2.entry.js → p-6ff38910.entry.js} +1 -1
- package/dist/twilight/{p-fa049325.entry.js → p-78be4e2c.entry.js} +1 -1
- package/dist/twilight/{p-e2ad8bc7.entry.js → p-8207fb6f.entry.js} +1 -1
- package/dist/twilight/{p-eb53ef20.entry.js → p-854eb825.entry.js} +1 -1
- package/dist/twilight/{p-fadab0ac.entry.js → p-8a4da11a.entry.js} +1 -1
- package/dist/twilight/{p-e58b7d20.entry.js → p-8c34fab2.entry.js} +1 -1
- package/dist/twilight/{p-b0f25824.entry.js → p-924555bd.entry.js} +1 -1
- package/dist/twilight/p-925690e3.entry.js +4 -0
- package/dist/twilight/{p-b7e861b2.entry.js → p-925869b3.entry.js} +1 -1
- package/dist/twilight/{p-45708652.entry.js → p-93e060da.entry.js} +1 -1
- package/dist/twilight/{p-0bbf0061.entry.js → p-94b31962.entry.js} +1 -1
- package/dist/twilight/{p-b73471d3.entry.js → p-9731d50b.entry.js} +1 -1
- package/dist/twilight/{p-5131149c.entry.js → p-9b2ba1e6.entry.js} +1 -1
- package/dist/twilight/{p-68bcb0ba.entry.js → p-9c2942c3.entry.js} +1 -1
- package/dist/twilight/{p-d18400bb.entry.js → p-9c3d5fdc.entry.js} +1 -1
- package/dist/twilight/{p-xuGEmDhH.js → p-B2jZw8NF.js} +1 -1
- package/dist/twilight/{p-DwV68ec-.js → p-B5kt5KrJ.js} +1 -1
- package/dist/twilight/{p-DIsyGRAw.js → p-CMvDceec.js} +1 -1
- package/dist/twilight/{p-NBF3VaTJ.js → p-Cw0D47mx.js} +1 -1
- package/dist/twilight/{p-B3k6Ab4H.js → p-DL6eUQYK.js} +1 -1
- package/dist/twilight/{p-OK5pMKD1.js → p-DWyUFC7G.js} +1 -1
- package/dist/twilight/{p-D-wessdE.js → p-DXDm8GqM.js} +1 -1
- package/dist/twilight/p-Dar-Px4H.js +4 -0
- package/dist/twilight/{p-DvcNoEfM.js → p-DrCHWc9_.js} +1 -1
- package/dist/twilight/{p-KmhadCpx.js → p-DvOajQJL.js} +1 -1
- package/dist/twilight/{p-D0jpoyIT.js → p-XEcnGv2r.js} +1 -1
- package/dist/twilight/p-YUFLgZi3.js +9 -0
- package/dist/twilight/{p-0adb148a.entry.js → p-a14b7bb6.entry.js} +1 -1
- package/dist/twilight/{p-c207c587.entry.js → p-a2fa4306.entry.js} +1 -1
- package/dist/twilight/{p-fc3e6684.entry.js → p-a49d9c6e.entry.js} +1 -1
- package/dist/twilight/{p-3e5dbd96.entry.js → p-aaf3736b.entry.js} +1 -1
- package/dist/twilight/{p-c1823790.entry.js → p-aeeec3d8.entry.js} +1 -1
- package/dist/twilight/{p-12a6d03b.entry.js → p-b1f79652.entry.js} +1 -1
- package/dist/twilight/p-b352e237.entry.js +4 -0
- package/dist/twilight/{p-5bd8ffe5.entry.js → p-b3859adb.entry.js} +1 -1
- package/dist/twilight/{p-afdddba9.entry.js → p-b7e4542c.entry.js} +1 -1
- package/dist/twilight/{p-567ba930.entry.js → p-bea56108.entry.js} +1 -1
- package/dist/twilight/{p-d60ed03c.entry.js → p-c0162a6e.entry.js} +1 -1
- package/dist/twilight/{p-03718a72.entry.js → p-c12ff95c.entry.js} +1 -1
- package/dist/twilight/{p-3918f93c.entry.js → p-c3432589.entry.js} +1 -1
- package/dist/twilight/{p-f42fa303.entry.js → p-c5250fca.entry.js} +1 -1
- package/dist/twilight/{p-62c791c6.entry.js → p-c55b672d.entry.js} +1 -1
- package/dist/twilight/{p-083e5039.entry.js → p-c612ad0b.entry.js} +1 -1
- package/dist/twilight/{p-3f52dc98.entry.js → p-c999abc3.entry.js} +1 -1
- package/dist/twilight/{p-eec8bdb1.entry.js → p-cd5722c4.entry.js} +1 -1
- package/dist/twilight/{p-a0471050.entry.js → p-cff61b58.entry.js} +1 -1
- package/dist/twilight/{p-ef5d5f2a.entry.js → p-d0b10f8b.entry.js} +1 -1
- package/dist/twilight/{p-3c5b9e45.entry.js → p-d1808642.entry.js} +1 -1
- package/dist/twilight/{p-2404e668.entry.js → p-d1bfd0bc.entry.js} +1 -1
- package/dist/twilight/{p-e2ebc898.entry.js → p-d1e67236.entry.js} +1 -1
- package/dist/twilight/{p-0fd165b9.entry.js → p-d34f2a6c.entry.js} +1 -1
- package/dist/twilight/{p-fd7f2211.entry.js → p-d473010e.entry.js} +1 -1
- package/dist/twilight/{p-ea80046d.entry.js → p-deaebd7b.entry.js} +1 -1
- package/dist/twilight/{p-ebc0b840.entry.js → p-e50b4426.entry.js} +1 -1
- package/dist/twilight/{p-eb352a06.entry.js → p-eab889dc.entry.js} +1 -1
- package/dist/twilight/{p-e59b3e07.entry.js → p-ed55bd99.entry.js} +1 -1
- package/dist/twilight/{p-631191d2.entry.js → p-ed770165.entry.js} +1 -1
- package/dist/twilight/{p-c05648b2.entry.js → p-f076d705.entry.js} +1 -1
- package/dist/twilight/{p-b05ce2ee.entry.js → p-f1bed530.entry.js} +1 -1
- package/dist/twilight/p-f34ea06b.entry.js +4 -0
- package/dist/twilight/{p-133aea32.entry.js → p-f5207897.entry.js} +1 -1
- package/dist/twilight/{p-d44c5dcc.entry.js → p-f668e5dd.entry.js} +1 -1
- package/dist/twilight/{p-ced32f4a.entry.js → p-f8d7196e.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.d.ts +20 -0
- package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.d.ts +1 -0
- package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.d.ts +9 -0
- package/dist/types/components/salla-multiple-bundle-product/interfaces.d.ts +1 -0
- package/dist/types/components.d.ts +21 -0
- package/package.json +5 -5
- package/dist/twilight/p-1c53d114.entry.js +0 -4
- package/dist/twilight/p-4d21d259.entry.js +0 -4
- package/dist/twilight/p-COQaiMGv.js +0 -4
- package/dist/twilight/p-Cq8arVRH.js +0 -9
- package/dist/twilight/p-b33c50dc.entry.js +0 -4
- package/dist/twilight/p-e4bb0633.entry.js +0 -4
|
@@ -35,22 +35,37 @@ const SallaMultipleBundleProductDetails = /*@__PURE__*/ proxyCustomElement(class
|
|
|
35
35
|
this.productSelectedHandler = null;
|
|
36
36
|
// handle selecting a product (toggle)
|
|
37
37
|
this.onSelectProduct = (sectionId, product) => {
|
|
38
|
+
const productId = product.id;
|
|
39
|
+
const wasSelected = this.selectedProducts[sectionId]?.has(productId) ?? false;
|
|
40
|
+
const section = this.sections.find(s => s.id == sectionId);
|
|
41
|
+
if (wasSelected && section && this.isProductSelectionLocked(section)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!wasSelected) {
|
|
45
|
+
if (!section) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (this.getEffectiveMax(section) !== 1 && this.isAtSelectionLimit(section)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
38
52
|
this.selectedProducts = {
|
|
39
53
|
...this.selectedProducts,
|
|
40
54
|
[sectionId]: new Set(this.selectedProducts[sectionId] || []),
|
|
41
55
|
};
|
|
42
|
-
const productId = product.id;
|
|
43
|
-
const wasSelected = this.selectedProducts[sectionId].has(productId);
|
|
44
56
|
if (wasSelected) {
|
|
45
|
-
// Product is being deselected
|
|
46
57
|
this.selectedProducts[sectionId].delete(productId);
|
|
47
|
-
// Clear form data and modal options for this product in this specific section
|
|
48
58
|
this.clearProductFormData(productId, sectionId);
|
|
49
59
|
this.clearProductModalOptions(productId, sectionId);
|
|
50
60
|
}
|
|
51
61
|
else {
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
const effectiveMax = this.getEffectiveMax(section);
|
|
63
|
+
if (effectiveMax === 1) {
|
|
64
|
+
this.syncSectionSelection(sectionId, productId);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
this.selectedProducts[sectionId].add(productId);
|
|
68
|
+
}
|
|
54
69
|
}
|
|
55
70
|
// force re-render
|
|
56
71
|
this.selectedProducts = { ...this.selectedProducts };
|
|
@@ -70,31 +85,45 @@ const SallaMultipleBundleProductDetails = /*@__PURE__*/ proxyCustomElement(class
|
|
|
70
85
|
[sectionId]: new Set(this.selectedProducts[sectionId] || []),
|
|
71
86
|
};
|
|
72
87
|
const productId = product.id;
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
if (this.selectedProducts[sectionId].has(productId)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const section = this.sections.find(s => s.id == sectionId);
|
|
92
|
+
if (!section) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const effectiveMax = this.getEffectiveMax(section);
|
|
96
|
+
if (effectiveMax === 1) {
|
|
97
|
+
this.syncSectionSelection(sectionId, productId);
|
|
98
|
+
}
|
|
99
|
+
else if (effectiveMax > 1 && this.isAtSelectionLimit(section)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
75
103
|
this.selectedProducts[sectionId].add(productId);
|
|
76
|
-
// force re-render
|
|
77
|
-
this.selectedProducts = { ...this.selectedProducts };
|
|
78
|
-
// dispatch event
|
|
79
|
-
salla.event.dispatch('on-bundle-product-selected', {
|
|
80
|
-
id: product.id,
|
|
81
|
-
name: product.name,
|
|
82
|
-
options: product.options,
|
|
83
|
-
});
|
|
84
104
|
}
|
|
105
|
+
this.selectedProducts = { ...this.selectedProducts };
|
|
106
|
+
salla.event.dispatch('on-bundle-product-selected', {
|
|
107
|
+
id: product.id,
|
|
108
|
+
name: product.name,
|
|
109
|
+
options: product.options,
|
|
110
|
+
});
|
|
85
111
|
};
|
|
86
112
|
// open product options modal
|
|
87
113
|
this.onSelectProductOptions = (product, sectionId) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
114
|
+
const section = this.sections.find(s => s.id == sectionId);
|
|
115
|
+
if (!section || !this.canSelectProductInSection(section, product.id)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const sectionIndex = this.sections.findIndex(s => s.id == sectionId);
|
|
119
|
+
const productIndex = section.products?.findIndex(p => p.id == product.id) ?? 0;
|
|
120
|
+
const isProductAlreadySelected = this.selectedProducts[sectionId]?.has(product.id) ?? false;
|
|
93
121
|
salla.event.dispatch('multiple-bundle-product-modal::open', {
|
|
94
122
|
product,
|
|
95
123
|
sectionId,
|
|
96
124
|
sectionIndex,
|
|
97
125
|
productIndex,
|
|
126
|
+
isProductAlreadySelected,
|
|
98
127
|
});
|
|
99
128
|
};
|
|
100
129
|
// Event handlers for bundle slider component
|
|
@@ -107,22 +136,164 @@ const SallaMultipleBundleProductDetails = /*@__PURE__*/ proxyCustomElement(class
|
|
|
107
136
|
this.onSelectProductOptions(product, sectionId);
|
|
108
137
|
};
|
|
109
138
|
}
|
|
139
|
+
isSingleProductSection(section) {
|
|
140
|
+
return (section.products?.length ?? 0) === 1;
|
|
141
|
+
}
|
|
142
|
+
getObligatoryMin(section) {
|
|
143
|
+
const min = section.obligatory_products;
|
|
144
|
+
if (min == null) {
|
|
145
|
+
return 0;
|
|
146
|
+
}
|
|
147
|
+
const numericMin = Number(min);
|
|
148
|
+
return Number.isNaN(numericMin) ? 0 : numericMin;
|
|
149
|
+
}
|
|
150
|
+
isProductSelectionLocked(section) {
|
|
151
|
+
return this.isSingleProductSection(section) && this.getObligatoryMin(section) === 1;
|
|
152
|
+
}
|
|
153
|
+
/** Empty max → cap is the number of products in the section. */
|
|
154
|
+
getEffectiveMax(section) {
|
|
155
|
+
const productCount = section.products?.length ?? 0;
|
|
156
|
+
const max = section.max_obligatory_products;
|
|
157
|
+
if (max != null && max > 0) {
|
|
158
|
+
return Math.min(max, productCount);
|
|
159
|
+
}
|
|
160
|
+
return productCount;
|
|
161
|
+
}
|
|
162
|
+
getSelectedCount(sectionId) {
|
|
163
|
+
return this.selectedProducts[sectionId]?.size ?? 0;
|
|
164
|
+
}
|
|
165
|
+
isAtSelectionLimit(section) {
|
|
166
|
+
return this.getSelectedCount(section.id) >= this.getEffectiveMax(section);
|
|
167
|
+
}
|
|
168
|
+
canSelectProductInSection(section, productId) {
|
|
169
|
+
if (this.selectedProducts[section.id]?.has(productId)) {
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
if (this.getEffectiveMax(section) === 1) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return !this.isAtSelectionLimit(section);
|
|
176
|
+
}
|
|
177
|
+
async canSelectBundleProduct(sectionId, productId) {
|
|
178
|
+
const section = this.sections.find(s => s.id == sectionId);
|
|
179
|
+
if (!section) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
return this.canSelectProductInSection(section, productId);
|
|
183
|
+
}
|
|
184
|
+
queryProductCheckbox(sectionId, productIndex) {
|
|
185
|
+
const selector = `input.s-multiple-bundle-product-checkbox[name="bundle[${sectionId}][${productIndex}][id]"]`;
|
|
186
|
+
const form = this.host.closest('form');
|
|
187
|
+
const fromForm = form?.querySelector(selector);
|
|
188
|
+
if (fromForm) {
|
|
189
|
+
return fromForm;
|
|
190
|
+
}
|
|
191
|
+
for (const slider of this.host.querySelectorAll('salla-multiple-bundle-product-slider')) {
|
|
192
|
+
const root = slider.shadowRoot ?? slider;
|
|
193
|
+
const input = root.querySelector(selector);
|
|
194
|
+
if (input) {
|
|
195
|
+
return input;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
dispatchBubblingChange(target) {
|
|
201
|
+
requestAnimationFrame(() => {
|
|
202
|
+
target.dispatchEvent(new window.Event('change', { bubbles: true }));
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/** Uncheck checkbox, remove form inputs, and reset modal state for one product slot. */
|
|
206
|
+
clearSectionProductSlot(sectionId, productId, productIndex) {
|
|
207
|
+
const checkbox = this.queryProductCheckbox(sectionId, productIndex);
|
|
208
|
+
if (checkbox) {
|
|
209
|
+
checkbox.checked = false;
|
|
210
|
+
}
|
|
211
|
+
const form = this.host.closest('form');
|
|
212
|
+
if (form) {
|
|
213
|
+
const slotPrefix = `bundle[${sectionId}][${productIndex}]`;
|
|
214
|
+
Array.from(form.querySelectorAll('input')).forEach((input) => {
|
|
215
|
+
const inSlot = input.name?.startsWith(slotPrefix) ?? false;
|
|
216
|
+
if (!inSlot) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (input.type === 'checkbox' && input.name?.endsWith('][id]')) {
|
|
220
|
+
input.checked = false;
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
input.remove();
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
this.clearProductModalOptions(productId, sectionId);
|
|
227
|
+
}
|
|
228
|
+
/** max=1: replace section selection and keep DOM/form in sync. */
|
|
229
|
+
syncSectionSelection(sectionId, productId) {
|
|
230
|
+
const section = this.sections.find(s => s.id == sectionId);
|
|
231
|
+
section?.products?.forEach((product, productIndex) => {
|
|
232
|
+
if (product.id != productId) {
|
|
233
|
+
this.clearSectionProductSlot(sectionId, product.id, productIndex);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
this.selectedProducts[sectionId] = new Set([productId]);
|
|
237
|
+
const selectedIndex = section?.products?.findIndex(p => p.id == productId) ?? -1;
|
|
238
|
+
const checkbox = selectedIndex >= 0 ? this.queryProductCheckbox(sectionId, selectedIndex) : null;
|
|
239
|
+
if (checkbox) {
|
|
240
|
+
checkbox.checked = true;
|
|
241
|
+
this.dispatchBubblingChange(checkbox);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
autoSelectSingleProductSections() {
|
|
245
|
+
if (!this.sections?.length) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const newSelectedProducts = { ...this.selectedProducts };
|
|
249
|
+
let updated = false;
|
|
250
|
+
const selectedEvents = [];
|
|
251
|
+
for (const section of this.sections) {
|
|
252
|
+
if (!this.isProductSelectionLocked(section)) {
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
const product = section.products?.[0];
|
|
256
|
+
if (!product || (!product.unlimited_quantity && (product.quantity ?? 0) <= 0)) {
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
const sectionId = section.id;
|
|
260
|
+
const currentSet = new Set(newSelectedProducts[sectionId] || []);
|
|
261
|
+
if (currentSet.has(product.id)) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
currentSet.add(product.id);
|
|
265
|
+
newSelectedProducts[sectionId] = currentSet;
|
|
266
|
+
updated = true;
|
|
267
|
+
selectedEvents.push({ product });
|
|
268
|
+
}
|
|
269
|
+
if (!updated) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
this.selectedProducts = newSelectedProducts;
|
|
273
|
+
selectedEvents.forEach(({ product }) => {
|
|
274
|
+
salla.event.dispatch('on-bundle-product-selected', {
|
|
275
|
+
id: product.id,
|
|
276
|
+
name: product.name,
|
|
277
|
+
options: product.options,
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
}
|
|
110
281
|
// Clear form data for a specific product in specific section
|
|
111
282
|
clearProductFormData(productId, sectionId) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
inputsToRemove.forEach(input => input.remove());
|
|
283
|
+
if (sectionId != null) {
|
|
284
|
+
const section = this.sections.find(s => s.id == sectionId);
|
|
285
|
+
const productIndex = section?.products?.findIndex(product => product.id == productId) ?? -1;
|
|
286
|
+
if (productIndex >= 0) {
|
|
287
|
+
this.clearSectionProductSlot(sectionId, productId, productIndex);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
120
290
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
inputsToRemove.forEach(input => input.remove());
|
|
291
|
+
const form = this.host.closest('form');
|
|
292
|
+
if (!form) {
|
|
293
|
+
return;
|
|
125
294
|
}
|
|
295
|
+
const inputsToRemove = form.querySelectorAll(`[data-product-id="${productId}"]`);
|
|
296
|
+
inputsToRemove.forEach(input => input.remove());
|
|
126
297
|
}
|
|
127
298
|
// Clear modal options state for a specific product
|
|
128
299
|
clearProductModalOptions(productId, sectionId) {
|
|
@@ -146,10 +317,42 @@ const SallaMultipleBundleProductDetails = /*@__PURE__*/ proxyCustomElement(class
|
|
|
146
317
|
productIndex,
|
|
147
318
|
});
|
|
148
319
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
320
|
+
getProgressStatus(section) {
|
|
321
|
+
const selectedCount = this.getSelectedCount(section.id);
|
|
322
|
+
const effectiveMax = this.getEffectiveMax(section);
|
|
323
|
+
if (effectiveMax > 0) {
|
|
324
|
+
return `${selectedCount}/${effectiveMax}`;
|
|
325
|
+
}
|
|
326
|
+
return '0';
|
|
327
|
+
}
|
|
328
|
+
getSectionSelectionNote(section) {
|
|
329
|
+
const min = this.getObligatoryMin(section);
|
|
330
|
+
const max = Number(section.max_obligatory_products) || 0;
|
|
331
|
+
const hasMin = min > 0;
|
|
332
|
+
const hasMax = max > 0;
|
|
333
|
+
if (!hasMin && !hasMax) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
if (hasMin && hasMax) {
|
|
337
|
+
if (min === max) {
|
|
338
|
+
return salla.lang.getWithDefault('pages.products.bundle_select_exact', `اختر ${min} منتجات`, { count: min });
|
|
339
|
+
}
|
|
340
|
+
return salla.lang.getWithDefault('pages.products.bundle_select_range', `اختر من ${min} إلى ${max} منتجات`, { min, max });
|
|
341
|
+
}
|
|
342
|
+
if (hasMin) {
|
|
343
|
+
return salla.lang.getWithDefault('pages.products.bundle_select_min', `اختر على الأقل ${min} منتجات`, { min });
|
|
344
|
+
}
|
|
345
|
+
return salla.lang.getWithDefault('pages.products.bundle_select_max', `اختر حتى ${max} منتجات`, { max });
|
|
346
|
+
}
|
|
347
|
+
handleSectionsChange() {
|
|
348
|
+
this.autoSelectSingleProductSections();
|
|
349
|
+
}
|
|
350
|
+
componentWillLoad() {
|
|
351
|
+
this.autoSelectSingleProductSections();
|
|
352
|
+
}
|
|
353
|
+
renderAccordionHeader(section) {
|
|
354
|
+
const selectionNote = this.getSectionSelectionNote(section);
|
|
355
|
+
return (h(Fragment, null, h("h2", { slot: "title" }, section?.name), selectionNote ? h("span", { slot: "note" }, selectionNote) : null, h("span", { slot: "progress" }, this.getProgressStatus(section))));
|
|
153
356
|
}
|
|
154
357
|
componentDidLoad() {
|
|
155
358
|
// Listen for product selected event from modal
|
|
@@ -180,16 +383,21 @@ const SallaMultipleBundleProductDetails = /*@__PURE__*/ proxyCustomElement(class
|
|
|
180
383
|
}
|
|
181
384
|
}
|
|
182
385
|
render() {
|
|
183
|
-
return (h(Host, { key: '
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
})), h("salla-multiple-bundle-product-options-modal", { key: '6627ee4f67bcd775b16e470dd4735848e6087fd4' })));
|
|
386
|
+
return (h(Host, { key: '74b123c432e77263cf0ddcf20ab742885c54d5f4', class: "s-multiple-bundle-product-wrapper" }, h("div", { key: '24bef0958a2a7d29bb4485eac08c7e6b8614a00d', class: "s-multiple-bundle-product-wrapper-sections" }, this.sections.map((section, index) => {
|
|
387
|
+
return (h("salla-accordion", { key: section.id, collapsed: index === 0 ? false : true }, h("salla-accordion-head", null, this.renderAccordionHeader(section)), h("salla-accordion-body", null, h("salla-multiple-bundle-product-slider", { section: section, sectionIndex: index, selectedProducts: this.selectedProducts, selectionLimit: this.getEffectiveMax(section), isSelectionLocked: this.isProductSelectionLocked(section), onProductSelected: this.handleBundleSliderProductSelected, onProductOptionsSelected: this.handleBundleSliderProductOptionsSelected }))));
|
|
388
|
+
})), h("salla-multiple-bundle-product-options-modal", { key: '556b4e51a4b79dfc00371a07296556fb74111524' })));
|
|
187
389
|
}
|
|
188
390
|
get host() { return this; }
|
|
391
|
+
static get watchers() { return {
|
|
392
|
+
"sections": ["handleSectionsChange"]
|
|
393
|
+
}; }
|
|
189
394
|
static get style() { return sallaMultipleBundleProductDetailsCss; }
|
|
190
395
|
}, [0, "salla-multiple-bundle-product-details", {
|
|
191
396
|
"sections": [16],
|
|
192
|
-
"selectedProducts": [32]
|
|
397
|
+
"selectedProducts": [32],
|
|
398
|
+
"canSelectBundleProduct": [64]
|
|
399
|
+
}, undefined, {
|
|
400
|
+
"sections": ["handleSectionsChange"]
|
|
193
401
|
}]);
|
|
194
402
|
function defineCustomElement() {
|
|
195
403
|
if (typeof customElements === "undefined") {
|
|
@@ -34,6 +34,7 @@ const SallaMultipleBundleProductOptionsModal = /*@__PURE__*/ proxyCustomElement(
|
|
|
34
34
|
this.isLoading = false;
|
|
35
35
|
this.hasUnsavedChanges = false;
|
|
36
36
|
this.validationErrors = [];
|
|
37
|
+
this.isProductAlreadySelected = false;
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Generate a unique cache key for selected options using section ID, product index, and product ID
|
|
@@ -95,6 +96,7 @@ const SallaMultipleBundleProductOptionsModal = /*@__PURE__*/ proxyCustomElement(
|
|
|
95
96
|
this.sectionId = data.sectionId || null;
|
|
96
97
|
this.sectionIndex = data.sectionIndex || 0;
|
|
97
98
|
this.productIndex = data.productIndex || 0;
|
|
99
|
+
this.isProductAlreadySelected = !!data.isProductAlreadySelected;
|
|
98
100
|
this.open();
|
|
99
101
|
};
|
|
100
102
|
salla.event.on('multiple-bundle-product-modal::open', this.modalOpenListener);
|
|
@@ -125,6 +127,10 @@ const SallaMultipleBundleProductOptionsModal = /*@__PURE__*/ proxyCustomElement(
|
|
|
125
127
|
// Extract section info from the checkbox name: bundle[sectionId][productIndex][id]
|
|
126
128
|
const nameMatch = target.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);
|
|
127
129
|
if (nameMatch && !target.checked) {
|
|
130
|
+
if (target.getAttribute('data-selection-locked') === 'true') {
|
|
131
|
+
target.checked = true;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
128
134
|
const [, sectionId, productIndex] = nameMatch;
|
|
129
135
|
const productId = target.value;
|
|
130
136
|
const form = this.host.closest('form');
|
|
@@ -363,6 +369,14 @@ const SallaMultipleBundleProductOptionsModal = /*@__PURE__*/ proxyCustomElement(
|
|
|
363
369
|
salla.notify.error(this.validationErrors.join(', '));
|
|
364
370
|
return;
|
|
365
371
|
}
|
|
372
|
+
if (!this.isProductAlreadySelected && this.sectionId != null) {
|
|
373
|
+
const details = this.host.closest('salla-multiple-bundle-product-details');
|
|
374
|
+
const canSelect = await details?.canSelectBundleProduct(this.sectionId, productId);
|
|
375
|
+
if (!canSelect) {
|
|
376
|
+
salla.notify.error(salla.lang.getWithDefault('pages.products.bundle_selection_limit_reached', 'لا يمكنك اختيار المزيد من المنتجات في هذا القسم'));
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
366
380
|
this.isLoading = true;
|
|
367
381
|
try {
|
|
368
382
|
// please don't change this with this.host.querySelector it will return null
|
|
@@ -479,7 +493,7 @@ const SallaMultipleBundleProductOptionsModal = /*@__PURE__*/ proxyCustomElement(
|
|
|
479
493
|
const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
|
|
480
494
|
const resetToken = this.optionsResetTokens[cacheKey] || 0;
|
|
481
495
|
const isDisabled = this.isLoading || optionsWithSelectedState.some(opt => opt.details.some(d => d.is_selected && d.is_out === true));
|
|
482
|
-
return (h(Host, { key: '
|
|
496
|
+
return (h(Host, { key: '6c1d1d3911867e30240676f3e2b7353e9ecf76c3' }, h("salla-modal", { key: 'b02110d80cd422d64962d78812ae0b0637c56237', isLoading: this.isLoading, ref: el => (this.modal = el), width: "md", centered: false, id: `s-multiple-bundle-product-options-modal-options-${productId}`, class: "s-multiple-bundle-product-options-modal-wrapper" }, h("div", { key: '20a52bbc732c6edfffde86577e99bbe300a1a4c8', slot: "loading" }, h("salla-skeleton", { key: '3a69fc75939d8b8f8639983d0f2f8dd8bf961152', height: "100%", width: "100%" })), this.product?.images && this.product?.images.length > 0 && (h("salla-slider", { key: '185639c54f79188093df98ac1cece1958879f71d', id: `details-slider-${this.product?.id}`, type: "thumbs", loop: false, "auto-height": true, "listen-to-thumbnails-option": true, showThumbsControls: false, controlsOuter: false, showControls: false, class: "s-multiple-bundle-product-options-modal-slider", verticalThumbs: true, thumbsConfig: {
|
|
483
497
|
centeredSlides: true,
|
|
484
498
|
centeredSlidesBounds: true,
|
|
485
499
|
slidesPerView: Math.min(5, Math.max(1, this.product?.images.length)),
|
|
@@ -487,13 +501,13 @@ const SallaMultipleBundleProductOptionsModal = /*@__PURE__*/ proxyCustomElement(
|
|
|
487
501
|
watchSlidesProgress: true,
|
|
488
502
|
direction: 'vertical',
|
|
489
503
|
spaceBetween: 10,
|
|
490
|
-
} }, h("div", { key: '
|
|
504
|
+
} }, h("div", { key: '3b6a88fe3862870d674dadc31967df6cc8fac365', slot: "items" }, this.product?.images &&
|
|
491
505
|
this.product?.images.map((image, index) => (h("div", { key: index, class: "swiper-slide" }, h("img", { src: image.url, alt: image.alt || `${this.product?.name} - Image ${index + 1}`, loading: "lazy", onError: e => {
|
|
492
506
|
e.target.style.display = 'none';
|
|
493
|
-
} }))))), this.product?.images && this.product?.images.length > 1 && (h("div", { key: '
|
|
507
|
+
} }))))), this.product?.images && this.product?.images.length > 1 && (h("div", { key: '6fce48b5b035cc61866aaf6c339866fa2314be87', slot: "thumbs" }, this.product?.images &&
|
|
494
508
|
this.product?.images.map((image, index) => (h("div", { key: index, "data-caption": `${this.product?.name} - Image ${index + 1}` }, h("img", { src: image.url, loading: "eager", class: "s-multiple-bundle-product-options-modal-slider-thumb", title: `${this.product?.name} - ${index + 1}`, alt: image.alt || `${this.product?.name} - ${index + 1}`, onError: e => {
|
|
495
509
|
e.target.style.display = 'none';
|
|
496
|
-
} })))))))), h("salla-product-options", { options: JSON.stringify(optionsWithSelectedState), key: `${cacheKey}-reset-${resetToken}`, "product-id": productId, "unique-key": `${cacheKey}-reset-${resetToken}` }), h("div", { key: '
|
|
510
|
+
} })))))))), h("salla-product-options", { options: JSON.stringify(optionsWithSelectedState), key: `${cacheKey}-reset-${resetToken}`, "product-id": productId, "unique-key": `${cacheKey}-reset-${resetToken}` }), h("div", { key: '3d555ea40fe5d9f3685fc6dafa4b6fad16732091', slot: "footer" }, h("div", { key: '1b4c6834899efbd09f3ea1db251999f50ec655b2', class: "s-multiple-bundle-product-options-modal-footer" }, h("salla-button", { key: '0818a75a444cca510c7f0cfea2ec53414c12db53', onClick: e => this.onSave(e), loading: this.isLoading, disabled: isDisabled }, this.isLoading
|
|
497
511
|
? salla.lang.get('common.elements.saving')
|
|
498
512
|
: salla.lang.get('common.elements.save')))))));
|
|
499
513
|
}
|
|
@@ -15,39 +15,71 @@ const SallaMultipleBundleProductSlider = /*@__PURE__*/ proxyCustomElement(class
|
|
|
15
15
|
this.productOptionsSelected = createEvent(this, "productOptionsSelected", 7);
|
|
16
16
|
/** A dictionary tracking which product IDs are currently selected per section. */
|
|
17
17
|
this.selectedProducts = {};
|
|
18
|
+
/** When true, the selected product cannot be deselected (single-product section with min = 1). */
|
|
19
|
+
this.isSelectionLocked = false;
|
|
20
|
+
/** Maximum selectable products for this section (empty max → all products in section). */
|
|
21
|
+
this.selectionLimit = 0;
|
|
18
22
|
this.savedOptionsByInstance = {};
|
|
19
23
|
this.handleProductClick = (product, productIndex) => {
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (checkbox) {
|
|
26
|
-
const willBeChecked = !checkbox.checked;
|
|
27
|
-
if (!willBeChecked) {
|
|
28
|
-
this.dispatchClearOptionsEvent(product, productIndex);
|
|
29
|
-
this.clearSavedOptionsState(this.section.id, productIndex);
|
|
24
|
+
const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
|
|
25
|
+
const checkbox = this.getCheckbox(this.section.id, productIndex);
|
|
26
|
+
if (isChecked && this.isSelectionLocked) {
|
|
27
|
+
if (checkbox) {
|
|
28
|
+
checkbox.checked = true;
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!isChecked && this.isMaxSelectionReached() && this.selectionLimit !== 1) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// max = 1: parent replaces selection and syncs all checkboxes in the section
|
|
36
|
+
if (this.selectionLimit === 1 && !isChecked) {
|
|
37
|
+
this.productSelected.emit({
|
|
38
|
+
product,
|
|
39
|
+
sectionId: this.section.id,
|
|
37
40
|
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!checkbox)
|
|
44
|
+
return;
|
|
45
|
+
const willBeChecked = !checkbox.checked;
|
|
46
|
+
if (!willBeChecked) {
|
|
47
|
+
this.dispatchClearOptionsEvent(product, productIndex);
|
|
48
|
+
this.clearSavedOptionsState(this.section.id, productIndex);
|
|
38
49
|
}
|
|
50
|
+
checkbox.checked = willBeChecked;
|
|
51
|
+
requestAnimationFrame(() => {
|
|
52
|
+
const changeEvent = new window.Event('change', { bubbles: true });
|
|
53
|
+
checkbox.dispatchEvent(changeEvent);
|
|
54
|
+
});
|
|
39
55
|
this.productSelected.emit({
|
|
40
56
|
product,
|
|
41
57
|
sectionId: this.section.id,
|
|
42
58
|
});
|
|
43
59
|
};
|
|
44
60
|
this.handleOptionsClick = (product) => {
|
|
61
|
+
const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
|
|
62
|
+
if (!isChecked && this.isMaxSelectionReached() && this.selectionLimit !== 1) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
45
65
|
this.productOptionsSelected.emit({
|
|
46
66
|
product,
|
|
47
67
|
sectionId: this.section.id,
|
|
48
68
|
});
|
|
49
69
|
};
|
|
50
70
|
}
|
|
71
|
+
getSelectedCount() {
|
|
72
|
+
return this.selectedProducts[this.section?.id]?.size ?? 0;
|
|
73
|
+
}
|
|
74
|
+
isMaxSelectionReached() {
|
|
75
|
+
return this.selectionLimit > 1 && this.getSelectedCount() >= this.selectionLimit;
|
|
76
|
+
}
|
|
77
|
+
isProductSelectionDisabled(product, isChecked) {
|
|
78
|
+
if (product.quantity === 0) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return !isChecked && this.isMaxSelectionReached();
|
|
82
|
+
}
|
|
51
83
|
getProductInstanceKey(sectionId, productIndex) {
|
|
52
84
|
return `${sectionId}::${productIndex}`;
|
|
53
85
|
}
|
|
@@ -93,9 +125,26 @@ const SallaMultipleBundleProductSlider = /*@__PURE__*/ proxyCustomElement(class
|
|
|
93
125
|
generateEventName(sectionId, productIndex) {
|
|
94
126
|
return `bundle[${sectionId}][${productIndex}][id]`;
|
|
95
127
|
}
|
|
128
|
+
getCheckbox(sectionId, productIndex) {
|
|
129
|
+
const name = this.generateEventName(sectionId, productIndex);
|
|
130
|
+
return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${name}"]`);
|
|
131
|
+
}
|
|
132
|
+
preventLockedDeselect(event, isChecked) {
|
|
133
|
+
if (!this.isSelectionLocked || !isChecked) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
event.stopPropagation();
|
|
138
|
+
const checkbox = event.target;
|
|
139
|
+
if (checkbox?.type === 'checkbox') {
|
|
140
|
+
checkbox.checked = true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
96
143
|
render() {
|
|
97
|
-
return (h(Host, { key: '
|
|
144
|
+
return (h(Host, { key: 'd52eb26454606df2526fa4c086110a54f7466644' }, h("salla-slider", { key: '1aa1fce5943c3721a8e4f762171c864d9097bb28', type: "carousel", controlsOuter: false, showControls: false, id: `accordion-multiple-bundle-product-${this.section.id}`, pagination: true, class: "s-multiple-bundle-product-wrapper-slider", sliderConfig: { spaceBetween: 0 } }, h("div", { key: '9342381bc43389bae48b906a1ab23a4f3cf8d00a', slot: "items" }, this?.section?.products?.map((product, productIndex) => {
|
|
98
145
|
const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
|
|
146
|
+
const isLocked = isChecked && this.isSelectionLocked;
|
|
147
|
+
const isDisabled = this.isProductSelectionDisabled(product, isChecked);
|
|
99
148
|
const hasSavedOptions = this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id, productIndex)];
|
|
100
149
|
const optionsButtonLabel = hasSavedOptions
|
|
101
150
|
? salla.lang.getWithDefault('pages.products.edit_selected_options', 'تعديل الخيارات')
|
|
@@ -103,9 +152,7 @@ const SallaMultipleBundleProductSlider = /*@__PURE__*/ proxyCustomElement(class
|
|
|
103
152
|
let optionsArrowIcon = salla.config.get('theme.is_rtl', true)
|
|
104
153
|
? KeyBoardArrowLeftIcon
|
|
105
154
|
: KeyBoardArrowRightIcon;
|
|
106
|
-
return (h("div", { class: `s-multiple-bundle-product-slide-one-third
|
|
107
|
-
? 's-multiple-bundle-product-slide-one-third-disabled'
|
|
108
|
-
: ''}`, key: product.id }, h("div", { class: "s-multiple-bundle-product-card" }, h("div", { class: "s-multiple-bundle-product-image-wrapper", onClick: () => this.handleProductClick(product, productIndex) }, h("input", { id: this.generateEventName(this.section.id, productIndex), type: "checkbox", class: "s-multiple-bundle-product-checkbox", checked: isChecked, name: this.generateEventName(this.section.id, productIndex), value: product.id }), h("img", { src: product.image.url || salla.url.cdn('images/s-empty.png'), loading: "lazy", alt: product.image.alt || product.name, class: "s-multiple-bundle-product-image" })), h("div", { class: "s-multiple-bundle-product-content-wrapper" }, h("div", { class: "s-multiple-bundle-product-content" }, h("div", { class: "s-multiple-bundle-product-details" }, h("div", { class: "s-multiple-bundle-product-title-wrapper" }, h("h2", { class: "s-multiple-bundle-product-title" }, h("a", { href: product?.url || '#', target: "_blank", rel: "noopener noreferrer" }, product.name))), h("div", { class: "s-multiple-bundle-product-price-wrapper" }, h("span", { class: "s-multiple-bundle-product-price" }, h("span", { innerHTML: salla.money(product.price) })), product.sale_price > 0 && (h("span", { class: "s-multiple-bundle-product-price-discount" }, h("span", { innerHTML: salla.money(product.regular_price) }))))), product.quantity_in_group > 0 && product.quantity !== 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.pieces'), h("span", null, product.quantity_in_group))), product.quantity === 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.quantity_in_group_finished')))), product.options?.length > 0 && (h("button", { class: "s-multiple-bundle-product-button", onClick: () => this.handleOptionsClick(product), type: "button" }, optionsButtonLabel, h("span", { class: "s-multiple-bundle-product-button-icon", innerHTML: optionsArrowIcon })))))));
|
|
155
|
+
return (h("div", { class: `s-multiple-bundle-product-slide-one-third${isDisabled ? ' s-multiple-bundle-product-slide-one-third-disabled' : ''}`, key: product.id }, h("div", { class: "s-multiple-bundle-product-card" }, h("div", { class: "s-multiple-bundle-product-image-wrapper", onClick: () => this.handleProductClick(product, productIndex) }, h("input", { id: this.generateEventName(this.section.id, productIndex), type: "checkbox", class: "s-multiple-bundle-product-checkbox", checked: isChecked, "data-selection-locked": isLocked ? 'true' : undefined, name: this.generateEventName(this.section.id, productIndex), value: product.id, onClick: event => this.preventLockedDeselect(event, isChecked), onChange: event => this.preventLockedDeselect(event, isChecked) }), h("img", { src: product.image.url || salla.url.cdn('images/s-empty.png'), loading: "lazy", alt: product.image.alt || product.name, class: "s-multiple-bundle-product-image" })), h("div", { class: "s-multiple-bundle-product-content-wrapper" }, h("div", { class: "s-multiple-bundle-product-content" }, h("div", { class: "s-multiple-bundle-product-details" }, h("div", { class: "s-multiple-bundle-product-title-wrapper" }, h("h2", { class: "s-multiple-bundle-product-title" }, h("a", { href: product?.url || '#', target: "_blank", rel: "noopener noreferrer" }, product.name))), h("div", { class: "s-multiple-bundle-product-price-wrapper" }, h("span", { class: "s-multiple-bundle-product-price" }, h("span", { innerHTML: salla.money(product.price) })), product.sale_price > 0 && (h("span", { class: "s-multiple-bundle-product-price-discount" }, h("span", { innerHTML: salla.money(product.regular_price) }))))), product.quantity_in_group > 0 && product.quantity !== 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.pieces'), h("span", null, product.quantity_in_group))), product.quantity === 0 && (h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.quantity_in_group_finished')))), product.options?.length > 0 && (h("button", { class: "s-multiple-bundle-product-button", onClick: () => this.handleOptionsClick(product), type: "button" }, optionsButtonLabel, h("span", { class: "s-multiple-bundle-product-button-icon", innerHTML: optionsArrowIcon })))))));
|
|
109
156
|
})))));
|
|
110
157
|
}
|
|
111
158
|
get host() { return this; }
|
|
@@ -114,6 +161,8 @@ const SallaMultipleBundleProductSlider = /*@__PURE__*/ proxyCustomElement(class
|
|
|
114
161
|
"section": [16],
|
|
115
162
|
"sectionIndex": [2, "section-index"],
|
|
116
163
|
"selectedProducts": [16, "selected-products"],
|
|
164
|
+
"isSelectionLocked": [4, "is-selection-locked"],
|
|
165
|
+
"selectionLimit": [2, "selection-limit"],
|
|
117
166
|
"savedOptionsByInstance": [32]
|
|
118
167
|
}, [[4, "optionsSaved", "handleOptionsSaved"]]]);
|
|
119
168
|
function defineCustomElement() {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
|
|
6
|
-
const sallaProductCardEmbedCss = "";
|
|
6
|
+
const sallaProductCardEmbedCss = ":host(:has(.s-product-card-embed-card-align-left)){float:inline-start;max-width:12rem;margin-block-end:1em;margin-inline-end:1em;shape-outside:margin-box}:host(:has(.s-product-card-embed-card-align-right)){float:inline-end;max-width:12rem;margin-block-end:1em;margin-inline-start:1em;shape-outside:margin-box}:host(:has(.s-product-card-embed-card-align-center)){display:block;clear:both;max-width:12rem;margin-block:1em;margin-inline:auto}:host(:has(.s-product-card-embed-card-align-left)) .s-product-card-embed-card-align-left,:host(:has(.s-product-card-embed-card-align-right)) .s-product-card-embed-card-align-right{float:none}";
|
|
7
7
|
|
|
8
8
|
const SallaProductCardEmbed$1 = /*@__PURE__*/ proxyCustomElement(class SallaProductCardEmbed extends HTMLElement {
|
|
9
9
|
constructor() {
|