@salla.sa/twilight-components 2.14.486 → 2.14.487
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-DvyEpCgx.js → Helper-B2B-kxAI.js} +7 -2
- package/dist/cjs/{filepond-BtDP9OW9.js → filepond-D8YNIT7U.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CTf1Ej_n.js → filepond-plugin-file-poster-DSZGbtH3.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-_wVJpYXF.js → filepond-plugin-file-validate-size-CDPCt-vD.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DWoo5Lcs.js → filepond-plugin-file-validate-type-PPR9wk_f.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DBb_5aN9.js → filepond-plugin-image-edit-CbzNxXz5.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Nnwt-m9k.js → filepond-plugin-image-exif-orientation-CHOCkxIA.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CjBwZm3E.js → filepond-plugin-image-preview-DPzPSwHT.js} +1 -1
- package/dist/cjs/{functions-DkS9Jmao.js → functions-BJ567SZR.js} +1 -1
- package/dist/cjs/{index-C0yFagl6.js → index-AuVRM2C2.js} +1 -1
- package/dist/cjs/{index-C_WIlgE2.js → index-KEg0BIuu.js} +6 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +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-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
- 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 +349 -0
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.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 +15 -8
- package/dist/cjs/salla-filters.cjs.entry.js +101 -13
- 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.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_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.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.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-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_3.cjs.entry.js +2 -2
- 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 +21 -9
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +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/{tracked-promise-TyxTPR6e.js → tracked-promise-DFl5fI3j.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DyJFw96R.js → vanilla-picker-CUpM_-PS.js} +1 -1
- package/dist/collection/Helpers/Helper.js +7 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-cart-summary-card/salla-cart-summary-card.js +401 -0
- package/dist/collection/components/salla-filters/salla-filters.css +5 -0
- package/dist/collection/components/salla-filters/salla-filters.js +101 -11
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +13 -6
- package/dist/collection/components/salla-products-list/salla-products-list.js +19 -7
- package/dist/components/Helper.js +7 -2
- package/dist/components/index.js +2 -2
- package/dist/components/salla-cart-summary-card.d.ts +11 -0
- package/dist/components/salla-cart-summary-card.js +404 -0
- package/dist/components/salla-filters-widget2.js +13 -6
- package/dist/components/salla-filters.js +101 -11
- package/dist/components/salla-products-list2.js +19 -7
- package/dist/esm/{Helper-CD8d-Brd.js → Helper-BQ9mvrt9.js} +7 -2
- package/dist/esm/{filepond-ZiatSU0Y.js → filepond-BsLighF8.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-2WAWdRm2.js → filepond-plugin-file-poster-Bm-5APBo.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DhLjP7aF.js → filepond-plugin-file-validate-size-DkYobKMY.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-HH8AZXAq.js → filepond-plugin-file-validate-type-BXKbNDGH.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BWBtBfk1.js → filepond-plugin-image-edit-B64dqBYZ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CQyPB3lV.js → filepond-plugin-image-exif-orientation-BelOzBrj.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-D6MiVWr1.js → filepond-plugin-image-preview-X67Ek3oE.js} +1 -1
- package/dist/esm/{functions-DflaFDbL.js → functions-DobdGlrA.js} +1 -1
- package/dist/esm/{index-BF901xIc.js → index-DBMDFsFH.js} +6 -2
- package/dist/esm/{index-Co2lT5R8.js → index-yDeCyY3S.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-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +11 -11
- 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 +347 -0
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.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 +15 -8
- package/dist/esm/salla-filters.entry.js +101 -13
- 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.entry.js +2 -2
- package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_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.entry.js +1 -1
- package/dist/esm/salla-notifications.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-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_3.entry.js +2 -2
- 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 +21 -9
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +2 -2
- package/dist/esm/salla-reward-action_4.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +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/{tracked-promise-CNdO8SSl.js → tracked-promise-6uJz7V9Q.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-YVpipuL-.js → vanilla-picker-Bw2Vk5YA.js} +1 -1
- package/dist/twilight/{p-d6da8710.entry.js → p-000022be.entry.js} +1 -1
- package/dist/twilight/{p-aa928350.entry.js → p-00fcfe8e.entry.js} +1 -1
- package/dist/twilight/{p-c01e3f1d.entry.js → p-0412fe67.entry.js} +1 -1
- package/dist/twilight/{p-2192d7c2.entry.js → p-08dfa3c5.entry.js} +1 -1
- package/dist/twilight/{p-22405eaa.entry.js → p-0c219cad.entry.js} +1 -1
- package/dist/twilight/{p-bcfe04fa.entry.js → p-11f843fd.entry.js} +1 -1
- package/dist/twilight/{p-ce8571e3.entry.js → p-130633cc.entry.js} +1 -1
- package/dist/twilight/{p-ad5c8d34.entry.js → p-1450bf80.entry.js} +1 -1
- package/dist/twilight/{p-a5895e0f.entry.js → p-14e936b0.entry.js} +1 -1
- package/dist/twilight/{p-beb2df03.entry.js → p-1547f282.entry.js} +1 -1
- package/dist/twilight/p-18efb27e.entry.js +4 -0
- package/dist/twilight/{p-1d3efd00.entry.js → p-18f264f9.entry.js} +1 -1
- package/dist/twilight/p-1b4fd0db.entry.js +4 -0
- package/dist/twilight/{p-77b6fbf2.entry.js → p-1bb06699.entry.js} +1 -1
- package/dist/twilight/{p-518bab79.entry.js → p-1e418b8f.entry.js} +1 -1
- package/dist/twilight/p-24d268c7.entry.js +4 -0
- package/dist/twilight/{p-2eb78125.entry.js → p-29620c50.entry.js} +1 -1
- package/dist/twilight/{p-9db7e318.entry.js → p-2f48e8e1.entry.js} +1 -1
- package/dist/twilight/{p-67b225d5.entry.js → p-37ced7ab.entry.js} +1 -1
- package/dist/twilight/{p-1c4e7c18.entry.js → p-39a49ae9.entry.js} +1 -1
- package/dist/twilight/{p-6976c445.entry.js → p-3a7f5c6e.entry.js} +1 -1
- package/dist/twilight/{p-e304cb5e.entry.js → p-3f153e79.entry.js} +1 -1
- package/dist/twilight/{p-4e2f144a.entry.js → p-4336dce1.entry.js} +1 -1
- package/dist/twilight/{p-7ce2c5ca.entry.js → p-44f67d40.entry.js} +1 -1
- package/dist/twilight/{p-e692322c.entry.js → p-46294bef.entry.js} +1 -1
- package/dist/twilight/{p-18ad7499.entry.js → p-4836c3eb.entry.js} +1 -1
- package/dist/twilight/{p-be632d40.entry.js → p-49275f85.entry.js} +1 -1
- package/dist/twilight/{p-43ab561c.entry.js → p-4a3ccff2.entry.js} +1 -1
- package/dist/twilight/{p-a7d99355.entry.js → p-4f8ec3a6.entry.js} +1 -1
- package/dist/twilight/{p-2e4fe427.entry.js → p-5119fe5d.entry.js} +1 -1
- package/dist/twilight/{p-ed1e0c2e.entry.js → p-519551ab.entry.js} +1 -1
- package/dist/twilight/{p-b8d180fe.entry.js → p-51fbf1bb.entry.js} +1 -1
- package/dist/twilight/{p-fe69512c.entry.js → p-52cab4a6.entry.js} +1 -1
- package/dist/twilight/{p-0fcc3b26.entry.js → p-546b31a3.entry.js} +1 -1
- package/dist/twilight/{p-5476bd33.entry.js → p-57785b92.entry.js} +1 -1
- package/dist/twilight/{p-90c58cc5.entry.js → p-5dfb7601.entry.js} +1 -1
- package/dist/twilight/{p-02350ded.entry.js → p-5e14fbf5.entry.js} +1 -1
- package/dist/twilight/{p-0e2a2a9a.entry.js → p-60545378.entry.js} +1 -1
- package/dist/twilight/{p-b7b29da3.entry.js → p-61332673.entry.js} +1 -1
- package/dist/twilight/{p-2b58b700.entry.js → p-636e6994.entry.js} +1 -1
- package/dist/twilight/{p-a445225d.entry.js → p-67ce35b0.entry.js} +1 -1
- package/dist/twilight/{p-c92915e0.entry.js → p-6bdcd67d.entry.js} +1 -1
- package/dist/twilight/{p-5c37420e.entry.js → p-6e2b2072.entry.js} +1 -1
- package/dist/twilight/{p-9b2f674f.entry.js → p-76672fe3.entry.js} +1 -1
- package/dist/twilight/{p-d3f904d0.entry.js → p-79bff80a.entry.js} +1 -1
- package/dist/twilight/{p-1a8525af.entry.js → p-7a5894fb.entry.js} +1 -1
- package/dist/twilight/{p-0c36ee7c.entry.js → p-7b0f537a.entry.js} +1 -1
- package/dist/twilight/{p-8f9e0a7a.entry.js → p-7bd7baa5.entry.js} +1 -1
- package/dist/twilight/{p-a047ed06.entry.js → p-8336df51.entry.js} +1 -1
- package/dist/twilight/{p-04f5d67b.entry.js → p-8a7f48ce.entry.js} +1 -1
- package/dist/twilight/{p-a853a50f.entry.js → p-96779a0c.entry.js} +1 -1
- package/dist/twilight/{p-368d3b26.entry.js → p-967d356e.entry.js} +1 -1
- package/dist/twilight/{p-a4107435.entry.js → p-9ab52d09.entry.js} +1 -1
- package/dist/twilight/{p-BuOjsqYX.js → p-BR9zeoCF.js} +1 -1
- package/dist/twilight/{p-BPGtYFVu.js → p-BTYXaopE.js} +1 -1
- package/dist/twilight/{p-BrcsejOr.js → p-CDTIhPDr.js} +1 -1
- package/dist/twilight/{p-gacShRe2.js → p-CMW3pjiL.js} +1 -1
- package/dist/twilight/{p-CMmiX5T8.js → p-C_htBBK4.js} +1 -1
- package/dist/twilight/{p-DwHaUky6.js → p-C_vo3xPL.js} +1 -1
- package/dist/twilight/{p-Bmy5YF6e.js → p-CcfoPQKG.js} +1 -1
- package/dist/twilight/{p-BF901xIc.js → p-DBMDFsFH.js} +1 -1
- package/dist/twilight/{p-KNG8mGcV.js → p-Dwu1e7SR.js} +1 -1
- package/dist/twilight/p-XnA1YTjA.js +4 -0
- package/dist/twilight/{p-8f006eca.entry.js → p-a767d9fe.entry.js} +1 -1
- package/dist/twilight/{p-506a2720.entry.js → p-ab404907.entry.js} +1 -1
- package/dist/twilight/{p-9f6a0804.entry.js → p-acd8aa32.entry.js} +1 -1
- package/dist/twilight/{p-b32e5ad7.entry.js → p-ad1d3cdf.entry.js} +1 -1
- package/dist/twilight/{p-f3b24cce.entry.js → p-b3b050e7.entry.js} +1 -1
- package/dist/twilight/{p-4b0aa371.entry.js → p-b3b78bf5.entry.js} +1 -1
- package/dist/twilight/p-b3f26711.entry.js +4 -0
- package/dist/twilight/{p-134988db.entry.js → p-b4f4e0b7.entry.js} +1 -1
- package/dist/twilight/{p-4288893b.entry.js → p-b7da726a.entry.js} +1 -1
- package/dist/twilight/{p-85b235dc.entry.js → p-b835777d.entry.js} +1 -1
- package/dist/twilight/{p-cd4b2301.entry.js → p-c253f69c.entry.js} +1 -1
- package/dist/twilight/{p-3eb54d75.entry.js → p-c46cf468.entry.js} +1 -1
- package/dist/twilight/{p-c5050e10.entry.js → p-c9608410.entry.js} +1 -1
- package/dist/twilight/{p-a6afc8ab.entry.js → p-cc75ae11.entry.js} +1 -1
- package/dist/twilight/{p-f4564fdc.entry.js → p-ce0685d1.entry.js} +1 -1
- package/dist/twilight/{p-dc093d27.entry.js → p-ce1bc4b0.entry.js} +1 -1
- package/dist/twilight/{p-d1048676.entry.js → p-cf1b9798.entry.js} +1 -1
- package/dist/twilight/{p-632766e3.entry.js → p-cf96947a.entry.js} +1 -1
- package/dist/twilight/{p-bd0075c9.entry.js → p-d01178f0.entry.js} +1 -1
- package/dist/twilight/{p-ce633fa0.entry.js → p-d3d2a114.entry.js} +1 -1
- package/dist/twilight/{p-f32df318.entry.js → p-d8fb7f9a.entry.js} +1 -1
- package/dist/twilight/{p-f5e55c13.entry.js → p-da827143.entry.js} +1 -1
- package/dist/twilight/{p-f5e943bb.entry.js → p-ddd22625.entry.js} +1 -1
- package/dist/twilight/{p-6b9780be.entry.js → p-de41e9b5.entry.js} +1 -1
- package/dist/twilight/p-e21a23d2.entry.js +4 -0
- package/dist/twilight/{p-a3a1bf15.entry.js → p-e5022e8f.entry.js} +1 -1
- package/dist/twilight/{p-d4eeed4b.entry.js → p-e84f7790.entry.js} +1 -1
- package/dist/twilight/{p-f71a7a24.entry.js → p-ef06457d.entry.js} +1 -1
- package/dist/twilight/{p-ce38e5a1.entry.js → p-f12670a1.entry.js} +1 -1
- package/dist/twilight/{p-d2cc8587.entry.js → p-f267ac72.entry.js} +1 -1
- package/dist/twilight/{p-4427e994.entry.js → p-f5d229a7.entry.js} +1 -1
- package/dist/twilight/{p-4544ca7d.entry.js → p-f856fe4d.entry.js} +1 -1
- package/dist/twilight/{p-4b558e37.entry.js → p-fa900f26.entry.js} +1 -1
- package/dist/twilight/{p-c590dcf0.entry.js → p-fd99de6e.entry.js} +1 -1
- package/dist/twilight/p-fdb0f6cc.entry.js +4 -0
- package/dist/twilight/{p-d92a7d91.entry.js → p-ffd6ad27.entry.js} +1 -1
- package/dist/twilight/{p-CwLXCdYY.js → p-lQbFKmnv.js} +1 -1
- package/dist/twilight/{p-DVM0Orh8.js → p-qj0-UBFk.js} +1 -1
- package/dist/twilight/{p-BEb9UIZ7.js → p-uiIu01tD.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-cart-summary-card/salla-cart-summary-card.d.ts +67 -0
- package/dist/types/components/salla-filters/salla-filters.d.ts +14 -0
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +1 -0
- package/dist/types/components.d.ts +37 -0
- package/package.json +5 -5
- package/dist/twilight/p-0d94f890.entry.js +0 -4
- package/dist/twilight/p-2cc32d1f.entry.js +0 -4
- package/dist/twilight/p-3d732135.entry.js +0 -4
- package/dist/twilight/p-C-3GuKNW.js +0 -4
- package/dist/twilight/p-b2a11170.entry.js +0 -4
- package/dist/twilight/p-d2cdd923.entry.js +0 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SallaCartSummaryCard extends Components.SallaCartSummaryCard, HTMLElement {}
|
|
4
|
+
export const SallaCartSummaryCard: {
|
|
5
|
+
prototype: SallaCartSummaryCard;
|
|
6
|
+
new (): SallaCartSummaryCard;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { d as defineCustomElement$3 } from './salla-button2.js';
|
|
6
|
+
import { d as defineCustomElement$2 } from './salla-skeleton2.js';
|
|
7
|
+
|
|
8
|
+
const SKELETON_ROWS = [
|
|
9
|
+
{ label: '100px', value: '56px' },
|
|
10
|
+
{ label: '72px', value: '64px' },
|
|
11
|
+
{ label: '96px', value: '48px' },
|
|
12
|
+
];
|
|
13
|
+
const SallaCartSummaryCard$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartSummaryCard extends HTMLElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.__registerHost();
|
|
17
|
+
this.validateForms = true;
|
|
18
|
+
this.cartCount = 0;
|
|
19
|
+
this.cartTotal = 0;
|
|
20
|
+
this.cartTotalDiscount = 0;
|
|
21
|
+
this.cartSubTotal = 0;
|
|
22
|
+
this.cartOptionsTotal = 0;
|
|
23
|
+
this.cartShippingCost = 0;
|
|
24
|
+
this.cartTaxAmount = 0;
|
|
25
|
+
this.cartHasShipping = false;
|
|
26
|
+
this.isOpen = false;
|
|
27
|
+
this.isDesktop = false;
|
|
28
|
+
/** True until the first cart payload (API response or cart event) arrives. */
|
|
29
|
+
this.isLoading = true;
|
|
30
|
+
// Original DOM location — needed to restore the host on the mobile→desktop flip.
|
|
31
|
+
this.originalParent = null;
|
|
32
|
+
this.originalNextSibling = null;
|
|
33
|
+
this.bodyObserver = null;
|
|
34
|
+
this.mediaQueryList = null;
|
|
35
|
+
this.submitObserver = null;
|
|
36
|
+
this.isSubmitting = false;
|
|
37
|
+
// Stable handler refs — anonymous functions can't be unbound from listeners.
|
|
38
|
+
this.mqlChangeHandler = (e) => {
|
|
39
|
+
this.isDesktop = e.matches;
|
|
40
|
+
this.applyMode();
|
|
41
|
+
};
|
|
42
|
+
this.cartEventNames = [
|
|
43
|
+
'cart::details.fetched',
|
|
44
|
+
'cart::updated',
|
|
45
|
+
'cart::latest.fetched',
|
|
46
|
+
'cart::coupon.added',
|
|
47
|
+
'cart::coupon.deleted',
|
|
48
|
+
];
|
|
49
|
+
this.cartEventHandler = (payload) => this.applyCartData(this.extractCart(payload));
|
|
50
|
+
this.toggleSheet = () => {
|
|
51
|
+
if (!this.isDesktop)
|
|
52
|
+
this.isOpen = !this.isOpen;
|
|
53
|
+
};
|
|
54
|
+
this.handleSubmit = async (event) => {
|
|
55
|
+
// Re-entrancy guard, set before the async validation so a second tap during
|
|
56
|
+
// that window can't fire a second submit. Covers all user types.
|
|
57
|
+
if (this.isSubmitting) {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.isSubmitting = true;
|
|
62
|
+
if (this.validateForms && !(await this.validateCartForms())) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
salla.notify?.error?.(salla.lang?.get?.('common.messages.required_fields'));
|
|
65
|
+
this.isSubmitting = false; // validation failed → allow retry
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const btn = this.host.querySelector('#s-cart-summary-card-submit');
|
|
69
|
+
if (typeof salla !== 'undefined' && salla.config?.get?.('user.type') !== 'guest' && btn) {
|
|
70
|
+
btn.load?.();
|
|
71
|
+
// Pin loading across re-renders; auto-clear after 10s so a failed submit
|
|
72
|
+
// doesn't lock the button forever.
|
|
73
|
+
this.submitObserver?.disconnect();
|
|
74
|
+
if (this.submitObserverTimeout)
|
|
75
|
+
clearTimeout(this.submitObserverTimeout);
|
|
76
|
+
this.submitObserver = new MutationObserver(() => {
|
|
77
|
+
if (!btn.hasAttribute('loading'))
|
|
78
|
+
btn.setAttribute('loading', '');
|
|
79
|
+
});
|
|
80
|
+
this.submitObserver.observe(btn, { attributes: true, attributeFilter: ['loading'] });
|
|
81
|
+
this.submitObserverTimeout = window.setTimeout(() => {
|
|
82
|
+
this.submitObserver?.disconnect();
|
|
83
|
+
this.submitObserver = null;
|
|
84
|
+
btn.removeAttribute?.('loading');
|
|
85
|
+
}, 10000);
|
|
86
|
+
}
|
|
87
|
+
salla.cart?.submit?.();
|
|
88
|
+
// Release after submit kicks off: success navigates away, a guest opens the
|
|
89
|
+
// login modal. Short delay blocks the double-tap race without a long lock.
|
|
90
|
+
window.setTimeout(() => { this.isSubmitting = false; }, 1500);
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// Sync: returning a promise would make Stencil defer first paint. init() runs async.
|
|
94
|
+
componentWillLoad() {
|
|
95
|
+
this.mediaQueryList = window.matchMedia(this.desktopMediaQuery());
|
|
96
|
+
this.isDesktop = this.mediaQueryList.matches;
|
|
97
|
+
if (this.isDesktop)
|
|
98
|
+
this.isOpen = true;
|
|
99
|
+
// isLoading is true by default → first paint is the skeleton.
|
|
100
|
+
this.init();
|
|
101
|
+
}
|
|
102
|
+
// Not awaited by componentWillLoad, so it can't block first paint.
|
|
103
|
+
async init() {
|
|
104
|
+
await salla.onReady();
|
|
105
|
+
await salla.lang.onLoaded();
|
|
106
|
+
this.loadTranslations();
|
|
107
|
+
// 'cart::updated' is in cartEventNames — don't also use onUpdated (it leaks, no off()).
|
|
108
|
+
this.cartEventNames.forEach(name => salla.event.on(name, this.cartEventHandler));
|
|
109
|
+
this.fetchCart();
|
|
110
|
+
}
|
|
111
|
+
loadTranslations() {
|
|
112
|
+
this.summaryLabel = salla.lang.get('pages.cart.summary');
|
|
113
|
+
this.itemsTotalLabel = salla.lang.get('pages.cart.items_total');
|
|
114
|
+
this.itemsTotalNoTaxLabel = salla.lang.get('pages.cart.items_total_without_tax');
|
|
115
|
+
this.optionsTotalLabel = salla.lang.get('pages.cart.order_options_total');
|
|
116
|
+
this.shippingCostLabel = salla.lang.get('pages.cart.shipping_cost');
|
|
117
|
+
this.vatTaxLabel = salla.lang.get('pages.cart.VAT_tax_amount');
|
|
118
|
+
this.savedLabel = salla.lang.get('pages.cart.discount');
|
|
119
|
+
this.discountBadge = salla.lang.get('pages.cart.saved');
|
|
120
|
+
this.finalTotalLabel = salla.lang.get('pages.cart.final_total');
|
|
121
|
+
this.pricesTaxedLabel = salla.lang.get('pages.cart.prices_taxed');
|
|
122
|
+
this.completeOrderLabel = salla.lang.get('pages.cart.complete_order');
|
|
123
|
+
this.openSummaryLabel = salla.lang.get('pages.cart.open_summary');
|
|
124
|
+
this.closeSummaryLabel = salla.lang.get('pages.cart.close_summary');
|
|
125
|
+
this.itemsCountTemplate = salla.lang.get('pages.cart.items_with_count');
|
|
126
|
+
}
|
|
127
|
+
/** Coerces PHP cart values: numbers, strings, and Money/MoneyTaxable objects. */
|
|
128
|
+
num(v) {
|
|
129
|
+
if (v === null || v === undefined)
|
|
130
|
+
return 0;
|
|
131
|
+
if (typeof v === 'number')
|
|
132
|
+
return isFinite(v) ? v : 0;
|
|
133
|
+
if (typeof v === 'string')
|
|
134
|
+
return parseFloat(v) || 0;
|
|
135
|
+
if (typeof v === 'object') {
|
|
136
|
+
if ('amount' in v)
|
|
137
|
+
return this.num(v.amount);
|
|
138
|
+
if ('value' in v)
|
|
139
|
+
return this.num(v.value);
|
|
140
|
+
if ('formatted' in v)
|
|
141
|
+
return this.num(v.formatted);
|
|
142
|
+
}
|
|
143
|
+
return 0;
|
|
144
|
+
}
|
|
145
|
+
// Desktop cutoff — must match the SCSS media queries so JS and CSS never diverge.
|
|
146
|
+
breakpointPx() {
|
|
147
|
+
return 1024;
|
|
148
|
+
}
|
|
149
|
+
desktopMediaQuery() {
|
|
150
|
+
return `(min-width: ${this.breakpointPx()}px)`;
|
|
151
|
+
}
|
|
152
|
+
componentDidLoad() {
|
|
153
|
+
// Capture original location BEFORE the portal relocates the host.
|
|
154
|
+
this.originalParent = this.host.parentElement;
|
|
155
|
+
this.originalNextSibling = this.host.nextSibling;
|
|
156
|
+
// Re-init if componentWillLoad failed to set it (rare hydration/race edge case).
|
|
157
|
+
if (!this.mediaQueryList) {
|
|
158
|
+
this.mediaQueryList = window.matchMedia(this.desktopMediaQuery());
|
|
159
|
+
this.isDesktop = this.mediaQueryList.matches;
|
|
160
|
+
}
|
|
161
|
+
this.applyMode();
|
|
162
|
+
// iOS Safari < 14 lacks addEventListener on MediaQueryList — fall back to addListener.
|
|
163
|
+
if (this.mediaQueryList.addEventListener) {
|
|
164
|
+
this.mediaQueryList.addEventListener('change', this.mqlChangeHandler);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
this.mediaQueryList.addListener(this.mqlChangeHandler);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// Mobile: portal host to <body> so position:fixed escapes any transformed
|
|
171
|
+
// ancestor. Desktop: restore to its original DOM location.
|
|
172
|
+
applyMode() {
|
|
173
|
+
if (this.isDesktop) {
|
|
174
|
+
this.isOpen = true;
|
|
175
|
+
this.bodyObserver?.disconnect();
|
|
176
|
+
this.bodyObserver = null;
|
|
177
|
+
if (this.originalParent && this.host.parentElement !== this.originalParent) {
|
|
178
|
+
// Sibling may have been removed while we were portaled — fall back
|
|
179
|
+
// to appendChild instead of letting insertBefore throw.
|
|
180
|
+
const ref = this.originalNextSibling?.parentNode === this.originalParent
|
|
181
|
+
? this.originalNextSibling
|
|
182
|
+
: null;
|
|
183
|
+
this.originalParent.insertBefore(this.host, ref);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
this.pinToBodyEnd();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// Re-pin via MutationObserver so a late-mounted footer can't paint over us.
|
|
191
|
+
pinToBodyEnd() {
|
|
192
|
+
if (this.host.parentElement !== document.body || document.body.lastElementChild !== this.host) {
|
|
193
|
+
document.body.appendChild(this.host);
|
|
194
|
+
}
|
|
195
|
+
if (!this.bodyObserver) {
|
|
196
|
+
this.bodyObserver = new MutationObserver(() => {
|
|
197
|
+
if (!this.isDesktop && document.body.lastElementChild !== this.host) {
|
|
198
|
+
document.body.appendChild(this.host);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
this.bodyObserver.observe(document.body, { childList: true });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
disconnectedCallback() {
|
|
205
|
+
// Fires synchronously on every removal, incl. our own reparenting — defer a
|
|
206
|
+
// microtask and bail if reconnected, else the portal loses its listeners.
|
|
207
|
+
Promise.resolve().then(() => {
|
|
208
|
+
if (this.host.isConnected)
|
|
209
|
+
return;
|
|
210
|
+
this.bodyObserver?.disconnect();
|
|
211
|
+
this.submitObserver?.disconnect();
|
|
212
|
+
if (this.submitObserverTimeout) {
|
|
213
|
+
clearTimeout(this.submitObserverTimeout);
|
|
214
|
+
this.submitObserverTimeout = undefined;
|
|
215
|
+
}
|
|
216
|
+
// Mirror the iOS-Safari-<14 path used in componentDidLoad.
|
|
217
|
+
if (this.mediaQueryList?.removeEventListener) {
|
|
218
|
+
this.mediaQueryList.removeEventListener('change', this.mqlChangeHandler);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
this.mediaQueryList?.removeListener(this.mqlChangeHandler);
|
|
222
|
+
}
|
|
223
|
+
this.mediaQueryList = null;
|
|
224
|
+
this.cartEventNames.forEach(name => salla.event.off(name, this.cartEventHandler));
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
fetchCart() {
|
|
228
|
+
const cartId = salla.config?.get?.('page.id');
|
|
229
|
+
const result = salla.cart?.api?.details?.(cartId);
|
|
230
|
+
if (result && typeof result.then === 'function') {
|
|
231
|
+
result
|
|
232
|
+
.then((res) => this.applyCartData(this.extractCart(res)))
|
|
233
|
+
// On failure, fall back to the cached summary instead of stranding the skeleton.
|
|
234
|
+
.catch(() => this.applyCachedSummary());
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
this.applyCachedSummary();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// Cart API failed → use the SDK's cached summary (localStorage, set on
|
|
241
|
+
// cart::updated). May be stale but beats zeros; events refresh it. Clears the
|
|
242
|
+
// skeleton either way so the CTA always renders.
|
|
243
|
+
applyCachedSummary() {
|
|
244
|
+
const summary = salla.storage?.get?.('cart.summary');
|
|
245
|
+
if (summary && typeof summary === 'object')
|
|
246
|
+
this.applyCartData(summary);
|
|
247
|
+
this.isLoading = false;
|
|
248
|
+
}
|
|
249
|
+
extractCart(payload) {
|
|
250
|
+
if (!payload)
|
|
251
|
+
return null;
|
|
252
|
+
if (payload.data?.cart)
|
|
253
|
+
return payload.data.cart;
|
|
254
|
+
if (payload.cart)
|
|
255
|
+
return payload.cart;
|
|
256
|
+
return payload;
|
|
257
|
+
}
|
|
258
|
+
applyCartData(data) {
|
|
259
|
+
if (!data)
|
|
260
|
+
return;
|
|
261
|
+
// First real payload ends the skeleton.
|
|
262
|
+
this.isLoading = false;
|
|
263
|
+
if (data.count !== undefined)
|
|
264
|
+
this.cartCount = this.num(data.count);
|
|
265
|
+
if (data.total !== undefined)
|
|
266
|
+
this.cartTotal = this.num(data.total);
|
|
267
|
+
// `total_discount` is the live field (untyped); `discount` is the typed fallback.
|
|
268
|
+
const discount = data.total_discount ?? data.discount;
|
|
269
|
+
if (discount !== undefined)
|
|
270
|
+
this.cartTotalDiscount = this.num(discount);
|
|
271
|
+
if (data.sub_total !== undefined)
|
|
272
|
+
this.cartSubTotal = this.num(data.sub_total);
|
|
273
|
+
if (data.options_total !== undefined)
|
|
274
|
+
this.cartOptionsTotal = this.num(data.options_total);
|
|
275
|
+
if (data.tax_amount !== undefined)
|
|
276
|
+
this.cartTaxAmount = this.num(data.tax_amount);
|
|
277
|
+
// Shipping cost (free-shipping aware): prefer `shipping_cost`, else `real_shipping_cost`.
|
|
278
|
+
const hasFreeShipping = !!data.free_shipping_bar?.has_free_shipping;
|
|
279
|
+
if (data.shipping_cost !== undefined)
|
|
280
|
+
this.cartShippingCost = this.num(data.shipping_cost);
|
|
281
|
+
else if (data.real_shipping_cost !== undefined)
|
|
282
|
+
this.cartShippingCost = hasFreeShipping ? 0 : this.num(data.real_shipping_cost);
|
|
283
|
+
// `has_shipping` isn't in the API response — derive row visibility from the cost.
|
|
284
|
+
this.cartHasShipping = this.cartShippingCost > 0 || !!data.has_shipping;
|
|
285
|
+
}
|
|
286
|
+
// Native reportValidity() covers standard fields; custom product options
|
|
287
|
+
// validate via their own async reportValidity() (incl. multi-option required
|
|
288
|
+
// logic), so await that too — else option validation is skipped at checkout.
|
|
289
|
+
async validateCartForms() {
|
|
290
|
+
let isValid = true;
|
|
291
|
+
document
|
|
292
|
+
.querySelectorAll('form[id^="item-"]')
|
|
293
|
+
.forEach(f => {
|
|
294
|
+
if (!f.reportValidity())
|
|
295
|
+
isValid = false;
|
|
296
|
+
});
|
|
297
|
+
const optionEls = Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));
|
|
298
|
+
for (const el of optionEls) {
|
|
299
|
+
if (typeof el.reportValidity === 'function' && !(await el.reportValidity()))
|
|
300
|
+
isValid = false;
|
|
301
|
+
}
|
|
302
|
+
return isValid;
|
|
303
|
+
}
|
|
304
|
+
money(value) {
|
|
305
|
+
try {
|
|
306
|
+
if (typeof salla !== 'undefined' && typeof salla.money === 'function') {
|
|
307
|
+
return salla.money(value);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
catch (_) { }
|
|
311
|
+
return String(value ?? 0);
|
|
312
|
+
}
|
|
313
|
+
getItemsLabel() {
|
|
314
|
+
return this.itemsCountTemplate?.replace(':count', String(this.cartCount)) ?? '';
|
|
315
|
+
}
|
|
316
|
+
// Skeleton during the initial fetch
|
|
317
|
+
renderSkeleton() {
|
|
318
|
+
return (h(Host, { class: {
|
|
319
|
+
's-cart-summary-card': true,
|
|
320
|
+
's-cart-summary-card--loading': true,
|
|
321
|
+
's-cart-summary-card--desktop': this.isDesktop,
|
|
322
|
+
's-cart-summary-card--mobile': !this.isDesktop,
|
|
323
|
+
} }, this.isDesktop && (h("div", { class: "s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open" }, h("div", { class: "s-cart-summary-card-sheet" }, h("header", { class: "s-cart-summary-card-sheet-header" }, h("h3", { class: "s-cart-summary-card-sheet-title" }, h("salla-skeleton", { width: "140px", height: "16px" }))), SKELETON_ROWS.map(({ label, value }, i) => (h("div", { class: "s-cart-summary-card-line", key: i }, h("salla-skeleton", { width: label, height: "16px" }), h("salla-skeleton", { width: value, height: "16px" }))))))), h("div", { class: "s-cart-summary-card-bar" }, h("div", { class: "s-cart-summary-card-bar-label" }, h("div", { class: "s-cart-summary-card-bar-label-main" }, h("salla-skeleton", { width: "90px", height: "16px" }), h("salla-skeleton", { width: "48px", height: "12px" }))), h("div", { class: "s-cart-summary-card-bar-totals" }, h("div", { class: "s-cart-summary-card-bar-totals-row" }, h("salla-skeleton", { width: "80px", height: "20px" })))), h("div", { class: "s-cart-summary-card-action" }, h("salla-skeleton", { width: "100%", height: "44px" }))));
|
|
324
|
+
}
|
|
325
|
+
render() {
|
|
326
|
+
if (this.isLoading)
|
|
327
|
+
return this.renderSkeleton();
|
|
328
|
+
const showSavings = this.cartTotalDiscount > 0;
|
|
329
|
+
const subTotalLabel = this.cartTaxAmount ? this.itemsTotalNoTaxLabel : this.itemsTotalLabel;
|
|
330
|
+
// Inline transform so sheet motion doesn't depend on SCSS load order.
|
|
331
|
+
const sheetStyle = this.isDesktop
|
|
332
|
+
? {}
|
|
333
|
+
: {
|
|
334
|
+
transform: this.isOpen ? 'translateY(0)' : 'translateY(100%)',
|
|
335
|
+
transition: 'transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)',
|
|
336
|
+
};
|
|
337
|
+
return (h(Host, { class: {
|
|
338
|
+
's-cart-summary-card': true,
|
|
339
|
+
's-cart-summary-card--open': this.isOpen,
|
|
340
|
+
's-cart-summary-card--desktop': this.isDesktop,
|
|
341
|
+
's-cart-summary-card--mobile': !this.isDesktop,
|
|
342
|
+
} }, h("div", { class: {
|
|
343
|
+
's-cart-summary-card-sheet-wrap': true,
|
|
344
|
+
's-cart-summary-card-sheet-wrap--open': this.isOpen,
|
|
345
|
+
}, "aria-hidden": this.isOpen ? 'false' : 'true' }, h("div", { class: "s-cart-summary-card-sheet", style: sheetStyle }, h("header", { class: "s-cart-summary-card-sheet-header" }, h("h3", { class: "s-cart-summary-card-sheet-title" }, this.summaryLabel)), h("div", { class: "s-cart-summary-card-line" }, h("span", null, subTotalLabel), h("b", { innerHTML: this.money(this.cartSubTotal) })), this.cartOptionsTotal > 0 && (h("div", { class: "s-cart-summary-card-line" }, h("span", null, this.optionsTotalLabel), h("b", { innerHTML: this.money(this.cartOptionsTotal) }))), this.cartHasShipping && (h("div", { class: "s-cart-summary-card-line" }, h("span", null, this.shippingCostLabel), h("b", { innerHTML: this.money(this.cartShippingCost) }))), this.cartTaxAmount > 0 && (h("div", { class: "s-cart-summary-card-line" }, h("span", null, this.vatTaxLabel), h("b", { innerHTML: this.money(this.cartTaxAmount) }))), showSavings && (h("div", { class: "s-cart-summary-card-line s-cart-summary-card-line--discount" }, h("span", null, this.savedLabel), h("b", null, "\u2212 ", h("span", { innerHTML: this.money(this.cartTotalDiscount) })))))), h("div", { class: "s-cart-summary-card-bar" }, h("div", { class: "s-cart-summary-card-bar-label" }, h("div", { class: "s-cart-summary-card-bar-label-main" }, h("span", { class: "s-cart-summary-card-bar-label-text" }, this.finalTotalLabel), h("span", { class: "s-cart-summary-card-bar-count" }, this.getItemsLabel())), this.cartTaxAmount > 0 && (h("div", { class: "s-cart-summary-card-bar-label-sub" }, this.pricesTaxedLabel))), h("div", { class: "s-cart-summary-card-bar-totals" }, h("div", { class: "s-cart-summary-card-bar-totals-row" }, showSavings && (h("s", { class: "s-cart-summary-card-bar-original" }, salla.helpers.number(this.cartTotal + this.cartTotalDiscount))), h("b", { class: "s-cart-summary-card-bar-total", innerHTML: this.money(this.cartTotal) }), !this.isDesktop && (h("button", { type: "button", class: "s-cart-summary-card-chevron", "aria-label": this.isOpen ? this.closeSummaryLabel : this.openSummaryLabel, "aria-expanded": this.isOpen ? 'true' : 'false', onClick: this.toggleSheet }, h("i", { class: "sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon" })))), showSavings && (h("div", { class: "s-cart-summary-card-bar-savings-badge" }, h("span", { "aria-hidden": "true" }, "\uD83C\uDF89"), h("span", null, this.discountBadge, " ", h("span", { innerHTML: this.money(this.cartTotalDiscount) })))))), h("div", { class: "s-cart-summary-card-action" }, h("salla-button", { id: "s-cart-summary-card-submit", width: "wide", "loader-position": "center", onClick: this.handleSubmit }, this.completeOrderLabel))));
|
|
346
|
+
}
|
|
347
|
+
get host() { return this; }
|
|
348
|
+
}, [0, "salla-cart-summary-card", {
|
|
349
|
+
"validateForms": [4, "validate-forms"],
|
|
350
|
+
"cartCount": [32],
|
|
351
|
+
"cartTotal": [32],
|
|
352
|
+
"cartTotalDiscount": [32],
|
|
353
|
+
"cartSubTotal": [32],
|
|
354
|
+
"cartOptionsTotal": [32],
|
|
355
|
+
"cartShippingCost": [32],
|
|
356
|
+
"cartTaxAmount": [32],
|
|
357
|
+
"cartHasShipping": [32],
|
|
358
|
+
"isOpen": [32],
|
|
359
|
+
"isDesktop": [32],
|
|
360
|
+
"isLoading": [32],
|
|
361
|
+
"summaryLabel": [32],
|
|
362
|
+
"itemsTotalLabel": [32],
|
|
363
|
+
"itemsTotalNoTaxLabel": [32],
|
|
364
|
+
"optionsTotalLabel": [32],
|
|
365
|
+
"shippingCostLabel": [32],
|
|
366
|
+
"vatTaxLabel": [32],
|
|
367
|
+
"savedLabel": [32],
|
|
368
|
+
"discountBadge": [32],
|
|
369
|
+
"finalTotalLabel": [32],
|
|
370
|
+
"pricesTaxedLabel": [32],
|
|
371
|
+
"completeOrderLabel": [32],
|
|
372
|
+
"openSummaryLabel": [32],
|
|
373
|
+
"closeSummaryLabel": [32],
|
|
374
|
+
"itemsCountTemplate": [32]
|
|
375
|
+
}]);
|
|
376
|
+
function defineCustomElement$1() {
|
|
377
|
+
if (typeof customElements === "undefined") {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const components = ["salla-cart-summary-card", "salla-button", "salla-skeleton"];
|
|
381
|
+
components.forEach(tagName => { switch (tagName) {
|
|
382
|
+
case "salla-cart-summary-card":
|
|
383
|
+
if (!customElements.get(tagName)) {
|
|
384
|
+
customElements.define(tagName, SallaCartSummaryCard$1);
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
case "salla-button":
|
|
388
|
+
if (!customElements.get(tagName)) {
|
|
389
|
+
defineCustomElement$3();
|
|
390
|
+
}
|
|
391
|
+
break;
|
|
392
|
+
case "salla-skeleton":
|
|
393
|
+
if (!customElements.get(tagName)) {
|
|
394
|
+
defineCustomElement$2();
|
|
395
|
+
}
|
|
396
|
+
break;
|
|
397
|
+
} });
|
|
398
|
+
}
|
|
399
|
+
defineCustomElement$1();
|
|
400
|
+
|
|
401
|
+
const SallaCartSummaryCard = SallaCartSummaryCard$1;
|
|
402
|
+
const defineCustomElement = defineCustomElement$1;
|
|
403
|
+
|
|
404
|
+
export { SallaCartSummaryCard, defineCustomElement };
|
|
@@ -162,7 +162,7 @@ const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class SallaFiltersWi
|
|
|
162
162
|
//@ts-ignore
|
|
163
163
|
return filteredValues.map((filterOption, index) => {
|
|
164
164
|
let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);
|
|
165
|
-
return h("label", { class: "s-filters-label", htmlFor: `${option.key}-option-${value}`, key: `${option.key}-option-${value}` }, h("input", { id: `${option.key}-option-${value}`, name: option.key, type:
|
|
165
|
+
return h("label", { class: "s-filters-label", htmlFor: `${option.key}-option-${value}`, key: `${option.key}-option-${value}` }, h("input", { id: `${option.key}-option-${value}`, name: option.key, type: option.type === FilterOptionTypes.VALUES ? 'checkbox' : 'radio', checked: this.isSelectedOption(option, value), class: option.type === FilterOptionTypes.VALUES ? 's-filters-checkbox' : 's-filters-radio', onChange: event => this.changed.emit({ event, option, value }) }), this.getOptionLabel(option, filterOption));
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
isSelectedOption(option, value) {
|
|
@@ -170,13 +170,18 @@ const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class SallaFiltersWi
|
|
|
170
170
|
return this.filtersData[option.key] == value;
|
|
171
171
|
}
|
|
172
172
|
if (option.type === FilterOptionTypes.VARIANTS) {
|
|
173
|
-
|
|
173
|
+
// selections are stored per widget key (handleOptionChange: filtersData.variants[option.key])
|
|
174
|
+
return this.filtersData[option.type] && this.filtersData[option.type][option.key] == value;
|
|
174
175
|
}
|
|
175
176
|
if (option.type === FilterOptionTypes.RANGE) {
|
|
176
177
|
return this.filtersData[option.key] && this.filtersData[option.key].min == value.min && this.filtersData[option.key].max == value.max;
|
|
177
178
|
}
|
|
178
179
|
if (option.type === FilterOptionTypes.VALUES) {
|
|
179
|
-
|
|
180
|
+
const selected = this.filtersData[option.key];
|
|
181
|
+
if (Array.isArray(selected)) {
|
|
182
|
+
return selected.some(v => Number(v) === Number(value));
|
|
183
|
+
}
|
|
184
|
+
return selected != null && Number(selected) === Number(value);
|
|
180
185
|
}
|
|
181
186
|
return false;
|
|
182
187
|
}
|
|
@@ -186,16 +191,18 @@ const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class SallaFiltersWi
|
|
|
186
191
|
return h("salla-rating-stars", { size: "small", value: filterOption });
|
|
187
192
|
}
|
|
188
193
|
let label = filterOption.value || 'null';
|
|
189
|
-
|
|
194
|
+
if (filterOption.count != null) {
|
|
195
|
+
label += ` (${salla.helpers.number(filterOption.count)})`;
|
|
196
|
+
}
|
|
190
197
|
return h("span", { class: "s-filters-option-name" }, label);
|
|
191
198
|
}
|
|
192
199
|
render() {
|
|
193
|
-
return (h(Host, { key: '
|
|
200
|
+
return (h(Host, { key: '3ea32331738365fc422b500b3e70fa590d4dbdb5', class: "s-filters-widget-container" }, h("h3", { key: 'c5cb7a27841bf85e4c108e15d606c1c45059e5ca', class: "s-filters-widget-title", onClick: () => this.toggleWidget() }, h("span", { key: '641164d403dd4c9b79a540f4da5829f5238cded4' }, this.option.label), h("span", { key: '5cf687d80ff627f306f5876f69b799b6b7a3813d', class: `s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}` })), h("div", { key: 'd9b753223b4fb1c468ed6c4c3a269b861bc5b34b', class: "s-filters-widget-content", ref: (el) => this.widgetContent = el }, Array.isArray(this.option.values) && this.option.values.length > 5 && (h("div", { key: '0ca4f8c598e5965e23ef56610df7afc31799f168', class: "s-filters-widget-search-wrapper", style: { padding: '8px 0', marginBottom: '8px' } }, h("input", { key: '7b43ec84dcbeb5b7f9cbe9335133e32c278c00fd', type: "text", class: "s-filters-widget-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder') || 'بحث...', value: this.searchQuery, onInput: (e) => this.searchQuery = e.target.value }))), h("div", { key: '5bf79fc5f51389d087fed93acee51a097a46af65', class: "s-filters-widget-values", ref: (el) => this.widgetValues = el }, h("slot", { key: '8dacd49ba003562d347a6c1b62e85ac447a62fcb' }), this.option.type !== FilterOptionTypes.RANGE
|
|
194
201
|
? this.renderFilterOption(this.option)
|
|
195
202
|
: h("salla-price-range", { onChanged: (event) => {
|
|
196
203
|
this.changed.emit(event.detail);
|
|
197
204
|
}, ref: price => this.priceRange = price, filtersData: this.filtersData, option: this.option })), this.withLoadMore && (!this.searchQuery || this.filteredCount > this.initialItemCount) &&
|
|
198
|
-
h("a", { key: '
|
|
205
|
+
h("a", { key: '85ca188ff9f0db7c0a23b94e4705ae2ca5c38d55', class: "s-filters-widget-more", onClick: () => this.showMore() }, !this.isShowMore ? this.showMoreLabel : this.showLessLabel))));
|
|
199
206
|
}
|
|
200
207
|
get host() { return this; }
|
|
201
208
|
static get style() { return sallaFiltersWidgetCss; }
|
|
@@ -8,7 +8,7 @@ import { d as defineCustomElement$5 } from './salla-button2.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 = ":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";
|
|
11
|
+
const sallaFiltersCss = ":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.s-filters-applied-remove{pointer-events:auto !important;cursor:pointer}";
|
|
12
12
|
|
|
13
13
|
const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters extends HTMLElement {
|
|
14
14
|
constructor() {
|
|
@@ -16,11 +16,14 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
16
16
|
this.__registerHost();
|
|
17
17
|
this.changed = createEvent(this, "changed", 7);
|
|
18
18
|
this.isReady = false; //to avoid triggering the changed event
|
|
19
|
+
this.isInitialFetch = true; //the base-category auto-append may only run on the first filters::fetched
|
|
19
20
|
this.filtersData = {};
|
|
21
|
+
this.appliedOpen = true;
|
|
20
22
|
salla.event.on('filters::hidden', () => this.host.style.display = 'none');
|
|
21
23
|
salla.lang.onLoaded(() => {
|
|
22
24
|
this.apply = salla.lang.get('pages.checkout.apply');
|
|
23
25
|
this.reset = salla.lang.get('pages.categories.filters_reset');
|
|
26
|
+
this.selectedTitle = salla.lang.getWithDefault('pages.categories.selected_filters', 'لقد اخترت');
|
|
24
27
|
});
|
|
25
28
|
salla.event.on('filters::fetched', ({ filters }) => {
|
|
26
29
|
this.host.style.display = '';
|
|
@@ -55,7 +58,9 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
55
58
|
break; // No need to continue checking once a match is found
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
|
-
|
|
61
|
+
// only on the first fetch after page load — re-appending on later fetches
|
|
62
|
+
// would silently undo an explicit "remove all filters" (COD-10662)
|
|
63
|
+
if (this.isInitialFetch && salla.config.get('page.slug') == "product.index" && Object.keys(freshFilterData).length == 0 && !hasFilters) {
|
|
59
64
|
// Append the current category to the url if there are no pre-selected filters
|
|
60
65
|
let currentUrl = window.location.href;
|
|
61
66
|
let filterValue = salla.config.get('page.id');
|
|
@@ -66,6 +71,7 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
66
71
|
}
|
|
67
72
|
return filter;
|
|
68
73
|
});
|
|
74
|
+
this.isInitialFetch = false;
|
|
69
75
|
this.filtersData = freshFilterData;
|
|
70
76
|
this.host.childNodes.forEach(async (widget) => widget.setWidgetHeight && await widget.setWidgetHeight());
|
|
71
77
|
});
|
|
@@ -127,9 +133,7 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
127
133
|
const value = filters[key];
|
|
128
134
|
const fullKey = parentKey ? `${parentKey}[${key}]` : key;
|
|
129
135
|
if (Array.isArray(value)) {
|
|
130
|
-
|
|
131
|
-
encodedFilters.push(`${fullKey}[${i}]=${value[i]}`);
|
|
132
|
-
}
|
|
136
|
+
value.forEach(item => encodedFilters.push(`${fullKey}[]=${item}`));
|
|
133
137
|
}
|
|
134
138
|
else if (typeof value === 'object' && value !== null) {
|
|
135
139
|
encodedFilters.push(this.encodeFilters(value, fullKey));
|
|
@@ -184,21 +188,105 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
184
188
|
isChecked && (this.filtersData[option.key] = value);
|
|
185
189
|
isChecked || (delete this.filtersData[option.key]);
|
|
186
190
|
}
|
|
187
|
-
//it's checkbox
|
|
188
|
-
// add if condition to avoid error when the filter is not existed in the filtersData
|
|
191
|
+
//it's checkbox (multi-select / OR within the same group)
|
|
189
192
|
else if (event.target.type == "checkbox") {
|
|
190
|
-
|
|
193
|
+
const current = this.filtersData[option.key];
|
|
194
|
+
// coerce legacy scalar values (e.g. ?filters[brand_id]=1) into an array
|
|
195
|
+
this.filtersData[option.key] = Array.isArray(current) ? current : (current != null ? [current] : []);
|
|
191
196
|
if (isChecked) {
|
|
192
197
|
this.filtersData[option.key].push(value);
|
|
193
198
|
}
|
|
194
|
-
|
|
199
|
+
else {
|
|
200
|
+
this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);
|
|
201
|
+
}
|
|
202
|
+
if (!this.filtersData[option.key].length) {
|
|
203
|
+
delete this.filtersData[option.key];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
this.filtersData = { ...this.filtersData }; // reassign so @State re-renders the applied chips
|
|
207
|
+
this.applyFilters();
|
|
208
|
+
}
|
|
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
|
+
/**
|
|
257
|
+
* Remove a single applied filter — the direct inverse of handleOptionChange.
|
|
258
|
+
*/
|
|
259
|
+
removeFilter(chip) {
|
|
260
|
+
if (chip.type === FilterOptionTypes.VARIANTS) {
|
|
261
|
+
if (this.filtersData.variants) {
|
|
262
|
+
delete this.filtersData.variants[chip.variantKey];
|
|
263
|
+
if (!Object.keys(this.filtersData.variants).length)
|
|
264
|
+
delete this.filtersData.variants;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else if (chip.type === FilterOptionTypes.RANGE) {
|
|
268
|
+
delete this.filtersData[chip.key];
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
const raw = this.filtersData[chip.key];
|
|
272
|
+
if (Array.isArray(raw)) {
|
|
273
|
+
this.filtersData[chip.key] = raw.filter(val => val != chip.value);
|
|
274
|
+
if (!this.filtersData[chip.key].length)
|
|
275
|
+
delete this.filtersData[chip.key];
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
delete this.filtersData[chip.key];
|
|
279
|
+
}
|
|
195
280
|
}
|
|
281
|
+
this.filtersData = { ...this.filtersData }; // reassign so the panel + widgets re-render immediately
|
|
196
282
|
this.applyFilters();
|
|
197
283
|
}
|
|
198
284
|
render() {
|
|
199
|
-
|
|
285
|
+
const appliedFilters = this.getAppliedFilters();
|
|
286
|
+
const removeText = salla.lang.getWithDefault('common.elements.delete', 'Remove');
|
|
287
|
+
return h(Host, { key: 'd6dacbf458eadefda7ec2b2c6845c54f553abea8' }, 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 } }) => {
|
|
200
288
|
this.handleOptionChange(event, option, value);
|
|
201
|
-
} }))
|
|
289
|
+
} })));
|
|
202
290
|
}
|
|
203
291
|
componentDidLoad() {
|
|
204
292
|
this.isReady = true;
|
|
@@ -211,6 +299,8 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
|
|
|
211
299
|
"filtersData": [32],
|
|
212
300
|
"apply": [32],
|
|
213
301
|
"reset": [32],
|
|
302
|
+
"selectedTitle": [32],
|
|
303
|
+
"appliedOpen": [32],
|
|
214
304
|
"getFilters": [64],
|
|
215
305
|
"applyFilters": [64],
|
|
216
306
|
"resetFilters": [64]
|