@salla.sa/twilight-components 2.14.417 → 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-CLDRrF9Y.js → filepond-BiRMqsJc.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BG080TXY.js → filepond-plugin-file-poster-LU25G59n.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-D9x7yIeS.js → filepond-plugin-file-validate-size-J3-riOvN.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CpHYiI2P.js → filepond-plugin-file-validate-type-DMawm6j5.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-B6TFtexK.js → filepond-plugin-image-edit-QXtHYcEz.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C4Ycs5Ji.js → filepond-plugin-image-exif-orientation-C0VBHQjd.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CWlUoPsm.js → filepond-plugin-image-preview-xG9m-vgD.js} +1 -1
- package/dist/cjs/{functions-B0oYwrYv.js → functions-CZrHAX2r.js} +1 -1
- package/dist/cjs/helpers-BJ2rnhxz.js +197 -0
- package/dist/cjs/{index-BQnJvBnq.js → index-Ce-Twd7-.js} +10 -6
- package/dist/cjs/{index-DEDv7FBx.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 +37 -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-BYjrk7x6.js → tracked-promise-DChUtH5B.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DbbhCpKU.js → vanilla-picker-ivACsPLJ.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-bought-together/salla-bought-together.js +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-bought-together.js +1 -0
- 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-B25v0bOp.js → filepond-0Pvy36B6.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-3pI-GrYi.js → filepond-plugin-file-poster-DV7OW1XJ.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BF3zIjLe.js → filepond-plugin-file-validate-size-DEya24r_.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BR91w5t3.js → filepond-plugin-file-validate-type-DiFvVzC6.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DPwgIvr6.js → filepond-plugin-image-edit-DGBw5KRt.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-Ba27xDEr.js → filepond-plugin-image-exif-orientation-BbpZAlI-.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CAEqmh_E.js → filepond-plugin-image-preview-CjRkn0jY.js} +1 -1
- package/dist/esm/{functions-Bk6s9Xp6.js → functions-BcJ4xDKw.js} +1 -1
- package/dist/esm/helpers-DR_vlSvU.js +184 -0
- package/dist/esm/{index-SSgsVJTU.js → index-313k5SuU.js} +1 -1
- package/dist/esm/{index-CN6KGTlN.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 +11 -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-BpxjPYjA.js → tracked-promise-xD-AZOwt.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CoVpA0FA.js → vanilla-picker-Bu8PG2Le.js} +1 -1
- package/dist/twilight/{p-5fe916ee.entry.js → p-02600ee1.entry.js} +1 -1
- package/dist/twilight/{p-f6862c1d.entry.js → p-02608fcd.entry.js} +1 -1
- package/dist/twilight/{p-7d0a6459.entry.js → p-029f9bfd.entry.js} +1 -1
- package/dist/twilight/p-073536c3.entry.js +4 -0
- package/dist/twilight/{p-89e6dc27.entry.js → p-0d4afc4b.entry.js} +1 -1
- package/dist/twilight/{p-529f8c0a.entry.js → p-11da9c5a.entry.js} +1 -1
- package/dist/twilight/{p-5980a88b.entry.js → p-13b1dae0.entry.js} +1 -1
- package/dist/twilight/{p-b94fd507.entry.js → p-13f019f5.entry.js} +1 -1
- package/dist/twilight/{p-65b943d6.entry.js → p-15be9e7a.entry.js} +1 -1
- package/dist/twilight/{p-f6010b04.entry.js → p-1bce06bf.entry.js} +1 -1
- package/dist/twilight/{p-93489e49.entry.js → p-1fe827c7.entry.js} +1 -1
- package/dist/twilight/{p-a3eaba68.entry.js → p-22d12f28.entry.js} +1 -1
- package/dist/twilight/{p-53c44a72.entry.js → p-2afe64d1.entry.js} +1 -1
- package/dist/twilight/{p-269c76e2.entry.js → p-2bb796b3.entry.js} +1 -1
- package/dist/twilight/{p-bbf9d24f.entry.js → p-2f1cb6da.entry.js} +1 -1
- package/dist/twilight/{p-337dc693.entry.js → p-3252277a.entry.js} +1 -1
- package/dist/twilight/{p-fa6c9d88.entry.js → p-3539d2a1.entry.js} +1 -1
- package/dist/twilight/{p-01e5a467.entry.js → p-3bda095b.entry.js} +1 -1
- package/dist/twilight/{p-44147d14.entry.js → p-3d286589.entry.js} +1 -1
- package/dist/twilight/{p-4e02648d.entry.js → p-410f0149.entry.js} +1 -1
- package/dist/twilight/{p-21c9f888.entry.js → p-42bf8cc1.entry.js} +1 -1
- package/dist/twilight/p-43c4c857.entry.js +4 -0
- package/dist/twilight/{p-fd200890.entry.js → p-4550de2d.entry.js} +1 -1
- package/dist/twilight/{p-f6cb5670.entry.js → p-4752dc2c.entry.js} +1 -1
- package/dist/twilight/{p-943a70d5.entry.js → p-48aba4cd.entry.js} +1 -1
- package/dist/twilight/p-49e28ca2.entry.js +4 -0
- package/dist/twilight/{p-3a336511.entry.js → p-4a7cbe49.entry.js} +1 -1
- package/dist/twilight/{p-ce32049d.entry.js → p-51252013.entry.js} +1 -1
- package/dist/twilight/{p-5c2221e4.entry.js → p-53e63007.entry.js} +1 -1
- package/dist/twilight/{p-60bcb05d.entry.js → p-57a4f3d2.entry.js} +1 -1
- package/dist/twilight/{p-50562d51.entry.js → p-5dbb89d5.entry.js} +1 -1
- package/dist/twilight/p-5dd07559.entry.js +4 -0
- package/dist/twilight/{p-5a719b92.entry.js → p-5dd75357.entry.js} +1 -1
- package/dist/twilight/p-5e4e45be.entry.js +4 -0
- package/dist/twilight/{p-93fd1f4c.entry.js → p-5f174a3e.entry.js} +1 -1
- package/dist/twilight/{p-901f4d3c.entry.js → p-625218f7.entry.js} +1 -1
- package/dist/twilight/{p-12a70121.entry.js → p-654a0990.entry.js} +1 -1
- package/dist/twilight/{p-89912723.entry.js → p-654b9857.entry.js} +1 -1
- package/dist/twilight/{p-2a3c8c27.entry.js → p-65ff0bf4.entry.js} +1 -1
- package/dist/twilight/{p-41338b27.entry.js → p-665aa4d1.entry.js} +1 -1
- package/dist/twilight/{p-30847b55.entry.js → p-69bec0e3.entry.js} +1 -1
- package/dist/twilight/{p-4546305a.entry.js → p-6b02b118.entry.js} +1 -1
- package/dist/twilight/{p-a3a24c3a.entry.js → p-72d4121c.entry.js} +1 -1
- package/dist/twilight/{p-9e2f4e04.entry.js → p-74cd506d.entry.js} +1 -1
- package/dist/twilight/{p-ea67e7fb.entry.js → p-75f26291.entry.js} +1 -1
- package/dist/twilight/{p-8cd3e1ee.entry.js → p-7ce1dff1.entry.js} +1 -1
- package/dist/twilight/{p-4f898f9a.entry.js → p-7d08def1.entry.js} +1 -1
- package/dist/twilight/{p-984ad4f5.entry.js → p-7f6c6d8a.entry.js} +1 -1
- package/dist/twilight/{p-f953dac6.entry.js → p-82d776ae.entry.js} +1 -1
- package/dist/twilight/{p-7df3848c.entry.js → p-87e78adc.entry.js} +1 -1
- package/dist/twilight/{p-a0f201dc.entry.js → p-891e4b61.entry.js} +1 -1
- package/dist/twilight/{p-f8971c24.entry.js → p-8bdd9c9b.entry.js} +1 -1
- package/dist/twilight/{p-b21dff70.entry.js → p-8d0b4049.entry.js} +1 -1
- package/dist/twilight/{p-92948a3c.entry.js → p-8dbff2c8.entry.js} +1 -1
- package/dist/twilight/{p-cb7286b0.entry.js → p-944b02ec.entry.js} +1 -1
- package/dist/twilight/{p-a6b86d59.entry.js → p-9693310b.entry.js} +1 -1
- package/dist/twilight/{p-9ef5baee.entry.js → p-9dcc291b.entry.js} +1 -1
- package/dist/twilight/{p-BqUtsKuV.js → p-B6bkY5-l.js} +1 -1
- package/dist/twilight/{p-IfDGKmqz.js → p-BCWPIsso.js} +1 -1
- package/dist/twilight/p-BLehGhpL.js +4 -0
- package/dist/twilight/{p-BI8HHCBk.js → p-BN2EOPT0.js} +2 -2
- package/dist/twilight/{p-D3AXrniM.js → p-BeZ-z3uX.js} +1 -1
- package/dist/twilight/{p-Dhp50bRZ.js → p-Bu7ZSFM5.js} +1 -1
- package/dist/twilight/{p-Dnp_uMrB.js → p-C0UBM1r0.js} +1 -1
- package/dist/twilight/{p-BHMFnn7K.js → p-C1ReTfKT.js} +1 -1
- package/dist/twilight/p-C8xwacGT.js +4 -0
- package/dist/twilight/{p-OFtreEoC.js → p-CX1cQxmm.js} +1 -1
- package/dist/twilight/{p-CN6KGTlN.js → p-CfaNNoM2.js} +1 -1
- package/dist/twilight/p-CoQJOPRz.js +4 -0
- package/dist/twilight/{p-CZ0CFRkg.js → p-P9Uquv6J.js} +1 -1
- package/dist/twilight/p-a132e9dc.entry.js +4 -0
- package/dist/twilight/{p-8867d017.entry.js → p-a22ab12e.entry.js} +1 -1
- package/dist/twilight/{p-3ea047a7.entry.js → p-a5093858.entry.js} +1 -1
- package/dist/twilight/{p-3d7867a2.entry.js → p-a5483eab.entry.js} +1 -1
- package/dist/twilight/{p-50a976c7.entry.js → p-ab922196.entry.js} +1 -1
- package/dist/twilight/{p-5ccc2829.entry.js → p-adf1ff1f.entry.js} +1 -1
- package/dist/twilight/{p-acdba86b.entry.js → p-b075bdd3.entry.js} +1 -1
- package/dist/twilight/{p-d83942f4.entry.js → p-b6446ed0.entry.js} +1 -1
- package/dist/twilight/{p-cba54712.entry.js → p-bd29fa58.entry.js} +1 -1
- package/dist/twilight/{p-38661112.entry.js → p-c0a96a41.entry.js} +1 -1
- package/dist/twilight/{p-2835e988.entry.js → p-c0da03a4.entry.js} +1 -1
- package/dist/twilight/{p-8f879479.entry.js → p-ce4823e8.entry.js} +1 -1
- package/dist/twilight/{p-418574c0.entry.js → p-cef8dfa8.entry.js} +1 -1
- package/dist/twilight/{p-984298b9.entry.js → p-d737a90e.entry.js} +1 -1
- package/dist/twilight/p-d7e404d1.entry.js +4 -0
- package/dist/twilight/{p-078e99bf.entry.js → p-d95fad47.entry.js} +1 -1
- package/dist/twilight/{p-1ac92f5a.entry.js → p-dacc7681.entry.js} +1 -1
- package/dist/twilight/{p-6f620e38.entry.js → p-e15ceaae.entry.js} +1 -1
- package/dist/twilight/p-e692fd88.entry.js +4 -0
- package/dist/twilight/{p-b3ad1668.entry.js → p-ee5afe29.entry.js} +1 -1
- package/dist/twilight/{p-329af334.entry.js → p-f248ce38.entry.js} +1 -1
- package/dist/twilight/{p-7cd6a7c4.entry.js → p-f6468e0f.entry.js} +1 -1
- package/dist/twilight/{p-4bf158ef.entry.js → p-f9e89a30.entry.js} +1 -1
- package/dist/twilight/{p-8f45764d.entry.js → p-fdd2d95e.entry.js} +1 -1
- package/dist/twilight/{p-66aac45f.entry.js → p-ff0d8f2b.entry.js} +1 -1
- package/dist/twilight/{p-CSkvMMJe.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-100664ef.entry.js +0 -4
- package/dist/twilight/p-38856897.entry.js +0 -4
- package/dist/twilight/p-43eca2f5.entry.js +0 -4
- package/dist/twilight/p-6edcfd67.entry.js +0 -4
- package/dist/twilight/p-73f6f7c7.entry.js +0 -4
- package/dist/twilight/p-DyiIcpTE.js +0 -4
- package/dist/twilight/p-a31559f1.entry.js +0 -4
- package/dist/twilight/p-c20a8155.entry.js +0 -4
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { D as DisplayType, d as defineCustomElement$3 } from './salla-product-options2.js';
|
|
5
6
|
import { d as defineCustomElement$c } from './salla-booking-field2.js';
|
|
6
7
|
import { d as defineCustomElement$b } from './salla-button2.js';
|
|
7
8
|
import { d as defineCustomElement$a } from './salla-color-picker2.js';
|
|
@@ -11,11 +12,188 @@ import { d as defineCustomElement$7 } from './salla-file-upload2.js';
|
|
|
11
12
|
import { d as defineCustomElement$6 } from './salla-loading2.js';
|
|
12
13
|
import { d as defineCustomElement$5 } from './salla-map2.js';
|
|
13
14
|
import { d as defineCustomElement$4 } from './salla-modal2.js';
|
|
14
|
-
import { d as defineCustomElement$3 } from './salla-product-options2.js';
|
|
15
15
|
import { d as defineCustomElement$2 } from './salla-progress-bar2.js';
|
|
16
16
|
import { d as defineCustomElement$1 } from './salla-quantity-input2.js';
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
let addedOrderItemCounter = 0;
|
|
19
|
+
function generateAddedOrderItemId(productId) {
|
|
20
|
+
const cryptoRef = (typeof globalThis !== 'undefined' ? globalThis.crypto : undefined);
|
|
21
|
+
if (cryptoRef && typeof cryptoRef.randomUUID === 'function') {
|
|
22
|
+
return `new-${productId}-${cryptoRef.randomUUID()}`;
|
|
23
|
+
}
|
|
24
|
+
addedOrderItemCounter += 1;
|
|
25
|
+
return `new-${productId}-${Date.now()}-${addedOrderItemCounter}`;
|
|
26
|
+
}
|
|
27
|
+
function cloneOrderEditProduct(product) {
|
|
28
|
+
if (product == null) {
|
|
29
|
+
return product;
|
|
30
|
+
}
|
|
31
|
+
return typeof structuredClone === 'function'
|
|
32
|
+
? structuredClone(product)
|
|
33
|
+
: JSON.parse(JSON.stringify(product));
|
|
34
|
+
}
|
|
35
|
+
function buildSavePayload(payload) {
|
|
36
|
+
return {
|
|
37
|
+
items: {
|
|
38
|
+
update: payload.items.update,
|
|
39
|
+
remove: payload.items.remove,
|
|
40
|
+
add: payload.items.add.map(({ itemId, ...addItem }) => addItem),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function createAddedOrderItem(product, quantity, optionDefinitions, selectedOptions = {}) {
|
|
45
|
+
const productData = cloneOrderEditProduct(product);
|
|
46
|
+
return {
|
|
47
|
+
id: generateAddedOrderItemId(product.id),
|
|
48
|
+
quantity,
|
|
49
|
+
isNew: true,
|
|
50
|
+
selectedOptions,
|
|
51
|
+
product: {
|
|
52
|
+
...productData,
|
|
53
|
+
options: cloneOrderEditProduct(optionDefinitions),
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function normalizeOrderEditOptionValue(value) {
|
|
58
|
+
if (typeof File !== 'undefined' && value instanceof File) {
|
|
59
|
+
return value.name;
|
|
60
|
+
}
|
|
61
|
+
return String(value);
|
|
62
|
+
}
|
|
63
|
+
function normalizeSelectedOptions(selectedOptions = {}) {
|
|
64
|
+
return JSON.stringify(Object.entries(selectedOptions)
|
|
65
|
+
.filter(([, value]) => value != null && normalizeOrderEditOptionValue(value).length > 0)
|
|
66
|
+
.map(([optionId, value]) => [String(optionId), normalizeOrderEditOptionValue(value)])
|
|
67
|
+
.sort(([leftId], [rightId]) => leftId.localeCompare(rightId)));
|
|
68
|
+
}
|
|
69
|
+
function hasSelectedOptions(selectedOptions) {
|
|
70
|
+
return Boolean(selectedOptions &&
|
|
71
|
+
Object.values(selectedOptions).some(value => value != null && normalizeOrderEditOptionValue(value).length > 0));
|
|
72
|
+
}
|
|
73
|
+
const detailIdOptionTypes = new Set([
|
|
74
|
+
DisplayType.COLOR,
|
|
75
|
+
DisplayType.COUNTRY,
|
|
76
|
+
DisplayType.DIGITAL_CARD_VALUE,
|
|
77
|
+
DisplayType.MULTIPLE_OPTIONS,
|
|
78
|
+
DisplayType.RADIO,
|
|
79
|
+
DisplayType.SINGLE_OPTION,
|
|
80
|
+
DisplayType.THUMBNAIL,
|
|
81
|
+
]);
|
|
82
|
+
function getProductOptionSelectedOptions(options = []) {
|
|
83
|
+
return options.reduce((acc, option) => {
|
|
84
|
+
if (option?.id == null) {
|
|
85
|
+
return acc;
|
|
86
|
+
}
|
|
87
|
+
const selectedDetails = option.details?.filter(detail => detail?.is_selected) || [];
|
|
88
|
+
const selectedDetail = selectedDetails[selectedDetails.length - 1];
|
|
89
|
+
const value = selectedDetail?.id ?? option.value;
|
|
90
|
+
if (value == null || String(value).length === 0) {
|
|
91
|
+
return acc;
|
|
92
|
+
}
|
|
93
|
+
acc[String(option.id)] = String(value);
|
|
94
|
+
return acc;
|
|
95
|
+
}, {});
|
|
96
|
+
}
|
|
97
|
+
function getOrderDetailSelectedOptionValue(item, optionId, value) {
|
|
98
|
+
const productOption = item?.product?.options?.find(option => String(option.id) === String(optionId));
|
|
99
|
+
const normalizedValue = String(value);
|
|
100
|
+
if (!productOption?.details?.length || !detailIdOptionTypes.has(productOption.type)) {
|
|
101
|
+
return normalizedValue;
|
|
102
|
+
}
|
|
103
|
+
const selectedDetail = productOption.details.find(detail => [
|
|
104
|
+
detail.id,
|
|
105
|
+
detail.name,
|
|
106
|
+
detail.option_value,
|
|
107
|
+
detail.color,
|
|
108
|
+
detail.image,
|
|
109
|
+
detail.code,
|
|
110
|
+
detail.display_value,
|
|
111
|
+
].some(detailValue => detailValue != null && String(detailValue) === normalizedValue));
|
|
112
|
+
return selectedDetail ? String(selectedDetail.id) : normalizedValue;
|
|
113
|
+
}
|
|
114
|
+
function getOrderDetailsSelectedOptions(item) {
|
|
115
|
+
return (item?.options || []).reduce((acc, option) => {
|
|
116
|
+
if (option?.id == null) {
|
|
117
|
+
return acc;
|
|
118
|
+
}
|
|
119
|
+
const value = option.value ?? option.display_value;
|
|
120
|
+
if (value == null || String(value).length === 0) {
|
|
121
|
+
return acc;
|
|
122
|
+
}
|
|
123
|
+
acc[String(option.id)] = getOrderDetailSelectedOptionValue(item, option.id, value);
|
|
124
|
+
return acc;
|
|
125
|
+
}, {});
|
|
126
|
+
}
|
|
127
|
+
function getOrderItemSelectedOptions(item) {
|
|
128
|
+
if (hasSelectedOptions(item?.selectedOptions)) {
|
|
129
|
+
return item.selectedOptions;
|
|
130
|
+
}
|
|
131
|
+
const productSelectedOptions = getProductOptionSelectedOptions(item?.product?.options);
|
|
132
|
+
if (hasSelectedOptions(productSelectedOptions)) {
|
|
133
|
+
return productSelectedOptions;
|
|
134
|
+
}
|
|
135
|
+
return getOrderDetailsSelectedOptions(item);
|
|
136
|
+
}
|
|
137
|
+
function findMergeableItem(items = [], productId, selectedOptions = {}) {
|
|
138
|
+
const targetSelectedOptions = normalizeSelectedOptions(selectedOptions);
|
|
139
|
+
return items.find(item => String(item.product?.id) === String(productId) &&
|
|
140
|
+
normalizeSelectedOptions(getOrderItemSelectedOptions(item)) === targetSelectedOptions);
|
|
141
|
+
}
|
|
142
|
+
function getOrderEditProductMaxQuantity(product) {
|
|
143
|
+
const rawQuantity = product?.max_quantity ?? product?.max_quantity_per_order;
|
|
144
|
+
const parsedQuantity = Number(rawQuantity);
|
|
145
|
+
return Number.isFinite(parsedQuantity) && parsedQuantity > 0 ? parsedQuantity : undefined;
|
|
146
|
+
}
|
|
147
|
+
function clampOrderEditQuantity(quantity, maxQuantity) {
|
|
148
|
+
if (!Number.isFinite(quantity) || quantity < 1) {
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
if (maxQuantity && quantity > maxQuantity) {
|
|
152
|
+
return maxQuantity;
|
|
153
|
+
}
|
|
154
|
+
return quantity;
|
|
155
|
+
}
|
|
156
|
+
function patchOrderItem(item, quantity, optionDefinitions, selectedOptions) {
|
|
157
|
+
return {
|
|
158
|
+
...item,
|
|
159
|
+
quantity,
|
|
160
|
+
selectedOptions: selectedOptions ?? getOrderItemSelectedOptions(item),
|
|
161
|
+
product: item.product
|
|
162
|
+
? {
|
|
163
|
+
...item.product,
|
|
164
|
+
options: optionDefinitions ?? item.product.options,
|
|
165
|
+
}
|
|
166
|
+
: item.product,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function updateOrderItems(items = [], itemId, quantity, optionDefinitions, selectedOptions) {
|
|
170
|
+
return items.map(item => item.id === itemId ? patchOrderItem(item, quantity, optionDefinitions, selectedOptions) : item);
|
|
171
|
+
}
|
|
172
|
+
function removeOrderItems(items = [], itemId) {
|
|
173
|
+
return items.filter(item => item.id !== itemId);
|
|
174
|
+
}
|
|
175
|
+
function mergePayloadItems(items, patch) {
|
|
176
|
+
return {
|
|
177
|
+
...items,
|
|
178
|
+
...patch,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function upsertPayloadUpdateList(updateList = [], itemId, quantity, options = {}) {
|
|
182
|
+
const nextUpdateList = updateList.filter(item => item.id !== itemId);
|
|
183
|
+
nextUpdateList.push({ id: itemId, quantity, options });
|
|
184
|
+
return nextUpdateList;
|
|
185
|
+
}
|
|
186
|
+
function updateAddedPayloadList(addList = [], itemId, quantity, options) {
|
|
187
|
+
return addList.map(item => item.itemId === itemId
|
|
188
|
+
? {
|
|
189
|
+
...item,
|
|
190
|
+
quantity,
|
|
191
|
+
options: options ?? item.options,
|
|
192
|
+
}
|
|
193
|
+
: item);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const sallaOrderEditItemCss = ":host{display:block}";
|
|
19
197
|
|
|
20
198
|
const SallaOrderEditItem = /*@__PURE__*/ proxyCustomElement(class SallaOrderEditItem extends HTMLElement {
|
|
21
199
|
constructor() {
|
|
@@ -23,6 +201,8 @@ const SallaOrderEditItem = /*@__PURE__*/ proxyCustomElement(class SallaOrderEdit
|
|
|
23
201
|
this.__registerHost();
|
|
24
202
|
this.orderItemUpdated = createEvent(this, "orderItemUpdated", 7);
|
|
25
203
|
this.orderItemRemoved = createEvent(this, "orderItemRemoved", 7);
|
|
204
|
+
this.quantityInput = null;
|
|
205
|
+
this.productOptions = null;
|
|
26
206
|
this.handleQuantityChange = (event) => {
|
|
27
207
|
const detail = event.detail;
|
|
28
208
|
const newQuantity = detail?.quantity ?? parseInt(event.target.value, 10);
|
|
@@ -40,38 +220,30 @@ const SallaOrderEditItem = /*@__PURE__*/ proxyCustomElement(class SallaOrderEdit
|
|
|
40
220
|
componentWillLoad() {
|
|
41
221
|
this.quantity = this.item?.quantity || 1;
|
|
42
222
|
}
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (optionsEl) {
|
|
50
|
-
optionsEl.addEventListener('change', this.handleOptionsChange);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
disconnectedCallback() {
|
|
54
|
-
const quantityEl = this.host.querySelector('salla-quantity-input');
|
|
55
|
-
if (quantityEl) {
|
|
56
|
-
quantityEl.removeEventListener('change', this.handleQuantityChange);
|
|
57
|
-
}
|
|
58
|
-
const optionsEl = this.host.querySelector('salla-product-options');
|
|
59
|
-
if (optionsEl) {
|
|
60
|
-
optionsEl.removeEventListener('change', this.handleOptionsChange);
|
|
61
|
-
}
|
|
223
|
+
handleItemChange(newItem) {
|
|
224
|
+
const newQuantity = newItem?.quantity || 1;
|
|
225
|
+
if (newQuantity === this.quantity)
|
|
226
|
+
return;
|
|
227
|
+
this.quantity = newQuantity;
|
|
228
|
+
this.quantityInput?.setValue?.(newQuantity, false);
|
|
62
229
|
}
|
|
63
230
|
get hasOptions() {
|
|
64
|
-
|
|
65
|
-
return options && options.length > 0;
|
|
231
|
+
return (this.item.product?.options?.length || 0) > 0;
|
|
66
232
|
}
|
|
67
233
|
async getSelectedOptions() {
|
|
68
|
-
|
|
69
|
-
|
|
234
|
+
return (await this.productOptions?.getSelectedOptionsData?.()) || {};
|
|
235
|
+
}
|
|
236
|
+
async getOptionsData() {
|
|
237
|
+
return (await this.productOptions?.getOptionsData?.()) || this.item.product?.options || [];
|
|
70
238
|
}
|
|
71
239
|
async emitUpdate(quantity) {
|
|
72
|
-
const
|
|
240
|
+
const itemId = this.item?.id;
|
|
241
|
+
if (itemId == null)
|
|
242
|
+
return;
|
|
243
|
+
const detail = { itemId, quantity };
|
|
73
244
|
if (this.hasOptions) {
|
|
74
245
|
detail.options = await this.getSelectedOptions();
|
|
246
|
+
detail.optionDefinitions = await this.getOptionsData();
|
|
75
247
|
}
|
|
76
248
|
this.orderItemUpdated.emit(detail);
|
|
77
249
|
}
|
|
@@ -90,21 +262,26 @@ const SallaOrderEditItem = /*@__PURE__*/ proxyCustomElement(class SallaOrderEdit
|
|
|
90
262
|
const imageAlt = product?.image?.alt || productName;
|
|
91
263
|
const productUrl = product?.url || '#';
|
|
92
264
|
const price = product?.price;
|
|
93
|
-
const maxQuantity = product
|
|
265
|
+
const maxQuantity = getOrderEditProductMaxQuantity(product);
|
|
94
266
|
const weightLabel = product?.weight_label;
|
|
95
267
|
const options = this.item.product?.options;
|
|
268
|
+
const optionsInstanceKey = `order-edit-item-${this.item.id}-${product?.id}`;
|
|
96
269
|
const quantityAttrs = { value: this.quantity };
|
|
97
270
|
if (maxQuantity) {
|
|
98
271
|
quantityAttrs.max = maxQuantity;
|
|
99
272
|
}
|
|
100
|
-
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: `${
|
|
273
|
+
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", { ref: el => (this.quantityInput = el), ...quantityAttrs, onChange: this.handleQuantityChange }))), this.hasOptions && (h("form", { class: "s-order-edit-item-options", onSubmit: e => e.preventDefault() }, 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` }))))));
|
|
101
274
|
}
|
|
102
|
-
get
|
|
275
|
+
static get watchers() { return {
|
|
276
|
+
"item": ["handleItemChange"]
|
|
277
|
+
}; }
|
|
103
278
|
static get style() { return sallaOrderEditItemCss; }
|
|
104
279
|
}, [0, "salla-order-edit-item", {
|
|
105
280
|
"item": [16],
|
|
106
281
|
"orderId": [8, "order-id"],
|
|
107
282
|
"quantity": [32]
|
|
283
|
+
}, undefined, {
|
|
284
|
+
"item": ["handleItemChange"]
|
|
108
285
|
}]);
|
|
109
286
|
function defineCustomElement() {
|
|
110
287
|
if (typeof customElements === "undefined") {
|
|
@@ -181,4 +358,4 @@ function defineCustomElement() {
|
|
|
181
358
|
}
|
|
182
359
|
defineCustomElement();
|
|
183
360
|
|
|
184
|
-
export { SallaOrderEditItem as S, defineCustomElement as d };
|
|
361
|
+
export { SallaOrderEditItem as S, getOrderEditProductMaxQuantity as a, cloneOrderEditProduct as b, clampOrderEditQuantity as c, defineCustomElement as d, updateAddedPayloadList as e, findMergeableItem as f, getOrderItemSelectedOptions as g, upsertPayloadUpdateList as h, createAddedOrderItem as i, buildSavePayload as j, mergePayloadItems as m, removeOrderItems as r, updateOrderItems as u };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SallaOrderEditProductCard extends Components.SallaOrderEditProductCard, HTMLElement {}
|
|
4
|
+
export const SallaOrderEditProductCard: {
|
|
5
|
+
prototype: SallaOrderEditProductCard;
|
|
6
|
+
new (): SallaOrderEditProductCard;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
|
|
6
|
+
const sallaOrderEditProductCardCss = ":host{display:block;min-width:0}";
|
|
7
|
+
|
|
8
|
+
const SallaOrderEditProductCard$1 = /*@__PURE__*/ proxyCustomElement(class SallaOrderEditProductCard extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.orderEditProductSelected = createEvent(this, "orderEditProductSelected", 7);
|
|
13
|
+
}
|
|
14
|
+
get productData() {
|
|
15
|
+
if (!this.product) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
if (typeof this.product === 'object') {
|
|
19
|
+
return this.product;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(this.product);
|
|
23
|
+
}
|
|
24
|
+
catch (_error) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
handleSelectProduct() {
|
|
29
|
+
this.orderEditProductSelected.emit({ product: this.productData });
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const product = this.productData;
|
|
33
|
+
const productName = product?.name || salla.lang.getWithDefault('common.elements.product', 'منتج');
|
|
34
|
+
const price = product?.price;
|
|
35
|
+
return (h(Host, { key: 'e5837d7ec53f2566fe981f02a95b52c7c817821c' }, h("button", { key: '415861262349f83c3c7d1dc72d9f8f01f855317e', type: "button", class: "s-order-edit-product-card", onClick: () => this.handleSelectProduct() }, h("div", { key: '072d3af840d5044636380f5620703cc446877162', class: "s-order-edit-product-card-media" }, product?.image?.url ? (h("img", { src: product.image.url, alt: product.image.alt || productName, class: "s-order-edit-product-card-image" })) : (h("div", { class: "s-order-edit-product-card-placeholder" }, h("i", { class: "sicon-shopping-bag" })))), h("div", { key: 'ac51822bbcf1f2213b11204fa968a40e7de164a3', class: "s-order-edit-product-card-content" }, h("h3", { key: 'e817582bf88db2ed6ac47a37a5d2b4e4ac953770', class: "s-order-edit-product-card-title" }, productName), price != null && (h("p", { key: 'efbf1b16d7c6d73de76bab1e8715a474f812fde4', class: "s-order-edit-product-card-price", innerHTML: salla.money(price) }))))));
|
|
36
|
+
}
|
|
37
|
+
static get style() { return sallaOrderEditProductCardCss; }
|
|
38
|
+
}, [0, "salla-order-edit-product-card", {
|
|
39
|
+
"product": [1]
|
|
40
|
+
}]);
|
|
41
|
+
function defineCustomElement$1() {
|
|
42
|
+
if (typeof customElements === "undefined") {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const components = ["salla-order-edit-product-card"];
|
|
46
|
+
components.forEach(tagName => { switch (tagName) {
|
|
47
|
+
case "salla-order-edit-product-card":
|
|
48
|
+
if (!customElements.get(tagName)) {
|
|
49
|
+
customElements.define(tagName, SallaOrderEditProductCard$1);
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
} });
|
|
53
|
+
}
|
|
54
|
+
defineCustomElement$1();
|
|
55
|
+
|
|
56
|
+
const SallaOrderEditProductCard = SallaOrderEditProductCard$1;
|
|
57
|
+
const defineCustomElement = defineCustomElement$1;
|
|
58
|
+
|
|
59
|
+
export { SallaOrderEditProductCard, defineCustomElement };
|