@salla.sa/twilight-components 2.14.271 → 2.14.273
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-DZKo1pV9.js → filepond-B6LUaQ9F.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-Ddu0-eEg.js → filepond-plugin-file-poster-DlB67Vv3.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-B2VId_n-.js → filepond-plugin-file-validate-size-D7kuqaEC.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-lGUMFCde.js → filepond-plugin-file-validate-type-CliXp1Qt.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BlEvC0bv.js → filepond-plugin-image-edit-BRIZbIyN.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C9yPmasn.js → filepond-plugin-image-exif-orientation-bFbWHyQs.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-BPQ9o2YT.js → filepond-plugin-image-preview-24nxaVX6.js} +1 -1
- package/dist/cjs/{index-DpqjX7F3.js → index-BpUrZ_-D.js} +136 -26
- package/dist/cjs/{index-4c5cqxT-.js → index-xI-pRoDr.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/{salla-add-product-button_51.cjs.entry.js → salla-accordion_62.cjs.entry.js} +2104 -121
- 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-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 +2 -2
- 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-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/{salla-accordion_4.cjs.entry.js → salla-order-details-options.cjs.entry.js} +1 -100
- package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-review-card.cjs.entry.js +2 -2
- package/dist/cjs/salla-reviews-page.cjs.entry.js +2 -2
- package/dist/cjs/salla-reviews.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +3 -4
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +8 -2
- package/dist/collection/components/salla-comments/salla-comments.js +20 -1
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +33 -5
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +0 -1
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.css +0 -0
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +89 -0
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.css +0 -0
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +195 -0
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.css +3 -0
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +595 -0
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.css +0 -0
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +174 -0
- package/dist/collection/components/salla-multiple-bundle-product/interfaces.js +1 -0
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.css +3 -0
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +132 -0
- package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +2 -2
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
- package/dist/collection/components/salla-product-options/salla-product-options.js +105 -22
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
- package/dist/collection/components/salla-search/salla-search.js +3 -3
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-slider/salla-slider.js +2 -2
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/salla-accordion-head2.js +2 -2
- package/dist/components/salla-comments.js +20 -1
- package/dist/components/salla-conditional-fields2.js +28 -6
- package/dist/components/salla-login-modal.js +0 -1
- package/dist/components/salla-multiple-bundle-product-cart.d.ts +11 -0
- package/dist/components/salla-multiple-bundle-product-cart.js +9 -0
- package/dist/components/salla-multiple-bundle-product-cart2.js +153 -0
- package/dist/components/salla-multiple-bundle-product-details.d.ts +11 -0
- package/dist/components/salla-multiple-bundle-product-details.js +9 -0
- package/dist/components/salla-multiple-bundle-product-details2.js +283 -0
- package/dist/components/salla-multiple-bundle-product-options-modal.d.ts +11 -0
- package/dist/components/salla-multiple-bundle-product-options-modal.js +9 -0
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +585 -0
- package/dist/components/salla-multiple-bundle-product-slider.d.ts +11 -0
- package/dist/components/salla-multiple-bundle-product-slider.js +9 -0
- package/dist/components/salla-multiple-bundle-product-slider2.js +81 -0
- package/dist/components/salla-multiple-bundle-product.d.ts +11 -0
- package/dist/components/salla-multiple-bundle-product.js +210 -0
- package/dist/components/salla-notification-item2.js +1 -1
- package/dist/components/salla-offer-modal.js +1 -1
- package/dist/components/salla-order-details.js +1 -1
- package/dist/components/salla-order-summary.js +1 -1
- package/dist/components/salla-payments.js +2 -2
- package/dist/components/salla-placeholder2.js +1 -1
- package/dist/components/salla-price-range2.js +2 -2
- package/dist/components/salla-product-availability2.js +1 -1
- package/dist/components/salla-product-card2.js +5 -5
- package/dist/components/salla-product-options.js +1 -810
- package/dist/{esm/salla-product-options.entry.js → components/salla-product-options2.js} +197 -30
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input.js +1 -1
- package/dist/components/salla-quick-buy2.js +1 -1
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reviews.js +1 -1
- package/dist/components/salla-scopes.js +1 -1
- package/dist/components/salla-search.js +3 -3
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-slider2.js +2 -2
- package/dist/components/salla-social-share.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/esm/{filepond-DbqR2fSR.js → filepond-C8M-qAIs.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-oSU_je8q.js → filepond-plugin-file-poster-UfHq-uvl.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DBNbjpCq.js → filepond-plugin-file-validate-size-DZ15xnJZ.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-FNihY0D1.js → filepond-plugin-file-validate-type-CWR9opI0.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BvLwmvqS.js → filepond-plugin-image-edit-XbR1h-bg.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CzDuHCvL.js → filepond-plugin-image-exif-orientation-cSRDvvXQ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-OJew5tLP.js → filepond-plugin-image-preview-B-SvzNFg.js} +1 -1
- package/dist/esm/{index-DFnMPSip.js → index-Q_DltBmK.js} +1 -1
- package/dist/esm/{index-DXrQDmAN.js → index-gLeBNvS1.js} +136 -26
- package/dist/esm/loader.js +3 -4
- package/dist/esm/{salla-add-product-button_51.entry.js → salla-accordion_62.entry.js} +2084 -112
- 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-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 +2 -2
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/{salla-accordion_4.entry.js → salla-order-details-options.entry.js} +2 -98
- package/dist/esm/salla-order-details.entry.js +2 -2
- package/dist/esm/salla-order-summary.entry.js +2 -2
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-review-card.entry.js +2 -2
- package/dist/esm/salla-reviews-page.entry.js +2 -2
- package/dist/esm/salla-reviews.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -4
- package/dist/twilight/{p-11c1fc02.entry.js → p-00d8544c.entry.js} +1 -1
- package/dist/twilight/{p-c87e16b6.entry.js → p-06d126b6.entry.js} +1 -1
- package/dist/twilight/{p-adc5a167.entry.js → p-1cc68ef5.entry.js} +1 -1
- package/dist/twilight/{p-yWcVqMiP.js → p-1ekWkYOJ.js} +1 -1
- package/dist/twilight/p-21b37923.entry.js +4 -0
- package/dist/twilight/{p-c2f0f504.entry.js → p-263b9b06.entry.js} +1 -1
- package/dist/twilight/{p-c0450f72.entry.js → p-2787ff9f.entry.js} +1 -1
- package/dist/twilight/p-3c1484b9.entry.js +11 -0
- package/dist/twilight/{p-6ed0de44.entry.js → p-5057b400.entry.js} +1 -1
- package/dist/twilight/{p-5c67f412.entry.js → p-5278b873.entry.js} +1 -1
- package/dist/twilight/{p-1d1672e8.entry.js → p-56f7a2ba.entry.js} +1 -1
- package/dist/twilight/{p-5aa17da1.entry.js → p-697db5c6.entry.js} +1 -1
- package/dist/twilight/{p-81131b67.entry.js → p-73a8296a.entry.js} +1 -1
- package/dist/twilight/{p-93b26c0b.entry.js → p-7603a820.entry.js} +1 -1
- package/dist/twilight/{p-86f00281.entry.js → p-7c8d7ca3.entry.js} +1 -1
- package/dist/twilight/{p-62312d5b.entry.js → p-80a07063.entry.js} +1 -1
- package/dist/twilight/{p-e987bf56.entry.js → p-82c156ab.entry.js} +1 -1
- package/dist/twilight/{p-fed06a9f.entry.js → p-8380c411.entry.js} +1 -1
- package/dist/twilight/{p-906ec5e3.entry.js → p-946e5649.entry.js} +1 -1
- package/dist/twilight/{p-01b67a23.entry.js → p-9bcd9c87.entry.js} +1 -1
- package/dist/twilight/p-9c477fdf.entry.js +4 -0
- package/dist/twilight/{p-B3DRwtQ_.js → p-B-nQtFTN.js} +1 -1
- package/dist/twilight/{p-BeXdXg7Q.js → p-BI2zk2yo.js} +1 -1
- package/dist/twilight/{p-E9O3bnHS.js → p-BRD27esZ.js} +1 -1
- package/dist/twilight/{p-MbgAyDn3.js → p-CUYEEJ4c.js} +1 -1
- package/dist/twilight/{p-BvKpNEUI.js → p-DUvdNUoC.js} +1 -1
- package/dist/twilight/{p-C3joUrVg.js → p-DhR67rwu.js} +1 -1
- package/dist/twilight/p-a01dd6b7.entry.js +4 -0
- package/dist/twilight/{p-849be825.entry.js → p-a3e000ef.entry.js} +1 -1
- package/dist/twilight/{p-0e18add0.entry.js → p-a6c14a64.entry.js} +1 -1
- package/dist/twilight/p-b0b79820.entry.js +4 -0
- package/dist/twilight/{p-57e8c6b5.entry.js → p-b5581886.entry.js} +1 -1
- package/dist/twilight/p-b81437f4.entry.js +4 -0
- package/dist/twilight/{p-591043a2.entry.js → p-bf010154.entry.js} +1 -1
- package/dist/twilight/{p-d3022e35.entry.js → p-c0388251.entry.js} +1 -1
- package/dist/twilight/{p-a71a3922.entry.js → p-c9ab361e.entry.js} +1 -1
- package/dist/twilight/{p-d8e500cc.entry.js → p-ed85bc00.entry.js} +1 -1
- package/dist/twilight/p-f7863a58.entry.js +4 -0
- package/dist/twilight/{p-DXrQDmAN.js → p-gLeBNvS1.js} +2 -2
- package/dist/twilight/{p-BQuXdlAk.js → p-j4lbZMJ0.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-accordion/salla-accordion-head.d.ts +6 -0
- package/dist/types/components/salla-conditional-fields/salla-conditional-fields.d.ts +2 -0
- package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.d.ts +10 -0
- package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.d.ts +20 -0
- package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.d.ts +46 -0
- package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.d.ts +22 -0
- package/dist/types/components/salla-multiple-bundle-product/interfaces.d.ts +101 -0
- package/dist/types/components/salla-multiple-bundle-product/salla-multiple-bundle-product.d.ts +42 -0
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +21 -1
- package/dist/types/components.d.ts +298 -2
- package/package.json +5 -5
- package/dist/cjs/app-globals-DfTgypwp.js +0 -38
- package/dist/cjs/camera-DytepEoK.js +0 -13
- package/dist/cjs/minus-CCryh1qf.js +0 -21
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +0 -280
- package/dist/cjs/salla-product-options.cjs.entry.js +0 -715
- package/dist/esm/app-globals-i4_OI7UA.js +0 -36
- package/dist/esm/camera-C6jIkM-X.js +0 -11
- package/dist/esm/minus-DfeagqF1.js +0 -18
- package/dist/esm/salla-booking-field_2.entry.js +0 -277
- package/dist/twilight/p-137e1751.entry.js +0 -4
- package/dist/twilight/p-18cd5d66.entry.js +0 -4
- package/dist/twilight/p-36b30807.entry.js +0 -4
- package/dist/twilight/p-6159654b.entry.js +0 -4
- package/dist/twilight/p-9d9e5493.entry.js +0 -4
- package/dist/twilight/p-C6jIkM-X.js +0 -4
- package/dist/twilight/p-CqZlwzcH.js +0 -4
- package/dist/twilight/p-DfeagqF1.js +0 -4
- package/dist/twilight/p-affed6bd.entry.js +0 -11
- package/dist/twilight/p-cfbd199f.entry.js +0 -4
- package/dist/twilight/p-d060275b.entry.js +0 -4
- package/dist/twilight/p-e162d003.entry.js +0 -4
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
var index = require('./index-DpqjX7F3.js');
|
|
7
|
-
|
|
8
|
-
var BookingTime = `<!-- Generated by IcoMoon.io -->
|
|
9
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
10
|
-
<title>calendar-time</title>
|
|
11
|
-
<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>
|
|
12
|
-
</svg>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
var Calendar = `<!-- Generated by IcoMoon.io -->
|
|
16
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
17
|
-
<title>calendar</title>
|
|
18
|
-
<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>
|
|
19
|
-
</svg>
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
var TimeIcon = `<!-- Generated by IcoMoon.io -->
|
|
23
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
24
|
-
<title>time</title>
|
|
25
|
-
<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>
|
|
26
|
-
</svg>
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
const sallaBookingFieldCss = ":host{display:block}";
|
|
30
|
-
|
|
31
|
-
const SallaBookingField = class {
|
|
32
|
-
constructor(hostRef) {
|
|
33
|
-
index.registerInstance(this, hostRef);
|
|
34
|
-
this.invalidInput = index.createEvent(this, "invalidInput");
|
|
35
|
-
this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');
|
|
36
|
-
this.editLabel = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');
|
|
37
|
-
this.bookedLabel = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');
|
|
38
|
-
this.selectDate = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');
|
|
39
|
-
this.bookingUrl = '';
|
|
40
|
-
this.iframeReady = false;
|
|
41
|
-
this.reservations = [];
|
|
42
|
-
// Load translations
|
|
43
|
-
salla.lang.onLoaded(() => this.setTranslations());
|
|
44
|
-
// Register event listeners
|
|
45
|
-
Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));
|
|
46
|
-
}
|
|
47
|
-
async setTranslations() {
|
|
48
|
-
const setNestedAsync = (lang, key, value) => {
|
|
49
|
-
return new Promise((resolve) => {
|
|
50
|
-
salla.helpers.setNested(salla.lang.messages[lang], key, value);
|
|
51
|
-
resolve(true);
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');
|
|
55
|
-
await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');
|
|
56
|
-
await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');
|
|
57
|
-
await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');
|
|
58
|
-
await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');
|
|
59
|
-
await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');
|
|
60
|
-
await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');
|
|
61
|
-
await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');
|
|
62
|
-
this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');
|
|
63
|
-
this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');
|
|
64
|
-
this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');
|
|
65
|
-
this.selectDate = salla.lang.get('pages.cart.select_appointment_date');
|
|
66
|
-
}
|
|
67
|
-
openBookingModal(event, afterReload = false) {
|
|
68
|
-
if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (salla.config.isGuest()) {
|
|
72
|
-
this.setAfterReloadEvent('booking::open-after-reload', this.productId);
|
|
73
|
-
salla.event.dispatch('login::open');
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
salla.booking.add(this.productId, false)
|
|
77
|
-
.then((resp) => {
|
|
78
|
-
if (resp.data.redirect.to !== 'booking') {
|
|
79
|
-
throw new Error('Unexpected redirect!');
|
|
80
|
-
}
|
|
81
|
-
salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });
|
|
82
|
-
})
|
|
83
|
-
.catch((error) => {
|
|
84
|
-
salla.error(salla.lang.get('common.errors.error_occurred'));
|
|
85
|
-
salla.logger.error(error.response || error);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
handleBookingOpen(data) {
|
|
89
|
-
if (data.id !== this.productId)
|
|
90
|
-
return;
|
|
91
|
-
this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);
|
|
92
|
-
this.iframeReady = true;
|
|
93
|
-
setTimeout(() => {
|
|
94
|
-
this.modal.setTitle(this.selectDate);
|
|
95
|
-
this.modal.open();
|
|
96
|
-
}, 100);
|
|
97
|
-
}
|
|
98
|
-
setAfterReloadEvent(event, payload) {
|
|
99
|
-
salla.storage.set('afterReloadEvent', { event, payload });
|
|
100
|
-
}
|
|
101
|
-
emitAfterReloadEvent() {
|
|
102
|
-
const eventDetails = salla.storage.get('afterReloadEvent');
|
|
103
|
-
if (eventDetails && eventDetails.event) {
|
|
104
|
-
const customEvent = new CustomEvent(eventDetails.event, {
|
|
105
|
-
detail: eventDetails.payload
|
|
106
|
-
});
|
|
107
|
-
window.dispatchEvent(customEvent);
|
|
108
|
-
salla.storage.remove('afterReloadEvent');
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
componentWillLoad() {
|
|
112
|
-
if (this.option && this.option.details.length) {
|
|
113
|
-
this.reservations = this.option.details;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
componentDidLoad() {
|
|
117
|
-
window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));
|
|
118
|
-
this.emitAfterReloadEvent();
|
|
119
|
-
window.addEventListener('message', this.handleMessageEvent.bind(this));
|
|
120
|
-
this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));
|
|
121
|
-
this.reservationsInput.addEventListener('input', () => {
|
|
122
|
-
this.reservationsInput.setCustomValidity('');
|
|
123
|
-
this.reservationsInput.reportValidity();
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
handleMessageEvent(event) {
|
|
127
|
-
if (event.data.source !== 'booking')
|
|
128
|
-
return;
|
|
129
|
-
const action = event.data.type;
|
|
130
|
-
const value = event.data.message;
|
|
131
|
-
if (localStorage.getItem('debug'))
|
|
132
|
-
console.log(`Received an action:${action}`, event.data);
|
|
133
|
-
if (action === 'error') {
|
|
134
|
-
if (value.fields?.reservation) {
|
|
135
|
-
salla.notify.error(value.fields.reservation[0]);
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const errorList = Object.values(value.fields || [value.message]).flat().map(error => `<li>${error}</li>`).join('');
|
|
139
|
-
salla.notify.error(`<ul>${errorList}</ul>`);
|
|
140
|
-
}
|
|
141
|
-
if (action === 'success') {
|
|
142
|
-
if (Number(value.productId) !== Number(this.productId))
|
|
143
|
-
return;
|
|
144
|
-
this.reservations = value.data.reservations.map(schedule => {
|
|
145
|
-
if (schedule.time && schedule.time.length > 0) {
|
|
146
|
-
const timeSlot = schedule.time[0];
|
|
147
|
-
return {
|
|
148
|
-
date: schedule.date,
|
|
149
|
-
day: schedule.day,
|
|
150
|
-
from_timestamp: timeSlot.from,
|
|
151
|
-
to_timestamp: timeSlot.to,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
return null;
|
|
155
|
-
}).filter(item => item !== null);
|
|
156
|
-
salla.notify.success(this.bookedLabel);
|
|
157
|
-
this.modal?.close();
|
|
158
|
-
setTimeout(() => window.location.reload());
|
|
159
|
-
}
|
|
160
|
-
if (action === 'height') {
|
|
161
|
-
this.iframe.height = value?.height + 'px';
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
bookingModal() {
|
|
165
|
-
return (index.h("salla-modal", { class: "s-booking-field-modal", ref: modal => (this.modal = modal), width: "md", position: "middle", noPadding: true }, index.h("iframe", { ref: iframe => (this.iframe = iframe), src: this.bookingUrl, frameborder: "0" })));
|
|
166
|
-
}
|
|
167
|
-
renderReservationDate(reservation) {
|
|
168
|
-
return (index.h("span", { class: reservation.from_timestamp ? 's-booking-field-reservations-has-time' : '' }, index.h("i", { class: "s-booking-field-reservations-icon", innerHTML: Calendar }), reservation.date));
|
|
169
|
-
}
|
|
170
|
-
renderReservationTime(reservation) {
|
|
171
|
-
if (!reservation.from_timestamp)
|
|
172
|
-
return '';
|
|
173
|
-
return (index.h("span", { class: "s-booking-field-reservations-time" }, index.h("i", { class: "s-booking-field-reservations-icon", innerHTML: TimeIcon }), index.h("span", null, reservation.from_timestamp, " - ", reservation.to_timestamp)));
|
|
174
|
-
}
|
|
175
|
-
render() {
|
|
176
|
-
return (index.h(index.Host, { key: '04c9e3dc3dc825bd6905221d858c260f7ca34748' }, index.h("div", { key: '07ec38cec1bd1798640dd7ea9592bb3b17d945c6', class: "s-booking-field-main" }, this.option.required || this.reservations.length > 0 ? index.h("div", { class: "s-booking-field-price" }, index.h("span", { innerHTML: salla.money(this.option.price) })) : '', index.h("salla-button", { key: '6b71889cfc0429d15c466a6f194df31549f09786', class: "s-booking-field-book-now", size: "small", loaderPosition: "center", fill: "outline", onClick: event => this.openBookingModal(event, false) }, index.h("span", { key: 'a16f8db6f52c7751ea605efcae04057ca0dc5b61', class: "s-booking-field-book-now-content" }, index.h("span", { key: '95f6086a599bcc620c87ece6c6ae9620dba15581', innerHTML: BookingTime }), this.reservations.length ? this.editLabel : this.bookNowLabel))), this.reservations.length > 0 && (index.h("div", { key: 'b3615100bbfff3d98d0ac99145aaf53449790c94', class: "s-booking-field-reservations" }, this.reservations.map((reservation, index$1) => (index.h("div", { key: index$1, class: "s-booking-field-reservations-item" }, this.renderReservationDate(reservation), this.renderReservationTime(reservation)))))), index.h("input", { key: '126f14f2e520b8696bc7450e209bad30b267878b', class: "s-hidden", name: this.option.name, required: this.option.required, value: JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations), ref: reservations => this.reservationsInput = reservations }), this.iframeReady && this.bookingModal()));
|
|
177
|
-
}
|
|
178
|
-
get host() { return index.getElement(this); }
|
|
179
|
-
};
|
|
180
|
-
SallaBookingField.style = sallaBookingFieldCss;
|
|
181
|
-
|
|
182
|
-
const SallaConditionalFields = class {
|
|
183
|
-
constructor(hostRef) {
|
|
184
|
-
index.registerInstance(this, hostRef);
|
|
185
|
-
}
|
|
186
|
-
hideAllOptions(optionId) {
|
|
187
|
-
this.host.querySelectorAll(`[data-show-when^="options[${optionId}"]`).forEach((field) => {
|
|
188
|
-
field.classList.add('hidden');
|
|
189
|
-
this.hideAllOptions(field.dataset.optionId);
|
|
190
|
-
this.disableInputs(field);
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
disableInputs(field) {
|
|
194
|
-
field.querySelectorAll('[name]').forEach((input) => {
|
|
195
|
-
input.setAttribute('disabled', '');
|
|
196
|
-
input.removeAttribute('required');
|
|
197
|
-
if (input?.tagName?.toLowerCase() === 'select') {
|
|
198
|
-
input.value = '';
|
|
199
|
-
}
|
|
200
|
-
if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {
|
|
201
|
-
// @ts-ignore
|
|
202
|
-
input.checked = false;
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
changeHandler(event) {
|
|
207
|
-
salla.event.emit('salla-onditional-fields::change', event);
|
|
208
|
-
salla.log('Received the change event: ', event);
|
|
209
|
-
if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox', 'radio'].includes(event.target.getAttribute('type'))) {
|
|
210
|
-
salla.log('Ignore the change because is not a supported input: ' + (event?.target?.tagName || 'N/A'));
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
let optionId = event.target.name.replace('[]', '');
|
|
214
|
-
let isMultiple = event.target.getAttribute('type') === 'checkbox';
|
|
215
|
-
let isRadio = event.target.getAttribute('type') === 'radio';
|
|
216
|
-
salla.log('Trying to find all elements with condition:', `[data-show-when^="${optionId}"]`);
|
|
217
|
-
this.host.querySelectorAll(`[data-show-when^="${optionId}"]`)
|
|
218
|
-
.forEach((field) => {
|
|
219
|
-
let isEqual = !field?.dataset.showWhen.includes('!=');
|
|
220
|
-
let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();
|
|
221
|
-
let isSelected;
|
|
222
|
-
if (isMultiple) {
|
|
223
|
-
let selectedValues = Array.from(this.host.querySelectorAll(`input[name="${event.target.name}"]:checked`), e => e?.value);
|
|
224
|
-
isSelected = selectedValues.includes(value.toString());
|
|
225
|
-
}
|
|
226
|
-
else if (isRadio) {
|
|
227
|
-
// Handle radio inputs.
|
|
228
|
-
isSelected = event.target.checked && event.target.value === value;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
isSelected = value === event.target.value;
|
|
232
|
-
}
|
|
233
|
-
salla.log('The input is ', isMultiple ? 'Multiple' : isRadio ? 'Radio' : 'Single', ' value:', isSelected);
|
|
234
|
-
let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);
|
|
235
|
-
if (showTheInput) {
|
|
236
|
-
field.classList.remove('hidden');
|
|
237
|
-
field.querySelectorAll('[name]').forEach((input) => {
|
|
238
|
-
input.removeAttribute('disabled');
|
|
239
|
-
const closestProductOption = input.closest('.s-product-options-option');
|
|
240
|
-
if (closestProductOption.dataset.optionRequired === 'true') {
|
|
241
|
-
input.setAttribute('required', '');
|
|
242
|
-
}
|
|
243
|
-
if (input.getAttribute('type') === 'checkbox') {
|
|
244
|
-
const checkboxes = Array.from(document.querySelectorAll(`input[type="checkbox"][name="${input.getAttribute('name')}"]`));
|
|
245
|
-
const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked);
|
|
246
|
-
if (isAnyChecked) {
|
|
247
|
-
checkboxes.forEach((checkbox) => {
|
|
248
|
-
checkbox.removeAttribute('required');
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
this.hideAllOptions(field.dataset.optionId);
|
|
256
|
-
field.classList.add('hidden');
|
|
257
|
-
this.disableInputs(field);
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
componentDidRender() {
|
|
262
|
-
this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {
|
|
263
|
-
// @ts-ignore
|
|
264
|
-
let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();
|
|
265
|
-
if (!optionName) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
this.changeHandler({
|
|
269
|
-
target: this.host.querySelector('[name^="' + optionName + '"]')
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
render() {
|
|
274
|
-
return (index.h(index.Host, { key: '405156ba83b8731039c2dd0ff800f617150cc722' }, index.h("slot", { key: '2bff17ce7b49fef9b028d673992d256b00e9481b' })));
|
|
275
|
-
}
|
|
276
|
-
get host() { return index.getElement(this); }
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
exports.salla_booking_field = SallaBookingField;
|
|
280
|
-
exports.salla_conditional_fields = SallaConditionalFields;
|