@salla.sa/twilight-components 2.14.353 → 2.14.354
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/bell-ring-BfKPinNo.js +13 -0
- package/dist/cjs/{interfaces-CX9-6aLf.js → camera-DytepEoK.js} +0 -11
- package/dist/cjs/cancel-De6vslRA.js +13 -0
- package/dist/cjs/cart-s-x1Fshk.js +13 -0
- package/dist/cjs/check-circle2-BDvlT4_n.js +13 -0
- package/dist/cjs/{check-CLRvuniI.js → check-x3w3-gpj.js} +2 -2
- package/dist/cjs/{filepond-7SxqaoXb.js → filepond-CuKErtOy.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DwIv84hN.js → filepond-plugin-file-poster-d-8BSuST.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-NUNnIo4Q.js → filepond-plugin-file-validate-size-zgI_JcqY.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CXI-hfww.js → filepond-plugin-file-validate-type-Cy8IgG2P.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-fBeBGIBb.js → filepond-plugin-image-edit-9ZAUzCvh.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BmLTdQ6d.js → filepond-plugin-image-exif-orientation-DzNe_tY2.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CssKRM6n.js → filepond-plugin-image-preview-Cfna6xTB.js} +1 -1
- package/dist/{esm/gift-C0JNGIpa.js → cjs/gift-CJ-3Yw_x.js} +4 -2
- package/dist/cjs/image-BoZ6Hums.js +13 -0
- package/dist/cjs/{index-B5soIVRX.js → index-Ce40E8tZ.js} +136 -12
- package/dist/cjs/{index-B9TEdQDE.js → index-ff-xJfhj.js} +1 -1
- package/dist/cjs/interfaces-CRqrf5RX.js +15 -0
- package/dist/cjs/keyboard_arrow_down-DHJ3FFZq.js +13 -0
- package/dist/cjs/keyboard_arrow_right-BayM_Il2.js +21 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/minus-CCryh1qf.js +21 -0
- package/dist/cjs/salla-accordion-body_3.cjs.entry.js +775 -0
- package/dist/cjs/salla-accordion_6.cjs.entry.js +768 -0
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +2389 -0
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +194 -0
- 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 +1565 -0
- package/dist/cjs/{salla-cart-item-offers.cjs.entry.js → salla-cart-item-offers_2.cjs.entry.js} +104 -5
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +1661 -0
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- package/dist/cjs/salla-count-down_2.cjs.entry.js +302 -0
- package/dist/cjs/salla-custom-fields.cjs.entry.js +4 -3
- 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 +488 -0
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +91 -0
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +34 -0
- package/dist/cjs/salla-localization-modal.cjs.entry.js +137 -0
- package/dist/cjs/salla-login-modal.cjs.entry.js +320 -0
- 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.cjs.entry.js +211 -0
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +40 -0
- package/dist/cjs/salla-menu.cjs.entry.js +139 -0
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +220 -0
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +598 -0
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +69 -0
- 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 +206 -0
- 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 +3 -3
- 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 +51 -0
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +66 -0
- package/dist/cjs/salla-products-list.cjs.entry.js +762 -0
- package/dist/cjs/salla-products-slider.cjs.entry.js +115 -0
- package/dist/cjs/salla-progress-bar.cjs.entry.js +73 -0
- package/dist/cjs/salla-quick-order.cjs.entry.js +239 -0
- package/dist/cjs/salla-rating-modal.cjs.entry.js +453 -0
- package/dist/cjs/salla-scopes.cjs.entry.js +180 -0
- package/dist/cjs/salla-search.cjs.entry.js +153 -0
- package/dist/cjs/salla-skeleton.cjs.entry.js +36 -0
- package/dist/cjs/salla-slider.cjs.entry.js +10389 -0
- package/dist/cjs/salla-social-share.cjs.entry.js +165 -0
- package/dist/cjs/salla-social.cjs.entry.js +3 -3
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +157 -0
- 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 +275 -0
- package/dist/cjs/salla-user-profile.cjs.entry.js +145 -0
- package/dist/cjs/salla-user-settings.cjs.entry.js +88 -0
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/search-c7Aa7lM9.js +13 -0
- package/dist/cjs/{special-discount-OVG_9Kf9.js → special-discount-DC2oXurL.js} +0 -8
- package/dist/cjs/star-DGcH7Yso.js +13 -0
- package/dist/cjs/star2-R146a27p.js +13 -0
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-C6fk8_TR.js → vanilla-picker-zQsXQIff.js} +1 -1
- package/dist/cjs/{whatsapp2-D7Sbg8Ey.js → whatsapp2-BdMd5Gx1.js} +2 -2
- package/dist/collection/collection-manifest.json +55 -1
- package/dist/collection/components/salla-product-options/salla-product-options.js +36 -3
- package/dist/components/index.js +2 -2
- package/dist/components/salla-product-options2.js +19 -2
- package/dist/esm/bell-ring-D3mWkc-3.js +11 -0
- package/dist/esm/{interfaces-CBT_Nxny.js → camera-C6jIkM-X.js} +1 -12
- package/dist/esm/cancel-BsLF_HK7.js +11 -0
- package/dist/esm/cart-DY4LZmNP.js +11 -0
- package/dist/esm/{check-uTyAzPSy.js → check-BsXh13x8.js} +2 -2
- package/dist/esm/check-circle2-BV4kqbdL.js +11 -0
- package/dist/esm/{filepond-Cuqyleyy.js → filepond-DEzyRrdH.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-C6Wara8q.js → filepond-plugin-file-poster-DyLcCcHM.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-D-M3KSxo.js → filepond-plugin-file-validate-size-Cxp5Yzea.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DzAl1VI8.js → filepond-plugin-file-validate-type-D2qNOQP4.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-flutfc9I.js → filepond-plugin-image-edit-DndTlA7m.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-B2UkG6iE.js → filepond-plugin-image-exif-orientation-CiT1CQoK.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-B4u8N2nE.js → filepond-plugin-image-preview-DBG7keFZ.js} +1 -1
- package/dist/{cjs/gift-BPDUPIY_.js → esm/gift-BChI23pG.js} +2 -4
- package/dist/esm/image-C-tzSDxw.js +11 -0
- package/dist/esm/{index-6mr785rH.js → index-B74h9G6a.js} +137 -13
- package/dist/esm/{index-xWIb6INF.js → index-BLw7mdtM.js} +1 -1
- package/dist/esm/interfaces-OF8QcbMM.js +15 -0
- package/dist/esm/keyboard_arrow_down-DCZbpt2a.js +11 -0
- package/dist/esm/keyboard_arrow_right-Vqpj4CWE.js +18 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/minus-DfeagqF1.js +18 -0
- package/dist/esm/salla-accordion-body_3.entry.js +771 -0
- package/dist/esm/salla-accordion_6.entry.js +761 -0
- package/dist/esm/salla-add-product-button_4.entry.js +2384 -0
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +191 -0
- 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 +1539 -0
- package/dist/esm/{salla-cart-item-offers.entry.js → salla-cart-item-offers_2.entry.js} +104 -6
- package/dist/esm/salla-comment-form_8.entry.js +1652 -0
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +3 -3
- package/dist/esm/salla-count-down_2.entry.js +299 -0
- package/dist/esm/salla-custom-fields.entry.js +3 -2
- 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 +486 -0
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +89 -0
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +32 -0
- package/dist/esm/salla-localization-modal.entry.js +135 -0
- package/dist/esm/salla-login-modal.entry.js +318 -0
- 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.entry.js +209 -0
- package/dist/esm/salla-maintenance-alert.entry.js +38 -0
- package/dist/esm/salla-menu.entry.js +137 -0
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +217 -0
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +595 -0
- package/dist/esm/salla-multiple-bundle-product.entry.js +67 -0
- 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 +204 -0
- 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 +3 -3
- 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 +49 -0
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +64 -0
- package/dist/esm/salla-products-list.entry.js +760 -0
- package/dist/esm/salla-products-slider.entry.js +113 -0
- package/dist/esm/salla-progress-bar.entry.js +71 -0
- package/dist/esm/salla-quick-order.entry.js +237 -0
- package/dist/esm/salla-rating-modal.entry.js +451 -0
- package/dist/esm/salla-scopes.entry.js +178 -0
- package/dist/esm/salla-search.entry.js +151 -0
- package/dist/esm/salla-skeleton.entry.js +34 -0
- package/dist/esm/salla-slider.entry.js +10387 -0
- package/dist/esm/salla-social-share.entry.js +163 -0
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +153 -0
- 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 +273 -0
- package/dist/esm/salla-user-profile.entry.js +143 -0
- package/dist/esm/salla-user-settings.entry.js +86 -0
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/search-BscTeWDc.js +11 -0
- package/dist/esm/{special-discount-yRO-ZESF.js → special-discount-Ctkfc4K-.js} +1 -8
- package/dist/esm/star-ZT7ehBBk.js +11 -0
- package/dist/esm/star2-D4oPi1Ov.js +11 -0
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-B4PKRAhm.js → vanilla-picker-CtwkXTap.js} +1 -1
- package/dist/esm/{whatsapp2-DWksgowB.js → whatsapp2-CgR-T_ZS.js} +2 -2
- package/dist/twilight/{p-2a26c1d6.entry.js → p-0134b4fd.entry.js} +1 -1
- package/dist/twilight/{p-d4aaeef4.entry.js → p-01daaaa6.entry.js} +1 -1
- package/dist/twilight/p-07da7390.entry.js +4 -0
- package/dist/twilight/{p-81702ecb.entry.js → p-08badc32.entry.js} +1 -1
- package/dist/twilight/{p-4bc98557.entry.js → p-0aa5a12a.entry.js} +1 -1
- package/dist/twilight/{p-6f576591.entry.js → p-10dcd981.entry.js} +1 -1
- package/dist/twilight/{p-5067322a.entry.js → p-212a0710.entry.js} +1 -1
- package/dist/twilight/p-229275db.entry.js +4 -0
- package/dist/twilight/{p-dde21f4b.entry.js → p-232185ec.entry.js} +1 -1
- package/dist/twilight/{p-12e49031.entry.js → p-2a927eac.entry.js} +1 -1
- package/dist/twilight/p-2d880232.entry.js +4 -0
- package/dist/twilight/p-2de9df64.entry.js +4 -0
- package/dist/twilight/p-309a0ba4.entry.js +4 -0
- package/dist/twilight/{p-e909d28b.entry.js → p-32732ca7.entry.js} +1 -1
- package/dist/twilight/{p-19e07b9e.entry.js → p-32ca34ec.entry.js} +1 -1
- package/dist/twilight/{p-9946fa76.entry.js → p-33093880.entry.js} +1 -1
- package/dist/twilight/p-3cffa4c9.entry.js +4 -0
- package/dist/twilight/p-3d0bb451.entry.js +4 -0
- package/dist/twilight/p-3e0d814c.entry.js +4 -0
- package/dist/twilight/p-4036d5dc.entry.js +4 -0
- package/dist/twilight/p-40fe4b01.entry.js +4 -0
- package/dist/twilight/p-47ac0ca5.entry.js +4 -0
- package/dist/twilight/{p-5bf05092.entry.js → p-4cd9da44.entry.js} +1 -1
- package/dist/twilight/p-5c9281d3.entry.js +4 -0
- package/dist/twilight/p-5d044466.entry.js +4 -0
- package/dist/twilight/p-5d21334a.entry.js +4 -0
- package/dist/twilight/{p-c096e336.entry.js → p-654429df.entry.js} +1 -1
- package/dist/twilight/p-6b8453be.entry.js +4 -0
- package/dist/twilight/p-6be7bbb0.entry.js +4 -0
- package/dist/twilight/{p-4253fc44.entry.js → p-6c8f5c94.entry.js} +1 -1
- package/dist/twilight/{p-6f5d02c6.entry.js → p-6fa02770.entry.js} +1 -1
- package/dist/twilight/p-7040ea33.entry.js +4 -0
- package/dist/twilight/p-8c189d76.entry.js +4 -0
- package/dist/twilight/p-8f1f052c.entry.js +4 -0
- package/dist/twilight/{p-ac6fc286.entry.js → p-9051a540.entry.js} +1 -1
- package/dist/twilight/p-9f1c561f.entry.js +4 -0
- package/dist/twilight/{p-B2SkkGH8.js → p-B69XOH6h.js} +1 -1
- package/dist/twilight/{p-6mr785rH.js → p-B74h9G6a.js} +2 -2
- package/dist/twilight/{p-C0JNGIpa.js → p-BChI23pG.js} +1 -1
- package/dist/twilight/{p-C_h1JDCU.js → p-BCxm-ISm.js} +1 -1
- package/dist/twilight/{p-Bp_xKTyn.js → p-BPqZ249Z.js} +1 -1
- package/dist/twilight/p-BV4kqbdL.js +4 -0
- package/dist/twilight/p-BsLF_HK7.js +4 -0
- package/dist/twilight/{p-uTyAzPSy.js → p-BsXh13x8.js} +1 -1
- package/dist/twilight/p-BscTeWDc.js +4 -0
- package/dist/twilight/p-C-tzSDxw.js +4 -0
- package/dist/twilight/p-C6jIkM-X.js +4 -0
- package/dist/twilight/p-CO-PeZ27.js +4 -0
- package/dist/twilight/{p-ChfiVIJv.js → p-CQq81yb5.js} +1 -1
- package/dist/twilight/{p-DWksgowB.js → p-CgR-T_ZS.js} +1 -1
- package/dist/twilight/p-Ctkfc4K-.js +4 -0
- package/dist/twilight/p-D3mWkc-3.js +4 -0
- package/dist/twilight/p-D4oPi1Ov.js +4 -0
- package/dist/twilight/p-DCZbpt2a.js +4 -0
- package/dist/twilight/p-DY4LZmNP.js +4 -0
- package/dist/twilight/p-DfeagqF1.js +4 -0
- package/dist/twilight/{p-Cuxsz9f-.js → p-DpsbV3x1.js} +1 -1
- package/dist/twilight/p-OF8QcbMM.js +4 -0
- package/dist/twilight/p-Vqpj4CWE.js +4 -0
- package/dist/twilight/p-ZT7ehBBk.js +4 -0
- package/dist/twilight/{p-tFBCbVoG.js → p-_-aXm0Wb.js} +1 -1
- package/dist/twilight/p-a100bd38.entry.js +4 -0
- package/dist/twilight/{p-0c87ef6c.entry.js → p-a2756650.entry.js} +1 -1
- package/dist/twilight/{p-8b018d82.entry.js → p-aab45a16.entry.js} +1 -1
- package/dist/twilight/p-aae761ff.entry.js +4 -0
- package/dist/twilight/p-afd61e47.entry.js +4 -0
- package/dist/twilight/p-b1fc6dfc.entry.js +4 -0
- package/dist/twilight/p-b206a0a1.entry.js +4 -0
- package/dist/twilight/p-b2332516.entry.js +4 -0
- package/dist/twilight/{p-18ebec2c.entry.js → p-b588ef46.entry.js} +1 -1
- package/dist/twilight/p-b71fc1b5.entry.js +4 -0
- package/dist/twilight/{p-zHj-W7EE.js → p-bVqtOl1F.js} +1 -1
- package/dist/twilight/{p-300624bb.entry.js → p-bf65b263.entry.js} +1 -1
- package/dist/twilight/{p-33ea3141.entry.js → p-c56a47b0.entry.js} +1 -1
- package/dist/twilight/p-c73189e3.entry.js +4 -0
- package/dist/twilight/p-d1203242.entry.js +4 -0
- package/dist/twilight/p-d4edfed4.entry.js +4 -0
- package/dist/twilight/{p-6472200c.entry.js → p-d86ce978.entry.js} +1 -1
- package/dist/twilight/{p-fa585081.entry.js → p-d9e7973d.entry.js} +1 -1
- package/dist/twilight/p-e3e33238.entry.js +4 -0
- package/dist/twilight/p-e6bb7362.entry.js +4 -0
- package/dist/twilight/{p-28900b2e.entry.js → p-e7813c80.entry.js} +1 -1
- package/dist/twilight/p-ec2fd37e.entry.js +4 -0
- package/dist/twilight/{p-b60db6c8.entry.js → p-ec77c523.entry.js} +1 -1
- package/dist/twilight/{p-8c7b7712.entry.js → p-efc18ce6.entry.js} +1 -1
- package/dist/twilight/p-f4039c40.entry.js +4 -0
- package/dist/twilight/p-f47b130c.entry.js +4 -0
- package/dist/twilight/{p-7e39343d.entry.js → p-f57ca123.entry.js} +1 -1
- package/dist/twilight/{p-2d209f96.entry.js → p-f5ad6572.entry.js} +1 -1
- package/dist/twilight/p-fc65084f.entry.js +4 -0
- package/dist/twilight/p-fd81a311.entry.js +4 -0
- package/dist/twilight/{p-16b8d78c.entry.js → p-fe983809.entry.js} +1 -1
- package/dist/twilight/{p-BijadG7g.js → p-i5J7XGS6.js} +1 -1
- package/dist/twilight/{p-DnELO4MH.js → p-shFpk0H3.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +8 -1
- package/dist/types/components.d.ts +4 -0
- package/package.json +5 -5
- package/dist/cjs/salla-accordion_62.cjs.entry.js +0 -22470
- package/dist/cjs/salla-review-card.cjs.entry.js +0 -183
- package/dist/cjs/salla-reviews-page.cjs.entry.js +0 -695
- package/dist/cjs/salla-reviews.cjs.entry.js +0 -106
- package/dist/esm/salla-accordion_62.entry.js +0 -22389
- package/dist/esm/salla-review-card.entry.js +0 -181
- package/dist/esm/salla-reviews-page.entry.js +0 -693
- package/dist/esm/salla-reviews.entry.js +0 -104
- package/dist/twilight/p-67830f2a.entry.js +0 -4
- package/dist/twilight/p-751dddd4.entry.js +0 -4
- package/dist/twilight/p-9b22a7eb.entry.js +0 -4
- package/dist/twilight/p-CBT_Nxny.js +0 -4
- package/dist/twilight/p-Dz7o69vX.js +0 -4
- package/dist/twilight/p-a515a8cc.entry.js +0 -4
- package/dist/twilight/p-c4821f8b.entry.js +0 -4
- package/dist/twilight/p-de807340.entry.js +0 -4
- package/dist/twilight/p-yRO-ZESF.js +0 -4
- package/dist/cjs/{twitter-pOrUNjXi.js → facebook-DbXua6B9.js} +2 -2
- package/dist/esm/{twitter-Dz7o69vX.js → facebook-CO-PeZ27.js} +2 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, h, H as Host, a as getElement } from './index-B74h9G6a.js';
|
|
5
|
+
import { H as Helper } from './Helper-B5RLi6Xo.js';
|
|
6
|
+
import './anime.es-CgtvEd63.js';
|
|
7
|
+
|
|
8
|
+
const sallaProductsSliderCss = "";
|
|
9
|
+
|
|
10
|
+
const SallaProductsSlider = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
/**
|
|
14
|
+
* Custom Card Component for the Salla Products Slider.
|
|
15
|
+
*
|
|
16
|
+
* This component allows you to customize the appearance of individual product cards within a Salla Products Slider.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <salla-products-slider product-card-component="my-custom-card-style1" ...
|
|
20
|
+
* <salla-products-slider product-card-component="my-custom-card-style2" ...
|
|
21
|
+
*/
|
|
22
|
+
this.productCardComponent = 'custom-salla-product-card';
|
|
23
|
+
this.apiUrl = '';
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
return salla.onReady()
|
|
27
|
+
.then(() => {
|
|
28
|
+
//TODO:: check why `this.includes` not working!!
|
|
29
|
+
this.includes = Helper.parseJson(this.includes || this.host.getAttribute('includes'));
|
|
30
|
+
if (!Array.isArray(this.includes)) {
|
|
31
|
+
this.includes = null;
|
|
32
|
+
}
|
|
33
|
+
Helper.setIncludes(this.includes);
|
|
34
|
+
this.sourceValueIsValid = !!(this.getSourceValue() || this.isSourceWithoutValue());
|
|
35
|
+
if (!this.sourceValueIsValid) {
|
|
36
|
+
salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.hasCustomComponent = !!customElements.get(this.productCardComponent);
|
|
40
|
+
if (this.source === 'json') {
|
|
41
|
+
this.productsData = this.getSourceValue();
|
|
42
|
+
this.isReady = true;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if ((this.getSource() == 'related' && !salla.config.get('store.settings.product.related_products_enabled'))) {
|
|
46
|
+
this.isReady = false;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
return salla.product.api.fetch({ source: Helper.getApiSource(this.getSource()), source_value: this.getSourceValue(), limit: this.limit })
|
|
50
|
+
.then(response => Helper.injectExtraFieldsToResponse(response))
|
|
51
|
+
.then(response => {
|
|
52
|
+
this.productsData = response.data;
|
|
53
|
+
this.isReady = true;
|
|
54
|
+
response.source = this.getSource();
|
|
55
|
+
response.sourceValue = this.getSourceValue();
|
|
56
|
+
salla.event.emit('salla-products-slider::products.fetched', response.data);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
componentDidRender() {
|
|
61
|
+
let processedCount = 0;
|
|
62
|
+
const intervalId = setInterval(() => {
|
|
63
|
+
this.host.querySelectorAll('[loading="lazy"]')?.forEach(img => img.removeAttribute('loading'));
|
|
64
|
+
processedCount++;
|
|
65
|
+
if (processedCount >= 10) {
|
|
66
|
+
clearInterval(intervalId);
|
|
67
|
+
}
|
|
68
|
+
}, 1000);
|
|
69
|
+
}
|
|
70
|
+
async componentDidLoad() {
|
|
71
|
+
await Salla.hooks.registerComponent('salla-products-slider', this);
|
|
72
|
+
}
|
|
73
|
+
isSourceWithoutValue() {
|
|
74
|
+
return ['offers', 'latest', 'sales', 'top-rated'].includes(this.getSource());
|
|
75
|
+
}
|
|
76
|
+
getItemHTML(product) {
|
|
77
|
+
//as a request they don't want to let the user to open the product details
|
|
78
|
+
//todo:: find a better way to handle this request
|
|
79
|
+
const isLandingPage = this.getSource() === 'landing-page';
|
|
80
|
+
isLandingPage && (product.url = '');
|
|
81
|
+
const handleClick = isLandingPage ? undefined : () => Helper.saveProductSource(this.getSource());
|
|
82
|
+
if (this.hasCustomComponent && this.productCardComponent.toLowerCase() == 'custom-salla-product-card') {
|
|
83
|
+
return h("div", { class: "s-products-slider-card", onClick: handleClick }, h("custom-salla-product-card", { product: product, source: this.getSource(), "source-value": this.getSourceValue() }));
|
|
84
|
+
}
|
|
85
|
+
if (this.hasCustomComponent) {
|
|
86
|
+
const customElem = document.createElement(this.productCardComponent);
|
|
87
|
+
customElem.setAttribute('product', JSON.stringify(product));
|
|
88
|
+
customElem.setAttribute('source', this.getSource());
|
|
89
|
+
customElem.setAttribute('source-value', this.getSourceValue());
|
|
90
|
+
return h("div", { class: "s-products-slider-card", onClick: handleClick, innerHTML: customElem.outerHTML });
|
|
91
|
+
}
|
|
92
|
+
return h("div", { class: "s-products-slider-card", onClick: handleClick }, h("salla-product-card", { "show-quantity": isLandingPage, "hide-add-btn": isLandingPage, "shadow-on-hover": true, product: product }));
|
|
93
|
+
}
|
|
94
|
+
canRender() {
|
|
95
|
+
return this.sourceValueIsValid && this.isReady;
|
|
96
|
+
}
|
|
97
|
+
getSource() {
|
|
98
|
+
return Helper.getProductsSource(this.source);
|
|
99
|
+
}
|
|
100
|
+
getSourceValue() {
|
|
101
|
+
return Helper.getProductsSourceValue(this.source, this.sourceValue);
|
|
102
|
+
}
|
|
103
|
+
render() {
|
|
104
|
+
if (!this.canRender()) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
return (h(Host, { class: "s-products-slider-wrapper" }, h("salla-slider", { class: "s-products-slider-slider", id: this.sliderId || `s-products-slider-${Math.random().toString(36).substr(2, 9)}`, "auto-play": this.autoplay, type: "carousel", "block-title": this.blockTitle, "block-subTitle": this.subTitle, "display-all-url": this.displayAllUrl, sliderConfig: this.sliderConfig ? this.sliderConfig : null }, h("div", { slot: "items" }, this.productsData?.map(product => this.getItemHTML(product))))));
|
|
108
|
+
}
|
|
109
|
+
get host() { return getElement(this); }
|
|
110
|
+
};
|
|
111
|
+
SallaProductsSlider.style = sallaProductsSliderCss;
|
|
112
|
+
|
|
113
|
+
export { SallaProductsSlider as salla_products_slider };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, h } from './index-B74h9G6a.js';
|
|
5
|
+
|
|
6
|
+
const sallaProgressBarCss = "";
|
|
7
|
+
|
|
8
|
+
const SallaProgressBar = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
/**
|
|
12
|
+
* Set height for the wrapper.
|
|
13
|
+
*/
|
|
14
|
+
this.height = "10px";
|
|
15
|
+
try {
|
|
16
|
+
if (this.donation) {
|
|
17
|
+
let donationJson = typeof this.donation == 'string' ? JSON.parse(this.donation) : this.donation;
|
|
18
|
+
if (donationJson.can_donate && donationJson.target_amount) {
|
|
19
|
+
donationJson.target_end_date = donationJson.target_end_date == '0000-00-00' ? null : donationJson.target_end_date;
|
|
20
|
+
this.value = donationJson.collected_amount;
|
|
21
|
+
this.target = donationJson.target_amount;
|
|
22
|
+
this.header = salla.lang.get('pages.products.target');
|
|
23
|
+
this.message = donationJson.target_end_date ? salla.lang.get('pages.products.donation_target_date') + ' ' + donationJson.target_end_date : '';
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
//in case the product is not enabled target campaign
|
|
27
|
+
this.message = donationJson.target_amount
|
|
28
|
+
? donationJson.target_message
|
|
29
|
+
: '';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
salla.log('Wrong donation json');
|
|
35
|
+
}
|
|
36
|
+
salla.lang.onLoaded(() => {
|
|
37
|
+
this.header = this.header?.replace('pages.products.target', salla.lang.get('pages.products.target'));
|
|
38
|
+
this.message = this.message?.replace('pages.products.donation_target_date', salla.lang.get('pages.products.donation_target_date'));
|
|
39
|
+
});
|
|
40
|
+
salla.onReady(() => {
|
|
41
|
+
this.color = this.color || salla.config.get('theme.color.primary', "#ffd5c4");
|
|
42
|
+
if (!this.unit) {
|
|
43
|
+
this.unit = salla.config.currency().symbol;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
getPercentage() {
|
|
48
|
+
return (this.value / this.target) * 100;
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
if (!this.target && !this.message) {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
return (h("div", { class: "s-progress-bar-container" }, this.header ? h("div", { class: "s-progress-bar-header" }, this.header) : '', this.getProgressBar(), this.message ? h("span", { class: "s-progress-bar-message" }, this.message) : ''));
|
|
55
|
+
}
|
|
56
|
+
getProgressBar() {
|
|
57
|
+
return this.target ? [
|
|
58
|
+
!this.hideUnits ? (h("div", { class: "s-progress-bar-target-section" }, h("span", { innerHTML: `${salla.helpers.number(this.value)} ${this.unit}` }), h("span", { innerHTML: `${salla.helpers.number(this.target)} ${this.unit}` }))) : null,
|
|
59
|
+
h("div", { class: "s-progress-bar-wrapper", style: { height: this.height } }, h("div", { class: {
|
|
60
|
+
"s-progress-bar-progress": true,
|
|
61
|
+
's-progress-bar-progress-stripped': this.stripped
|
|
62
|
+
}, style: {
|
|
63
|
+
width: `${this.getPercentage()}%`,
|
|
64
|
+
backgroundColor: this.color
|
|
65
|
+
} }))
|
|
66
|
+
] : null;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
SallaProgressBar.style = sallaProgressBarCss;
|
|
70
|
+
|
|
71
|
+
export { SallaProgressBar as salla_progress_bar };
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-B74h9G6a.js';
|
|
5
|
+
import { M as MailIcon } from './mail-DmgxDvXL.js';
|
|
6
|
+
import { C as Cancel } from './cancel-BsLF_HK7.js';
|
|
7
|
+
|
|
8
|
+
var CelebrationIcon = `<!-- Generated by IcoMoon.io -->
|
|
9
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
10
|
+
<title>party-horn</title>
|
|
11
|
+
<path fill="currentColor" d="M5.333 4.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM11.333 10c0.341 0 0.683-0.131 0.943-0.391 1.541-1.54 2.391-3.589 2.391-5.771v-2.505c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.505c0 1.468-0.572 2.848-1.609 3.885-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391zM18.667 9.993c0.319 0 0.639-0.115 0.895-0.345 0.383-0.347 0.684-0.325 1.497-0.22 0.923 0.124 2.319 0.307 3.636-0.887 1.293-1.172 1.303-2.54 1.308-3.539 0.005-0.887 0.043-1.228 0.432-1.581 0.361-0.327 0.621-0.335 1.493-0.216 0.923 0.12 2.317 0.307 3.635-0.884 0.545-0.495 0.587-1.337 0.093-1.883-0.493-0.547-1.336-0.589-1.884-0.093-0.361 0.325-0.621 0.333-1.493 0.216-0.921-0.119-2.317-0.305-3.635 0.884-1.293 1.173-1.303 2.541-1.308 3.54-0.005 0.885-0.043 1.227-0.432 1.58-0.383 0.348-0.683 0.327-1.497 0.22-0.924-0.124-2.32-0.305-3.636 0.887-0.545 0.495-0.587 1.339-0.092 1.884 0.264 0.291 0.625 0.437 0.988 0.437zM18.667 16.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM30.667 17.333h-2.505c-2.179 0-4.228 0.849-5.771 2.391-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.603 0.391 0.944 0.391s0.683-0.131 0.943-0.391c1.023-1.023 2.439-1.609 3.884-1.609h2.505c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM30.667 10.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM29.333 26.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM7.456 11.057c-0.327-0.327-0.799-0.46-1.249-0.356-0.449 0.107-0.812 0.439-0.959 0.876l-5.036 15.113c-0.487 1.457-0.113 3.037 0.973 4.125 0.772 0.771 1.792 1.183 2.84 1.183 0.428 0 0.861-0.068 1.284-0.209l15.112-5.037c0.439-0.145 0.769-0.508 0.876-0.959 0.107-0.449-0.028-0.921-0.355-1.249zM4.467 29.259c-0.503 0.163-1.023 0.043-1.395-0.329-0.373-0.373-0.497-0.896-0.329-1.396l4.355-13.065 10.436 10.435z"></path>
|
|
12
|
+
</svg>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
var PortraitIcon = `<!-- Generated by IcoMoon.io -->
|
|
16
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
17
|
+
<title>portrait</title>
|
|
18
|
+
<path d="M24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 3.028 2.041 5.561 4.811 6.371 0.004 0.001 0.008 0.003 0.012 0.004 0.591 0.172 1.2 0.292 1.844 0.292h16c0.644 0 1.253-0.12 1.843-0.292 0.004-0.001 0.008-0.003 0.012-0.004 2.771-0.809 4.812-3.343 4.812-6.371v-16c0-3.676-2.991-6.667-6.667-6.667zM8.012 28c0.121-1.915 3.363-4 7.988-4s7.868 2.085 7.988 4zM28 24c0 1.24-0.579 2.335-1.467 3.069-0.768-3.288-5.112-5.736-10.533-5.736s-9.765 2.448-10.533 5.736c-0.888-0.735-1.467-1.829-1.467-3.069v-16c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4zM16 6.667c-3.308 0-6 2.692-6 6s2.692 6 6 6 6-2.692 6-6-2.692-6-6-6zM16 16c-1.839 0-3.333-1.495-3.333-3.333s1.495-3.333 3.333-3.333 3.333 1.495 3.333 3.333-1.495 3.333-3.333 3.333z"></path>
|
|
19
|
+
</svg>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
var IphoneXIcon = `<!-- Generated by IcoMoon.io -->
|
|
23
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
24
|
+
<title>iphone-x</title>
|
|
25
|
+
<path d="M24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.597 1.333-1.333 1.333h-16c-0.736 0-1.333-0.597-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h4c0 1.471 1.196 2.667 2.667 2.667h2.667c1.471 0 2.667-1.196 2.667-2.667h4c0.736 0 1.333 0.599 1.333 1.333z"></path>
|
|
26
|
+
</svg>
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const sallaQuickOrderCss = ".s-quick-order-expandable:not(.s-quick-order-shown){overflow:hidden}";
|
|
30
|
+
|
|
31
|
+
const SallaQuickOrder = class {
|
|
32
|
+
constructor(hostRef) {
|
|
33
|
+
registerInstance(this, hostRef);
|
|
34
|
+
this.quickOrderSubmited = createEvent(this, "quickOrderSubmited");
|
|
35
|
+
/**
|
|
36
|
+
* quick order title
|
|
37
|
+
*/
|
|
38
|
+
this.quickOrderTitle = 'ليش تنتظر؟';
|
|
39
|
+
/**
|
|
40
|
+
* quick order sub title
|
|
41
|
+
*/
|
|
42
|
+
this.subTitle = 'احصل على المنتج مباشرة الآن';
|
|
43
|
+
/**
|
|
44
|
+
* quick order pay button text
|
|
45
|
+
*/
|
|
46
|
+
this.payButtonTitle = 'اطلب المنتج';
|
|
47
|
+
/**
|
|
48
|
+
* quick order confirm pay button text
|
|
49
|
+
*/
|
|
50
|
+
this.confirmPayButtonTitle = 'اشتر الآن';
|
|
51
|
+
/**
|
|
52
|
+
* agreement text from server or from props
|
|
53
|
+
*/
|
|
54
|
+
this.agreementText = salla.lang.get('pages.checkout.show_full_agreement');
|
|
55
|
+
/**
|
|
56
|
+
* is email required
|
|
57
|
+
*/
|
|
58
|
+
this.isEmailRequired = false;
|
|
59
|
+
/**
|
|
60
|
+
* Quick Order Style
|
|
61
|
+
*/
|
|
62
|
+
this.quickOrderStyle = 'default';
|
|
63
|
+
this.isAvailable = false;
|
|
64
|
+
this.oneClick = false;
|
|
65
|
+
this.expanded = false;
|
|
66
|
+
this.isTermsRequired = false;
|
|
67
|
+
this.countryCode = salla.config.get('user.country_code', 'SA') || 'SA';
|
|
68
|
+
this.submitSucess = false;
|
|
69
|
+
//Langugae states
|
|
70
|
+
this.placeHolderEmail = salla.lang.get('common.elements.email');
|
|
71
|
+
this.emailOptional = salla.lang.get('common.elements.optional');
|
|
72
|
+
this.agreementShowText = salla.lang.get('pages.checkout.show_full_agreement');
|
|
73
|
+
this.agreementModalHead = salla.lang.get('pages.checkout.full_agreement');
|
|
74
|
+
this.userNameLabel = salla.lang.get('pages.products.your_name');
|
|
75
|
+
this.termsChecked = false;
|
|
76
|
+
salla.onReady(() => {
|
|
77
|
+
this.productId = this.productId || salla.config.get('page.id');
|
|
78
|
+
});
|
|
79
|
+
salla.lang.onLoaded(() => {
|
|
80
|
+
this.placeHolderEmail = salla.lang.get('common.elements.email');
|
|
81
|
+
this.emailOptional = salla.lang.get('common.elements.optional');
|
|
82
|
+
this.agreementShowText = salla.lang.get('pages.checkout.show_full_agreement');
|
|
83
|
+
this.agreementModalHead = salla.lang.get('pages.checkout.full_agreement');
|
|
84
|
+
this.userNameLabel = salla.lang.get('pages.products.your_name');
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
getBtnColor() {
|
|
88
|
+
return this.quickOrderStyle === 'default' ? 'light' : 'primary';
|
|
89
|
+
}
|
|
90
|
+
getErrorMessage(type, name) {
|
|
91
|
+
return name == 'terms'
|
|
92
|
+
? salla.lang.get('pages.checkout.check_agreement')
|
|
93
|
+
: salla.lang.get(`common.errors.${type}`, { attribute: name == 'name' ? this.userNameLabel : this.placeHolderEmail });
|
|
94
|
+
}
|
|
95
|
+
handleInvalidInput(e) {
|
|
96
|
+
let input = e.target;
|
|
97
|
+
let validity = input.validity;
|
|
98
|
+
let errorMessage;
|
|
99
|
+
if (validity.valueMissing) {
|
|
100
|
+
errorMessage = this.getErrorMessage('field_required', input.name);
|
|
101
|
+
console.log(this.getErrorMessage('field_required', input.name));
|
|
102
|
+
}
|
|
103
|
+
else if (validity.typeMismatch) {
|
|
104
|
+
errorMessage = this.getErrorMessage('invalid_value', input.name);
|
|
105
|
+
}
|
|
106
|
+
input.setCustomValidity(errorMessage);
|
|
107
|
+
}
|
|
108
|
+
async setWrapperHeight() {
|
|
109
|
+
let expandable = this.host.querySelector('.s-quick-order-expandable');
|
|
110
|
+
setTimeout(() => {
|
|
111
|
+
if (expandable.style.maxHeight || this.oneClick) {
|
|
112
|
+
expandable.style.maxHeight = null;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
expandable.style.maxHeight = expandable.scrollHeight + "px";
|
|
116
|
+
}
|
|
117
|
+
}, 50);
|
|
118
|
+
}
|
|
119
|
+
getDarkOrLight() {
|
|
120
|
+
return this.quickOrderStyle === 'default' && salla.config.get('theme.color.is_dark') ? 'dark' : 'light';
|
|
121
|
+
}
|
|
122
|
+
getStyleColor() {
|
|
123
|
+
return {
|
|
124
|
+
gray: '#f3f3f3',
|
|
125
|
+
white: '#ffffff',
|
|
126
|
+
default: salla.config.get('theme.color.primary'),
|
|
127
|
+
}[this.quickOrderStyle] || '#f3f3f3';
|
|
128
|
+
}
|
|
129
|
+
async submit(e, checkOneClick = false) {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
if (checkOneClick && !this.oneClick) {
|
|
132
|
+
this.expanded = !this.expanded;
|
|
133
|
+
this.setWrapperHeight();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
return this.submitBtn.load()
|
|
137
|
+
.then(() => this.getPayload())
|
|
138
|
+
.then((payload) => salla.api.cart.createQuickOrder(payload))
|
|
139
|
+
.then(() => {
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
this.submitBtn.stop();
|
|
142
|
+
this.submitSucess = true;
|
|
143
|
+
this.quickOrderSubmited.emit();
|
|
144
|
+
}, 200);
|
|
145
|
+
})
|
|
146
|
+
.catch(error => error && (console.error(error), this.submitBtn.stop()));
|
|
147
|
+
}
|
|
148
|
+
async getPayload() {
|
|
149
|
+
if (this.oneClick) {
|
|
150
|
+
return {
|
|
151
|
+
product_ids: [this.productId],
|
|
152
|
+
agreement: true,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
product_ids: [this.productId],
|
|
157
|
+
email: this.emailInput?.value,
|
|
158
|
+
phone: Number((await this.phoneInput?.getValues())?.phone),
|
|
159
|
+
country_code: (await this.phoneInput?.getValues())?.countryCode || this.countryCode,
|
|
160
|
+
name: this.nameInput?.value,
|
|
161
|
+
agreement: this.termsChecked,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
formatAgreementText(agreement_text, length = 150) {
|
|
165
|
+
if (!agreement_text)
|
|
166
|
+
return '';
|
|
167
|
+
if (agreement_text.length <= length)
|
|
168
|
+
return agreement_text;
|
|
169
|
+
const parsedToDOM = new DOMParser().parseFromString(agreement_text, 'text/html');
|
|
170
|
+
return parsedToDOM.documentElement.innerText.substring(0, length) + '...';
|
|
171
|
+
}
|
|
172
|
+
loadQuickOrderSettings() {
|
|
173
|
+
let data = salla.config.get('store.settings.quick_order');
|
|
174
|
+
if (!data) {
|
|
175
|
+
return Promise.resolve();
|
|
176
|
+
}
|
|
177
|
+
this.user = salla.config.get('user') || salla.storage.get('user') || {};
|
|
178
|
+
this.countryCode = this.user?.country_code || this.countryCode;
|
|
179
|
+
// make email required if user is gust or is required from server
|
|
180
|
+
this.isEmailRequired = this.user?.email ? false : this.isEmailRequired;
|
|
181
|
+
// check if one click is available
|
|
182
|
+
this.oneClick = this.user?.email;
|
|
183
|
+
this.initComponentData(data);
|
|
184
|
+
return Promise.resolve();
|
|
185
|
+
// return salla.api.withoutNotifier(() => salla.api.cart.getQuickOrderSettings().then(res => this.initComponentData(res.data)));
|
|
186
|
+
}
|
|
187
|
+
initComponentData(data) {
|
|
188
|
+
this.quickOrderTitle = data.title;
|
|
189
|
+
this.subTitle = data.sub_title;
|
|
190
|
+
this.payButtonTitle = data.order_now_button;
|
|
191
|
+
this.isEmailRequired = data.is_email_required;
|
|
192
|
+
this.isTermsRequired = data.show_agreement;
|
|
193
|
+
this.agreementText = data.agreement;
|
|
194
|
+
this.confirmPayButtonTitle = data.confirm_button;
|
|
195
|
+
this.thanksMessage = data.thanks_message;
|
|
196
|
+
this.quickOrderStyle = data.style;
|
|
197
|
+
this.isAvailable = true;
|
|
198
|
+
// toggle oneClick if true
|
|
199
|
+
this.oneClick = this.oneClick && !this.isTermsRequired;
|
|
200
|
+
}
|
|
201
|
+
componentWillLoad() {
|
|
202
|
+
return new Promise(resolve => salla.onReady(() => this.loadQuickOrderSettings().then(resolve)));
|
|
203
|
+
}
|
|
204
|
+
render() {
|
|
205
|
+
if (!this.isAvailable) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (this.submitSucess) {
|
|
209
|
+
return (h(Host, { class: "s-quick-order" }, h("div", { class: 's-quick-order-confirm', style: {
|
|
210
|
+
backgroundColor: salla.config.get('theme.color.primary') + '10',
|
|
211
|
+
borderColor: salla.config.get('theme.color.primary') + '10',
|
|
212
|
+
color: salla.config.get('theme.color.primary')
|
|
213
|
+
} }, h("i", { innerHTML: CelebrationIcon }), h("span", null, this.thanksMessage))));
|
|
214
|
+
}
|
|
215
|
+
return (h(Host, { class: `s-quick-order s-quick-order-${this.getDarkOrLight()}` }, h("div", { class: `s-quick-order-container s-quick-order-${this.quickOrderStyle}`, style: { backgroundColor: this.getStyleColor() } }, h("div", { class: "s-quick-order-button-cont" }, h("div", null, h("h3", null, this.quickOrderTitle), h("p", null, this.subTitle)), h("salla-button", { class: this.expanded ? "s-quick-order-btn-close" : "", onClick: (e) => this.submit(e, true), color: this.getBtnColor() }, this.oneClick
|
|
216
|
+
? this.confirmPayButtonTitle : this.expanded ? h("i", { innerHTML: Cancel }) : this.confirmPayButtonTitle)), h("form", { onSubmit: (e) => this.submit(e), class: 's-quick-order-expandable ' + (this.expanded ? 's-quick-order-shown' : '') }, Salla.config.isGuest() &&
|
|
217
|
+
[
|
|
218
|
+
h("div", { class: "s-form-group" }, h("span", { innerHTML: PortraitIcon }), h("input", { type: "text", required: true, class: "s-form-control s-quick-order-phone-field", name: 'name', placeholder: this.userNameLabel, ref: el => (this.nameInput = el) })),
|
|
219
|
+
h("div", { class: "s-quick-order-flex-input" }, h("div", { class: "s-form-group" }, h("span", { innerHTML: IphoneXIcon }), h("salla-tel-input", { ref: el => (this.phoneInput = el) })), h("div", { class: "s-form-group" }, h("span", { innerHTML: MailIcon }), h("input", { type: "email", class: "s-form-control s-quick-order-email-field", name: 'email', required: this.isEmailRequired, placeholder: this.placeHolderEmail + ' ' + (this.isEmailRequired ? '' : this.emailOptional), ref: el => (this.emailInput = el) }))),
|
|
220
|
+
], this.isTermsRequired && (h("label", { htmlFor: "terms", class: "s-quick-order-terms" }, h("input", { type: "checkbox", required: true, name: 'terms', id: 'terms', ref: el => (this.termsInput = el), onChange: () => (this.termsChecked = this.termsInput.checked), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", h("div", { innerHTML: this.formatAgreementText(this.agreementText, 150) }, this.agreementText.length > 150 && (h("salla-button", { shape: "link", onClick: () => this.agreementModal.open() }, this.agreementShowText))), " "))), h("salla-button", { type: "submit", color: this.getBtnColor(), width: "wide", ref: el => (this.submitBtn = el) }, this.payButtonTitle)), h("salla-modal", { "modal-title": this.agreementModalHead, ref: modal => (this.agreementModal = modal) }, h("article", { innerHTML: this.agreementText })))));
|
|
221
|
+
}
|
|
222
|
+
componentDidLoad() {
|
|
223
|
+
this.host.querySelectorAll('input').forEach(input => {
|
|
224
|
+
input.addEventListener('invalid', e => {
|
|
225
|
+
this.handleInvalidInput(e);
|
|
226
|
+
});
|
|
227
|
+
input.addEventListener('input', () => {
|
|
228
|
+
input.setCustomValidity('');
|
|
229
|
+
input.reportValidity();
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
get host() { return getElement(this); }
|
|
234
|
+
};
|
|
235
|
+
SallaQuickOrder.style = sallaQuickOrderCss;
|
|
236
|
+
|
|
237
|
+
export { SallaQuickOrder as salla_quick_order };
|