@salla.sa/twilight-components 2.14.373 → 2.14.375
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-CXs-MqTC.js → filepond-C6fC8vSQ.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C_2cyJP8.js → filepond-plugin-file-poster-D4aLOYiI.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-4nPUz6ol.js → filepond-plugin-file-validate-size-COkEZvyR.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CepBx5RP.js → filepond-plugin-file-validate-type-D29vog-A.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BM279qcx.js → filepond-plugin-image-edit-BRA-418C.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-B-r1ML5w.js → filepond-plugin-image-exif-orientation-D49CRoKg.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DAvqUcPB.js → filepond-plugin-image-preview-CUf6Tmfs.js} +1 -1
- package/dist/cjs/{index-ClUdAQsW.js → index-BCqwgnTd.js} +1 -1
- package/dist/cjs/{index-B4KM1T_g.js → index-CkLnPQyE.js} +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down_2.cjs.entry.js +20 -7
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +35 -10
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-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-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +7 -3
- package/dist/cjs/salla-products-slider.cjs.entry.js +6 -2
- package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +30 -15
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-trust-badges.cjs.entry.js +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 +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DraU08VH.js → vanilla-picker-D0YMvIFq.js} +1 -1
- package/dist/collection/components/salla-gifting/salla-gifting.js +34 -9
- package/dist/collection/components/salla-product-card/salla-product-card.js +19 -6
- package/dist/collection/components/salla-products-list/salla-products-list.js +6 -2
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +5 -1
- package/dist/collection/components/salla-search/salla-search.css +13 -1
- package/dist/collection/components/salla-search/salla-search.js +48 -13
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/salla-gifting.js +34 -9
- package/dist/components/salla-product-card2.js +19 -6
- package/dist/components/salla-products-list2.js +6 -2
- package/dist/components/salla-products-slider2.js +5 -1
- package/dist/components/salla-search.js +30 -14
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/esm/{filepond-DAL4Xltg.js → filepond-Dv58WYPK.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-pYAj1TCf.js → filepond-plugin-file-poster-DhX_LabH.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size--DK_2h1f.js → filepond-plugin-file-validate-size-BSQTXY-0.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-CLv3B3w8.js → filepond-plugin-file-validate-type-BV2vkyMX.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-D_juTeqv.js → filepond-plugin-image-edit-COhLXxAR.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-D6SDimvg.js → filepond-plugin-image-exif-orientation-vGEGPdXW.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-EMuHdpX5.js → filepond-plugin-image-preview-DJJEZyfF.js} +1 -1
- package/dist/esm/{index-DM9YbL3Z.js → index-BVjoLf40.js} +1 -1
- package/dist/esm/{index-D0I6A6_z.js → index-DO8ZSWrC.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_3.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_4.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +11 -11
- package/dist/esm/salla-bullet-delivery.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down_2.entry.js +20 -7
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +35 -10
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-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-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +7 -3
- package/dist/esm/salla-products-slider.entry.js +6 -2
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +30 -15
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-trust-badges.entry.js +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 +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-Qqo0H_M-.js → vanilla-picker-CRoXEEbH.js} +1 -1
- package/dist/twilight/{p-a7501d0e.entry.js → p-066d24e3.entry.js} +1 -1
- package/dist/twilight/{p-bf22c662.entry.js → p-09866a6a.entry.js} +1 -1
- package/dist/twilight/{p-ac609ddd.entry.js → p-0db791ec.entry.js} +1 -1
- package/dist/twilight/{p-92cb89fe.entry.js → p-0f79691d.entry.js} +1 -1
- package/dist/twilight/{p-f8255074.entry.js → p-1181bf0b.entry.js} +1 -1
- package/dist/twilight/{p-8cd9364d.entry.js → p-1306b083.entry.js} +1 -1
- package/dist/twilight/{p-259053f2.entry.js → p-1a770914.entry.js} +1 -1
- package/dist/twilight/p-1b5d5a2d.entry.js +4 -0
- package/dist/twilight/{p-87dd72b9.entry.js → p-1d2eb48c.entry.js} +1 -1
- package/dist/twilight/{p-6f9b53cf.entry.js → p-1d9f0a8e.entry.js} +1 -1
- package/dist/twilight/{p-7177877e.entry.js → p-1f485253.entry.js} +1 -1
- package/dist/twilight/{p-ec4c5bdc.entry.js → p-1ff3ab59.entry.js} +1 -1
- package/dist/twilight/{p-d60c17d1.entry.js → p-20300661.entry.js} +1 -1
- package/dist/twilight/{p-91e8d1aa.entry.js → p-2093700f.entry.js} +1 -1
- package/dist/twilight/{p-a79a15bd.entry.js → p-23ed2044.entry.js} +1 -1
- package/dist/twilight/{p-078adc00.entry.js → p-2533c930.entry.js} +1 -1
- package/dist/twilight/{p-1124e117.entry.js → p-277149a3.entry.js} +1 -1
- package/dist/twilight/{p-6b360187.entry.js → p-2ca69eb5.entry.js} +1 -1
- package/dist/twilight/{p-b1f1e022.entry.js → p-2d72b610.entry.js} +1 -1
- package/dist/twilight/{p-d75f911d.entry.js → p-333b3f0c.entry.js} +1 -1
- package/dist/twilight/{p-f49fa6f4.entry.js → p-33d891a4.entry.js} +1 -1
- package/dist/twilight/{p-d7974589.entry.js → p-3a8a81b0.entry.js} +1 -1
- package/dist/twilight/p-3f211631.entry.js +4 -0
- package/dist/twilight/{p-1400a600.entry.js → p-4823b8bc.entry.js} +1 -1
- package/dist/twilight/p-4f83c6fa.entry.js +4 -0
- package/dist/twilight/{p-9303ae5e.entry.js → p-505f2ab8.entry.js} +1 -1
- package/dist/twilight/{p-c816e7ec.entry.js → p-51dcacbf.entry.js} +1 -1
- package/dist/twilight/{p-b23eb62e.entry.js → p-5e37d6c5.entry.js} +1 -1
- package/dist/twilight/{p-a71cc1ff.entry.js → p-60c93cb3.entry.js} +1 -1
- package/dist/twilight/{p-0a345a4f.entry.js → p-64d129cd.entry.js} +1 -1
- package/dist/twilight/p-67653c43.entry.js +4 -0
- package/dist/twilight/{p-7b6160d7.entry.js → p-6bd5d4de.entry.js} +1 -1
- package/dist/twilight/{p-797dfd7c.entry.js → p-6cf4f164.entry.js} +1 -1
- package/dist/twilight/{p-12d952ec.entry.js → p-732dfb48.entry.js} +1 -1
- package/dist/twilight/{p-f3267e09.entry.js → p-7abf75d6.entry.js} +1 -1
- package/dist/twilight/{p-5a5d50f6.entry.js → p-7ba45f07.entry.js} +1 -1
- package/dist/twilight/{p-beb81a94.entry.js → p-8a0c5a94.entry.js} +1 -1
- package/dist/twilight/{p-2ea4ee86.entry.js → p-8cfae1fb.entry.js} +1 -1
- package/dist/twilight/{p-d634d9ba.entry.js → p-90613df7.entry.js} +1 -1
- package/dist/twilight/{p-d3fd6daf.entry.js → p-90c6bb33.entry.js} +1 -1
- package/dist/twilight/{p-81d6ecf6.entry.js → p-944da1a0.entry.js} +1 -1
- package/dist/twilight/{p-d2019eac.entry.js → p-9aa75f51.entry.js} +1 -1
- package/dist/twilight/{p-CAvfXKfT.js → p-B7UokZmD.js} +1 -1
- package/dist/twilight/{p-CXIkjeL5.js → p-C5geWkhd.js} +1 -1
- package/dist/twilight/{p-Bm7PVfv2.js → p-C9AzkaPU.js} +1 -1
- package/dist/twilight/{p-k3_m9cjN.js → p-CUMwiyB2.js} +1 -1
- package/dist/twilight/{p-DscsSwIa.js → p-CuFlUm87.js} +1 -1
- package/dist/twilight/{p-D1zOfbCq.js → p-DJjUUwwe.js} +1 -1
- package/dist/twilight/{p-D0I6A6_z.js → p-DO8ZSWrC.js} +1 -1
- package/dist/twilight/{p-fhnRt3YI.js → p-DPHWpXVr.js} +2 -2
- package/dist/twilight/{p-m0atWUhZ.js → p-_e5z4vpX.js} +1 -1
- package/dist/twilight/{p-e756721e.entry.js → p-a14550ba.entry.js} +1 -1
- package/dist/twilight/{p-d532cc5c.entry.js → p-a33ecc4d.entry.js} +1 -1
- package/dist/twilight/{p-24c778de.entry.js → p-a6aa6c5b.entry.js} +1 -1
- package/dist/twilight/{p-95c07362.entry.js → p-a87756d8.entry.js} +1 -1
- package/dist/twilight/{p-049efeda.entry.js → p-abf88fe9.entry.js} +1 -1
- package/dist/twilight/{p-a7c29ab2.entry.js → p-af7e2568.entry.js} +1 -1
- package/dist/twilight/{p-8a3e1f56.entry.js → p-afe5ce03.entry.js} +1 -1
- package/dist/twilight/{p-84572940.entry.js → p-b166707a.entry.js} +1 -1
- package/dist/twilight/{p-191b61bc.entry.js → p-b56c127d.entry.js} +1 -1
- package/dist/twilight/{p-e0aa9527.entry.js → p-b70cf161.entry.js} +1 -1
- package/dist/twilight/{p-47d61973.entry.js → p-cead97fb.entry.js} +1 -1
- package/dist/twilight/{p-d69d9f88.entry.js → p-d1984ea3.entry.js} +1 -1
- package/dist/twilight/{p-3bc62efe.entry.js → p-d3d64095.entry.js} +1 -1
- package/dist/twilight/{p-ffcbf3a6.entry.js → p-dc47ca96.entry.js} +1 -1
- package/dist/twilight/{p-6a818aa8.entry.js → p-de778929.entry.js} +1 -1
- package/dist/twilight/{p-6202c3db.entry.js → p-e5ff81b4.entry.js} +1 -1
- package/dist/twilight/{p-e7ef6d17.entry.js → p-e6533b16.entry.js} +1 -1
- package/dist/twilight/{p-3accaca5.entry.js → p-e801da3a.entry.js} +1 -1
- package/dist/twilight/{p-755ab399.entry.js → p-e8ef633a.entry.js} +1 -1
- package/dist/twilight/{p-4b9b3e93.entry.js → p-ea6392d3.entry.js} +1 -1
- package/dist/twilight/{p-9ad56294.entry.js → p-eb6c1a49.entry.js} +1 -1
- package/dist/twilight/{p-165e1b7c.entry.js → p-ef7ddff4.entry.js} +1 -1
- package/dist/twilight/{p-3fd36e29.entry.js → p-f0a3769e.entry.js} +1 -1
- package/dist/twilight/{p-a8abd889.entry.js → p-f27e7def.entry.js} +1 -1
- package/dist/twilight/{p-c0d6fde8.entry.js → p-f61bdc96.entry.js} +1 -1
- package/dist/twilight/{p-e92f5e6d.entry.js → p-f6394d42.entry.js} +1 -1
- package/dist/twilight/{p-Dn05wIoL.js → p-jblAFAWg.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-gifting/intefaces.d.ts +1 -0
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +1 -0
- package/dist/types/components/salla-product-card/salla-product-card.d.ts +2 -0
- package/dist/types/components/salla-search/salla-search.d.ts +5 -1
- package/dist/types/components.d.ts +10 -0
- package/package.json +5 -5
- package/dist/twilight/p-503a47fc.entry.js +0 -4
- package/dist/twilight/p-a6db79a2.entry.js +0 -4
- package/dist/twilight/p-d40c12ca.entry.js +0 -4
- package/dist/twilight/p-f9542326.entry.js +0 -4
|
@@ -33,6 +33,7 @@ export class SallaGifting {
|
|
|
33
33
|
this.selectedText = undefined;
|
|
34
34
|
this.hasError = false;
|
|
35
35
|
this.timeZone = null;
|
|
36
|
+
this.receiverCountryCode = salla.config.get('store.scope.countries')?.[0] || salla.config.get('store.store_country') || 'SA';
|
|
36
37
|
this.hostId = `salla-gifting-${Math.random().toString(36).slice(2, 10)}`;
|
|
37
38
|
/**
|
|
38
39
|
* The form selector to be used to get the form data
|
|
@@ -284,18 +285,28 @@ export class SallaGifting {
|
|
|
284
285
|
this.selectedText = event.target.value;
|
|
285
286
|
this.customTextArea.classList.remove('s-form-has-error');
|
|
286
287
|
}
|
|
288
|
+
clearError(key) {
|
|
289
|
+
if (this.errors?.[key]) {
|
|
290
|
+
const { [key]: _, ...rest } = this.errors;
|
|
291
|
+
this.errors = rest;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
287
294
|
handleSenderName(event) {
|
|
288
295
|
this.senderName = event.target.value;
|
|
296
|
+
this.clearError('sender_name');
|
|
289
297
|
}
|
|
290
298
|
handleReceiverName(event) {
|
|
291
299
|
this.receiverName = event.target.value;
|
|
300
|
+
this.clearError('receiver.name');
|
|
292
301
|
}
|
|
293
302
|
handleReceiverCity(event) {
|
|
294
303
|
this.receiverCity = event.target.value;
|
|
304
|
+
this.clearError('receiver.city_id');
|
|
295
305
|
}
|
|
296
306
|
async handleCountryChange(event) {
|
|
297
307
|
const countryId = event.target.value;
|
|
298
308
|
this.selectedCountryId = countryId;
|
|
309
|
+
this.clearError('receiver.country');
|
|
299
310
|
// Find the selected country and store its country_code
|
|
300
311
|
const selectedCountry = this.gift?.countries?.find(country => country.id == countryId);
|
|
301
312
|
this.selectedCountryCode = selectedCountry?.country_code;
|
|
@@ -340,6 +351,7 @@ export class SallaGifting {
|
|
|
340
351
|
let phone = event.detail;
|
|
341
352
|
this.receiverMobile = phone.number;
|
|
342
353
|
this.receiverCountryCode = phone.country_code;
|
|
354
|
+
this.clearError('receiver.mobile');
|
|
343
355
|
}
|
|
344
356
|
handleDateTimePicker(event) {
|
|
345
357
|
this.deliveryDate = event.detail;
|
|
@@ -366,12 +378,24 @@ export class SallaGifting {
|
|
|
366
378
|
this.calendarFormGroup.classList.add('s-form-has-error');
|
|
367
379
|
return;
|
|
368
380
|
}
|
|
369
|
-
// Validate
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
381
|
+
// Validate required fields
|
|
382
|
+
const requiredFields = [
|
|
383
|
+
{ key: 'sender_name', value: this.senderName, label: this.senderNameLabel },
|
|
384
|
+
{ key: 'receiver.name', value: this.receiverName, label: this.receiverNameFieldLabel },
|
|
385
|
+
{ key: 'receiver.mobile', value: this.receiverMobile, label: this.receiverMobileFieldLabel },
|
|
386
|
+
...(this.physicalProducts ? [
|
|
387
|
+
{ key: 'receiver.country', value: this.selectedCountryId, label: this.receiverCountryFieldLabel },
|
|
388
|
+
{ key: 'receiver.city_id', value: this.receiverCity, label: this.receiverCityFieldLabel },
|
|
389
|
+
] : []),
|
|
390
|
+
];
|
|
391
|
+
const validationErrors = {};
|
|
392
|
+
requiredFields.forEach(({ key, value, label }) => {
|
|
393
|
+
if (!value) {
|
|
394
|
+
validationErrors[key] = salla.lang.get('common.errors.field_required', { attribute: label });
|
|
373
395
|
}
|
|
374
|
-
|
|
396
|
+
});
|
|
397
|
+
if (Object.keys(validationErrors).length) {
|
|
398
|
+
this.errors = validationErrors;
|
|
375
399
|
this.setWrapperHeight(2, 150, 0);
|
|
376
400
|
return;
|
|
377
401
|
}
|
|
@@ -384,8 +408,9 @@ export class SallaGifting {
|
|
|
384
408
|
donation_amount: donatingAmount ? donatingAmount : null,
|
|
385
409
|
receiver: {
|
|
386
410
|
name: this.receiverName,
|
|
387
|
-
|
|
411
|
+
mobile_country_code: this.receiverCountryCode,
|
|
388
412
|
mobile: this.receiverMobile,
|
|
413
|
+
...(this.physicalProducts && this.selectedCountryCode ? { country_code: this.selectedCountryCode } : {}),
|
|
389
414
|
...(this.receiverCity && this.physicalProducts ? { city_id: this.receiverCity } : {})
|
|
390
415
|
},
|
|
391
416
|
has_apple_pay: salla.helpers.hasApplePay(),
|
|
@@ -443,7 +468,7 @@ export class SallaGifting {
|
|
|
443
468
|
}
|
|
444
469
|
render() {
|
|
445
470
|
return [
|
|
446
|
-
h("div", { key: '
|
|
471
|
+
h("div", { key: 'ba5575020df2e6e1d72eadc5c15ffa2629a7e0f0' }, h("salla-list-tile", { key: '2be6a003eb1881b35001d184fe4e7d8b3a48bcc2', class: this.generateClass() }, h("div", { key: 'c1c9762462177aac3571c72608921fb3a71e0c1e', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: '6d25fe0684792b2b18c48b23c3a78fe1f428d371' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: '8943aeec88dd610d159b3ee09e7cf784bfb85057', slot: "subtitle" }, h("div", { key: '7e93b7590c04431344d940965f851e6c21565921' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '0b4c0390853b20e1cc1dcd63215d639f6da28d5b', slot: "action" }, h("salla-button", { key: '8597cbcfecfe87c4057a0712e78cf5c3ccea9b89', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: '48ee9b4c7fd63ae5d49acf137fb429292ade8fd7', name: "widget-btn-content" }, h("div", { key: '05681d9d1f8f99b0c8ac722fc4c49a0b7c9dfb7d', class: "s-gifting-widget-action-content" }, h("span", { key: '4c22063c0d47096166363bbf458ec2b57615bc6c', innerHTML: GiftSharing }), " \u00A0", h("span", { key: '2688bf6e45d28f6696e8581d745626ac749b30c6' }, this.sectionBtnText)))))), h("salla-modal", { key: '338ce16bd3c615b5a97d8bf09d1bd1fa6388194e', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: '33662376e8979c321fce3d2c01060881439bb652', slot: "loading" }, h("div", { key: 'ae3173d44990f7c2f41206f9ecd63dc1b30c2a1e', class: "s-gifting-skeleton" }, h("div", { key: 'dcab87f7a921763c0a52d122c2eb5b87aca41792', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'c41d6ced2a82554aeb7e36986111832bef6f1f0f', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: 'cbf4e6c3eccc896f4b2675f5877df055d5b884be', class: "s-gifting-modal-title" }, h("div", { key: '544134f67bdac37775af422cac9688c7975b0c4b', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: '62d175f4b42d24ded6f87f3af700af35febe108f', height: '15px', width: '150px' })))), h("div", { key: '7dc39034234bfb0e57cbbc2c395a639cd383a77b', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '5d73d76103a98cd477f4604c3408b6071434c2f5', height: '10px', width: '150px' }), h("salla-skeleton", { key: '477ee6bf604e799336e7c45f119cfcdbc23cb0ed', height: '230px' }), h("salla-skeleton", { key: 'b8c51be1f614081b900465e1445d726be5bb3d48', height: '10px', width: '150px' }), h("salla-skeleton", { key: '6dae16f42decbd267fa03b7a71103a32fe30e2b1', height: '30px' }), h("salla-skeleton", { key: '1b077b2a03c438446a0a9c115e2b61377fcbd542', height: '40px' })))), h("slot", { key: 'fb0253f4ca6c6e4cafd0c8496e94d0e6da37d748', name: "header" }), !!this.hasError ?
|
|
447
472
|
h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
|
|
448
473
|
:
|
|
449
474
|
[
|
|
@@ -454,12 +479,12 @@ export class SallaGifting {
|
|
|
454
479
|
: ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
|
|
455
480
|
this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
|
|
456
481
|
h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
|
|
457
|
-
h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.
|
|
482
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
|
|
458
483
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.physicalProducts &&
|
|
459
484
|
h("div", null, h("div", { class: this.errors && this.errors['receiver.country'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverCountryFieldLabel), h("select", { name: "country", class: "s-form-control", onChange: (event) => this.handleCountryChange(event), required: true }, h("option", { value: "" }, this.selectCountry), this.gift?.countries?.map((country) => (h("option", { value: country.id }, country.name)))), this.errors && this.errors['receiver.country'] ?
|
|
460
485
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''), h("div", { class: this.errors && this.errors['receiver.city_id'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverCityFieldLabel), h("select", { name: "city", "aria-label": salla.lang.get('blocks.buy_as_gift.select_city'), class: "s-form-control", onChange: (event) => this.handleReceiverCity(event), disabled: this.loadingCities }, h("option", { value: "", selected: true }, this.loadingCities ? salla.lang.get('common.elements.loading') : this.selectCity), this.gift?.cities?.map((city) => (h("option", { value: city.id }, city.name)))), this.errors && this.errors['receiver.city_id'] ?
|
|
461
486
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), h("div", { class: "s-gifting-info anime-item opacity-0" }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo))), !this.physicalProducts && h("div", { class: "anime-item opacity-0" }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
|
|
462
|
-
], h("slot", { key: '
|
|
487
|
+
], h("slot", { key: '8b69297ac7f9a527c12325a64a267825ea5ee48b', name: "footer" })))
|
|
463
488
|
];
|
|
464
489
|
}
|
|
465
490
|
static get is() { return "salla-gifting"; }
|
|
@@ -46,6 +46,19 @@ export class SallaProductCard {
|
|
|
46
46
|
}
|
|
47
47
|
this.wishlistBtn?.classList.toggle('s-product-card-wishlist-added', isAdded);
|
|
48
48
|
}
|
|
49
|
+
isInWishlist() {
|
|
50
|
+
return salla.storage.get('salla::wishlist', []).includes(this.productData?.id);
|
|
51
|
+
}
|
|
52
|
+
async handleWishlistClick() {
|
|
53
|
+
const wasInWishlist = this.isInWishlist();
|
|
54
|
+
this.toggleFavoriteIcon(!wasInWishlist);
|
|
55
|
+
try {
|
|
56
|
+
await salla.wishlist.toggle(this.productData.id);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
this.toggleFavoriteIcon(wasInWishlist);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
49
62
|
formatDate(date) {
|
|
50
63
|
let d = new Date(date);
|
|
51
64
|
return `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`;
|
|
@@ -92,14 +105,14 @@ export class SallaProductCard {
|
|
|
92
105
|
's-product-card-out-of-stock': this.productData?.is_out_of_stock,
|
|
93
106
|
};
|
|
94
107
|
const hrefProp = this.productData?.url ? { href: this.productData.url, title: `Learn more about ${this.productData?.name}` } : {};
|
|
95
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: 'af7d81ee7f9d8d56c5a8dd6092a57dc0e12cd6f4', id: `product-${this.productData?.id}`, class: classes }, h("div", { key: '31491a836d402261afee6c8d28b1600cc5b0b06d', class: !this.fullImage ? 's-product-card-image' : 's-product-card-image-full' }, h("a", { key: '18594836114d10d13a26b307b4dd30a399c2657f', ...hrefProp }, h("img", { key: '06ccf31c089968eec9cb87fbc8a308e178459577', class: `s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)
|
|
96
109
|
? 'contain'
|
|
97
110
|
: this.fitImageHeight
|
|
98
111
|
? this.fitImageHeight
|
|
99
|
-
: 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && h("a", { key: '
|
|
100
|
-
h("salla-button", { shape: "icon", fill: "none", color: "light", "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () =>
|
|
112
|
+
: 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && h("a", { key: 'a03cd8723f1511ab0c80b46a121f201d4b600670', ...hrefProp, class: "s-product-card-overlay" }), !this.horizontal && !this.fullImage ?
|
|
113
|
+
h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, h("span", { innerHTML: Heart })) : ''), h("div", { key: 'b918024efb5f4e650c16130045d4ac76f688c66b', class: "s-product-card-content" }, this.isSpecial && this.productData?.quantity ?
|
|
101
114
|
h("div", { class: "s-product-card-content-pie", ref: pie => this.pie = pie }, h("span", null, h("b", null, salla.helpers.number(this.productData?.quantity)), this.remained), h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -1 36 34", class: "s-product-card-content-pie-svg" }, h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-base" }), h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-bar" })))
|
|
102
|
-
: '', h("div", { key: '
|
|
115
|
+
: '', h("div", { key: '41b3d71085017bce419692aa01dce166b1fe31ab', class: { 's-product-card-content-main': true, 's-product-card-content-extra-padding': this.isSpecial } }, h("h3", { key: '0d1eaecd339554a1fcd1af6fd55f0edc94474d55', class: "s-product-card-content-title" }, h("a", { key: '203bf0b7fb32629982cbcce236095b8c3663b317', ...hrefProp }, this.productData?.name)), this.productData?.subtitle && !this.minimal ?
|
|
103
116
|
h("p", { class: "s-product-card-content-subtitle" }, this.productData?.subtitle)
|
|
104
117
|
: ''), this.productData?.donation && !this.minimal && !this.fullImage ?
|
|
105
118
|
[h("salla-progress-bar", { donation: this.productData?.donation }), h("div", { class: "s-product-card-donation-input" }, this.productData?.donation?.can_donate ?
|
|
@@ -108,13 +121,13 @@ export class SallaProductCard {
|
|
|
108
121
|
this.addBtn.donatingAmount = e.target.value;
|
|
109
122
|
}, id: "donation-amount", name: "donating_amount", class: "s-form-control", placeholder: this.donationAmount })]
|
|
110
123
|
: '')]
|
|
111
|
-
: '', h("div", { key: '
|
|
124
|
+
: '', h("div", { key: 'f15e29713c258337540bc7cbb3e16339a6e319ab', class: { 's-product-card-content-sub': true, 's-product-card-content-extra-padding': this.isSpecial } }, this.getProductPrice(), this.productData?.rating?.stars && !this.minimal ?
|
|
112
125
|
h("div", { class: "s-product-card-rating" }, h("span", { innerHTML: Star }), h("span", null, this.productData.rating.stars))
|
|
113
126
|
: ''), this.isSpecial && this.productData.discount_ends
|
|
114
127
|
? h("salla-count-down", { date: this.formatDate(this.productData.discount_ends), "end-of-day": true, boxed: true, labeled: true })
|
|
115
128
|
: '', !this.hideAddBtn && !this.compact ?
|
|
116
129
|
h("div", { class: "s-product-card-content-footer" }, h("salla-add-product-button", { fill: "outline", width: "wide", ref: el => this.addBtn = el, "product-id": this.productData.id, "product-status": this.productData.status, "product-type": this.productData.type }, h("slot", { name: "add-to-cart-label" }, this.productData.add_to_cart_label)), this.horizontal || this.fullImage ?
|
|
117
|
-
h("salla-button", { shape: "icon", fill: "none", color: "light", ref: el => this.wishlistBtn = el, "aria-label": "Add or remove to wishlist", class: "s-product-card-wishlist-btn animated", onClick: () =>
|
|
130
|
+
h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, ref: el => this.wishlistBtn = el, "aria-label": "Add or remove to wishlist", class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick(), "data-id": "{{ product.id }}" }, h("span", { class: "text-xl", innerHTML: Heart }))
|
|
118
131
|
: '')
|
|
119
132
|
: ''), !this.hideAddBtn && this.compact ?
|
|
120
133
|
h("div", { class: "s-product-card-content-footer" }, h("salla-add-product-button", { ref: el => this.addBtn = el, "product-id": this.productData.id, "product-status": this.productData.status, "product-type": this.productData.type, class: "s-add-product-button-compact" }, h("slot", { name: "add-to-cart-label" }, this.productData.add_to_cart_label)))
|
|
@@ -553,7 +553,11 @@ export class SallaProductsList {
|
|
|
553
553
|
}
|
|
554
554
|
getInitialData() {
|
|
555
555
|
this.loading();
|
|
556
|
-
return salla.
|
|
556
|
+
return salla.api.withoutNotifier(() => salla.product.api.fetch({
|
|
557
|
+
source: Helper.getApiSource(this.getSource()),
|
|
558
|
+
source_value: this.getSourceValue(),
|
|
559
|
+
limit: this.limit
|
|
560
|
+
}).then(async (response) => {
|
|
557
561
|
if (!response.data.length) {
|
|
558
562
|
this.showPlaceholder = true;
|
|
559
563
|
this.placeholderLoader && this.placeholderLoader.remove();
|
|
@@ -569,7 +573,7 @@ export class SallaProductsList {
|
|
|
569
573
|
return;
|
|
570
574
|
}
|
|
571
575
|
this.handleResponse(response).forEach(card => this.wrapper.append(card));
|
|
572
|
-
});
|
|
576
|
+
}));
|
|
573
577
|
}
|
|
574
578
|
async loadMore() {
|
|
575
579
|
this.infiniteScroll?.loadNextPage();
|
|
@@ -42,7 +42,11 @@ export class SallaProductsSlider {
|
|
|
42
42
|
this.isReady = false;
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
return salla.
|
|
45
|
+
return salla.api.withoutNotifier(() => salla.product.api.fetch({
|
|
46
|
+
source: Helper.getApiSource(this.getSource()),
|
|
47
|
+
source_value: this.getSourceValue(),
|
|
48
|
+
limit: this.limit
|
|
49
|
+
}))
|
|
46
50
|
.then(response => Helper.injectExtraFieldsToResponse(response))
|
|
47
51
|
.then(response => {
|
|
48
52
|
this.productsData = response.data;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Salla Search Component: Site search modal.
|
|
3
3
|
* You can use these classes to target the elements in the component.
|
|
4
|
-
*/
|
|
4
|
+
*/
|
|
5
|
+
.s-search-placeholder-wrapper {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: inline-block;
|
|
8
|
+
}
|
|
9
|
+
.s-search-input-wrapper {
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
.s-search-placeholder-trigger {
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
appearance: none;
|
|
15
|
+
text-align: start;
|
|
16
|
+
}
|
|
@@ -14,6 +14,10 @@ export class SallaSearch {
|
|
|
14
14
|
this.loading = false;
|
|
15
15
|
this.typing = false;
|
|
16
16
|
this.debounce = setTimeout(() => '', 1000);
|
|
17
|
+
/**
|
|
18
|
+
* Set the component to display as a placeholder (button) that will open the modal. Defaults to `false`
|
|
19
|
+
*/
|
|
20
|
+
this.placeholder = false;
|
|
17
21
|
/**
|
|
18
22
|
* Set the component display without modal window. Defaults to `false`
|
|
19
23
|
*/
|
|
@@ -34,7 +38,8 @@ export class SallaSearch {
|
|
|
34
38
|
* Show submit action buttons at the end.
|
|
35
39
|
*/
|
|
36
40
|
this.showAction = false;
|
|
37
|
-
this.productSlot =
|
|
41
|
+
this.productSlot =
|
|
42
|
+
this.host.querySelector('[slot="product"]')?.innerHTML || this.getDefaultProductSlot();
|
|
38
43
|
salla.event.on('search::open', () => this.open());
|
|
39
44
|
salla.lang.onLoaded(() => {
|
|
40
45
|
this.translationLoaded = true;
|
|
@@ -58,12 +63,12 @@ export class SallaSearch {
|
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
65
|
getDefaultProductSlot() {
|
|
61
|
-
return '<div class="s-search-product-image-container">' +
|
|
66
|
+
return ('<div class="s-search-product-image-container">' +
|
|
62
67
|
' <img class="s-search-product-image" src="{image}" alt="{name}"/>' +
|
|
63
68
|
'</div>' +
|
|
64
69
|
'<div class="s-search-product-details">' +
|
|
65
70
|
' <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div>' +
|
|
66
|
-
'</div>';
|
|
71
|
+
'</div>');
|
|
67
72
|
}
|
|
68
73
|
debounceSearch(event) {
|
|
69
74
|
this.typing = true;
|
|
@@ -105,12 +110,13 @@ export class SallaSearch {
|
|
|
105
110
|
this.noResults.style.display = 'none';
|
|
106
111
|
//run loading spinner or stop it
|
|
107
112
|
this.loading = true;
|
|
108
|
-
salla.product
|
|
113
|
+
salla.product
|
|
114
|
+
.fetch({ source: 'search', source_value: val })
|
|
109
115
|
.then(response => {
|
|
110
116
|
this.results = response;
|
|
111
117
|
salla.event.emit('Products Searched', val);
|
|
112
118
|
})
|
|
113
|
-
.catch(err => err !== 'Query is same as previous one!' ? this.results = undefined : null)
|
|
119
|
+
.catch(err => (err !== 'Query is same as previous one!' ? (this.results = undefined) : null))
|
|
114
120
|
.finally(() => this.afterSearching(/*isEmpty*/ false));
|
|
115
121
|
}
|
|
116
122
|
afterSearching(isEmpty = true) {
|
|
@@ -121,16 +127,25 @@ export class SallaSearch {
|
|
|
121
127
|
this.inputValue.length < 3 ? this.container.classList.remove('s-search-no-results') : '';
|
|
122
128
|
}
|
|
123
129
|
render() {
|
|
124
|
-
const searchContent = h("div", { key: '
|
|
125
|
-
|
|
130
|
+
const searchContent = (h("div", { key: '25857ea8c54c56875ed665e9163db0b0dfc23d48', class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => (this.container = container) }, h("div", { key: '2d75789cec346377f1ad6e27605868a747f57ec0', class: "s-search-input-wrapper" }, h("span", { key: '68f3d318d8a1a54aff7da564f571bb7e1521d600', class: "s-search-icon-wrap" }, h("span", { key: '479b33adc20e2e6c34eff5fda4e303bfae16e445', class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { key: '4577ea9dbec8175e52603a0934a2d6f22aa26a02', type: "search", enterkeyhint: "search", autocomplete: "off", class: "s-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder'), onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), ref: input => (this.searchInput = input), style: {
|
|
131
|
+
height: this.height + 'px',
|
|
132
|
+
borderRadius: this.oval ? this.height / 2 + 'px' : '',
|
|
133
|
+
} }), this.showAction ? (h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search }))) : null), h("div", { key: '0607676854eefa6966ec38c0d2e6dd5a3c6423bb', class: "s-search-results" }, this.results?.data.map(product => (h("a", { href: product.url + '?from=search-bar', class: {
|
|
134
|
+
's-search-product': true,
|
|
135
|
+
's-search-product-not-available': !product.is_available,
|
|
136
|
+
}, innerHTML: this.productSlot
|
|
126
137
|
.replace(/\{name\}/g, product.name)
|
|
127
138
|
.replace(/\{price\}/g, product.price ? salla.money(product.price) : '')
|
|
128
|
-
.replace(/\{regular_price\}/g, product.is_on_sale && product.regular_price
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
.replace(/\{regular_price\}/g, product.is_on_sale && product.regular_price
|
|
140
|
+
? salla.money(product.regular_price)
|
|
141
|
+
: '')
|
|
142
|
+
.replace(/\{image\}/g, product.image.url) }))), h("p", { key: '7136791cf4dc3d523cdba41367bd7691fd4ad9ba', ref: el => (this.noResults = el), class: "s-search-no-results-placeholder" }, salla.lang.get('common.elements.no_options')))));
|
|
143
|
+
const modalContent = (h("salla-modal", { key: 'ec8705a09e4993459d92569a5b71836cb0acefd8', position: "top", class: "s-search-modal", ref: modal => (this.modal = modal) }, searchContent));
|
|
144
|
+
const placeholderContent = (h("div", { key: '19b7e1c22e3a40c780eff0c74a23413f089ec96b', class: "s-search-placeholder-wrapper s-search-inline" }, h("div", { key: 'd87fc19fce928f230edb427e952903262a9ba32c', class: "s-search-input-wrapper" }, h("span", { key: '6475d41b267a2b35027016b5de474463cc7e6055', class: "s-search-icon-wrap" }, h("span", { key: 'e6ebac28c76a8a9824188da7ad2c290db610094f', class: "s-search-icon", innerHTML: Search })), h("button", { key: '3d7db311a4c348d4baaf1cb50eb5a0ed7953b28e', type: "button", class: "s-search-input s-search-placeholder-trigger", onClick: () => this.open(), style: {
|
|
145
|
+
height: this.height + 'px',
|
|
146
|
+
borderRadius: this.oval ? this.height / 2 + 'px' : '',
|
|
147
|
+
} }, salla.lang.get('blocks.header.search_placeholder'))), modalContent));
|
|
148
|
+
return this.placeholder ? (placeholderContent) : this.inline ? (h("div", { class: "s-search-modal" }, searchContent)) : (modalContent);
|
|
134
149
|
}
|
|
135
150
|
/**
|
|
136
151
|
* Run it one time after load
|
|
@@ -152,6 +167,26 @@ export class SallaSearch {
|
|
|
152
167
|
}
|
|
153
168
|
static get properties() {
|
|
154
169
|
return {
|
|
170
|
+
"placeholder": {
|
|
171
|
+
"type": "boolean",
|
|
172
|
+
"attribute": "placeholder",
|
|
173
|
+
"mutable": false,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "boolean",
|
|
176
|
+
"resolved": "boolean",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "Set the component to display as a placeholder (button) that will open the modal. Defaults to `false`"
|
|
184
|
+
},
|
|
185
|
+
"getter": false,
|
|
186
|
+
"setter": false,
|
|
187
|
+
"reflect": false,
|
|
188
|
+
"defaultValue": "false"
|
|
189
|
+
},
|
|
155
190
|
"inline": {
|
|
156
191
|
"type": "boolean",
|
|
157
192
|
"attribute": "inline",
|
|
@@ -22,7 +22,7 @@ export class SallaSkeleton {
|
|
|
22
22
|
's-skeleton-item': true,
|
|
23
23
|
's-skeleton-item-circular': this.type == 'circle',
|
|
24
24
|
};
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '0d85a5f753c250b1acacb0dea809879a549d8d12', class: "s-skeleton-wrapper", style: { width: this.width, height: this.height } }, h("div", { key: '80c3b2555be6c0fef7794bb184c919d4be2bdf24', class: classes }, "\u00A0")));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "salla-skeleton"; }
|
|
28
28
|
static get originalStyleUrls() {
|
|
@@ -31,7 +31,7 @@ export class SallaSocial {
|
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
33
|
const linksArray = this.getLinksArray();
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '63d306c569080a2719d6e2731dc5fe0d6b8f77f4' }, h("ul", { key: '12c71e69359695da6c2ab3f607973b314c639e1e', class: "s-social-list" }, linksArray.map((link) => (h("li", { class: "s-social-link" }, h("div", { id: "social-slot", innerHTML: this.socialSlot
|
|
35
35
|
.replace(/\{icon\}/g, this.iconsList[link.type])
|
|
36
36
|
.replace(/\{type\}/g, link.type)
|
|
37
37
|
.replace(/\{link\}/g, link.value.toString()) })))))));
|
|
@@ -122,7 +122,7 @@ export class SallaSocialShare {
|
|
|
122
122
|
window.a2a?.init('page');
|
|
123
123
|
}
|
|
124
124
|
render() {
|
|
125
|
-
return (h("div", { key: '
|
|
125
|
+
return (h("div", { key: 'ce2897e4cac7940407f6466a0eb4b2ff9fab3236', class: "s-social-share-wrapper" }, h("slot", { key: 'a0d4beebb29febd203d619845223c4e62b6b9c21', name: 'widget' }, h("salla-button", { key: '8615149ec0475bafc2f94d4b0bacfd49048d112f', "aria-label": "Share", onClick: () => this.open(), class: "s-social-share-btn", shape: "icon", fill: "outline", color: "light" }, h("span", { key: '187e9aa3194eedafd1355fc3e79db1118e21050f', innerHTML: this.opened ? Cancel : ShareAlt }))), h("ul", { key: '7a1192bbf8e39d7fa101deae229949cc730aff0b', ref: el => this.shareMenu = el, class: "s-social-share-list a2a_kit share", "data-a2a-url": this.url ? this.url : window.location.href, "data-a2a-title": this.urlName ? this.urlName : document.title }, this.platforms.split(',').map(platform => {
|
|
126
126
|
return (h("li", null, h("a", { class: `a2a_button_${platform}`, "aria-label": `Share Via ${platform}` }, this.platformIcons.map((icon) => {
|
|
127
127
|
if (icon.name === platform) {
|
|
128
128
|
return h("span", { class: "s-social-share-icon", innerHTML: icon.icon });
|
|
@@ -30,7 +30,7 @@ export class SallaTabContent {
|
|
|
30
30
|
's-tabs-content': true,
|
|
31
31
|
's-tabs-content-selected': this.isSelected
|
|
32
32
|
};
|
|
33
|
-
return (h("div", { key: '
|
|
33
|
+
return (h("div", { key: '6272014593c424e20e4fc9cc2c59dc5c4bd1abc1', class: classes }, h("slot", { key: 'd7a3c32021cc14da0d895b5830c0cf3c8a047529' })));
|
|
34
34
|
}
|
|
35
35
|
static get is() { return "salla-tab-content"; }
|
|
36
36
|
static get originalStyleUrls() {
|
|
@@ -52,7 +52,7 @@ export class SallaTabHeader {
|
|
|
52
52
|
's-tabs-active': this.isSelected,
|
|
53
53
|
};
|
|
54
54
|
return [
|
|
55
|
-
h("div", { key: '
|
|
55
|
+
h("div", { key: '5ac0d60331466d359ff0ba59d7702b177c96d95b', class: classes, onClick: this.onClick.bind(this) }, h("slot", { key: 'dc8ed7ec638ba1c24b355eedc831c67ab15ded62' })),
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
static get is() { return "salla-tab-header"; }
|
|
@@ -50,7 +50,7 @@ export class SallaTabs {
|
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
52
|
return [
|
|
53
|
-
h("div", { key: '
|
|
53
|
+
h("div", { key: '32051cc4308a49527f424d2bd0ce42a1ae25b8d4', class: "s-tabs" }, h("div", { key: '5d99d5835d8f3686f38a51f2eb049887d9f7229b', class: "s-tabs-header" }, h("slot", { key: '5b78f92eb7ffe9ad56c235415ae4ea93b0ed3c1d', name: "header" })), h("div", { key: '8979a8c600d60ed79ae8ebb6894754ab3ab7be97', class: "s-tabs-content-wrapper" }, h("slot", { key: '629a4e9b7934a0074a6e7579645e08e0b37c7e61', name: "content" })))
|
|
54
54
|
];
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "salla-tabs"; }
|
|
@@ -123,7 +123,7 @@ export class SallaTelInput {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
render() {
|
|
126
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: 'd48f549012efc0bc465bd7da8bd5693506514d25', class: "s-tel-input" }, h("input", { key: '04fa4306973163688b74effbbbd8838b39deb6ad', type: "tel", disabled: this.disabled, name: this.name, value: this.phone, onChange: (event) => this.handleCountryInput(event), ref: el => this.phoneInput = el, enterkeyhint: "next", autocomplete: "tel", class: "s-tel-input-control tel-input s-ltr" }), h("span", { key: '9ae2ddda777dfc2672756f8a6ada215169c1b486', class: "s-tel-input-error-msg", ref: el => this.errorMsg = el }), h("input", { key: '83961dde155948b5bfe9030575a084470d707442', type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" })));
|
|
127
127
|
}
|
|
128
128
|
componentDidLoad() {
|
|
129
129
|
this.initTelInput();
|
|
@@ -27,7 +27,7 @@ export class SallaTooltip {
|
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
29
|
const validTheme = ['default', 'dark'].includes(this.theme) ? this.theme : 'default';
|
|
30
|
-
return (h("div", { key: '
|
|
30
|
+
return (h("div", { key: '52b272aea520c20cdd3a46847a003c5acd099ba7', class: "s-tooltip-container" }, h("div", { key: 'b7b5663370e9c5976ffeac9325e7c871156244d1', class: `s-tooltip-item s-tooltip-item--${validTheme}`, style: { display: this.show ? 'block' : 'none' } }, this.text ? h("span", null, this.text) : h("slot", null))));
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "salla-tooltip"; }
|
|
33
33
|
static get originalStyleUrls() {
|
|
@@ -56,7 +56,7 @@ export class SallaUserSettings {
|
|
|
56
56
|
await salla.profile.delete().finally(() => this.confirmationModal.close());
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '7ebde1b251239daf505e3ed7460d8bd21eefcb1c', class: "s-user-settings-wrapper" }, this.canHideName && h("div", { key: 'ba44ce4314ef6df6a85227e5f7db5428f63c0dde', class: "s-user-settings-section" }, h("salla-list-tile", { key: 'ae83ddc78aa668dc44ae9c32001d401b051c6503' }, h("div", { key: 'da59b1543b7d0352505db2146579183abc57d4ac', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '95999a4a02fe57158473d64847d2ad861b79384c', innerHTML: UserCancel })), h("div", { key: '416e8c839f0ee9c89ca725829594c75c7baa7b49', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.hideMyName)), h("div", { key: '798935472d17bc427990eb0d4cb1f3172ef7c244', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.hideMyNameDesc)), h("div", { key: 'bd455f1375fa73e4dde76075f4e18dd55a7ae859', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '9148274bf7a0faccbe282531107882c072e4e918', class: "s-toggle" }, h("input", { key: 'ed079fe4e696edb5ca1e3ef2ff594a787a2030c4', class: "s-toggle-input", checked: this.isHiddenName, onChange: (e) => this.toggleSetting('is_hidden_name', e), type: "checkbox" }), h("div", { key: '1ab8d7680e75a743ab7c92bc533dd3466e00d6bc', class: "s-toggle-switcher" }))))), h("div", { key: 'e2beb47cd5983c0d499b44d24e2abdfd7d3bc932', class: "s-user-settings-section" }, h("salla-list-tile", { key: '15dc8a7e21faeaedb6a8b12093959d0dca89cc6a' }, h("div", { key: '2e2633ced498512feaf9af090eb2554190a6601c', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: 'c25d328af60bdb56af88a5783ebed45a9ab662d5', innerHTML: Bullhorn })), h("div", { key: '26a2262d700f6326acfd23455c36ccb0bbc30c90', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.promotionalMsgs)), h("div", { key: '5a86ab74e912a2eb8ef618c8c2a0fce9635e21ab', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.promotionalMsgsDesc)), h("div", { key: 'fce21eb942724cd3e662d1fa28998dd569800807', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '2d5c5fe21af1b7b4618d568aac807477377456b9', class: "s-toggle" }, h("input", { key: '6141b9aee3d7f08c1614e18622734c985f00698d', class: "s-toggle-input", checked: this.isNotifiable, onChange: (e) => this.toggleSetting('is_notifiable', e), type: "checkbox" }), h("div", { key: 'bb1d05fa73a6a2683fd13bbfcfda9c6da33eec5c', class: "s-toggle-switcher" }))))), h("div", { key: '725a865983025acca1fc7e38aa8ca242977e0cec', class: "s-user-settings-section s-user-settings-section-deactivate-user" }, h("salla-list-tile", { key: 'f78022f0df1fa056218cc04f634020c91e13a1de' }, h("div", { key: '0e64bb2523b466f01c73392104f433ede50d5511', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '96a246978ddc161debca6a33ca9b33c76a28c671', innerHTML: UserOff })), h("div", { key: '1b9e41414830b0d08524517959a316c410b0263e', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.deactivateAccount)), h("div", { key: '23baf125e4c2f93185ce23c0e75b1cdf8218bddf', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.deactivateDesc)), h("div", { key: 'c8d12d145ebc670fd43843682983c3a7ee9fd2c2', slot: 'action', class: "s-user-settings-section-action" }, h("salla-button", { key: '94eede53889d66f641dd24492c38d2350b0901c8', fill: "outline", color: "danger", shape: "btn", size: "medium", width: "normal", onClick: () => this.openDeactivateModal() }, this.capitalizeText(this.deactivateAccount))))), h("salla-modal", { key: '6e6132d1d2fef544b5c504c66bc8dd84aba2a3a4', width: "sm", subTitle: this.capitalizeText(this.sorryForLeavingText), ref: modal => this.confirmationModal = modal }, h("span", { key: '914742e0cb4b2b089e56c7139f2cbd4c677da85c', slot: 'icon', class: "s-user-settings-confirmation-icon", innerHTML: UserOff }), h("div", { key: '1980c63604f16ea75fafa9f3889ca29441a02e42', class: "s-user-settings-confirmation" }, h("div", { key: '82deb3934516d6132dcc006b7fde1937838b201b', class: "s-user-settings-confirmation-warning" }, this.capitalizeText(this.warningText)), h("div", { key: '7219b0aec0f4e3c6a269f476623929d1d993a754', class: "s-user-settings-confirmation-actions" }, h("salla-button", { key: '6e5421e168e6c2b1fd04842b98e57e9bfd13c018', width: "wide", onClick: () => this.confirmationModal.close() }, this.capitalizeText(this.keepAccount)), h("salla-button", { key: 'b44fa27e4afee3cadb52c39286f6130d1f6eb2a8', fill: 'outline', loading: this.buttonLoading, width: "wide", onClick: () => this.deleteAccount() }, this.capitalizeText(this.deactivateAccount)))))));
|
|
60
60
|
}
|
|
61
61
|
static get is() { return "salla-user-settings"; }
|
|
62
62
|
static get originalStyleUrls() {
|