@salla.sa/twilight-components 2.14.352 → 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-XtsZ6xtH.js → filepond-CuKErtOy.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-Bj84Ypvg.js → filepond-plugin-file-poster-d-8BSuST.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-aYfb4yYH.js → filepond-plugin-file-validate-size-zgI_JcqY.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CJsd6rXl.js → filepond-plugin-file-validate-type-Cy8IgG2P.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DRlBSg36.js → filepond-plugin-image-edit-9ZAUzCvh.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-SY8c6DzI.js → filepond-plugin-image-exif-orientation-DzNe_tY2.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-iqhJmUmU.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-Z-cyrNSM.js → index-Ce40E8tZ.js} +136 -12
- package/dist/cjs/{index-C7-280f4.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 +8 -3
- 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-Dq7F5bE1.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-add-product-button/salla-add-product-button.js +18 -6
- package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.js +7 -2
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +39 -8
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +4 -2
- package/dist/collection/components/salla-product-options/salla-product-options.js +36 -3
- package/dist/collection/components/salla-products-list/salla-products-list.js +17 -11
- package/dist/components/index.js +2 -2
- package/dist/components/salla-add-product-button2.js +18 -6
- package/dist/components/salla-app-install-alert.js +7 -2
- package/dist/components/salla-color-picker2.js +38 -7
- package/dist/components/salla-maintenance-alert.js +4 -2
- package/dist/components/salla-product-options2.js +19 -2
- package/dist/components/salla-products-list2.js +17 -11
- 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-Dg4ZKM-u.js → filepond-DEzyRrdH.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BUIjdsnA.js → filepond-plugin-file-poster-DyLcCcHM.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DgZMMqmi.js → filepond-plugin-file-validate-size-Cxp5Yzea.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DA9tDSFr.js → filepond-plugin-file-validate-type-D2qNOQP4.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-dotdnN4Z.js → filepond-plugin-image-edit-DndTlA7m.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-oSI8aLU-.js → filepond-plugin-image-exif-orientation-CiT1CQoK.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DEefQK61.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-D2-TtAhI.js → index-B74h9G6a.js} +137 -13
- package/dist/esm/{index-B7E8Tmgi.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 +8 -3
- 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-DkUGzUrx.js → vanilla-picker-CtwkXTap.js} +1 -1
- package/dist/esm/{whatsapp2-DWksgowB.js → whatsapp2-CgR-T_ZS.js} +2 -2
- package/dist/twilight/{p-7b3ca138.entry.js → p-0134b4fd.entry.js} +1 -1
- package/dist/twilight/{p-0effc34b.entry.js → p-01daaaa6.entry.js} +1 -1
- package/dist/twilight/p-07da7390.entry.js +4 -0
- package/dist/twilight/{p-6ce3f119.entry.js → p-08badc32.entry.js} +1 -1
- package/dist/twilight/{p-4a594c06.entry.js → p-0aa5a12a.entry.js} +1 -1
- package/dist/twilight/{p-e73c28a8.entry.js → p-10dcd981.entry.js} +1 -1
- package/dist/twilight/{p-81df7a2e.entry.js → p-212a0710.entry.js} +1 -1
- package/dist/twilight/p-229275db.entry.js +4 -0
- package/dist/twilight/{p-fea62668.entry.js → p-232185ec.entry.js} +1 -1
- package/dist/twilight/{p-e5c01983.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-6d886b96.entry.js → p-32732ca7.entry.js} +1 -1
- package/dist/twilight/{p-9d35196f.entry.js → p-32ca34ec.entry.js} +1 -1
- package/dist/twilight/{p-2aa0a4e2.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-b9d0212c.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-e26cc25b.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-67c327a8.entry.js → p-6c8f5c94.entry.js} +1 -1
- package/dist/twilight/{p-9b8f5399.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-6b0a03f6.entry.js → p-9051a540.entry.js} +1 -1
- package/dist/twilight/p-9f1c561f.entry.js +4 -0
- package/dist/twilight/{p-B0ba6Gec.js → p-B69XOH6h.js} +2 -2
- package/dist/twilight/{p-D2-TtAhI.js → p-B74h9G6a.js} +2 -2
- package/dist/twilight/{p-C0JNGIpa.js → p-BChI23pG.js} +1 -1
- package/dist/twilight/{p-DhcC83-2.js → p-BCxm-ISm.js} +1 -1
- package/dist/twilight/{p-Cmkcwiop.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-DPqkW1aD.js → p-CQq81yb5.js} +2 -2
- 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-DJ557xys.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-q-O0srMP.js → p-_-aXm0Wb.js} +1 -1
- package/dist/twilight/p-a100bd38.entry.js +4 -0
- package/dist/twilight/{p-cf66ab4d.entry.js → p-a2756650.entry.js} +1 -1
- package/dist/twilight/{p-b1af2aca.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-6c2807c8.entry.js → p-b588ef46.entry.js} +1 -1
- package/dist/twilight/p-b71fc1b5.entry.js +4 -0
- package/dist/twilight/{p-_JhF_Kvb.js → p-bVqtOl1F.js} +1 -1
- package/dist/twilight/{p-a858523c.entry.js → p-bf65b263.entry.js} +1 -1
- package/dist/twilight/{p-d4faa0f6.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-f6ffc708.entry.js → p-d86ce978.entry.js} +1 -1
- package/dist/twilight/{p-8e7fa4a9.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-30403778.entry.js → p-e7813c80.entry.js} +1 -1
- package/dist/twilight/p-ec2fd37e.entry.js +4 -0
- package/dist/twilight/{p-ed60a726.entry.js → p-ec77c523.entry.js} +1 -1
- package/dist/twilight/{p-b208650b.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-db526796.entry.js → p-f57ca123.entry.js} +1 -1
- package/dist/twilight/{p-933881d3.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-9fa5ffcf.entry.js → p-fe983809.entry.js} +1 -1
- package/dist/twilight/{p-Czq4p9Qp.js → p-i5J7XGS6.js} +1 -1
- package/dist/twilight/{p-C2bMx7q5.js → p-shFpk0H3.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +5 -0
- package/dist/types/components/salla-app-install-alert/salla-app-install-alert.d.ts +3 -1
- package/dist/types/components/salla-color-picker/salla-color-picker.d.ts +10 -0
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +8 -1
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +2 -0
- package/dist/types/components.d.ts +4 -0
- package/package.json +5 -5
- package/dist/cjs/salla-accordion_62.cjs.entry.js +0 -22420
- 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 -22339
- 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-01bccbf2.entry.js +0 -4
- package/dist/twilight/p-22d83528.entry.js +0 -4
- package/dist/twilight/p-3a74b551.entry.js +0 -4
- package/dist/twilight/p-4e416704.entry.js +0 -4
- package/dist/twilight/p-5dbf4cec.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-a42d626d.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,163 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, h, a as getElement } from './index-B74h9G6a.js';
|
|
5
|
+
import { a as anime } from './anime.es-CgtvEd63.js';
|
|
6
|
+
import { f as facebook, t as twitter } from './facebook-CO-PeZ27.js';
|
|
7
|
+
import { M as MailIcon } from './mail-DmgxDvXL.js';
|
|
8
|
+
import { C as Cancel } from './cancel-BsLF_HK7.js';
|
|
9
|
+
|
|
10
|
+
var copy_link = `<!-- Generated by IcoMoon.io -->
|
|
11
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
12
|
+
<title>link</title>
|
|
13
|
+
<path d="M19.247 23.019l-4.189 4.189c-2.831 2.831-7.435 2.831-10.265 0-1.371-1.372-2.125-3.193-2.125-5.132s0.755-3.761 2.125-5.133l4.189-4.191c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-4.189 4.191c-1.875 1.875-2.907 4.367-2.907 7.019s1.032 5.143 2.907 7.017 4.368 2.907 7.019 2.907 5.143-1.032 7.017-2.908l4.189-4.189c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.52-1.885 0.001zM22.276 9.724c-0.521-0.521-1.364-0.521-1.885 0l-10.667 10.667c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l10.667-10.667c0.521-0.521 0.521-1.364 0-1.885zM29.093 2.908c-1.875-1.876-4.368-2.908-7.019-2.908s-5.143 1.032-7.017 2.908l-4.189 4.188c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l4.189-4.189c2.831-2.831 7.435-2.831 10.265 0 1.371 1.372 2.125 3.193 2.125 5.132s-0.755 3.761-2.125 5.133l-4.189 4.191c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l4.189-4.191c1.875-1.875 2.907-4.367 2.907-7.019s-1.032-5.143-2.907-7.016z"></path>
|
|
14
|
+
</svg>
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
var whatsapp = `<!-- Generated by IcoMoon.io -->
|
|
18
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
19
|
+
<title>whatsapp</title>
|
|
20
|
+
<path d="M16 32c-0.008 0-0.018 0-0.028 0-3.1 0-5.993-0.887-8.439-2.421l0.066 0.039-7.2 2.3 2.336-6.964c-1.713-2.492-2.736-5.575-2.736-8.897 0-0.020 0-0.040 0-0.060v0.003c0.009-8.833 7.167-15.991 15.999-16h0.001c8.837 0 16 7.163 16 16s-7.163 16-16 16v0zM7.906 27.424l0.4 0.264c2.169 1.449 4.837 2.312 7.707 2.312 7.732 0 14-6.268 14-14s-6.268-14-14-14c-0.004 0-0.009 0-0.013 0h0.001c-7.729 0.008-13.992 6.271-14 13.999v0.001c-0 0.010-0 0.021-0 0.032 0 3.072 1 5.909 2.693 8.206l-0.027-0.038 0.304 0.416-1.4 4.2zM20.716 24.958c-1.684-0.131-3.237-0.574-4.641-1.271l0.073 0.033c-3.098-1.456-5.634-3.668-7.438-6.405l-0.042-0.067c-1.102-1.357-1.819-3.067-1.962-4.938l-0.002-0.030c-0.001-0.036-0.001-0.078-0.001-0.12 0-1.575 0.66-2.995 1.719-4l0.002-0.002c0.547-0.52 1.289-0.839 2.105-0.839 0.033 0 0.066 0.001 0.099 0.002l-0.005-0c0.2 0 0.378 0 0.542 0.018 0.016-0.001 0.035-0.001 0.054-0.001 0.815 0 1.502 0.549 1.711 1.298l0.003 0.012 0.324 0.782c0.376 0.906 0.858 2.068 0.942 2.244 0.144 0.251 0.23 0.552 0.23 0.873 0 0.286-0.068 0.557-0.188 0.797l0.005-0.010c-0.149 0.307-0.332 0.57-0.55 0.802l0.002-0.002c-0.148 0.168-0.248 0.274-0.346 0.378s-0.172 0.18-0.26 0.284c0.575 0.92 1.237 1.713 1.992 2.406l0.008 0.008c0.829 0.758 1.802 1.373 2.872 1.8l0.064 0.022c0.369-0.266 0.672-0.6 0.896-0.985l0.008-0.015 0.174-0.232c0.328-0.484 0.875-0.798 1.495-0.798 0.249 0 0.487 0.051 0.703 0.142l-0.012-0.004c0.492 0.168 2.922 1.372 2.946 1.384l0.228 0.11c0.415 0.149 0.758 0.417 0.996 0.763l0.004 0.007c0.107 0.349 0.169 0.75 0.169 1.166 0 0.591-0.125 1.153-0.349 1.661l0.010-0.026c-0.702 1.368-1.983 2.353-3.511 2.637l-0.031 0.005c-0.309 0.071-0.663 0.112-1.028 0.112-0.004 0-0.007 0-0.011 0h0.001zM10.632 9.318c-0.028-0.002-0.062-0.004-0.095-0.004-0.245 0-0.472 0.076-0.659 0.206l0.004-0.002c-0.726 0.651-1.18 1.591-1.18 2.638 0 0.044 0.001 0.087 0.002 0.13l-0-0.006c0.122 1.404 0.662 2.662 1.495 3.671l-0.009-0.011 0.12 0.168c1.627 2.491 3.865 4.46 6.504 5.723l0.096 0.041c3.136 1.288 3.916 1.124 4.426 1.014 0.87-0.159 1.601-0.656 2.067-1.347l0.007-0.011c0.12-0.316 0.204-0.682 0.237-1.063l0.001-0.015-0.040-0.018-0.256-0.124c-0.8-0.4-2.46-1.2-2.734-1.292l-0.058 0.184c-0.346 0.501-0.684 0.934-1.045 1.347l0.015-0.017c-0.344 0.349-0.821 0.565-1.349 0.565-0.28 0-0.546-0.061-0.785-0.17l0.012 0.005c-1.403-0.547-2.609-1.301-3.646-2.239l0.010 0.009c-0.975-0.891-1.81-1.912-2.486-3.039l-0.034-0.061c-0.152-0.244-0.242-0.54-0.242-0.857 0-0.463 0.191-0.88 0.499-1.178l0-0c0.13-0.162 0.264-0.302 0.4-0.444l0.236-0.256c0.091-0.096 0.177-0.201 0.254-0.311l0.006-0.009c-0.158-0.36-0.622-1.472-0.988-2.352l-0.322-0.772-0.038-0.086c-0.188-0.010-0.302-0.016-0.426-0.016zM12.462 12.442v0.012z"></path>
|
|
21
|
+
</svg>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
var Socials;
|
|
25
|
+
(function (Socials) {
|
|
26
|
+
Socials["FACEBOOK"] = "facebook";
|
|
27
|
+
Socials["TWITTER"] = "twitter";
|
|
28
|
+
Socials["WHATSAPP"] = "whatsapp";
|
|
29
|
+
Socials["EMAIL"] = "email";
|
|
30
|
+
Socials["COPY_LINK"] = "copy_link";
|
|
31
|
+
})(Socials || (Socials = {}));
|
|
32
|
+
|
|
33
|
+
var ShareAlt = `<!-- Generated by IcoMoon.io -->
|
|
34
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
35
|
+
<title>share-alt</title>
|
|
36
|
+
<path d="M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-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.667zM26.667 29.333c-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>
|
|
37
|
+
</svg>
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const sallaSocialShareCss = "";
|
|
41
|
+
|
|
42
|
+
const SallaSocialShare = class {
|
|
43
|
+
constructor(hostRef) {
|
|
44
|
+
registerInstance(this, hostRef);
|
|
45
|
+
this.opened = false;
|
|
46
|
+
this.allPlatforms = [Socials.WHATSAPP, Socials.FACEBOOK, Socials.TWITTER, Socials.EMAIL, Socials.COPY_LINK];
|
|
47
|
+
this.platformIcons = [{ icon: whatsapp, name: Socials.WHATSAPP }, {
|
|
48
|
+
icon: facebook,
|
|
49
|
+
name: Socials.FACEBOOK
|
|
50
|
+
}, { icon: twitter, name: Socials.TWITTER }, { icon: MailIcon, name: Socials.EMAIL }, {
|
|
51
|
+
icon: copy_link,
|
|
52
|
+
name: Socials.COPY_LINK
|
|
53
|
+
}];
|
|
54
|
+
this.convertedPlatforms = [];
|
|
55
|
+
/**
|
|
56
|
+
* page url that will be shared custom | current page url
|
|
57
|
+
*/
|
|
58
|
+
this.url = "";
|
|
59
|
+
/**
|
|
60
|
+
* page url name that will be shared custom | current page url
|
|
61
|
+
*/
|
|
62
|
+
this.urlName = "";
|
|
63
|
+
/**
|
|
64
|
+
* selected platforms to share | all platforms
|
|
65
|
+
*/
|
|
66
|
+
this.platforms = 'facebook,twitter,whatsapp,email,copy_link';
|
|
67
|
+
}
|
|
68
|
+
componentWillLoad() {
|
|
69
|
+
if (this.host.hasAttribute('aria-label')) {
|
|
70
|
+
this.host.removeAttribute('aria-label');
|
|
71
|
+
}
|
|
72
|
+
if (document.getElementById('a2a-script')) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const script = document.createElement('script');
|
|
76
|
+
script.src = 'https://static.addtoany.com/menu/page.js';
|
|
77
|
+
script.setAttribute('id', 'a2a-script');
|
|
78
|
+
script.async = true;
|
|
79
|
+
script.onload = function () {
|
|
80
|
+
window.a2a_config.locale = salla.config.get('user.language_code', salla.lang.getLocale());
|
|
81
|
+
window.a2a_config.callbacks = window.a2a_config.callbacks || [];
|
|
82
|
+
window.a2a_config.callbacks.push({
|
|
83
|
+
share: (data) => {
|
|
84
|
+
// Handle share event
|
|
85
|
+
const shareData = {
|
|
86
|
+
share_via: data.service.toLowerCase(),
|
|
87
|
+
url: data.url,
|
|
88
|
+
title: data.title
|
|
89
|
+
};
|
|
90
|
+
// Dispatch the share event
|
|
91
|
+
salla.event.emit('share-element', shareData);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
document.body.appendChild(script);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Activate or open the share menu.
|
|
99
|
+
*/
|
|
100
|
+
async open() {
|
|
101
|
+
const animateList = new anime.timeline().add({
|
|
102
|
+
targets: this.shareMenu,
|
|
103
|
+
translateY: [-50, 0],
|
|
104
|
+
opacity: [0, 1],
|
|
105
|
+
duration: 300,
|
|
106
|
+
podding: '0',
|
|
107
|
+
easing: 'easeInOutSine'
|
|
108
|
+
});
|
|
109
|
+
animateList.add({
|
|
110
|
+
targets: this.shareMenu.children,
|
|
111
|
+
translateZ: 0,
|
|
112
|
+
translateY: [-30, 0],
|
|
113
|
+
scaleY: [0, 1],
|
|
114
|
+
opacity: [0, 1],
|
|
115
|
+
duration: 1400,
|
|
116
|
+
delay: anime.stagger(100)
|
|
117
|
+
}, '-=200');
|
|
118
|
+
this.opened = !this.opened;
|
|
119
|
+
if (this.opened) {
|
|
120
|
+
this.shareMenu.classList.add('opened');
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
animateList.pause();
|
|
124
|
+
animateList.seek(0);
|
|
125
|
+
this.shareMenu.classList.remove('opened');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Asynchronously initializes the "AddToAny" (a2a) social sharing tool on the current page.
|
|
130
|
+
* If the global object `window.a2a` is available, it initializes the tool with the 'page' mode.
|
|
131
|
+
* The 'page' mode is typically used to enable sharing of the current webpage.
|
|
132
|
+
*
|
|
133
|
+
* @remarks
|
|
134
|
+
* This function is designed to be used in scenarios where dynamic loading or refreshing of social sharing tools is needed.
|
|
135
|
+
* Ensure that the AddToAny script is properly included in the HTML document before calling this function.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* // Call the refresh function to initialize AddToAny on the page.
|
|
139
|
+
* await refresh();
|
|
140
|
+
*
|
|
141
|
+
* @throws {Error} Throws an error if the AddToAny script is not properly included or if there are issues during initialization.
|
|
142
|
+
*
|
|
143
|
+
* @async
|
|
144
|
+
* @returns {Promise<void>} A promise that resolves once the initialization is complete.
|
|
145
|
+
*/
|
|
146
|
+
async refresh() {
|
|
147
|
+
// Attempt to initialize AddToAny with 'page' mode if the global object `window.a2a` is available.
|
|
148
|
+
window.a2a?.init('page');
|
|
149
|
+
}
|
|
150
|
+
render() {
|
|
151
|
+
return (h("div", { key: 'c4ac8faea4a8ec8aa5ba9f4e744710d508387d78', class: "s-social-share-wrapper" }, h("slot", { key: '6c6b54513f67be8818a9a042570286d09b7115f8', name: 'widget' }, h("salla-button", { key: '8a57650940dad634cf3576dada4cc35687ed447c', "aria-label": "Share", onClick: () => this.open(), class: "s-social-share-btn", shape: "icon", fill: "outline", color: "light" }, h("span", { key: '207f2fb0e2f89e7057775153ffcc68eebb069824', innerHTML: this.opened ? Cancel : ShareAlt }))), h("ul", { key: 'fd9b25a483a93efa10994c2a7a876b6741d976c2', ref: el => this.shareMenu = el, class: "s-social-share-list a2a_kit share", "data-a2a-url": this.url ? this.url : window.location.href, "data-a2a-title": this.urlName ? this.urlName : document.title }, this.platforms.split(',').map(platform => {
|
|
152
|
+
return (h("li", null, h("a", { class: `a2a_button_${platform}`, "aria-label": `Share Via ${platform}` }, this.platformIcons.map((icon) => {
|
|
153
|
+
if (icon.name === platform) {
|
|
154
|
+
return h("span", { class: "s-social-share-icon", innerHTML: icon.icon });
|
|
155
|
+
}
|
|
156
|
+
}))));
|
|
157
|
+
}))));
|
|
158
|
+
}
|
|
159
|
+
get host() { return getElement(this); }
|
|
160
|
+
};
|
|
161
|
+
SallaSocialShare.style = sallaSocialShareCss;
|
|
162
|
+
|
|
163
|
+
export { SallaSocialShare as salla_social_share };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, h, H as Host, a as getElement } from './index-
|
|
5
|
-
import { f as facebook, t as twitter } from './
|
|
4
|
+
import { r as registerInstance, h, H as Host, a as getElement } from './index-B74h9G6a.js';
|
|
5
|
+
import { f as facebook, t as twitter } from './facebook-CO-PeZ27.js';
|
|
6
6
|
|
|
7
7
|
var instagram = `<!-- Generated by IcoMoon.io -->
|
|
8
8
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, h, c as createEvent, a as getElement } from './index-B74h9G6a.js';
|
|
5
|
+
|
|
6
|
+
const sallaTabContentCss = "";
|
|
7
|
+
|
|
8
|
+
const SallaTabContent = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.isSelected = false;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Expose self for the parent.
|
|
15
|
+
*/
|
|
16
|
+
async getChild() {
|
|
17
|
+
return {
|
|
18
|
+
selected: this.selected.bind(this),
|
|
19
|
+
unselect: this.unselect.bind(this),
|
|
20
|
+
name: this.name
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
unselect() {
|
|
24
|
+
this.isSelected = false;
|
|
25
|
+
}
|
|
26
|
+
selected() {
|
|
27
|
+
this.isSelected = true;
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const classes = {
|
|
31
|
+
's-tabs-content': true,
|
|
32
|
+
's-tabs-content-selected': this.isSelected
|
|
33
|
+
};
|
|
34
|
+
return (h("div", { key: '6b11ec3a839c759e64e1766de55f9ac1be18931e', class: classes }, h("slot", { key: '17300d7a52e068428ea956b2c5d5be6d0ab69fca' })));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
SallaTabContent.style = sallaTabContentCss;
|
|
38
|
+
|
|
39
|
+
function generateRandomId() {
|
|
40
|
+
return Math.random().toString(36).slice(2, 10);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const sallaTabHeaderCss = "";
|
|
44
|
+
|
|
45
|
+
const SallaTabHeader = class {
|
|
46
|
+
constructor(hostRef) {
|
|
47
|
+
registerInstance(this, hostRef);
|
|
48
|
+
this.tabSelected = createEvent(this, "tabSelected");
|
|
49
|
+
this.id = generateRandomId();
|
|
50
|
+
/**
|
|
51
|
+
* The class applied to the currently active(selected) tab
|
|
52
|
+
*/
|
|
53
|
+
this.activeClass = undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Set the height of the tab bar
|
|
56
|
+
*/
|
|
57
|
+
this.height = undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Center tab items in the given flex.
|
|
60
|
+
*/
|
|
61
|
+
this.centered = false;
|
|
62
|
+
this.isSelected = false;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Expose self for the parent.
|
|
66
|
+
*/
|
|
67
|
+
async getChild() {
|
|
68
|
+
return {
|
|
69
|
+
selected: this.selected.bind(this),
|
|
70
|
+
unselect: this.unselect.bind(this),
|
|
71
|
+
name: this.name,
|
|
72
|
+
id: this.id
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
unselect() {
|
|
76
|
+
this.isSelected = false;
|
|
77
|
+
}
|
|
78
|
+
selected() {
|
|
79
|
+
this.isSelected = true;
|
|
80
|
+
}
|
|
81
|
+
onClick() {
|
|
82
|
+
this.getChild().then(child => {
|
|
83
|
+
this.tabSelected.emit(child);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
const classes = {
|
|
88
|
+
's-tabs-header-item': true,
|
|
89
|
+
's-tabs-bg-normal': true,
|
|
90
|
+
's-tabs-active': this.isSelected,
|
|
91
|
+
};
|
|
92
|
+
return [
|
|
93
|
+
h("div", { key: '08c51c1ad15c6b0efbeb165c89fc7d73748467d0', class: classes, onClick: this.onClick.bind(this) }, h("slot", { key: 'ba5045dab7c254eb4533dc64630ab0c1f561701b' })),
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
SallaTabHeader.style = sallaTabHeaderCss;
|
|
98
|
+
|
|
99
|
+
const sallaTabsCss = ".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";
|
|
100
|
+
|
|
101
|
+
const SallaTabs = class {
|
|
102
|
+
constructor(hostRef) {
|
|
103
|
+
registerInstance(this, hostRef);
|
|
104
|
+
/**
|
|
105
|
+
* Background color
|
|
106
|
+
*/
|
|
107
|
+
this.backgroundColor = undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Align tabs vertically.
|
|
110
|
+
*/
|
|
111
|
+
this.vertical = false;
|
|
112
|
+
}
|
|
113
|
+
componentWillLoad() {
|
|
114
|
+
this.createGroup().then(() => {
|
|
115
|
+
const [group] = this.tabGroup;
|
|
116
|
+
this.selectGroup(group);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
onSelectedTab(event) {
|
|
120
|
+
const group = this.tabGroup.find(group => group.header.id === event.detail.id);
|
|
121
|
+
this.selectGroup(group);
|
|
122
|
+
}
|
|
123
|
+
async createGroup() {
|
|
124
|
+
const tabsHeaderEl = Array.from(this.host.querySelectorAll('salla-tab-header'));
|
|
125
|
+
this.tabsHeader = await Promise.all(tabsHeaderEl.map(async (el) => await el.getChild()));
|
|
126
|
+
const tabsContentEl = Array.from(this.host.querySelectorAll('salla-tab-content'));
|
|
127
|
+
this.tabsContent = await Promise.all(tabsContentEl.map(async (el) => await el.getChild()));
|
|
128
|
+
this.tabGroup = this.tabsHeader.map(header => {
|
|
129
|
+
const content = this.tabsContent.find(content => content.name === header.name);
|
|
130
|
+
return {
|
|
131
|
+
header: header,
|
|
132
|
+
content: content
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
selectGroup(group) {
|
|
137
|
+
this.tabGroup.map(g => {
|
|
138
|
+
g.header.unselect();
|
|
139
|
+
g.content.unselect();
|
|
140
|
+
});
|
|
141
|
+
group.header.selected();
|
|
142
|
+
group.content.selected();
|
|
143
|
+
}
|
|
144
|
+
render() {
|
|
145
|
+
return [
|
|
146
|
+
h("div", { key: '3195e8954179d52867093b5e861b3c0caa6d7af6', class: "s-tabs" }, h("div", { key: 'cf75a77b6cc9b9cd288e963ee56acf19e177029a', class: "s-tabs-header" }, h("slot", { key: 'fa345597be2fbb8ff4f1cb420a030c5ec821bc8b', name: "header" })), h("div", { key: 'f7fd939608e5341b6d9c1d75e7d9dc909a4d8912', class: "s-tabs-content-wrapper" }, h("slot", { key: '86ce2c9bcb3be06264e75369a6be81b2e1361619', name: "content" })))
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
get host() { return getElement(this); }
|
|
150
|
+
};
|
|
151
|
+
SallaTabs.style = sallaTabsCss;
|
|
152
|
+
|
|
153
|
+
export { SallaTabContent as salla_tab_content, SallaTabHeader as salla_tab_header, SallaTabs as salla_tabs };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, h, a as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, h, a as getElement } from './index-B74h9G6a.js';
|
|
5
5
|
|
|
6
6
|
const sallaTooltipCss = ".s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:\"\";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}";
|
|
7
7
|
|
|
@@ -0,0 +1,273 @@
|
|
|
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 { A as ArrowDown } from './keyboard_arrow_down-DCZbpt2a.js';
|
|
6
|
+
import { B as BellRing } from './bell-ring-D3mWkc-3.js';
|
|
7
|
+
import { P as PendingOrdersIcon } from './cart-DY4LZmNP.js';
|
|
8
|
+
import { W as WishListIcon } from './star-ZT7ehBBk.js';
|
|
9
|
+
import { C as Cancel } from './cancel-BsLF_HK7.js';
|
|
10
|
+
import { S as Star } from './star2-D4oPi1Ov.js';
|
|
11
|
+
import { l as loyaltyProgramIcon } from './gift-BChI23pG.js';
|
|
12
|
+
|
|
13
|
+
var OrderIcon = `<!-- Generated by IcoMoon.io -->
|
|
14
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
15
|
+
<title>box-bankers</title>
|
|
16
|
+
<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>
|
|
17
|
+
</svg>
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
var UserCircle = `<!-- Generated by IcoMoon.io -->
|
|
21
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
22
|
+
<title>user-circle</title>
|
|
23
|
+
<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>
|
|
24
|
+
</svg>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
var LogoutIcon = `<!-- Generated by IcoMoon.io -->
|
|
28
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
29
|
+
<title>send-out</title>
|
|
30
|
+
<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>
|
|
31
|
+
</svg>
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
var WalletIcon = `<!-- Generated by IcoMoon.io -->
|
|
35
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
36
|
+
<title>wallet</title>
|
|
37
|
+
<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>
|
|
38
|
+
</svg>
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
var SettingstIcon = `<!-- Generated by IcoMoon.io -->
|
|
42
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
43
|
+
<title>settings</title>
|
|
44
|
+
<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.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.333zM16.016 18.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>
|
|
45
|
+
</svg>
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const sallaUserMenuCss = "";
|
|
49
|
+
|
|
50
|
+
const SallaUserMenu = class {
|
|
51
|
+
constructor(hostRef) {
|
|
52
|
+
registerInstance(this, hostRef);
|
|
53
|
+
this.accountLoading = false;
|
|
54
|
+
this.opened = false;
|
|
55
|
+
this.notifications = salla.lang.get('common.titles.notifications');
|
|
56
|
+
this.orders = salla.lang.get('common.titles.orders');
|
|
57
|
+
this.pending_orders = salla.lang.get('common.titles.pending_orders');
|
|
58
|
+
this.wishlist = salla.lang.get('common.titles.wishlist');
|
|
59
|
+
this.profile = salla.lang.get('common.titles.profile');
|
|
60
|
+
this.rating = salla.lang.get('common.titles.rating');
|
|
61
|
+
this.wallet = salla.lang.get('common.titles.wallet');
|
|
62
|
+
this.settings = salla.lang.get('common.titles.settings');
|
|
63
|
+
this.loyalty_program = salla.lang.get('pages.loyalty_program.loyalty_points');
|
|
64
|
+
this.logout = salla.lang.get('blocks.header.logout');
|
|
65
|
+
this.hello = salla.lang.get('pages.checkout.hello');
|
|
66
|
+
this.first_name = salla.storage.get('user.first_name') || '';
|
|
67
|
+
this.last_name = salla.storage.get('user.last_name') || '';
|
|
68
|
+
this.avatar = salla.storage.get('user.avatar') || salla.url.cdn('images/avatar.png', 40, 40);
|
|
69
|
+
this.badges = {
|
|
70
|
+
notifications: salla.helpers.number(salla.storage.get('user.notifications') || 0),
|
|
71
|
+
pending_orders: salla.helpers.number(salla.storage.get('user.pending_orders') || 0),
|
|
72
|
+
};
|
|
73
|
+
this.sallaAccountEnabled = false;
|
|
74
|
+
this.hasBadges = Number(salla.storage.get('user.pending_orders')) > 0 ||
|
|
75
|
+
Number(salla.storage.get('user.notifications')) > 0;
|
|
76
|
+
/**
|
|
77
|
+
* To display only the list without the dropdown functionality
|
|
78
|
+
*/
|
|
79
|
+
this.inline = false;
|
|
80
|
+
/**
|
|
81
|
+
* To display the trigger as an avatar only
|
|
82
|
+
*/
|
|
83
|
+
this.avatarOnly = false;
|
|
84
|
+
/**
|
|
85
|
+
* To display the dropdown header in mobile sheet
|
|
86
|
+
*/
|
|
87
|
+
this.showHeader = false;
|
|
88
|
+
/**
|
|
89
|
+
* To Make the dropdown menu relative to parent element or not
|
|
90
|
+
*/
|
|
91
|
+
this.relativeDropdown = false;
|
|
92
|
+
this.onClickOutside = () => {
|
|
93
|
+
this.opened = false;
|
|
94
|
+
};
|
|
95
|
+
this.OrderUpdate = 0;
|
|
96
|
+
this.items = {
|
|
97
|
+
notifications: BellRing,
|
|
98
|
+
orders: OrderIcon,
|
|
99
|
+
pending_orders: PendingOrdersIcon,
|
|
100
|
+
wishlist: WishListIcon,
|
|
101
|
+
wallet: WalletIcon,
|
|
102
|
+
loyalty_program: loyaltyProgramIcon,
|
|
103
|
+
profile: UserCircle
|
|
104
|
+
};
|
|
105
|
+
// salla.auth.event.onLoggedIn(() => {
|
|
106
|
+
// this.is_loggedIn = true
|
|
107
|
+
// })
|
|
108
|
+
salla.lang.onLoaded(() => {
|
|
109
|
+
this.notifications = salla.lang.get('common.titles.notifications');
|
|
110
|
+
this.orders = salla.lang.get('common.titles.orders');
|
|
111
|
+
this.pending_orders = salla.lang.get('common.titles.pending_orders');
|
|
112
|
+
this.wishlist = salla.lang.get('common.titles.wishlist');
|
|
113
|
+
this.profile = salla.lang.get('common.titles.profile');
|
|
114
|
+
this.hello = salla.lang.get('pages.checkout.hello');
|
|
115
|
+
this.rating = salla.lang.get('common.titles.rating');
|
|
116
|
+
this.wallet = salla.lang.get('common.titles.wallet');
|
|
117
|
+
this.settings = salla.lang.get('common.titles.settings');
|
|
118
|
+
this.loyalty_program = salla.lang.get('pages.loyalty_program.loyalty_points');
|
|
119
|
+
this.logout = salla.lang.get('blocks.header.logout');
|
|
120
|
+
});
|
|
121
|
+
Salla.onReady(() => {
|
|
122
|
+
if (salla.config.isGuest()) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
this.is_loggedIn = true;
|
|
126
|
+
/**
|
|
127
|
+
* Get Fresh Notifications In These Cases:
|
|
128
|
+
* - is notification page, if user already changed the status of his orders (to reset notification badge)
|
|
129
|
+
* - is pending orders page, if user already changed the status of his orders (to reset orders badge)
|
|
130
|
+
* - is profile page, in case user changed his name or avatar, we need to update it
|
|
131
|
+
* - half hour is passed from the last user data fetched
|
|
132
|
+
*
|
|
133
|
+
* //todo:: update the data in the storage in customer pages
|
|
134
|
+
* //todo:: cover two requests in customer pages
|
|
135
|
+
* //todo:: make sure to run this only after token is set
|
|
136
|
+
*/
|
|
137
|
+
const shouldFetchProfile = !this.inline &&
|
|
138
|
+
(salla.url.is_page('customer.notifications') ||
|
|
139
|
+
salla.url.is_page('customer.orders.index.pending') ||
|
|
140
|
+
salla.url.is_page('customer.profile') ||
|
|
141
|
+
(Date.now() - (salla.storage.get('user.fetched_at') || 0)) / 1000 / 60 > 30);
|
|
142
|
+
if (shouldFetchProfile) {
|
|
143
|
+
this.fetchFreshProfile();
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
salla.event.on('profile::info.fetched', res => {
|
|
147
|
+
this.updateProfileState(res);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
async componentWillLoad() {
|
|
153
|
+
await salla.onReady();
|
|
154
|
+
await salla.lang.onLoaded();
|
|
155
|
+
Salla.event.on('api::token.injected', (token) => this.profileUrl = this.buildProfileUrl(token));
|
|
156
|
+
this.sallaAccountEnabled = Salla.config.get('store.features')?.includes('salla-account');
|
|
157
|
+
this.items = this.sallaAccountEnabled ? { ...this.items, settings: SettingstIcon } : this.items;
|
|
158
|
+
//we need it only in theme-y
|
|
159
|
+
if (this.host.hasAttribute('with-rating')) {
|
|
160
|
+
this.items.rating = Star;
|
|
161
|
+
}
|
|
162
|
+
//we need it to be the last item
|
|
163
|
+
this.items.logout = LogoutIcon;
|
|
164
|
+
let token = Salla.storage.get('token');
|
|
165
|
+
if (!token) {
|
|
166
|
+
token = '';
|
|
167
|
+
}
|
|
168
|
+
this.profileUrl = this.buildProfileUrl(token);
|
|
169
|
+
const trigger = this.host.querySelector('[slot="trigger"]');
|
|
170
|
+
this.triggerSlot =
|
|
171
|
+
'<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>';
|
|
172
|
+
if (!trigger) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
this.triggerSlot = trigger.innerHTML;
|
|
176
|
+
trigger.innerHTML = this.replaceParams(trigger.innerHTML);
|
|
177
|
+
}
|
|
178
|
+
fetchFreshProfile() {
|
|
179
|
+
//don't request fetchFreshProfile unless token is injected into the api
|
|
180
|
+
if (!salla.api.token) {
|
|
181
|
+
salla.log('trying to fetchFreshProfile before injected the token!!');
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
salla.profile.api.info().then(res => {
|
|
185
|
+
this.updateProfileState(res);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
updateProfileState(res) {
|
|
189
|
+
this.badges = {
|
|
190
|
+
notifications: salla.helpers.number(res.data.notifications || 0),
|
|
191
|
+
pending_orders: salla.helpers.number(res.data.pending_orders || 0),
|
|
192
|
+
};
|
|
193
|
+
this.hasBadges = Number(res.data.pending_orders) > 0 || Number(res.data.notifications) > 0;
|
|
194
|
+
this.first_name = res.data.first_name;
|
|
195
|
+
this.last_name = res.data.last_name;
|
|
196
|
+
this.avatar = res.data.avatar || salla.url.cdn('images/avatar.png', 40, 40);
|
|
197
|
+
}
|
|
198
|
+
async open(e) {
|
|
199
|
+
this.opened = !this.opened;
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
if (this.opened) {
|
|
202
|
+
window.addEventListener('click', this.onClickOutside);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
menuItemClicked(event, itemKey) {
|
|
206
|
+
if (itemKey !== 'logout') {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
salla.auth.logout('sall-user-menu');
|
|
211
|
+
}
|
|
212
|
+
replaceParams(body) {
|
|
213
|
+
return body
|
|
214
|
+
.replace(/\{hello\}/g, this.hello)
|
|
215
|
+
.replace(/\{first_name\}/g, this.first_name)
|
|
216
|
+
.replace(/\{last_name\}/g, this.last_name)
|
|
217
|
+
.replace(/\{avatar\}/g, this.avatar)
|
|
218
|
+
.replace(/\{icon\}/g, ArrowDown);
|
|
219
|
+
}
|
|
220
|
+
getTheHeader() {
|
|
221
|
+
return (h("div", { class: {
|
|
222
|
+
's-user-menu-trigger-slot': true,
|
|
223
|
+
's-user-menu-red-dot': this.hasBadges,
|
|
224
|
+
's-user-menu-trigger-avatar-only': this.avatarOnly,
|
|
225
|
+
}, id: "trigger-slot", onClick: e => this.open(e), onKeyUp: e => this.open(e), innerHTML: this.replaceParams(this.triggerSlot) }));
|
|
226
|
+
}
|
|
227
|
+
getItemAnchorLinkAttrs(itemKey) {
|
|
228
|
+
if (itemKey === 'profile' && this.profileUrl && this.sallaAccountEnabled) {
|
|
229
|
+
return { href: this.profileUrl, target: '_blank', rel: 'noopener noreferrer' };
|
|
230
|
+
}
|
|
231
|
+
// Fix loyalty program URL mapping from master
|
|
232
|
+
const urlKey = itemKey === 'loyalty_program' ? 'loyalty' : itemKey;
|
|
233
|
+
return { href: Salla.url.get(urlKey) };
|
|
234
|
+
}
|
|
235
|
+
getMenuItem([itemKey, itemValue], i) {
|
|
236
|
+
//todo:: enhancement support slot here
|
|
237
|
+
if (itemKey === 'wallet' && !window.can_access_wallet)
|
|
238
|
+
return;
|
|
239
|
+
if (itemKey === 'loyalty_program' && !Salla.config.get('store.features').includes('loyalty-system'))
|
|
240
|
+
return;
|
|
241
|
+
return (h("li", { class: {
|
|
242
|
+
's-user-menu-dropdown-item': true,
|
|
243
|
+
's-user-menu-dropdown-item-logout': i + 1 === Object.entries(this.items).length,
|
|
244
|
+
} }, h("a", { ...this.getItemAnchorLinkAttrs(itemKey), class: "s-user-menu-dropdown-item-link", onClick: event => this.menuItemClicked(event, itemKey) }, h("i", { class: "s-user-menu-dropdown-item-prefix", innerHTML: itemValue }), h("span", { class: "s-user-menu-dropdown-item-title" }, this[itemKey]), !['٠', '0', undefined].includes(this.badges[itemKey]) ? (h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[itemKey])) : (''))));
|
|
245
|
+
}
|
|
246
|
+
componentShouldUpdate() {
|
|
247
|
+
if (!this.opened) {
|
|
248
|
+
window.removeEventListener('click', this.onClickOutside);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
render() {
|
|
252
|
+
if (!this.is_loggedIn) {
|
|
253
|
+
return (h(Host, null, h("slot", { name: "login-btn" }, h("button", { type: "button", class: "s-user-menu-login-btn", onClick: () => salla.event.dispatch('login::open'), innerHTML: UserCircle }))));
|
|
254
|
+
}
|
|
255
|
+
if (this.inline) {
|
|
256
|
+
return (h(Host, null, h("ul", { class: "s-user-menu-inline" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i)))));
|
|
257
|
+
}
|
|
258
|
+
return (h(Host, null, h("div", { class: {
|
|
259
|
+
's-user-menu-wrapper': true,
|
|
260
|
+
's-user-menu-relative-dropdown': this.relativeDropdown,
|
|
261
|
+
} }, this.getTheHeader(), h("div", { class: { 's-user-menu-toggler': true, opened: this.opened } }, h("div", { class: "s-user-menu-dropdown", onClick: e => e.stopPropagation(), onKeyUp: e => e.stopPropagation() }, this.showHeader ? (h("div", { class: "s-user-menu-dropdown-header" }, h("img", { src: this.avatar, alt: `${this.first_name} ${this.last_name}` }), h("div", { class: "s-user-menu-dropdown-header-content" }, h("span", null, this.hello), h("p", null, this.first_name, " ", this.last_name)), h("button", { type: 'button', class: "s-user-menu-dropdown-header-close", innerHTML: Cancel, onClick: () => { this.opened = false; } }))) : (''), h("ul", { class: "s-user-menu-dropdown-list" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))))))));
|
|
262
|
+
}
|
|
263
|
+
componentDidLoad() {
|
|
264
|
+
document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));
|
|
265
|
+
}
|
|
266
|
+
buildProfileUrl(token) {
|
|
267
|
+
return `${Salla.config.get('account.url', 'https://accounts.salla.com')}/${salla.config.get('user.language_code')}/user?store=${Salla.config.get('store.id')}&info=${encodeURIComponent(token)}`;
|
|
268
|
+
}
|
|
269
|
+
get host() { return getElement(this); }
|
|
270
|
+
};
|
|
271
|
+
SallaUserMenu.style = sallaUserMenuCss;
|
|
272
|
+
|
|
273
|
+
export { SallaUserMenu as salla_user_menu };
|