@salla.sa/twilight-components 2.14.486 → 2.14.488
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-05NO31dc.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CTf1Ej_n.js → filepond-plugin-file-poster-BSzyn1DL.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-_wVJpYXF.js → filepond-plugin-file-validate-size-DJKsosMa.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DWoo5Lcs.js → filepond-plugin-file-validate-type-C0xLud1P.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DBb_5aN9.js → filepond-plugin-image-edit-Dq1zXDYS.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Nnwt-m9k.js → filepond-plugin-image-exif-orientation-B84Q7JSN.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CjBwZm3E.js → filepond-plugin-image-preview-BaE9P79l.js} +1 -1
- package/dist/cjs/{functions-DkS9Jmao.js → functions-B-_Pnqnt.js} +1 -1
- package/dist/cjs/{index-C0yFagl6.js → index-BsvV4QQg.js} +1 -1
- package/dist/cjs/{index-C_WIlgE2.js → index-f6loD1zL.js} +10 -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 +4 -3
- 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 +21 -13
- 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-cancel.cjs.entry.js +296 -0
- 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 +5 -2
- 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-We1h_qB4.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DyJFw96R.js → vanilla-picker-Ck8OFt14.js} +1 -1
- package/dist/collection/Helpers/Helper.js +7 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/salla-breadcrumb/salla-breadcrumb.js +2 -1
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +20 -12
- 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-order-cancel/interfaces.js +1 -0
- package/dist/collection/components/salla-order-cancel/salla-order-cancel.css +17 -0
- package/dist/collection/components/salla-order-cancel/salla-order-cancel.js +366 -0
- package/dist/collection/components/salla-products-list/salla-products-list.js +19 -7
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +4 -1
- package/dist/components/Helper.js +7 -2
- package/dist/components/index.js +2 -2
- package/dist/components/salla-breadcrumb.js +2 -1
- package/dist/components/salla-bullet-delivery.js +20 -12
- 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-order-cancel.d.ts +11 -0
- package/dist/components/salla-order-cancel.js +347 -0
- package/dist/components/salla-products-list2.js +19 -7
- package/dist/components/salla-user-menu.js +4 -1
- package/dist/esm/{Helper-CD8d-Brd.js → Helper-BQ9mvrt9.js} +7 -2
- package/dist/esm/{filepond-ZiatSU0Y.js → filepond-2lHD_yVt.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-2WAWdRm2.js → filepond-plugin-file-poster-DIjVVIwh.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DhLjP7aF.js → filepond-plugin-file-validate-size-CfcICNJA.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-HH8AZXAq.js → filepond-plugin-file-validate-type-DsvYMiJr.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BWBtBfk1.js → filepond-plugin-image-edit-B7K5Ib7q.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CQyPB3lV.js → filepond-plugin-image-exif-orientation-9iz6i-up.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-D6MiVWr1.js → filepond-plugin-image-preview-C89IBH1s.js} +1 -1
- package/dist/esm/{functions-DflaFDbL.js → functions-CJdqLH4P.js} +1 -1
- package/dist/esm/{index-Co2lT5R8.js → index-D1YskPUH.js} +1 -1
- package/dist/esm/{index-BF901xIc.js → index-K0OclOPO.js} +10 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +4 -3
- 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 +21 -13
- 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-cancel.entry.js +294 -0
- 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 +5 -2
- 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-yWzlErXb.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-YVpipuL-.js → vanilla-picker-Bwq5IBwq.js} +1 -1
- package/dist/twilight/{p-6976c445.entry.js → p-04612ed4.entry.js} +1 -1
- package/dist/twilight/{p-7ce2c5ca.entry.js → p-0be72b27.entry.js} +1 -1
- package/dist/twilight/{p-e692322c.entry.js → p-0f6a9e5e.entry.js} +1 -1
- package/dist/twilight/{p-9f6a0804.entry.js → p-12d485db.entry.js} +1 -1
- package/dist/twilight/{p-4b0aa371.entry.js → p-168bfefc.entry.js} +1 -1
- package/dist/twilight/{p-f4564fdc.entry.js → p-1695dd23.entry.js} +1 -1
- package/dist/twilight/p-18c99d79.entry.js +4 -0
- package/dist/twilight/{p-d4eeed4b.entry.js → p-1abccd80.entry.js} +1 -1
- package/dist/twilight/{p-fe69512c.entry.js → p-1ec309ad.entry.js} +1 -1
- package/dist/twilight/{p-f5e943bb.entry.js → p-2368ab21.entry.js} +1 -1
- package/dist/twilight/{p-b7b29da3.entry.js → p-24eb59ac.entry.js} +1 -1
- package/dist/twilight/{p-9b2f674f.entry.js → p-283b7a09.entry.js} +1 -1
- package/dist/twilight/{p-c5050e10.entry.js → p-28eea468.entry.js} +1 -1
- package/dist/twilight/{p-cd4b2301.entry.js → p-2ea6c5c6.entry.js} +1 -1
- package/dist/twilight/{p-f71a7a24.entry.js → p-30796ada.entry.js} +1 -1
- package/dist/twilight/{p-18ad7499.entry.js → p-327d33c2.entry.js} +1 -1
- package/dist/twilight/{p-0c36ee7c.entry.js → p-363417b6.entry.js} +1 -1
- package/dist/twilight/{p-bd0075c9.entry.js → p-387e06ce.entry.js} +1 -1
- package/dist/twilight/{p-67b225d5.entry.js → p-38c82b5b.entry.js} +1 -1
- package/dist/twilight/{p-DwHaUky6.js → p-3Yh5uCQZ.js} +1 -1
- package/dist/twilight/{p-02350ded.entry.js → p-3cee41e1.entry.js} +1 -1
- package/dist/twilight/p-3e9bba4f.entry.js +4 -0
- package/dist/twilight/{p-3eb54d75.entry.js → p-3f1913e0.entry.js} +1 -1
- package/dist/twilight/{p-a853a50f.entry.js → p-416e7ea9.entry.js} +1 -1
- package/dist/twilight/{p-beb2df03.entry.js → p-44819d23.entry.js} +1 -1
- package/dist/twilight/{p-a4107435.entry.js → p-44ed9315.entry.js} +1 -1
- package/dist/twilight/{p-DVM0Orh8.js → p-4Xs3NevL.js} +1 -1
- package/dist/twilight/{p-0e2a2a9a.entry.js → p-4bdd0eab.entry.js} +1 -1
- package/dist/twilight/{p-77b6fbf2.entry.js → p-4df90b34.entry.js} +1 -1
- package/dist/twilight/{p-ce8571e3.entry.js → p-4e16be16.entry.js} +1 -1
- package/dist/twilight/{p-134988db.entry.js → p-507e04b3.entry.js} +1 -1
- package/dist/twilight/{p-4544ca7d.entry.js → p-52df99a3.entry.js} +1 -1
- package/dist/twilight/{p-0fcc3b26.entry.js → p-54047fdd.entry.js} +1 -1
- package/dist/twilight/p-5dbdf0e7.entry.js +4 -0
- package/dist/twilight/{p-a7d99355.entry.js → p-5dc0f3c0.entry.js} +1 -1
- package/dist/twilight/{p-22405eaa.entry.js → p-5effd85b.entry.js} +2 -2
- package/dist/twilight/{p-8f9e0a7a.entry.js → p-62e99802.entry.js} +1 -1
- package/dist/twilight/{p-c590dcf0.entry.js → p-680e0dca.entry.js} +1 -1
- package/dist/twilight/{p-f32df318.entry.js → p-6e6f4879.entry.js} +1 -1
- package/dist/twilight/{p-KNG8mGcV.js → p-6iwUgroX.js} +1 -1
- package/dist/twilight/{p-f5e55c13.entry.js → p-72bc40b3.entry.js} +1 -1
- package/dist/twilight/{p-d3f904d0.entry.js → p-75345728.entry.js} +1 -1
- package/dist/twilight/{p-d2cc8587.entry.js → p-76f06b0a.entry.js} +1 -1
- package/dist/twilight/{p-43ab561c.entry.js → p-7a738892.entry.js} +1 -1
- package/dist/twilight/{p-e304cb5e.entry.js → p-7ab11977.entry.js} +1 -1
- package/dist/twilight/p-7cfe5dbf.entry.js +4 -0
- package/dist/twilight/{p-1d3efd00.entry.js → p-868b6dcc.entry.js} +1 -1
- package/dist/twilight/{p-a6afc8ab.entry.js → p-8878ec9e.entry.js} +1 -1
- package/dist/twilight/{p-9db7e318.entry.js → p-8a274920.entry.js} +1 -1
- package/dist/twilight/{p-2192d7c2.entry.js → p-8b2fb172.entry.js} +1 -1
- package/dist/twilight/{p-368d3b26.entry.js → p-8b45c13a.entry.js} +1 -1
- package/dist/twilight/{p-d1048676.entry.js → p-8ba7b32d.entry.js} +1 -1
- package/dist/twilight/{p-6b9780be.entry.js → p-8f204414.entry.js} +1 -1
- package/dist/twilight/{p-bcfe04fa.entry.js → p-906dfda7.entry.js} +1 -1
- package/dist/twilight/{p-4427e994.entry.js → p-90976775.entry.js} +1 -1
- package/dist/twilight/{p-4288893b.entry.js → p-917bae25.entry.js} +1 -1
- package/dist/twilight/{p-b8d180fe.entry.js → p-95c6ca83.entry.js} +1 -1
- package/dist/twilight/{p-b32e5ad7.entry.js → p-997a1fdf.entry.js} +1 -1
- package/dist/twilight/{p-dc093d27.entry.js → p-9cb07624.entry.js} +1 -1
- package/dist/twilight/{p-d6da8710.entry.js → p-9d51f43d.entry.js} +1 -1
- package/dist/twilight/{p-aa928350.entry.js → p-9dc6f28e.entry.js} +1 -1
- package/dist/twilight/{p-c01e3f1d.entry.js → p-9efc4b59.entry.js} +1 -1
- package/dist/twilight/{p-CMmiX5T8.js → p-BF7QVpUp.js} +1 -1
- package/dist/twilight/{p-gacShRe2.js → p-BHY6Sj5y.js} +1 -1
- package/dist/twilight/{p-BPGtYFVu.js → p-BZ24UYWJ.js} +1 -1
- package/dist/twilight/{p-BuOjsqYX.js → p-BgI56yKL.js} +1 -1
- package/dist/twilight/{p-CwLXCdYY.js → p-Bnnviqjp.js} +1 -1
- package/dist/twilight/{p-BrcsejOr.js → p-CJRTPVPy.js} +1 -1
- package/dist/twilight/{p-BEb9UIZ7.js → p-DTwxTvVu.js} +1 -1
- package/dist/twilight/{p-Bmy5YF6e.js → p-DZu6rifA.js} +1 -1
- package/dist/twilight/{p-BF901xIc.js → p-K0OclOPO.js} +1 -1
- package/dist/twilight/p-XnA1YTjA.js +4 -0
- package/dist/twilight/{p-1a8525af.entry.js → p-b2a12062.entry.js} +1 -1
- package/dist/twilight/{p-4b558e37.entry.js → p-b69cc47d.entry.js} +1 -1
- package/dist/twilight/{p-be632d40.entry.js → p-bb7d240f.entry.js} +1 -1
- package/dist/twilight/{p-5476bd33.entry.js → p-bd50d1c4.entry.js} +1 -1
- package/dist/twilight/{p-1c4e7c18.entry.js → p-c01100d0.entry.js} +1 -1
- package/dist/twilight/{p-04f5d67b.entry.js → p-c19cdf96.entry.js} +1 -1
- package/dist/twilight/{p-a5895e0f.entry.js → p-c1b56f08.entry.js} +1 -1
- package/dist/twilight/{p-2eb78125.entry.js → p-c1e7fe98.entry.js} +1 -1
- package/dist/twilight/{p-ce633fa0.entry.js → p-c497fa37.entry.js} +1 -1
- package/dist/twilight/p-c6026f2e.entry.js +4 -0
- package/dist/twilight/{p-4e2f144a.entry.js → p-cb475d27.entry.js} +1 -1
- package/dist/twilight/{p-ed1e0c2e.entry.js → p-cb9501dc.entry.js} +1 -1
- package/dist/twilight/{p-5c37420e.entry.js → p-ccbf4eea.entry.js} +1 -1
- package/dist/twilight/{p-a445225d.entry.js → p-cd11cafc.entry.js} +1 -1
- package/dist/twilight/{p-f3b24cce.entry.js → p-cdfe32c9.entry.js} +1 -1
- package/dist/twilight/{p-d92a7d91.entry.js → p-d1b3e98b.entry.js} +1 -1
- package/dist/twilight/{p-8f006eca.entry.js → p-d5bbdd47.entry.js} +1 -1
- package/dist/twilight/{p-518bab79.entry.js → p-d6ace1e8.entry.js} +1 -1
- package/dist/twilight/{p-85b235dc.entry.js → p-db3da75c.entry.js} +1 -1
- package/dist/twilight/p-df6739de.entry.js +4 -0
- package/dist/twilight/{p-ad5c8d34.entry.js → p-e10eed6e.entry.js} +1 -1
- package/dist/twilight/{p-2b58b700.entry.js → p-e30f415c.entry.js} +1 -1
- package/dist/twilight/{p-b2a11170.entry.js → p-e52bbc5f.entry.js} +1 -1
- package/dist/twilight/{p-a047ed06.entry.js → p-e9439252.entry.js} +1 -1
- package/dist/twilight/p-eeb0e354.entry.js +4 -0
- package/dist/twilight/{p-0d94f890.entry.js → p-f4b040f0.entry.js} +1 -1
- package/dist/twilight/{p-90c58cc5.entry.js → p-f5242092.entry.js} +1 -1
- package/dist/twilight/{p-506a2720.entry.js → p-f6c20f25.entry.js} +1 -1
- package/dist/twilight/{p-2e4fe427.entry.js → p-f97717b9.entry.js} +1 -1
- package/dist/twilight/{p-ce38e5a1.entry.js → p-fb9f7001.entry.js} +1 -1
- package/dist/twilight/{p-c92915e0.entry.js → p-fe6e676c.entry.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-order-cancel/interfaces.d.ts +20 -0
- package/dist/types/components/salla-order-cancel/salla-order-cancel.d.ts +42 -0
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +1 -0
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +1 -0
- package/dist/types/components.d.ts +68 -0
- package/package.json +5 -5
- package/dist/twilight/p-2cc32d1f.entry.js +0 -4
- package/dist/twilight/p-3d732135.entry.js +0 -4
- package/dist/twilight/p-632766e3.entry.js +0 -4
- package/dist/twilight/p-C-3GuKNW.js +0 -4
- package/dist/twilight/p-a3a1bf15.entry.js +0 -4
- package/dist/twilight/p-d2cdd923.entry.js +0 -4
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { h, Host } from "@stencil/core";
|
|
5
|
+
const SKELETON_ROWS = [
|
|
6
|
+
{ label: '100px', value: '56px' },
|
|
7
|
+
{ label: '72px', value: '64px' },
|
|
8
|
+
{ label: '96px', value: '48px' },
|
|
9
|
+
];
|
|
10
|
+
/**
|
|
11
|
+
* Cart summary card. Inline on desktop (≥1024px), sticky bar with
|
|
12
|
+
* collapsible sheet on mobile.
|
|
13
|
+
*/
|
|
14
|
+
export class SallaCartSummaryCard {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.validateForms = true;
|
|
17
|
+
this.cartCount = 0;
|
|
18
|
+
this.cartTotal = 0;
|
|
19
|
+
this.cartTotalDiscount = 0;
|
|
20
|
+
this.cartSubTotal = 0;
|
|
21
|
+
this.cartOptionsTotal = 0;
|
|
22
|
+
this.cartShippingCost = 0;
|
|
23
|
+
this.cartTaxAmount = 0;
|
|
24
|
+
this.cartHasShipping = false;
|
|
25
|
+
this.isOpen = false;
|
|
26
|
+
this.isDesktop = false;
|
|
27
|
+
/** True until the first cart payload (API response or cart event) arrives. */
|
|
28
|
+
this.isLoading = true;
|
|
29
|
+
// Original DOM location — needed to restore the host on the mobile→desktop flip.
|
|
30
|
+
this.originalParent = null;
|
|
31
|
+
this.originalNextSibling = null;
|
|
32
|
+
this.bodyObserver = null;
|
|
33
|
+
this.mediaQueryList = null;
|
|
34
|
+
this.submitObserver = null;
|
|
35
|
+
this.isSubmitting = false;
|
|
36
|
+
// Stable handler refs — anonymous functions can't be unbound from listeners.
|
|
37
|
+
this.mqlChangeHandler = (e) => {
|
|
38
|
+
this.isDesktop = e.matches;
|
|
39
|
+
this.applyMode();
|
|
40
|
+
};
|
|
41
|
+
this.cartEventNames = [
|
|
42
|
+
'cart::details.fetched',
|
|
43
|
+
'cart::updated',
|
|
44
|
+
'cart::latest.fetched',
|
|
45
|
+
'cart::coupon.added',
|
|
46
|
+
'cart::coupon.deleted',
|
|
47
|
+
];
|
|
48
|
+
this.cartEventHandler = (payload) => this.applyCartData(this.extractCart(payload));
|
|
49
|
+
this.toggleSheet = () => {
|
|
50
|
+
if (!this.isDesktop)
|
|
51
|
+
this.isOpen = !this.isOpen;
|
|
52
|
+
};
|
|
53
|
+
this.handleSubmit = async (event) => {
|
|
54
|
+
// Re-entrancy guard, set before the async validation so a second tap during
|
|
55
|
+
// that window can't fire a second submit. Covers all user types.
|
|
56
|
+
if (this.isSubmitting) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.isSubmitting = true;
|
|
61
|
+
if (this.validateForms && !(await this.validateCartForms())) {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
salla.notify?.error?.(salla.lang?.get?.('common.messages.required_fields'));
|
|
64
|
+
this.isSubmitting = false; // validation failed → allow retry
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const btn = this.host.querySelector('#s-cart-summary-card-submit');
|
|
68
|
+
if (typeof salla !== 'undefined' && salla.config?.get?.('user.type') !== 'guest' && btn) {
|
|
69
|
+
btn.load?.();
|
|
70
|
+
// Pin loading across re-renders; auto-clear after 10s so a failed submit
|
|
71
|
+
// doesn't lock the button forever.
|
|
72
|
+
this.submitObserver?.disconnect();
|
|
73
|
+
if (this.submitObserverTimeout)
|
|
74
|
+
clearTimeout(this.submitObserverTimeout);
|
|
75
|
+
this.submitObserver = new MutationObserver(() => {
|
|
76
|
+
if (!btn.hasAttribute('loading'))
|
|
77
|
+
btn.setAttribute('loading', '');
|
|
78
|
+
});
|
|
79
|
+
this.submitObserver.observe(btn, { attributes: true, attributeFilter: ['loading'] });
|
|
80
|
+
this.submitObserverTimeout = window.setTimeout(() => {
|
|
81
|
+
this.submitObserver?.disconnect();
|
|
82
|
+
this.submitObserver = null;
|
|
83
|
+
btn.removeAttribute?.('loading');
|
|
84
|
+
}, 10000);
|
|
85
|
+
}
|
|
86
|
+
salla.cart?.submit?.();
|
|
87
|
+
// Release after submit kicks off: success navigates away, a guest opens the
|
|
88
|
+
// login modal. Short delay blocks the double-tap race without a long lock.
|
|
89
|
+
window.setTimeout(() => { this.isSubmitting = false; }, 1500);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
// Sync: returning a promise would make Stencil defer first paint. init() runs async.
|
|
93
|
+
componentWillLoad() {
|
|
94
|
+
this.mediaQueryList = window.matchMedia(this.desktopMediaQuery());
|
|
95
|
+
this.isDesktop = this.mediaQueryList.matches;
|
|
96
|
+
if (this.isDesktop)
|
|
97
|
+
this.isOpen = true;
|
|
98
|
+
// isLoading is true by default → first paint is the skeleton.
|
|
99
|
+
this.init();
|
|
100
|
+
}
|
|
101
|
+
// Not awaited by componentWillLoad, so it can't block first paint.
|
|
102
|
+
async init() {
|
|
103
|
+
await salla.onReady();
|
|
104
|
+
await salla.lang.onLoaded();
|
|
105
|
+
this.loadTranslations();
|
|
106
|
+
// 'cart::updated' is in cartEventNames — don't also use onUpdated (it leaks, no off()).
|
|
107
|
+
this.cartEventNames.forEach(name => salla.event.on(name, this.cartEventHandler));
|
|
108
|
+
this.fetchCart();
|
|
109
|
+
}
|
|
110
|
+
loadTranslations() {
|
|
111
|
+
this.summaryLabel = salla.lang.get('pages.cart.summary');
|
|
112
|
+
this.itemsTotalLabel = salla.lang.get('pages.cart.items_total');
|
|
113
|
+
this.itemsTotalNoTaxLabel = salla.lang.get('pages.cart.items_total_without_tax');
|
|
114
|
+
this.optionsTotalLabel = salla.lang.get('pages.cart.order_options_total');
|
|
115
|
+
this.shippingCostLabel = salla.lang.get('pages.cart.shipping_cost');
|
|
116
|
+
this.vatTaxLabel = salla.lang.get('pages.cart.VAT_tax_amount');
|
|
117
|
+
this.savedLabel = salla.lang.get('pages.cart.discount');
|
|
118
|
+
this.discountBadge = salla.lang.get('pages.cart.saved');
|
|
119
|
+
this.finalTotalLabel = salla.lang.get('pages.cart.final_total');
|
|
120
|
+
this.pricesTaxedLabel = salla.lang.get('pages.cart.prices_taxed');
|
|
121
|
+
this.completeOrderLabel = salla.lang.get('pages.cart.complete_order');
|
|
122
|
+
this.openSummaryLabel = salla.lang.get('pages.cart.open_summary');
|
|
123
|
+
this.closeSummaryLabel = salla.lang.get('pages.cart.close_summary');
|
|
124
|
+
this.itemsCountTemplate = salla.lang.get('pages.cart.items_with_count');
|
|
125
|
+
}
|
|
126
|
+
/** Coerces PHP cart values: numbers, strings, and Money/MoneyTaxable objects. */
|
|
127
|
+
num(v) {
|
|
128
|
+
if (v === null || v === undefined)
|
|
129
|
+
return 0;
|
|
130
|
+
if (typeof v === 'number')
|
|
131
|
+
return isFinite(v) ? v : 0;
|
|
132
|
+
if (typeof v === 'string')
|
|
133
|
+
return parseFloat(v) || 0;
|
|
134
|
+
if (typeof v === 'object') {
|
|
135
|
+
if ('amount' in v)
|
|
136
|
+
return this.num(v.amount);
|
|
137
|
+
if ('value' in v)
|
|
138
|
+
return this.num(v.value);
|
|
139
|
+
if ('formatted' in v)
|
|
140
|
+
return this.num(v.formatted);
|
|
141
|
+
}
|
|
142
|
+
return 0;
|
|
143
|
+
}
|
|
144
|
+
// Desktop cutoff — must match the SCSS media queries so JS and CSS never diverge.
|
|
145
|
+
breakpointPx() {
|
|
146
|
+
return 1024;
|
|
147
|
+
}
|
|
148
|
+
desktopMediaQuery() {
|
|
149
|
+
return `(min-width: ${this.breakpointPx()}px)`;
|
|
150
|
+
}
|
|
151
|
+
componentDidLoad() {
|
|
152
|
+
// Capture original location BEFORE the portal relocates the host.
|
|
153
|
+
this.originalParent = this.host.parentElement;
|
|
154
|
+
this.originalNextSibling = this.host.nextSibling;
|
|
155
|
+
// Re-init if componentWillLoad failed to set it (rare hydration/race edge case).
|
|
156
|
+
if (!this.mediaQueryList) {
|
|
157
|
+
this.mediaQueryList = window.matchMedia(this.desktopMediaQuery());
|
|
158
|
+
this.isDesktop = this.mediaQueryList.matches;
|
|
159
|
+
}
|
|
160
|
+
this.applyMode();
|
|
161
|
+
// iOS Safari < 14 lacks addEventListener on MediaQueryList — fall back to addListener.
|
|
162
|
+
if (this.mediaQueryList.addEventListener) {
|
|
163
|
+
this.mediaQueryList.addEventListener('change', this.mqlChangeHandler);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.mediaQueryList.addListener(this.mqlChangeHandler);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Mobile: portal host to <body> so position:fixed escapes any transformed
|
|
170
|
+
// ancestor. Desktop: restore to its original DOM location.
|
|
171
|
+
applyMode() {
|
|
172
|
+
if (this.isDesktop) {
|
|
173
|
+
this.isOpen = true;
|
|
174
|
+
this.bodyObserver?.disconnect();
|
|
175
|
+
this.bodyObserver = null;
|
|
176
|
+
if (this.originalParent && this.host.parentElement !== this.originalParent) {
|
|
177
|
+
// Sibling may have been removed while we were portaled — fall back
|
|
178
|
+
// to appendChild instead of letting insertBefore throw.
|
|
179
|
+
const ref = this.originalNextSibling?.parentNode === this.originalParent
|
|
180
|
+
? this.originalNextSibling
|
|
181
|
+
: null;
|
|
182
|
+
this.originalParent.insertBefore(this.host, ref);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
this.pinToBodyEnd();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Re-pin via MutationObserver so a late-mounted footer can't paint over us.
|
|
190
|
+
pinToBodyEnd() {
|
|
191
|
+
if (this.host.parentElement !== document.body || document.body.lastElementChild !== this.host) {
|
|
192
|
+
document.body.appendChild(this.host);
|
|
193
|
+
}
|
|
194
|
+
if (!this.bodyObserver) {
|
|
195
|
+
this.bodyObserver = new MutationObserver(() => {
|
|
196
|
+
if (!this.isDesktop && document.body.lastElementChild !== this.host) {
|
|
197
|
+
document.body.appendChild(this.host);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
this.bodyObserver.observe(document.body, { childList: true });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
disconnectedCallback() {
|
|
204
|
+
// Fires synchronously on every removal, incl. our own reparenting — defer a
|
|
205
|
+
// microtask and bail if reconnected, else the portal loses its listeners.
|
|
206
|
+
Promise.resolve().then(() => {
|
|
207
|
+
if (this.host.isConnected)
|
|
208
|
+
return;
|
|
209
|
+
this.bodyObserver?.disconnect();
|
|
210
|
+
this.submitObserver?.disconnect();
|
|
211
|
+
if (this.submitObserverTimeout) {
|
|
212
|
+
clearTimeout(this.submitObserverTimeout);
|
|
213
|
+
this.submitObserverTimeout = undefined;
|
|
214
|
+
}
|
|
215
|
+
// Mirror the iOS-Safari-<14 path used in componentDidLoad.
|
|
216
|
+
if (this.mediaQueryList?.removeEventListener) {
|
|
217
|
+
this.mediaQueryList.removeEventListener('change', this.mqlChangeHandler);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
this.mediaQueryList?.removeListener(this.mqlChangeHandler);
|
|
221
|
+
}
|
|
222
|
+
this.mediaQueryList = null;
|
|
223
|
+
this.cartEventNames.forEach(name => salla.event.off(name, this.cartEventHandler));
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
fetchCart() {
|
|
227
|
+
const cartId = salla.config?.get?.('page.id');
|
|
228
|
+
const result = salla.cart?.api?.details?.(cartId);
|
|
229
|
+
if (result && typeof result.then === 'function') {
|
|
230
|
+
result
|
|
231
|
+
.then((res) => this.applyCartData(this.extractCart(res)))
|
|
232
|
+
// On failure, fall back to the cached summary instead of stranding the skeleton.
|
|
233
|
+
.catch(() => this.applyCachedSummary());
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
this.applyCachedSummary();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// Cart API failed → use the SDK's cached summary (localStorage, set on
|
|
240
|
+
// cart::updated). May be stale but beats zeros; events refresh it. Clears the
|
|
241
|
+
// skeleton either way so the CTA always renders.
|
|
242
|
+
applyCachedSummary() {
|
|
243
|
+
const summary = salla.storage?.get?.('cart.summary');
|
|
244
|
+
if (summary && typeof summary === 'object')
|
|
245
|
+
this.applyCartData(summary);
|
|
246
|
+
this.isLoading = false;
|
|
247
|
+
}
|
|
248
|
+
extractCart(payload) {
|
|
249
|
+
if (!payload)
|
|
250
|
+
return null;
|
|
251
|
+
if (payload.data?.cart)
|
|
252
|
+
return payload.data.cart;
|
|
253
|
+
if (payload.cart)
|
|
254
|
+
return payload.cart;
|
|
255
|
+
return payload;
|
|
256
|
+
}
|
|
257
|
+
applyCartData(data) {
|
|
258
|
+
if (!data)
|
|
259
|
+
return;
|
|
260
|
+
// First real payload ends the skeleton.
|
|
261
|
+
this.isLoading = false;
|
|
262
|
+
if (data.count !== undefined)
|
|
263
|
+
this.cartCount = this.num(data.count);
|
|
264
|
+
if (data.total !== undefined)
|
|
265
|
+
this.cartTotal = this.num(data.total);
|
|
266
|
+
// `total_discount` is the live field (untyped); `discount` is the typed fallback.
|
|
267
|
+
const discount = data.total_discount ?? data.discount;
|
|
268
|
+
if (discount !== undefined)
|
|
269
|
+
this.cartTotalDiscount = this.num(discount);
|
|
270
|
+
if (data.sub_total !== undefined)
|
|
271
|
+
this.cartSubTotal = this.num(data.sub_total);
|
|
272
|
+
if (data.options_total !== undefined)
|
|
273
|
+
this.cartOptionsTotal = this.num(data.options_total);
|
|
274
|
+
if (data.tax_amount !== undefined)
|
|
275
|
+
this.cartTaxAmount = this.num(data.tax_amount);
|
|
276
|
+
// Shipping cost (free-shipping aware): prefer `shipping_cost`, else `real_shipping_cost`.
|
|
277
|
+
const hasFreeShipping = !!data.free_shipping_bar?.has_free_shipping;
|
|
278
|
+
if (data.shipping_cost !== undefined)
|
|
279
|
+
this.cartShippingCost = this.num(data.shipping_cost);
|
|
280
|
+
else if (data.real_shipping_cost !== undefined)
|
|
281
|
+
this.cartShippingCost = hasFreeShipping ? 0 : this.num(data.real_shipping_cost);
|
|
282
|
+
// `has_shipping` isn't in the API response — derive row visibility from the cost.
|
|
283
|
+
this.cartHasShipping = this.cartShippingCost > 0 || !!data.has_shipping;
|
|
284
|
+
}
|
|
285
|
+
// Native reportValidity() covers standard fields; custom product options
|
|
286
|
+
// validate via their own async reportValidity() (incl. multi-option required
|
|
287
|
+
// logic), so await that too — else option validation is skipped at checkout.
|
|
288
|
+
async validateCartForms() {
|
|
289
|
+
let isValid = true;
|
|
290
|
+
document
|
|
291
|
+
.querySelectorAll('form[id^="item-"]')
|
|
292
|
+
.forEach(f => {
|
|
293
|
+
if (!f.reportValidity())
|
|
294
|
+
isValid = false;
|
|
295
|
+
});
|
|
296
|
+
const optionEls = Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));
|
|
297
|
+
for (const el of optionEls) {
|
|
298
|
+
if (typeof el.reportValidity === 'function' && !(await el.reportValidity()))
|
|
299
|
+
isValid = false;
|
|
300
|
+
}
|
|
301
|
+
return isValid;
|
|
302
|
+
}
|
|
303
|
+
money(value) {
|
|
304
|
+
try {
|
|
305
|
+
if (typeof salla !== 'undefined' && typeof salla.money === 'function') {
|
|
306
|
+
return salla.money(value);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch (_) { }
|
|
310
|
+
return String(value ?? 0);
|
|
311
|
+
}
|
|
312
|
+
getItemsLabel() {
|
|
313
|
+
return this.itemsCountTemplate?.replace(':count', String(this.cartCount)) ?? '';
|
|
314
|
+
}
|
|
315
|
+
// Skeleton during the initial fetch
|
|
316
|
+
renderSkeleton() {
|
|
317
|
+
return (h(Host, { class: {
|
|
318
|
+
's-cart-summary-card': true,
|
|
319
|
+
's-cart-summary-card--loading': true,
|
|
320
|
+
's-cart-summary-card--desktop': this.isDesktop,
|
|
321
|
+
's-cart-summary-card--mobile': !this.isDesktop,
|
|
322
|
+
} }, 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" }))));
|
|
323
|
+
}
|
|
324
|
+
render() {
|
|
325
|
+
if (this.isLoading)
|
|
326
|
+
return this.renderSkeleton();
|
|
327
|
+
const showSavings = this.cartTotalDiscount > 0;
|
|
328
|
+
const subTotalLabel = this.cartTaxAmount ? this.itemsTotalNoTaxLabel : this.itemsTotalLabel;
|
|
329
|
+
// Inline transform so sheet motion doesn't depend on SCSS load order.
|
|
330
|
+
const sheetStyle = this.isDesktop
|
|
331
|
+
? {}
|
|
332
|
+
: {
|
|
333
|
+
transform: this.isOpen ? 'translateY(0)' : 'translateY(100%)',
|
|
334
|
+
transition: 'transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)',
|
|
335
|
+
};
|
|
336
|
+
return (h(Host, { class: {
|
|
337
|
+
's-cart-summary-card': true,
|
|
338
|
+
's-cart-summary-card--open': this.isOpen,
|
|
339
|
+
's-cart-summary-card--desktop': this.isDesktop,
|
|
340
|
+
's-cart-summary-card--mobile': !this.isDesktop,
|
|
341
|
+
} }, h("div", { class: {
|
|
342
|
+
's-cart-summary-card-sheet-wrap': true,
|
|
343
|
+
's-cart-summary-card-sheet-wrap--open': this.isOpen,
|
|
344
|
+
}, "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))));
|
|
345
|
+
}
|
|
346
|
+
static get is() { return "salla-cart-summary-card"; }
|
|
347
|
+
static get properties() {
|
|
348
|
+
return {
|
|
349
|
+
"validateForms": {
|
|
350
|
+
"type": "boolean",
|
|
351
|
+
"attribute": "validate-forms",
|
|
352
|
+
"mutable": false,
|
|
353
|
+
"complexType": {
|
|
354
|
+
"original": "boolean",
|
|
355
|
+
"resolved": "boolean",
|
|
356
|
+
"references": {}
|
|
357
|
+
},
|
|
358
|
+
"required": false,
|
|
359
|
+
"optional": false,
|
|
360
|
+
"docs": {
|
|
361
|
+
"tags": [],
|
|
362
|
+
"text": ""
|
|
363
|
+
},
|
|
364
|
+
"getter": false,
|
|
365
|
+
"setter": false,
|
|
366
|
+
"reflect": false,
|
|
367
|
+
"defaultValue": "true"
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
static get states() {
|
|
372
|
+
return {
|
|
373
|
+
"cartCount": {},
|
|
374
|
+
"cartTotal": {},
|
|
375
|
+
"cartTotalDiscount": {},
|
|
376
|
+
"cartSubTotal": {},
|
|
377
|
+
"cartOptionsTotal": {},
|
|
378
|
+
"cartShippingCost": {},
|
|
379
|
+
"cartTaxAmount": {},
|
|
380
|
+
"cartHasShipping": {},
|
|
381
|
+
"isOpen": {},
|
|
382
|
+
"isDesktop": {},
|
|
383
|
+
"isLoading": {},
|
|
384
|
+
"summaryLabel": {},
|
|
385
|
+
"itemsTotalLabel": {},
|
|
386
|
+
"itemsTotalNoTaxLabel": {},
|
|
387
|
+
"optionsTotalLabel": {},
|
|
388
|
+
"shippingCostLabel": {},
|
|
389
|
+
"vatTaxLabel": {},
|
|
390
|
+
"savedLabel": {},
|
|
391
|
+
"discountBadge": {},
|
|
392
|
+
"finalTotalLabel": {},
|
|
393
|
+
"pricesTaxedLabel": {},
|
|
394
|
+
"completeOrderLabel": {},
|
|
395
|
+
"openSummaryLabel": {},
|
|
396
|
+
"closeSummaryLabel": {},
|
|
397
|
+
"itemsCountTemplate": {}
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
static get elementRef() { return "host"; }
|
|
401
|
+
}
|
|
@@ -7,11 +7,14 @@ import Helper from "../../Helpers/Helper";
|
|
|
7
7
|
export class SallaFilters {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.isReady = false; //to avoid triggering the changed event
|
|
10
|
+
this.isInitialFetch = true; //the base-category auto-append may only run on the first filters::fetched
|
|
10
11
|
this.filtersData = {};
|
|
12
|
+
this.appliedOpen = true;
|
|
11
13
|
salla.event.on('filters::hidden', () => this.host.style.display = 'none');
|
|
12
14
|
salla.lang.onLoaded(() => {
|
|
13
15
|
this.apply = salla.lang.get('pages.checkout.apply');
|
|
14
16
|
this.reset = salla.lang.get('pages.categories.filters_reset');
|
|
17
|
+
this.selectedTitle = salla.lang.getWithDefault('pages.categories.selected_filters', 'لقد اخترت');
|
|
15
18
|
});
|
|
16
19
|
salla.event.on('filters::fetched', ({ filters }) => {
|
|
17
20
|
this.host.style.display = '';
|
|
@@ -46,7 +49,9 @@ export class SallaFilters {
|
|
|
46
49
|
break; // No need to continue checking once a match is found
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
|
-
|
|
52
|
+
// only on the first fetch after page load — re-appending on later fetches
|
|
53
|
+
// would silently undo an explicit "remove all filters" (COD-10662)
|
|
54
|
+
if (this.isInitialFetch && salla.config.get('page.slug') == "product.index" && Object.keys(freshFilterData).length == 0 && !hasFilters) {
|
|
50
55
|
// Append the current category to the url if there are no pre-selected filters
|
|
51
56
|
let currentUrl = window.location.href;
|
|
52
57
|
let filterValue = salla.config.get('page.id');
|
|
@@ -57,6 +62,7 @@ export class SallaFilters {
|
|
|
57
62
|
}
|
|
58
63
|
return filter;
|
|
59
64
|
});
|
|
65
|
+
this.isInitialFetch = false;
|
|
60
66
|
this.filtersData = freshFilterData;
|
|
61
67
|
this.host.childNodes.forEach(async (widget) => widget.setWidgetHeight && await widget.setWidgetHeight());
|
|
62
68
|
});
|
|
@@ -118,9 +124,7 @@ export class SallaFilters {
|
|
|
118
124
|
const value = filters[key];
|
|
119
125
|
const fullKey = parentKey ? `${parentKey}[${key}]` : key;
|
|
120
126
|
if (Array.isArray(value)) {
|
|
121
|
-
|
|
122
|
-
encodedFilters.push(`${fullKey}[${i}]=${value[i]}`);
|
|
123
|
-
}
|
|
127
|
+
value.forEach(item => encodedFilters.push(`${fullKey}[]=${item}`));
|
|
124
128
|
}
|
|
125
129
|
else if (typeof value === 'object' && value !== null) {
|
|
126
130
|
encodedFilters.push(this.encodeFilters(value, fullKey));
|
|
@@ -175,21 +179,105 @@ export class SallaFilters {
|
|
|
175
179
|
isChecked && (this.filtersData[option.key] = value);
|
|
176
180
|
isChecked || (delete this.filtersData[option.key]);
|
|
177
181
|
}
|
|
178
|
-
//it's checkbox
|
|
179
|
-
// add if condition to avoid error when the filter is not existed in the filtersData
|
|
182
|
+
//it's checkbox (multi-select / OR within the same group)
|
|
180
183
|
else if (event.target.type == "checkbox") {
|
|
181
|
-
|
|
184
|
+
const current = this.filtersData[option.key];
|
|
185
|
+
// coerce legacy scalar values (e.g. ?filters[brand_id]=1) into an array
|
|
186
|
+
this.filtersData[option.key] = Array.isArray(current) ? current : (current != null ? [current] : []);
|
|
182
187
|
if (isChecked) {
|
|
183
188
|
this.filtersData[option.key].push(value);
|
|
184
189
|
}
|
|
185
|
-
|
|
190
|
+
else {
|
|
191
|
+
this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);
|
|
192
|
+
}
|
|
193
|
+
if (!this.filtersData[option.key].length) {
|
|
194
|
+
delete this.filtersData[option.key];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
this.filtersData = { ...this.filtersData }; // reassign so @State re-renders the applied chips
|
|
198
|
+
this.applyFilters();
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Flatten the selected filtersData into displayable chips, resolving the
|
|
202
|
+
* human label for each group + option from `this.filters`. Selections that
|
|
203
|
+
* can't be resolved to a known option (e.g. the auto-added base category)
|
|
204
|
+
* are skipped.
|
|
205
|
+
*/
|
|
206
|
+
getAppliedFilters() {
|
|
207
|
+
const chips = [];
|
|
208
|
+
const data = this.filtersData || {};
|
|
209
|
+
for (const key of Object.keys(data)) {
|
|
210
|
+
if (key === 'variants') {
|
|
211
|
+
const variantFilter = this.filters?.find(f => f.type === FilterOptionTypes.VARIANTS);
|
|
212
|
+
for (const variantKey of Object.keys(data.variants || {})) {
|
|
213
|
+
const value = data.variants[variantKey];
|
|
214
|
+
const opt = variantFilter?.values?.find(o => (o.key || o.value) == value);
|
|
215
|
+
if (!opt)
|
|
216
|
+
continue;
|
|
217
|
+
chips.push({ key, variantKey, value, type: FilterOptionTypes.VARIANTS, groupLabel: variantFilter?.label, optionLabel: opt.value });
|
|
218
|
+
}
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const group = this.filters?.find(f => f.key === key);
|
|
222
|
+
if (!group)
|
|
223
|
+
continue;
|
|
224
|
+
const raw = data[key];
|
|
225
|
+
// RANGE (e.g. price) is stored as a { min, max } object
|
|
226
|
+
if (group.type === FilterOptionTypes.RANGE || (raw && typeof raw === 'object' && !Array.isArray(raw))) {
|
|
227
|
+
chips.push({ key, value: raw, type: FilterOptionTypes.RANGE, groupLabel: group.label, optionLabel: `${raw.min} - ${raw.max}` });
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
// the auto-appended base category (see filters::fetched) is page scoping, not a user
|
|
231
|
+
// selection — skip it. It's stored as a scalar; user selections are always arrays.
|
|
232
|
+
if (key === 'category_id' && !Array.isArray(raw) && salla.config.get('page.slug') == 'product.index' && raw == salla.config.get('page.id')) {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
const values = Array.isArray(raw) ? raw : [raw];
|
|
236
|
+
for (const value of values) {
|
|
237
|
+
// rating values are bare numbers; everything else maps key -> value label
|
|
238
|
+
const opt = group.values?.find(o => (typeof o === 'number' ? o : (o.key || o.value)) == value);
|
|
239
|
+
const optionLabel = group.key === 'rating' ? `${value}` : (opt && typeof opt !== 'number' ? opt.value : undefined);
|
|
240
|
+
if (optionLabel == null)
|
|
241
|
+
continue;
|
|
242
|
+
chips.push({ key, value, type: group.type, groupLabel: group.label, optionLabel });
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return chips;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Remove a single applied filter — the direct inverse of handleOptionChange.
|
|
249
|
+
*/
|
|
250
|
+
removeFilter(chip) {
|
|
251
|
+
if (chip.type === FilterOptionTypes.VARIANTS) {
|
|
252
|
+
if (this.filtersData.variants) {
|
|
253
|
+
delete this.filtersData.variants[chip.variantKey];
|
|
254
|
+
if (!Object.keys(this.filtersData.variants).length)
|
|
255
|
+
delete this.filtersData.variants;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (chip.type === FilterOptionTypes.RANGE) {
|
|
259
|
+
delete this.filtersData[chip.key];
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
const raw = this.filtersData[chip.key];
|
|
263
|
+
if (Array.isArray(raw)) {
|
|
264
|
+
this.filtersData[chip.key] = raw.filter(val => val != chip.value);
|
|
265
|
+
if (!this.filtersData[chip.key].length)
|
|
266
|
+
delete this.filtersData[chip.key];
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
delete this.filtersData[chip.key];
|
|
270
|
+
}
|
|
186
271
|
}
|
|
272
|
+
this.filtersData = { ...this.filtersData }; // reassign so the panel + widgets re-render immediately
|
|
187
273
|
this.applyFilters();
|
|
188
274
|
}
|
|
189
275
|
render() {
|
|
190
|
-
|
|
276
|
+
const appliedFilters = this.getAppliedFilters();
|
|
277
|
+
const removeText = salla.lang.getWithDefault('common.elements.delete', 'Remove');
|
|
278
|
+
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 } }) => {
|
|
191
279
|
this.handleOptionChange(event, option, value);
|
|
192
|
-
} }))
|
|
280
|
+
} })));
|
|
193
281
|
}
|
|
194
282
|
componentDidLoad() {
|
|
195
283
|
this.isReady = true;
|
|
@@ -238,7 +326,9 @@ export class SallaFilters {
|
|
|
238
326
|
"isSidebarOpen": {},
|
|
239
327
|
"filtersData": {},
|
|
240
328
|
"apply": {},
|
|
241
|
-
"reset": {}
|
|
329
|
+
"reset": {},
|
|
330
|
+
"selectedTitle": {},
|
|
331
|
+
"appliedOpen": {}
|
|
242
332
|
};
|
|
243
333
|
}
|
|
244
334
|
static get events() {
|
|
@@ -135,7 +135,7 @@ export class SallaFiltersWidget {
|
|
|
135
135
|
//@ts-ignore
|
|
136
136
|
return filteredValues.map((filterOption, index) => {
|
|
137
137
|
let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);
|
|
138
|
-
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:
|
|
138
|
+
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));
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
isSelectedOption(option, value) {
|
|
@@ -143,13 +143,18 @@ export class SallaFiltersWidget {
|
|
|
143
143
|
return this.filtersData[option.key] == value;
|
|
144
144
|
}
|
|
145
145
|
if (option.type === FilterOptionTypes.VARIANTS) {
|
|
146
|
-
|
|
146
|
+
// selections are stored per widget key (handleOptionChange: filtersData.variants[option.key])
|
|
147
|
+
return this.filtersData[option.type] && this.filtersData[option.type][option.key] == value;
|
|
147
148
|
}
|
|
148
149
|
if (option.type === FilterOptionTypes.RANGE) {
|
|
149
150
|
return this.filtersData[option.key] && this.filtersData[option.key].min == value.min && this.filtersData[option.key].max == value.max;
|
|
150
151
|
}
|
|
151
152
|
if (option.type === FilterOptionTypes.VALUES) {
|
|
152
|
-
|
|
153
|
+
const selected = this.filtersData[option.key];
|
|
154
|
+
if (Array.isArray(selected)) {
|
|
155
|
+
return selected.some(v => Number(v) === Number(value));
|
|
156
|
+
}
|
|
157
|
+
return selected != null && Number(selected) === Number(value);
|
|
153
158
|
}
|
|
154
159
|
return false;
|
|
155
160
|
}
|
|
@@ -159,16 +164,18 @@ export class SallaFiltersWidget {
|
|
|
159
164
|
return h("salla-rating-stars", { size: "small", value: filterOption });
|
|
160
165
|
}
|
|
161
166
|
let label = filterOption.value || 'null';
|
|
162
|
-
|
|
167
|
+
if (filterOption.count != null) {
|
|
168
|
+
label += ` (${salla.helpers.number(filterOption.count)})`;
|
|
169
|
+
}
|
|
163
170
|
return h("span", { class: "s-filters-option-name" }, label);
|
|
164
171
|
}
|
|
165
172
|
render() {
|
|
166
|
-
return (h(Host, { key: '
|
|
173
|
+
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
|
|
167
174
|
? this.renderFilterOption(this.option)
|
|
168
175
|
: h("salla-price-range", { onChanged: (event) => {
|
|
169
176
|
this.changed.emit(event.detail);
|
|
170
177
|
}, ref: price => this.priceRange = price, filtersData: this.filtersData, option: this.option })), this.withLoadMore && (!this.searchQuery || this.filteredCount > this.initialItemCount) &&
|
|
171
|
-
h("a", { key: '
|
|
178
|
+
h("a", { key: '85ca188ff9f0db7c0a23b94e4705ae2ca5c38d55', class: "s-filters-widget-more", onClick: () => this.showMore() }, !this.isShowMore ? this.showMoreLabel : this.showLessLabel))));
|
|
172
179
|
}
|
|
173
180
|
static get is() { return "salla-filters-widget"; }
|
|
174
181
|
static get originalStyleUrls() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|