@salla.sa/twilight-components 2.14.389 → 2.14.390
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-D-Sm5mfd.js → filepond-DFct_qpx.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-D_Q9tOzh.js → filepond-plugin-file-poster-B_Lr4Ulx.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-jE8i9yLT.js → filepond-plugin-file-validate-size-BqkoO_hr.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-ClNK2GsY.js → filepond-plugin-file-validate-type-DyTH8eH0.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BtI2loP1.js → filepond-plugin-image-edit-Cxg-WjCl.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DFksd-cT.js → filepond-plugin-image-exif-orientation-BSVkpMNu.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-B6iy7dvj.js → filepond-plugin-image-preview-DNcmQwuK.js} +1 -1
- package/dist/cjs/{index-CZzG9P8m.js → index-B8vh41va.js} +26 -10
- package/dist/cjs/{index-PbcABX0l.js → index-DnQaQgSB.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +63 -0
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.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_7.cjs.entry.js +10 -10
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.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-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +196 -0
- package/dist/cjs/salla-custom-fields.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-gifting.cjs.entry.js +91 -16
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.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-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/{salla-accordion-body_3.cjs.entry.js → salla-map.cjs.entry.js} +1 -57
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.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-modal.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-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +95 -0
- package/dist/cjs/salla-order-edit.cjs.entry.js +181 -0
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/{salla-count-down_2.cjs.entry.js → salla-product-card.cjs.entry.js} +1 -160
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.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-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.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/cjs/{vanilla-picker-BP4lqf-K.js → vanilla-picker-BZ48aiBi.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/salla-count-down/salla-count-down.css +4 -0
- package/dist/collection/components/salla-count-down/salla-count-down.js +122 -13
- package/dist/collection/components/salla-gifting/salla-gifting.js +96 -15
- package/dist/collection/components/salla-order-edit/interfaces.js +1 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.css +0 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +185 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit.css +0 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit.js +256 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-count-down2.js +49 -13
- package/dist/components/salla-gifting.js +96 -15
- package/dist/components/salla-order-edit-item.d.ts +11 -0
- package/dist/components/salla-order-edit-item.js +9 -0
- package/dist/components/salla-order-edit-item2.js +184 -0
- package/dist/components/salla-order-edit.d.ts +11 -0
- package/dist/components/salla-order-edit.js +291 -0
- package/dist/components/salla-quantity-input.js +1 -125
- package/dist/components/salla-quantity-input2.js +130 -0
- package/dist/esm/{filepond-PPWykQxI.js → filepond-C9FlNeRD.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BRSyNznG.js → filepond-plugin-file-poster-BfX4exY0.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BKa_IBRc.js → filepond-plugin-file-validate-size-B5-cSfmI.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-B2Gqcysx.js → filepond-plugin-file-validate-type-DKvNhI35.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C0UvZ9iA.js → filepond-plugin-image-edit-DV1-ZICm.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-Dmzu9ZJy.js → filepond-plugin-image-exif-orientation-idrSYwAk.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CaZ36U6e.js → filepond-plugin-image-preview-os8BCUOs.js} +1 -1
- package/dist/esm/{index-CyfZeaV2.js → index-BcMtCVX0.js} +26 -10
- package/dist/esm/{index-C3w2qMi0.js → index-DQCZHaDc.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +60 -0
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_4.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.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_7.entry.js +10 -10
- package/dist/esm/salla-bullet-delivery.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.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-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +194 -0
- package/dist/esm/salla-custom-fields.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-gifting.entry.js +91 -16
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.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-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/{salla-accordion-body_3.entry.js → salla-map.entry.js} +2 -56
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.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-modal.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-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +93 -0
- package/dist/esm/salla-order-edit.entry.js +179 -0
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/{salla-count-down_2.entry.js → salla-product-card.entry.js} +2 -160
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.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-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.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/{vanilla-picker-BnLjo9lg.js → vanilla-picker-BBEKwYz7.js} +1 -1
- package/dist/twilight/{p-49178d13.entry.js → p-00a2d261.entry.js} +1 -1
- package/dist/twilight/{p-0dcadf17.entry.js → p-0b27ca19.entry.js} +1 -1
- package/dist/twilight/{p-52249b73.entry.js → p-0d0ca330.entry.js} +1 -1
- package/dist/twilight/{p-749f87cc.entry.js → p-1054b66c.entry.js} +1 -1
- package/dist/twilight/{p-9dace77f.entry.js → p-129d6c0c.entry.js} +1 -1
- package/dist/twilight/{p-d0d9eaa7.entry.js → p-15a052c7.entry.js} +1 -1
- package/dist/twilight/{p-7367264c.entry.js → p-207950ad.entry.js} +1 -1
- package/dist/twilight/{p-4a0248ab.entry.js → p-2548fa30.entry.js} +1 -1
- package/dist/twilight/{p-77a89284.entry.js → p-26cb1fdf.entry.js} +1 -1
- package/dist/twilight/{p-313e016b.entry.js → p-2b74eb03.entry.js} +1 -1
- package/dist/twilight/{p-71199938.entry.js → p-359b2de3.entry.js} +1 -1
- package/dist/twilight/{p-3424772f.entry.js → p-35a2ea22.entry.js} +1 -1
- package/dist/twilight/{p-92aa6f9c.entry.js → p-3653ad70.entry.js} +1 -1
- package/dist/twilight/{p-0e064e79.entry.js → p-374057f7.entry.js} +1 -1
- package/dist/twilight/p-374c63c7.entry.js +4 -0
- package/dist/twilight/{p-3490e1f2.entry.js → p-412643eb.entry.js} +1 -1
- package/dist/twilight/{p-981aa6b2.entry.js → p-47cd7ceb.entry.js} +1 -1
- package/dist/twilight/{p-5db4f7be.entry.js → p-47d1003b.entry.js} +1 -1
- package/dist/twilight/{p-b6d4d88f.entry.js → p-48353d62.entry.js} +1 -1
- package/dist/twilight/{p-833e8364.entry.js → p-4866439f.entry.js} +1 -1
- package/dist/twilight/{p-549d8385.entry.js → p-4f3964d8.entry.js} +1 -1
- package/dist/twilight/{p-f8b53b4a.entry.js → p-4fefd2df.entry.js} +1 -1
- package/dist/twilight/{p-de4fc6d3.entry.js → p-5174aa32.entry.js} +1 -1
- package/dist/twilight/{p-6b642ef5.entry.js → p-58c66b0d.entry.js} +1 -1
- package/dist/twilight/{p-7b3e9e94.entry.js → p-58fa3856.entry.js} +1 -1
- package/dist/twilight/{p-6f230886.entry.js → p-596525f9.entry.js} +1 -1
- package/dist/twilight/p-5a629abd.entry.js +4 -0
- package/dist/twilight/{p-f713d4c1.entry.js → p-5d2ebf97.entry.js} +1 -1
- package/dist/twilight/{p-016b3b19.entry.js → p-65df6042.entry.js} +1 -1
- package/dist/twilight/{p-7eebae69.entry.js → p-67bc002a.entry.js} +1 -1
- package/dist/twilight/{p-b85269f0.entry.js → p-67cf0723.entry.js} +1 -1
- package/dist/twilight/{p-1a9b64ea.entry.js → p-687a597a.entry.js} +1 -1
- package/dist/twilight/{p-75744403.entry.js → p-689701b4.entry.js} +1 -1
- package/dist/twilight/{p-646ac137.entry.js → p-70e478a6.entry.js} +1 -1
- package/dist/twilight/{p-a3479656.entry.js → p-74472650.entry.js} +1 -1
- package/dist/twilight/{p-5a3fbfcc.entry.js → p-7855ae93.entry.js} +1 -1
- package/dist/twilight/p-8c86ba24.entry.js +4 -0
- package/dist/twilight/{p-9b03dc5f.entry.js → p-8d4d4a0e.entry.js} +1 -1
- package/dist/twilight/{p-85e08789.entry.js → p-8fbd92a2.entry.js} +1 -1
- package/dist/twilight/{p-f2a021d2.entry.js → p-983f9f1e.entry.js} +1 -1
- package/dist/twilight/{p-f9b6a945.entry.js → p-998a3b5f.entry.js} +1 -1
- package/dist/twilight/{p-56f20bf9.entry.js → p-9bf0a7df.entry.js} +1 -1
- package/dist/twilight/{p-414f399b.entry.js → p-9ff1a4dc.entry.js} +1 -1
- package/dist/twilight/{p-C11T4TVo.js → p-B21QGKK8.js} +1 -1
- package/dist/twilight/{p-DaXFe_AG.js → p-Bc2ExcVy.js} +1 -1
- package/dist/twilight/{p-CyfZeaV2.js → p-BcMtCVX0.js} +2 -2
- package/dist/twilight/{p-DV84B4Zf.js → p-C3Z9uRGX.js} +1 -1
- package/dist/twilight/{p-CKAWVE2E.js → p-DIeaJrGb.js} +1 -1
- package/dist/twilight/{p-CJnMMMxb.js → p-DbdyybJU.js} +1 -1
- package/dist/twilight/{p-oPo_An7U.js → p-UFbwqsEd.js} +1 -1
- package/dist/twilight/{p-9af46409.entry.js → p-a39a0eb8.entry.js} +1 -1
- package/dist/twilight/{p-6c5ab45f.entry.js → p-a54364a3.entry.js} +1 -1
- package/dist/twilight/{p-68e1946b.entry.js → p-a6bb162e.entry.js} +1 -1
- package/dist/twilight/{p-dccaabbe.entry.js → p-a6cbb4f5.entry.js} +1 -1
- package/dist/twilight/{p-b6924b12.entry.js → p-a8fd427d.entry.js} +1 -1
- package/dist/twilight/{p-9ae66ab7.entry.js → p-a909028d.entry.js} +1 -1
- package/dist/twilight/{p-fdb99998.entry.js → p-acd70c2f.entry.js} +1 -1
- package/dist/twilight/{p-8538541b.entry.js → p-ae1e338f.entry.js} +1 -1
- package/dist/twilight/{p-ccc3689d.entry.js → p-b19ace8d.entry.js} +1 -1
- package/dist/twilight/p-b697172b.entry.js +4 -0
- package/dist/twilight/{p-c48e2a05.entry.js → p-bb98a631.entry.js} +1 -1
- package/dist/twilight/{p-8c1f6ff5.entry.js → p-c18179ed.entry.js} +1 -1
- package/dist/twilight/{p-8c918f58.entry.js → p-c2d74b3d.entry.js} +1 -1
- package/dist/twilight/{p-83bb3e08.entry.js → p-c45f2128.entry.js} +1 -1
- package/dist/twilight/p-c5522363.entry.js +4 -0
- package/dist/twilight/{p-a5215f9c.entry.js → p-c6e7b06f.entry.js} +1 -1
- package/dist/twilight/{p-d224ad78.entry.js → p-cc6c624c.entry.js} +1 -1
- package/dist/twilight/{p-B5sTdzgA.js → p-ctIqN5Fo.js} +1 -1
- package/dist/twilight/{p-71e9036c.entry.js → p-d607bfd3.entry.js} +1 -1
- package/dist/twilight/{p-2d3c3fc0.entry.js → p-d862646f.entry.js} +1 -1
- package/dist/twilight/{p-e4984da6.entry.js → p-dbcc0a7f.entry.js} +1 -1
- package/dist/twilight/p-dc6f4d54.entry.js +4 -0
- package/dist/twilight/{p-28691a37.entry.js → p-deb74e2e.entry.js} +1 -1
- package/dist/twilight/{p-e51abff8.entry.js → p-dfa729d4.entry.js} +1 -1
- package/dist/twilight/p-e7671432.entry.js +4 -0
- package/dist/twilight/{p-1fa74395.entry.js → p-e7932d3d.entry.js} +1 -1
- package/dist/twilight/{p-46715ed4.entry.js → p-e879fb84.entry.js} +1 -1
- package/dist/twilight/p-e9c7f99a.entry.js +4 -0
- package/dist/twilight/{p-c782ba90.entry.js → p-f100cc25.entry.js} +1 -1
- package/dist/twilight/{p-fca12e58.entry.js → p-f63999f8.entry.js} +1 -1
- package/dist/twilight/{p-nDM6sAQW.js → p-fbLtV-T9.js} +1 -1
- package/dist/twilight/{p-282b2717.entry.js → p-fd22cd01.entry.js} +1 -1
- package/dist/twilight/{p-DgRZXtp7.js → p-ukob-enB.js} +2 -2
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-count-down/salla-count-down.d.ts +24 -0
- package/dist/types/components/salla-gifting/gift-schema.d.ts +4 -0
- package/dist/types/components/salla-gifting/intefaces.d.ts +1 -0
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +10 -1
- package/dist/types/components/salla-order-edit/interfaces.d.ts +114 -0
- package/dist/types/components/salla-order-edit/salla-order-edit-item.d.ts +35 -0
- package/dist/types/components/salla-order-edit/salla-order-edit.d.ts +42 -0
- package/dist/types/components.d.ts +170 -0
- package/package.json +5 -5
- package/dist/twilight/p-1048b469.entry.js +0 -4
- package/dist/twilight/p-69ae622f.entry.js +0 -4
- package/dist/twilight/p-d33f3c58.entry.js +0 -4
- package/dist/twilight/p-fbcc194e.entry.js +0 -4
|
@@ -26,6 +26,11 @@ export class SallaGifting {
|
|
|
26
26
|
this.selectedCountryId = undefined;
|
|
27
27
|
this.selectedCountryCode = undefined;
|
|
28
28
|
this.loadingCities = false;
|
|
29
|
+
this.loadingRegions = false;
|
|
30
|
+
this.regions = [];
|
|
31
|
+
this.selectedRegionId = undefined;
|
|
32
|
+
this.isKSA = false;
|
|
33
|
+
this.step2Animated = false;
|
|
29
34
|
this.showTextArea = false;
|
|
30
35
|
/// Gift Form Data
|
|
31
36
|
this.selectedImage = undefined;
|
|
@@ -60,6 +65,8 @@ export class SallaGifting {
|
|
|
60
65
|
this.selectCountry = salla.lang.get('pages.checkout.select_country');
|
|
61
66
|
this.selectCityInfo = salla.lang.get('blocks.buy_as_gift.city_info');
|
|
62
67
|
this.receiverCityFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_city');
|
|
68
|
+
this.receiverRegionFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_region') || salla.lang.get('pages.checkout.region');
|
|
69
|
+
this.selectRegion = salla.lang.get('pages.checkout.select_region');
|
|
63
70
|
this.receiverEmailFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_email');
|
|
64
71
|
this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder');
|
|
65
72
|
this.sendLater = salla.lang.get('blocks.buy_as_gift.send_later');
|
|
@@ -137,7 +144,7 @@ export class SallaGifting {
|
|
|
137
144
|
*/
|
|
138
145
|
async setWrapperHeight(asStep = 1, delay = 250, additionSpace = 0, newHeight = 0) {
|
|
139
146
|
let currentStep = document.querySelector(`#${this.hostId} .gift-step-${asStep}`);
|
|
140
|
-
|
|
147
|
+
const updateHeight = () => {
|
|
141
148
|
let currentStepHeight = currentStep.offsetHeight;
|
|
142
149
|
if (newHeight) {
|
|
143
150
|
this.stepsWrapper.style.height = `${newHeight}px`;
|
|
@@ -145,7 +152,13 @@ export class SallaGifting {
|
|
|
145
152
|
else {
|
|
146
153
|
this.stepsWrapper.style.height = currentStepHeight + additionSpace + 'px';
|
|
147
154
|
}
|
|
148
|
-
}
|
|
155
|
+
};
|
|
156
|
+
if (this.step2Animated && asStep === 2) {
|
|
157
|
+
requestAnimationFrame(updateHeight);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
setTimeout(updateHeight, delay);
|
|
161
|
+
}
|
|
149
162
|
}
|
|
150
163
|
toggleCalendar() {
|
|
151
164
|
this.showCalendar = !this.showCalendar;
|
|
@@ -214,6 +227,7 @@ export class SallaGifting {
|
|
|
214
227
|
item.classList.remove('opacity-0');
|
|
215
228
|
item.removeAttribute('style');
|
|
216
229
|
});
|
|
230
|
+
this.step2Animated = true;
|
|
217
231
|
}
|
|
218
232
|
}, '-=1200');
|
|
219
233
|
this.currentStep = 2;
|
|
@@ -255,6 +269,7 @@ export class SallaGifting {
|
|
|
255
269
|
}
|
|
256
270
|
}, '-=1200');
|
|
257
271
|
stepBackAnime.play();
|
|
272
|
+
this.step2Animated = false;
|
|
258
273
|
this.setWrapperHeight(1, 600, 0);
|
|
259
274
|
this.currentStep = 1;
|
|
260
275
|
this.parentClass = `is-current-step-${this.currentStep}`;
|
|
@@ -304,23 +319,72 @@ export class SallaGifting {
|
|
|
304
319
|
this.clearError('receiver.city_id');
|
|
305
320
|
}
|
|
306
321
|
async handleCountryChange(event) {
|
|
307
|
-
const countryId = event.target.value;
|
|
322
|
+
const countryId = Number(event.target.value);
|
|
308
323
|
this.selectedCountryId = countryId;
|
|
309
324
|
this.clearError('receiver.country');
|
|
310
325
|
// Find the selected country and store its country_code
|
|
311
326
|
const selectedCountry = this.gift?.countries?.find(country => country.id == countryId);
|
|
312
327
|
this.selectedCountryCode = selectedCountry?.country_code;
|
|
328
|
+
this.isKSA = selectedCountry?.country_code === 'SA';
|
|
329
|
+
// Reset region and city
|
|
330
|
+
this.regions = [];
|
|
331
|
+
this.selectedRegionId = undefined;
|
|
332
|
+
this.gift = { ...this.gift, cities: [] };
|
|
333
|
+
this.receiverCity = undefined;
|
|
313
334
|
if (!countryId || this.gift?.countries?.length === 0) {
|
|
314
|
-
this.gift = { ...this.gift, cities: [] };
|
|
315
|
-
this.receiverCity = undefined;
|
|
316
335
|
this.selectedCountryCode = undefined;
|
|
336
|
+
this.isKSA = false;
|
|
337
|
+
this.setWrapperHeight(2, 0, 0);
|
|
317
338
|
return;
|
|
318
339
|
}
|
|
319
|
-
this.
|
|
340
|
+
if (this.isKSA) {
|
|
341
|
+
// For KSA, fetch regions first
|
|
342
|
+
this.loadingRegions = true;
|
|
343
|
+
this.setWrapperHeight(2, 0, 0);
|
|
344
|
+
try {
|
|
345
|
+
const response = await salla.api.request(`shipping/countries/${countryId}/regions`);
|
|
346
|
+
if (response && response.data) {
|
|
347
|
+
this.regions = response.data;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
console.error('Error fetching regions:', error);
|
|
352
|
+
}
|
|
353
|
+
finally {
|
|
354
|
+
this.loadingRegions = false;
|
|
355
|
+
this.setWrapperHeight(2, 0, 0);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
// For non-KSA, fetch cities directly
|
|
360
|
+
this.loadingCities = true;
|
|
361
|
+
this.setWrapperHeight(2, 0, 0);
|
|
362
|
+
try {
|
|
363
|
+
const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${countryId}`);
|
|
364
|
+
if (response && response.data) {
|
|
365
|
+
this.gift = { ...this.gift, cities: response.data };
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
console.error('Error fetching cities:', error);
|
|
370
|
+
}
|
|
371
|
+
finally {
|
|
372
|
+
this.loadingCities = false;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
async handleRegionChange(event) {
|
|
377
|
+
const regionId = Number(event.target.value);
|
|
378
|
+
this.selectedRegionId = regionId;
|
|
379
|
+
this.clearError('receiver.region');
|
|
380
|
+
// Reset city when region changes
|
|
320
381
|
this.gift = { ...this.gift, cities: [] };
|
|
321
382
|
this.receiverCity = undefined;
|
|
383
|
+
if (!regionId)
|
|
384
|
+
return;
|
|
385
|
+
this.loadingCities = true;
|
|
322
386
|
try {
|
|
323
|
-
const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${
|
|
387
|
+
const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${this.selectedCountryId}®ion_id=${regionId}`);
|
|
324
388
|
if (response && response.data) {
|
|
325
389
|
this.gift = { ...this.gift, cities: response.data };
|
|
326
390
|
}
|
|
@@ -330,6 +394,7 @@ export class SallaGifting {
|
|
|
330
394
|
}
|
|
331
395
|
finally {
|
|
332
396
|
this.loadingCities = false;
|
|
397
|
+
this.setWrapperHeight(2, 0, 0);
|
|
333
398
|
}
|
|
334
399
|
}
|
|
335
400
|
handleUploadImage(img) {
|
|
@@ -385,6 +450,7 @@ export class SallaGifting {
|
|
|
385
450
|
{ key: 'receiver.mobile', value: this.receiverMobile, label: this.receiverMobileFieldLabel },
|
|
386
451
|
...(this.physicalProducts ? [
|
|
387
452
|
{ key: 'receiver.country', value: this.selectedCountryId, label: this.receiverCountryFieldLabel },
|
|
453
|
+
...(this.isKSA ? [{ key: 'receiver.region', value: this.selectedRegionId, label: this.receiverRegionFieldLabel }] : []),
|
|
388
454
|
{ key: 'receiver.city_id', value: this.receiverCity, label: this.receiverCityFieldLabel },
|
|
389
455
|
] : []),
|
|
390
456
|
];
|
|
@@ -411,6 +477,7 @@ export class SallaGifting {
|
|
|
411
477
|
mobile_country_code: this.receiverCountryCode,
|
|
412
478
|
mobile: this.receiverMobile,
|
|
413
479
|
...(this.physicalProducts && this.selectedCountryCode ? { country_code: this.selectedCountryCode } : {}),
|
|
480
|
+
...(this.physicalProducts && this.selectedRegionId ? { region_id: this.selectedRegionId } : {}),
|
|
414
481
|
...(this.receiverCity && this.physicalProducts ? { city_id: this.receiverCity } : {})
|
|
415
482
|
},
|
|
416
483
|
has_apple_pay: salla.helpers.hasApplePay(),
|
|
@@ -435,6 +502,10 @@ export class SallaGifting {
|
|
|
435
502
|
this.setWrapperHeight(2, 150, 0);
|
|
436
503
|
});
|
|
437
504
|
}
|
|
505
|
+
step2ItemClass(extra = '') {
|
|
506
|
+
const base = `anime-item${this.step2Animated ? '' : ' opacity-0'}`;
|
|
507
|
+
return extra ? `${extra} ${base}` : base;
|
|
508
|
+
}
|
|
438
509
|
generateClass() {
|
|
439
510
|
return {
|
|
440
511
|
"s-gifting-widget": true,
|
|
@@ -468,7 +539,7 @@ export class SallaGifting {
|
|
|
468
539
|
}
|
|
469
540
|
render() {
|
|
470
541
|
return [
|
|
471
|
-
h("div", { key: '
|
|
542
|
+
h("div", { key: '5d0eec8210f77d166c144704ec78bffcaf1f4ce0' }, h("salla-list-tile", { key: '19cc20b4f70bbb8a7d267f60052db77589901962', class: this.generateClass() }, h("div", { key: '1c3c52b5ac48e71a6ac26c60494657ac28d16457', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: 'e3379fb3ed39d1bc63500346058b26b883c3be13' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'f6c2a522727546aa27cef725faa8be082da063da', slot: "subtitle" }, h("div", { key: '7b58ad967f39fa2cc660369b72e73f8dc49f90dc' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '848396dcd6ce6009ebc4cf1a209a055ad1adbf15', slot: "action" }, h("salla-button", { key: '2ba69b670f1c958784c6f1dca6b2dd0b93f20859', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: '6ac9ac339e321fc9433465cfd75f299307ee7152', name: "widget-btn-content" }, h("div", { key: 'c61dd36375886c1ecf87f115e5248dca1af7efc9', class: "s-gifting-widget-action-content" }, h("span", { key: '0c8a3630ba6b15889fc4bf3d55a1279cdf713400', innerHTML: GiftSharing }), " \u00A0", h("span", { key: 'c9299ec752e5393f30a78e1e01d367be9e97ca50' }, this.sectionBtnText)))))), h("salla-modal", { key: '9ee17e79f97eee59d25d9627d5b1cd4ada7cadb3', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: 'aba3b6a4d3e903934c9b5e629119c3a3b5bc90ab', slot: "loading" }, h("div", { key: 'e03613cc85bf4024f63d2e256a2744ec78f7eabf', class: "s-gifting-skeleton" }, h("div", { key: '01156691d540ce5ef5723902610a1da27fba3ddb', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'e45b4868e4fa5633aeb22f758f75f5412290b179', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: '2b427d38dd6e0569e16de84ef46eb2052d23b739', class: "s-gifting-modal-title" }, h("div", { key: 'c4f9cb6f513e3ebd2e6ad209648a1f70bcafbcb5', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: 'e684b682a4cca89262128cca13604b7aa9a83cd7', height: '15px', width: '150px' })))), h("div", { key: '2941865d68cd216b4dd82bb8279f6bcbaa062bf3', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '7c4f4235a666930ceef3dc0b38809aea5ee5ce5c', height: '10px', width: '150px' }), h("salla-skeleton", { key: '0257f401762a11b0bf3da7db603b4e5f57bd1aae', height: '230px' }), h("salla-skeleton", { key: 'cced26b189549fcee4eff3a3fbd943a5735b4c6c', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'f5893e5c631564c91bfe42c4102190d43f913947', height: '30px' }), h("salla-skeleton", { key: '64d3738017cf6732b429848c1de4ca16db1adc06', height: '40px' })))), h("slot", { key: '77d5bda8147f7f09d73b97fd7456121626b465a7', name: "header" }), !!this.hasError ?
|
|
472
543
|
h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
|
|
473
544
|
:
|
|
474
545
|
[
|
|
@@ -477,14 +548,18 @@ export class SallaGifting {
|
|
|
477
548
|
h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, this.gift && this.gift.gift_images ?
|
|
478
549
|
this.gift?.gift_images.map((item) => h("a", { class: "s-gifting-clickable s-gifting-image", onClick: () => this.setPreview(item) }, h("img", { style: { "width": "120px" }, src: item.url, alt: `${item.id}` }))) : ''))
|
|
479
550
|
: ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
|
|
480
|
-
this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.
|
|
481
|
-
h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.
|
|
482
|
-
h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.
|
|
551
|
+
this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.step2ItemClass(this.errors?.['sender_name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
|
|
552
|
+
h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
|
|
553
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.mobile'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
|
|
483
554
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.physicalProducts &&
|
|
484
|
-
h("div",
|
|
485
|
-
h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''),
|
|
486
|
-
|
|
487
|
-
|
|
555
|
+
h("div", { class: this.step2ItemClass(this.errors?.['receiver.country'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCountryFieldLabel), h("select", { name: "country", class: "s-form-control", onChange: (event) => this.handleCountryChange(event), required: true }, h("option", { value: "" }, this.selectCountry), this.gift?.countries?.map((country) => (h("option", { value: country.id }, country.name)))), this.errors && this.errors['receiver.country'] ?
|
|
556
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''), this.physicalProducts && this.isKSA &&
|
|
557
|
+
h("div", { class: this.step2ItemClass(this.errors?.['receiver.region'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverRegionFieldLabel), h("select", { name: "region", class: "s-form-control", onChange: (event) => this.handleRegionChange(event), disabled: this.loadingRegions }, h("option", { value: "", selected: true }, this.loadingRegions ? salla.lang.get('common.elements.loading') : this.selectRegion), this.regions?.map((region) => (h("option", { value: region.id }, region.name)))), this.errors && this.errors['receiver.region'] ?
|
|
558
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.region']) : ''), this.physicalProducts &&
|
|
559
|
+
h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCityFieldLabel), h("select", { name: "city", "aria-label": salla.lang.get('blocks.buy_as_gift.select_city'), class: "s-form-control", onChange: (event) => this.handleReceiverCity(event), disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId) }, h("option", { value: "", selected: true }, this.loadingCities ? salla.lang.get('common.elements.loading') : this.selectCity), this.gift?.cities?.map((city) => (h("option", { value: city.id }, city.name)))), this.errors && this.errors['receiver.city_id'] ?
|
|
560
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), this.physicalProducts &&
|
|
561
|
+
h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.physicalProducts && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
|
|
562
|
+
], h("slot", { key: '46da7ff69a3c10b75886a23936f2f9ad8ad0e7bf', name: "footer" })))
|
|
488
563
|
];
|
|
489
564
|
}
|
|
490
565
|
static get is() { return "salla-gifting"; }
|
|
@@ -639,6 +714,8 @@ export class SallaGifting {
|
|
|
639
714
|
"selectCity": {},
|
|
640
715
|
"selectCityInfo": {},
|
|
641
716
|
"receiverCityFieldLabel": {},
|
|
717
|
+
"receiverRegionFieldLabel": {},
|
|
718
|
+
"selectRegion": {},
|
|
642
719
|
"receiverEmailFieldLabel": {},
|
|
643
720
|
"emailPlaceholder": {},
|
|
644
721
|
"sendLater": {},
|
|
@@ -657,6 +734,10 @@ export class SallaGifting {
|
|
|
657
734
|
"selectedCountryId": {},
|
|
658
735
|
"selectedCountryCode": {},
|
|
659
736
|
"loadingCities": {},
|
|
737
|
+
"loadingRegions": {},
|
|
738
|
+
"regions": {},
|
|
739
|
+
"selectedRegionId": {},
|
|
740
|
+
"isKSA": {},
|
|
660
741
|
"parsedFormData": {},
|
|
661
742
|
"showTextArea": {},
|
|
662
743
|
"selectedImage": {},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { h, Host } from "@stencil/core";
|
|
5
|
+
/**
|
|
6
|
+
* @salla/ui-components
|
|
7
|
+
* The `salla-order-edit-item` component renders a single editable order item card
|
|
8
|
+
* with quantity controls, editable product options, and a remove button.
|
|
9
|
+
*/
|
|
10
|
+
export class SallaOrderEditItem {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.handleQuantityChange = (event) => {
|
|
13
|
+
const detail = event.detail;
|
|
14
|
+
const newQuantity = detail?.quantity ?? parseInt(event.target.value, 10);
|
|
15
|
+
if (isNaN(newQuantity) || newQuantity < 1)
|
|
16
|
+
return;
|
|
17
|
+
if (newQuantity === this.quantity)
|
|
18
|
+
return;
|
|
19
|
+
this.quantity = newQuantity;
|
|
20
|
+
this.emitUpdate(newQuantity);
|
|
21
|
+
};
|
|
22
|
+
this.handleOptionsChange = () => {
|
|
23
|
+
this.emitUpdate(this.quantity);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
componentWillLoad() {
|
|
27
|
+
this.quantity = this.item?.quantity || 1;
|
|
28
|
+
}
|
|
29
|
+
componentDidLoad() {
|
|
30
|
+
const quantityEl = this.host.querySelector('salla-quantity-input');
|
|
31
|
+
if (quantityEl) {
|
|
32
|
+
quantityEl.addEventListener('change', this.handleQuantityChange);
|
|
33
|
+
}
|
|
34
|
+
const optionsEl = this.host.querySelector('salla-product-options');
|
|
35
|
+
if (optionsEl) {
|
|
36
|
+
optionsEl.addEventListener('change', this.handleOptionsChange);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
const quantityEl = this.host.querySelector('salla-quantity-input');
|
|
41
|
+
if (quantityEl) {
|
|
42
|
+
quantityEl.removeEventListener('change', this.handleQuantityChange);
|
|
43
|
+
}
|
|
44
|
+
const optionsEl = this.host.querySelector('salla-product-options');
|
|
45
|
+
if (optionsEl) {
|
|
46
|
+
optionsEl.removeEventListener('change', this.handleOptionsChange);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
get hasOptions() {
|
|
50
|
+
const options = this.item.product?.options;
|
|
51
|
+
return options && options.length > 0;
|
|
52
|
+
}
|
|
53
|
+
async getSelectedOptions() {
|
|
54
|
+
const optionsEl = this.host.querySelector(`salla-product-options[product-id="${this.item.product?.id}"]`);
|
|
55
|
+
return (await optionsEl?.getSelectedOptionsData()) || {};
|
|
56
|
+
}
|
|
57
|
+
async emitUpdate(quantity) {
|
|
58
|
+
const detail = { itemId: this.item?.id, quantity };
|
|
59
|
+
if (this.hasOptions) {
|
|
60
|
+
detail.options = await this.getSelectedOptions();
|
|
61
|
+
}
|
|
62
|
+
this.orderItemUpdated.emit(detail);
|
|
63
|
+
}
|
|
64
|
+
removeItem() {
|
|
65
|
+
const itemId = this.item?.id;
|
|
66
|
+
if (itemId == null)
|
|
67
|
+
return;
|
|
68
|
+
this.orderItemRemoved.emit({ itemId });
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
if (!this.item)
|
|
72
|
+
return null;
|
|
73
|
+
const product = this.item.product;
|
|
74
|
+
const productName = this.item.name || product?.name || '';
|
|
75
|
+
const imageUrl = product?.image?.url || '';
|
|
76
|
+
const imageAlt = product?.image?.alt || productName;
|
|
77
|
+
const productUrl = product?.url || '#';
|
|
78
|
+
const price = product?.price;
|
|
79
|
+
const maxQuantity = product?.max_quantity;
|
|
80
|
+
const weightLabel = product?.weight_label;
|
|
81
|
+
const options = this.item.product?.options;
|
|
82
|
+
const quantityAttrs = { value: this.quantity };
|
|
83
|
+
if (maxQuantity) {
|
|
84
|
+
quantityAttrs.max = maxQuantity;
|
|
85
|
+
}
|
|
86
|
+
return (h(Host, null, h("div", null, h("div", { class: "s-order-edit-item-header" }, h("div", { class: "s-order-edit-item-media" }, imageUrl && (h("a", { href: productUrl }, h("img", { src: imageUrl, alt: imageAlt, class: "s-order-edit-item-image" }))), h("div", { class: "s-order-edit-item-details" }, h("h2", { class: "s-order-edit-item-name" }, h("a", { href: productUrl, class: "s-order-edit-item-link" }, productName)), price != null && (h("span", { class: "s-order-edit-item-price", innerHTML: salla.money(price) })), weightLabel && (h("p", { class: "s-order-edit-item-weight" }, salla.lang.getWithDefault('pages.products.weight', 'الوزن'), " ", weightLabel)))), h("salla-button", { type: "button", shape: "icon", size: "small", color: "danger", "aria-label": salla.lang.getWithDefault('common.elements.delete', 'حذف'), onClick: () => this.removeItem() }, h("i", { class: "sicon-cancel" }))), h("div", { class: "s-order-edit-item-quantity" }, h("h3", { class: "s-order-edit-item-quantity-label" }, salla.lang.getWithDefault('common.elements.quantity', 'الكمية')), h("div", { class: "s-order-edit-item-quantity-input" }, h("salla-quantity-input", { ...quantityAttrs }))), this.hasOptions && (h("form", { onSubmit: e => e.preventDefault() }, h("salla-product-options", { "product-id": product.id, options: JSON.stringify(options), key: `${product.id}-order-edit-item-options` }))))));
|
|
87
|
+
}
|
|
88
|
+
static get is() { return "salla-order-edit-item"; }
|
|
89
|
+
static get originalStyleUrls() {
|
|
90
|
+
return {
|
|
91
|
+
"$": ["salla-order-edit-item.scss"]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
static get styleUrls() {
|
|
95
|
+
return {
|
|
96
|
+
"$": ["salla-order-edit-item.css"]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get properties() {
|
|
100
|
+
return {
|
|
101
|
+
"item": {
|
|
102
|
+
"type": "unknown",
|
|
103
|
+
"attribute": "item",
|
|
104
|
+
"mutable": false,
|
|
105
|
+
"complexType": {
|
|
106
|
+
"original": "OrderEditItem",
|
|
107
|
+
"resolved": "OrderEditItem",
|
|
108
|
+
"references": {
|
|
109
|
+
"OrderEditItem": {
|
|
110
|
+
"location": "import",
|
|
111
|
+
"path": "./interfaces",
|
|
112
|
+
"id": "src/components/salla-order-edit/interfaces.ts::OrderEditItem"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": false,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": "Item data object"
|
|
121
|
+
},
|
|
122
|
+
"getter": false,
|
|
123
|
+
"setter": false
|
|
124
|
+
},
|
|
125
|
+
"orderId": {
|
|
126
|
+
"type": "any",
|
|
127
|
+
"attribute": "order-id",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "string | number",
|
|
131
|
+
"resolved": "number | string",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Parent order ID (for API calls)"
|
|
139
|
+
},
|
|
140
|
+
"getter": false,
|
|
141
|
+
"setter": false,
|
|
142
|
+
"reflect": false
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
static get states() {
|
|
147
|
+
return {
|
|
148
|
+
"quantity": {}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
static get events() {
|
|
152
|
+
return [{
|
|
153
|
+
"method": "orderItemUpdated",
|
|
154
|
+
"name": "orderItemUpdated",
|
|
155
|
+
"bubbles": true,
|
|
156
|
+
"cancelable": true,
|
|
157
|
+
"composed": true,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": "Emitted when an item quantity or options are updated"
|
|
161
|
+
},
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "{\n itemId: string | number;\n quantity: number;\n options?: any[];\n }",
|
|
164
|
+
"resolved": "{ itemId: string | number; quantity: number; options?: any[]; }",
|
|
165
|
+
"references": {}
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
"method": "orderItemRemoved",
|
|
169
|
+
"name": "orderItemRemoved",
|
|
170
|
+
"bubbles": true,
|
|
171
|
+
"cancelable": true,
|
|
172
|
+
"composed": true,
|
|
173
|
+
"docs": {
|
|
174
|
+
"tags": [],
|
|
175
|
+
"text": "Emitted when an item is successfully removed"
|
|
176
|
+
},
|
|
177
|
+
"complexType": {
|
|
178
|
+
"original": "{\n itemId: string | number;\n }",
|
|
179
|
+
"resolved": "{ itemId: string | number; }",
|
|
180
|
+
"references": {}
|
|
181
|
+
}
|
|
182
|
+
}];
|
|
183
|
+
}
|
|
184
|
+
static get elementRef() { return "host"; }
|
|
185
|
+
}
|
|
File without changes
|