@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,453 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
var index = require('./index-Ce40E8tZ.js');
|
|
7
|
+
var star = require('./star-DGcH7Yso.js');
|
|
8
|
+
var checkCircle2 = require('./check-circle2-BDvlT4_n.js');
|
|
9
|
+
var Helper = require('./Helper-DHRnzcFm.js');
|
|
10
|
+
var image = require('./image-BoZ6Hums.js');
|
|
11
|
+
var whatsapp2 = require('./whatsapp2-BdMd5Gx1.js');
|
|
12
|
+
var mail = require('./mail-CO8cFZH7.js');
|
|
13
|
+
var anime_es = require('./anime.es-BqW8JHZi.js');
|
|
14
|
+
|
|
15
|
+
var ShippingFast = `<!-- 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>shipping-fast</title>
|
|
18
|
+
<path d="M10.667 14.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h8c0.736 0 1.333-0.596 1.333-1.333zM9.333 18.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM9.333 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM1.333 10.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.123 13.103l-3.147-3.935c-1.273-1.589-3.171-2.501-5.205-2.501h-1.437c0-2.205-1.795-4-4-4h-13.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v1.333c0 0.248 0.087 0.468 0.204 0.667-0.117 0.199-0.204 0.419-0.204 0.667v5.333c0 0.737 0.597 1.333 1.333 1.333h9.333v6.667h-1.333c-0.063 0-0.117 0.028-0.179 0.036-0.583-2.313-2.664-4.036-5.155-4.036-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c2.491 0 4.572-1.723 5.155-4.036 0.061 0.008 0.116 0.036 0.179 0.036h2.667c0.736 0 1.333-0.596 1.333-1.333v-8.399c0-0.905-0.311-1.792-0.877-2.499zM21.333 13.333v-4h1.437c1.221 0 2.36 0.547 3.124 1.501l1.997 2.499zM22.667 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>
|
|
19
|
+
</svg>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const sallaRatingModalCss = "";
|
|
23
|
+
|
|
24
|
+
const SallaRatingModal = class {
|
|
25
|
+
constructor(hostRef) {
|
|
26
|
+
index.registerInstance(this, hostRef);
|
|
27
|
+
this.hasError = false;
|
|
28
|
+
this.showContactWidget = true;
|
|
29
|
+
this.images = [];
|
|
30
|
+
this.productImages = {};
|
|
31
|
+
this.editItemImages = [];
|
|
32
|
+
this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_subject', { store, id, customer });
|
|
33
|
+
this.editMode = false;
|
|
34
|
+
this.defaultMode = false;
|
|
35
|
+
this.deleteMode = false;
|
|
36
|
+
this.shouldOpenDeleteModal = false;
|
|
37
|
+
this.editItem = null;
|
|
38
|
+
this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
|
|
39
|
+
this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
|
|
40
|
+
this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
|
|
41
|
+
this.allowedImagesTypesLabel = salla.lang.get('common.uploader.allowed_images_types');
|
|
42
|
+
this.addImagesLabel = salla.lang.get('pages.rating.add_images');
|
|
43
|
+
this.editImagesLabel = salla.lang.get('pages.rating.edit_images');
|
|
44
|
+
this.threeImagesMax = salla.lang.get('common.uploader.max_three_images');
|
|
45
|
+
this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
|
|
46
|
+
this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
|
|
47
|
+
this.cancelLabel = salla.lang.get('common.elements.cancel');
|
|
48
|
+
this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
|
|
49
|
+
this.updatedSuccessfullyLabel = salla.lang.get("pages.rating.review_updated_successfully");
|
|
50
|
+
this.deletedSuccessfullyLabel = salla.lang.get("pages.rating.review_deleted_successfully");
|
|
51
|
+
this.contactUsLabel = salla.lang.get('blocks.footer.social');
|
|
52
|
+
this.allowAttachImages = salla.config.get('store.settings.rating.allow_attach_images');
|
|
53
|
+
this.allowContactSupport = salla.config.get('store.settings.rating.allow_contact_support');
|
|
54
|
+
this.contentRefs = [];
|
|
55
|
+
this.hiddenInputs = [];
|
|
56
|
+
this.isOpen = [];
|
|
57
|
+
this.stepsCount = 0;
|
|
58
|
+
this.currentIndex = 0;
|
|
59
|
+
this.submitted = [];
|
|
60
|
+
this.MAX_UPLOAD_LIMIT = 3;
|
|
61
|
+
this.onOpen = (index) => {
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
anime_es.anime({
|
|
64
|
+
targets: this.contentRefs[index],
|
|
65
|
+
duration: 100,
|
|
66
|
+
height: this.contentRefs[index].scrollHeight,
|
|
67
|
+
opacity: [0, 1],
|
|
68
|
+
easing: 'easeOutQuart',
|
|
69
|
+
complete: () => resolve(),
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
this.onClose = (index) => {
|
|
74
|
+
return new Promise((resolve) => {
|
|
75
|
+
anime_es.anime({
|
|
76
|
+
targets: this.contentRefs[index],
|
|
77
|
+
duration: 100,
|
|
78
|
+
height: 0,
|
|
79
|
+
opacity: [1, 0],
|
|
80
|
+
easing: 'easeOutQuart',
|
|
81
|
+
complete: () => resolve(),
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
this.toggleUploader = async (index) => {
|
|
86
|
+
this.isOpen[index] = !this.isOpen[index];
|
|
87
|
+
Helper.Helper.toggleElementClassIf(this.contentRefs[index], 'is-closed', 'is-opened', () => !this.isOpen[index]);
|
|
88
|
+
await (this.isOpen[index] ? this.onOpen(index) : this.onClose(index));
|
|
89
|
+
await new Promise((resolve) => setTimeout(resolve, 101));
|
|
90
|
+
if (this.body && this.currentTab) {
|
|
91
|
+
setTimeout(() => this.body.setAttribute('style', `height:${this.currentTab.offsetHeight + (this.editMode ? 60 : 0)}px`));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
salla.onReady(() => {
|
|
95
|
+
this.orderId = salla.config.get('page.id');
|
|
96
|
+
});
|
|
97
|
+
salla.lang.onLoaded(() => {
|
|
98
|
+
this.contactUsLabel = salla.lang.get('blocks.footer.social');
|
|
99
|
+
const setNestedAsync = (lang, key, value) => {
|
|
100
|
+
return new Promise((resolve) => {
|
|
101
|
+
salla.helpers.setNested(salla.lang.messages[lang], key, value);
|
|
102
|
+
resolve(true);
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
const setTranslations = async () => {
|
|
106
|
+
await setNestedAsync('ar.trans', 'common.uploader.drag_and_drop_files', 'اسحب الملفات وأفلتها هنا');
|
|
107
|
+
await setNestedAsync('en.trans', 'common.uploader.drag_and_drop_files', 'Drag and drop files here');
|
|
108
|
+
await setNestedAsync('ar.trans', 'common.uploader.allowed_images_types', ' .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة');
|
|
109
|
+
await setNestedAsync('en.trans', 'common.uploader.allowed_images_types', 'Images in jpg, jpeg, or png format are allowed.');
|
|
110
|
+
await setNestedAsync('ar.trans', 'pages.rating.add_images', 'اضافة صور');
|
|
111
|
+
await setNestedAsync('en.trans', 'pages.rating.add_images', 'Add Images');
|
|
112
|
+
await setNestedAsync('ar.trans', 'pages.rating.edit_images', 'تعديل الصور');
|
|
113
|
+
await setNestedAsync('en.trans', 'pages.rating.edit_images', 'Edit Images');
|
|
114
|
+
await setNestedAsync('ar.trans', 'pages.rating.edit_review', 'تعديل التقييم');
|
|
115
|
+
await setNestedAsync('en.trans', 'pages.rating.edit_review', 'Edit review');
|
|
116
|
+
await setNestedAsync('ar.trans', 'pages.rating.confirm_deletion', 'تأكيد حذف التقييم');
|
|
117
|
+
await setNestedAsync('en.trans', 'pages.rating.confirm_deletion', 'Confirm review deletion');
|
|
118
|
+
await setNestedAsync('ar.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'هل أنت متأكد من حذف تقييمك؟');
|
|
119
|
+
await setNestedAsync('en.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'Are you sure you want to delete your review?');
|
|
120
|
+
await setNestedAsync('ar.trans', 'pages.rating.review_updated_successfully', 'تم تعديل التقييم بنجاح');
|
|
121
|
+
await setNestedAsync('en.trans', 'pages.rating.review_updated_successfully', 'The review has been successfully updated.');
|
|
122
|
+
await setNestedAsync('ar.trans', 'pages.rating.review_deleted_successfully', 'تم حذف التقييم بنجاح');
|
|
123
|
+
await setNestedAsync('en.trans', 'pages.rating.review_deleted_successfully', 'The review has been successfully deleted.');
|
|
124
|
+
await setNestedAsync('ar.trans', 'pages.rating.images_count', 'الصور ( :current من أصل :total )');
|
|
125
|
+
await setNestedAsync('en.trans', 'pages.rating.images_count', 'Images ( :current of :total )');
|
|
126
|
+
await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`);
|
|
127
|
+
await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`);
|
|
128
|
+
await setNestedAsync('ar.trans', 'common.elements.confirm_delete', 'تأكيد الحذف');
|
|
129
|
+
await setNestedAsync('en.trans', 'common.elements.confirm_delete', 'Confirm deletion');
|
|
130
|
+
this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
|
|
131
|
+
this.allowedImagesTypesLabel = salla.lang.get('common.uploader.allowed_images_types');
|
|
132
|
+
this.addImagesLabel = salla.lang.get('pages.rating.add_images');
|
|
133
|
+
this.threeImagesMax = salla.lang.get('common.uploader.max_three_images');
|
|
134
|
+
this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
|
|
135
|
+
this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
|
|
136
|
+
this.editImagesLabel = salla.lang.get('pages.rating.edit_images');
|
|
137
|
+
this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
|
|
138
|
+
this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
|
|
139
|
+
this.cancelLabel = salla.lang.get("common.elements.cancel");
|
|
140
|
+
this.updatedSuccessfullyLabel = salla.lang.get("pages.rating.review_updated_successfully");
|
|
141
|
+
this.deletedSuccessfullyLabel = salla.lang.get("pages.rating.review_deleted_successfully");
|
|
142
|
+
this.confirmDeleteBtn = salla.lang.get("common.elements.confirm_delete");
|
|
143
|
+
this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_body', { store, id, customer });
|
|
144
|
+
};
|
|
145
|
+
setTranslations();
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Show the rating modal
|
|
150
|
+
*/
|
|
151
|
+
async open() {
|
|
152
|
+
this.defaultMode = true;
|
|
153
|
+
return new Promise((resolve) => {
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
this.modal.open().then(() => this.order || salla.api.withoutNotifier(() => salla.rating.api.order(this.orderId ? this.orderId : salla.config.get('page.id'))).then(res => this.order = res.data))
|
|
156
|
+
.then(() => this.modal.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
|
|
157
|
+
.then(() => {
|
|
158
|
+
// Initialize productImages for all products
|
|
159
|
+
const initialImages = {};
|
|
160
|
+
if (this.order?.products) {
|
|
161
|
+
for (const item of this.order.products) {
|
|
162
|
+
initialImages[item.product.id] = [];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
this.productImages = initialImages;
|
|
166
|
+
})
|
|
167
|
+
.then(() => this.modal.stopLoading())
|
|
168
|
+
.then(() => this.stepsCount = [this.order.testimonials_enabled, this.order.products_enabled, this.order.shipping_enabled].filter(enabled => enabled).length)
|
|
169
|
+
.then(() => setTimeout(() => this.handleWizard(), 100))
|
|
170
|
+
.catch(e => {
|
|
171
|
+
resolve(false);
|
|
172
|
+
this.hasError = true;
|
|
173
|
+
this.errorMessage = e.response?.data?.error?.message || e.response?.data;
|
|
174
|
+
this.modal.stopLoading();
|
|
175
|
+
});
|
|
176
|
+
resolve(true);
|
|
177
|
+
}, 50);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
async openEditModal(params) {
|
|
181
|
+
this.defaultMode = false;
|
|
182
|
+
this.editMode = true;
|
|
183
|
+
this.editType = params.type;
|
|
184
|
+
this.editFeedbackId = params.feedback_id;
|
|
185
|
+
try {
|
|
186
|
+
await this.fetchEditItem(params.feedback_id);
|
|
187
|
+
this.editModal.open();
|
|
188
|
+
}
|
|
189
|
+
catch (e) {
|
|
190
|
+
this.hasError = true;
|
|
191
|
+
this.errorMessage = e.response?.data?.error?.message || e.response?.data;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async fetchEditItem(feedbackId) {
|
|
195
|
+
const endpoint = `rating/${feedbackId}/show`;
|
|
196
|
+
const response = await salla.api.request(endpoint);
|
|
197
|
+
this.editItem = response.data;
|
|
198
|
+
if (this.allowAttachImages && this.editType == "product" && this.editItem.images.length) {
|
|
199
|
+
this.editItemImages = this.editItem.images.map(img => {
|
|
200
|
+
return { id: `${Math.floor(100 + Math.random() * 900)}`, url: img };
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async editReview() {
|
|
205
|
+
const data = {};
|
|
206
|
+
this.editModal.querySelectorAll('[name]').forEach((input) => {
|
|
207
|
+
const inputData = salla.helpers.inputData(input.name, input.value, data);
|
|
208
|
+
data[inputData.name] = inputData.value;
|
|
209
|
+
});
|
|
210
|
+
data.images && (data.images = data.images.split(','));
|
|
211
|
+
const endpoint = `rating/${this.editFeedbackId}`;
|
|
212
|
+
await salla.api.request(endpoint, data, 'put').then((res) => {
|
|
213
|
+
this.editModal.close();
|
|
214
|
+
salla.notify.success(res.message || this.updatedSuccessfullyLabel);
|
|
215
|
+
setTimeout(() => {
|
|
216
|
+
window.location.reload();
|
|
217
|
+
}, 500);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
async openDeleteModal(params) {
|
|
221
|
+
this.defaultMode = false;
|
|
222
|
+
this.deleteMode = true;
|
|
223
|
+
this.deleteFeedbackId = params.feedback_id;
|
|
224
|
+
this.shouldOpenDeleteModal = true;
|
|
225
|
+
return new Promise((resolve) => {
|
|
226
|
+
setTimeout(() => {
|
|
227
|
+
this.deleteModal.open().then(() => resolve(true));
|
|
228
|
+
}, 50);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
async deleteReview() {
|
|
232
|
+
const endpoint = `rating/${this.deleteFeedbackId}`;
|
|
233
|
+
await salla.api.request(endpoint, null, 'delete').then(() => {
|
|
234
|
+
this.deleteModal.close();
|
|
235
|
+
salla.notify.success(this.deletedSuccessfullyLabel);
|
|
236
|
+
setTimeout(() => {
|
|
237
|
+
window.location.reload();
|
|
238
|
+
}, 500);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Show the rating modal
|
|
243
|
+
*/
|
|
244
|
+
async close() {
|
|
245
|
+
return this.modal.close();
|
|
246
|
+
}
|
|
247
|
+
// handle wizard
|
|
248
|
+
handleWizard() {
|
|
249
|
+
this.steps = this.modal.querySelectorAll(".s-rating-modal-step");
|
|
250
|
+
this.dots = this.modal.querySelectorAll(".s-rating-modal-step-dot");
|
|
251
|
+
this.showActiveStep();
|
|
252
|
+
}
|
|
253
|
+
showActiveStep(current = null) {
|
|
254
|
+
this.currentTab = current || this.steps[this.currentIndex];
|
|
255
|
+
Helper.Helper.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', dot => dot != this.dots[this.currentIndex])
|
|
256
|
+
.toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', tab => tab == this.currentTab);
|
|
257
|
+
if (this.currentIndex !== 0) {
|
|
258
|
+
// the animation
|
|
259
|
+
Helper.Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-unactive', 's-rating-modal-hidden', () => true);
|
|
260
|
+
setTimeout(() => Helper.Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-active', 's-rating-modal-unactive', () => true), 300);
|
|
261
|
+
}
|
|
262
|
+
// Btn text
|
|
263
|
+
const nextType = this.steps[this.currentIndex + 1]?.dataset.type;
|
|
264
|
+
this.nextBtn?.setText(nextType ? `${salla.lang.get('pages.rating.rate')} ${salla.lang.get(`pages.rating.${nextType}`)}`
|
|
265
|
+
: salla.lang.get('pages.rating.send_ratings'));
|
|
266
|
+
setTimeout(() => this.body?.setAttribute('style', `height:${this.currentTab?.offsetHeight}px`));
|
|
267
|
+
}
|
|
268
|
+
previousTab() {
|
|
269
|
+
this.currentIndex > 0 && this.currentIndex--;
|
|
270
|
+
Helper.Helper.toggleElementClassIf(this.backBtn, 's-rating-modal-unvisiable', 'block', () => this.currentIndex == 0);
|
|
271
|
+
this.showActiveStep();
|
|
272
|
+
}
|
|
273
|
+
submit() {
|
|
274
|
+
this.submittedBefore() || this.validate();
|
|
275
|
+
salla.config.canLeave = false;
|
|
276
|
+
this.nextBtn.load()
|
|
277
|
+
.then(() => this.submittedBefore() || this.sendFeedback())
|
|
278
|
+
.then(() => this.currentTab.querySelectorAll('[name],.s-rating-modal-btn-star').forEach(el => el.setAttribute('disabled', '')))
|
|
279
|
+
.then(() => this.currentIndex < this.stepsCount && this.currentIndex++)
|
|
280
|
+
.then(() => this.showActiveStep())
|
|
281
|
+
.then(() => Helper.Helper.toggleClassIf('#prev-btn', 'block', 's-rating-modal-unvisiable', () => true))
|
|
282
|
+
.finally(() => {
|
|
283
|
+
this.nextBtn.stop();
|
|
284
|
+
salla.config.canLeave = true;
|
|
285
|
+
if (this.currentIndex == this.stepsCount) {
|
|
286
|
+
this.showThankYou();
|
|
287
|
+
this.showContactWidget = false;
|
|
288
|
+
}
|
|
289
|
+
// this.modal.isClosable = false;
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
submittedBefore() {
|
|
293
|
+
return this.submitted.includes(this.currentIndex);
|
|
294
|
+
}
|
|
295
|
+
validate(rating = null, type = null) {
|
|
296
|
+
if (!rating && this.currentTab.dataset.type === 'products') {
|
|
297
|
+
const ratingForms = this.currentTab.querySelectorAll('.rating-outer-form');
|
|
298
|
+
ratingForms.forEach(ratingForm => this.validate(ratingForm, 'product'));
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
rating = rating || this.currentTab;
|
|
302
|
+
const stars = rating.querySelector('.rating_hidden_input').value;
|
|
303
|
+
const validationMessage = rating.querySelector('.s-rating-modal-validation-msg');
|
|
304
|
+
type = type || rating.dataset.type;
|
|
305
|
+
if (!stars) {
|
|
306
|
+
validationMessage.innerHTML = salla.lang.get(`pages.rating.rate_${type}_stars`).replace(' (:item)', '');
|
|
307
|
+
throw new Error(validationMessage.innerHTML);
|
|
308
|
+
}
|
|
309
|
+
validationMessage.innerHTML = '';
|
|
310
|
+
}
|
|
311
|
+
sendFeedback() {
|
|
312
|
+
const data = {};
|
|
313
|
+
this.currentTab.querySelectorAll('[name]').forEach((input) => {
|
|
314
|
+
//decode names like `<input name="jamal[inner]" value="hi">` to be {name:jamal, value: {inner:"hi"}}
|
|
315
|
+
const inputData = salla.helpers.inputData(input.name, input.value, data);
|
|
316
|
+
data[inputData.name] = inputData.value;
|
|
317
|
+
});
|
|
318
|
+
if (this.allowAttachImages && data.products) {
|
|
319
|
+
for (let productIndex in data.products) {
|
|
320
|
+
if (data.products[productIndex].images) {
|
|
321
|
+
data.products[productIndex].images = data.products[productIndex].images.split(',');
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (Object.keys(data).length == 0) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
data.order_id = this.orderId;
|
|
329
|
+
data.type = this.currentTab.dataset.type;
|
|
330
|
+
this.submitted.push(this.currentIndex);
|
|
331
|
+
return salla.rating.api[this.currentTab.dataset.type](data);
|
|
332
|
+
}
|
|
333
|
+
showThankYou() {
|
|
334
|
+
let seconds = 10;
|
|
335
|
+
let timeToClose = setInterval(() => {
|
|
336
|
+
this.thanksTime.innerHTML = `00:0${seconds--}`;
|
|
337
|
+
if (seconds > 0) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
clearInterval(timeToClose);
|
|
341
|
+
this.thanksTime.remove();
|
|
342
|
+
this.close().then(() => window.location.reload());
|
|
343
|
+
}, 1000);
|
|
344
|
+
this.modal.querySelector('.s-rating-modal-footer').classList.add('s-rating-modal-unvisiable');
|
|
345
|
+
this.showActiveStep(this.thanksTab);
|
|
346
|
+
}
|
|
347
|
+
getFilepondPlaceholder() {
|
|
348
|
+
return `<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${image.ImageIcon}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>
|
|
349
|
+
<span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`;
|
|
350
|
+
}
|
|
351
|
+
getCustomerName() {
|
|
352
|
+
let firstName = salla.config.get('user.first_name') || salla.storage.get('user.first_name') || '';
|
|
353
|
+
let lasName = salla.config.get('user.last_name') || salla.storage.get('user.last_name') || '';
|
|
354
|
+
return `${firstName} ${lasName}`;
|
|
355
|
+
}
|
|
356
|
+
handleSendEmail() {
|
|
357
|
+
const subject = `${this.contactSubjectLabel} #${this.order.id}`;
|
|
358
|
+
const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
|
|
359
|
+
const mailtoLink = `mailto:${salla.config.get('store.contacts.email')}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
|
|
360
|
+
window.open(mailtoLink, '_blank');
|
|
361
|
+
}
|
|
362
|
+
handleSendWhatsApp() {
|
|
363
|
+
const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
|
|
364
|
+
const whatsappLink = `https://wa.me/${salla.config.get('store.contacts.whatsapp')}?text=${encodeURIComponent(body)}`;
|
|
365
|
+
window.open(whatsappLink, '_blank');
|
|
366
|
+
}
|
|
367
|
+
resetData(isOpen) {
|
|
368
|
+
if (isOpen.detail) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
this.modal?.close();
|
|
372
|
+
this.editItem = null;
|
|
373
|
+
this.editItemImages = [];
|
|
374
|
+
this.hiddenInputs[1] && (this.hiddenInputs[1].value = '');
|
|
375
|
+
this.deleteFeedbackId = null;
|
|
376
|
+
this.editFeedbackId = null;
|
|
377
|
+
this.shouldOpenDeleteModal = false;
|
|
378
|
+
this.editMode = false;
|
|
379
|
+
this.deleteMode = false;
|
|
380
|
+
this.defaultMode = false;
|
|
381
|
+
}
|
|
382
|
+
getDeleteModal() {
|
|
383
|
+
return (index.h("salla-modal", { ref: modal => this.deleteModal = modal, width: "xs", onModalVisibilityChanged: (isOpen) => this.resetData(isOpen) }, index.h("div", { class: "s-rating-modal-delete-wrapper", ref: el => this.body = el }, index.h("h3", null, this.confirmDeletionLabel), index.h("p", null, this.areYouSureLabel), index.h("div", { class: "s-rating-modal-delete-actions" }, index.h("salla-button", { loaderPosition: 'center', onClick: () => this.deleteReview() }, this.confirmDeleteBtn), index.h("salla-button", { color: 'danger', fill: 'outline', onClick: () => this.deleteModal.close() }, this.cancelLabel)))));
|
|
384
|
+
}
|
|
385
|
+
renderUploadedImagesCount(productId) {
|
|
386
|
+
// In edit mode, use editItemImages; in default mode, use productImages
|
|
387
|
+
const imageCount = this.editMode ? this.editItemImages.length : (this.productImages[productId] || []).length;
|
|
388
|
+
return (index.h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice("pages.rating.images_count", imageCount, { current: imageCount, total: this.MAX_UPLOAD_LIMIT })));
|
|
389
|
+
}
|
|
390
|
+
getEditModal() {
|
|
391
|
+
return (index.h("salla-modal", { ref: modal => this.editModal = modal, width: "md", onModalVisibilityChanged: (isOpen) => this.resetData(isOpen) }, index.h("div", { class: "s-rating-modal-edit-wrapper", ref: el => this.body = el }, this.editType === "store" && this.editItem ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "store", ref: currentTab => this.currentTab = currentTab }, index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), index.h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), index.h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === "shipping" && this.editItem ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => this.currentTab = currentTab }, this.editItem.shipping.logo
|
|
392
|
+
? index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))
|
|
393
|
+
: index.h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast }), index.h("div", { class: "s-rating-modal-title" }, " ", `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), index.h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == "product" && this.editItem ? index.h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => this.currentTab = currentTab }, index.h("div", { class: "s-rating-modal-product" }, index.h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, index.h("div", { class: "s-rating-modal-product-img-wrap" }, index.h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), index.h("div", { class: "s-rating-modal-product-details" }, index.h("div", { class: "s-rating-modal-product-details-main" }, index.h("div", null, index.h("h3", { class: "s-rating-modal-product-title" }, " ", this.editItem.product.name), index.h("div", { class: "s-rating-modal-stars-product" }, index.h("salla-rating-stars", { withLabel: true, size: "small", editable: true, value: this.editItem.stars }))), this.allowAttachImages && index.h("salla-button", { class: "s-comments-item-like-btn mt-0", loaderPosition: 'center', fill: 'outline', size: 'small', onClick: () => this.toggleUploader(1) }, index.h("span", null, this.editItemImages.length ? this.editImagesLabel : this.addImagesLabel), index.h("span", { innerHTML: image.ImageIcon }))), index.h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "content", class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.allowAttachImages && (index.h("div", { class: "s-rating-modal-uploader is-closed", ref: (el) => (this.contentRefs[1] = el) }, index.h("salla-file-upload", { name: "images", allowMultiple: true, maxFilesCount: this.MAX_UPLOAD_LIMIT, imagePreviewHeight: 117, filePosterHeight: 117, "instant-upload": true, type: "feedback", files: JSON.stringify(this.editItemImages), payloadName: "files[]", id: `file-${this.editItem.product.id}`, title: this.editItem.product.name, instantUpload: true, accept: "image/png, image/jpeg, image/jpg", url: salla.url.api('upload'), onUploaded: (e) => {
|
|
394
|
+
this.editItemImages = [...this.editItemImages, e.detail];
|
|
395
|
+
this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
|
|
396
|
+
}, onRemoved: (e) => {
|
|
397
|
+
const removedId = e.detail;
|
|
398
|
+
if (!removedId)
|
|
399
|
+
return;
|
|
400
|
+
this.editItemImages = this.editItemImages.filter(img => img.id !== removedId);
|
|
401
|
+
this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
|
|
402
|
+
}, labelIdle: this.getFilepondPlaceholder() }), index.h("input", { type: "hidden", name: "images", value: this.editItem.images.join(','), ref: (el) => (this.hiddenInputs[1] = el) }), this.renderUploadedImagesCount(this.editItem.product.id)))))
|
|
403
|
+
: null, index.h("div", { class: "s-rating-modal-footer s-rating-modal-footer-end" }, index.h("salla-button", { "loader-position": 'center', onClick: () => this.editReview() }, this.editReviewLabel)))));
|
|
404
|
+
}
|
|
405
|
+
render() {
|
|
406
|
+
if (this.deleteMode) {
|
|
407
|
+
return index.h(index.Host, { class: "s-rating-modal" }, this.getDeleteModal());
|
|
408
|
+
}
|
|
409
|
+
if (this.editMode) {
|
|
410
|
+
return index.h(index.Host, { class: "s-rating-modal" }, this.getEditModal());
|
|
411
|
+
}
|
|
412
|
+
if (this.defaultMode) {
|
|
413
|
+
return (index.h(index.Host, { class: "s-rating-modal" }, index.h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: (isOpen) => this.resetData(isOpen), isLoading: true, width: "md", ref: modal => this.modal = modal }, index.h("div", { slot: 'loading' }, index.h("div", { class: "s-rating-modal-skeleton" }, index.h("salla-skeleton", { type: 'circle', height: '80px', width: '80px' }), index.h("salla-skeleton", { height: '15px', width: '60%' }), index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("div", { class: "s-rating-modal-skeleton-stars" }, [...Array(5)].map((v) => index.h("div", { key: v, innerHTML: star.WishListIcon }))), index.h("salla-skeleton", { height: '100px', width: '100%' }), index.h("div", { class: "s-rating-modal-skeleton-footer" }, index.h("salla-skeleton", { height: '40px', width: '30%' })))), !this.hasError && this.order
|
|
414
|
+
? [index.h("div", { class: "s-rating-modal-wrapper", ref: el => this.body = el }, this.order?.testimonials_enabled ?
|
|
415
|
+
index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), index.h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large" })), index.h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))
|
|
416
|
+
: '', this.order.products_enabled
|
|
417
|
+
? index.h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products" }, this.order.products.map((item, index$1) => index.h("div", { class: "s-rating-modal-product", key: index$1 }, index.h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, index.h("div", { class: "s-rating-modal-product-img-wrap" }, index.h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), index.h("div", { class: "s-rating-modal-product-details" }, index.h("div", { class: "s-rating-modal-product-details-main" }, index.h("div", null, index.h("h3", { class: "s-rating-modal-product-title" }, " ", item.product.name), index.h("div", { class: "s-rating-modal-stars-product" }, index.h("salla-rating-stars", { withLabel: true, size: "small", name: `products[${index$1}][rating]` }))), this.allowAttachImages && index.h("salla-button", { class: "s-comments-item-like-btn mt-0", loaderPosition: 'center', fill: 'outline', size: 'small', onClick: () => this.toggleUploader(index$1) }, index.h("span", null, this.addImagesLabel), index.h("span", { innerHTML: image.ImageIcon }))), index.h("input", { type: "hidden", name: `products[${index$1}][product_id]`, value: item.product.id }), index.h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: `products[${index$1}][comment]`, class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.allowAttachImages && (index.h("div", { class: "s-rating-modal-uploader is-closed", ref: (el) => (this.contentRefs[index$1] = el) }, index.h("salla-file-upload", { name: "image", maxFilesCount: this.MAX_UPLOAD_LIMIT, imagePreviewHeight: 117, "instant-upload": true, type: "feedback", payloadName: "files[]", id: `file-${item.product.id}`, title: item.product.name, allowMultiple: true, instantUpload: true, accept: "image/png, image/jpeg, image/jpg", url: salla.url.api('upload'), onUploaded: (e) => {
|
|
418
|
+
this.productImages = {
|
|
419
|
+
...this.productImages,
|
|
420
|
+
[item.product.id]: [...(this.productImages[item.product.id] || []), e.detail]
|
|
421
|
+
};
|
|
422
|
+
this.hiddenInputs[index$1].value = this.productImages[item.product.id].map(img => img.url).join(',');
|
|
423
|
+
}, onRemoved: (e) => {
|
|
424
|
+
const removedId = e.detail;
|
|
425
|
+
if (!removedId || !this.productImages[item.product.id])
|
|
426
|
+
return;
|
|
427
|
+
this.productImages = {
|
|
428
|
+
...this.productImages,
|
|
429
|
+
[item.product.id]: this.productImages[item.product.id].filter(img => img.id !== removedId)
|
|
430
|
+
};
|
|
431
|
+
this.hiddenInputs[index$1].value = this.productImages[item.product.id].map(img => img.url).join(',');
|
|
432
|
+
}, labelIdle: this.getFilepondPlaceholder() }), index.h("input", { type: "hidden", name: `products[${index$1}][images]`, value: (this.productImages[item.product.id] || []).map(img => img.url).join(','), ref: (el) => (this.hiddenInputs[index$1] = el) }), this.renderUploadedImagesCount(item.product.id))))))
|
|
433
|
+
: '', this.order.shipping_enabled && this.order.shipping?.company
|
|
434
|
+
? index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, index.h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo
|
|
435
|
+
? index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))
|
|
436
|
+
: index.h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast }), index.h("div", { class: "s-rating-modal-title" }, " ", `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large" })), index.h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))
|
|
437
|
+
: '', index.h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => this.thanksTab = el }, index.h("span", { class: "s-rating-modal-icon", innerHTML: checkCircle2.CheckCircle2 }), index.h("h3", { class: "s-rating-modal-thanks-title" }, salla.lang.get('pages.rating.thanks')), index.h("div", { class: "s-rating-modal-thanks-msg", innerHTML: this.order.thanks_message }), index.h("time", { class: "s-rating-modal-thanks-time", ref: el => this.thanksTime = el }))), this.allowContactSupport && this.showContactWidget && (salla.config.get('store.contacts.whatsapp') || salla.config.get('store.contacts.email')) ? index.h("div", { class: "s-rating-modal-contact" }, index.h("p", null, this.contactUsLabel), index.h("div", { class: "s-rating-modal-contact-icons" }, salla.config.get('store.contacts.whatsapp') && index.h("span", { onClick: () => this.handleSendWhatsApp(), innerHTML: whatsapp2.WhatsappIcon }), salla.config.get('store.contacts.email') && index.h("span", { onClick: () => this.handleSendEmail(), innerHTML: mail.MailIcon }))) : '', index.h("div", { class: "s-rating-modal-footer" }, index.h("button", { ref: el => this.backBtn = el, onClick: () => this.previousTab(), class: "s-rating-modal-btn s-rating-modal-unvisiable" }, salla.lang.get('common.elements.back')), this.stepsCount > 1 ? index.h("ul", { class: "s-rating-modal-dots" }, [0, 1, 2].slice(0, this.stepsCount).map((v) => index.h("li", { key: v, class: 's-rating-modal-bg-gray s-rating-modal-step-dot' }))) : '', index.h("salla-button", { "loader-position": 'center', ref: el => this.nextBtn = el, onClick: () => this.submit() }, salla.lang.get('common.elements.next')))]
|
|
438
|
+
: index.h("salla-placeholder", { alignment: "center" }))));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
componentWillLoad() {
|
|
442
|
+
salla.event.on('rating::open', () => this.open());
|
|
443
|
+
salla.event.on('rating::edit', (params) => this.openEditModal(params));
|
|
444
|
+
salla.event.on('rating::delete', (params) => this.openDeleteModal(params));
|
|
445
|
+
}
|
|
446
|
+
componentDidLoad() {
|
|
447
|
+
salla.event.dispatch('rating::ready', this);
|
|
448
|
+
}
|
|
449
|
+
get host() { return index.getElement(this); }
|
|
450
|
+
};
|
|
451
|
+
SallaRatingModal.style = sallaRatingModalCss;
|
|
452
|
+
|
|
453
|
+
exports.salla_rating_modal = SallaRatingModal;
|