@salla.sa/twilight-components 2.14.245 → 2.14.246
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/{app-globals-BlXsYXPz.js → app-globals-BHtaAN5N.js} +3 -3
- package/dist/cjs/{app-globals-BlXsYXPz.js.map → app-globals-BHtaAN5N.js.map} +1 -1
- package/dist/cjs/{index-RtQ2qsYM.js → index-BkPZ5Jxw.js} +4 -4
- package/dist/cjs/index-BkPZ5Jxw.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.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-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{app-globals-bcy23yOg.js → app-globals-CF1QEvCE.js} +3 -3
- package/dist/esm/{app-globals-bcy23yOg.js.map → app-globals-CF1QEvCE.js.map} +1 -1
- package/dist/esm/{index-TfrZPiHM.js → index-DlD7eZu1.js} +4 -4
- package/dist/esm/index-DlD7eZu1.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body.entry.js +1 -1
- package/dist/esm/salla-accordion-head.entry.js +1 -1
- package/dist/esm/salla-accordion.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-summary.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-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm-es5/{app-globals-bcy23yOg.js → app-globals-CF1QEvCE.js} +2 -2
- package/dist/esm-es5/{app-globals-bcy23yOg.js.map → app-globals-CF1QEvCE.js.map} +1 -1
- package/dist/esm-es5/{index-TfrZPiHM.js → index-DlD7eZu1.js} +3 -3
- package/dist/esm-es5/index-DlD7eZu1.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
- package/dist/esm-es5/salla-accordion.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +2 -2
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +2 -2
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-a3575677.system.entry.js → p-008098b0.system.entry.js} +2 -2
- package/dist/twilight/{p-6dd8e040.system.entry.js → p-07012c17.system.entry.js} +2 -2
- package/dist/twilight/{p-f3b9bca4.entry.js → p-07890c65.entry.js} +7 -7
- package/dist/twilight/{p-29c5e915.entry.js → p-162ff321.entry.js} +2 -2
- package/dist/twilight/{p-4c4f98b4.system.entry.js → p-1b10ad6d.system.entry.js} +2 -2
- package/dist/twilight/{p-ce9cde22.entry.js → p-1e41fb84.entry.js} +2 -2
- package/dist/twilight/{p-9b4e8457.system.entry.js → p-1e49477f.system.entry.js} +2 -2
- package/dist/twilight/{p-D_HaOyHH.system.js.map → p-1qAo3Rae.system.js.map} +1 -1
- package/dist/twilight/{p-af63e71c.entry.js → p-203da90b.entry.js} +2 -2
- package/dist/twilight/{p-b9a143df.system.entry.js → p-29a4d594.system.entry.js} +2 -2
- package/dist/twilight/{p-cb22e781.entry.js → p-2bfe6c27.entry.js} +2 -2
- package/dist/twilight/p-313af071.system.entry.js +5 -0
- package/dist/twilight/{p-fbe14a39.system.entry.js → p-44d2bb6c.system.entry.js} +2 -2
- package/dist/twilight/{p-3bdcb368.system.entry.js → p-47a60d91.system.entry.js} +2 -2
- package/dist/twilight/{p-827c909f.system.entry.js → p-528cbe36.system.entry.js} +2 -2
- package/dist/twilight/{p-dc026fbc.system.entry.js → p-52ce19d1.system.entry.js} +3 -3
- package/dist/twilight/{p-24389b0b.entry.js → p-559c692e.entry.js} +2 -2
- package/dist/twilight/{p-279daf34.entry.js → p-57039aab.entry.js} +2 -2
- package/dist/twilight/{p-4d0b108b.system.entry.js → p-5758d15d.system.entry.js} +2 -2
- package/dist/twilight/{p-d270386d.entry.js → p-60e5a6db.entry.js} +2 -2
- package/dist/twilight/{p-28aa32df.entry.js → p-62168e2f.entry.js} +2 -2
- package/dist/twilight/{p-e477c1c4.system.entry.js → p-673042f2.system.entry.js} +3 -3
- package/dist/twilight/{p-0cfd54f6.system.entry.js → p-707b4a65.system.entry.js} +2 -2
- package/dist/twilight/{p-849b5b1c.entry.js → p-70baa1fc.entry.js} +2 -2
- package/dist/twilight/{p-6b501ee0.entry.js → p-75ee65ba.entry.js} +2 -2
- package/dist/twilight/{p-854c5ca2.entry.js → p-7982c0dc.entry.js} +2 -2
- package/dist/twilight/{p-b78ec488.system.entry.js → p-7bc976ab.system.entry.js} +2 -2
- package/dist/twilight/{p-d21d5b8d.entry.js → p-7c231938.entry.js} +2 -2
- package/dist/twilight/{p-94cd1015.entry.js → p-801dd66d.entry.js} +2 -2
- package/dist/twilight/{p-ba5e89ed.entry.js → p-80d1d13f.entry.js} +2 -2
- package/dist/twilight/{p-0a4eec00.system.entry.js → p-80dbb8ec.system.entry.js} +2 -2
- package/dist/twilight/{p-4e8e00aa.system.entry.js → p-810af197.system.entry.js} +2 -2
- package/dist/twilight/{p-5dc4a5c0.system.entry.js → p-810dd86a.system.entry.js} +2 -2
- package/dist/twilight/{p-2b355c74.entry.js → p-8408e149.entry.js} +2 -2
- package/dist/twilight/{p-a9ed20d0.entry.js → p-8ac928af.entry.js} +2 -2
- package/dist/twilight/{p-b8acf49a.system.entry.js → p-8eabe907.system.entry.js} +2 -2
- package/dist/twilight/{p-1df83439.entry.js → p-929e9291.entry.js} +2 -2
- package/dist/twilight/{p-74a31a87.entry.js → p-9c170c94.entry.js} +2 -2
- package/dist/twilight/{p-bba0aa9c.entry.js → p-9f703f6a.entry.js} +2 -2
- package/dist/twilight/{p-BvZNuO_k.system.js.map → p-B07iv4_H.system.js.map} +1 -1
- package/dist/twilight/{p-D_z7TtNm.system.js.map → p-BB0kBywP.system.js.map} +1 -1
- package/dist/twilight/{p-aJW8CizZ.system.js.map → p-BCXDqz7X.system.js.map} +1 -1
- package/dist/twilight/{p-DvSLTuZM.system.js.map → p-BMaA_oI1.system.js.map} +1 -1
- package/dist/twilight/{p-CCEzoQkr.system.js.map → p-Ba0rAqQK.system.js.map} +1 -1
- package/dist/twilight/{p-C1j2Mybi.system.js.map → p-Bj9hNWTX.system.js.map} +1 -1
- package/dist/twilight/{p-B7YoCPUj.system.js.map → p-Bk1965BP.system.js.map} +1 -1
- package/dist/twilight/{p-lQgQAXVy.system.js → p-BkyygBuT.system.js} +2 -2
- package/dist/twilight/{p-lQgQAXVy.system.js.map → p-BkyygBuT.system.js.map} +1 -1
- package/dist/twilight/{p-LtKpVQSC.system.js.map → p-BsEeqA9d.system.js.map} +1 -1
- package/dist/twilight/{p-CRWuiy2w.system.js.map → p-BurPaBww.system.js.map} +1 -1
- package/dist/twilight/{p-DdS70ik4.system.js → p-BvBZtfDx.system.js} +2 -2
- package/dist/twilight/{p-DdS70ik4.system.js.map → p-BvBZtfDx.system.js.map} +1 -1
- package/dist/twilight/{p-v5fCQxe_.system.js.map → p-BvaTYU0Y.system.js.map} +1 -1
- package/dist/twilight/{p-D_KVdrk5.system.js.map → p-C3hekSf2.system.js.map} +1 -1
- package/dist/twilight/{p-Bf2t4sS7.system.js.map → p-C7A6mH1h.system.js.map} +1 -1
- package/dist/twilight/{p-BoRn76FR.system.js → p-CLm1RVuI.system.js} +3 -3
- package/dist/twilight/p-CLm1RVuI.system.js.map +1 -0
- package/dist/twilight/{p-DBQBFt5P.system.js.map → p-CV33cGKg.system.js.map} +1 -1
- package/dist/twilight/{p-CF-5c0k9.system.js.map → p-C_WrH2SY.system.js.map} +1 -1
- package/dist/twilight/{p-CcD3fLs8.system.js.map → p-CffDHVtM.system.js.map} +1 -1
- package/dist/twilight/{p-D664QZA6.system.js.map → p-CgCixa4P.system.js.map} +1 -1
- package/dist/twilight/{p-CjjN4fNH.system.js.map → p-Cwkm1k8l.system.js.map} +1 -1
- package/dist/twilight/{p-DfdxbQJV.system.js.map → p-Cy-DpNWJ.system.js.map} +1 -1
- package/dist/twilight/{p-g6P5C1-t.system.js.map → p-Czgd3k-A.system.js.map} +1 -1
- package/dist/twilight/{p-iC1de6J3.system.js.map → p-D-a3Wsom.system.js.map} +1 -1
- package/dist/twilight/{p-CfD5WVsV.js → p-DMFoOvgF.js} +2 -2
- package/dist/twilight/{p-CfD5WVsV.js.map → p-DMFoOvgF.js.map} +1 -1
- package/dist/twilight/{p-CPLroejr.system.js.map → p-DfE_9WEq.system.js.map} +1 -1
- package/dist/twilight/{p-BZNK2OhY.system.js.map → p-DhE4-yS0.system.js.map} +1 -1
- package/dist/twilight/{p-TfrZPiHM.js → p-DlD7eZu1.js} +3 -3
- package/dist/twilight/p-DlD7eZu1.js.map +1 -0
- package/dist/twilight/{p-DYlJ4rm0.system.js.map → p-Dvp0mSsf.system.js.map} +1 -1
- package/dist/twilight/{p-IP42L3Dw.system.js.map → p-DyBElJSY.system.js.map} +1 -1
- package/dist/twilight/{p-OD5oRGeI.system.js.map → p-ITnhXfq_.system.js.map} +1 -1
- package/dist/twilight/{p-qe0eSxJZ.system.js.map → p-J1R6tsIK.system.js.map} +1 -1
- package/dist/twilight/{p-C_0z-awL.system.js.map → p-MXH_Q7Te.system.js.map} +1 -1
- package/dist/twilight/{p-NOU_yaZT.system.js.map → p-PpK4mDCG.system.js.map} +1 -1
- package/dist/twilight/{p-Bz6T5olt.system.js.map → p-VidX-FZg.system.js.map} +1 -1
- package/dist/twilight/{p-CcQg-RDM.system.js.map → p-XPLviwNd.system.js.map} +1 -1
- package/dist/twilight/{p-B4IOZQq2.system.js.map → p-YmS9fQje.system.js.map} +1 -1
- package/dist/twilight/{p-12d56016.system.entry.js → p-a285e2ca.system.entry.js} +2 -2
- package/dist/twilight/{p-eda69b6f.entry.js → p-a3c2dfa3.entry.js} +2 -2
- package/dist/twilight/{p-2d61d0e7.entry.js → p-a6591ae4.entry.js} +2 -2
- package/dist/twilight/p-a67fd8f2.entry.js +5 -0
- package/dist/twilight/{p-021b3219.entry.js → p-a76a8fa1.entry.js} +2 -2
- package/dist/twilight/{p-f9464d95.entry.js → p-aba9553d.entry.js} +2 -2
- package/dist/twilight/{p-41c5db98.system.entry.js → p-b16b1101.system.entry.js} +2 -2
- package/dist/twilight/p-b1cb35b0.system.entry.js +5 -0
- package/dist/twilight/{p-ee6033a9.entry.js → p-b2ebbc79.entry.js} +2 -2
- package/dist/twilight/{p-de5cdbf2.system.entry.js → p-b4ffaa66.system.entry.js} +2 -2
- package/dist/twilight/{p-d552d660.system.entry.js → p-b5a9201e.system.entry.js} +2 -2
- package/dist/twilight/{p-90535622.system.entry.js → p-b82da45c.system.entry.js} +2 -2
- package/dist/twilight/{p-7273395e.system.entry.js → p-be0e05db.system.entry.js} +2 -2
- package/dist/twilight/{p-fca90326.entry.js → p-c09a7b4c.entry.js} +2 -2
- package/dist/twilight/{p-1f975387.entry.js → p-c87b3c18.entry.js} +2 -2
- package/dist/twilight/{p-5d14ab42.entry.js → p-cebb691f.entry.js} +2 -2
- package/dist/twilight/{p-f5d36cd6.system.entry.js → p-d28f73be.system.entry.js} +2 -2
- package/dist/twilight/{p-bf2e161f.entry.js → p-d481d138.entry.js} +2 -2
- package/dist/twilight/{p-377e8ae9.system.entry.js → p-dafaf654.system.entry.js} +2 -2
- package/dist/twilight/{p-e45f155c.system.entry.js → p-dcfa1dba.system.entry.js} +2 -2
- package/dist/twilight/{p-25614273.system.entry.js → p-dd817609.system.entry.js} +2 -2
- package/dist/twilight/{p-20a58fc9.entry.js → p-dde23dab.entry.js} +2 -2
- package/dist/twilight/{p-d149c3b0.system.entry.js → p-df337e06.system.entry.js} +2 -2
- package/dist/twilight/{p-929164d2.system.entry.js → p-e9cdd4ab.system.entry.js} +2 -2
- package/dist/twilight/{p-853399af.entry.js → p-ed414623.entry.js} +2 -2
- package/dist/twilight/{p-45f5b923.entry.js → p-f0dff388.entry.js} +2 -2
- package/dist/twilight/{p-fcea3994.system.entry.js → p-f70fa2de.system.entry.js} +2 -2
- package/dist/twilight/{p-9d5433ec.system.entry.js → p-fba8e69a.system.entry.js} +2 -2
- package/dist/twilight/{p-CwAje28k.system.js.map → p-rjcC9WwP.system.js.map} +1 -1
- package/dist/twilight/{p-DmBhTkzL.system.js.map → p-zWvh6Hml.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-RtQ2qsYM.js.map +0 -1
- package/dist/esm/index-TfrZPiHM.js.map +0 -1
- package/dist/esm-es5/index-TfrZPiHM.js.map +0 -1
- package/dist/twilight/p-73f96869.system.entry.js +0 -5
- package/dist/twilight/p-87c0a1ae.system.entry.js +0 -5
- package/dist/twilight/p-BoRn76FR.system.js.map +0 -1
- package/dist/twilight/p-TfrZPiHM.js.map +0 -1
- package/dist/twilight/p-e6a8977d.entry.js +0 -5
- /package/dist/twilight/{p-a3575677.system.entry.js.map → p-008098b0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6dd8e040.system.entry.js.map → p-07012c17.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f3b9bca4.entry.js.map → p-07890c65.entry.js.map} +0 -0
- /package/dist/twilight/{p-29c5e915.entry.js.map → p-162ff321.entry.js.map} +0 -0
- /package/dist/twilight/{p-4c4f98b4.system.entry.js.map → p-1b10ad6d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ce9cde22.entry.js.map → p-1e41fb84.entry.js.map} +0 -0
- /package/dist/twilight/{p-9b4e8457.system.entry.js.map → p-1e49477f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-af63e71c.entry.js.map → p-203da90b.entry.js.map} +0 -0
- /package/dist/twilight/{p-b9a143df.system.entry.js.map → p-29a4d594.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cb22e781.entry.js.map → p-2bfe6c27.entry.js.map} +0 -0
- /package/dist/twilight/{p-87c0a1ae.system.entry.js.map → p-313af071.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fbe14a39.system.entry.js.map → p-44d2bb6c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3bdcb368.system.entry.js.map → p-47a60d91.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-827c909f.system.entry.js.map → p-528cbe36.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-dc026fbc.system.entry.js.map → p-52ce19d1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-24389b0b.entry.js.map → p-559c692e.entry.js.map} +0 -0
- /package/dist/twilight/{p-279daf34.entry.js.map → p-57039aab.entry.js.map} +0 -0
- /package/dist/twilight/{p-4d0b108b.system.entry.js.map → p-5758d15d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d270386d.entry.js.map → p-60e5a6db.entry.js.map} +0 -0
- /package/dist/twilight/{p-28aa32df.entry.js.map → p-62168e2f.entry.js.map} +0 -0
- /package/dist/twilight/{p-e477c1c4.system.entry.js.map → p-673042f2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0cfd54f6.system.entry.js.map → p-707b4a65.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-849b5b1c.entry.js.map → p-70baa1fc.entry.js.map} +0 -0
- /package/dist/twilight/{p-6b501ee0.entry.js.map → p-75ee65ba.entry.js.map} +0 -0
- /package/dist/twilight/{p-854c5ca2.entry.js.map → p-7982c0dc.entry.js.map} +0 -0
- /package/dist/twilight/{p-b78ec488.system.entry.js.map → p-7bc976ab.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d21d5b8d.entry.js.map → p-7c231938.entry.js.map} +0 -0
- /package/dist/twilight/{p-94cd1015.entry.js.map → p-801dd66d.entry.js.map} +0 -0
- /package/dist/twilight/{p-ba5e89ed.entry.js.map → p-80d1d13f.entry.js.map} +0 -0
- /package/dist/twilight/{p-0a4eec00.system.entry.js.map → p-80dbb8ec.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4e8e00aa.system.entry.js.map → p-810af197.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5dc4a5c0.system.entry.js.map → p-810dd86a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2b355c74.entry.js.map → p-8408e149.entry.js.map} +0 -0
- /package/dist/twilight/{p-a9ed20d0.entry.js.map → p-8ac928af.entry.js.map} +0 -0
- /package/dist/twilight/{p-b8acf49a.system.entry.js.map → p-8eabe907.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1df83439.entry.js.map → p-929e9291.entry.js.map} +0 -0
- /package/dist/twilight/{p-74a31a87.entry.js.map → p-9c170c94.entry.js.map} +0 -0
- /package/dist/twilight/{p-bba0aa9c.entry.js.map → p-9f703f6a.entry.js.map} +0 -0
- /package/dist/twilight/{p-12d56016.system.entry.js.map → p-a285e2ca.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-eda69b6f.entry.js.map → p-a3c2dfa3.entry.js.map} +0 -0
- /package/dist/twilight/{p-2d61d0e7.entry.js.map → p-a6591ae4.entry.js.map} +0 -0
- /package/dist/twilight/{p-e6a8977d.entry.js.map → p-a67fd8f2.entry.js.map} +0 -0
- /package/dist/twilight/{p-021b3219.entry.js.map → p-a76a8fa1.entry.js.map} +0 -0
- /package/dist/twilight/{p-f9464d95.entry.js.map → p-aba9553d.entry.js.map} +0 -0
- /package/dist/twilight/{p-41c5db98.system.entry.js.map → p-b16b1101.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-73f96869.system.entry.js.map → p-b1cb35b0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ee6033a9.entry.js.map → p-b2ebbc79.entry.js.map} +0 -0
- /package/dist/twilight/{p-de5cdbf2.system.entry.js.map → p-b4ffaa66.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d552d660.system.entry.js.map → p-b5a9201e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-90535622.system.entry.js.map → p-b82da45c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7273395e.system.entry.js.map → p-be0e05db.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fca90326.entry.js.map → p-c09a7b4c.entry.js.map} +0 -0
- /package/dist/twilight/{p-1f975387.entry.js.map → p-c87b3c18.entry.js.map} +0 -0
- /package/dist/twilight/{p-5d14ab42.entry.js.map → p-cebb691f.entry.js.map} +0 -0
- /package/dist/twilight/{p-f5d36cd6.system.entry.js.map → p-d28f73be.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bf2e161f.entry.js.map → p-d481d138.entry.js.map} +0 -0
- /package/dist/twilight/{p-377e8ae9.system.entry.js.map → p-dafaf654.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e45f155c.system.entry.js.map → p-dcfa1dba.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-25614273.system.entry.js.map → p-dd817609.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-20a58fc9.entry.js.map → p-dde23dab.entry.js.map} +0 -0
- /package/dist/twilight/{p-d149c3b0.system.entry.js.map → p-df337e06.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-929164d2.system.entry.js.map → p-e9cdd4ab.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-853399af.entry.js.map → p-ed414623.entry.js.map} +0 -0
- /package/dist/twilight/{p-45f5b923.entry.js.map → p-f0dff388.entry.js.map} +0 -0
- /package/dist/twilight/{p-fcea3994.system.entry.js.map → p-f70fa2de.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9d5433ec.system.entry.js.map → p-fba8e69a.system.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-v5fCQxe_.system.js","sources":["src/components/salla-offer/interfaces.ts","src/components/salla-offer/salla-offer.scss?tag=salla-offer","src/components/salla-offer/salla-offer.tsx"],"sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\",\n SpecialPrice = \"special_price\",\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface SpecialPriceDetail {\n apply_to: \"product\" | \"category\";\n discount_value: number;\n ends_at: number;\n min_items: number; \n min_spend: number;\n targets: Array<string | number>;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail | SpecialPriceDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n",".s-offer-wrapper .s-slider-block__title {\n h2 {\n font-size: 1.125rem;\n line-height: 1.75rem;\n color: #f87171;\n\n &::before {\n font-family: \"sallaicons\";\n content: \"\\ee30\" !important;\n position: absolute;\n top: 1rem;\n font-size: 3rem;\n font-weight: 400;\n line-height: 1;\n color: #fef2f2;\n }\n }\n}\n\n.s-offer-bank-wrapper-sinlge-item{\n display: flex;\n align-items: center !important;\n gap: 14px;\n}\n\n.s-offer-bank-wrapper {\n display: flex !important;\n width: 100% !important;\n}\n\n// .s-offer-bank-wrapper {\n // \n// }","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer,SpecialPriceDetail, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n *\n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n /**\n * Emits a promotion viewed event for analytics tracking\n */\n private emitPromotionViewed(): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: 1 \n };\n \n salla.event.emit('promotion::viewed', [promotionData]);\n }\n /**\n * Emits a promotion clicked event\n */\n private emitPromotionClicked(position: number = 1): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: position\n };\n \n salla.event.emit('promotion::clicked', [promotionData]);\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.SpecialPrice,OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n\n //if it's special price offer\n if (offer.type === OfferType.SpecialPrice) {\n const details = offer.details as SpecialPriceDetail;\n\n return details.apply_to === 'product'\n // Avoid additional requests; use `salla-products-slider` and pass the custom card\n ? salla.product.api.fetch({ source: \"selected\", source_value: details.targets})\n .then((response: any) => {\n (offer.details as any).products = response.data; // Set the fetched products\n return this.offersList = [offer];\n })\n : salla.product.api.categories() // Fetch all categories in one query\n .then((res) => {\n const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories\n (offer.details as any).categories = categoriesToRender;\n return this.offersList = [offer];\n });\n }\n\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n this.emitPromotionViewed();\n }\n\n \n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n // Check if the offers list is empty or if the component is not ready to render\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\" onClick={() => this.emitPromotionClicked()}>\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.SpecialPrice) {\n return this.renderSpecialPriceSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n *\n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n private renderSpecialPriceSection() {\n const details = this.offersList[0].details as SpecialPriceDetail;\n\n return [\n // Render products if `apply_to` is \"product\"\n details.apply_to === \"product\" &&\n details.products?.map((product:Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n\n // Render categories if `apply_to` is \"category\"\n details.apply_to === \"category\" &&\n details.categories?.map((category: Category) => this.getCategoriesSection(category)),\n ];\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,QAGX;YAHD,CAAA,UAAY,QAAQ,EAAA;YAClB,IAAA,QAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;YAED,IAAY,SAOX;YAPD,CAAA,UAAY,SAAS,EAAA;YACnB,IAAA,SAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;YAC3B,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,OAA2B;YAC3B,IAAA,SAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;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C,CAAO,CAAA,MAAA,EAAA,IAAA,EAAA,IAAI,CAAC,YAAY,CAAQ,CACrH,GAAG,EAAE,CACT,EACN,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,gDAAgD,EAAA,EAAE,IAAI,CAAC,kBAAkB,OAC/E,CAAA,CAAA,MAAA,EAAA,IAAA,EAAO,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAQ,MAAK,CACpE,CACF,CACL;;gBAGK,yBAAyB,GAAA;;oBAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAA6B;oBAEhE,OAAO;;wBAEL,OAAO,CAAC,QAAQ,KAAK,SAAS;6BAC9B,CAAA,EAAA,GAAA,OAAO,CAAC,QAAQ,0CAAE,GAAG,CAAC,CAAC,OAAe,MACpC,WAAK,KAAK,EAAC,0BAA0B,EAClC,EAAA,IAAI,CAAC;YACJ,sBAAE,EAAC,IAAI,CAAC,oBAAoB,EAAC,EAAA,OAAO,EAAE,OAAO,EAA8B;YAC3E,sBAAE,mDAAoC,OAAO,EAAE,OAAO,EAAuB,CAAA,CAC3E,CACP,CAAC,CAAA;;wBAGF,OAAO,CAAC,QAAQ,KAAK,UAAU;YAC/B,iBAAA,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,QAAkB,KAAK,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAA;qBACrF;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-BvaTYU0Y.system.js","sources":["src/components/salla-offer/interfaces.ts","src/components/salla-offer/salla-offer.scss?tag=salla-offer","src/components/salla-offer/salla-offer.tsx"],"sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\",\n SpecialPrice = \"special_price\",\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface SpecialPriceDetail {\n apply_to: \"product\" | \"category\";\n discount_value: number;\n ends_at: number;\n min_items: number; \n min_spend: number;\n targets: Array<string | number>;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail | SpecialPriceDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n",".s-offer-wrapper .s-slider-block__title {\n h2 {\n font-size: 1.125rem;\n line-height: 1.75rem;\n color: #f87171;\n\n &::before {\n font-family: \"sallaicons\";\n content: \"\\ee30\" !important;\n position: absolute;\n top: 1rem;\n font-size: 3rem;\n font-weight: 400;\n line-height: 1;\n color: #fef2f2;\n }\n }\n}\n\n.s-offer-bank-wrapper-sinlge-item{\n display: flex;\n align-items: center !important;\n gap: 14px;\n}\n\n.s-offer-bank-wrapper {\n display: flex !important;\n width: 100% !important;\n}\n\n// .s-offer-bank-wrapper {\n // \n// }","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer,SpecialPriceDetail, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n *\n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n /**\n * Emits a promotion viewed event for analytics tracking\n */\n private emitPromotionViewed(): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: 1 \n };\n \n salla.event.emit('promotion::viewed', [promotionData]);\n }\n /**\n * Emits a promotion clicked event\n */\n private emitPromotionClicked(position: number = 1): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: position\n };\n \n salla.event.emit('promotion::clicked', [promotionData]);\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.SpecialPrice,OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n\n //if it's special price offer\n if (offer.type === OfferType.SpecialPrice) {\n const details = offer.details as SpecialPriceDetail;\n\n return details.apply_to === 'product'\n // Avoid additional requests; use `salla-products-slider` and pass the custom card\n ? salla.product.api.fetch({ source: \"selected\", source_value: details.targets})\n .then((response: any) => {\n (offer.details as any).products = response.data; // Set the fetched products\n return this.offersList = [offer];\n })\n : salla.product.api.categories() // Fetch all categories in one query\n .then((res) => {\n const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories\n (offer.details as any).categories = categoriesToRender;\n return this.offersList = [offer];\n });\n }\n\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n this.emitPromotionViewed();\n }\n\n \n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n // Check if the offers list is empty or if the component is not ready to render\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\" onClick={() => this.emitPromotionClicked()}>\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.SpecialPrice) {\n return this.renderSpecialPriceSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n *\n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n private renderSpecialPriceSection() {\n const details = this.offersList[0].details as SpecialPriceDetail;\n\n return [\n // Render products if `apply_to` is \"product\"\n details.apply_to === \"product\" &&\n details.products?.map((product:Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n\n // Render categories if `apply_to` is \"category\"\n details.apply_to === \"category\" &&\n details.categories?.map((category: Category) => this.getCategoriesSection(category)),\n ];\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,QAGX;YAHD,CAAA,UAAY,QAAQ,EAAA;YAClB,IAAA,QAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;YAED,IAAY,SAOX;YAPD,CAAA,UAAY,SAAS,EAAA;YACnB,IAAA,SAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;YAC3B,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,OAA2B;YAC3B,IAAA,SAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;YAClC,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACb,IAAA,SAAA,CAAA,UAAA,CAAA,GAAA,aAAwB;YACxB,IAAA,SAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;YAChC,CAAC,EAPW,SAAS,KAAT,SAAS,GAOpB,EAAA,CAAA,CAAA;;YCZD,MAAM,aAAa,GAAG,khBAAkhB;;kBCmB3hB,UAAU,0BAAA,MAAA;YAErB,IAAA,WAAA,CAAA,OAAA,EAAA;;;YAoBA;;;;;;;;YAQG;YACK,QAAA,IAAoB,CAAA,oBAAA,GAAW,2BAA2B;;YAGzD,QAAA,IAAU,CAAA,UAAA,GAAY,EAAE;YAExB,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;YAK/B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;YAC5B,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK;oBAC1B,IAAS,CA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,0BAA0B,EAClC,EAAA,IAAI,CAAC;YACJ,sBAAE,EAAC,IAAI,CAAC,oBAAoB,EAAC,EAAA,OAAO,EAAE,OAAO,EAA8B;YAC3E,sBAAE,mDAAoC,OAAO,EAAE,OAAO,EAAuB,CAAA,CAC3E,CACP,CAAC,CAAA;;wBAGF,OAAO,CAAC,QAAQ,KAAK,UAAU;YAC/B,iBAAA,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,QAAkB,KAAK,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAA;qBACrF;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-D_KVdrk5.system.js","sources":["src/components/salla-price-range/salla-price-range.scss?tag=salla-price-range","src/components/salla-price-range/salla-price-range.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n\n.rtl, [dir=\"rtl\"] {\n .rtl-range-slider {\n transform: rotateY(180deg);\n }\n\n .rtl-range-numbers{\n flex-direction: row-reverse;\n }\n\n .form-select, select{\n background-position: left 0.5rem center;\n padding-right: 12px;\n } \n\n // divide\n.menu-divide {\n li {\n &:not(:last-child) {\n &:after {\n left: 0;\n right: auto;\n }\n }\n }\n}\n}\n\ninput[type=range]::-webkit-slider-thumb {\n pointer-events: all;\n width: 24px;\n height: 24px;\n -webkit-appearance: none;\n}\n\n[type='checkbox']:checked{\n background-size: 80%;\n}","import { Component, Host, h, State, Prop, Event, Method } from '@stencil/core';\nimport { Filter, FilterValue } from \"../salla-filters/interfaces\";\nimport arrowLeft from '../../assets/svg/arrow-left.svg'\nimport arrowRight from '../../assets/svg/arrow-right.svg'\n\n\n@Component({\n tag: 'salla-price-range',\n styleUrl: 'salla-price-range.scss',\n})\nexport class SallaPriceRange {\n /**\n * Minimum price threshold value\n */\n @Prop({ mutable: true }) minPrice;\n\n /**\n * Maximum price threshold value\n */\n @Prop({ mutable: true }) maxPrice;\n\n /**\n * Product price range filter option object instance\n */\n @Prop({ reflect: true }) option: Filter;\n\n /**\n * Currently selected price filter data\n */\n @Prop({ reflect: true }) filtersData: any;\n\n\n @State() min = 0;\n @State() max = 10000;\n @State() priceOptions: any;\n @State() moreThanLabel: string = \"أكثر من\";\n @State() lessThanLabel: string = \"أقل من\";\n @State() toLabel: string = \"الى\";\n @State() fromLabel: string = \"من\";\n @State() typing: boolean = false;\n @State() isMin: boolean = false;\n @State() isRTL: Boolean = salla.config.get('theme.is_rtl', true);\n\n\n /**\n * Custome event emitted when there is a change in price input.\n */\n @Event() changed: any;\n\n isReady: Boolean;\n minInput: HTMLInputElement;\n maxInput: HTMLInputElement;\n filterValues: Array<FilterValue> = [];\n\n\n connectedCallback() {\n if (this.filtersData && this.filtersData?.price) {\n this.minPrice = this.filtersData.price.min;\n this.maxPrice = this.filtersData.price.max;\n }\n salla.lang.onLoaded(() => {\n this.moreThanLabel = salla.lang.getWithDefault('common.elements.more_than', this.moreThanLabel)\n this.lessThanLabel = salla.lang.getWithDefault('common.elements.less_than', this.lessThanLabel)\n this.toLabel = salla.lang.getWithDefault('common.elements.to', this.toLabel)\n this.fromLabel = salla.lang.getWithDefault('common.elements.from', this.fromLabel)\n })\n\n //no need to show one option only\n if (this.option.values.length == 1) {\n return;\n }\n //here we may receive too many prices, we will group all inputs to\n if (this.option.values.length <= 5) {\n this.filterValues = this.option.values;\n return;\n }\n const chunkSize = Math.ceil(this.option.values.length / 5);\n for (let i = 0; i < this.option.values.length; i += chunkSize) {\n this.filterValues.push(\n this.option.values\n .slice(i, i + chunkSize)\n .reduce((final: FilterValue, currentValue: FilterValue) => {\n final.to = currentValue.to;\n final.count += currentValue.count;\n return final;\n })\n );\n // do whatever\n }\n }\n\n /**\n * reset the price range inputs\n */\n @Method()\n async reset() {\n //@ts-ignore\n this.minInput.value = null;\n this.maxInput.value = null;\n this.minPrice=null\n this.maxPrice=null\n }\n\n private getPriceLabel(filterValue: FilterValue) {\n // @ts-ignore\n if (isNaN(filterValue.from) || filterValue.from < 1) {\n return `${this.lessThanLabel} ${salla.money(filterValue.to)}`;\n }\n // @ts-ignore\n if (isNaN(filterValue.to) || filterValue.to < 1) {\n return `${this.moreThanLabel} ${salla.money(filterValue.from)}`;\n }\n\n return `${salla.money(filterValue.from)} ${this.toLabel} ${salla.money(filterValue.to)}`;\n }\n\n minInputValidation(value: number) {\n if (value && (value > this.max || (this.maxPrice && value > this.maxPrice))) {\n // this.minPrice = this.maxPrice;\n return;\n }\n\n if (value < this.min) {\n this.minPrice = this.min;\n return;\n }\n\n if (value) {\n this.minPrice = value;\n }\n }\n\n maxInputValidation(value) {\n if (value && (value < this.min || (this.minPrice && value < this.minPrice))) {\n // this.maxPrice = this.minPrice;\n return;\n }\n if (value > this.max) {\n this.maxPrice = this.max;\n return;\n }\n }\n\n private async changedEventHandler(event) {\n salla.helpers.inputDigitsOnly(this.minInput)\n salla.helpers.inputDigitsOnly(this.maxInput)\n\n const minInputValue = this.minPrice ? +this.minPrice * 1 : null\n const maxInputValue = this.maxPrice ? +this.maxPrice * 1 : null\n \n if (!this.maxPrice) {\n this.maxPrice = '';\n }\n if (this.isMin) {\n this.minInputValidation(minInputValue);\n } else {\n if (!this.minPrice) {\n this.minPrice = 0;\n }\n this.maxInputValidation(maxInputValue)\n }\n\n this.isReady && this.changed.emit({\n event: event,\n option: this.option,\n value: { max: this.maxPrice, min: this.minPrice }\n })\n }\n private handleMinMaxPrice(event: Event, value: FilterValue): void {\n //todo:: cover when from is star\n this.minPrice = value.from;\n this.maxPrice = value.to !== '*' ? value.to : \"\";\n\n this.changedEventHandler(event);\n }\n\n\n\n private isChecked(filterValue: FilterValue) {\n if (!this.minPrice && !this.maxPrice) {\n return false;\n }\n\n //1 filterValue.from zero or * and this.minPrice not set or zero\n //2 filterValue.from == this.minPrice\n //@ts-ignore\n let isMinEqual = ((filterValue.from < 1 || filterValue.from == '*') && this.minPrice == 0) || filterValue.from == this.minPrice;\n\n //1 filterValue.to == \"*\" or null\n //2 filterValue.to == this.max\n let isMaxEqual = filterValue.to == '*' || !filterValue.to || filterValue.to == this.maxPrice;\n return isMinEqual && isMaxEqual;\n }\n\n private handleMinPrice(event: Event) {\n this.isMin = true\n const value = (event.target as HTMLInputElement).value\n this.minPrice = value ==='' ? 0 : value\n }\n private handleMaxPrice(event: Event) {\n this.isMin = false\n const value = (event.target as HTMLInputElement).value\n this.maxPrice = value === undefined ? '' : value\n }\n\n\n render() {\n return (\n <Host>\n {\n this.filterValues.map((filterValue, index) => {\n\n return <label class=\"s-filters-label\" htmlFor={`${this.option.key}-${index}`} key={index}>\n <input\n id={`${this.option.key}-${index}`}\n name=\"price\"\n type=\"radio\"\n checked={this.isChecked(filterValue)}\n class=\"s-filters-radio\"\n onChange={e => this.handleMinMaxPrice(e, filterValue)}\n />\n <span innerHTML={this.getPriceLabel(filterValue)}></span>\n </label>\n })\n }\n\n\n <div class=\"flex justify-center items-center\">\n <div class=\"relative max-w-xl w-full\">\n <div class=\"s-price-range-inputs\">\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.minInput = el}\n onBlur={(e) => this.handleMinPrice(e)}\n value={this.minPrice}\n placeholder={this.fromLabel}\n class=\"s-price-range-number-input\"\n\n />\n </div>\n\n <div class=\"s-price-range-gray-text\"> -</div>\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.maxInput = el}\n onBlur={(e) => this.handleMaxPrice(e)}\n value={this.maxPrice}\n placeholder={this.toLabel}\n class=\"s-price-range-number-input\" aria-describedby=\"price-currency\" />\n </div>\n <salla-button color='gray' shape='icon' size='small' fill='outline' onClick={(event) => this.changedEventHandler(event)}>\n <span innerHTML={this.isRTL ? arrowLeft : arrowRight} />\n </salla-button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n this.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AAK,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAA,EACrH,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,SAAS,EAAE,IAAI,CAAC,KAAK,GAAG,SAAS,GAAG,UAAU,GAAI,CAC3C,CACX,CACF,CACF,CACD;;UAIX,gBAAgB,GAAA;MACd,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-C3hekSf2.system.js","sources":["src/components/salla-price-range/salla-price-range.scss?tag=salla-price-range","src/components/salla-price-range/salla-price-range.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n\n.rtl, [dir=\"rtl\"] {\n .rtl-range-slider {\n transform: rotateY(180deg);\n }\n\n .rtl-range-numbers{\n flex-direction: row-reverse;\n }\n\n .form-select, select{\n background-position: left 0.5rem center;\n padding-right: 12px;\n } \n\n // divide\n.menu-divide {\n li {\n &:not(:last-child) {\n &:after {\n left: 0;\n right: auto;\n }\n }\n }\n}\n}\n\ninput[type=range]::-webkit-slider-thumb {\n pointer-events: all;\n width: 24px;\n height: 24px;\n -webkit-appearance: none;\n}\n\n[type='checkbox']:checked{\n background-size: 80%;\n}","import { Component, Host, h, State, Prop, Event, Method } from '@stencil/core';\nimport { Filter, FilterValue } from \"../salla-filters/interfaces\";\nimport arrowLeft from '../../assets/svg/arrow-left.svg'\nimport arrowRight from '../../assets/svg/arrow-right.svg'\n\n\n@Component({\n tag: 'salla-price-range',\n styleUrl: 'salla-price-range.scss',\n})\nexport class SallaPriceRange {\n /**\n * Minimum price threshold value\n */\n @Prop({ mutable: true }) minPrice;\n\n /**\n * Maximum price threshold value\n */\n @Prop({ mutable: true }) maxPrice;\n\n /**\n * Product price range filter option object instance\n */\n @Prop({ reflect: true }) option: Filter;\n\n /**\n * Currently selected price filter data\n */\n @Prop({ reflect: true }) filtersData: any;\n\n\n @State() min = 0;\n @State() max = 10000;\n @State() priceOptions: any;\n @State() moreThanLabel: string = \"أكثر من\";\n @State() lessThanLabel: string = \"أقل من\";\n @State() toLabel: string = \"الى\";\n @State() fromLabel: string = \"من\";\n @State() typing: boolean = false;\n @State() isMin: boolean = false;\n @State() isRTL: Boolean = salla.config.get('theme.is_rtl', true);\n\n\n /**\n * Custome event emitted when there is a change in price input.\n */\n @Event() changed: any;\n\n isReady: Boolean;\n minInput: HTMLInputElement;\n maxInput: HTMLInputElement;\n filterValues: Array<FilterValue> = [];\n\n\n connectedCallback() {\n if (this.filtersData && this.filtersData?.price) {\n this.minPrice = this.filtersData.price.min;\n this.maxPrice = this.filtersData.price.max;\n }\n salla.lang.onLoaded(() => {\n this.moreThanLabel = salla.lang.getWithDefault('common.elements.more_than', this.moreThanLabel)\n this.lessThanLabel = salla.lang.getWithDefault('common.elements.less_than', this.lessThanLabel)\n this.toLabel = salla.lang.getWithDefault('common.elements.to', this.toLabel)\n this.fromLabel = salla.lang.getWithDefault('common.elements.from', this.fromLabel)\n })\n\n //no need to show one option only\n if (this.option.values.length == 1) {\n return;\n }\n //here we may receive too many prices, we will group all inputs to\n if (this.option.values.length <= 5) {\n this.filterValues = this.option.values;\n return;\n }\n const chunkSize = Math.ceil(this.option.values.length / 5);\n for (let i = 0; i < this.option.values.length; i += chunkSize) {\n this.filterValues.push(\n this.option.values\n .slice(i, i + chunkSize)\n .reduce((final: FilterValue, currentValue: FilterValue) => {\n final.to = currentValue.to;\n final.count += currentValue.count;\n return final;\n })\n );\n // do whatever\n }\n }\n\n /**\n * reset the price range inputs\n */\n @Method()\n async reset() {\n //@ts-ignore\n this.minInput.value = null;\n this.maxInput.value = null;\n this.minPrice=null\n this.maxPrice=null\n }\n\n private getPriceLabel(filterValue: FilterValue) {\n // @ts-ignore\n if (isNaN(filterValue.from) || filterValue.from < 1) {\n return `${this.lessThanLabel} ${salla.money(filterValue.to)}`;\n }\n // @ts-ignore\n if (isNaN(filterValue.to) || filterValue.to < 1) {\n return `${this.moreThanLabel} ${salla.money(filterValue.from)}`;\n }\n\n return `${salla.money(filterValue.from)} ${this.toLabel} ${salla.money(filterValue.to)}`;\n }\n\n minInputValidation(value: number) {\n if (value && (value > this.max || (this.maxPrice && value > this.maxPrice))) {\n // this.minPrice = this.maxPrice;\n return;\n }\n\n if (value < this.min) {\n this.minPrice = this.min;\n return;\n }\n\n if (value) {\n this.minPrice = value;\n }\n }\n\n maxInputValidation(value) {\n if (value && (value < this.min || (this.minPrice && value < this.minPrice))) {\n // this.maxPrice = this.minPrice;\n return;\n }\n if (value > this.max) {\n this.maxPrice = this.max;\n return;\n }\n }\n\n private async changedEventHandler(event) {\n salla.helpers.inputDigitsOnly(this.minInput)\n salla.helpers.inputDigitsOnly(this.maxInput)\n\n const minInputValue = this.minPrice ? +this.minPrice * 1 : null\n const maxInputValue = this.maxPrice ? +this.maxPrice * 1 : null\n \n if (!this.maxPrice) {\n this.maxPrice = '';\n }\n if (this.isMin) {\n this.minInputValidation(minInputValue);\n } else {\n if (!this.minPrice) {\n this.minPrice = 0;\n }\n this.maxInputValidation(maxInputValue)\n }\n\n this.isReady && this.changed.emit({\n event: event,\n option: this.option,\n value: { max: this.maxPrice, min: this.minPrice }\n })\n }\n private handleMinMaxPrice(event: Event, value: FilterValue): void {\n //todo:: cover when from is star\n this.minPrice = value.from;\n this.maxPrice = value.to !== '*' ? value.to : \"\";\n\n this.changedEventHandler(event);\n }\n\n\n\n private isChecked(filterValue: FilterValue) {\n if (!this.minPrice && !this.maxPrice) {\n return false;\n }\n\n //1 filterValue.from zero or * and this.minPrice not set or zero\n //2 filterValue.from == this.minPrice\n //@ts-ignore\n let isMinEqual = ((filterValue.from < 1 || filterValue.from == '*') && this.minPrice == 0) || filterValue.from == this.minPrice;\n\n //1 filterValue.to == \"*\" or null\n //2 filterValue.to == this.max\n let isMaxEqual = filterValue.to == '*' || !filterValue.to || filterValue.to == this.maxPrice;\n return isMinEqual && isMaxEqual;\n }\n\n private handleMinPrice(event: Event) {\n this.isMin = true\n const value = (event.target as HTMLInputElement).value\n this.minPrice = value ==='' ? 0 : value\n }\n private handleMaxPrice(event: Event) {\n this.isMin = false\n const value = (event.target as HTMLInputElement).value\n this.maxPrice = value === undefined ? '' : value\n }\n\n\n render() {\n return (\n <Host>\n {\n this.filterValues.map((filterValue, index) => {\n\n return <label class=\"s-filters-label\" htmlFor={`${this.option.key}-${index}`} key={index}>\n <input\n id={`${this.option.key}-${index}`}\n name=\"price\"\n type=\"radio\"\n checked={this.isChecked(filterValue)}\n class=\"s-filters-radio\"\n onChange={e => this.handleMinMaxPrice(e, filterValue)}\n />\n <span innerHTML={this.getPriceLabel(filterValue)}></span>\n </label>\n })\n }\n\n\n <div class=\"flex justify-center items-center\">\n <div class=\"relative max-w-xl w-full\">\n <div class=\"s-price-range-inputs\">\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.minInput = el}\n onBlur={(e) => this.handleMinPrice(e)}\n value={this.minPrice}\n placeholder={this.fromLabel}\n class=\"s-price-range-number-input\"\n\n />\n </div>\n\n <div class=\"s-price-range-gray-text\"> -</div>\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.maxInput = el}\n onBlur={(e) => this.handleMaxPrice(e)}\n value={this.maxPrice}\n placeholder={this.toLabel}\n class=\"s-price-range-number-input\" aria-describedby=\"price-currency\" />\n </div>\n <salla-button color='gray' shape='icon' size='small' fill='outline' onClick={(event) => this.changedEventHandler(event)}>\n <span innerHTML={this.isRTL ? arrowLeft : arrowRight} />\n </salla-button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAAA,MAAM,kBAAkB,GAAG,ynBAAynB;;YCUvoB,eAAe,gCAAA,MAAA;MAJ5B,IAAA,W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GAAG,SAAS,GAAG,UAAU,GAAI,CAC3C,CACX,CACF,CACF,CACD;;UAIX,gBAAgB,GAAA;MACd,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-C7A6mH1h.system.js","sources":["src/components/salla-tooltip/salla-tooltip.scss?tag=salla-tooltip","src/components/salla-tooltip/salla-tooltip.tsx"],"sourcesContent":[".s-tooltip {\n &-container {\n position: relative;\n display: inline-block;\n }\n\n &-item {\n position: absolute;\n transform: translateX(-39%);\n background-color: #baf3e6;\n color: #004d5a;\n bottom: 100%;\n left: 50%;\n text-align: center;\n border-radius: 5px;\n z-index: 1;\n white-space: nowrap;\n opacity: 0;\n transition: opacity 0.3s;\n pointer-events: none;\n margin: 0 0 16px 8px;\n padding: 12px;\n max-width: 150px;\n width: 190px;\n white-space: normal;\n opacity: 1;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -10px; // Position the arrow just below the tooltip\n left: 50%;\n margin-left: -5px; // Center the arrow\n border-width: 5px;\n border-style: solid;\n border-color: #baf3e6 transparent transparent transparent; // Arrow color and shape\n }\n &:dir(ltr) {\n transform: translateX(-72%);\n }\n }\n}\n","import { Component, Prop, h, State, Element, Listen } from '@stencil/core';\n\n@Component({\n tag: 'salla-tooltip',\n styleUrl: 'salla-tooltip.scss',\n shadow: false,\n})\nexport class SallaTooltip {\n /**\n * The text content to display in the tooltip\n */\n @Prop() text: string;\n /**\n * The ID of the target element to which the tooltip is attached\n */\n @Prop() targetId: string;\n @State() show: boolean = false;\n @Element() el: HTMLElement;\n\n private targetElement: HTMLElement | null = null;\n\n @Listen('mouseover', { target: 'window' })\n handleMouseOver(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = true;\n }\n }\n\n @Listen('mouseout', { target: 'window' })\n handleMouseOut(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = false;\n }\n }\n\n componentDidLoad() {\n // Find the target element based on the targetSelector prop\n this.targetElement = document.getElementById(this.targetId);\n }\n\n render() {\n return (\n <div class=\"s-tooltip-container\">\n <slot></slot>\n {this.show && <div class=\"s-tooltip-item\">{this.text}</div>}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,4tBAA4tB;;YCOvuB,YAAY,4BAAA,MAAA;MALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;MAcW,QAAA,IAAI,CAAA,IAAA,GAAY,KAAK;MAGtB,QAAA,IAAa,CAAA,aAAA,GAAuB,IAAI;MA6BjD;MA1BC,IAAA,eAAe,CAAC,KAAiB,EAAA;MAC/B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;;MAKpB,IAAA,cAAc,CAAC,KAAiB,EAAA;MAC9B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,KAAK;;;UAIrB,gBAAgB,GAAA;;cAEd,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;;UAG7D,MAAM,GAAA;cACJ,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,qBAAqB,EAAA,EAC9B,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,IAAI,IAAI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,gBAAgB,EAAE,EAAA,IAAI,CAAC,IAAI,CAAO,CACvD;;;;;;;;;;;;"}
|