@salla.sa/twilight-components 2.14.444 → 2.14.446

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.
Files changed (318) hide show
  1. package/dist/cjs/{filepond-plugin-file-poster-CmQuPQcY.js → filepond-plugin-file-poster-DXUkwq91.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-validate-size-sGTAJHie.js → filepond-plugin-file-validate-size-CmWT-l1o.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-type-DhXaHZZZ.js → filepond-plugin-file-validate-type-CI-SRLe5.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-image-edit-Cj8JCfAN.js → filepond-plugin-image-edit-D0ccVwFm.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-exif-orientation-32JSai7q.js → filepond-plugin-image-exif-orientation-CC7CmDIV.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-preview-BKmavM3U.js → filepond-plugin-image-preview-DOMTJIsr.js} +1 -1
  7. package/dist/cjs/{filepond-Bbj7PmYR.js → filepond-rDr-05NK.js} +1 -1
  8. package/dist/cjs/{functions-lGTNolKl.js → functions-BrD7nRK2.js} +1 -1
  9. package/dist/cjs/{index-BSEEzSJv.js → index-BBFmWakU.js} +1 -1
  10. package/dist/cjs/{index-BjjfvdmF.js → index-DA8jhZqT.js} +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +58 -42
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-gifting.cjs.entry.js +144 -38
  37. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  49. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  50. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit.cjs.entry.js +15 -4
  69. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  83. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  98. package/dist/cjs/{tracked-promise-BLOn0DiZ.js → tracked-promise-vD81wqoM.js} +1 -1
  99. package/dist/cjs/twilight.cjs.js +2 -2
  100. package/dist/cjs/{vanilla-picker-C5CI4VSj.js → vanilla-picker-Dc4-oPc4.js} +1 -1
  101. package/dist/collection/components/salla-bought-together/salla-bought-together.js +1 -1
  102. package/dist/collection/components/salla-gifting/salla-gifting.css +15 -0
  103. package/dist/collection/components/salla-gifting/salla-gifting.js +149 -36
  104. package/dist/collection/components/salla-order-edit/salla-order-edit.js +16 -4
  105. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +97 -41
  106. package/dist/components/index.js +2 -2
  107. package/dist/components/salla-bought-together.js +1 -1
  108. package/dist/components/salla-gifting.js +170 -51
  109. package/dist/components/salla-order-edit.js +16 -4
  110. package/dist/components/salla-searchable-dropdown2.js +59 -41
  111. package/dist/esm/{filepond-BFX6xxhJ.js → filepond-CpYF7JQY.js} +1 -1
  112. package/dist/esm/{filepond-plugin-file-poster-DwMxJsyL.js → filepond-plugin-file-poster-ob6i92P3.js} +1 -1
  113. package/dist/esm/{filepond-plugin-file-validate-size-BFwbB1wr.js → filepond-plugin-file-validate-size-h8AHfyQH.js} +1 -1
  114. package/dist/esm/{filepond-plugin-file-validate-type-9VetG0aO.js → filepond-plugin-file-validate-type-BPLx-hfr.js} +1 -1
  115. package/dist/esm/{filepond-plugin-image-edit-DqIgezI-.js → filepond-plugin-image-edit-B7wPe8-3.js} +1 -1
  116. package/dist/esm/{filepond-plugin-image-exif-orientation-B97i5tWf.js → filepond-plugin-image-exif-orientation-e7W60Y2D.js} +1 -1
  117. package/dist/esm/{filepond-plugin-image-preview-eGkx8PnH.js → filepond-plugin-image-preview-DOov9hTx.js} +1 -1
  118. package/dist/esm/{functions-C1QgrjTx.js → functions-BRfvCQ-R.js} +1 -1
  119. package/dist/esm/{index-CjquqEh1.js → index-DryPCgN9.js} +2 -2
  120. package/dist/esm/{index-BU_MkqNl.js → index-nKWbBz_d.js} +1 -1
  121. package/dist/esm/loader.js +3 -3
  122. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  123. package/dist/esm/salla-accordion_6.entry.js +1 -1
  124. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  125. package/dist/esm/salla-advertisement.entry.js +1 -1
  126. package/dist/esm/salla-alert_2.entry.js +1 -1
  127. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  128. package/dist/esm/salla-apps-icons.entry.js +1 -1
  129. package/dist/esm/salla-badge.entry.js +1 -1
  130. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  131. package/dist/esm/salla-bullet-delivery_2.entry.js +58 -42
  132. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  133. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  134. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  135. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  136. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  137. package/dist/esm/salla-contacts.entry.js +1 -1
  138. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  139. package/dist/esm/salla-count-down.entry.js +1 -1
  140. package/dist/esm/salla-custom-fields.entry.js +1 -1
  141. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  142. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  143. package/dist/esm/salla-filters-widget.entry.js +1 -1
  144. package/dist/esm/salla-filters.entry.js +1 -1
  145. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  146. package/dist/esm/salla-gifting.entry.js +144 -38
  147. package/dist/esm/salla-hook.entry.js +1 -1
  148. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  149. package/dist/esm/salla-installment.entry.js +1 -1
  150. package/dist/esm/salla-list-tile.entry.js +1 -1
  151. package/dist/esm/salla-localization-modal.entry.js +1 -1
  152. package/dist/esm/salla-login-modal.entry.js +1 -1
  153. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  154. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  155. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  156. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  157. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  158. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  159. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  160. package/dist/esm/salla-loyalty.entry.js +1 -1
  161. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  162. package/dist/esm/salla-map.entry.js +1 -1
  163. package/dist/esm/salla-menu.entry.js +1 -1
  164. package/dist/esm/salla-metadata.entry.js +1 -1
  165. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  166. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  167. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  168. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  169. package/dist/esm/salla-notification-item.entry.js +1 -1
  170. package/dist/esm/salla-notifications.entry.js +1 -1
  171. package/dist/esm/salla-offer-modal.entry.js +1 -1
  172. package/dist/esm/salla-offer.entry.js +1 -1
  173. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  174. package/dist/esm/salla-order-details-options.entry.js +1 -1
  175. package/dist/esm/salla-order-details.entry.js +1 -1
  176. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  177. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  178. package/dist/esm/salla-order-edit.entry.js +15 -4
  179. package/dist/esm/salla-order-summary.entry.js +1 -1
  180. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  181. package/dist/esm/salla-orders.entry.js +1 -1
  182. package/dist/esm/salla-payments.entry.js +1 -1
  183. package/dist/esm/salla-placeholder.entry.js +1 -1
  184. package/dist/esm/salla-price-range.entry.js +1 -1
  185. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  186. package/dist/esm/salla-product-card_2.entry.js +1 -1
  187. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  188. package/dist/esm/salla-products-list.entry.js +1 -1
  189. package/dist/esm/salla-progress-bar.entry.js +1 -1
  190. package/dist/esm/salla-quick-order.entry.js +1 -1
  191. package/dist/esm/salla-rating-modal.entry.js +1 -1
  192. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  193. package/dist/esm/salla-scopes.entry.js +1 -1
  194. package/dist/esm/salla-search.entry.js +1 -1
  195. package/dist/esm/salla-skeleton.entry.js +1 -1
  196. package/dist/esm/salla-slider.entry.js +1 -1
  197. package/dist/esm/salla-social-share.entry.js +1 -1
  198. package/dist/esm/salla-social.entry.js +1 -1
  199. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  200. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  201. package/dist/esm/salla-tooltip.entry.js +1 -1
  202. package/dist/esm/salla-trust-badges.entry.js +1 -1
  203. package/dist/esm/salla-user-menu.entry.js +1 -1
  204. package/dist/esm/salla-user-profile.entry.js +1 -1
  205. package/dist/esm/salla-user-settings.entry.js +1 -1
  206. package/dist/esm/salla-verify.entry.js +1 -1
  207. package/dist/esm/salla-wallet.entry.js +1 -1
  208. package/dist/esm/{tracked-promise-CHodYJuF.js → tracked-promise-x7FFO6oF.js} +1 -1
  209. package/dist/esm/twilight.js +3 -3
  210. package/dist/esm/{vanilla-picker-Dz2cnaJm.js → vanilla-picker-WM2eU5Jq.js} +1 -1
  211. package/dist/twilight/{p-7e5bd688.entry.js → p-02281f9b.entry.js} +1 -1
  212. package/dist/twilight/{p-4532ccc9.entry.js → p-02be2d0d.entry.js} +1 -1
  213. package/dist/twilight/{p-4858fee7.entry.js → p-04bf282e.entry.js} +1 -1
  214. package/dist/twilight/{p-bdb97cd6.entry.js → p-06254080.entry.js} +1 -1
  215. package/dist/twilight/{p-86cdc4f0.entry.js → p-0fbc1adc.entry.js} +1 -1
  216. package/dist/twilight/{p-d876814e.entry.js → p-1a8ffb6a.entry.js} +1 -1
  217. package/dist/twilight/{p-ce3c2d87.entry.js → p-25b0ee17.entry.js} +1 -1
  218. package/dist/twilight/{p-44bcc6ef.entry.js → p-27954727.entry.js} +1 -1
  219. package/dist/twilight/{p-113e46ae.entry.js → p-306017cc.entry.js} +1 -1
  220. package/dist/twilight/{p-2ea272a5.entry.js → p-3158d2a9.entry.js} +1 -1
  221. package/dist/twilight/{p-da47b179.entry.js → p-362d1920.entry.js} +1 -1
  222. package/dist/twilight/{p-efca806c.entry.js → p-372ff04c.entry.js} +1 -1
  223. package/dist/twilight/{p-d65cd0ca.entry.js → p-38334780.entry.js} +1 -1
  224. package/dist/twilight/{p-1ce6baf8.entry.js → p-385277f9.entry.js} +1 -1
  225. package/dist/twilight/{p-0bc373c3.entry.js → p-38c40f88.entry.js} +1 -1
  226. package/dist/twilight/{p-30159ed2.entry.js → p-392bac91.entry.js} +1 -1
  227. package/dist/twilight/{p-9aa7503c.entry.js → p-39e59627.entry.js} +1 -1
  228. package/dist/twilight/{p-9dc45831.entry.js → p-3c8531fd.entry.js} +1 -1
  229. package/dist/twilight/{p-f6741e14.entry.js → p-3ea0a5bb.entry.js} +1 -1
  230. package/dist/twilight/{p-e88b5134.entry.js → p-4139872a.entry.js} +1 -1
  231. package/dist/twilight/{p-9c3ff0a1.entry.js → p-41b5d22c.entry.js} +1 -1
  232. package/dist/twilight/{p-556d563d.entry.js → p-426a869c.entry.js} +1 -1
  233. package/dist/twilight/{p-bca4bdc7.entry.js → p-43420d4d.entry.js} +1 -1
  234. package/dist/twilight/{p-c9403f34.entry.js → p-43e5cb00.entry.js} +1 -1
  235. package/dist/twilight/{p-0cc907b6.entry.js → p-46b2f44a.entry.js} +1 -1
  236. package/dist/twilight/{p-89f289b8.entry.js → p-47ac0d89.entry.js} +1 -1
  237. package/dist/twilight/{p-f933dbd9.entry.js → p-4b0747a1.entry.js} +1 -1
  238. package/dist/twilight/{p-928752cf.entry.js → p-4e8a8906.entry.js} +1 -1
  239. package/dist/twilight/{p-22ac20fb.entry.js → p-4eb51d3e.entry.js} +1 -1
  240. package/dist/twilight/{p-dec3e314.entry.js → p-56af742e.entry.js} +1 -1
  241. package/dist/twilight/{p-b07ea02e.entry.js → p-56f5aac9.entry.js} +1 -1
  242. package/dist/twilight/{p-89c54193.entry.js → p-57e63e76.entry.js} +1 -1
  243. package/dist/twilight/{p-386f7262.entry.js → p-5f08f47d.entry.js} +1 -1
  244. package/dist/twilight/{p-9a029ffb.entry.js → p-63dd5a3c.entry.js} +1 -1
  245. package/dist/twilight/{p-7a8e7d0f.entry.js → p-65421b04.entry.js} +1 -1
  246. package/dist/twilight/{p-a85d96e2.entry.js → p-66b9efc0.entry.js} +1 -1
  247. package/dist/twilight/{p-345fade3.entry.js → p-691abee2.entry.js} +1 -1
  248. package/dist/twilight/{p-b1555436.entry.js → p-6b2d84be.entry.js} +1 -1
  249. package/dist/twilight/{p-c02a27a5.entry.js → p-6c25d9f0.entry.js} +1 -1
  250. package/dist/twilight/{p-658af936.entry.js → p-6e33dad3.entry.js} +1 -1
  251. package/dist/twilight/{p-c65eb0ee.entry.js → p-70e5fcb0.entry.js} +1 -1
  252. package/dist/twilight/{p-d5c2fe58.entry.js → p-740ccc8e.entry.js} +1 -1
  253. package/dist/twilight/{p-9586467e.entry.js → p-7447b19b.entry.js} +1 -1
  254. package/dist/twilight/p-752c4d55.entry.js +4 -0
  255. package/dist/twilight/{p-f141b189.entry.js → p-7b91245f.entry.js} +1 -1
  256. package/dist/twilight/{p-b86e2768.entry.js → p-85911960.entry.js} +1 -1
  257. package/dist/twilight/{p-87eaf990.entry.js → p-86e3a8fc.entry.js} +1 -1
  258. package/dist/twilight/{p-4fbe9195.entry.js → p-891d0baa.entry.js} +1 -1
  259. package/dist/twilight/{p-a3b2c406.entry.js → p-96ce2dbc.entry.js} +1 -1
  260. package/dist/twilight/{p-lbla8oyU.js → p-B09zahHa.js} +1 -1
  261. package/dist/twilight/{p-OpqsYFJ7.js → p-CW4u-F7Z.js} +1 -1
  262. package/dist/twilight/{p-BAeNPoQd.js → p-Cqvb5bEk.js} +1 -1
  263. package/dist/twilight/{p-CZmvt3JS.js → p-D0NjtBeS.js} +1 -1
  264. package/dist/twilight/{p-CiZS53-6.js → p-DfQlAXmu.js} +1 -1
  265. package/dist/twilight/{p-XxMmLD82.js → p-DkfNyQIQ.js} +1 -1
  266. package/dist/twilight/{p-DizhqBLB.js → p-DnhZebll.js} +1 -1
  267. package/dist/twilight/{p-CjquqEh1.js → p-DryPCgN9.js} +1 -1
  268. package/dist/twilight/{p-vtSaduZY.js → p-Dv6JHEwK.js} +1 -1
  269. package/dist/twilight/{p-CHlhCr-2.js → p-W3jneIaI.js} +1 -1
  270. package/dist/twilight/{p-4z9238xc.js → p-_2O7LkzU.js} +1 -1
  271. package/dist/twilight/{p-46aecc23.entry.js → p-a09118de.entry.js} +1 -1
  272. package/dist/twilight/{p-28503efc.entry.js → p-a35822f5.entry.js} +1 -1
  273. package/dist/twilight/{p-2aa656f0.entry.js → p-acef8c7b.entry.js} +1 -1
  274. package/dist/twilight/{p-549792e6.entry.js → p-b51a70cc.entry.js} +1 -1
  275. package/dist/twilight/{p-4da7a36e.entry.js → p-b607e474.entry.js} +1 -1
  276. package/dist/twilight/{p-d6b42548.entry.js → p-be360c44.entry.js} +1 -1
  277. package/dist/twilight/p-c1b9517f.entry.js +4 -0
  278. package/dist/twilight/{p-dff8a0d3.entry.js → p-c22a3b11.entry.js} +1 -1
  279. package/dist/twilight/p-c312d0db.entry.js +4 -0
  280. package/dist/twilight/{p-48f717e0.entry.js → p-c81c589b.entry.js} +1 -1
  281. package/dist/twilight/{p-cafc416d.entry.js → p-cc65c26b.entry.js} +1 -1
  282. package/dist/twilight/{p-6e230a2b.entry.js → p-cfa852cf.entry.js} +1 -1
  283. package/dist/twilight/{p-22c4ec76.entry.js → p-d520bdb9.entry.js} +1 -1
  284. package/dist/twilight/{p-7b2f6272.entry.js → p-d6ceeb02.entry.js} +1 -1
  285. package/dist/twilight/{p-96be7ad7.entry.js → p-d72ac224.entry.js} +1 -1
  286. package/dist/twilight/{p-041739c7.entry.js → p-d9adeaf2.entry.js} +1 -1
  287. package/dist/twilight/{p-51e355f4.entry.js → p-da8058f3.entry.js} +1 -1
  288. package/dist/twilight/{p-b8a680fa.entry.js → p-db288463.entry.js} +1 -1
  289. package/dist/twilight/{p-ea7e46e8.entry.js → p-dc0d3911.entry.js} +1 -1
  290. package/dist/twilight/{p-3376ea68.entry.js → p-e00cbb9e.entry.js} +1 -1
  291. package/dist/twilight/{p-2d771a56.entry.js → p-e114505e.entry.js} +1 -1
  292. package/dist/twilight/{p-d6d1a44f.entry.js → p-e1176fed.entry.js} +1 -1
  293. package/dist/twilight/{p-61ae022e.entry.js → p-e20e9fcc.entry.js} +1 -1
  294. package/dist/twilight/{p-656f5c9f.entry.js → p-e290b5c5.entry.js} +1 -1
  295. package/dist/twilight/{p-736037bf.entry.js → p-e450e794.entry.js} +1 -1
  296. package/dist/twilight/{p-c191d2fc.entry.js → p-e5cfb673.entry.js} +1 -1
  297. package/dist/twilight/{p-b8acec24.entry.js → p-e84c62f7.entry.js} +1 -1
  298. package/dist/twilight/{p-432b5dc2.entry.js → p-eb3ef9e4.entry.js} +1 -1
  299. package/dist/twilight/{p-d47b2e4a.entry.js → p-ec145c3d.entry.js} +1 -1
  300. package/dist/twilight/{p-40da7379.entry.js → p-f196f804.entry.js} +1 -1
  301. package/dist/twilight/p-f2563e2b.entry.js +4 -0
  302. package/dist/twilight/{p-271228e8.entry.js → p-f2f152fc.entry.js} +1 -1
  303. package/dist/twilight/{p-98404ee2.entry.js → p-f38b7948.entry.js} +1 -1
  304. package/dist/twilight/{p-0f268a17.entry.js → p-f6d9edd5.entry.js} +1 -1
  305. package/dist/twilight/{p-2c270887.entry.js → p-f7b7ea3d.entry.js} +1 -1
  306. package/dist/twilight/{p-12383fc2.entry.js → p-f974d986.entry.js} +1 -1
  307. package/dist/twilight/{p-4f7a053b.entry.js → p-ffe84d46.entry.js} +1 -1
  308. package/dist/twilight/{p-DcGM6DYo.js → p-k4lInm67.js} +1 -1
  309. package/dist/twilight/twilight.esm.js +1 -1
  310. package/dist/types/components/salla-gifting/salla-gifting.d.ts +23 -4
  311. package/dist/types/components/salla-order-edit/salla-order-edit.d.ts +4 -0
  312. package/dist/types/components/salla-searchable-dropdown/salla-searchable-dropdown.d.ts +8 -0
  313. package/dist/types/components.d.ts +18 -0
  314. package/package.json +5 -5
  315. package/dist/twilight/p-0aa1fc10.entry.js +0 -4
  316. package/dist/twilight/p-2a75ac14.entry.js +0 -4
  317. package/dist/twilight/p-644ab356.entry.js +0 -4
  318. package/dist/twilight/p-f5a99491.entry.js +0 -4
@@ -30,7 +30,17 @@ export class SallaGifting {
30
30
  this.regions = [];
31
31
  this.selectedRegionId = undefined;
32
32
  this.isKSA = false;
33
+ this.selectedCountry = null;
34
+ this.selectedRegion = null;
35
+ this.displayedCities = [];
36
+ this.selectedCity = null;
37
+ this.searchingCities = false;
38
+ this.enableCityAjaxSearch = false;
39
+ this.citySearchQuery = '';
33
40
  this.step2Animated = false;
41
+ this.citySearchTimer = null;
42
+ this.citySearchCounter = 0;
43
+ this.locationRequestCounter = 0;
34
44
  this.showTextArea = false;
35
45
  /// Gift Form Data
36
46
  this.selectedImage = undefined;
@@ -44,6 +54,50 @@ export class SallaGifting {
44
54
  * The form selector to be used to get the form data
45
55
  */
46
56
  this.formSelector = 'form.product-form, form.form--product-options';
57
+ this.handleCitySearch = (query) => {
58
+ this.citySearchQuery = query;
59
+ if (!this.enableCityAjaxSearch)
60
+ return;
61
+ if (this.citySearchTimer)
62
+ clearTimeout(this.citySearchTimer);
63
+ const requestId = ++this.citySearchCounter;
64
+ this.citySearchTimer = setTimeout(async () => {
65
+ this.searchingCities = true;
66
+ try {
67
+ const cities = await this.fetchCities(query);
68
+ if (requestId === this.citySearchCounter) {
69
+ this.displayedCities = cities;
70
+ }
71
+ }
72
+ catch (e) {
73
+ if (requestId === this.citySearchCounter) {
74
+ this.displayedCities = [];
75
+ }
76
+ }
77
+ finally {
78
+ if (requestId === this.citySearchCounter) {
79
+ this.searchingCities = false;
80
+ }
81
+ }
82
+ }, SallaGifting.CITY_SEARCH_DEBOUNCE_MS);
83
+ };
84
+ this.handleCitySelected = (city) => {
85
+ this.selectedCity = city;
86
+ this.receiverCity = String(city.id);
87
+ this.clearError('receiver.city_id');
88
+ };
89
+ this.handleCityDropdownClosed = () => {
90
+ this.citySearchQuery = '';
91
+ if (this.citySearchTimer) {
92
+ clearTimeout(this.citySearchTimer);
93
+ this.citySearchTimer = null;
94
+ }
95
+ ++this.citySearchCounter;
96
+ this.displayedCities = this.gift?.cities ?? [];
97
+ this.searchingCities = false;
98
+ };
99
+ this.handleCountryDropdownClosed = () => { };
100
+ this.handleRegionDropdownClosed = () => { };
47
101
  salla.lang.onLoaded(() => {
48
102
  this.selectImageOrUpload = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
49
103
  this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_for_your_gift');
@@ -317,24 +371,58 @@ export class SallaGifting {
317
371
  this.receiverName = event.target.value;
318
372
  this.clearError('receiver.name');
319
373
  }
320
- handleReceiverCity(event) {
321
- this.receiverCity = event.target.value;
322
- this.clearError('receiver.city_id');
374
+ resetCityState() {
375
+ if (this.citySearchTimer) {
376
+ clearTimeout(this.citySearchTimer);
377
+ this.citySearchTimer = null;
378
+ }
379
+ ++this.citySearchCounter;
380
+ this.gift = { ...this.gift, cities: [] };
381
+ this.displayedCities = [];
382
+ this.receiverCity = undefined;
383
+ this.selectedCity = null;
384
+ this.citySearchQuery = '';
385
+ this.searchingCities = false;
386
+ this.enableCityAjaxSearch = false;
387
+ }
388
+ setInitialCities(cities) {
389
+ this.gift = { ...this.gift, cities };
390
+ this.displayedCities = cities;
391
+ this.enableCityAjaxSearch = cities.length >= SallaGifting.CITY_AJAX_THRESHOLD;
392
+ }
393
+ async fetchCities(query = '') {
394
+ if (!this.selectedCountryId)
395
+ return [];
396
+ if (this.isKSA && !this.selectedRegionId)
397
+ return [];
398
+ const params = [
399
+ 'for_branch=0',
400
+ `country_id=${this.selectedCountryId}`,
401
+ ];
402
+ if (this.isKSA && this.selectedRegionId) {
403
+ params.push(`region_id=${this.selectedRegionId}`);
404
+ }
405
+ if (query?.trim()) {
406
+ params.push(`query=${encodeURIComponent(query.trim())}`);
407
+ }
408
+ const response = await salla.api.request(`shipping/cities?${params.join('&')}`);
409
+ return response?.data ?? [];
323
410
  }
324
- async handleCountryChange(event) {
325
- const countryId = Number(event.target.value);
411
+ async handleCountrySelected(country) {
412
+ const countryId = country?.id;
413
+ this.selectedCountry = country ?? null;
326
414
  this.selectedCountryId = countryId;
415
+ this.selectedCountryCode = country?.country_code;
416
+ this.isKSA = country?.country_code === 'SA';
327
417
  this.clearError('receiver.country');
328
- // Find the selected country and store its country_code
329
- const selectedCountry = this.gift?.countries?.find(country => country.id == countryId);
330
- this.selectedCountryCode = selectedCountry?.country_code;
331
- this.isKSA = selectedCountry?.country_code === 'SA';
332
- // Reset region and city
418
+ // Reset region and city; bump request counter so in-flight loads from a
419
+ // previous country/region selection get discarded when they resolve.
333
420
  this.regions = [];
334
421
  this.selectedRegionId = undefined;
335
- this.gift = { ...this.gift, cities: [] };
336
- this.receiverCity = undefined;
337
- if (!countryId || this.gift?.countries?.length === 0) {
422
+ this.selectedRegion = null;
423
+ this.resetCityState();
424
+ const requestId = ++this.locationRequestCounter;
425
+ if (!countryId) {
338
426
  this.selectedCountryCode = undefined;
339
427
  this.isKSA = false;
340
428
  this.setWrapperHeight(2, 0, 0);
@@ -346,16 +434,22 @@ export class SallaGifting {
346
434
  this.setWrapperHeight(2, 0, 0);
347
435
  try {
348
436
  const response = await salla.api.request(`shipping/countries/${countryId}/regions`);
437
+ if (requestId !== this.locationRequestCounter)
438
+ return;
349
439
  if (response && response.data) {
350
440
  this.regions = response.data;
351
441
  }
352
442
  }
353
443
  catch (error) {
444
+ if (requestId !== this.locationRequestCounter)
445
+ return;
354
446
  console.error('Error fetching regions:', error);
355
447
  }
356
448
  finally {
357
- this.loadingRegions = false;
358
- this.setWrapperHeight(2, 0, 0);
449
+ if (requestId === this.locationRequestCounter) {
450
+ this.loadingRegions = false;
451
+ this.setWrapperHeight(2, 0, 0);
452
+ }
359
453
  }
360
454
  }
361
455
  else {
@@ -363,41 +457,51 @@ export class SallaGifting {
363
457
  this.loadingCities = true;
364
458
  this.setWrapperHeight(2, 0, 0);
365
459
  try {
366
- const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${countryId}`);
367
- if (response && response.data) {
368
- this.gift = { ...this.gift, cities: response.data };
369
- }
460
+ const cities = await this.fetchCities();
461
+ if (requestId !== this.locationRequestCounter)
462
+ return;
463
+ this.setInitialCities(cities);
370
464
  }
371
465
  catch (error) {
466
+ if (requestId !== this.locationRequestCounter)
467
+ return;
372
468
  console.error('Error fetching cities:', error);
373
469
  }
374
470
  finally {
375
- this.loadingCities = false;
471
+ if (requestId === this.locationRequestCounter) {
472
+ this.loadingCities = false;
473
+ }
376
474
  }
377
475
  }
378
476
  }
379
- async handleRegionChange(event) {
380
- const regionId = Number(event.target.value);
477
+ async handleRegionSelected(region) {
478
+ const regionId = region?.id;
479
+ this.selectedRegion = region ?? null;
381
480
  this.selectedRegionId = regionId;
382
481
  this.clearError('receiver.region');
383
- // Reset city when region changes
384
- this.gift = { ...this.gift, cities: [] };
385
- this.receiverCity = undefined;
482
+ // Reset city when region changes; bump request counter so any earlier
483
+ // in-flight city fetch (for a previous region) is discarded on resolve.
484
+ this.resetCityState();
485
+ const requestId = ++this.locationRequestCounter;
386
486
  if (!regionId)
387
487
  return;
388
488
  this.loadingCities = true;
389
489
  try {
390
- const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${this.selectedCountryId}&region_id=${regionId}`);
391
- if (response && response.data) {
392
- this.gift = { ...this.gift, cities: response.data };
393
- }
490
+ const cities = await this.fetchCities();
491
+ if (requestId !== this.locationRequestCounter)
492
+ return;
493
+ this.setInitialCities(cities);
394
494
  }
395
495
  catch (error) {
496
+ if (requestId !== this.locationRequestCounter)
497
+ return;
396
498
  console.error('Error fetching cities:', error);
397
499
  }
398
500
  finally {
399
- this.loadingCities = false;
400
- this.setWrapperHeight(2, 0, 0);
501
+ if (requestId === this.locationRequestCounter) {
502
+ this.loadingCities = false;
503
+ this.setWrapperHeight(2, 0, 0);
504
+ }
401
505
  }
402
506
  }
403
507
  handleUploadImage(img) {
@@ -542,7 +646,7 @@ export class SallaGifting {
542
646
  }
543
647
  render() {
544
648
  return [
545
- h("div", { key: '2bc4ff1b223c9b1f2e50e36c7f6e6f0448f5a51d' }, h("salla-list-tile", { key: 'b5cf74b6d00c292a1c654c695d316a0a34e70c30', class: this.generateClass() }, h("div", { key: '2e229e46039a9bbf071bc65534733c9da61545f8', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: 'b067244c213dd0c3c64f795f07b4c27f57c661f5' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'a8804b65526bfde36bbb82302d667bc10052ff4b', slot: "subtitle" }, h("div", { key: 'cf2ca350ab3884baa192ce1c043719eb8f9a0120' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: 'f68182d4324c4b56893b63e046e4298c519e449e', slot: "action" }, h("salla-button", { key: '6cf71ec0311dfe7804f4634ae1203e0ae65150be', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: '9b00d0c0c7a594e7e9635a79a6b4a472da73ebe3', name: "widget-btn-content" }, h("div", { key: 'a73ed9d6322c4484180f68e7c8fb7a3b4e5bdb8a', class: "s-gifting-widget-action-content" }, h("span", { key: '0ce7ec753ab1ec30269127a8426a36d55d983a6e', innerHTML: GiftSharing }), " \u00A0", h("span", { key: 'ae35a5669a30e7abb61e5d540224c2be5baae82a' }, this.sectionBtnText)))))), h("salla-modal", { key: 'dee19984ecc71f6e10c330121361359d00408448', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: '10eee2481652b157c44b16d34097ffcce9325d81', slot: "loading" }, h("div", { key: '325446006a0bf5d6d480c8935912fe976ccd453d', class: "s-gifting-skeleton" }, h("div", { key: 'f256cc302b946906262450f0bb023912d034aa13', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: '75bf0e81841a4c41e4105f19bd3e4fbf67ece325', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: '64661720e2f94f6d8b86087d3a03538a1a419202', class: "s-gifting-modal-title" }, h("div", { key: 'd5000d6903f5a7b61beb6a0a88291953e1344ba3', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: '07efd33b877468df617bab4cd2f1b73e73f2d284', height: '15px', width: '150px' })))), h("div", { key: '6fb9d9abf7e211a6ecc45ee50283d37d1755b220', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: 'ed76848f4c017334dea4f12c07ec6556646c397f', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'cfe3e107536dac9e5b1524770eb6990ab3b6460b', height: '230px' }), h("salla-skeleton", { key: 'a35af25d98f5758bf442759841536fed09f6cdd2', height: '10px', width: '150px' }), h("salla-skeleton", { key: '6950704fb24a07807542723f2752b6a734090d42', height: '30px' }), h("salla-skeleton", { key: 'bd65f98a07ee8d041434b9b475ce4c355318f586', height: '40px' })))), h("slot", { key: 'e946b5c7a4146d0118d321d860d332d17c3f931e', name: "header" }), !!this.hasError ?
649
+ h("div", { key: 'db700f9ec96a6974f3b815bb017ebe97ae8fe5c0' }, h("salla-list-tile", { key: '1e2fd1c0b375c85fcd4af1ea071c36879e6913c5', class: this.generateClass() }, h("div", { key: 'a9d02c933bc13bf8765e7e91ce08b2c9495954e5', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: '56bd850368806c6ed5770ea5f6b0339749a77dfa' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'fbb4940fd3e3578f2f5a479d9d44be8dfbda7e43', slot: "subtitle" }, h("div", { key: 'fb7e8532984fbfc6fd61c55a6d44d7cdbb4bc9a2' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '04f27f1ddbfa0b06be111b6c3176fbda5ea6d43a', slot: "action" }, h("salla-button", { key: 'fe71a1a773e5275ede7d1b3ea535c330688028b7', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: 'd62127d30254df2d8add55e0e1dbcfefb686e359', name: "widget-btn-content" }, h("div", { key: '5ddbb695af142baf3bb6986627f97a7a7607eb31', class: "s-gifting-widget-action-content" }, h("span", { key: '7820fb6abd9d7a9c1035c0f80191a3ff2a4c5fe8', innerHTML: GiftSharing }), " \u00A0", h("span", { key: '2cfc69862d3d087375efaed3bcec0ff0c1587989' }, this.sectionBtnText)))))), h("salla-modal", { key: '32c19391248ba6186f43fea59493171079e7bf07', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: 'e4b5829416314f25793158dae0c530b8057b4085', slot: "loading" }, h("div", { key: '6ee873add5868f105b7ec7291c2a8c8fc033c588', class: "s-gifting-skeleton" }, h("div", { key: '40aae38f8b2d62b434394811a3ef6d8bc00f6f32', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'a652cd74a16d0db662ea4a518ebfab366a3c3899', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: 'edb4a1477893246e98207aeba7bfb5af686f20b9', class: "s-gifting-modal-title" }, h("div", { key: '83ef942b15450cc59ad32d8c5b3ba43a32bcb29c', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: 'd9041c777a2fa0aa7ffc752958c7441916a02f85', height: '15px', width: '150px' })))), h("div", { key: 'fe3bb9dad01becba87486c4886037fd67b059919', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '08bd8304b66264b70f6df68e64da3560a1f75461', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'bbea0d7ff0c846897af2ef5d3696b252a2f4e662', height: '230px' }), h("salla-skeleton", { key: '8cb1fde02e31a1accabd2e26409983e7ba56eeb1', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'f80a986b953278bac41505506adf8d611566a167', height: '30px' }), h("salla-skeleton", { key: 'f7eccce69b619de385872642e1fb62b2cf6c3082', height: '40px' })))), h("slot", { key: 'd299e46040193b441f8171d05e0048849e3df8d5', name: "header" }), !!this.hasError ?
546
650
  h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
547
651
  :
548
652
  [
@@ -555,14 +659,14 @@ export class SallaGifting {
555
659
  h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
556
660
  h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.mobile'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
557
661
  h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.isPhysical() &&
558
- h("div", { class: this.step2ItemClass(this.errors?.['receiver.country'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCountryFieldLabel), h("select", { name: "country", class: "s-form-control", onChange: (event) => this.handleCountryChange(event), required: true }, h("option", { value: "" }, this.selectCountry), this.gift?.countries?.map((country) => (h("option", { value: country.id }, country.name)))), this.errors && this.errors['receiver.country'] ?
662
+ h("div", { class: this.step2ItemClass(this.errors?.['receiver.country'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label", htmlFor: `${this.hostId}-country` }, this.receiverCountryFieldLabel), h("salla-searchable-dropdown", { placeholder: this.selectCountry, items: this.gift?.countries ?? [], selectedItem: this.selectedCountry, disabled: !this.gift?.countries?.length, required: true, inputId: `${this.hostId}-country`, searchable: false, keepParentScroll: true, onItemSelected: (e) => this.handleCountrySelected(e.detail), onDropdownClosed: () => this.handleCountryDropdownClosed() }), this.errors && this.errors['receiver.country'] ?
559
663
  h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''), this.isPhysical() && this.isKSA &&
560
- h("div", { class: this.step2ItemClass(this.errors?.['receiver.region'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverRegionFieldLabel), h("select", { name: "region", class: "s-form-control", onChange: (event) => this.handleRegionChange(event), disabled: this.loadingRegions }, h("option", { value: "", selected: true }, this.loadingRegions ? salla.lang.get('common.elements.loading') : this.selectRegion), this.regions?.map((region) => (h("option", { value: region.id }, region.name)))), this.errors && this.errors['receiver.region'] ?
664
+ h("div", { class: this.step2ItemClass(this.errors?.['receiver.region'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label", htmlFor: `${this.hostId}-region` }, this.receiverRegionFieldLabel), h("salla-searchable-dropdown", { placeholder: this.selectRegion, items: this.regions ?? [], selectedItem: this.selectedRegion, loading: this.loadingRegions, disabled: this.loadingRegions || !this.regions?.length, required: true, inputId: `${this.hostId}-region`, searchable: false, keepParentScroll: true, onItemSelected: (e) => this.handleRegionSelected(e.detail), onDropdownClosed: () => this.handleRegionDropdownClosed() }), this.errors && this.errors['receiver.region'] ?
561
665
  h("span", { class: "s-gifting-error" }, this.errors['receiver.region']) : ''), this.isPhysical() &&
562
- h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCityFieldLabel), h("select", { name: "city", "aria-label": salla.lang.get('blocks.buy_as_gift.select_city'), class: "s-form-control", onChange: (event) => this.handleReceiverCity(event), disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId) }, h("option", { value: "", selected: true }, this.loadingCities ? salla.lang.get('common.elements.loading') : this.selectCity), this.gift?.cities?.map((city) => (h("option", { value: city.id }, city.name)))), this.errors && this.errors['receiver.city_id'] ?
666
+ h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label", htmlFor: `${this.hostId}-city` }, this.receiverCityFieldLabel), h("salla-searchable-dropdown", { placeholder: this.selectCity, items: this.displayedCities, selectedItem: this.selectedCity, loading: this.loadingCities, searching: this.searchingCities, disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId), required: true, inputId: `${this.hostId}-city`, searchQuery: this.citySearchQuery, clientSearch: !this.enableCityAjaxSearch, dropUp: true, keepParentScroll: true, onItemSelected: (e) => this.handleCitySelected(e.detail), onSearchInput: (e) => this.handleCitySearch(e.detail), onDropdownClosed: () => this.handleCityDropdownClosed() }), this.errors && this.errors['receiver.city_id'] ?
563
667
  h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), this.isPhysical() &&
564
668
  h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.isPhysical() && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
565
- ], h("slot", { key: '579cbbcc59818051def887c38e4d0eed6e690737', name: "footer" })))
669
+ ], h("slot", { key: 'bd8cd1628ed4282b177f0ddcd5fb93289c47b4d6', name: "footer" })))
566
670
  ];
567
671
  }
568
672
  static get is() { return "salla-gifting"; }
@@ -760,6 +864,13 @@ export class SallaGifting {
760
864
  "regions": {},
761
865
  "selectedRegionId": {},
762
866
  "isKSA": {},
867
+ "selectedCountry": {},
868
+ "selectedRegion": {},
869
+ "displayedCities": {},
870
+ "selectedCity": {},
871
+ "searchingCities": {},
872
+ "enableCityAjaxSearch": {},
873
+ "citySearchQuery": {},
763
874
  "parsedFormData": {},
764
875
  "showTextArea": {},
765
876
  "selectedImage": {},
@@ -839,3 +950,5 @@ export class SallaGifting {
839
950
  };
840
951
  }
841
952
  }
953
+ SallaGifting.CITY_AJAX_THRESHOLD = 400;
954
+ SallaGifting.CITY_SEARCH_DEBOUNCE_MS = 100;
@@ -25,6 +25,7 @@ export class SallaOrderEdit {
25
25
  this.addProductConfirmLoading = false;
26
26
  this.mobileProductsModalMounted = false;
27
27
  this.isMobileViewport = false;
28
+ this.isRTL = true;
28
29
  // Plain field (not @State): scroll-loading guard never affects rendering, so avoid re-render churn.
29
30
  this.mobileProductsListLoading = false;
30
31
  this.confirming = false;
@@ -67,6 +68,9 @@ export class SallaOrderEdit {
67
68
  };
68
69
  this.defaultProductsListSource = 'latest';
69
70
  this.debouncedProductSearch = salla.helpers.debounce((query) => this.applyProductSearch(query), 500);
71
+ salla.onReady(() => {
72
+ this.isRTL = salla.config.get('theme.is_rtl', true);
73
+ });
70
74
  }
71
75
  getParsedExcludedCategories() {
72
76
  if (!this.excludedCategories) {
@@ -420,6 +424,13 @@ export class SallaOrderEdit {
420
424
  this.navigateToOrder();
421
425
  }
422
426
  }
427
+ returnToOrderDetails() {
428
+ this.confirming = true;
429
+ this.navigateToOrder();
430
+ }
431
+ getConfirmButtonIconClass() {
432
+ return this.isRTL ? 'sicon-keyboard_arrow_left' : 'sicon-keyboard_arrow_right';
433
+ }
423
434
  async cancelEditSession() {
424
435
  try {
425
436
  await salla.order.api.cancelEditSession(this.orderId);
@@ -469,7 +480,7 @@ export class SallaOrderEdit {
469
480
  const hasRemainingAmount = preview?.totals?.remaining_amount?.amount > 0;
470
481
  const hasRefundAmount = preview?.totals?.refund_amount?.amount > 0;
471
482
  const taxAmount = preview?.totals?.tax?.amount?.amount;
472
- return (h("salla-modal", { ref: modal => (this.saveModal = modal), width: "md", onModalVisibilityChanged: async (e) => {
483
+ return (h("salla-modal", { ref: modal => (this.saveModal = modal), width: "md", isClosable: false, onModalVisibilityChanged: async (e) => {
473
484
  if (!e.detail) {
474
485
  this.editPreview = null;
475
486
  if (!this.confirming) {
@@ -477,7 +488,7 @@ export class SallaOrderEdit {
477
488
  }
478
489
  this.confirming = false;
479
490
  }
480
- } }, h("div", { class: "s-order-edit-modal" }, h("h2", { class: "s-order-edit-modal-title" }, salla.lang.getWithDefault('pages.orders.edit_summary_title', 'ملخص الطلب بعد التعديل')), preview?.items?.length > 0 && (h("div", { class: "s-order-edit-modal-items" }, preview.items.map(item => {
491
+ } }, h("div", { class: "s-order-edit-modal" }, h("h2", { class: "s-order-edit-modal-title" }, salla.lang.getWithDefault('pages.orders.edit_summary_title', 'ملخص الطلب بعد التعديل')), h("p", { class: "s-order-edit-modal-subtitle" }, salla.lang.getWithDefault('pages.orders.cart_edits_saved', 'Your cart edits have been saved')), preview?.items?.length > 0 && (h("div", { class: "s-order-edit-modal-items" }, preview.items.map(item => {
481
492
  const orderItem = this.order?.items?.find(oi => oi.id == item.id);
482
493
  const imageUrl = orderItem?.product?.image?.url;
483
494
  const optionsLabel = item.options?.join('/ ');
@@ -486,7 +497,7 @@ export class SallaOrderEdit {
486
497
  ? salla.lang.getWithDefault('pages.orders.pay_difference', 'دفع فارق المبلغ')
487
498
  : hasRefundAmount
488
499
  ? salla.lang.getWithDefault('pages.orders.confirm_and_receive_difference', 'تأكيد واستلام فارق المبلغ')
489
- : salla.lang.getWithDefault('pages.orders.confirm_changes', 'تأكيد التعديلات'), h("i", { class: "sicon-keyboard_arrow_left s-order-edit-modal-btn-icon" }))))));
500
+ : salla.lang.getWithDefault('pages.orders.confirm_changes', 'تأكيد التعديلات'), h("i", { class: `${this.getConfirmButtonIconClass()} s-order-edit-modal-btn-icon` })), h("salla-button", { color: 'gray', fill: "outline", onClick: () => this.returnToOrderDetails() }, salla.lang.getWithDefault('pages.orders.back_to_order_details', 'العودة إلى تفاصيل الطلب'))))));
490
501
  }
491
502
  render() {
492
503
  if (this.loading) {
@@ -595,7 +606,8 @@ export class SallaOrderEdit {
595
606
  "addProductLoading": {},
596
607
  "addProductConfirmLoading": {},
597
608
  "mobileProductsModalMounted": {},
598
- "isMobileViewport": {}
609
+ "isMobileViewport": {},
610
+ "isRTL": {}
599
611
  };
600
612
  }
601
613
  static get listeners() {
@@ -16,6 +16,13 @@ export class SallaSearchableDropdown {
16
16
  this.searchQuery = '';
17
17
  this.clientSearch = false;
18
18
  this.dropUp = false;
19
+ this.searchable = true;
20
+ /**
21
+ * When true, the dropdown will NOT override the nearest scrollable ancestor's
22
+ * `overflow` to `visible` while open. Use this when the host (e.g. a modal
23
+ * body) needs to keep its own scrolling intact while the dropdown is open.
24
+ */
25
+ this.keepParentScroll = false;
19
26
  this.isOpen = false;
20
27
  this.focusedIndex = -1;
21
28
  this.clientSearchQuery = '';
@@ -29,14 +36,18 @@ export class SallaSearchableDropdown {
29
36
  }
30
37
  };
31
38
  this.handleTriggerKeyDown = (e) => {
32
- if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {
33
- e.preventDefault();
34
- if (!this.isOpen)
39
+ if (!this.isOpen) {
40
+ if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {
41
+ e.preventDefault();
35
42
  this.open();
43
+ }
44
+ else if (e.key === 'Escape') {
45
+ this.close();
46
+ }
47
+ return;
36
48
  }
37
- else if (e.key === 'Escape') {
38
- this.close();
39
- }
49
+ // When open without a search input, the trigger keeps focus and drives item navigation.
50
+ this.navigateItems(e);
40
51
  };
41
52
  this.handleSearchInputChange = (e) => {
42
53
  const value = e.target.value;
@@ -47,34 +58,7 @@ export class SallaSearchableDropdown {
47
58
  this.focusedIndex = -1;
48
59
  };
49
60
  this.handleSearchKeyDown = (e) => {
50
- const visibleItems = this.filteredItems;
51
- const itemCount = visibleItems.length;
52
- switch (e.key) {
53
- case 'ArrowDown':
54
- e.preventDefault();
55
- this.focusedIndex = itemCount > 0
56
- ? (this.focusedIndex + 1) % itemCount
57
- : -1;
58
- this.scrollFocusedIntoView();
59
- break;
60
- case 'ArrowUp':
61
- e.preventDefault();
62
- this.focusedIndex = itemCount > 0
63
- ? (this.focusedIndex - 1 + itemCount) % itemCount
64
- : -1;
65
- this.scrollFocusedIntoView();
66
- break;
67
- case 'Enter':
68
- e.preventDefault();
69
- if (this.focusedIndex >= 0 && this.focusedIndex < itemCount) {
70
- this.selectItem(visibleItems[this.focusedIndex]);
71
- }
72
- break;
73
- case 'Escape':
74
- e.preventDefault();
75
- this.close();
76
- break;
77
- }
61
+ this.navigateItems(e);
78
62
  };
79
63
  }
80
64
  connectedCallback() {
@@ -137,9 +121,11 @@ export class SallaSearchableDropdown {
137
121
  return;
138
122
  this.isOpen = true;
139
123
  this.focusedIndex = -1;
140
- this.scrollableAncestor = this.findScrollableAncestor();
141
- if (this.scrollableAncestor) {
142
- this.scrollableAncestor.style.overflow = 'visible';
124
+ if (!this.keepParentScroll) {
125
+ this.scrollableAncestor = this.findScrollableAncestor();
126
+ if (this.scrollableAncestor) {
127
+ this.scrollableAncestor.style.overflow = 'visible';
128
+ }
143
129
  }
144
130
  this.dropdownOpened.emit();
145
131
  requestAnimationFrame(() => this.searchInputRef?.focus());
@@ -156,6 +142,36 @@ export class SallaSearchableDropdown {
156
142
  }
157
143
  this.dropdownClosed.emit();
158
144
  }
145
+ navigateItems(e) {
146
+ const visibleItems = this.filteredItems;
147
+ const itemCount = visibleItems.length;
148
+ switch (e.key) {
149
+ case 'ArrowDown':
150
+ e.preventDefault();
151
+ this.focusedIndex = itemCount > 0
152
+ ? (this.focusedIndex + 1) % itemCount
153
+ : -1;
154
+ this.scrollFocusedIntoView();
155
+ break;
156
+ case 'ArrowUp':
157
+ e.preventDefault();
158
+ this.focusedIndex = itemCount > 0
159
+ ? (this.focusedIndex - 1 + itemCount) % itemCount
160
+ : -1;
161
+ this.scrollFocusedIntoView();
162
+ break;
163
+ case 'Enter':
164
+ e.preventDefault();
165
+ if (this.focusedIndex >= 0 && this.focusedIndex < itemCount) {
166
+ this.selectItem(visibleItems[this.focusedIndex]);
167
+ }
168
+ break;
169
+ case 'Escape':
170
+ e.preventDefault();
171
+ this.close();
172
+ break;
173
+ }
174
+ }
159
175
  scrollFocusedIntoView() {
160
176
  if (this.focusedIndex < 0)
161
177
  return;
@@ -172,18 +188,18 @@ export class SallaSearchableDropdown {
172
188
  render() {
173
189
  const hasSelection = this.selectedItem != null;
174
190
  const listboxId = `${this.inputId}-listbox`;
175
- return (h(Host, { key: '3545a75c07ae7c2a2c82ee54fa710f6f5d8bcfce', class: "s-searchable-dropdown" }, h("div", { key: '022fb98602228c5837cadb758f24f00956fafc22', class: { 's-searchable-dropdown': true, 's-searchable-dropdown--open': this.isOpen } }, this.label && (h("label", { key: '24e09036df24d45ce74799ec06b20b03df866866', class: "s-searchable-dropdown-label", htmlFor: this.inputId }, this.label, this.required && h("span", { key: '94277d1659f2b22c96de02a77a37920eefff13ef', class: "s-searchable-dropdown-required" }, " *"))), h("div", { key: '077e0662f0570c1bf9339577e7699d75f9b337de', class: {
191
+ return (h(Host, { key: 'c529f2b61adbc38aa1e5403da6fdb985fe256baa', class: "s-searchable-dropdown" }, h("div", { key: '88ab96afd36421fdf965b79298fa14f435adbcef', class: { 's-searchable-dropdown': true, 's-searchable-dropdown--open': this.isOpen } }, this.label && (h("label", { key: '6ee8a2d0428e1347e36eabec32a3129897481abc', class: "s-searchable-dropdown-label", htmlFor: this.inputId }, this.label, this.required && h("span", { key: '8473884ec18e73c72c79e7749264bd9c24c56ae9', class: "s-searchable-dropdown-required" }, " *"))), h("div", { key: 'bffbea7ff0cb9466c8a852a841a21ed8351ef92d', class: {
176
192
  's-searchable-dropdown-trigger': true,
177
193
  's-searchable-dropdown-trigger--disabled': this.disabled || this.loading,
178
194
  's-searchable-dropdown-trigger--open': this.isOpen,
179
- }, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h("i", { key: '134a95003036f1c8a7df91a06542178e6ec12c04', class: {
195
+ }, role: "combobox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-disabled": this.disabled || this.loading ? 'true' : 'false', tabIndex: this.disabled || this.loading ? -1 : 0, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, hasSelection ? (h("span", { class: "s-searchable-dropdown-trigger-text" }, this.getDisplayName(this.selectedItem))) : (h("span", { class: "s-searchable-dropdown-trigger-placeholder" }, this.placeholder)), h("i", { key: 'e3aee1ffe1b80a9ef21f4c9cca02de0a590b0825', class: {
180
196
  'sicon-keyboard_arrow_down': true,
181
197
  's-searchable-dropdown-trigger-icon': true,
182
198
  's-searchable-dropdown-trigger-icon--open': this.isOpen,
183
- }, "aria-hidden": "true" })), this.isOpen && (h("div", { key: 'be6eb6c94d4b73c27959722ccb4bc87722035d1c', class: {
199
+ }, "aria-hidden": "true" })), this.isOpen && (h("div", { key: '7a19f2d6847b3e0dda5e0ea509df91a2f48fa098', class: {
184
200
  's-searchable-dropdown-panel': true,
185
201
  's-searchable-dropdown-panel--up': this.dropUp,
186
- }, ref: (el) => (this.panelRef = el) }, h("div", { key: 'd97ce90a0fd26043a45c1a45616f8fde621e8ac5', class: "s-searchable-dropdown-search-wrap" }, h("i", { key: 'c7683e2dd873306e18afea983bb410827d883796', class: "sicon-search s-searchable-dropdown-search-icon", "aria-hidden": "true" }), h("input", { key: '64c4259b6c5453a9b1cb5985c58c65dd01ec139f', ref: (el) => (this.searchInputRef = el), id: this.inputId, type: "text", class: "s-searchable-dropdown-search-input", placeholder: this.placeholder, value: this.clientSearch ? this.clientSearchQuery : this.searchQuery, onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchKeyDown, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": listboxId })), h("div", { key: '9748f507fcb884b520ffc847800cc3543546b8ce', id: listboxId, class: "s-searchable-dropdown-list s-scrollbar", role: "listbox" }, this.renderListContent()))))));
202
+ }, ref: (el) => (this.panelRef = el) }, this.searchable && (h("div", { key: '601529f76a09762a57fe7b7663ecfa1505462367', class: "s-searchable-dropdown-search-wrap" }, h("i", { key: 'f91e464e7efed3759837880b5a7593daa4f84ecb', class: "sicon-search s-searchable-dropdown-search-icon", "aria-hidden": "true" }), h("input", { key: 'f72a7e12d0a6e90bab3983258c9b08aa286bc897', ref: (el) => (this.searchInputRef = el), id: this.inputId, type: "text", class: "s-searchable-dropdown-search-input", placeholder: this.placeholder, value: this.clientSearch ? this.clientSearchQuery : this.searchQuery, onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchKeyDown, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": listboxId }))), h("div", { key: '495aa88fc76d3d17956db7277cc98aff08b4c1af', id: listboxId, class: "s-searchable-dropdown-list s-scrollbar", role: "listbox" }, this.renderListContent()))))));
187
203
  }
188
204
  renderListContent() {
189
205
  if (this.searching || this.loading) {
@@ -477,6 +493,46 @@ export class SallaSearchableDropdown {
477
493
  "setter": false,
478
494
  "reflect": false,
479
495
  "defaultValue": "false"
496
+ },
497
+ "searchable": {
498
+ "type": "boolean",
499
+ "attribute": "searchable",
500
+ "mutable": false,
501
+ "complexType": {
502
+ "original": "boolean",
503
+ "resolved": "boolean",
504
+ "references": {}
505
+ },
506
+ "required": false,
507
+ "optional": false,
508
+ "docs": {
509
+ "tags": [],
510
+ "text": ""
511
+ },
512
+ "getter": false,
513
+ "setter": false,
514
+ "reflect": false,
515
+ "defaultValue": "true"
516
+ },
517
+ "keepParentScroll": {
518
+ "type": "boolean",
519
+ "attribute": "keep-parent-scroll",
520
+ "mutable": false,
521
+ "complexType": {
522
+ "original": "boolean",
523
+ "resolved": "boolean",
524
+ "references": {}
525
+ },
526
+ "required": false,
527
+ "optional": false,
528
+ "docs": {
529
+ "tags": [],
530
+ "text": "When true, the dropdown will NOT override the nearest scrollable ancestor's\n`overflow` to `visible` while open. Use this when the host (e.g. a modal\nbody) needs to keep its own scrolling intact while the dropdown is open."
531
+ },
532
+ "getter": false,
533
+ "setter": false,
534
+ "reflect": false,
535
+ "defaultValue": "false"
480
536
  }
481
537
  };
482
538
  }