@salla.sa/twilight-components 2.14.418 → 2.14.419
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-C1_8U7ht.js → filepond-BiRMqsJc.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C2QZkcu0.js → filepond-plugin-file-poster-LU25G59n.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-CbVRd24w.js → filepond-plugin-file-validate-size-J3-riOvN.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-63RP4vcL.js → filepond-plugin-file-validate-type-DMawm6j5.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CjWMhhkZ.js → filepond-plugin-image-edit-QXtHYcEz.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-CJxStqYG.js → filepond-plugin-image-exif-orientation-C0VBHQjd.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview--RTa59Q8.js → filepond-plugin-image-preview-xG9m-vgD.js} +1 -1
- package/dist/cjs/{functions-T48FHZw8.js → functions-CZrHAX2r.js} +1 -1
- package/dist/cjs/helpers-BJ2rnhxz.js +197 -0
- package/dist/cjs/{index-DO_QXaSt.js → index-Ce-Twd7-.js} +10 -6
- package/dist/cjs/{index-CQ4zjhzH.js → index-DE1iYzD2.js} +1 -1
- package/dist/cjs/interfaces-Bh7W0bEU.js +33 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +36 -58
- 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-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +12 -12
- 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 +4 -4
- 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 +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.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-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- 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-banner.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- 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-map.cjs.entry.js +1 -1
- 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 +28 -29
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +41 -0
- package/dist/cjs/salla-order-edit.cjs.entry.js +339 -40
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- 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 +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card_2.cjs.entry.js +6 -6
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +38 -15
- 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-reward-action_4.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
- package/dist/cjs/salla-search.cjs.entry.js +6 -6
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- 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-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 +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/{tracked-promise-BnNAgCN_.js → tracked-promise-DChUtH5B.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-wbE79zwn.js → vanilla-picker-ivACsPLJ.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-order-edit/helpers.js +181 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.css +3 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +42 -30
- package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.css +4 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +93 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit.css +3 -0
- package/dist/collection/components/salla-order-edit/salla-order-edit.js +353 -39
- 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 +28 -0
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-products-list/salla-products-list.js +54 -14
- 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 +5 -5
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- 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-order-edit-item2.js +207 -30
- package/dist/components/salla-order-edit-product-card.d.ts +11 -0
- package/dist/components/salla-order-edit-product-card.js +59 -0
- package/dist/components/salla-order-edit.js +378 -65
- 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-options2.js +8 -1
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-products-list2.js +39 -15
- package/dist/components/salla-quantity-input2.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 +5 -5
- package/dist/components/salla-skeleton2.js +1 -1
- 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-BaqNYv3C.js → filepond-0Pvy36B6.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-nENZqIRv.js → filepond-plugin-file-poster-DV7OW1XJ.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DGOq4RG8.js → filepond-plugin-file-validate-size-DEya24r_.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DwM-3UO7.js → filepond-plugin-file-validate-type-DiFvVzC6.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BCqDiFWK.js → filepond-plugin-image-edit-DGBw5KRt.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DiuxhjrQ.js → filepond-plugin-image-exif-orientation-BbpZAlI-.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DbFvPPQQ.js → filepond-plugin-image-preview-CjRkn0jY.js} +1 -1
- package/dist/esm/{functions-JPNAXx4d.js → functions-BcJ4xDKw.js} +1 -1
- package/dist/esm/helpers-DR_vlSvU.js +184 -0
- package/dist/esm/{index-DElBWCVR.js → index-313k5SuU.js} +1 -1
- package/dist/esm/{index-BwsreBbG.js → index-CfaNNoM2.js} +10 -6
- package/dist/esm/interfaces-CoQJOPRz.js +33 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +10 -32
- 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-badge.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +12 -12
- 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 +4 -4
- 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 +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.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-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- 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-banner.entry.js +2 -2
- package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map.entry.js +1 -1
- 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 +28 -29
- package/dist/esm/salla-order-edit-product-card.entry.js +39 -0
- package/dist/esm/salla-order-edit.entry.js +339 -40
- package/dist/esm/salla-order-summary.entry.js +2 -2
- 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 +3 -3
- package/dist/esm/salla-placeholder.entry.js +2 -2
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card_2.entry.js +6 -6
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +38 -15
- 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-reward-action_4.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +2 -2
- package/dist/esm/salla-search.entry.js +6 -6
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/{tracked-promise-BD-FZk2P.js → tracked-promise-xD-AZOwt.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CqoFxJJE.js → vanilla-picker-Bu8PG2Le.js} +1 -1
- package/dist/twilight/{p-ce588635.entry.js → p-02600ee1.entry.js} +1 -1
- package/dist/twilight/{p-c5e18341.entry.js → p-02608fcd.entry.js} +1 -1
- package/dist/twilight/{p-f73c7b43.entry.js → p-029f9bfd.entry.js} +1 -1
- package/dist/twilight/p-073536c3.entry.js +4 -0
- package/dist/twilight/{p-ceb9458e.entry.js → p-0d4afc4b.entry.js} +1 -1
- package/dist/twilight/{p-edaba475.entry.js → p-11da9c5a.entry.js} +1 -1
- package/dist/twilight/{p-7d3722ad.entry.js → p-13b1dae0.entry.js} +1 -1
- package/dist/twilight/{p-ab5e0aef.entry.js → p-13f019f5.entry.js} +1 -1
- package/dist/twilight/{p-069485ec.entry.js → p-15be9e7a.entry.js} +1 -1
- package/dist/twilight/{p-d9c4d2ed.entry.js → p-1bce06bf.entry.js} +1 -1
- package/dist/twilight/{p-0bf11f89.entry.js → p-1fe827c7.entry.js} +1 -1
- package/dist/twilight/{p-fec6b08b.entry.js → p-22d12f28.entry.js} +1 -1
- package/dist/twilight/{p-b737dbcb.entry.js → p-2afe64d1.entry.js} +1 -1
- package/dist/twilight/{p-3f50a52d.entry.js → p-2bb796b3.entry.js} +1 -1
- package/dist/twilight/{p-f653f2bb.entry.js → p-2f1cb6da.entry.js} +1 -1
- package/dist/twilight/{p-f88806d7.entry.js → p-3252277a.entry.js} +1 -1
- package/dist/twilight/{p-4110e600.entry.js → p-3539d2a1.entry.js} +1 -1
- package/dist/twilight/{p-167f5262.entry.js → p-3bda095b.entry.js} +1 -1
- package/dist/twilight/{p-61215f22.entry.js → p-3d286589.entry.js} +1 -1
- package/dist/twilight/{p-5ac81ffe.entry.js → p-410f0149.entry.js} +1 -1
- package/dist/twilight/{p-57451f00.entry.js → p-42bf8cc1.entry.js} +1 -1
- package/dist/twilight/p-43c4c857.entry.js +4 -0
- package/dist/twilight/{p-ff90dbf0.entry.js → p-4550de2d.entry.js} +1 -1
- package/dist/twilight/{p-fbe07d2d.entry.js → p-4752dc2c.entry.js} +1 -1
- package/dist/twilight/{p-9d8e4e7c.entry.js → p-48aba4cd.entry.js} +1 -1
- package/dist/twilight/p-49e28ca2.entry.js +4 -0
- package/dist/twilight/{p-10884e6e.entry.js → p-4a7cbe49.entry.js} +1 -1
- package/dist/twilight/{p-46088f51.entry.js → p-51252013.entry.js} +1 -1
- package/dist/twilight/{p-29fc145b.entry.js → p-53e63007.entry.js} +1 -1
- package/dist/twilight/{p-dcc65eb2.entry.js → p-57a4f3d2.entry.js} +1 -1
- package/dist/twilight/{p-a96ec635.entry.js → p-5dbb89d5.entry.js} +1 -1
- package/dist/twilight/p-5dd07559.entry.js +4 -0
- package/dist/twilight/{p-ac008da7.entry.js → p-5dd75357.entry.js} +1 -1
- package/dist/twilight/p-5e4e45be.entry.js +4 -0
- package/dist/twilight/{p-d0cf9b68.entry.js → p-5f174a3e.entry.js} +1 -1
- package/dist/twilight/{p-695e3211.entry.js → p-625218f7.entry.js} +1 -1
- package/dist/twilight/{p-03c39b2d.entry.js → p-654a0990.entry.js} +1 -1
- package/dist/twilight/{p-d739ae41.entry.js → p-654b9857.entry.js} +1 -1
- package/dist/twilight/{p-60878c2e.entry.js → p-65ff0bf4.entry.js} +1 -1
- package/dist/twilight/{p-aaff5603.entry.js → p-665aa4d1.entry.js} +1 -1
- package/dist/twilight/{p-5b371b1f.entry.js → p-69bec0e3.entry.js} +1 -1
- package/dist/twilight/{p-2bd83486.entry.js → p-6b02b118.entry.js} +1 -1
- package/dist/twilight/{p-44db7163.entry.js → p-72d4121c.entry.js} +1 -1
- package/dist/twilight/{p-993bdcbe.entry.js → p-74cd506d.entry.js} +1 -1
- package/dist/twilight/{p-b6ac7a22.entry.js → p-75f26291.entry.js} +1 -1
- package/dist/twilight/{p-1c3e0dbc.entry.js → p-7ce1dff1.entry.js} +1 -1
- package/dist/twilight/{p-7d492d3c.entry.js → p-7d08def1.entry.js} +1 -1
- package/dist/twilight/{p-ad762138.entry.js → p-7f6c6d8a.entry.js} +1 -1
- package/dist/twilight/{p-0a786447.entry.js → p-82d776ae.entry.js} +1 -1
- package/dist/twilight/{p-d469525b.entry.js → p-87e78adc.entry.js} +1 -1
- package/dist/twilight/{p-b6dce61a.entry.js → p-891e4b61.entry.js} +1 -1
- package/dist/twilight/{p-91d74168.entry.js → p-8bdd9c9b.entry.js} +1 -1
- package/dist/twilight/{p-19e82de2.entry.js → p-8d0b4049.entry.js} +1 -1
- package/dist/twilight/{p-9134d94d.entry.js → p-8dbff2c8.entry.js} +1 -1
- package/dist/twilight/{p-9c73e42a.entry.js → p-944b02ec.entry.js} +1 -1
- package/dist/twilight/{p-af1474dd.entry.js → p-9693310b.entry.js} +1 -1
- package/dist/twilight/{p-c1d4db6f.entry.js → p-9dcc291b.entry.js} +1 -1
- package/dist/twilight/{p-Dw7mGaHj.js → p-B6bkY5-l.js} +1 -1
- package/dist/twilight/{p-BuNOvMeU.js → p-BCWPIsso.js} +1 -1
- package/dist/twilight/p-BLehGhpL.js +4 -0
- package/dist/twilight/{p-CTyl0UJE.js → p-BN2EOPT0.js} +1 -1
- package/dist/twilight/{p-DlGhggDp.js → p-BeZ-z3uX.js} +1 -1
- package/dist/twilight/{p-GgHo6Cr_.js → p-Bu7ZSFM5.js} +1 -1
- package/dist/twilight/{p-CEuTw3-D.js → p-C0UBM1r0.js} +1 -1
- package/dist/twilight/{p-Cw0Ky-u0.js → p-C1ReTfKT.js} +1 -1
- package/dist/twilight/p-C8xwacGT.js +4 -0
- package/dist/twilight/{p-DPgASjJ8.js → p-CX1cQxmm.js} +1 -1
- package/dist/twilight/{p-BwsreBbG.js → p-CfaNNoM2.js} +1 -1
- package/dist/twilight/p-CoQJOPRz.js +4 -0
- package/dist/twilight/{p-LWKLIOwS.js → p-P9Uquv6J.js} +1 -1
- package/dist/twilight/p-a132e9dc.entry.js +4 -0
- package/dist/twilight/{p-a3a0bafa.entry.js → p-a22ab12e.entry.js} +1 -1
- package/dist/twilight/{p-4807586a.entry.js → p-a5093858.entry.js} +1 -1
- package/dist/twilight/{p-4edf67be.entry.js → p-a5483eab.entry.js} +1 -1
- package/dist/twilight/{p-57e0b11b.entry.js → p-ab922196.entry.js} +1 -1
- package/dist/twilight/{p-2f833767.entry.js → p-adf1ff1f.entry.js} +1 -1
- package/dist/twilight/{p-4c57de7b.entry.js → p-b075bdd3.entry.js} +1 -1
- package/dist/twilight/{p-b9062150.entry.js → p-b6446ed0.entry.js} +1 -1
- package/dist/twilight/{p-25104b13.entry.js → p-bd29fa58.entry.js} +1 -1
- package/dist/twilight/{p-b4fd50ef.entry.js → p-c0a96a41.entry.js} +1 -1
- package/dist/twilight/{p-b9c9c487.entry.js → p-c0da03a4.entry.js} +1 -1
- package/dist/twilight/{p-1c1ac203.entry.js → p-ce4823e8.entry.js} +1 -1
- package/dist/twilight/{p-af84c7b8.entry.js → p-cef8dfa8.entry.js} +1 -1
- package/dist/twilight/p-d737a90e.entry.js +4 -0
- package/dist/twilight/p-d7e404d1.entry.js +4 -0
- package/dist/twilight/{p-a00015ec.entry.js → p-d95fad47.entry.js} +1 -1
- package/dist/twilight/{p-201926a3.entry.js → p-dacc7681.entry.js} +1 -1
- package/dist/twilight/{p-580441f5.entry.js → p-e15ceaae.entry.js} +1 -1
- package/dist/twilight/p-e692fd88.entry.js +4 -0
- package/dist/twilight/{p-59657a19.entry.js → p-ee5afe29.entry.js} +1 -1
- package/dist/twilight/{p-681953ef.entry.js → p-f248ce38.entry.js} +1 -1
- package/dist/twilight/{p-c968dab0.entry.js → p-f6468e0f.entry.js} +1 -1
- package/dist/twilight/{p-cd6fc43c.entry.js → p-f9e89a30.entry.js} +1 -1
- package/dist/twilight/{p-e5325563.entry.js → p-fdd2d95e.entry.js} +1 -1
- package/dist/twilight/{p-0654ccca.entry.js → p-ff0d8f2b.entry.js} +1 -1
- package/dist/twilight/{p-CbukOCNI.js → p-nj3fF7xi.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-order-edit/helpers.d.ts +25 -0
- package/dist/types/components/salla-order-edit/interfaces.d.ts +22 -25
- package/dist/types/components/salla-order-edit/salla-order-edit-item.d.ts +7 -5
- package/dist/types/components/salla-order-edit/salla-order-edit-product-card.d.ts +11 -0
- package/dist/types/components/salla-order-edit/salla-order-edit.d.ts +56 -4
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +4 -0
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +5 -0
- package/dist/types/components.d.ts +51 -4
- package/package.json +5 -5
- package/dist/twilight/p-36048354.entry.js +0 -4
- package/dist/twilight/p-60d875cc.entry.js +0 -4
- package/dist/twilight/p-7a33e83b.entry.js +0 -4
- package/dist/twilight/p-86cfa253.entry.js +0 -4
- package/dist/twilight/p-c0b690b2.entry.js +0 -4
- package/dist/twilight/p-e07f938a.entry.js +0 -4
- package/dist/twilight/p-f-qXMnue.js +0 -4
- package/dist/twilight/p-f2815da9.entry.js +0 -4
- package/dist/twilight/p-f7b21078.entry.js +0 -4
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-Ce-Twd7-.js');
|
|
7
|
+
var helpers = require('./helpers-BJ2rnhxz.js');
|
|
8
|
+
require('./interfaces-Bh7W0bEU.js');
|
|
7
9
|
|
|
8
|
-
const sallaOrderEditItemCss = "";
|
|
10
|
+
const sallaOrderEditItemCss = ":host{display:block}";
|
|
9
11
|
|
|
10
12
|
const SallaOrderEditItem = class {
|
|
11
13
|
constructor(hostRef) {
|
|
12
14
|
index.registerInstance(this, hostRef);
|
|
13
15
|
this.orderItemUpdated = index.createEvent(this, "orderItemUpdated");
|
|
14
16
|
this.orderItemRemoved = index.createEvent(this, "orderItemRemoved");
|
|
17
|
+
this.quantityInput = null;
|
|
18
|
+
this.productOptions = null;
|
|
15
19
|
this.handleQuantityChange = (event) => {
|
|
16
20
|
const detail = event.detail;
|
|
17
21
|
const newQuantity = detail?.quantity ?? parseInt(event.target.value, 10);
|
|
@@ -29,38 +33,30 @@ const SallaOrderEditItem = class {
|
|
|
29
33
|
componentWillLoad() {
|
|
30
34
|
this.quantity = this.item?.quantity || 1;
|
|
31
35
|
}
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (optionsEl) {
|
|
39
|
-
optionsEl.addEventListener('change', this.handleOptionsChange);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
disconnectedCallback() {
|
|
43
|
-
const quantityEl = this.host.querySelector('salla-quantity-input');
|
|
44
|
-
if (quantityEl) {
|
|
45
|
-
quantityEl.removeEventListener('change', this.handleQuantityChange);
|
|
46
|
-
}
|
|
47
|
-
const optionsEl = this.host.querySelector('salla-product-options');
|
|
48
|
-
if (optionsEl) {
|
|
49
|
-
optionsEl.removeEventListener('change', this.handleOptionsChange);
|
|
50
|
-
}
|
|
36
|
+
handleItemChange(newItem) {
|
|
37
|
+
const newQuantity = newItem?.quantity || 1;
|
|
38
|
+
if (newQuantity === this.quantity)
|
|
39
|
+
return;
|
|
40
|
+
this.quantity = newQuantity;
|
|
41
|
+
this.quantityInput?.setValue?.(newQuantity, false);
|
|
51
42
|
}
|
|
52
43
|
get hasOptions() {
|
|
53
|
-
|
|
54
|
-
return options && options.length > 0;
|
|
44
|
+
return (this.item.product?.options?.length || 0) > 0;
|
|
55
45
|
}
|
|
56
46
|
async getSelectedOptions() {
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
return (await this.productOptions?.getSelectedOptionsData?.()) || {};
|
|
48
|
+
}
|
|
49
|
+
async getOptionsData() {
|
|
50
|
+
return (await this.productOptions?.getOptionsData?.()) || this.item.product?.options || [];
|
|
59
51
|
}
|
|
60
52
|
async emitUpdate(quantity) {
|
|
61
|
-
const
|
|
53
|
+
const itemId = this.item?.id;
|
|
54
|
+
if (itemId == null)
|
|
55
|
+
return;
|
|
56
|
+
const detail = { itemId, quantity };
|
|
62
57
|
if (this.hasOptions) {
|
|
63
58
|
detail.options = await this.getSelectedOptions();
|
|
59
|
+
detail.optionDefinitions = await this.getOptionsData();
|
|
64
60
|
}
|
|
65
61
|
this.orderItemUpdated.emit(detail);
|
|
66
62
|
}
|
|
@@ -79,16 +75,19 @@ const SallaOrderEditItem = class {
|
|
|
79
75
|
const imageAlt = product?.image?.alt || productName;
|
|
80
76
|
const productUrl = product?.url || '#';
|
|
81
77
|
const price = product?.price;
|
|
82
|
-
const maxQuantity = product
|
|
78
|
+
const maxQuantity = helpers.getOrderEditProductMaxQuantity(product);
|
|
83
79
|
const weightLabel = product?.weight_label;
|
|
84
80
|
const options = this.item.product?.options;
|
|
81
|
+
const optionsInstanceKey = `order-edit-item-${this.item.id}-${product?.id}`;
|
|
85
82
|
const quantityAttrs = { value: this.quantity };
|
|
86
83
|
if (maxQuantity) {
|
|
87
84
|
quantityAttrs.max = maxQuantity;
|
|
88
85
|
}
|
|
89
|
-
return (index.h(index.Host, null, index.h("div", null, index.h("div", { class: "s-order-edit-item-header" }, index.h("div", { class: "s-order-edit-item-media" }, imageUrl && (index.h("a", { href: productUrl }, index.h("img", { src: imageUrl, alt: imageAlt, class: "s-order-edit-item-image" }))), index.h("div", { class: "s-order-edit-item-details" }, index.h("h2", { class: "s-order-edit-item-name" }, index.h("a", { href: productUrl, class: "s-order-edit-item-link" }, productName)), price != null && (index.h("span", { class: "s-order-edit-item-price", innerHTML: salla.money(price) })), weightLabel && (index.h("p", { class: "s-order-edit-item-weight" }, salla.lang.getWithDefault('pages.products.weight', 'الوزن'), " ", weightLabel)))), index.h("salla-button", { type: "button", shape: "icon", size: "small", color: "danger", "aria-label": salla.lang.getWithDefault('common.elements.delete', 'حذف'), onClick: () => this.removeItem() }, index.h("i", { class: "sicon-cancel" }))), index.h("div", { class: "s-order-edit-item-quantity" }, index.h("h3", { class: "s-order-edit-item-quantity-label" }, salla.lang.getWithDefault('common.elements.quantity', 'الكمية')), index.h("div", { class: "s-order-edit-item-quantity-input" }, index.h("salla-quantity-input", { ...quantityAttrs }))), this.hasOptions && (index.h("form", { onSubmit: e => e.preventDefault() }, index.h("salla-product-options", { "product-id": product.id, options: JSON.stringify(options), key: `${
|
|
86
|
+
return (index.h(index.Host, null, index.h("div", null, index.h("div", { class: "s-order-edit-item-header" }, index.h("div", { class: "s-order-edit-item-media" }, imageUrl && (index.h("a", { href: productUrl }, index.h("img", { src: imageUrl, alt: imageAlt, class: "s-order-edit-item-image" }))), index.h("div", { class: "s-order-edit-item-details" }, index.h("h2", { class: "s-order-edit-item-name" }, index.h("a", { href: productUrl, class: "s-order-edit-item-link" }, productName)), price != null && (index.h("span", { class: "s-order-edit-item-price", innerHTML: salla.money(price) })), weightLabel && (index.h("p", { class: "s-order-edit-item-weight" }, salla.lang.getWithDefault('pages.products.weight', 'الوزن'), " ", weightLabel)))), index.h("salla-button", { type: "button", shape: "icon", size: "small", color: "danger", "aria-label": salla.lang.getWithDefault('common.elements.delete', 'حذف'), onClick: () => this.removeItem() }, index.h("i", { class: "sicon-cancel" }))), index.h("div", { class: "s-order-edit-item-quantity" }, index.h("h3", { class: "s-order-edit-item-quantity-label" }, salla.lang.getWithDefault('common.elements.quantity', 'الكمية')), index.h("div", { class: "s-order-edit-item-quantity-input" }, index.h("salla-quantity-input", { ref: el => (this.quantityInput = el), ...quantityAttrs, onChange: this.handleQuantityChange }))), this.hasOptions && (index.h("form", { class: "s-order-edit-item-options", onSubmit: e => e.preventDefault() }, index.h("salla-product-options", { ref: el => (this.productOptions = el), onChange: this.handleOptionsChange, "product-id": product.id, "unique-key": optionsInstanceKey, options: JSON.stringify(options), key: `${optionsInstanceKey}-options` }))))));
|
|
90
87
|
}
|
|
91
|
-
get
|
|
88
|
+
static get watchers() { return {
|
|
89
|
+
"item": ["handleItemChange"]
|
|
90
|
+
}; }
|
|
92
91
|
};
|
|
93
92
|
SallaOrderEditItem.style = sallaOrderEditItemCss;
|
|
94
93
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
var index = require('./index-Ce-Twd7-.js');
|
|
7
|
+
|
|
8
|
+
const sallaOrderEditProductCardCss = ":host{display:block;min-width:0}";
|
|
9
|
+
|
|
10
|
+
const SallaOrderEditProductCard = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.orderEditProductSelected = index.createEvent(this, "orderEditProductSelected");
|
|
14
|
+
}
|
|
15
|
+
get productData() {
|
|
16
|
+
if (!this.product) {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
if (typeof this.product === 'object') {
|
|
20
|
+
return this.product;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(this.product);
|
|
24
|
+
}
|
|
25
|
+
catch (_error) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
handleSelectProduct() {
|
|
30
|
+
this.orderEditProductSelected.emit({ product: this.productData });
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const product = this.productData;
|
|
34
|
+
const productName = product?.name || salla.lang.getWithDefault('common.elements.product', 'منتج');
|
|
35
|
+
const price = product?.price;
|
|
36
|
+
return (index.h(index.Host, { key: 'e5837d7ec53f2566fe981f02a95b52c7c817821c' }, index.h("button", { key: '415861262349f83c3c7d1dc72d9f8f01f855317e', type: "button", class: "s-order-edit-product-card", onClick: () => this.handleSelectProduct() }, index.h("div", { key: '072d3af840d5044636380f5620703cc446877162', class: "s-order-edit-product-card-media" }, product?.image?.url ? (index.h("img", { src: product.image.url, alt: product.image.alt || productName, class: "s-order-edit-product-card-image" })) : (index.h("div", { class: "s-order-edit-product-card-placeholder" }, index.h("i", { class: "sicon-shopping-bag" })))), index.h("div", { key: 'ac51822bbcf1f2213b11204fa968a40e7de164a3', class: "s-order-edit-product-card-content" }, index.h("h3", { key: 'e817582bf88db2ed6ac47a37a5d2b4e4ac953770', class: "s-order-edit-product-card-title" }, productName), price != null && (index.h("p", { key: 'efbf1b16d7c6d73de76bab1e8715a474f812fde4', class: "s-order-edit-product-card-price", innerHTML: salla.money(price) }))))));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
SallaOrderEditProductCard.style = sallaOrderEditProductCardCss;
|
|
40
|
+
|
|
41
|
+
exports.salla_order_edit_product_card = SallaOrderEditProductCard;
|
|
@@ -3,27 +3,84 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-Ce-Twd7-.js');
|
|
7
|
+
var helpers = require('./helpers-BJ2rnhxz.js');
|
|
8
|
+
require('./interfaces-Bh7W0bEU.js');
|
|
7
9
|
|
|
8
|
-
const sallaOrderEditCss = "";
|
|
10
|
+
const sallaOrderEditCss = ":host{display:block}";
|
|
9
11
|
|
|
10
12
|
const SallaOrderEdit = class {
|
|
11
13
|
constructor(hostRef) {
|
|
12
14
|
index.registerInstance(this, hostRef);
|
|
13
15
|
this.loading = true;
|
|
14
16
|
this.saveLoading = false;
|
|
15
|
-
this.payload = { items: { update: [], remove: [] } };
|
|
17
|
+
this.payload = { items: { update: [], remove: [], add: [] } };
|
|
16
18
|
this.expired = false;
|
|
17
19
|
this.editPreview = null;
|
|
20
|
+
this.productSearchQuery = '';
|
|
21
|
+
this.productsListKey = 0;
|
|
22
|
+
this.productsListSource = 'latest';
|
|
23
|
+
this.productsListSourceValue = '';
|
|
24
|
+
this.selectedProductToAdd = null;
|
|
25
|
+
this.addProductQuantity = 1;
|
|
26
|
+
this.addProductLoading = false;
|
|
27
|
+
this.addProductConfirmLoading = false;
|
|
28
|
+
this.mobileProductsModalMounted = false;
|
|
29
|
+
this.isMobileViewport = false;
|
|
30
|
+
// Plain field (not @State): scroll-loading guard never affects rendering, so avoid re-render churn.
|
|
31
|
+
this.mobileProductsListLoading = false;
|
|
18
32
|
this.confirming = false;
|
|
33
|
+
this.handleMobileProductSelected = (event) => {
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
void this.handleProductSelected(event);
|
|
36
|
+
};
|
|
37
|
+
this.productsPanelMobileQuery = '(max-width: 768px)';
|
|
38
|
+
this.handleProductsPanelViewportChange = (event) => {
|
|
39
|
+
this.isMobileViewport = event.matches;
|
|
40
|
+
};
|
|
41
|
+
this.hasProductTypeFilter = (url) => {
|
|
42
|
+
const queryStart = url.indexOf('?');
|
|
43
|
+
const query = (queryStart >= 0 ? url.slice(queryStart + 1) : url).split('#')[0];
|
|
44
|
+
return Array.from(new URLSearchParams(query)).some(([key, value]) => (value === 'product' &&
|
|
45
|
+
/^filters\[types\](?:\[(?:\d*)\])?$/.test(key)));
|
|
46
|
+
};
|
|
47
|
+
this.normalizeProductsListArrayParams = (url) => {
|
|
48
|
+
return url.replace(/(^|[?&])(includes|source_value|filters(?:\[|%5B)[^&=\]%]+?(?:\]|%5D))(\[|%5B)\d+(\]|%5D)(?==)/gi, (_, sep, name, open, close) => `${sep}${name}${open}${close}`);
|
|
49
|
+
};
|
|
50
|
+
this.handleBeforeBuildListUrl = (ctx) => {
|
|
51
|
+
if (ctx.component?.productCardComponent !== 'salla-order-edit-product-card' ||
|
|
52
|
+
typeof ctx.url !== 'string') {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
ctx.url = this.normalizeProductsListArrayParams(ctx.url);
|
|
56
|
+
if (this.hasProductTypeFilter(ctx.url)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
ctx.url += `${ctx.url.includes('?') ? '&' : '?'}filters[types][]=product`;
|
|
60
|
+
};
|
|
61
|
+
this.defaultProductsListSource = 'latest';
|
|
62
|
+
this.debouncedProductSearch = salla.helpers.debounce((query) => this.applyProductSearch(query), 500);
|
|
19
63
|
}
|
|
20
64
|
async componentWillLoad() {
|
|
65
|
+
this.setupProductsPanelViewportQuery();
|
|
21
66
|
await salla.onReady();
|
|
67
|
+
this.unregisterBeforeBuildListUrlHook = salla.hooks.registerHook('salla-products-list', 'beforeBuildListUrl', this.handleBeforeBuildListUrl);
|
|
22
68
|
this.loadFromProp();
|
|
23
69
|
this.startExpiryCheck();
|
|
24
70
|
}
|
|
25
71
|
disconnectedCallback() {
|
|
26
72
|
clearInterval(this.expiryInterval);
|
|
73
|
+
this.unregisterBeforeBuildListUrlHook?.();
|
|
74
|
+
this.productsPanelViewportQuery?.removeEventListener('change', this.handleProductsPanelViewportChange);
|
|
75
|
+
this.mobileProductsModal?.removeEventListener('orderEditProductSelected', this.handleMobileProductSelected);
|
|
76
|
+
}
|
|
77
|
+
setupProductsPanelViewportQuery() {
|
|
78
|
+
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.productsPanelViewportQuery = window.matchMedia(this.productsPanelMobileQuery);
|
|
82
|
+
this.isMobileViewport = this.productsPanelViewportQuery.matches;
|
|
83
|
+
this.productsPanelViewportQuery.addEventListener('change', this.handleProductsPanelViewportChange);
|
|
27
84
|
}
|
|
28
85
|
startExpiryCheck() {
|
|
29
86
|
const endsAt = this.order?.customer_editing_session?.ends_at;
|
|
@@ -48,7 +105,13 @@ const SallaOrderEdit = class {
|
|
|
48
105
|
return;
|
|
49
106
|
}
|
|
50
107
|
const data = typeof this.orderData === 'string' ? JSON.parse(this.orderData) : this.orderData;
|
|
51
|
-
this.order =
|
|
108
|
+
this.order = {
|
|
109
|
+
...data,
|
|
110
|
+
items: data.items.map(item => ({
|
|
111
|
+
...item,
|
|
112
|
+
selectedOptions: helpers.getOrderItemSelectedOptions(item),
|
|
113
|
+
})),
|
|
114
|
+
};
|
|
52
115
|
}
|
|
53
116
|
catch (e) {
|
|
54
117
|
this.error = salla.lang.getWithDefault('pages.orders.order_not_found', 'الطلب غير موجود');
|
|
@@ -57,22 +120,223 @@ const SallaOrderEdit = class {
|
|
|
57
120
|
this.loading = false;
|
|
58
121
|
}
|
|
59
122
|
}
|
|
60
|
-
|
|
61
|
-
|
|
123
|
+
applyProductSearch(query) {
|
|
124
|
+
const normalizedQuery = query?.trim() || '';
|
|
125
|
+
const nextSource = normalizedQuery ? 'search' : this.defaultProductsListSource;
|
|
126
|
+
const nextSourceValue = nextSource === 'search' ? JSON.stringify(normalizedQuery) : '';
|
|
127
|
+
if (this.productsListSource === nextSource &&
|
|
128
|
+
this.productsListSourceValue === nextSourceValue) {
|
|
62
129
|
return;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
130
|
+
}
|
|
131
|
+
this.productsListSource = nextSource;
|
|
132
|
+
this.productsListSourceValue = nextSourceValue;
|
|
133
|
+
this.productsListKey += 1;
|
|
134
|
+
}
|
|
135
|
+
handleProductSearch(event) {
|
|
136
|
+
const value = event.target?.value || '';
|
|
137
|
+
this.productSearchQuery = value;
|
|
138
|
+
this.debouncedProductSearch(value);
|
|
139
|
+
}
|
|
140
|
+
getProductsListKey(scope) {
|
|
141
|
+
return `${scope}-${this.productsListSource}-${this.productsListSourceValue}-${this.productsListKey}`;
|
|
142
|
+
}
|
|
143
|
+
handleMobileProductsScroll(event) {
|
|
144
|
+
const container = event.currentTarget;
|
|
145
|
+
const distanceToBottom = container.scrollHeight - container.scrollTop - container.clientHeight;
|
|
146
|
+
if (distanceToBottom > 200 || this.mobileProductsListLoading) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const productsList = container.querySelector('salla-products-list');
|
|
150
|
+
if (!productsList) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
this.mobileProductsListLoading = true;
|
|
154
|
+
void productsList.loadMore().finally(() => {
|
|
155
|
+
this.mobileProductsListLoading = false;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
waitForNextFrame() {
|
|
159
|
+
return new Promise(resolve => requestAnimationFrame(() => resolve(undefined)));
|
|
160
|
+
}
|
|
161
|
+
async openMobileProductsModal() {
|
|
162
|
+
if (!this.mobileProductsModalMounted) {
|
|
163
|
+
this.mobileProductsModalMounted = true;
|
|
164
|
+
await this.waitForNextFrame();
|
|
165
|
+
}
|
|
166
|
+
await this.mobileProductsModal?.open?.();
|
|
167
|
+
}
|
|
168
|
+
setMobileProductsModal(modal) {
|
|
169
|
+
if (this.mobileProductsModal === modal) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this.mobileProductsModal?.removeEventListener('orderEditProductSelected', this.handleMobileProductSelected);
|
|
173
|
+
this.mobileProductsModal = modal;
|
|
174
|
+
this.mobileProductsModal?.addEventListener('orderEditProductSelected', this.handleMobileProductSelected);
|
|
175
|
+
}
|
|
176
|
+
resetAddProductDrawer() {
|
|
177
|
+
this.selectedProductToAdd = null;
|
|
178
|
+
this.addProductQuantity = 1;
|
|
179
|
+
this.addProductLoading = false;
|
|
180
|
+
this.addProductConfirmLoading = false;
|
|
181
|
+
this.addProductOptions = null;
|
|
182
|
+
}
|
|
183
|
+
getAddProductMaxQuantity(product = this.selectedProductToAdd) {
|
|
184
|
+
return helpers.getOrderEditProductMaxQuantity(product);
|
|
185
|
+
}
|
|
186
|
+
clampAddProductQuantity(quantity, product = this.selectedProductToAdd) {
|
|
187
|
+
return helpers.clampOrderEditQuantity(quantity, this.getAddProductMaxQuantity(product));
|
|
188
|
+
}
|
|
189
|
+
getApiErrorMessage(error) {
|
|
190
|
+
return error?.response?.data?.error?.message || error?.response?.data?.message;
|
|
191
|
+
}
|
|
192
|
+
notifyApiError(error) {
|
|
193
|
+
const message = this.getApiErrorMessage(error);
|
|
194
|
+
if (message) {
|
|
195
|
+
salla.notify.error(message);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async validateAddProductOptions() {
|
|
199
|
+
if (!this.selectedProductToAdd?.options?.length) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
if (!this.addProductOptions) {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
return ((await this.addProductOptions.validateAndScroll?.()) ??
|
|
206
|
+
(await this.addProductOptions.reportValidity?.()) ??
|
|
207
|
+
false);
|
|
208
|
+
}
|
|
209
|
+
updateLocalOrderItem(itemId, quantity, optionDefinitions, selectedOptions) {
|
|
210
|
+
this.order = {
|
|
211
|
+
...this.order,
|
|
212
|
+
items: helpers.updateOrderItems(this.order.items, itemId, quantity, optionDefinitions, selectedOptions),
|
|
70
213
|
};
|
|
214
|
+
}
|
|
215
|
+
removeLocalOrderItem(itemId) {
|
|
71
216
|
this.order = {
|
|
72
217
|
...this.order,
|
|
73
|
-
items: this.order.items
|
|
218
|
+
items: helpers.removeOrderItems(this.order.items, itemId),
|
|
74
219
|
};
|
|
75
220
|
}
|
|
221
|
+
setPayloadItems(patch) {
|
|
222
|
+
this.payload = {
|
|
223
|
+
...this.payload,
|
|
224
|
+
items: helpers.mergePayloadItems(this.payload.items, patch),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
handleAddProductQuantityChange(event) {
|
|
228
|
+
const detail = event.detail;
|
|
229
|
+
const newQuantity = detail?.quantity ?? parseInt(event.target?.value, 10);
|
|
230
|
+
if (isNaN(newQuantity) || newQuantity < 1) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this.addProductQuantity = this.clampAddProductQuantity(newQuantity);
|
|
234
|
+
}
|
|
235
|
+
async handleProductSelected(event) {
|
|
236
|
+
const product = event.detail?.product;
|
|
237
|
+
if (!product?.id || this.addProductLoading) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
this.addProductLoading = true;
|
|
241
|
+
try {
|
|
242
|
+
this.selectedProductToAdd = helpers.cloneOrderEditProduct(product);
|
|
243
|
+
this.addProductQuantity = 1;
|
|
244
|
+
await this.mobileProductsModal?.close?.();
|
|
245
|
+
await this.waitForNextFrame();
|
|
246
|
+
await this.addProductDrawer?.open?.();
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
this.notifyApiError(error);
|
|
250
|
+
}
|
|
251
|
+
finally {
|
|
252
|
+
this.addProductLoading = false;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async confirmAddProduct() {
|
|
256
|
+
if (!this.selectedProductToAdd?.id) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (this.addProductConfirmLoading) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
this.addProductConfirmLoading = true;
|
|
263
|
+
try {
|
|
264
|
+
const maxQuantity = this.getAddProductMaxQuantity();
|
|
265
|
+
const normalizedQuantity = this.clampAddProductQuantity(this.addProductQuantity);
|
|
266
|
+
if (normalizedQuantity !== this.addProductQuantity) {
|
|
267
|
+
this.addProductQuantity = normalizedQuantity;
|
|
268
|
+
}
|
|
269
|
+
const productOptions = this.addProductOptions;
|
|
270
|
+
const optionsAreValid = await this.validateAddProductOptions();
|
|
271
|
+
if (!optionsAreValid) {
|
|
272
|
+
salla.notify.error(salla.lang.getWithDefault('common.messages.required_fields', 'يرجى تعبئة الحقول المطلوبة'));
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const selectedOptionsPayload = (await productOptions?.getSelectedOptionsData?.()) || {};
|
|
276
|
+
const optionDefinitions = (await productOptions?.getOptionsData?.()) ||
|
|
277
|
+
this.selectedProductToAdd.options ||
|
|
278
|
+
[];
|
|
279
|
+
const existingItem = helpers.findMergeableItem(this.order?.items, this.selectedProductToAdd.id, selectedOptionsPayload);
|
|
280
|
+
if (existingItem) {
|
|
281
|
+
const mergedQuantity = helpers.clampOrderEditQuantity(existingItem.quantity + normalizedQuantity, maxQuantity);
|
|
282
|
+
this.updateLocalOrderItem(existingItem.id, mergedQuantity, optionDefinitions, selectedOptionsPayload);
|
|
283
|
+
if (existingItem.isNew) {
|
|
284
|
+
this.setPayloadItems({
|
|
285
|
+
add: helpers.updateAddedPayloadList(this.payload.items.add, existingItem.id, mergedQuantity, selectedOptionsPayload),
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
this.setPayloadItems({
|
|
290
|
+
update: helpers.upsertPayloadUpdateList(this.payload.items.update, existingItem.id, mergedQuantity, selectedOptionsPayload),
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
await this.addProductDrawer?.close?.();
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const newItem = helpers.createAddedOrderItem(this.selectedProductToAdd, normalizedQuantity, optionDefinitions, selectedOptionsPayload);
|
|
297
|
+
const addEntry = {
|
|
298
|
+
itemId: newItem.id,
|
|
299
|
+
product_id: this.selectedProductToAdd.id,
|
|
300
|
+
quantity: normalizedQuantity,
|
|
301
|
+
options: selectedOptionsPayload,
|
|
302
|
+
};
|
|
303
|
+
this.order = {
|
|
304
|
+
...this.order,
|
|
305
|
+
items: [...this.order.items, newItem],
|
|
306
|
+
};
|
|
307
|
+
this.setPayloadItems({
|
|
308
|
+
add: [...this.payload.items.add, addEntry],
|
|
309
|
+
});
|
|
310
|
+
await this.addProductDrawer?.close?.();
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
this.notifyApiError(error);
|
|
314
|
+
}
|
|
315
|
+
finally {
|
|
316
|
+
this.addProductConfirmLoading = false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
handleItemUpdated(event) {
|
|
320
|
+
if (!this.order)
|
|
321
|
+
return;
|
|
322
|
+
const { itemId, quantity, options, optionDefinitions } = event.detail;
|
|
323
|
+
const currentItem = this.order.items.find(item => item.id === itemId);
|
|
324
|
+
if (!currentItem) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const safeQuantity = helpers.clampOrderEditQuantity(quantity, helpers.getOrderEditProductMaxQuantity(currentItem.product));
|
|
328
|
+
if (currentItem.isNew) {
|
|
329
|
+
this.setPayloadItems({
|
|
330
|
+
add: helpers.updateAddedPayloadList(this.payload.items.add, itemId, safeQuantity, options),
|
|
331
|
+
});
|
|
332
|
+
this.updateLocalOrderItem(itemId, safeQuantity, optionDefinitions, options);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
this.setPayloadItems({
|
|
336
|
+
update: helpers.upsertPayloadUpdateList(this.payload.items.update, itemId, safeQuantity, options ?? {}),
|
|
337
|
+
});
|
|
338
|
+
this.updateLocalOrderItem(itemId, safeQuantity, optionDefinitions, options);
|
|
339
|
+
}
|
|
76
340
|
handleItemRemoved(event) {
|
|
77
341
|
if (!this.order)
|
|
78
342
|
return;
|
|
@@ -81,35 +345,39 @@ const SallaOrderEdit = class {
|
|
|
81
345
|
return;
|
|
82
346
|
}
|
|
83
347
|
const { itemId } = event.detail;
|
|
84
|
-
this.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
348
|
+
const currentItem = this.order.items.find(item => item.id === itemId);
|
|
349
|
+
if (!currentItem) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (currentItem.isNew) {
|
|
353
|
+
this.setPayloadItems({
|
|
354
|
+
add: this.payload.items.add.filter(item => item.itemId !== itemId),
|
|
355
|
+
});
|
|
356
|
+
this.removeLocalOrderItem(itemId);
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
this.setPayloadItems({
|
|
360
|
+
update: this.payload.items.update.filter(u => u.id !== itemId),
|
|
361
|
+
remove: [...this.payload.items.remove, itemId],
|
|
362
|
+
});
|
|
363
|
+
this.removeLocalOrderItem(itemId);
|
|
95
364
|
}
|
|
96
365
|
get hasChanges() {
|
|
97
|
-
return this.payload.items.update.length > 0 ||
|
|
366
|
+
return (this.payload.items.update.length > 0 ||
|
|
367
|
+
this.payload.items.remove.length > 0 ||
|
|
368
|
+
this.payload.items.add.length > 0);
|
|
98
369
|
}
|
|
99
370
|
async saveOrder() {
|
|
100
371
|
if (!this.hasChanges)
|
|
101
372
|
return;
|
|
102
373
|
this.saveLoading = true;
|
|
103
374
|
try {
|
|
104
|
-
const response = await salla.order.api.editOrder(this.orderId, this.payload);
|
|
375
|
+
const response = await salla.order.api.editOrder(this.orderId, helpers.buildSavePayload(this.payload));
|
|
105
376
|
this.editPreview = response?.data?.data || response?.data;
|
|
106
|
-
await this.saveModal?.open();
|
|
377
|
+
await this.saveModal?.open?.();
|
|
107
378
|
}
|
|
108
379
|
catch (error) {
|
|
109
|
-
|
|
110
|
-
if (message) {
|
|
111
|
-
salla.notify.error(message);
|
|
112
|
-
}
|
|
380
|
+
this.notifyApiError(error);
|
|
113
381
|
}
|
|
114
382
|
finally {
|
|
115
383
|
this.saveLoading = false;
|
|
@@ -136,12 +404,44 @@ const SallaOrderEdit = class {
|
|
|
136
404
|
this.navigateToOrder();
|
|
137
405
|
}
|
|
138
406
|
catch (error) {
|
|
139
|
-
|
|
140
|
-
if (message) {
|
|
141
|
-
salla.notify.error(message);
|
|
142
|
-
}
|
|
407
|
+
this.notifyApiError(error);
|
|
143
408
|
}
|
|
144
409
|
}
|
|
410
|
+
renderProductsPanel() {
|
|
411
|
+
const addProductTitle = salla.lang.getWithDefault('pages.orders.add_product_to_order', 'أضف منتج للطلب');
|
|
412
|
+
return (index.h("section", { class: "s-order-edit-products-panel" }, index.h("div", { class: "s-order-edit-products-header" }, index.h("h2", { class: "s-order-edit-products-title" }, addProductTitle)), this.renderProductsPickerContent('panel')));
|
|
413
|
+
}
|
|
414
|
+
renderProductsPickerContent(scope) {
|
|
415
|
+
return (index.h("div", { class: {
|
|
416
|
+
's-order-edit-products-picker': true,
|
|
417
|
+
's-order-edit-products-modal-content': scope === 'modal',
|
|
418
|
+
} }, index.h("label", { class: "s-order-edit-products-search" }, index.h("i", { class: "sicon-search" }), index.h("input", { type: "search", class: "s-order-edit-products-search-input", placeholder: salla.lang.getWithDefault('pages.products.search_for_product', 'ابحث عن منتج'), value: this.productSearchQuery, onInput: event => this.handleProductSearch(event) })), index.h("div", { class: "s-order-edit-products-list", onScroll: scope === 'modal' ? event => this.handleMobileProductsScroll(event) : undefined }, index.h("salla-products-list", { key: this.getProductsListKey(scope), includes: ['options'], source: this.productsListSource, "source-value": this.productsListSourceValue, autoload: true, "product-card-component": "salla-order-edit-product-card" }))));
|
|
419
|
+
}
|
|
420
|
+
renderMobileProductsModal() {
|
|
421
|
+
return (index.h("salla-modal", { ref: modal => this.setMobileProductsModal(modal), width: "md", class: "s-order-edit-mobile-products-modal", "modal-title": salla.lang.getWithDefault('pages.orders.add_product_to_order', 'أضف منتج للطلب'), onModalVisibilityChanged: (e) => {
|
|
422
|
+
if (!e.detail) {
|
|
423
|
+
this.mobileProductsModalMounted = false;
|
|
424
|
+
}
|
|
425
|
+
} }, this.mobileProductsModalMounted ? this.renderProductsPickerContent('modal') : null));
|
|
426
|
+
}
|
|
427
|
+
renderAddProductDrawer() {
|
|
428
|
+
const product = this.selectedProductToAdd;
|
|
429
|
+
const productName = product?.name || salla.lang.getWithDefault('common.elements.product', 'منتج');
|
|
430
|
+
const price = product?.price;
|
|
431
|
+
const maxQuantity = this.getAddProductMaxQuantity(product);
|
|
432
|
+
const optionsInstanceKey = product ? `order-edit-add-${product.id}` : 'order-edit-add';
|
|
433
|
+
const quantityAttrs = {
|
|
434
|
+
value: this.clampAddProductQuantity(this.addProductQuantity, product),
|
|
435
|
+
};
|
|
436
|
+
if (maxQuantity) {
|
|
437
|
+
quantityAttrs.max = maxQuantity;
|
|
438
|
+
}
|
|
439
|
+
return (index.h("salla-modal", { ref: drawer => (this.addProductDrawer = drawer), width: "md", "modal-title": salla.lang.getWithDefault('pages.orders.add_product_to_order', 'أضف منتج للطلب'), onModalVisibilityChanged: (e) => {
|
|
440
|
+
if (!e.detail) {
|
|
441
|
+
this.resetAddProductDrawer();
|
|
442
|
+
}
|
|
443
|
+
} }, index.h("div", { class: "s-order-edit-add-modal" }, this.addProductLoading ? (index.h("div", { class: "s-order-edit-add-modal-loading" }, index.h("salla-loading", null))) : product ? (index.h("div", { class: "s-order-edit-add-modal-content" }, index.h("div", { class: "s-order-edit-add-modal-header" }, index.h("div", { class: "s-order-edit-add-modal-media" }, product.image?.url && (index.h("img", { src: product.image.url, alt: product.image.alt || productName, class: "s-order-edit-add-modal-image" })), index.h("div", { class: "s-order-edit-add-modal-details" }, index.h("h3", { class: "s-order-edit-add-modal-name" }, productName), price != null && (index.h("span", { class: "s-order-edit-add-modal-price", innerHTML: salla.money(price) }))))), index.h("div", { class: "s-order-edit-add-modal-quantity" }, index.h("h3", { class: "s-order-edit-add-modal-section-title" }, salla.lang.getWithDefault('common.elements.quantity', 'الكمية')), index.h("div", { class: "s-order-edit-add-modal-quantity-input" }, index.h("salla-quantity-input", { ...quantityAttrs, onChange: event => this.handleAddProductQuantityChange(event) }))), product.options?.length > 0 && (index.h("form", { onSubmit: e => e.preventDefault() }, index.h("salla-product-options", { ref: el => (this.addProductOptions = el), "product-id": product.id, "unique-key": optionsInstanceKey, options: JSON.stringify(product.options), key: `${optionsInstanceKey}-options` }))), index.h("div", { class: "s-order-edit-add-modal-actions" }, index.h("salla-button", { onClick: () => this.confirmAddProduct(), loading: this.addProductConfirmLoading }, salla.lang.getWithDefault('common.elements.confirm', 'تأكيد')), index.h("salla-button", { color: "gray", fill: "outline", onClick: () => this.addProductDrawer?.close?.() }, salla.lang.getWithDefault('common.elements.cancel', 'الغاء'))))) : null)));
|
|
444
|
+
}
|
|
145
445
|
renderSaveModal() {
|
|
146
446
|
const preview = this.editPreview;
|
|
147
447
|
const hasRemainingAmount = preview?.totals?.remaining_amount?.amount > 0;
|
|
@@ -174,16 +474,15 @@ const SallaOrderEdit = class {
|
|
|
174
474
|
return (index.h(index.Host, null, index.h("div", { class: "s-order-edit-expired" }, index.h("p", null, salla.lang.getWithDefault('pages.orders.edit_session_expired', 'انتهت مدة التعديل المتاحة')), index.h("salla-button", { onClick: () => this.navigateToOrder() }, salla.lang.getWithDefault('pages.orders.back_to_order', 'العودة إلى تفاصيل الطلب')))));
|
|
175
475
|
}
|
|
176
476
|
if (this.error || !this.order) {
|
|
177
|
-
return (index.h(index.Host, null, index.h("div", { class: "no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, this.error))));
|
|
477
|
+
return (index.h(index.Host, null, index.h("div", { class: "s-order-edit-no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, this.error))));
|
|
178
478
|
}
|
|
179
479
|
const hasItems = this.order.items && this.order.items.length > 0;
|
|
180
480
|
const endsAt = this.order.customer_editing_session?.ends_at;
|
|
181
|
-
return (index.h(index.Host, null, endsAt && (index.h("div", { class: "s-order-edit-timer-wrapper" }, index.h("salla-count-down", { prefixText: salla.lang.getWithDefault('pages.orders.edit_within', 'يمكنك التعديل خلال'), date: endsAt, horizontal: true, withButton: true, autoSegments: true, labeled: false, size: "sm", color: "primary" }))), index.h("div", { class: "s-order-edit-items-wrapper" }, index.h("h2", { class: "s-order-edit-items-title" }, salla.lang.getWithDefault('pages.orders.order_products', 'منتجات الطلب')), hasItems ? (this.order.items.map((item, index$1) => [
|
|
481
|
+
return (index.h(index.Host, null, endsAt && (index.h("div", { class: "s-order-edit-timer-wrapper" }, index.h("salla-count-down", { prefixText: salla.lang.getWithDefault('pages.orders.edit_within', 'يمكنك التعديل خلال'), date: endsAt, horizontal: true, withButton: true, autoSegments: true, labeled: false, size: "sm", color: "primary" }))), index.h("div", { class: "s-order-edit-layout" }, !this.isMobileViewport ? this.renderProductsPanel() : null, index.h("section", { class: "s-order-edit-order-panel" }, index.h("div", { class: "s-order-edit-items-wrapper" }, index.h("h2", { class: "s-order-edit-items-title" }, salla.lang.getWithDefault('pages.orders.order_products', 'منتجات الطلب')), hasItems ? (this.order.items.map((item, index$1) => [
|
|
182
482
|
index.h("salla-order-edit-item", { key: item.id, item: item, orderId: this.orderId }),
|
|
183
483
|
index$1 < this.order.items.length - 1 ? (index.h("div", { class: "s-order-edit-items-divider" })) : null,
|
|
184
|
-
])) : (index.h("div", { class: "no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, salla.lang.getWithDefault('common.elements.no_items', 'لا توجد عناصر'))))), index.h("div", { class: "s-order-edit-actions" }, index.h("salla-button", { onClick: () => this.saveOrder(), loading: this.saveLoading, disabled: !this.hasChanges }, salla.lang.getWithDefault('pages.orders.save_changes', 'حفظ التعديلات')), index.h("salla-button", { color: "gray", fill: "outline", onClick: () => this.cancelEditSession() }, salla.lang.getWithDefault('common.elements.cancel', 'الغاء'))), this.renderSaveModal()));
|
|
484
|
+
])) : (index.h("div", { class: "s-order-edit-no-content-placeholder" }, index.h("i", { class: "sicon-shopping-bag icon" }), index.h("p", null, salla.lang.getWithDefault('common.elements.no_items', 'لا توجد عناصر'))))), index.h("div", { class: "s-order-edit-actions" }, index.h("salla-button", { class: "s-order-edit-mobile-products-trigger", color: "gray", size: "small", fill: "outline", onClick: () => this.openMobileProductsModal() }, index.h("i", { class: "sicon-add s-order-edit-mobile-products-trigger-icon" }), salla.lang.getWithDefault('pages.orders.add_product', 'إضافة منتج')), index.h("salla-button", { onClick: () => this.saveOrder(), loading: this.saveLoading, size: "small", disabled: !this.hasChanges }, salla.lang.getWithDefault('pages.orders.save_changes', 'حفظ التعديلات')), index.h("salla-button", { size: "small", color: "gray", fill: "outline", onClick: () => this.cancelEditSession() }, salla.lang.getWithDefault('common.elements.cancel', 'الغاء'))))), this.renderMobileProductsModal(), this.renderAddProductDrawer(), this.renderSaveModal()));
|
|
185
485
|
}
|
|
186
|
-
get host() { return index.getElement(this); }
|
|
187
486
|
};
|
|
188
487
|
SallaOrderEdit.style = sallaOrderEditCss;
|
|
189
488
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-Ce-Twd7-.js');
|
|
7
7
|
var check = require('./check-BnVBPQNp.js');
|
|
8
8
|
|
|
9
9
|
var iconFileArchive = `<!-- Generated by IcoMoon.io -->
|
|
@@ -92,7 +92,7 @@ const SallaOrderSummary = class {
|
|
|
92
92
|
this.copyCodeButtonTimeout && clearTimeout(this.copyCodeButtonTimeout);
|
|
93
93
|
}
|
|
94
94
|
render() {
|
|
95
|
-
return (index.h("ul", { key: '
|
|
95
|
+
return (index.h("ul", { key: '20b8d793a83306a203cd0f7eadededf3ce224181', class: "s-order-summary-wrapper" }, this.noItemFound ? index.h("salla-placeholder", { alignment: "center" }, index.h("span", { slot: "title" })) :
|
|
96
96
|
this.order_items.map((item) => (this.isDigitalCard(item) ? (index.h("li", { key: item.product.id, class: "s-order-summary-item" }, index.h("h2", { class: "s-order-summary-item-title" }, this.codes_text, " (", item.name, ")"), item.codes.map((code) => (index.h("div", { key: code.code, class: "s-order-summary-code-item-wrapper" }, index.h("p", null, index.h("span", { innerHTML: iconCreditCard }), index.h("span", null, code.code)), index.h("salla-button", { class: `s-order-summary-item-copy-button ${this.codeCopied === code.code ? 'copied' : ''}`, onClick: () => this.copyToClipboardHandler(code.code), shape: "link" }, index.h("span", { innerHTML: this.codeCopied === code.code ? check.SICheck : iconCopy }), index.h("span", null, this.copy_text))))))) :
|
|
97
97
|
this.isDigitalProduct(item) ? (index.h("li", { key: item.product.id, class: "s-order-summary-item" }, index.h("h2", { class: "s-order-summary-item-title" }, this.files_text, " (", item.name, ")"), index.h("ul", null, item.files.map((file) => (index.h("li", { class: "s-order-summary-digital-item-wrapper" }, index.h("div", null, index.h("span", { innerHTML: iconFileArchive }), index.h("span", null, file.name)), index.h("a", { href: file.url, target: "_blank", class: "s-order-summary-item-download" }, index.h("span", { innerHTML: iconDownload }), index.h("span", null, this.download_text)))))))) : null))));
|
|
98
98
|
}
|