@salla.sa/twilight-components 2.14.548 → 2.14.550
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Helper-6RI07gZo.js → Helper-D1YsoJud.js} +46 -0
- package/dist/cjs/{filepond-CGA4aTUA.js → filepond-B-8syvXC.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DyVz7vP9.js → filepond-plugin-file-poster-DxfU_d7d.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-CgzYDBcU.js → filepond-plugin-file-validate-size-C0XIW0bl.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-Dx2CbMZ9.js → filepond-plugin-file-validate-type-BHyBHLOg.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-D3aTsFmD.js → filepond-plugin-image-edit-Dnni9gl-.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BW3usWts.js → filepond-plugin-image-exif-orientation-C7pHXy9M.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Bb7_UNPY.js → filepond-plugin-image-preview-CFttWV9E.js} +1 -1
- package/dist/cjs/{index-BssNhL-x.js → index-CHvvKGJc.js} +7 -3
- package/dist/cjs/{intlTelInput-B7QYiZ0d.js → intlTelInput--yv-lZaU.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +175 -0
- 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_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-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +10 -11
- package/dist/cjs/salla-filters.cjs.entry.js +14 -79
- 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 +2 -2
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +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-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +2 -2
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
- package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -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 +2 -2
- 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/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-H1di5S1s.js → vanilla-picker-D-X0hQ7w.js} +1 -1
- package/dist/collection/Helpers/Helper.js +28 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-applied-filters/salla-applied-filters.css +115 -0
- package/dist/collection/components/salla-applied-filters/salla-applied-filters.js +185 -0
- package/dist/collection/components/salla-filters/salla-filters.css +0 -119
- package/dist/collection/components/salla-filters/salla-filters.js +27 -73
- package/dist/components/Helper.js +47 -1
- package/dist/components/index.js +3 -3
- package/dist/components/salla-applied-filters.d.ts +11 -0
- package/dist/components/salla-applied-filters.js +195 -0
- package/dist/components/salla-filters-widget2.js +2 -21
- package/dist/components/salla-filters.js +10 -76
- package/dist/esm/{Helper-CBmYxrzX.js → Helper-DsjZ6kte.js} +47 -1
- package/dist/esm/{filepond-plugin-file-poster-DrmkMK37.js → filepond-plugin-file-poster-bfSOezL4.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-fRXLDtKY.js → filepond-plugin-file-validate-size-DagZiT3e.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-9x4CtZKy.js → filepond-plugin-file-validate-type-Cf4JwDq-.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BTjvSjn9.js → filepond-plugin-image-edit-DWZ8nbdr.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CnSOx2Lm.js → filepond-plugin-image-exif-orientation-NHp2unXf.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Cy0Nd8Xr.js → filepond-plugin-image-preview-BSi_AIFs.js} +1 -1
- package/dist/esm/{filepond-CXmbiROU.js → filepond-rGVsy4ep.js} +1 -1
- package/dist/esm/{index-B64o_70M.js → index-Bf2Z6A1M.js} +7 -3
- package/dist/esm/{intlTelInput-FF2eKbuC.js → intlTelInput-DLtsxnoY.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +2 -2
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +173 -0
- 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_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-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +2 -2
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +2 -3
- package/dist/esm/salla-filters.entry.js +8 -73
- 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 +2 -2
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +2 -2
- package/dist/esm/salla-offer-modal.entry.js +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-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +2 -2
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +2 -2
- package/dist/esm/salla-products-slider.entry.js +2 -2
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
- package/dist/esm/salla-rating-modal.entry.js +2 -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 +2 -2
- 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/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DMNociUd.js → vanilla-picker-AjTapsL5.js} +1 -1
- package/dist/twilight/{p-fa0467a7.entry.js → p-018456c8.entry.js} +1 -1
- package/dist/twilight/{p-441ee14a.entry.js → p-03db1fe6.entry.js} +1 -1
- package/dist/twilight/p-0739e769.entry.js +4 -0
- package/dist/twilight/{p-5273dbb2.entry.js → p-09c1d9c8.entry.js} +1 -1
- package/dist/twilight/{p-b8cd26a7.entry.js → p-0c4c4419.entry.js} +1 -1
- package/dist/twilight/{p-3b7cbf05.entry.js → p-0ccba871.entry.js} +1 -1
- package/dist/twilight/{p-cacf3c75.entry.js → p-0d199866.entry.js} +1 -1
- package/dist/twilight/{p-5f9b8ada.entry.js → p-0da8a64f.entry.js} +1 -1
- package/dist/twilight/{p-2f64c3b3.entry.js → p-0dc61077.entry.js} +1 -1
- package/dist/twilight/{p-0dfd760b.entry.js → p-0e12c9ca.entry.js} +1 -1
- package/dist/twilight/{p-522fb030.entry.js → p-0fb44a3c.entry.js} +1 -1
- package/dist/twilight/{p-1edbb249.entry.js → p-12d74e96.entry.js} +1 -1
- package/dist/twilight/{p-55cbacd7.entry.js → p-13fb9b74.entry.js} +1 -1
- package/dist/twilight/{p-440687a4.entry.js → p-1653256e.entry.js} +1 -1
- package/dist/twilight/{p-f12f8db3.entry.js → p-17c30aa6.entry.js} +1 -1
- package/dist/twilight/{p-f99550d8.entry.js → p-1c662f1d.entry.js} +1 -1
- package/dist/twilight/{p-233b9115.entry.js → p-2607ac8e.entry.js} +1 -1
- package/dist/twilight/{p-63a2ee05.entry.js → p-27396f6f.entry.js} +1 -1
- package/dist/twilight/{p-c9b1ad01.entry.js → p-277f3a46.entry.js} +1 -1
- package/dist/twilight/{p-6cd863b9.entry.js → p-2c212d54.entry.js} +1 -1
- package/dist/twilight/p-2f2771de.entry.js +4 -0
- package/dist/twilight/{p-309f771b.entry.js → p-33842645.entry.js} +1 -1
- package/dist/twilight/{p-be916b5f.entry.js → p-34240222.entry.js} +1 -1
- package/dist/twilight/{p-5c9e4502.entry.js → p-3615a99b.entry.js} +1 -1
- package/dist/twilight/{p-647832d9.entry.js → p-3627d945.entry.js} +1 -1
- package/dist/twilight/{p-b4fda5f4.entry.js → p-38b4dfa9.entry.js} +1 -1
- package/dist/twilight/{p-5ab11313.entry.js → p-3a4160c2.entry.js} +1 -1
- package/dist/twilight/{p-74a1a32f.entry.js → p-434f3557.entry.js} +1 -1
- package/dist/twilight/{p-63acbca7.entry.js → p-44ee3af8.entry.js} +1 -1
- package/dist/twilight/{p-6451e759.entry.js → p-4d3e018b.entry.js} +1 -1
- package/dist/twilight/{p-569ad58b.entry.js → p-4df5f9a0.entry.js} +1 -1
- package/dist/twilight/{p-b17c6f84.entry.js → p-4f1102f8.entry.js} +1 -1
- package/dist/twilight/{p-52607d64.entry.js → p-5256180e.entry.js} +1 -1
- package/dist/twilight/{p-9dbf3ff4.entry.js → p-5383a324.entry.js} +1 -1
- package/dist/twilight/{p-c26f1183.entry.js → p-57b7cd9f.entry.js} +1 -1
- package/dist/twilight/{p-77fa0f9f.entry.js → p-581eeaf8.entry.js} +1 -1
- package/dist/twilight/{p-8e293878.entry.js → p-5a4f7313.entry.js} +1 -1
- package/dist/twilight/{p-b16264a3.entry.js → p-649ced48.entry.js} +1 -1
- package/dist/twilight/{p-897b8824.entry.js → p-69d75b45.entry.js} +1 -1
- package/dist/twilight/{p-e0f3e985.entry.js → p-6e78cc02.entry.js} +1 -1
- package/dist/twilight/{p-c8dae54b.entry.js → p-785cee9b.entry.js} +1 -1
- package/dist/twilight/{p-e354292f.entry.js → p-7b6fa77f.entry.js} +1 -1
- package/dist/twilight/{p-2ddabee9.entry.js → p-7e101885.entry.js} +1 -1
- package/dist/twilight/{p-971b8ff5.entry.js → p-7e9d98c3.entry.js} +1 -1
- package/dist/twilight/{p-13978ff2.entry.js → p-8838ad5c.entry.js} +1 -1
- package/dist/twilight/{p-db4dc7cc.entry.js → p-8cf65dbf.entry.js} +1 -1
- package/dist/twilight/{p-40d4ccbb.entry.js → p-8e0bdbbc.entry.js} +1 -1
- package/dist/twilight/{p-991fa4ad.entry.js → p-95a3b9b9.entry.js} +1 -1
- package/dist/twilight/{p-c5d1b2e4.entry.js → p-97136699.entry.js} +1 -1
- package/dist/twilight/{p-1485dedd.entry.js → p-9ae3a15c.entry.js} +1 -1
- package/dist/twilight/{p-b4f2f280.entry.js → p-9cbc4733.entry.js} +1 -1
- package/dist/twilight/{p-8e631629.entry.js → p-9e702ebb.entry.js} +1 -1
- package/dist/twilight/p-9ee1e01c.entry.js +4 -0
- package/dist/twilight/{p-66ece3d6.entry.js → p-9f1d1b76.entry.js} +1 -1
- package/dist/twilight/{p-b4d47e7c.entry.js → p-9fdb6380.entry.js} +1 -1
- package/dist/twilight/{p-UxfFm_QX.js → p-B-Q5WD6p.js} +1 -1
- package/dist/twilight/{p-DBnECOny.js → p-B59qdBmY.js} +2 -2
- package/dist/twilight/{p-GwasjFLA.js → p-BdsgfewR.js} +1 -1
- package/dist/twilight/{p-B64o_70M.js → p-Bf2Z6A1M.js} +1 -1
- package/dist/twilight/{p-Bh11vKua.js → p-BlDax_46.js} +1 -1
- package/dist/twilight/{p-0MyCcOKI.js → p-CG1Rwy3q.js} +1 -1
- package/dist/twilight/{p-BK166pHQ.js → p-CMQ7Gxqu.js} +1 -1
- package/dist/twilight/{p-DWqu98fW.js → p-CPqpCDCi.js} +1 -1
- package/dist/twilight/p-D6rFREuQ.js +4 -0
- package/dist/twilight/{p-DrJZdc5M.js → p-DfIHi_xi.js} +1 -1
- package/dist/twilight/{p-87227eb2.entry.js → p-a3eb15e4.entry.js} +1 -1
- package/dist/twilight/{p-ba32a9d2.entry.js → p-a818352a.entry.js} +1 -1
- package/dist/twilight/{p-63cebaef.entry.js → p-a8d6804c.entry.js} +1 -1
- package/dist/twilight/{p-b0a87a8d.entry.js → p-aa71f393.entry.js} +1 -1
- package/dist/twilight/{p-7c2a0a8b.entry.js → p-b017b72e.entry.js} +1 -1
- package/dist/twilight/{p-9a617c41.entry.js → p-b19102f6.entry.js} +1 -1
- package/dist/twilight/{p-5f860460.entry.js → p-b2380c6b.entry.js} +1 -1
- package/dist/twilight/{p-9ae25175.entry.js → p-b452c8a0.entry.js} +1 -1
- package/dist/twilight/{p-7eca6506.entry.js → p-b603a180.entry.js} +1 -1
- package/dist/twilight/{p-ace041b9.entry.js → p-b7b4231f.entry.js} +1 -1
- package/dist/twilight/{p-0c7bdda5.entry.js → p-bc595ee3.entry.js} +1 -1
- package/dist/twilight/{p-56e553e4.entry.js → p-bd3fef37.entry.js} +1 -1
- package/dist/twilight/{p-e4db462b.entry.js → p-bded58cb.entry.js} +1 -1
- package/dist/twilight/{p-26c750c8.entry.js → p-be95b40b.entry.js} +1 -1
- package/dist/twilight/{p-1ad71324.entry.js → p-c0c561b9.entry.js} +1 -1
- package/dist/twilight/{p-1628c63c.entry.js → p-c24f6325.entry.js} +1 -1
- package/dist/twilight/{p-d0847af9.entry.js → p-c31b966f.entry.js} +1 -1
- package/dist/twilight/{p-3eb853f9.entry.js → p-c56725b9.entry.js} +1 -1
- package/dist/twilight/{p-1ce848ab.entry.js → p-c818e0eb.entry.js} +1 -1
- package/dist/twilight/{p-840dd411.entry.js → p-cd51e722.entry.js} +1 -1
- package/dist/twilight/{p-923a35da.entry.js → p-cf21323d.entry.js} +1 -1
- package/dist/twilight/{p-660a552a.entry.js → p-cfac0aa1.entry.js} +1 -1
- package/dist/twilight/{p-a5199e7d.entry.js → p-cfbf287b.entry.js} +1 -1
- package/dist/twilight/{p-49c7dc56.entry.js → p-d2556680.entry.js} +1 -1
- package/dist/twilight/{p-04cc5898.entry.js → p-d2c204f4.entry.js} +1 -1
- package/dist/twilight/{p-177e9071.entry.js → p-d63ca8bb.entry.js} +1 -1
- package/dist/twilight/{p-37b73a97.entry.js → p-d65a6462.entry.js} +1 -1
- package/dist/twilight/{p-b0500232.entry.js → p-dfaf0617.entry.js} +1 -1
- package/dist/twilight/{p-cb02e6db.entry.js → p-e284728d.entry.js} +1 -1
- package/dist/twilight/{p-7ce5c2cd.entry.js → p-e54cc4f8.entry.js} +1 -1
- package/dist/twilight/{p-19b03612.entry.js → p-e8a1c501.entry.js} +1 -1
- package/dist/twilight/{p-e826d3aa.entry.js → p-e8b220e1.entry.js} +1 -1
- package/dist/twilight/{p-a867beee.entry.js → p-ebb73bcc.entry.js} +1 -1
- package/dist/twilight/{p-003648b5.entry.js → p-efa79191.entry.js} +1 -1
- package/dist/twilight/{p-d7e4f0f8.entry.js → p-f1322c8e.entry.js} +1 -1
- package/dist/twilight/{p-a0e8ca67.entry.js → p-f2e5f1fd.entry.js} +1 -1
- package/dist/twilight/{p-602e632c.entry.js → p-f586c239.entry.js} +1 -1
- package/dist/twilight/{p-74c7cc02.entry.js → p-fc587040.entry.js} +1 -1
- package/dist/twilight/{p-BcGXp0zm.js → p-uOF6Cufg.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/Helpers/Helper.d.ts +10 -0
- package/dist/types/components/salla-applied-filters/salla-applied-filters.d.ts +37 -0
- package/dist/types/components/salla-filters/salla-filters.d.ts +3 -11
- package/dist/types/components.d.ts +17 -0
- package/package.json +5 -5
- package/dist/cjs/interfaces-DZDQwN6-.js +0 -23
- package/dist/esm/interfaces-DL4h2bc3.js +0 -23
- package/dist/twilight/p-3f460184.entry.js +0 -4
- package/dist/twilight/p-DL4h2bc3.js +0 -4
- package/dist/twilight/p-DOBDDG4K.js +0 -4
- package/dist/twilight/p-a7fccb9c.entry.js +0 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SallaAppliedFilters extends Components.SallaAppliedFilters, HTMLElement {}
|
|
4
|
+
export const SallaAppliedFilters: {
|
|
5
|
+
prototype: SallaAppliedFilters;
|
|
6
|
+
new (): SallaAppliedFilters;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { H as Helper, F as FilterOptionTypes } from './Helper.js';
|
|
6
|
+
|
|
7
|
+
const sallaAppliedFiltersCss = "/*!twlt*/:host{display:block}.s-applied-filters-tags{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;margin-bottom:1rem}.s-applied-filters-tag{display:inline-flex;align-items:center;gap:0.4rem;border-radius:999px;border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);color:var(--main-text-color);font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem}.s-applied-filters-tag-remove{display:inline-flex;align-items:center;justify-content:center;border:0;padding:0;background:transparent;color:inherit;font-size:0.75rem;cursor:pointer}.s-applied-filters-clear-tag{display:inline-flex;align-items:center;gap:0.4rem;border-radius:999px;border:1px solid var(--color-danger, #dc3545);background:transparent;color:var(--color-danger, #dc3545);font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem;cursor:pointer}.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-applied-filters-wrapper{display:block}.s-applied-filters-tags{margin-bottom:1rem;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-applied-filters-tag{display:inline-flex;align-items:center;gap:0.375rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));background-color:rgb(255 255 255 / 0.3);padding-top:0.375rem;padding-bottom:0.375rem;padding-left:0.625rem;padding-right:0.625rem;font-size:0.875rem;line-height:1.25rem;color:var(--main-text-color)}.s-applied-filters-tag-name{color:inherit}.s-applied-filters-tag-remove{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;border-width:0px;background-color:transparent;padding:0px;font-size:0.75rem;line-height:1rem;color:inherit}.s-applied-filters-clear-tag{display:inline-flex;cursor:pointer;align-items:center;gap:0.375rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1));background-color:transparent;padding-top:0.375rem;padding-bottom:0.375rem;padding-left:0.625rem;padding-right:0.625rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}";
|
|
8
|
+
|
|
9
|
+
const SallaAppliedFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaAppliedFilters extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.filters = [];
|
|
14
|
+
this.filtersData = {};
|
|
15
|
+
this.clearAllLabel = '';
|
|
16
|
+
this.removeLabel = '';
|
|
17
|
+
this.translationDefaults = {
|
|
18
|
+
'pages.categories.clear_all_filters': { ar: 'إزالة التصفية', en: 'Clear All' },
|
|
19
|
+
'common.elements.delete': { ar: 'حذف', en: 'Delete' },
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async componentWillLoad() {
|
|
23
|
+
salla.event.on('filters::fetched', ({ filters }) => {
|
|
24
|
+
this.filters = Helper.resolveFilterLabels(filters);
|
|
25
|
+
this.syncFiltersDataFromFiltersElement();
|
|
26
|
+
});
|
|
27
|
+
salla.event.on('filters::hidden', () => {
|
|
28
|
+
this.filters = [];
|
|
29
|
+
});
|
|
30
|
+
// The current selections, kept in sync with salla-filters' own state.
|
|
31
|
+
salla.event.on('salla-filters::changed', (filtersData) => {
|
|
32
|
+
this.filtersData = { ...filtersData };
|
|
33
|
+
});
|
|
34
|
+
salla.event.on('salla-filters::reset', () => {
|
|
35
|
+
this.filtersData = {};
|
|
36
|
+
});
|
|
37
|
+
salla.lang.onLoaded(() => {
|
|
38
|
+
this.registerTranslationDefaults();
|
|
39
|
+
this.loadTranslations();
|
|
40
|
+
});
|
|
41
|
+
this.getInitialFiltersData();
|
|
42
|
+
}
|
|
43
|
+
getInitialFiltersData() {
|
|
44
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
45
|
+
this.filtersData = Helper.extractFiltersFromUrl(searchParams);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* salla-filters reconciles its own filtersData synchronously in its `filters::fetched`
|
|
49
|
+
* handler, dropping any key whose filter group no longer exists in the fresh backend
|
|
50
|
+
* response (e.g. a disabled category). Pull that reconciled state instead of keeping our
|
|
51
|
+
* own copy sourced from the raw URL, which would otherwise go stale forever — it's only
|
|
52
|
+
* ever updated by user-driven `salla-filters::changed`/`reset` events, never by a fetch.
|
|
53
|
+
* Deferred a tick so it runs after salla-filters' own (synchronous) listener, regardless
|
|
54
|
+
* of which component happened to register its `filters::fetched` listener first.
|
|
55
|
+
*/
|
|
56
|
+
syncFiltersDataFromFiltersElement() {
|
|
57
|
+
setTimeout(async () => {
|
|
58
|
+
const filtersData = await this.getFiltersElement()?.getFilters();
|
|
59
|
+
if (filtersData) {
|
|
60
|
+
this.filtersData = { ...filtersData };
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Register bilingual (ar/en) defaults for our keys, without overriding any
|
|
66
|
+
* translation that already exists in the store/central translations.
|
|
67
|
+
*/
|
|
68
|
+
registerTranslationDefaults() {
|
|
69
|
+
const missing = Object.entries(this.translationDefaults).reduce((acc, [key, value]) => {
|
|
70
|
+
// `get` returns the key itself when no translation is found.
|
|
71
|
+
if (salla.lang.get(key) === key) {
|
|
72
|
+
acc[key] = value;
|
|
73
|
+
}
|
|
74
|
+
return acc;
|
|
75
|
+
}, {});
|
|
76
|
+
if (Object.keys(missing).length) {
|
|
77
|
+
salla.lang.addBulk(missing);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
loadTranslations() {
|
|
81
|
+
this.clearAllLabel = salla.lang.get('pages.categories.clear_all_filters');
|
|
82
|
+
this.removeLabel = salla.lang.get('common.elements.delete');
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Flatten the selected filtersData into displayable chips, resolving the
|
|
86
|
+
* human label for each group + option from `this.filters`. Selections that
|
|
87
|
+
* can't be resolved to a known option (e.g. the auto-added base category)
|
|
88
|
+
* are skipped. Ported from salla-filters, which no longer renders this UI.
|
|
89
|
+
*/
|
|
90
|
+
getAppliedFilters() {
|
|
91
|
+
const chips = [];
|
|
92
|
+
const data = this.filtersData || {};
|
|
93
|
+
for (const key of Object.keys(data)) {
|
|
94
|
+
if (key === 'variants') {
|
|
95
|
+
const variantFilter = this.filters?.find(f => f.type === FilterOptionTypes.VARIANTS);
|
|
96
|
+
for (const variantKey of Object.keys(data.variants || {})) {
|
|
97
|
+
const value = data.variants[variantKey];
|
|
98
|
+
const opt = variantFilter?.values?.find(o => (o.key || o.value) == value);
|
|
99
|
+
if (!opt)
|
|
100
|
+
continue;
|
|
101
|
+
chips.push({
|
|
102
|
+
key,
|
|
103
|
+
variantKey,
|
|
104
|
+
value,
|
|
105
|
+
type: FilterOptionTypes.VARIANTS,
|
|
106
|
+
groupLabel: variantFilter?.label,
|
|
107
|
+
optionLabel: opt.value,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const group = this.filters?.find(f => f.key === key);
|
|
113
|
+
if (!group)
|
|
114
|
+
continue;
|
|
115
|
+
const raw = data[key];
|
|
116
|
+
// RANGE (e.g. price) is stored as a { min, max } object
|
|
117
|
+
if (group.type === FilterOptionTypes.RANGE ||
|
|
118
|
+
(raw && typeof raw === 'object' && !Array.isArray(raw))) {
|
|
119
|
+
const min = raw.min;
|
|
120
|
+
const max = raw.max;
|
|
121
|
+
chips.push({
|
|
122
|
+
key,
|
|
123
|
+
value: raw,
|
|
124
|
+
type: FilterOptionTypes.RANGE,
|
|
125
|
+
groupLabel: group.label,
|
|
126
|
+
optionLabel: `${min} - ${max}`,
|
|
127
|
+
});
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
// the auto-appended base category (see filters::fetched) is page scoping, not a user
|
|
131
|
+
// selection — skip it. It's stored as a scalar; user selections are always arrays.
|
|
132
|
+
if (key === 'category_id' &&
|
|
133
|
+
!Array.isArray(raw) &&
|
|
134
|
+
salla.config.get('page.slug') == 'product.index' &&
|
|
135
|
+
raw == salla.config.get('page.id')) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const values = Array.isArray(raw) ? raw : [raw];
|
|
139
|
+
for (const value of values) {
|
|
140
|
+
// rating values are bare numbers; everything else maps key -> value label
|
|
141
|
+
const opt = group.values?.find(o => (typeof o === 'number' ? o : o.key || o.value) == value);
|
|
142
|
+
const optionLabel = group.key === 'rating'
|
|
143
|
+
? `${value}`
|
|
144
|
+
: opt && typeof opt !== 'number'
|
|
145
|
+
? opt.value
|
|
146
|
+
: undefined;
|
|
147
|
+
if (optionLabel == null)
|
|
148
|
+
continue;
|
|
149
|
+
chips.push({ key, value, type: group.type, groupLabel: group.label, optionLabel });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return chips;
|
|
153
|
+
}
|
|
154
|
+
getFiltersElement() {
|
|
155
|
+
return document.querySelector('salla-filters');
|
|
156
|
+
}
|
|
157
|
+
removeFilter(chip) {
|
|
158
|
+
this.getFiltersElement()?.removeFilter(chip);
|
|
159
|
+
}
|
|
160
|
+
clearAll() {
|
|
161
|
+
this.getFiltersElement()?.resetFilters();
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const chips = this.getAppliedFilters();
|
|
165
|
+
if (!chips.length) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
return (h(Host, { class: "s-applied-filters-wrapper" }, h("div", { class: "s-applied-filters-tags" }, chips.map(chip => (h("div", { class: "s-applied-filters-tag" }, h("span", { class: "s-applied-filters-tag-name" }, chip.groupLabel, ": ", chip.optionLabel), h("button", { type: "button", class: "s-applied-filters-tag-remove", "aria-label": `${this.removeLabel} ${chip.groupLabel}: ${chip.optionLabel}`, onClick: () => this.removeFilter(chip) }, h("i", { class: "sicon-cancel", "aria-hidden": "true" }))))), h("button", { type: "button", class: "s-applied-filters-clear-tag", onClick: () => this.clearAll() }, h("span", null, this.clearAllLabel)))));
|
|
169
|
+
}
|
|
170
|
+
static get style() { return sallaAppliedFiltersCss; }
|
|
171
|
+
}, [0, "salla-applied-filters", {
|
|
172
|
+
"filters": [32],
|
|
173
|
+
"filtersData": [32],
|
|
174
|
+
"clearAllLabel": [32],
|
|
175
|
+
"removeLabel": [32]
|
|
176
|
+
}]);
|
|
177
|
+
function defineCustomElement$1() {
|
|
178
|
+
if (typeof customElements === "undefined") {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const components = ["salla-applied-filters"];
|
|
182
|
+
components.forEach(tagName => { switch (tagName) {
|
|
183
|
+
case "salla-applied-filters":
|
|
184
|
+
if (!customElements.get(tagName)) {
|
|
185
|
+
customElements.define(tagName, SallaAppliedFilters$1);
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
} });
|
|
189
|
+
}
|
|
190
|
+
defineCustomElement$1();
|
|
191
|
+
|
|
192
|
+
const SallaAppliedFilters = SallaAppliedFilters$1;
|
|
193
|
+
const defineCustomElement = defineCustomElement$1;
|
|
194
|
+
|
|
195
|
+
export { SallaAppliedFilters, defineCustomElement };
|
|
@@ -2,30 +2,11 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
|
-
import { H as Helper } from './Helper.js';
|
|
5
|
+
import { F as FilterOptionTypes, H as Helper } from './Helper.js';
|
|
6
6
|
import { d as defineCustomElement$3 } from './salla-button2.js';
|
|
7
7
|
import { d as defineCustomElement$2 } from './salla-price-range2.js';
|
|
8
8
|
import { d as defineCustomElement$1 } from './salla-rating-stars2.js';
|
|
9
9
|
|
|
10
|
-
var FilterOptionTypes;
|
|
11
|
-
(function (FilterOptionTypes) {
|
|
12
|
-
// CATEGORIES = "categories",
|
|
13
|
-
// BRANDs = "brands",
|
|
14
|
-
// RATING = "rating",
|
|
15
|
-
// PRICE = "price",
|
|
16
|
-
// RADIO = "radio",
|
|
17
|
-
FilterOptionTypes["VALUES"] = "values";
|
|
18
|
-
FilterOptionTypes["VARIANTS"] = "variants";
|
|
19
|
-
FilterOptionTypes["MINIMUM"] = "minimum";
|
|
20
|
-
FilterOptionTypes["RANGE"] = "range";
|
|
21
|
-
})(FilterOptionTypes || (FilterOptionTypes = {}));
|
|
22
|
-
var FilterOptionInputType;
|
|
23
|
-
(function (FilterOptionInputType) {
|
|
24
|
-
FilterOptionInputType["VALUES"] = "values";
|
|
25
|
-
FilterOptionInputType["VARIANT"] = "variants";
|
|
26
|
-
FilterOptionInputType["RANGE"] = "range";
|
|
27
|
-
})(FilterOptionInputType || (FilterOptionInputType = {}));
|
|
28
|
-
|
|
29
10
|
const sallaFiltersWidgetCss = "/*!twlt*/:host{display:block}.collapse{visibility:collapse}.fixed{position:fixed}.hidden{display:none}.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)}.duration-300{transition-duration:300ms}.s-filters-widget-container{display:block;overflow:hidden;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0.5rem}@media (min-width: 768px){.s-filters-widget-container{margin-bottom:1.25rem;padding-bottom:1.25rem;padding-top:1.25rem}}.s-filters-widget-content{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-opened{visibility:visible;opacity:1}.s-filters-widget-closed{visibility:hidden;height:0px !important;padding:0px;opacity:0}.s-filters-widget-title{display:flex;cursor:pointer;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:700}.s-filters-widget-arrow{font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));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:300ms}.s-filters-widget-arrow svg{height:1.25rem;width:1.25rem}.s-filters-widget-active-arrow{--tw-rotate:90deg;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));--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-filters-widget-values{overflow:hidden;padding-top:1rem;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-more{margin-top:0.5rem;display:block;cursor:pointer;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-filters-widget-plusminus{position:relative;height:0.75rem;width:0.75rem;--tw-rotate:90deg;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))}.s-filters-widget-plusminus::before{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus::after{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus-active:before{transform:translatey(-50%) rotate(-90deg);opacity:0}.s-filters-widget-plusminus-active:after{transform:translatey(-50%) rotate(0);background-color:var(--color-primary)}.s-filters-widget-plusminus:before{transform:translatey(-50%)}.s-filters-widget-plusminus:after{transform:translatey(-50%) rotate(90deg)}.s-filters-widget-search-input{width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding:0.5rem}.s-filters-widget-search-input:focus{border-color:var(--color-primary);outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary)}.s-filters-widget-empty-state{padding:0.5rem;text-align:center;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}";
|
|
30
11
|
|
|
31
12
|
const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class SallaFiltersWidget extends HTMLElement {
|
|
@@ -252,4 +233,4 @@ function defineCustomElement() {
|
|
|
252
233
|
}
|
|
253
234
|
defineCustomElement();
|
|
254
235
|
|
|
255
|
-
export {
|
|
236
|
+
export { SallaFiltersWidget as S, defineCustomElement as d };
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
|
-
import {
|
|
6
|
-
import { H as Helper } from './Helper.js';
|
|
5
|
+
import { H as Helper, F as FilterOptionTypes } from './Helper.js';
|
|
7
6
|
import { d as defineCustomElement$5 } from './salla-button2.js';
|
|
7
|
+
import { d as defineCustomElement$4 } from './salla-filters-widget2.js';
|
|
8
8
|
import { d as defineCustomElement$3 } from './salla-price-range2.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './salla-rating-stars2.js';
|
|
10
10
|
|
|
11
|
-
const sallaFiltersCss = "/*!twlt*/:host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.
|
|
11
|
+
const sallaFiltersCss = "/*!twlt*/:host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.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-filters-checkbox{height:1.25rem;width:1.25rem;border-radius:6px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-filters-checkbox:focus{--tw-ring-color:transparent}.s-filters-radio{position:relative;height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1)) !important;color:var(--color-primary)}.s-filters-radio:focus{--tw-ring-color:transparent}.s-filters-radio:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-right:0.75rem}.s-filters-radio:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-left:0.75rem}.s-filters-radio:checked{border-color:var(--color-primary)}.s-filters-radio:checked::after{position:absolute;left:0.125rem;top:0.125rem;display:block;height:0.625rem;width:0.625rem;border-radius:9999px;background-color:var(--color-primary);--tw-content:'';content:var(--tw-content)}.s-filters-radio:checked:hover{border-color:var(--color-primary)}.s-filters-radio:checked:focus{border-color:var(--color-primary)}.s-filters-label{position:relative;margin-bottom:0.75rem;display:flex;cursor:pointer;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-filters-label:last-child{margin-bottom:0px}.s-filters-option-name{margin-left:0.5rem;margin-right:0.5rem;--tw-text-opacity:1;color:rgb(129 127 127 / var(--tw-text-opacity, 1))}.s-filters-footer{margin-top:1rem;display:flex}.s-filters-footer salla-button{flex:1 1 0%}.s-filters-footer salla-button button{width:100%}";
|
|
12
12
|
|
|
13
13
|
const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters extends HTMLElement {
|
|
14
14
|
constructor() {
|
|
@@ -18,32 +18,15 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
18
18
|
this.isReady = false; //to avoid triggering the changed event
|
|
19
19
|
this.isInitialFetch = true; //the base-category auto-append may only run on the first filters::fetched
|
|
20
20
|
this.filtersData = {};
|
|
21
|
-
this.appliedOpen = true;
|
|
22
21
|
salla.event.on('filters::hidden', () => this.host.style.display = 'none');
|
|
23
22
|
salla.lang.onLoaded(() => {
|
|
24
23
|
this.apply = salla.lang.get('pages.checkout.apply');
|
|
25
|
-
this.reset = salla.lang.get('pages.categories.filters_reset');
|
|
26
|
-
this.selectedTitle = salla.lang.getWithDefault('pages.categories.selected_filters', 'لقد اخترت');
|
|
27
24
|
});
|
|
28
25
|
salla.event.on('filters::fetched', ({ filters }) => {
|
|
29
26
|
this.host.style.display = '';
|
|
30
27
|
let freshFilterData = {};
|
|
31
|
-
this.filters = filters
|
|
28
|
+
this.filters = Helper.resolveFilterLabels(filters)
|
|
32
29
|
.map((filter) => {
|
|
33
|
-
filter.label = {
|
|
34
|
-
category_id: salla.lang.get('common.titles.categories'),
|
|
35
|
-
brand_id: salla.lang.get('common.titles.brands'),
|
|
36
|
-
rating: salla.lang.get('pages.categories.filter_rating'),
|
|
37
|
-
price: salla.lang.get('pages.categories.filter_price'),
|
|
38
|
-
}[filter.key] || filter.label;
|
|
39
|
-
// filter.type = FilterOptionTypes.VALUES;
|
|
40
|
-
if (filter.key == 'rating') {
|
|
41
|
-
filter.type = FilterOptionTypes.VALUES;
|
|
42
|
-
//@ts-ignore
|
|
43
|
-
let { max, min } = filter.values;
|
|
44
|
-
//@ts-ignore
|
|
45
|
-
filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max);
|
|
46
|
-
}
|
|
47
30
|
if (this.filtersData.variants && filter.type == FilterOptionTypes.VARIANTS) {
|
|
48
31
|
freshFilterData.variants = this.filtersData.variants;
|
|
49
32
|
}
|
|
@@ -206,57 +189,12 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
206
189
|
this.filtersData = { ...this.filtersData }; // reassign so @State re-renders the applied chips
|
|
207
190
|
this.applyFilters();
|
|
208
191
|
}
|
|
209
|
-
/**
|
|
210
|
-
* Flatten the selected filtersData into displayable chips, resolving the
|
|
211
|
-
* human label for each group + option from `this.filters`. Selections that
|
|
212
|
-
* can't be resolved to a known option (e.g. the auto-added base category)
|
|
213
|
-
* are skipped.
|
|
214
|
-
*/
|
|
215
|
-
getAppliedFilters() {
|
|
216
|
-
const chips = [];
|
|
217
|
-
const data = this.filtersData || {};
|
|
218
|
-
for (const key of Object.keys(data)) {
|
|
219
|
-
if (key === 'variants') {
|
|
220
|
-
const variantFilter = this.filters?.find(f => f.type === FilterOptionTypes.VARIANTS);
|
|
221
|
-
for (const variantKey of Object.keys(data.variants || {})) {
|
|
222
|
-
const value = data.variants[variantKey];
|
|
223
|
-
const opt = variantFilter?.values?.find(o => (o.key || o.value) == value);
|
|
224
|
-
if (!opt)
|
|
225
|
-
continue;
|
|
226
|
-
chips.push({ key, variantKey, value, type: FilterOptionTypes.VARIANTS, groupLabel: variantFilter?.label, optionLabel: opt.value });
|
|
227
|
-
}
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
const group = this.filters?.find(f => f.key === key);
|
|
231
|
-
if (!group)
|
|
232
|
-
continue;
|
|
233
|
-
const raw = data[key];
|
|
234
|
-
// RANGE (e.g. price) is stored as a { min, max } object
|
|
235
|
-
if (group.type === FilterOptionTypes.RANGE || (raw && typeof raw === 'object' && !Array.isArray(raw))) {
|
|
236
|
-
chips.push({ key, value: raw, type: FilterOptionTypes.RANGE, groupLabel: group.label, optionLabel: `${raw.min} - ${raw.max}` });
|
|
237
|
-
continue;
|
|
238
|
-
}
|
|
239
|
-
// the auto-appended base category (see filters::fetched) is page scoping, not a user
|
|
240
|
-
// selection — skip it. It's stored as a scalar; user selections are always arrays.
|
|
241
|
-
if (key === 'category_id' && !Array.isArray(raw) && salla.config.get('page.slug') == 'product.index' && raw == salla.config.get('page.id')) {
|
|
242
|
-
continue;
|
|
243
|
-
}
|
|
244
|
-
const values = Array.isArray(raw) ? raw : [raw];
|
|
245
|
-
for (const value of values) {
|
|
246
|
-
// rating values are bare numbers; everything else maps key -> value label
|
|
247
|
-
const opt = group.values?.find(o => (typeof o === 'number' ? o : (o.key || o.value)) == value);
|
|
248
|
-
const optionLabel = group.key === 'rating' ? `${value}` : (opt && typeof opt !== 'number' ? opt.value : undefined);
|
|
249
|
-
if (optionLabel == null)
|
|
250
|
-
continue;
|
|
251
|
-
chips.push({ key, value, type: group.type, groupLabel: group.label, optionLabel });
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
return chips;
|
|
255
|
-
}
|
|
256
192
|
/**
|
|
257
193
|
* Remove a single applied filter — the direct inverse of handleOptionChange.
|
|
194
|
+
* Public so salla-applied-filters (which owns the applied-chips UI) can
|
|
195
|
+
* drive removal on the live salla-filters element it reads chips from.
|
|
258
196
|
*/
|
|
259
|
-
removeFilter(chip) {
|
|
197
|
+
async removeFilter(chip) {
|
|
260
198
|
if (chip.type === FilterOptionTypes.VARIANTS) {
|
|
261
199
|
if (this.filtersData.variants) {
|
|
262
200
|
delete this.filtersData.variants[chip.variantKey];
|
|
@@ -282,9 +220,7 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
282
220
|
this.applyFilters();
|
|
283
221
|
}
|
|
284
222
|
render() {
|
|
285
|
-
|
|
286
|
-
const removeText = salla.lang.getWithDefault('common.elements.delete', 'Remove');
|
|
287
|
-
return h(Host, { key: 'f0493d0e85ebb9e6612a1edc6cd7f45e7473017e' }, appliedFilters.length ? h("div", { class: "s-filters-applied s-filters-widget-container" }, h("h3", { class: "s-filters-widget-title", onClick: () => this.appliedOpen = !this.appliedOpen }, h("span", null, this.selectedTitle), h("span", { class: `s-filters-widget-plusminus ${this.appliedOpen ? 's-filters-widget-plusminus-active' : ''}` })), h("div", { class: `s-filters-widget-content ${this.appliedOpen ? 's-filters-widget-opened' : 's-filters-widget-closed'}` }, h("div", { class: "s-filters-widget-values" }, appliedFilters.map(chip => h("div", { class: "s-filters-label s-filters-applied-item" }, h("span", { class: "s-filters-option-name" }, chip.groupLabel, ": ", chip.optionLabel), h("button", { type: "button", class: "s-filters-applied-remove", "aria-label": `${removeText} ${chip.groupLabel}: ${chip.optionLabel}`, onClick: () => this.removeFilter(chip) }, h("i", { class: "sicon-cancel", "aria-hidden": "true" }))))), h("div", { class: "s-filters-footer" }, h("salla-button", { color: 'gray', fill: 'outline', onClick: () => this.resetFilters() }, this.reset)))) : '', this.filters?.map(option => h("salla-filters-widget", { option: option, filtersData: this.filtersData, onChanged: ({ detail: { event, option, value } }) => {
|
|
223
|
+
return h(Host, { key: '32ede23f7fb3d9c7fbcd136ad2773e3212c2f5b8' }, this.filters?.map(option => h("salla-filters-widget", { option: option, filtersData: this.filtersData, onChanged: ({ detail: { event, option, value } }) => {
|
|
288
224
|
this.handleOptionChange(event, option, value);
|
|
289
225
|
} })));
|
|
290
226
|
}
|
|
@@ -298,12 +234,10 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
298
234
|
"isSidebarOpen": [32],
|
|
299
235
|
"filtersData": [32],
|
|
300
236
|
"apply": [32],
|
|
301
|
-
"reset": [32],
|
|
302
|
-
"selectedTitle": [32],
|
|
303
|
-
"appliedOpen": [32],
|
|
304
237
|
"getFilters": [64],
|
|
305
238
|
"applyFilters": [64],
|
|
306
|
-
"resetFilters": [64]
|
|
239
|
+
"resetFilters": [64],
|
|
240
|
+
"removeFilter": [64]
|
|
307
241
|
}]);
|
|
308
242
|
function defineCustomElement$1() {
|
|
309
243
|
if (typeof customElements === "undefined") {
|
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { a as anime } from './anime.es-CgtvEd63.js';
|
|
5
5
|
|
|
6
|
+
var FilterOptionTypes;
|
|
7
|
+
(function (FilterOptionTypes) {
|
|
8
|
+
// CATEGORIES = "categories",
|
|
9
|
+
// BRANDs = "brands",
|
|
10
|
+
// RATING = "rating",
|
|
11
|
+
// PRICE = "price",
|
|
12
|
+
// RADIO = "radio",
|
|
13
|
+
FilterOptionTypes["VALUES"] = "values";
|
|
14
|
+
FilterOptionTypes["VARIANTS"] = "variants";
|
|
15
|
+
FilterOptionTypes["MINIMUM"] = "minimum";
|
|
16
|
+
FilterOptionTypes["RANGE"] = "range";
|
|
17
|
+
})(FilterOptionTypes || (FilterOptionTypes = {}));
|
|
18
|
+
var FilterOptionInputType;
|
|
19
|
+
(function (FilterOptionInputType) {
|
|
20
|
+
FilterOptionInputType["VALUES"] = "values";
|
|
21
|
+
FilterOptionInputType["VARIANT"] = "variants";
|
|
22
|
+
FilterOptionInputType["RANGE"] = "range";
|
|
23
|
+
})(FilterOptionInputType || (FilterOptionInputType = {}));
|
|
24
|
+
|
|
6
25
|
//TODO::reduce it to 10
|
|
7
26
|
salla.event.setMaxListeners(100);
|
|
8
27
|
class Helper {
|
|
@@ -139,6 +158,33 @@ class Helper {
|
|
|
139
158
|
});
|
|
140
159
|
return filters;
|
|
141
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Resolve i18n labels for the known filter groups (category/brand/rating/price)
|
|
163
|
+
* and normalize the `rating` group's `{min,max}` values into a plain 1-5 star
|
|
164
|
+
* array. Shared by salla-filters (the filter panel) and salla-applied-filters
|
|
165
|
+
* (the applied chips) so both agree on the same group labels. Returns shallow
|
|
166
|
+
* copies rather than mutating in place, since both components receive the
|
|
167
|
+
* same `filters::fetched` payload by reference.
|
|
168
|
+
*/
|
|
169
|
+
resolveFilterLabels(filters) {
|
|
170
|
+
return filters.map((filter) => {
|
|
171
|
+
const resolved = { ...filter };
|
|
172
|
+
resolved.label = {
|
|
173
|
+
category_id: salla.lang.get('common.titles.categories'),
|
|
174
|
+
brand_id: salla.lang.get('common.titles.brands'),
|
|
175
|
+
rating: salla.lang.get('pages.categories.filter_rating'),
|
|
176
|
+
price: salla.lang.get('pages.categories.filter_price'),
|
|
177
|
+
}[resolved.key] || resolved.label;
|
|
178
|
+
if (resolved.key == 'rating') {
|
|
179
|
+
resolved.type = FilterOptionTypes.VALUES;
|
|
180
|
+
//@ts-ignore
|
|
181
|
+
const { max, min } = filter.values;
|
|
182
|
+
//@ts-ignore
|
|
183
|
+
resolved.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max);
|
|
184
|
+
}
|
|
185
|
+
return resolved;
|
|
186
|
+
});
|
|
187
|
+
}
|
|
142
188
|
async injectExtraFieldsToResponse(response) {
|
|
143
189
|
if (!response || !this.includes)
|
|
144
190
|
return response;
|
|
@@ -472,4 +518,4 @@ class Helper {
|
|
|
472
518
|
}
|
|
473
519
|
var Helper$1 = new Helper;
|
|
474
520
|
|
|
475
|
-
export { Helper$1 as H };
|
|
521
|
+
export { FilterOptionTypes as F, Helper$1 as H };
|