@salla.sa/twilight-components 2.14.556 → 2.14.558
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/{esm/cart-DY4LZmNP.js → cjs/cart-DSvlJXCH.js} +4 -2
- package/dist/cjs/{filepond-t0Yy69qV.js → filepond-LS8ytqmE.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DNZM6Czl.js → filepond-plugin-file-poster-DexU9y97.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BPMIodJt.js → filepond-plugin-file-validate-size-BJJ_spY7.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DgYmyGCI.js → filepond-plugin-file-validate-type-BYz_biwv.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-B4itf01h.js → filepond-plugin-image-edit-C3R9xG9P.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Dj43xu10.js → filepond-plugin-image-exif-orientation-DC7e2K9l.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-C6Gm9i9o.js → filepond-plugin-image-preview-DLbo1P7r.js} +1 -1
- package/dist/cjs/{index-DyL5Ypj3.js → index-BkcJlC9S.js} +14 -14
- package/dist/cjs/{intlTelInput-BTUy-aYK.js → intlTelInput-DvZz7cvU.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 +21 -6
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +3 -3
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +3 -3
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +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 +5 -5
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +3 -3
- 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 +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_2.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_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 +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-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-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 +224 -46
- package/dist/cjs/salla-payments.cjs.entry.js +76 -2
- 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 +48 -13
- 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-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +33 -4
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -2
- 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.cjs.entry.js +279 -33
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -165
- 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 +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-C_t8j4f7.js → vanilla-picker-COagKVR0.js} +1 -1
- package/dist/collection/components/salla-button/salla-button.js +32 -2
- package/dist/collection/components/salla-modal/salla-modal.css +34 -16
- package/dist/collection/components/salla-modal/salla-modal.js +27 -2
- package/dist/collection/components/salla-orders/salla-orders.css +122 -0
- package/dist/collection/components/salla-orders/salla-orders.js +231 -45
- package/dist/collection/components/salla-payments/salla-payments.css +3 -0
- package/dist/collection/components/salla-payments/salla-payments.js +74 -0
- package/dist/collection/components/salla-product-card/salla-product-card.css +22 -2
- package/dist/collection/components/salla-product-card/salla-product-card.js +106 -11
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +32 -3
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -1
- package/dist/collection/components/salla-search/interfaces.js +1 -0
- package/dist/collection/components/salla-search/salla-search.css +324 -14
- package/dist/collection/components/salla-search/salla-search.js +179 -32
- package/dist/collection/components/salla-search/utils.js +111 -0
- package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.css +1 -16
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -163
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/salla-button2.js +13 -2
- package/dist/components/salla-modal2.js +9 -3
- package/dist/components/salla-orders.js +294 -48
- package/dist/components/salla-payments.js +75 -1
- package/dist/components/salla-product-card2.js +50 -12
- package/dist/components/salla-rating-modal-v22.js +32 -3
- package/dist/components/salla-rating-modal2.js +2 -1
- package/dist/components/salla-search.js +392 -39
- package/dist/components/salla-searchable-dropdown2.js +4 -4
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share2.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-trust-badges.js +2 -164
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/components/salla-wishlist-actions.js +1 -1
- package/dist/{cjs/cart-s-x1Fshk.js → esm/cart-gFG8By9O.js} +2 -4
- package/dist/esm/{filepond-Dl-e9LIA.js → filepond-D5Fnwsco.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-B44qzFr7.js → filepond-plugin-file-poster-BfePPO64.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DeewGi6D.js → filepond-plugin-file-validate-size-CVpLCDVB.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DquQHM9K.js → filepond-plugin-file-validate-type-BhzMnQfH.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DPSC2V4u.js → filepond-plugin-image-edit-Bvj3qwXE.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-A-4MC3po.js → filepond-plugin-image-exif-orientation-NlBBLgPL.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-vvc3KNls.js → filepond-plugin-image-preview-CA1k8ex-.js} +1 -1
- package/dist/esm/{index-BJmvvw9H.js → index-B6Lo-Jz2.js} +14 -14
- package/dist/esm/{intlTelInput-DFX9QeWQ.js → intlTelInput-nu7FH85H.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 +21 -6
- package/dist/esm/salla-add-product-button_5.entry.js +3 -3
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +3 -3
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +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 +5 -5
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +3 -3
- 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 +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_2.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_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 +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-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-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 +224 -46
- package/dist/esm/salla-payments.entry.js +76 -2
- 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 +48 -13
- 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-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +33 -4
- package/dist/esm/salla-rating-modal.entry.js +3 -2
- 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.entry.js +279 -33
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-trust-badges.entry.js +3 -165
- package/dist/esm/salla-user-menu.entry.js +3 -3
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +2 -2
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-Ld2F0WbU.js → vanilla-picker-Dn7Q0By-.js} +1 -1
- package/dist/twilight/{p-f0c19b59.entry.js → p-00f3dc2a.entry.js} +1 -1
- package/dist/twilight/{p-cc3c48b4.entry.js → p-051740db.entry.js} +1 -1
- package/dist/twilight/{p-95b8806a.entry.js → p-05f65278.entry.js} +1 -1
- package/dist/twilight/{p-3ec284fd.entry.js → p-0e9845d3.entry.js} +1 -1
- package/dist/twilight/{p-5391291e.entry.js → p-0ea66288.entry.js} +1 -1
- package/dist/twilight/{p-6b3e668c.entry.js → p-0f9d25c2.entry.js} +1 -1
- package/dist/twilight/{p-f6e44ad6.entry.js → p-100cb969.entry.js} +1 -1
- package/dist/twilight/{p-b654ffbd.entry.js → p-11234d66.entry.js} +1 -1
- package/dist/twilight/{p-54b4dec6.entry.js → p-1546f64d.entry.js} +1 -1
- package/dist/twilight/{p-bd68067a.entry.js → p-191b4fa6.entry.js} +1 -1
- package/dist/twilight/p-19607f60.entry.js +4 -0
- package/dist/twilight/p-1d1bbac7.entry.js +4 -0
- package/dist/twilight/{p-7e7f0849.entry.js → p-1d220636.entry.js} +1 -1
- package/dist/twilight/{p-7d0e8486.entry.js → p-1d9aa36c.entry.js} +1 -1
- package/dist/twilight/{p-1b97e436.entry.js → p-257717f5.entry.js} +1 -1
- package/dist/twilight/{p-ec27e0f4.entry.js → p-289574f0.entry.js} +1 -1
- package/dist/twilight/{p-d4263617.entry.js → p-28aeea5d.entry.js} +1 -1
- package/dist/twilight/{p-4df9ca99.entry.js → p-29a9ff44.entry.js} +1 -1
- package/dist/twilight/{p-1882e5b9.entry.js → p-2cb160a8.entry.js} +1 -1
- package/dist/twilight/{p-d8808de5.entry.js → p-2dc5f115.entry.js} +1 -1
- package/dist/twilight/{p-75e126cc.entry.js → p-2de7945d.entry.js} +1 -1
- package/dist/twilight/{p-a1ce8d6d.entry.js → p-2ebe428c.entry.js} +1 -1
- package/dist/twilight/{p-45b85a45.entry.js → p-31c017ae.entry.js} +1 -1
- package/dist/twilight/{p-8a640353.entry.js → p-344e7a53.entry.js} +1 -1
- package/dist/twilight/{p-4023d48a.entry.js → p-3661b790.entry.js} +1 -1
- package/dist/twilight/{p-55c89592.entry.js → p-3c312812.entry.js} +1 -1
- package/dist/twilight/{p-e209addd.entry.js → p-3f12a3a2.entry.js} +1 -1
- package/dist/twilight/{p-d16a17d2.entry.js → p-400c631e.entry.js} +1 -1
- package/dist/twilight/{p-d9e98286.entry.js → p-44f20e64.entry.js} +1 -1
- package/dist/twilight/{p-5af2868f.entry.js → p-4604590c.entry.js} +1 -1
- package/dist/twilight/{p-5b148ad4.entry.js → p-4c422a3d.entry.js} +1 -1
- package/dist/twilight/{p-d5a486bb.entry.js → p-4f645457.entry.js} +1 -1
- package/dist/twilight/{p-5ab257bf.entry.js → p-529a60e2.entry.js} +1 -1
- package/dist/twilight/{p-f37147c7.entry.js → p-5a2150e8.entry.js} +1 -1
- package/dist/twilight/{p-e0f7a4e1.entry.js → p-5d6db148.entry.js} +1 -1
- package/dist/twilight/{p-4ca525cb.entry.js → p-5d6f9c3e.entry.js} +1 -1
- package/dist/twilight/{p-2f59ef9c.entry.js → p-5dcf8a71.entry.js} +1 -1
- package/dist/twilight/{p-c266feb3.entry.js → p-5f4331f0.entry.js} +1 -1
- package/dist/twilight/{p-91351958.entry.js → p-5ffdb544.entry.js} +1 -1
- package/dist/twilight/{p-c4582e2b.entry.js → p-63b48fb1.entry.js} +1 -1
- package/dist/twilight/{p-291d6f2b.entry.js → p-647a1b63.entry.js} +1 -1
- package/dist/twilight/{p-92992a1e.entry.js → p-6840449d.entry.js} +1 -1
- package/dist/twilight/{p-99af9a68.entry.js → p-747fdf8c.entry.js} +1 -1
- package/dist/twilight/{p-918eb4b7.entry.js → p-7512638e.entry.js} +1 -1
- package/dist/twilight/{p-6d7629ee.entry.js → p-75ba562a.entry.js} +1 -1
- package/dist/twilight/{p-3bba916f.entry.js → p-7639c5a8.entry.js} +1 -1
- package/dist/twilight/{p-e64ad9de.entry.js → p-778f38ce.entry.js} +1 -1
- package/dist/twilight/{p-275b49b7.entry.js → p-785ac87d.entry.js} +1 -1
- package/dist/twilight/{p-90d5e633.entry.js → p-78cba566.entry.js} +1 -1
- package/dist/twilight/{p-e0e614d1.entry.js → p-7a78cbcd.entry.js} +1 -1
- package/dist/twilight/{p-3eb18438.entry.js → p-7b286e8d.entry.js} +1 -1
- package/dist/twilight/{p-2f2956d9.entry.js → p-8284d68b.entry.js} +1 -1
- package/dist/twilight/{p-4af910f1.entry.js → p-86622485.entry.js} +1 -1
- package/dist/twilight/{p-67efee3a.entry.js → p-8ca39b58.entry.js} +1 -1
- package/dist/twilight/{p-12a43d43.entry.js → p-8e10a9a9.entry.js} +1 -1
- package/dist/twilight/{p-dff3411a.entry.js → p-8ee698cc.entry.js} +1 -1
- package/dist/twilight/{p-89a82ff5.entry.js → p-8f11c556.entry.js} +1 -1
- package/dist/twilight/p-91ab3a03.entry.js +4 -0
- package/dist/twilight/{p-Ye-NG0xO.js → p-9L0Aq4PZ.js} +1 -1
- package/dist/twilight/{p-BJmvvw9H.js → p-B6Lo-Jz2.js} +1 -1
- package/dist/twilight/{p-BUfrGdXG.js → p-Ble2-eBI.js} +1 -1
- package/dist/twilight/{p-pCB_h2Xn.js → p-BopTxsQ2.js} +1 -1
- package/dist/twilight/{p-SDB-lCJg.js → p-CMHD60jb.js} +1 -1
- package/dist/twilight/{p-DXzyepGb.js → p-CUuXQJdT.js} +1 -1
- package/dist/twilight/{p-DpFFhlK6.js → p-CvrBhStg.js} +1 -1
- package/dist/twilight/{p-BscSw0sZ.js → p-DexDAAf1.js} +1 -1
- package/dist/twilight/{p-CLEHV1kt.js → p-Dgq6RHqV.js} +1 -1
- package/dist/twilight/{p-VDJLgJLw.js → p-VJGJYEfb.js} +1 -1
- package/dist/twilight/p-a1035984.entry.js +4 -0
- package/dist/twilight/{p-74f730e1.entry.js → p-a50073b5.entry.js} +1 -1
- package/dist/twilight/{p-4fdc296f.entry.js → p-a82db499.entry.js} +1 -1
- package/dist/twilight/{p-99702306.entry.js → p-a8d3ae7e.entry.js} +1 -1
- package/dist/twilight/p-a8d90638.entry.js +4 -0
- package/dist/twilight/{p-bfb82c90.entry.js → p-abce7e02.entry.js} +1 -1
- package/dist/twilight/{p-ba5546ab.entry.js → p-ad12ab8c.entry.js} +1 -1
- package/dist/twilight/{p-427d38a0.entry.js → p-adb31a76.entry.js} +1 -1
- package/dist/twilight/{p-601013e8.entry.js → p-b5a68a1a.entry.js} +1 -1
- package/dist/twilight/{p-fdc36d7c.entry.js → p-b695db2e.entry.js} +1 -1
- package/dist/twilight/{p-e1cca558.entry.js → p-ba941354.entry.js} +1 -1
- package/dist/twilight/{p-fa1900ec.entry.js → p-bb94c4e4.entry.js} +1 -1
- package/dist/twilight/{p-fc0304bf.entry.js → p-bbfaf5ac.entry.js} +1 -1
- package/dist/twilight/{p-2815c25a.entry.js → p-be292e0b.entry.js} +1 -1
- package/dist/twilight/{p-cb892619.entry.js → p-be34bd30.entry.js} +1 -1
- package/dist/twilight/{p-cddd3975.entry.js → p-bf2f2a36.entry.js} +1 -1
- package/dist/twilight/p-bfa7a257.entry.js +4 -0
- package/dist/twilight/{p-17522796.entry.js → p-c39c8112.entry.js} +1 -1
- package/dist/twilight/{p-3a1fd71a.entry.js → p-c56e1aa1.entry.js} +1 -1
- package/dist/twilight/{p-91f9f647.entry.js → p-c8c09f5c.entry.js} +1 -1
- package/dist/twilight/{p-a893e7e3.entry.js → p-c8c34286.entry.js} +1 -1
- package/dist/twilight/{p-88045527.entry.js → p-d41903f9.entry.js} +1 -1
- package/dist/twilight/{p-13011571.entry.js → p-d55b86b5.entry.js} +1 -1
- package/dist/twilight/{p-2fddb802.entry.js → p-d72e0350.entry.js} +1 -1
- package/dist/twilight/{p-95918a1a.entry.js → p-d96bc0c1.entry.js} +1 -1
- package/dist/twilight/{p-62dfd479.entry.js → p-db9f8104.entry.js} +2 -2
- package/dist/twilight/p-dd734bcb.entry.js +4 -0
- package/dist/twilight/p-df9d5f85.entry.js +4 -0
- package/dist/twilight/{p-8d7bfcf6.entry.js → p-e3a45456.entry.js} +1 -1
- package/dist/twilight/{p-6e08f950.entry.js → p-e5169250.entry.js} +1 -1
- package/dist/twilight/{p-a1738bf0.entry.js → p-ea606acc.entry.js} +1 -1
- package/dist/twilight/{p-2ce0c4ca.entry.js → p-effc8ceb.entry.js} +1 -1
- package/dist/twilight/{p-0d3be88f.entry.js → p-f2fb1121.entry.js} +1 -1
- package/dist/twilight/{p-5527801b.entry.js → p-fa7c358f.entry.js} +1 -1
- package/dist/twilight/{p-DY4LZmNP.js → p-gFG8By9O.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-button/salla-button.d.ts +6 -0
- package/dist/types/components/salla-modal/salla-modal.d.ts +5 -0
- package/dist/types/components/salla-orders/interface.d.ts +1 -0
- package/dist/types/components/salla-orders/salla-orders.d.ts +29 -2
- package/dist/types/components/salla-payments/salla-payments.d.ts +4 -0
- package/dist/types/components/salla-product-card/salla-product-card.d.ts +18 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +7 -0
- package/dist/types/components/salla-search/interfaces.d.ts +21 -0
- package/dist/types/components/salla-search/salla-search.d.ts +40 -2
- package/dist/types/components/salla-search/utils.d.ts +19 -0
- package/dist/types/components/salla-trust-badges/salla-trust-badges.d.ts +0 -22
- package/dist/types/components.d.ts +50 -0
- package/package.json +5 -5
- package/dist/twilight/p-08fa9f0b.entry.js +0 -4
- package/dist/twilight/p-1066a05c.entry.js +0 -4
- package/dist/twilight/p-11afb8be.entry.js +0 -4
- package/dist/twilight/p-164cb0d8.entry.js +0 -4
- package/dist/twilight/p-5ecc99df.entry.js +0 -4
- package/dist/twilight/p-acc63da6.entry.js +0 -4
- package/dist/twilight/p-bb082b47.entry.js +0 -4
- package/dist/twilight/p-f3eab493.entry.js +0 -4
|
@@ -3,22 +3,165 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
5
|
import { S as Search } from './search.js';
|
|
6
|
+
import { C as Cancel } from './cancel.js';
|
|
7
|
+
import { K as KeyBoardArrowLeftIcon, a as KeyBoardArrowRightIcon } from './keyboard_arrow_left.js';
|
|
6
8
|
import { H as Helper } from './Helper.js';
|
|
7
|
-
import { d as defineCustomElement$
|
|
8
|
-
import { d as defineCustomElement$
|
|
9
|
-
import { d as defineCustomElement$
|
|
9
|
+
import { d as defineCustomElement$l } from './salla-add-product-button2.js';
|
|
10
|
+
import { d as defineCustomElement$k } from './salla-attachment-view2.js';
|
|
11
|
+
import { d as defineCustomElement$j } from './salla-booking-field2.js';
|
|
12
|
+
import { d as defineCustomElement$i } from './salla-button2.js';
|
|
13
|
+
import { d as defineCustomElement$h } from './salla-color-picker2.js';
|
|
14
|
+
import { d as defineCustomElement$g } from './salla-conditional-fields2.js';
|
|
15
|
+
import { d as defineCustomElement$f } from './salla-count-down2.js';
|
|
16
|
+
import { d as defineCustomElement$e } from './salla-datetime-picker2.js';
|
|
17
|
+
import { d as defineCustomElement$d } from './salla-file-upload2.js';
|
|
18
|
+
import { d as defineCustomElement$c } from './salla-loading2.js';
|
|
19
|
+
import { d as defineCustomElement$b } from './salla-map2.js';
|
|
20
|
+
import { d as defineCustomElement$a } from './salla-modal2.js';
|
|
21
|
+
import { d as defineCustomElement$9 } from './salla-order-options-modal2.js';
|
|
22
|
+
import { d as defineCustomElement$8 } from './salla-product-availability2.js';
|
|
23
|
+
import { d as defineCustomElement$7 } from './salla-product-card2.js';
|
|
24
|
+
import { d as defineCustomElement$6 } from './salla-product-options2.js';
|
|
25
|
+
import { d as defineCustomElement$5 } from './salla-progress-bar2.js';
|
|
26
|
+
import { d as defineCustomElement$4 } from './salla-quick-buy2.js';
|
|
27
|
+
import { d as defineCustomElement$3 } from './salla-slider2.js';
|
|
28
|
+
import { d as defineCustomElement$2 } from './salla-tel-input2.js';
|
|
10
29
|
|
|
11
|
-
const
|
|
30
|
+
const NEW_SEARCH_FEATURE_FLAG = 'new-search-ui-enabled';
|
|
31
|
+
const SEARCH_HISTORY_KEY = 'salla::search-history';
|
|
32
|
+
const SEARCH_HISTORY_LIMIT = 10;
|
|
33
|
+
// Multi-market stores scope search history per market via the `scope` query param.
|
|
34
|
+
function getSearchHistoryKey() {
|
|
35
|
+
if (typeof window === 'undefined') {
|
|
36
|
+
return SEARCH_HISTORY_KEY;
|
|
37
|
+
}
|
|
38
|
+
const scope = new URLSearchParams(window.location.search).get('scope');
|
|
39
|
+
return scope ? `${SEARCH_HISTORY_KEY}-${scope}` : SEARCH_HISTORY_KEY;
|
|
40
|
+
}
|
|
41
|
+
const DEFAULT_LABELS = {
|
|
42
|
+
searchPlaceholder: '',
|
|
43
|
+
noOptions: '',
|
|
44
|
+
outOfStock: '',
|
|
45
|
+
close: '',
|
|
46
|
+
back: '',
|
|
47
|
+
remove: '',
|
|
48
|
+
searchHistory: '',
|
|
49
|
+
trendingCategories: '',
|
|
50
|
+
mostSearched: '',
|
|
51
|
+
searchSuggestions: '',
|
|
52
|
+
categories: '',
|
|
53
|
+
searchResults: '',
|
|
54
|
+
searchViewAllTemplate: '',
|
|
55
|
+
};
|
|
56
|
+
// Labels not yet in the central translation files - seeded via addBulk only when missing.
|
|
57
|
+
const TRANSLATION_DEFAULTS = {
|
|
58
|
+
'common.elements.search_history': { ar: 'آخر ما تم البحث عنه', en: 'Recently Searched' },
|
|
59
|
+
'common.elements.trending_categories': {
|
|
60
|
+
ar: 'التصنيفات الأكثر بحثاً',
|
|
61
|
+
en: 'Trending categories',
|
|
62
|
+
},
|
|
63
|
+
'common.elements.most_searched': { ar: 'الأكثر بحثاً', en: 'Most searched' },
|
|
64
|
+
'common.elements.search_suggestions': { ar: 'اقتراحات البحث', en: 'Search suggestions' },
|
|
65
|
+
'common.elements.categories': { ar: 'التصنيفات', en: 'Categories' },
|
|
66
|
+
'common.elements.search_results': { ar: 'نتائج البحث', en: 'Search results' },
|
|
67
|
+
'common.elements.search_view_all': {
|
|
68
|
+
ar: 'عرض كل النتائج لـ ":word"',
|
|
69
|
+
en: 'View all results for ":word"',
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
function isNewSearchFeatureEnabled() {
|
|
73
|
+
const flag = salla.storage.get(NEW_SEARCH_FEATURE_FLAG, false);
|
|
74
|
+
return flag === true || flag === 'true';
|
|
75
|
+
}
|
|
76
|
+
function getSearchResultsUrl(term) {
|
|
77
|
+
return salla.url.get('search?q=' + encodeURI(term));
|
|
78
|
+
}
|
|
79
|
+
function loadSearchHistory() {
|
|
80
|
+
const key = getSearchHistoryKey();
|
|
81
|
+
const stored = salla.storage.get(key, []);
|
|
82
|
+
return Array.isArray(stored) ? stored.filter(term => typeof term === 'string') : [];
|
|
83
|
+
}
|
|
84
|
+
function saveSearchHistory(history) {
|
|
85
|
+
const key = getSearchHistoryKey();
|
|
86
|
+
salla.storage.set(key, history);
|
|
87
|
+
}
|
|
88
|
+
function addToSearchHistory(history, term) {
|
|
89
|
+
const trimmed = term.trim();
|
|
90
|
+
if (!trimmed) {
|
|
91
|
+
return history;
|
|
92
|
+
}
|
|
93
|
+
const withoutDuplicate = history.filter(existing => existing.toLowerCase() !== trimmed.toLowerCase());
|
|
94
|
+
return [trimmed, ...withoutDuplicate].slice(0, SEARCH_HISTORY_LIMIT);
|
|
95
|
+
}
|
|
96
|
+
function registerTranslationDefaults() {
|
|
97
|
+
if (!salla?.lang?.addBulk) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const missing = Object.entries(TRANSLATION_DEFAULTS).reduce((acc, [key, value]) => {
|
|
101
|
+
if (salla.lang.get(key) === key) {
|
|
102
|
+
acc[key] = value;
|
|
103
|
+
}
|
|
104
|
+
return acc;
|
|
105
|
+
}, {});
|
|
106
|
+
if (Object.keys(missing).length) {
|
|
107
|
+
salla.lang.addBulk(missing);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function loadLabels() {
|
|
111
|
+
return {
|
|
112
|
+
searchPlaceholder: salla.lang.get('blocks.header.search_placeholder'),
|
|
113
|
+
noOptions: salla.lang.get('common.elements.no_options'),
|
|
114
|
+
outOfStock: salla.lang.get('pages.products.out_of_stock'),
|
|
115
|
+
close: salla.lang.get('common.elements.close'),
|
|
116
|
+
back: salla.lang.get('common.elements.back'),
|
|
117
|
+
remove: salla.lang.get('common.elements.remove'),
|
|
118
|
+
searchHistory: salla.lang.get('common.elements.search_history'),
|
|
119
|
+
trendingCategories: salla.lang.get('common.elements.trending_categories'),
|
|
120
|
+
mostSearched: salla.lang.get('common.elements.most_searched'),
|
|
121
|
+
searchSuggestions: salla.lang.get('common.elements.search_suggestions'),
|
|
122
|
+
categories: salla.lang.get('common.elements.categories'),
|
|
123
|
+
searchResults: salla.lang.get('common.elements.search_results'),
|
|
124
|
+
searchViewAllTemplate: salla.lang.get('common.elements.search_view_all'),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function getDefaultProductSlot() {
|
|
128
|
+
return ('<div class="s-search-product-image-container">' +
|
|
129
|
+
' <img class="s-search-product-image" src="{image}" alt="{name}"/>' +
|
|
130
|
+
'</div>' +
|
|
131
|
+
'<div class="s-search-product-details">' +
|
|
132
|
+
' <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div>' +
|
|
133
|
+
'</div>');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const sallaSearchCss = "/*!twlt*/.s-search-placeholder-wrapper{position:relative;display:inline-block}.s-search-input-wrapper{position:relative}.s-search-placeholder-trigger{cursor:pointer;appearance:none;text-align:start}.visible{visibility:visible}.block{display:block}.inline{display:inline}.hidden{display:none}.border{border-width:1px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-container{position:relative;z-index:99;max-height:14rem;border-radius:0.375rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-search-oval{border-radius:20px}.s-search-inline{min-width:220px}.s-search-container-open{max-height:24rem;border-radius:0px !important}.s-search-container-open .s-search-input{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important;border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-no-results .s-search-input{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0px;padding-bottom:0.125rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-input:focus{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-ring-color:transparent}.s-search-input:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:2.5rem}.s-search-input:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:2.5rem}.s-search-modal-new .s-search-input{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-icon-wrap{position:absolute;top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-icon-wrap:where([dir=\"ltr\"],[dir=\"ltr\"] *){left:1rem}.s-search-icon-wrap:where([dir=\"rtl\"],[dir=\"rtl\"] *){right:1rem}.s-search-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-search-spinner-loader{display:block;height:1rem;width:1rem}@keyframes spin{to{transform:rotate(360deg)}}.s-search-spinner-loader{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));border-right-color:var(--color-primary)}.s-search-results{position:absolute;margin:auto;max-height:24rem;width:100%;max-width:100%;overflow-y:auto;border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-no-results{border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important}.s-search-no-results-placeholder{grid-column:1 / -1;padding:1rem;text-align:center;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-product{display:flex;height:100%;justify-content:space-around;overflow:hidden;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-product:last-child{border-bottom-width:0px}.s-search-product:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 480px){.s-search-product{padding-left:1.25rem;padding-right:1.25rem}}.s-search-product-image-container{position:relative;height:3.5rem;width:5rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-product-image{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-search-product-image::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-search-product-details{flex:1 1 0%;padding-top:0.25rem}.s-search-product-details:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:1rem}@media (min-width: 480px){.s-search-product-details:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:1.25rem}}.s-search-product-details:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:1rem}@media (min-width: 480px){.s-search-product-details:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:1.25rem}}.s-search-product-title{margin-bottom:0.375rem;display:flex;flex-direction:column;align-items:baseline;justify-content:flex-start;font-size:0.875rem;font-weight:700;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-product-price{display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-search-product-regular-price{padding-left:0.75rem;padding-right:0.75rem;font-weight:500;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-search-product-not-available{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-action{position:absolute;height:100%}.s-search-action:where([dir=\"ltr\"],[dir=\"ltr\"] *){right:0px}.s-search-action:where([dir=\"rtl\"],[dir=\"rtl\"] *){left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-search-action-oval:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.s-search-action-oval:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.s-search-input-row{display:flex;align-items:center;gap:0.25rem}.s-search-back-btn{display:flex;flex-shrink:0;align-items:center;justify-content:center;padding:0.25rem;line-height:1;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-back-btn:hover{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-search-back-btn{display:none}}.s-search-back-btn svg{height:1.5rem;width:1.5rem;fill:#6b7280}.s-search-input-wrapper{position:relative;display:flex;flex-grow:1;align-items:center}.s-search-input-clearable:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-right:2.25rem}.s-search-input-clearable:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-left:2.25rem}.s-search-input-clearable::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}.s-search-clear-icon{position:absolute;top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:0.25rem;line-height:1;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-clear-icon:hover{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-clear-icon:where([dir=\"ltr\"],[dir=\"ltr\"] *){right:0.75rem}.s-search-clear-icon:where([dir=\"rtl\"],[dir=\"rtl\"] *){left:0.75rem}.s-search-clear-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-search-panel{display:flex;flex-direction:column;gap:0.75rem;padding:0px}@media (min-width: 640px){.s-search-panel{padding:1rem}}.s-search-results-body{display:flex;max-height:24rem;gap:0.75rem;overflow-y:auto}.s-search-results-grid-wrap{min-width:0px;flex:1 1 0%}.s-search-results-grid{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));align-content:flex-start;column-gap:0.75rem;row-gap:0.25rem}@media (min-width: 640px){.s-search-results-grid{grid-template-columns:repeat(2, minmax(0, 1fr))}}.s-search-grid-item{cursor:pointer;border-radius:0.375rem;padding:0.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-grid-item:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-search-grid-item .s-product-card-out-badge{--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-search-view-all{display:flex;flex-shrink:0;align-items:center;justify-content:center;gap:0.25rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:0.75rem;text-align:center;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-view-all:hover{text-decoration-line:underline}.s-search-view-all-icon{line-height:1}.s-search-view-all-icon svg{height:1rem;width:1rem;fill:#6b7280}.s-search-sidebar{width:7rem;flex-shrink:0}.s-search-sidebar>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-sidebar{--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}@media (min-width: 480px){.s-search-sidebar{width:8rem}}.s-search-sidebar:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-right-width:1px;padding-right:0.75rem}.s-search-sidebar:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-left-width:1px;padding-left:0.75rem}.s-search-idle-panel{max-height:24rem;min-height:6rem}.s-search-idle-panel>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-idle-panel{overflow-y:auto}.s-search-idle-section-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-history-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-history-chip{display:inline-flex;align-items:center;gap:0.375rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.375rem;padding-bottom:0.375rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-history-chip:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-left:0.75rem;padding-right:0.5rem}.s-search-history-chip:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-right:0.75rem;padding-left:0.5rem}.s-search-history-chip-term{line-height:1}.s-search-history-chip-remove svg{height:0.625rem;width:0.625rem;fill:#9ca3af}.s-search-idle-categories-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-idle-category-chip{display:inline-flex;align-items:center;gap:0.25rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-idle-category-chip:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-search-idle-category-count{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-most-searched-list{display:flex;flex-direction:column}.s-search-most-searched-item{display:flex;width:100%;align-items:center;gap:0.5rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-most-searched-item:hover{color:var(--color-primary)}.s-search-most-searched-icon svg{height:0.875rem;width:0.875rem;fill:#9ca3af}@media (min-width: 640px){.s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}.s-search-modal .s-modal-spacer{display:inline}}@media (max-width: 639px){.s-search-modal .s-modal-body{height:100dvh;max-height:100dvh !important}}@media (min-width: 640px){.s-search-modal .s-modal-body{padding:0;width:700px;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible;position:relative !important}}.s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}@media (min-width: 640px){.s-search-modal.s-search-modal-new .s-modal-body{background:white;overflow:hidden;width:1100px;max-width:95%}}";
|
|
12
137
|
|
|
13
138
|
const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends HTMLElement {
|
|
14
139
|
constructor() {
|
|
15
140
|
super();
|
|
16
141
|
this.__registerHost();
|
|
142
|
+
this.newSearchEnabled = isNewSearchFeatureEnabled();
|
|
17
143
|
this.inputValue = '';
|
|
144
|
+
this.hasTrackedFocus = false;
|
|
18
145
|
this.translationLoaded = false;
|
|
146
|
+
this.labels = DEFAULT_LABELS;
|
|
19
147
|
this.loading = false;
|
|
20
148
|
this.typing = false;
|
|
21
149
|
this.debounce = setTimeout(() => '', 1000);
|
|
150
|
+
this.search_term = '';
|
|
151
|
+
this.hasInputValue = false;
|
|
152
|
+
this.searchHistory = loadSearchHistory();
|
|
153
|
+
/**
|
|
154
|
+
* Most-searched categories to surface before the customer types a query.
|
|
155
|
+
* Not wired to a live endpoint yet - stays empty (and hidden) until a future
|
|
156
|
+
* story populates it.
|
|
157
|
+
*/
|
|
158
|
+
this.trendingCategories = [];
|
|
159
|
+
/**
|
|
160
|
+
* Most-searched terms, reused both as the pre-search "most searched" list and
|
|
161
|
+
* as the results-view "search suggestions" sidebar. Same not-wired-yet status
|
|
162
|
+
* as trendingCategories.
|
|
163
|
+
*/
|
|
164
|
+
this.mostSearchedTerms = [];
|
|
22
165
|
/**
|
|
23
166
|
* Set the component to display as a placeholder (button) that will open the modal. Defaults to `false`
|
|
24
167
|
*/
|
|
@@ -43,37 +186,72 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
|
|
|
43
186
|
* Show submit action buttons at the end.
|
|
44
187
|
*/
|
|
45
188
|
this.showAction = false;
|
|
189
|
+
this.tracking = {
|
|
190
|
+
searchFocus: () => {
|
|
191
|
+
if (this.hasTrackedFocus) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this.hasTrackedFocus = true;
|
|
195
|
+
salla.event.emit('salla-search::input.focused');
|
|
196
|
+
},
|
|
197
|
+
productClick: (product, position) => {
|
|
198
|
+
salla.event.emit('salla-search::product.clicked', [{ product, position }]);
|
|
199
|
+
},
|
|
200
|
+
recommendationClick: (term, source) => {
|
|
201
|
+
salla.event.emit('salla-search::recommendation.clicked', { term, source });
|
|
202
|
+
},
|
|
203
|
+
};
|
|
46
204
|
this.productSlot =
|
|
47
|
-
this.host
|
|
205
|
+
this.host?.querySelector('[slot="product"]')?.innerHTML || getDefaultProductSlot();
|
|
48
206
|
salla.event.on('search::open', () => this.open());
|
|
49
|
-
salla.lang.onLoaded(() => {
|
|
50
|
-
this.translationLoaded = true;
|
|
51
|
-
});
|
|
52
207
|
salla.event.on('modalClosed', () => this.onModalClose());
|
|
53
208
|
}
|
|
54
209
|
async open() {
|
|
55
|
-
if (!this.inline) {
|
|
56
|
-
await this.modal
|
|
210
|
+
if (this.newSearchEnabled || !this.inline) {
|
|
211
|
+
await this.modal?.open().then(() => setTimeout(() => this.searchInput?.focus(), 300));
|
|
57
212
|
}
|
|
58
213
|
}
|
|
59
214
|
onModalClose() {
|
|
60
|
-
this.searchInput
|
|
215
|
+
if (this.searchInput) {
|
|
216
|
+
this.searchInput.value = '';
|
|
217
|
+
}
|
|
61
218
|
this.results = undefined;
|
|
219
|
+
this.hasInputValue = false;
|
|
62
220
|
this.afterSearching();
|
|
63
|
-
this.container
|
|
221
|
+
this.container?.classList.remove('s-search-no-results');
|
|
64
222
|
}
|
|
65
223
|
handleKeyDown(ev) {
|
|
66
224
|
if (ev.key === 'Enter' && this.search_term?.length) {
|
|
67
|
-
window.location.href =
|
|
225
|
+
window.location.href = getSearchResultsUrl(this.search_term);
|
|
68
226
|
}
|
|
69
227
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
228
|
+
clearSearch() {
|
|
229
|
+
if (this.searchInput) {
|
|
230
|
+
this.searchInput.value = '';
|
|
231
|
+
}
|
|
232
|
+
this.hasInputValue = false;
|
|
233
|
+
this.search_term = '';
|
|
234
|
+
this.searchInput?.focus();
|
|
235
|
+
}
|
|
236
|
+
removeFromSearchHistory(term) {
|
|
237
|
+
this.searchHistory = this.searchHistory.filter(existing => existing !== term);
|
|
238
|
+
saveSearchHistory(this.searchHistory);
|
|
239
|
+
this.afterSearching(!this.results);
|
|
240
|
+
}
|
|
241
|
+
applySuggestedTerm(term, source) {
|
|
242
|
+
this.tracking.recommendationClick(term, source);
|
|
243
|
+
if (this.searchInput) {
|
|
244
|
+
this.searchInput.value = term;
|
|
245
|
+
}
|
|
246
|
+
this.hasInputValue = true;
|
|
247
|
+
this.search_term = term;
|
|
248
|
+
this.searchInput?.focus();
|
|
249
|
+
}
|
|
250
|
+
async componentWillLoad() {
|
|
251
|
+
await salla.lang.onLoaded();
|
|
252
|
+
registerTranslationDefaults();
|
|
253
|
+
this.labels = loadLabels();
|
|
254
|
+
this.translationLoaded = true;
|
|
77
255
|
}
|
|
78
256
|
debounceSearch(event) {
|
|
79
257
|
this.typing = true;
|
|
@@ -85,10 +263,13 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
|
|
|
85
263
|
}
|
|
86
264
|
limitWordsAndSearch(event) {
|
|
87
265
|
let value = event.target.value;
|
|
266
|
+
this.hasInputValue = value.length > 0;
|
|
88
267
|
const words = value.trim().split(/\s+/);
|
|
89
268
|
if (words.length > this.maxWords) {
|
|
90
269
|
const truncatedInput = words.slice(0, this.maxWords).join(' ');
|
|
91
|
-
this.searchInput
|
|
270
|
+
if (this.searchInput) {
|
|
271
|
+
this.searchInput.value = truncatedInput;
|
|
272
|
+
}
|
|
92
273
|
}
|
|
93
274
|
this.debounceSearch(event);
|
|
94
275
|
}
|
|
@@ -112,7 +293,7 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
|
|
|
112
293
|
}
|
|
113
294
|
}
|
|
114
295
|
search(val) {
|
|
115
|
-
this.noResults.style.display = 'none';
|
|
296
|
+
this.noResults && (this.noResults.style.display = 'none');
|
|
116
297
|
//run loading spinner or stop it
|
|
117
298
|
this.loading = true;
|
|
118
299
|
salla.product
|
|
@@ -120,22 +301,29 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
|
|
|
120
301
|
.then(response => {
|
|
121
302
|
this.results = response;
|
|
122
303
|
salla.event.emit('Products Searched', val);
|
|
304
|
+
if (this.newSearchEnabled) {
|
|
305
|
+
this.searchHistory = addToSearchHistory(this.searchHistory, val);
|
|
306
|
+
saveSearchHistory(this.searchHistory);
|
|
307
|
+
}
|
|
123
308
|
})
|
|
124
309
|
.catch(err => (err !== 'Query is same as previous one!' ? (this.results = undefined) : null))
|
|
125
310
|
.finally(() => this.afterSearching(/*isEmpty*/ false));
|
|
126
311
|
}
|
|
127
312
|
afterSearching(isEmpty = true) {
|
|
128
|
-
this.noResults
|
|
129
|
-
|
|
313
|
+
if (this.noResults) {
|
|
314
|
+
this.noResults.style.display = isEmpty || !!this.results?.data?.length ? 'none' : 'block';
|
|
315
|
+
}
|
|
316
|
+
// The new search experience is always a fully-visible modal panel (no collapsed/expanded
|
|
317
|
+
// input trick needed), so this open/no-results cosmetic toggle only applies to the legacy UI.
|
|
318
|
+
if (!this.newSearchEnabled) {
|
|
319
|
+
Helper.toggleElementClassIf(this.container, 's-search-container-open', 's-search-no-results', () => this.results?.data.length);
|
|
320
|
+
}
|
|
130
321
|
this.loading = false;
|
|
131
322
|
salla.product.api.previousQuery = ''; //avoid having error 'Query is same as previous one!' after reopen modal;
|
|
132
|
-
this.inputValue.length < 3 ? this.container
|
|
323
|
+
this.inputValue.length < 3 ? this.container?.classList.remove('s-search-no-results') : '';
|
|
133
324
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
height: this.height + 'px',
|
|
137
|
-
borderRadius: this.oval ? this.height / 2 + 'px' : '',
|
|
138
|
-
} }), this.showAction ? (h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search }))) : null), h("div", { key: 'f3b40ce4ec24678f6d8421f3da8ac9e1bd631c3a', class: "s-search-results" }, this.results?.data.map(product => (h("a", { href: product.url + '?from=search-bar', class: {
|
|
325
|
+
renderLegacyResults() {
|
|
326
|
+
return (h("div", { class: "s-search-results" }, this.results?.data.map(product => (h("a", { href: product.url + '?from=search-bar', class: {
|
|
139
327
|
's-search-product': true,
|
|
140
328
|
's-search-product-not-available': !product.is_available,
|
|
141
329
|
}, innerHTML: this.productSlot
|
|
@@ -144,12 +332,83 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
|
|
|
144
332
|
.replace(/\{regular_price\}/g, product.is_on_sale && product.regular_price
|
|
145
333
|
? salla.money(product.regular_price)
|
|
146
334
|
: '')
|
|
147
|
-
.replace(/\{image\}/g, product.image.url) }))), h("p", {
|
|
148
|
-
|
|
149
|
-
|
|
335
|
+
.replace(/\{image\}/g, product.image.url) }))), h("p", { ref: el => (this.noResults = el), class: "s-search-no-results-placeholder" }, this.labels.noOptions)));
|
|
336
|
+
}
|
|
337
|
+
renderCategoriesSection(title) {
|
|
338
|
+
if (!this.trendingCategories.length) {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
return (h("div", null, h("p", { class: "s-search-idle-section-title" }, title), h("div", { class: "s-search-idle-categories-list" }, this.trendingCategories.map(category => (h("a", { class: "s-search-idle-category-chip", href: category.url, onClick: () => this.tracking.recommendationClick(category.name, 'category') }, category.name, category.count ? (h("span", { class: "s-search-idle-category-count" }, category.count)) : null))))));
|
|
342
|
+
}
|
|
343
|
+
renderTermsSection(title, source) {
|
|
344
|
+
if (!this.mostSearchedTerms.length) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
return (h("div", null, h("p", { class: "s-search-idle-section-title" }, title), h("ul", { class: "s-search-most-searched-list" }, this.mostSearchedTerms.map(term => (h("li", null, h("button", { type: "button", class: "s-search-most-searched-item", onClick: () => this.applySuggestedTerm(term, source) }, h("span", { class: "s-search-most-searched-icon", innerHTML: Search }), term)))))));
|
|
348
|
+
}
|
|
349
|
+
renderSearchHistorySection() {
|
|
350
|
+
// Only in the empty/zero state - hidden as soon as there's input text or results.
|
|
351
|
+
if (!this.searchHistory.length || this.hasInputValue) {
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
return (h("div", null, h("p", { class: "s-search-idle-section-title" }, this.labels.searchHistory), h("div", { class: "s-search-history-list" }, this.searchHistory.map(term => (h("span", { class: "s-search-history-chip" }, h("button", { type: "button", class: "s-search-history-chip-term", onClick: () => this.applySuggestedTerm(term, 'history') }, term), h("button", { type: "button", class: "s-search-history-chip-remove", "aria-label": this.labels.remove, onClick: () => this.removeFromSearchHistory(term) }, h("span", { innerHTML: Cancel }))))))));
|
|
355
|
+
}
|
|
356
|
+
renderIdlePanel() {
|
|
357
|
+
// Always renders - even with nothing in history/trending yet - so the panel opens as a
|
|
358
|
+
// visible (if empty) container rather than disappearing until there's something to show.
|
|
359
|
+
return (h("div", { class: "s-search-idle-panel" }, this.renderSearchHistorySection(), this.renderCategoriesSection(this.labels.trendingCategories), this.renderTermsSection(this.labels.mostSearched, 'trending')));
|
|
360
|
+
}
|
|
361
|
+
renderResultsBody() {
|
|
362
|
+
// Search history never shows here (only in the empty/zero state), so the sidebar's
|
|
363
|
+
// visibility depends only on categories/terms - not the full idle-panel content check.
|
|
364
|
+
const hasSidebarContent = this.trendingCategories.length > 0 || this.mostSearchedTerms.length > 0;
|
|
365
|
+
return (h("div", { class: "s-search-results-body" }, hasSidebarContent ? (h("div", { class: "s-search-sidebar" }, this.renderTermsSection(this.labels.searchSuggestions, 'suggestion'), this.renderCategoriesSection(this.labels.categories))) : null, h("div", { class: "s-search-results-grid-wrap" }, h("p", { class: "s-search-idle-section-title" }, this.labels.searchResults), h("div", { class: "s-search-results-grid" }, this.results?.data.map((product, position) => (h("div", { class: "s-search-grid-item", onClick: () => this.tracking.productClick(product, position) }, h("salla-product-card", { product: { ...product, url: product.url + '?from=search-bar' }, horizontal: true, compact: true, "show-quantity": !product.is_available, "show-out-of-stock-beside-price": true, hideAddBtn: true })))), this.results?.data.length === 0 ? (h("p", { class: "s-search-no-results-placeholder" }, this.labels.noOptions)) : null))));
|
|
366
|
+
}
|
|
367
|
+
renderViewAllLink() {
|
|
368
|
+
if (!this.results?.data.length) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
return (h("a", { class: "s-search-view-all", href: getSearchResultsUrl(this.search_term) }, this.labels.searchViewAllTemplate.replace(':word', this.search_term), h("span", { class: "s-search-view-all-icon", innerHTML: salla.config.get('theme.is_rtl', true) ? KeyBoardArrowLeftIcon : KeyBoardArrowRightIcon })));
|
|
372
|
+
}
|
|
373
|
+
renderDropdown() {
|
|
374
|
+
if (!this.newSearchEnabled) {
|
|
375
|
+
return this.renderLegacyResults();
|
|
376
|
+
}
|
|
377
|
+
return this.results ? this.renderResultsBody() : this.renderIdlePanel();
|
|
378
|
+
}
|
|
379
|
+
renderInputWrapper() {
|
|
380
|
+
const inputWrapper = (h("div", { class: "s-search-input-wrapper" }, h("span", { class: "s-search-icon-wrap" }, h("span", { class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { type: "search", enterkeyhint: "search", autocomplete: "off", class: { 's-search-input': true, 's-search-input-clearable': this.newSearchEnabled }, placeholder: this.labels.searchPlaceholder, onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), onFocus: () => this.newSearchEnabled && this.tracking.searchFocus(), ref: input => (this.searchInput = input), style: {
|
|
381
|
+
height: this.height + 'px',
|
|
382
|
+
borderRadius: this.oval ? this.height / 2 + 'px' : '',
|
|
383
|
+
} }), this.newSearchEnabled && this.hasInputValue ? (h("button", { type: "button", class: "s-search-clear-icon", "aria-label": this.labels.close, onClick: () => this.clearSearch() }, h("span", { innerHTML: Cancel }))) : null, this.showAction ? (h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search }))) : null));
|
|
384
|
+
if (!this.newSearchEnabled) {
|
|
385
|
+
return inputWrapper;
|
|
386
|
+
}
|
|
387
|
+
return (h("div", { class: "s-search-input-row" }, h("button", { type: "button", class: "s-search-back-btn", "aria-label": this.labels.back, onClick: () => this.modal?.close() }, h("span", { innerHTML: salla.config.get('theme.is_rtl', true)
|
|
388
|
+
? KeyBoardArrowRightIcon
|
|
389
|
+
: KeyBoardArrowLeftIcon })), inputWrapper));
|
|
390
|
+
}
|
|
391
|
+
renderPlaceholderTrigger() {
|
|
392
|
+
return (h("div", { class: "s-search-input-wrapper" }, h("span", { class: "s-search-icon-wrap" }, h("span", { class: "s-search-icon", innerHTML: Search })), h("button", { type: "button", class: "s-search-input s-search-placeholder-trigger", onClick: () => this.open(), style: {
|
|
150
393
|
height: this.height + 'px',
|
|
151
394
|
borderRadius: this.oval ? this.height / 2 + 'px' : '',
|
|
152
|
-
} },
|
|
395
|
+
} }, this.labels.searchPlaceholder)));
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* The new search UI is always a modal opened from a placeholder trigger (never inline,
|
|
399
|
+
* never a bare/self-triggering modal), with its own padded panel layout - the input and
|
|
400
|
+
* dropdown content share one bordered card instead of the legacy floating-dropdown look.
|
|
401
|
+
*/
|
|
402
|
+
renderNewSearchExperience() {
|
|
403
|
+
return (h("div", { class: "s-search-placeholder-wrapper s-search-inline" }, this.renderPlaceholderTrigger(), h("salla-modal", { position: "top", class: "s-search-modal s-search-modal-new", "hide-close-button": true, ref: modal => (this.modal = modal) }, h("div", { class: "s-search-panel", ref: container => (this.container = container) }, this.renderInputWrapper(), this.renderDropdown(), this.renderViewAllLink()))));
|
|
404
|
+
}
|
|
405
|
+
render() {
|
|
406
|
+
if (this.newSearchEnabled) {
|
|
407
|
+
return this.renderNewSearchExperience();
|
|
408
|
+
}
|
|
409
|
+
const searchContent = (h("div", { class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => (this.container = container) }, this.renderInputWrapper(), this.renderDropdown()));
|
|
410
|
+
const modalContent = (h("salla-modal", { position: "top", class: "s-search-modal", ref: modal => (this.modal = modal) }, searchContent));
|
|
411
|
+
const placeholderContent = (h("div", { class: "s-search-placeholder-wrapper s-search-inline" }, this.renderPlaceholderTrigger(), modalContent));
|
|
153
412
|
return this.placeholder ? (placeholderContent) : this.inline ? (h("div", { class: "s-search-modal" }, searchContent)) : (modalContent);
|
|
154
413
|
}
|
|
155
414
|
/**
|
|
@@ -157,7 +416,11 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
|
|
|
157
416
|
*/
|
|
158
417
|
componentDidLoad() {
|
|
159
418
|
this.afterSearching();
|
|
160
|
-
|
|
419
|
+
const initialQuery = this.getQueryParam('q');
|
|
420
|
+
if (initialQuery && this.searchInput) {
|
|
421
|
+
this.searchInput.value = initialQuery;
|
|
422
|
+
this.hasInputValue = true;
|
|
423
|
+
}
|
|
161
424
|
}
|
|
162
425
|
get host() { return this; }
|
|
163
426
|
static get watchers() { return {
|
|
@@ -172,11 +435,16 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class SallaSearch extends
|
|
|
172
435
|
"maxWords": [2, "max-words"],
|
|
173
436
|
"showAction": [4, "show-action"],
|
|
174
437
|
"translationLoaded": [32],
|
|
438
|
+
"labels": [32],
|
|
175
439
|
"results": [32],
|
|
176
440
|
"loading": [32],
|
|
177
441
|
"typing": [32],
|
|
178
442
|
"debounce": [32],
|
|
179
|
-
"search_term": [32]
|
|
443
|
+
"search_term": [32],
|
|
444
|
+
"hasInputValue": [32],
|
|
445
|
+
"searchHistory": [32],
|
|
446
|
+
"trendingCategories": [32],
|
|
447
|
+
"mostSearchedTerms": [32]
|
|
180
448
|
}, [[0, "keydown", "handleKeyDown"]], {
|
|
181
449
|
"search_term": ["handleSearch"]
|
|
182
450
|
}]);
|
|
@@ -184,24 +452,109 @@ function defineCustomElement$1() {
|
|
|
184
452
|
if (typeof customElements === "undefined") {
|
|
185
453
|
return;
|
|
186
454
|
}
|
|
187
|
-
const components = ["salla-search", "salla-button", "salla-loading", "salla-modal"];
|
|
455
|
+
const components = ["salla-search", "salla-add-product-button", "salla-attachment-view", "salla-booking-field", "salla-button", "salla-color-picker", "salla-conditional-fields", "salla-count-down", "salla-datetime-picker", "salla-file-upload", "salla-loading", "salla-map", "salla-modal", "salla-order-options-modal", "salla-product-availability", "salla-product-card", "salla-product-options", "salla-progress-bar", "salla-quick-buy", "salla-slider", "salla-tel-input"];
|
|
188
456
|
components.forEach(tagName => { switch (tagName) {
|
|
189
457
|
case "salla-search":
|
|
190
458
|
if (!customElements.get(tagName)) {
|
|
191
459
|
customElements.define(tagName, SallaSearch$1);
|
|
192
460
|
}
|
|
193
461
|
break;
|
|
462
|
+
case "salla-add-product-button":
|
|
463
|
+
if (!customElements.get(tagName)) {
|
|
464
|
+
defineCustomElement$l();
|
|
465
|
+
}
|
|
466
|
+
break;
|
|
467
|
+
case "salla-attachment-view":
|
|
468
|
+
if (!customElements.get(tagName)) {
|
|
469
|
+
defineCustomElement$k();
|
|
470
|
+
}
|
|
471
|
+
break;
|
|
472
|
+
case "salla-booking-field":
|
|
473
|
+
if (!customElements.get(tagName)) {
|
|
474
|
+
defineCustomElement$j();
|
|
475
|
+
}
|
|
476
|
+
break;
|
|
194
477
|
case "salla-button":
|
|
195
478
|
if (!customElements.get(tagName)) {
|
|
196
|
-
defineCustomElement$
|
|
479
|
+
defineCustomElement$i();
|
|
480
|
+
}
|
|
481
|
+
break;
|
|
482
|
+
case "salla-color-picker":
|
|
483
|
+
if (!customElements.get(tagName)) {
|
|
484
|
+
defineCustomElement$h();
|
|
485
|
+
}
|
|
486
|
+
break;
|
|
487
|
+
case "salla-conditional-fields":
|
|
488
|
+
if (!customElements.get(tagName)) {
|
|
489
|
+
defineCustomElement$g();
|
|
490
|
+
}
|
|
491
|
+
break;
|
|
492
|
+
case "salla-count-down":
|
|
493
|
+
if (!customElements.get(tagName)) {
|
|
494
|
+
defineCustomElement$f();
|
|
495
|
+
}
|
|
496
|
+
break;
|
|
497
|
+
case "salla-datetime-picker":
|
|
498
|
+
if (!customElements.get(tagName)) {
|
|
499
|
+
defineCustomElement$e();
|
|
500
|
+
}
|
|
501
|
+
break;
|
|
502
|
+
case "salla-file-upload":
|
|
503
|
+
if (!customElements.get(tagName)) {
|
|
504
|
+
defineCustomElement$d();
|
|
197
505
|
}
|
|
198
506
|
break;
|
|
199
507
|
case "salla-loading":
|
|
200
508
|
if (!customElements.get(tagName)) {
|
|
201
|
-
defineCustomElement$
|
|
509
|
+
defineCustomElement$c();
|
|
510
|
+
}
|
|
511
|
+
break;
|
|
512
|
+
case "salla-map":
|
|
513
|
+
if (!customElements.get(tagName)) {
|
|
514
|
+
defineCustomElement$b();
|
|
202
515
|
}
|
|
203
516
|
break;
|
|
204
517
|
case "salla-modal":
|
|
518
|
+
if (!customElements.get(tagName)) {
|
|
519
|
+
defineCustomElement$a();
|
|
520
|
+
}
|
|
521
|
+
break;
|
|
522
|
+
case "salla-order-options-modal":
|
|
523
|
+
if (!customElements.get(tagName)) {
|
|
524
|
+
defineCustomElement$9();
|
|
525
|
+
}
|
|
526
|
+
break;
|
|
527
|
+
case "salla-product-availability":
|
|
528
|
+
if (!customElements.get(tagName)) {
|
|
529
|
+
defineCustomElement$8();
|
|
530
|
+
}
|
|
531
|
+
break;
|
|
532
|
+
case "salla-product-card":
|
|
533
|
+
if (!customElements.get(tagName)) {
|
|
534
|
+
defineCustomElement$7();
|
|
535
|
+
}
|
|
536
|
+
break;
|
|
537
|
+
case "salla-product-options":
|
|
538
|
+
if (!customElements.get(tagName)) {
|
|
539
|
+
defineCustomElement$6();
|
|
540
|
+
}
|
|
541
|
+
break;
|
|
542
|
+
case "salla-progress-bar":
|
|
543
|
+
if (!customElements.get(tagName)) {
|
|
544
|
+
defineCustomElement$5();
|
|
545
|
+
}
|
|
546
|
+
break;
|
|
547
|
+
case "salla-quick-buy":
|
|
548
|
+
if (!customElements.get(tagName)) {
|
|
549
|
+
defineCustomElement$4();
|
|
550
|
+
}
|
|
551
|
+
break;
|
|
552
|
+
case "salla-slider":
|
|
553
|
+
if (!customElements.get(tagName)) {
|
|
554
|
+
defineCustomElement$3();
|
|
555
|
+
}
|
|
556
|
+
break;
|
|
557
|
+
case "salla-tel-input":
|
|
205
558
|
if (!customElements.get(tagName)) {
|
|
206
559
|
defineCustomElement$2();
|
|
207
560
|
}
|
|
@@ -197,18 +197,18 @@ const SallaSearchableDropdown = /*@__PURE__*/ proxyCustomElement(class SallaSear
|
|
|
197
197
|
render() {
|
|
198
198
|
const hasSelection = this.selectedItem != null;
|
|
199
199
|
const listboxId = `${this.inputId}-listbox`;
|
|
200
|
-
return (h(Host, { key: '
|
|
200
|
+
return (h(Host, { key: '6661631ca1fbc9dee2c634fffa720e5f90ce3483', class: "s-searchable-dropdown" }, h("div", { key: '201df6fb1c7d201d93681acc3819d76be5da4c6a', class: { 's-searchable-dropdown': true, 's-searchable-dropdown--open': this.isOpen } }, this.label && (h("label", { key: '2a5a78700cb7c4f498140f91525e7264bcfa7555', class: "s-searchable-dropdown-label", htmlFor: this.inputId }, this.label, this.required && h("span", { key: 'ae3395c452ced56a8754466a5962acfaaef0c3b5', class: "s-searchable-dropdown-required" }, " *"))), h("div", { key: 'ca363dd594a146e9dedd6940c736e832f465d495', class: {
|
|
201
201
|
's-searchable-dropdown-trigger': true,
|
|
202
202
|
's-searchable-dropdown-trigger--disabled': this.disabled || this.loading,
|
|
203
203
|
's-searchable-dropdown-trigger--open': this.isOpen,
|
|
204
|
-
}, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h("i", { key: '
|
|
204
|
+
}, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h("i", { key: '84e041b879c392a82bbaf0ebd21b50a1e035218d', class: {
|
|
205
205
|
'sicon-keyboard_arrow_down': true,
|
|
206
206
|
's-searchable-dropdown-trigger-icon': true,
|
|
207
207
|
's-searchable-dropdown-trigger-icon--open': this.isOpen,
|
|
208
|
-
}, "aria-hidden": "true" })), this.isOpen && (h("div", { key: '
|
|
208
|
+
}, "aria-hidden": "true" })), this.isOpen && (h("div", { key: 'eeeb7a2c5f3ff05966150fada86eb26d38f38699', class: {
|
|
209
209
|
's-searchable-dropdown-panel': true,
|
|
210
210
|
's-searchable-dropdown-panel--up': this.dropUp,
|
|
211
|
-
}, ref: (el) => (this.panelRef = el) }, this.searchable && (h("div", { key: '
|
|
211
|
+
}, ref: (el) => (this.panelRef = el) }, this.searchable && (h("div", { key: '28bd784d25d2bb9928c2316aac029257140d19e9', class: "s-searchable-dropdown-search-wrap" }, h("i", { key: '78add1451d050ce225fc3e14af352af4891735a3', class: "sicon-search s-searchable-dropdown-search-icon", "aria-hidden": "true" }), h("input", { key: '94644b386f64d1312511349f1eebafb56566754a', ref: (el) => (this.searchInputRef = el), id: this.inputId, type: "text", class: "s-searchable-dropdown-search-input", placeholder: this.placeholder, value: this.clientSearch ? this.clientSearchQuery : this.searchQuery, onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchKeyDown, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": listboxId }))), h("div", { key: '5e7f218ded5baac0ad6fd92a04eae8948f7c9430', id: listboxId, class: "s-searchable-dropdown-list s-scrollbar", role: "listbox" }, this.renderListContent()))))));
|
|
212
212
|
}
|
|
213
213
|
renderListContent() {
|
|
214
214
|
if (this.searching || this.loading) {
|