@salla.sa/twilight-components 2.14.389 → 2.14.390

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/cjs/{filepond-D-Sm5mfd.js → filepond-DFct_qpx.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-D_Q9tOzh.js → filepond-plugin-file-poster-B_Lr4Ulx.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-jE8i9yLT.js → filepond-plugin-file-validate-size-BqkoO_hr.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-ClNK2GsY.js → filepond-plugin-file-validate-type-DyTH8eH0.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BtI2loP1.js → filepond-plugin-image-edit-Cxg-WjCl.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-DFksd-cT.js → filepond-plugin-image-exif-orientation-BSVkpMNu.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-B6iy7dvj.js → filepond-plugin-image-preview-DNcmQwuK.js} +1 -1
  8. package/dist/cjs/{index-CZzG9P8m.js → index-B8vh41va.js} +26 -10
  9. package/dist/cjs/{index-PbcABX0l.js → index-DnQaQgSB.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +63 -0
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  19. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-count-down.cjs.entry.js +196 -0
  27. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-gifting.cjs.entry.js +91 -16
  31. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  41. package/dist/cjs/{salla-accordion-body_3.cjs.entry.js → salla-map.cjs.entry.js} +1 -57
  42. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-order-edit-item.cjs.entry.js +95 -0
  55. package/dist/cjs/salla-order-edit.cjs.entry.js +181 -0
  56. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  62. package/dist/cjs/{salla-count-down_2.cjs.entry.js → salla-product-card.cjs.entry.js} +1 -160
  63. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  84. package/dist/cjs/twilight.cjs.js +2 -2
  85. package/dist/cjs/{vanilla-picker-BP4lqf-K.js → vanilla-picker-BZ48aiBi.js} +1 -1
  86. package/dist/collection/collection-manifest.json +2 -0
  87. package/dist/collection/components/salla-count-down/salla-count-down.css +4 -0
  88. package/dist/collection/components/salla-count-down/salla-count-down.js +122 -13
  89. package/dist/collection/components/salla-gifting/salla-gifting.js +96 -15
  90. package/dist/collection/components/salla-order-edit/interfaces.js +1 -0
  91. package/dist/collection/components/salla-order-edit/salla-order-edit-item.css +0 -0
  92. package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +185 -0
  93. package/dist/collection/components/salla-order-edit/salla-order-edit.css +0 -0
  94. package/dist/collection/components/salla-order-edit/salla-order-edit.js +256 -0
  95. package/dist/components/index.js +2 -2
  96. package/dist/components/salla-count-down2.js +49 -13
  97. package/dist/components/salla-gifting.js +96 -15
  98. package/dist/components/salla-order-edit-item.d.ts +11 -0
  99. package/dist/components/salla-order-edit-item.js +9 -0
  100. package/dist/components/salla-order-edit-item2.js +184 -0
  101. package/dist/components/salla-order-edit.d.ts +11 -0
  102. package/dist/components/salla-order-edit.js +291 -0
  103. package/dist/components/salla-quantity-input.js +1 -125
  104. package/dist/components/salla-quantity-input2.js +130 -0
  105. package/dist/esm/{filepond-PPWykQxI.js → filepond-C9FlNeRD.js} +1 -1
  106. package/dist/esm/{filepond-plugin-file-poster-BRSyNznG.js → filepond-plugin-file-poster-BfX4exY0.js} +1 -1
  107. package/dist/esm/{filepond-plugin-file-validate-size-BKa_IBRc.js → filepond-plugin-file-validate-size-B5-cSfmI.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-validate-type-B2Gqcysx.js → filepond-plugin-file-validate-type-DKvNhI35.js} +1 -1
  109. package/dist/esm/{filepond-plugin-image-edit-C0UvZ9iA.js → filepond-plugin-image-edit-DV1-ZICm.js} +1 -1
  110. package/dist/esm/{filepond-plugin-image-exif-orientation-Dmzu9ZJy.js → filepond-plugin-image-exif-orientation-idrSYwAk.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-preview-CaZ36U6e.js → filepond-plugin-image-preview-os8BCUOs.js} +1 -1
  112. package/dist/esm/{index-CyfZeaV2.js → index-BcMtCVX0.js} +26 -10
  113. package/dist/esm/{index-C3w2qMi0.js → index-DQCZHaDc.js} +1 -1
  114. package/dist/esm/loader.js +3 -3
  115. package/dist/esm/salla-accordion-body_2.entry.js +60 -0
  116. package/dist/esm/salla-accordion_6.entry.js +1 -1
  117. package/dist/esm/salla-add-product-button_4.entry.js +1 -1
  118. package/dist/esm/salla-advertisement.entry.js +1 -1
  119. package/dist/esm/salla-alert_2.entry.js +1 -1
  120. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  121. package/dist/esm/salla-apps-icons.entry.js +1 -1
  122. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  123. package/dist/esm/salla-bullet-delivery.entry.js +1 -1
  124. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  125. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  126. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  127. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  128. package/dist/esm/salla-contacts.entry.js +1 -1
  129. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  130. package/dist/esm/salla-count-down.entry.js +194 -0
  131. package/dist/esm/salla-custom-fields.entry.js +1 -1
  132. package/dist/esm/salla-filters-widget.entry.js +1 -1
  133. package/dist/esm/salla-filters.entry.js +1 -1
  134. package/dist/esm/salla-gifting.entry.js +91 -16
  135. package/dist/esm/salla-hook.entry.js +1 -1
  136. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  137. package/dist/esm/salla-installment.entry.js +1 -1
  138. package/dist/esm/salla-list-tile.entry.js +1 -1
  139. package/dist/esm/salla-localization-modal.entry.js +1 -1
  140. package/dist/esm/salla-login-modal.entry.js +1 -1
  141. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  142. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  143. package/dist/esm/salla-loyalty.entry.js +1 -1
  144. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  145. package/dist/esm/{salla-accordion-body_3.entry.js → salla-map.entry.js} +2 -56
  146. package/dist/esm/salla-menu.entry.js +1 -1
  147. package/dist/esm/salla-metadata.entry.js +1 -1
  148. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  149. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  150. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  151. package/dist/esm/salla-notification-item.entry.js +1 -1
  152. package/dist/esm/salla-notifications.entry.js +1 -1
  153. package/dist/esm/salla-offer-modal.entry.js +1 -1
  154. package/dist/esm/salla-offer.entry.js +1 -1
  155. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  156. package/dist/esm/salla-order-details-options.entry.js +1 -1
  157. package/dist/esm/salla-order-details.entry.js +1 -1
  158. package/dist/esm/salla-order-edit-item.entry.js +93 -0
  159. package/dist/esm/salla-order-edit.entry.js +179 -0
  160. package/dist/esm/salla-order-summary.entry.js +1 -1
  161. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  162. package/dist/esm/salla-orders.entry.js +1 -1
  163. package/dist/esm/salla-payments.entry.js +1 -1
  164. package/dist/esm/salla-placeholder.entry.js +1 -1
  165. package/dist/esm/salla-price-range.entry.js +1 -1
  166. package/dist/esm/{salla-count-down_2.entry.js → salla-product-card.entry.js} +2 -160
  167. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  168. package/dist/esm/salla-products-list.entry.js +1 -1
  169. package/dist/esm/salla-products-slider.entry.js +1 -1
  170. package/dist/esm/salla-progress-bar.entry.js +1 -1
  171. package/dist/esm/salla-quick-order.entry.js +1 -1
  172. package/dist/esm/salla-rating-modal.entry.js +1 -1
  173. package/dist/esm/salla-scopes.entry.js +1 -1
  174. package/dist/esm/salla-search.entry.js +1 -1
  175. package/dist/esm/salla-skeleton.entry.js +1 -1
  176. package/dist/esm/salla-slider.entry.js +1 -1
  177. package/dist/esm/salla-social-share.entry.js +1 -1
  178. package/dist/esm/salla-social.entry.js +1 -1
  179. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  180. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  181. package/dist/esm/salla-tooltip.entry.js +1 -1
  182. package/dist/esm/salla-trust-badges.entry.js +1 -1
  183. package/dist/esm/salla-user-menu.entry.js +1 -1
  184. package/dist/esm/salla-user-profile.entry.js +1 -1
  185. package/dist/esm/salla-user-settings.entry.js +1 -1
  186. package/dist/esm/salla-verify.entry.js +1 -1
  187. package/dist/esm/salla-wallet.entry.js +1 -1
  188. package/dist/esm/twilight.js +3 -3
  189. package/dist/esm/{vanilla-picker-BnLjo9lg.js → vanilla-picker-BBEKwYz7.js} +1 -1
  190. package/dist/twilight/{p-49178d13.entry.js → p-00a2d261.entry.js} +1 -1
  191. package/dist/twilight/{p-0dcadf17.entry.js → p-0b27ca19.entry.js} +1 -1
  192. package/dist/twilight/{p-52249b73.entry.js → p-0d0ca330.entry.js} +1 -1
  193. package/dist/twilight/{p-749f87cc.entry.js → p-1054b66c.entry.js} +1 -1
  194. package/dist/twilight/{p-9dace77f.entry.js → p-129d6c0c.entry.js} +1 -1
  195. package/dist/twilight/{p-d0d9eaa7.entry.js → p-15a052c7.entry.js} +1 -1
  196. package/dist/twilight/{p-7367264c.entry.js → p-207950ad.entry.js} +1 -1
  197. package/dist/twilight/{p-4a0248ab.entry.js → p-2548fa30.entry.js} +1 -1
  198. package/dist/twilight/{p-77a89284.entry.js → p-26cb1fdf.entry.js} +1 -1
  199. package/dist/twilight/{p-313e016b.entry.js → p-2b74eb03.entry.js} +1 -1
  200. package/dist/twilight/{p-71199938.entry.js → p-359b2de3.entry.js} +1 -1
  201. package/dist/twilight/{p-3424772f.entry.js → p-35a2ea22.entry.js} +1 -1
  202. package/dist/twilight/{p-92aa6f9c.entry.js → p-3653ad70.entry.js} +1 -1
  203. package/dist/twilight/{p-0e064e79.entry.js → p-374057f7.entry.js} +1 -1
  204. package/dist/twilight/p-374c63c7.entry.js +4 -0
  205. package/dist/twilight/{p-3490e1f2.entry.js → p-412643eb.entry.js} +1 -1
  206. package/dist/twilight/{p-981aa6b2.entry.js → p-47cd7ceb.entry.js} +1 -1
  207. package/dist/twilight/{p-5db4f7be.entry.js → p-47d1003b.entry.js} +1 -1
  208. package/dist/twilight/{p-b6d4d88f.entry.js → p-48353d62.entry.js} +1 -1
  209. package/dist/twilight/{p-833e8364.entry.js → p-4866439f.entry.js} +1 -1
  210. package/dist/twilight/{p-549d8385.entry.js → p-4f3964d8.entry.js} +1 -1
  211. package/dist/twilight/{p-f8b53b4a.entry.js → p-4fefd2df.entry.js} +1 -1
  212. package/dist/twilight/{p-de4fc6d3.entry.js → p-5174aa32.entry.js} +1 -1
  213. package/dist/twilight/{p-6b642ef5.entry.js → p-58c66b0d.entry.js} +1 -1
  214. package/dist/twilight/{p-7b3e9e94.entry.js → p-58fa3856.entry.js} +1 -1
  215. package/dist/twilight/{p-6f230886.entry.js → p-596525f9.entry.js} +1 -1
  216. package/dist/twilight/p-5a629abd.entry.js +4 -0
  217. package/dist/twilight/{p-f713d4c1.entry.js → p-5d2ebf97.entry.js} +1 -1
  218. package/dist/twilight/{p-016b3b19.entry.js → p-65df6042.entry.js} +1 -1
  219. package/dist/twilight/{p-7eebae69.entry.js → p-67bc002a.entry.js} +1 -1
  220. package/dist/twilight/{p-b85269f0.entry.js → p-67cf0723.entry.js} +1 -1
  221. package/dist/twilight/{p-1a9b64ea.entry.js → p-687a597a.entry.js} +1 -1
  222. package/dist/twilight/{p-75744403.entry.js → p-689701b4.entry.js} +1 -1
  223. package/dist/twilight/{p-646ac137.entry.js → p-70e478a6.entry.js} +1 -1
  224. package/dist/twilight/{p-a3479656.entry.js → p-74472650.entry.js} +1 -1
  225. package/dist/twilight/{p-5a3fbfcc.entry.js → p-7855ae93.entry.js} +1 -1
  226. package/dist/twilight/p-8c86ba24.entry.js +4 -0
  227. package/dist/twilight/{p-9b03dc5f.entry.js → p-8d4d4a0e.entry.js} +1 -1
  228. package/dist/twilight/{p-85e08789.entry.js → p-8fbd92a2.entry.js} +1 -1
  229. package/dist/twilight/{p-f2a021d2.entry.js → p-983f9f1e.entry.js} +1 -1
  230. package/dist/twilight/{p-f9b6a945.entry.js → p-998a3b5f.entry.js} +1 -1
  231. package/dist/twilight/{p-56f20bf9.entry.js → p-9bf0a7df.entry.js} +1 -1
  232. package/dist/twilight/{p-414f399b.entry.js → p-9ff1a4dc.entry.js} +1 -1
  233. package/dist/twilight/{p-C11T4TVo.js → p-B21QGKK8.js} +1 -1
  234. package/dist/twilight/{p-DaXFe_AG.js → p-Bc2ExcVy.js} +1 -1
  235. package/dist/twilight/{p-CyfZeaV2.js → p-BcMtCVX0.js} +2 -2
  236. package/dist/twilight/{p-DV84B4Zf.js → p-C3Z9uRGX.js} +1 -1
  237. package/dist/twilight/{p-CKAWVE2E.js → p-DIeaJrGb.js} +1 -1
  238. package/dist/twilight/{p-CJnMMMxb.js → p-DbdyybJU.js} +1 -1
  239. package/dist/twilight/{p-oPo_An7U.js → p-UFbwqsEd.js} +1 -1
  240. package/dist/twilight/{p-9af46409.entry.js → p-a39a0eb8.entry.js} +1 -1
  241. package/dist/twilight/{p-6c5ab45f.entry.js → p-a54364a3.entry.js} +1 -1
  242. package/dist/twilight/{p-68e1946b.entry.js → p-a6bb162e.entry.js} +1 -1
  243. package/dist/twilight/{p-dccaabbe.entry.js → p-a6cbb4f5.entry.js} +1 -1
  244. package/dist/twilight/{p-b6924b12.entry.js → p-a8fd427d.entry.js} +1 -1
  245. package/dist/twilight/{p-9ae66ab7.entry.js → p-a909028d.entry.js} +1 -1
  246. package/dist/twilight/{p-fdb99998.entry.js → p-acd70c2f.entry.js} +1 -1
  247. package/dist/twilight/{p-8538541b.entry.js → p-ae1e338f.entry.js} +1 -1
  248. package/dist/twilight/{p-ccc3689d.entry.js → p-b19ace8d.entry.js} +1 -1
  249. package/dist/twilight/p-b697172b.entry.js +4 -0
  250. package/dist/twilight/{p-c48e2a05.entry.js → p-bb98a631.entry.js} +1 -1
  251. package/dist/twilight/{p-8c1f6ff5.entry.js → p-c18179ed.entry.js} +1 -1
  252. package/dist/twilight/{p-8c918f58.entry.js → p-c2d74b3d.entry.js} +1 -1
  253. package/dist/twilight/{p-83bb3e08.entry.js → p-c45f2128.entry.js} +1 -1
  254. package/dist/twilight/p-c5522363.entry.js +4 -0
  255. package/dist/twilight/{p-a5215f9c.entry.js → p-c6e7b06f.entry.js} +1 -1
  256. package/dist/twilight/{p-d224ad78.entry.js → p-cc6c624c.entry.js} +1 -1
  257. package/dist/twilight/{p-B5sTdzgA.js → p-ctIqN5Fo.js} +1 -1
  258. package/dist/twilight/{p-71e9036c.entry.js → p-d607bfd3.entry.js} +1 -1
  259. package/dist/twilight/{p-2d3c3fc0.entry.js → p-d862646f.entry.js} +1 -1
  260. package/dist/twilight/{p-e4984da6.entry.js → p-dbcc0a7f.entry.js} +1 -1
  261. package/dist/twilight/p-dc6f4d54.entry.js +4 -0
  262. package/dist/twilight/{p-28691a37.entry.js → p-deb74e2e.entry.js} +1 -1
  263. package/dist/twilight/{p-e51abff8.entry.js → p-dfa729d4.entry.js} +1 -1
  264. package/dist/twilight/p-e7671432.entry.js +4 -0
  265. package/dist/twilight/{p-1fa74395.entry.js → p-e7932d3d.entry.js} +1 -1
  266. package/dist/twilight/{p-46715ed4.entry.js → p-e879fb84.entry.js} +1 -1
  267. package/dist/twilight/p-e9c7f99a.entry.js +4 -0
  268. package/dist/twilight/{p-c782ba90.entry.js → p-f100cc25.entry.js} +1 -1
  269. package/dist/twilight/{p-fca12e58.entry.js → p-f63999f8.entry.js} +1 -1
  270. package/dist/twilight/{p-nDM6sAQW.js → p-fbLtV-T9.js} +1 -1
  271. package/dist/twilight/{p-282b2717.entry.js → p-fd22cd01.entry.js} +1 -1
  272. package/dist/twilight/{p-DgRZXtp7.js → p-ukob-enB.js} +2 -2
  273. package/dist/twilight/twilight.esm.js +1 -1
  274. package/dist/types/components/salla-count-down/salla-count-down.d.ts +24 -0
  275. package/dist/types/components/salla-gifting/gift-schema.d.ts +4 -0
  276. package/dist/types/components/salla-gifting/intefaces.d.ts +1 -0
  277. package/dist/types/components/salla-gifting/salla-gifting.d.ts +10 -1
  278. package/dist/types/components/salla-order-edit/interfaces.d.ts +114 -0
  279. package/dist/types/components/salla-order-edit/salla-order-edit-item.d.ts +35 -0
  280. package/dist/types/components/salla-order-edit/salla-order-edit.d.ts +42 -0
  281. package/dist/types/components.d.ts +170 -0
  282. package/package.json +5 -5
  283. package/dist/twilight/p-1048b469.entry.js +0 -4
  284. package/dist/twilight/p-69ae622f.entry.js +0 -4
  285. package/dist/twilight/p-d33f3c58.entry.js +0 -4
  286. package/dist/twilight/p-fbcc194e.entry.js +0 -4
@@ -0,0 +1,291 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
+ import { d as defineCustomElement$f } from './salla-booking-field2.js';
6
+ import { d as defineCustomElement$e } from './salla-button2.js';
7
+ import { d as defineCustomElement$d } from './salla-color-picker2.js';
8
+ import { d as defineCustomElement$c } from './salla-conditional-fields2.js';
9
+ import { d as defineCustomElement$b } from './salla-count-down2.js';
10
+ import { d as defineCustomElement$a } from './salla-datetime-picker2.js';
11
+ import { d as defineCustomElement$9 } from './salla-file-upload2.js';
12
+ import { d as defineCustomElement$8 } from './salla-loading2.js';
13
+ import { d as defineCustomElement$7 } from './salla-map2.js';
14
+ import { d as defineCustomElement$6 } from './salla-modal2.js';
15
+ import { d as defineCustomElement$5 } from './salla-order-edit-item2.js';
16
+ import { d as defineCustomElement$4 } from './salla-product-options2.js';
17
+ import { d as defineCustomElement$3 } from './salla-progress-bar2.js';
18
+ import { d as defineCustomElement$2 } from './salla-quantity-input2.js';
19
+
20
+ const sallaOrderEditCss = "";
21
+
22
+ const SallaOrderEdit$1 = /*@__PURE__*/ proxyCustomElement(class SallaOrderEdit extends HTMLElement {
23
+ constructor() {
24
+ super();
25
+ this.__registerHost();
26
+ this.loading = true;
27
+ this.saveLoading = false;
28
+ this.payload = { items: { update: [], remove: [] } };
29
+ this.expired = false;
30
+ this.editPreview = null;
31
+ this.confirming = false;
32
+ }
33
+ async componentWillLoad() {
34
+ await salla.onReady();
35
+ this.loadFromProp();
36
+ this.startExpiryCheck();
37
+ }
38
+ disconnectedCallback() {
39
+ clearInterval(this.expiryInterval);
40
+ }
41
+ startExpiryCheck() {
42
+ const endsAt = this.order?.customer_editing_session?.ends_at;
43
+ if (!endsAt)
44
+ return;
45
+ const isExpired = () => new Date(`${endsAt.replace(' ', 'T')}+03:00`).getTime() <= Date.now();
46
+ if (isExpired()) {
47
+ this.expired = true;
48
+ return;
49
+ }
50
+ this.expiryInterval = setInterval(() => {
51
+ if (isExpired()) {
52
+ this.expired = true;
53
+ clearInterval(this.expiryInterval);
54
+ }
55
+ }, 1000);
56
+ }
57
+ loadFromProp() {
58
+ try {
59
+ if (!this.orderData) {
60
+ this.error = salla.lang.getWithDefault('pages.orders.order_not_found', 'الطلب غير موجود');
61
+ return;
62
+ }
63
+ const data = typeof this.orderData === 'string' ? JSON.parse(this.orderData) : this.orderData;
64
+ this.order = data;
65
+ }
66
+ catch (e) {
67
+ this.error = salla.lang.getWithDefault('pages.orders.order_not_found', 'الطلب غير موجود');
68
+ }
69
+ finally {
70
+ this.loading = false;
71
+ }
72
+ }
73
+ handleItemUpdated(event) {
74
+ if (!this.order)
75
+ return;
76
+ const { itemId, quantity, options } = event.detail;
77
+ const updateList = this.payload.items.update.filter(u => u.id !== itemId);
78
+ const updateEntry = { id: itemId, quantity, options: options ?? [] };
79
+ updateList.push(updateEntry);
80
+ this.payload = {
81
+ ...this.payload,
82
+ items: { ...this.payload.items, update: updateList },
83
+ };
84
+ this.order = {
85
+ ...this.order,
86
+ items: this.order.items.map(item => item.id === itemId ? { ...item, quantity } : item),
87
+ };
88
+ }
89
+ handleItemRemoved(event) {
90
+ if (!this.order)
91
+ return;
92
+ if (this.order.items.length <= 1) {
93
+ salla.notify.error(salla.lang.getWithDefault('pages.orders.order_cannot_be_empty', 'لا يمكن إزالة جميع المنتجات من الطلب'));
94
+ return;
95
+ }
96
+ const { itemId } = event.detail;
97
+ this.payload = {
98
+ ...this.payload,
99
+ items: {
100
+ update: this.payload.items.update.filter(u => u.id !== itemId),
101
+ remove: [...this.payload.items.remove, itemId],
102
+ },
103
+ };
104
+ this.order = {
105
+ ...this.order,
106
+ items: this.order.items.filter(item => item.id !== itemId),
107
+ };
108
+ }
109
+ get hasChanges() {
110
+ return this.payload.items.update.length > 0 || this.payload.items.remove.length > 0;
111
+ }
112
+ async saveOrder() {
113
+ if (!this.hasChanges)
114
+ return;
115
+ this.saveLoading = true;
116
+ try {
117
+ const response = await salla.order.api.editOrder(this.orderId, this.payload);
118
+ this.editPreview = response?.data?.data || response?.data;
119
+ await this.saveModal?.open();
120
+ }
121
+ catch (error) {
122
+ const message = error?.response?.data?.error?.message || error?.response?.data?.message;
123
+ if (message) {
124
+ salla.notify.error(message);
125
+ }
126
+ }
127
+ finally {
128
+ this.saveLoading = false;
129
+ }
130
+ }
131
+ navigateToOrder() {
132
+ const url = new URL(window.location.href);
133
+ url.pathname = url.pathname.replace(/\/edit\/?$/, '');
134
+ url.search = '';
135
+ window.location.href = url.href;
136
+ }
137
+ handleConfirm() {
138
+ this.confirming = true;
139
+ if (this.editPreview?.payment?.required && this.editPreview.payment.payment_url) {
140
+ window.location.href = this.editPreview.payment.payment_url;
141
+ }
142
+ else {
143
+ this.navigateToOrder();
144
+ }
145
+ }
146
+ cancel() {
147
+ this.navigateToOrder();
148
+ }
149
+ renderSaveModal() {
150
+ const preview = this.editPreview;
151
+ const hasRemainingAmount = preview?.totals?.remaining_amount?.amount > 0;
152
+ const hasRefundAmount = preview?.totals?.refund_amount?.amount > 0;
153
+ const taxAmount = preview?.totals?.tax?.amount?.amount;
154
+ return (h("salla-modal", { ref: modal => (this.saveModal = modal), width: "md", onModalVisibilityChanged: (e) => {
155
+ if (!e.detail) {
156
+ this.editPreview = null;
157
+ if (!this.confirming) {
158
+ this.navigateToOrder();
159
+ }
160
+ this.confirming = false;
161
+ }
162
+ } }, 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 => {
163
+ const orderItem = this.order?.items?.find(oi => oi.id == item.id);
164
+ const imageUrl = orderItem?.product?.image?.url;
165
+ const optionsLabel = item.options?.join('/ ');
166
+ return (h("div", { class: "s-order-edit-modal-item" }, h("div", { class: "s-order-edit-modal-item-start" }, imageUrl && (h("img", { src: imageUrl, alt: item.name, class: "s-order-edit-modal-item-image" })), h("div", null, h("p", { class: "s-order-edit-modal-item-name" }, item.name), optionsLabel && (h("span", { class: "s-order-edit-modal-item-options" }, optionsLabel)))), h("div", { class: "s-order-edit-modal-item-end" }, h("span", { class: "s-order-edit-modal-item-price", innerHTML: salla.money(item.price.amount) }))));
167
+ }))), preview?.totals?.updated_products_total && (h("div", { class: "s-order-edit-modal-row" }, h("span", { class: "s-order-edit-modal-row-label" }, salla.lang.getWithDefault('pages.orders.modified_products_total', 'مجموع المنتجات المعدلة')), h("span", { class: "s-order-edit-modal-row-value", innerHTML: salla.money(preview.totals.updated_products_total.amount) }))), taxAmount > 0 && (h("div", { class: "s-order-edit-modal-row" }, h("span", { class: "s-order-edit-modal-tax-label" }, h("i", { class: "sicon-info-circle s-order-edit-modal-tax-icon" }), salla.lang.getWithDefault('pages.orders.vat', 'ضريبة القيمة المضافة')), h("span", { class: "s-order-edit-modal-row-value", innerHTML: salla.money(taxAmount) }))), preview?.totals?.total && (h("div", { class: "s-order-edit-modal-total" }, h("span", { class: "s-order-edit-modal-total-label" }, salla.lang.getWithDefault('pages.orders.order_total', 'اجمالي الطلب')), h("span", { class: "s-order-edit-modal-total-value", innerHTML: salla.money(preview.totals.total.amount) }))), hasRefundAmount && (h("div", { class: "s-order-edit-modal-refund" }, h("i", { class: "sicon-info-circle s-order-edit-modal-refund-icon" }), h("p", { class: "s-order-edit-modal-refund-text" }, salla.lang.getWithDefault('pages.orders.refund_message', 'سيتم تحويل فارق المبلغ على نفس وسيلة الدفع')))), h("div", { class: "s-order-edit-modal-btn-wrapper" }, h("salla-button", { onClick: () => this.handleConfirm() }, hasRemainingAmount
168
+ ? salla.lang.getWithDefault('pages.orders.pay_difference', 'دفع فارق المبلغ')
169
+ : hasRefundAmount
170
+ ? salla.lang.getWithDefault('pages.orders.confirm_and_receive_difference', 'تأكيد واستلام فارق المبلغ')
171
+ : salla.lang.getWithDefault('pages.orders.confirm_changes', 'تأكيد التعديلات'), h("i", { class: "sicon-keyboard_arrow_left s-order-edit-modal-btn-icon" }))))));
172
+ }
173
+ render() {
174
+ if (this.loading) {
175
+ return (h(Host, null, h("salla-loading", null)));
176
+ }
177
+ if (this.expired) {
178
+ return (h(Host, null, h("div", { class: "s-order-edit-expired" }, h("p", null, salla.lang.getWithDefault('pages.orders.edit_session_expired', 'انتهت مدة التعديل المتاحة')), h("salla-button", { onClick: () => this.navigateToOrder() }, salla.lang.getWithDefault('pages.orders.back_to_order', 'العودة إلى تفاصيل الطلب')))));
179
+ }
180
+ if (this.error || !this.order) {
181
+ return (h(Host, null, h("div", { class: "no-content-placeholder" }, h("i", { class: "sicon-shopping-bag icon" }), h("p", null, this.error))));
182
+ }
183
+ const hasItems = this.order.items && this.order.items.length > 0;
184
+ const endsAt = this.order.customer_editing_session?.ends_at;
185
+ return (h(Host, null, endsAt && (h("div", { class: "s-order-edit-timer-wrapper" }, h("salla-count-down", { prefixText: salla.lang.getWithDefault('pages.orders.edit_within', 'يمكنك التعديل خلال'), date: endsAt, horizontal: true, withButton: true, autoSegments: true, labeled: false, size: "sm", color: "primary" }))), h("div", { class: "s-order-edit-items-wrapper" }, h("h2", { class: "s-order-edit-items-title" }, salla.lang.getWithDefault('pages.orders.order_products', 'منتجات الطلب')), hasItems ? (this.order.items.map((item, index) => [
186
+ h("salla-order-edit-item", { key: item.id, item: item, orderId: this.orderId }),
187
+ index < this.order.items.length - 1 ? (h("div", { class: "s-order-edit-items-divider" })) : null,
188
+ ])) : (h("div", { class: "no-content-placeholder" }, h("i", { class: "sicon-shopping-bag icon" }), h("p", null, salla.lang.getWithDefault('common.elements.no_items', 'لا توجد عناصر'))))), h("div", { class: "s-order-edit-actions" }, h("salla-button", { onClick: () => this.saveOrder(), loading: this.saveLoading, disabled: !this.hasChanges }, salla.lang.getWithDefault('pages.orders.save_changes', 'حفظ التعديلات')), h("salla-button", { color: "gray", fill: "outline", onClick: () => this.cancel() }, salla.lang.getWithDefault('common.elements.cancel', 'الغاء'))), this.renderSaveModal()));
189
+ }
190
+ get host() { return this; }
191
+ static get style() { return sallaOrderEditCss; }
192
+ }, [0, "salla-order-edit", {
193
+ "orderId": [8, "order-id"],
194
+ "orderData": [1, "order-data"],
195
+ "order": [32],
196
+ "loading": [32],
197
+ "error": [32],
198
+ "saveLoading": [32],
199
+ "payload": [32],
200
+ "expired": [32],
201
+ "editPreview": [32]
202
+ }, [[0, "orderItemUpdated", "handleItemUpdated"], [0, "orderItemRemoved", "handleItemRemoved"]]]);
203
+ function defineCustomElement$1() {
204
+ if (typeof customElements === "undefined") {
205
+ return;
206
+ }
207
+ const components = ["salla-order-edit", "salla-booking-field", "salla-button", "salla-color-picker", "salla-conditional-fields", "salla-count-down", "salla-datetime-picker", "salla-file-upload", "salla-loading", "salla-map", "salla-modal", "salla-order-edit-item", "salla-product-options", "salla-progress-bar", "salla-quantity-input"];
208
+ components.forEach(tagName => { switch (tagName) {
209
+ case "salla-order-edit":
210
+ if (!customElements.get(tagName)) {
211
+ customElements.define(tagName, SallaOrderEdit$1);
212
+ }
213
+ break;
214
+ case "salla-booking-field":
215
+ if (!customElements.get(tagName)) {
216
+ defineCustomElement$f();
217
+ }
218
+ break;
219
+ case "salla-button":
220
+ if (!customElements.get(tagName)) {
221
+ defineCustomElement$e();
222
+ }
223
+ break;
224
+ case "salla-color-picker":
225
+ if (!customElements.get(tagName)) {
226
+ defineCustomElement$d();
227
+ }
228
+ break;
229
+ case "salla-conditional-fields":
230
+ if (!customElements.get(tagName)) {
231
+ defineCustomElement$c();
232
+ }
233
+ break;
234
+ case "salla-count-down":
235
+ if (!customElements.get(tagName)) {
236
+ defineCustomElement$b();
237
+ }
238
+ break;
239
+ case "salla-datetime-picker":
240
+ if (!customElements.get(tagName)) {
241
+ defineCustomElement$a();
242
+ }
243
+ break;
244
+ case "salla-file-upload":
245
+ if (!customElements.get(tagName)) {
246
+ defineCustomElement$9();
247
+ }
248
+ break;
249
+ case "salla-loading":
250
+ if (!customElements.get(tagName)) {
251
+ defineCustomElement$8();
252
+ }
253
+ break;
254
+ case "salla-map":
255
+ if (!customElements.get(tagName)) {
256
+ defineCustomElement$7();
257
+ }
258
+ break;
259
+ case "salla-modal":
260
+ if (!customElements.get(tagName)) {
261
+ defineCustomElement$6();
262
+ }
263
+ break;
264
+ case "salla-order-edit-item":
265
+ if (!customElements.get(tagName)) {
266
+ defineCustomElement$5();
267
+ }
268
+ break;
269
+ case "salla-product-options":
270
+ if (!customElements.get(tagName)) {
271
+ defineCustomElement$4();
272
+ }
273
+ break;
274
+ case "salla-progress-bar":
275
+ if (!customElements.get(tagName)) {
276
+ defineCustomElement$3();
277
+ }
278
+ break;
279
+ case "salla-quantity-input":
280
+ if (!customElements.get(tagName)) {
281
+ defineCustomElement$2();
282
+ }
283
+ break;
284
+ } });
285
+ }
286
+ defineCustomElement$1();
287
+
288
+ const SallaOrderEdit = SallaOrderEdit$1;
289
+ const defineCustomElement = defineCustomElement$1;
290
+
291
+ export { SallaOrderEdit, defineCustomElement };
@@ -1,131 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
- import { A as Add, M as Minus } from './minus.js';
6
- import { H as Helper } from './Helper.js';
7
-
8
- const sallaQuantityInputCss = "";
9
-
10
- const SallaQuantityInput$1 = /*@__PURE__*/ proxyCustomElement(class SallaQuantityInput extends HTMLElement {
11
- constructor() {
12
- super();
13
- this.__registerHost();
14
- /**
15
- * Based on store setting: store.settings.product.manual_quantity
16
- */
17
- this.disableInput = false;
18
- this.hostAttributes = {};
19
- this.hasIncrementSlot = false;
20
- this.hasDecrementSlot = false;
21
- this.didLoaded = false;
22
- this.quantity = 1;
23
- this.fireChangeEvent = true;
24
- }
25
- /**
26
- * Workaround to fire change event for the input.
27
- */
28
- watchPropHandler() {
29
- if (!this.didLoaded) {
30
- return;
31
- }
32
- if (!this.fireChangeEvent) {
33
- this.fireChangeEvent = true;
34
- return;
35
- }
36
- Helper.debounce(() => {
37
- salla.document.event.fireEvent(this.textInput, 'change', {
38
- bubbles: true,
39
- detail: { productId: this.cartItemId, quantity: this.quantity }
40
- });
41
- });
42
- }
43
- async componentWillLoad() {
44
- await salla.onReady();
45
- this.disableInput = !salla.config.get('store.settings.product.manual_quantity');
46
- this.quantity = parseInt(this.host.getAttribute('value')) || 1;
47
- this.hasIncrementSlot = !!this.host.querySelector('[slot="increment-button"]');
48
- this.hasDecrementSlot = !!this.host.querySelector('[slot="decrement-button"]');
49
- }
50
- componentDidLoad() {
51
- this.didLoaded = true;
52
- this.textInput.addEventListener('input', (event) => salla.helpers.inputDigitsOnly(event.target));
53
- }
54
- getInputAttributes() {
55
- for (let i = 0; i < this.host.attributes.length; i++) {
56
- if (!['id', 'value', 'min', 'class'].includes(this.host.attributes[i].name)) {
57
- this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
58
- }
59
- }
60
- return this.hostAttributes;
61
- }
62
- /**
63
- * decrease quantity by one.
64
- * @return HTMLSallaQuantityInputElement
65
- */
66
- async decrease() {
67
- return this.setValue(this.quantity - 1);
68
- }
69
- /**
70
- * increase quantity by one.
71
- * @return HTMLSallaQuantityInputElement
72
- */
73
- async increase() {
74
- return this.setValue(Number(this.quantity) + 1);
75
- }
76
- /**
77
- * set quantity by one.
78
- * @return HTMLSallaQuantityInputElement
79
- */
80
- async setValue(value, fireChangeEvent = true) {
81
- this.fireChangeEvent = fireChangeEvent;
82
- let maxQuantity = parseInt(this.host.getAttribute('max'));
83
- if (maxQuantity && value > maxQuantity) {
84
- value = maxQuantity;
85
- }
86
- if (value <= 1) {
87
- value = 1;
88
- }
89
- this.quantity = value;
90
- return this.host;
91
- }
92
- render() {
93
- const inputAttributes = this.getInputAttributes();
94
- if (!inputAttributes['aria-label'] && !inputAttributes['aria-labelledby']) {
95
- inputAttributes['aria-label'] = salla.lang.getWithDefault('common.elements.quantity', 'Quantity');
96
- }
97
- return (h(Host, { key: 'c9b83e158f990a40a69100bcc7880bc208433de1', class: "s-quantity-input" }, h("div", { key: '74ee814b486365c28950a675f0e75ed78fad1549', class: "s-quantity-input-container" }, h("button", { key: 'a78de04f1ca0efc4b20d3fc4acdb1d881bf31501', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button", "aria-label": salla.lang.getWithDefault('common.elements.increase_quantity', 'Increase quantity') }, !this.hasIncrementSlot ? h("span", { innerHTML: Add }) : '', h("slot", { key: 'd1222cf3e005c8fbf1d38e42589e5abac08b99bf', name: "increment-button" })), h("input", { key: 'b2402558907f7e0e15bf622b1524a5649d74fe8d', class: "s-quantity-input-input", ...inputAttributes, ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", readOnly: this.disableInput, value: this.quantity }), h("button", { key: '578d4ff2f4c4d6b778d052a2eed68f9abcc8625b', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button", "aria-label": salla.lang.getWithDefault('common.elements.decrease_quantity', 'Decrease quantity') }, !this.hasDecrementSlot ? h("span", { innerHTML: Minus }) : '', h("slot", { key: 'e8540cb6aae1027d76736069f2372ba18903bd25', name: "decrement-button" })))));
98
- }
99
- get host() { return this; }
100
- static get watchers() { return {
101
- "quantity": ["watchPropHandler"]
102
- }; }
103
- static get style() { return sallaQuantityInputCss; }
104
- }, [4, "salla-quantity-input", {
105
- "cartItemId": [8, "cart-item-id"],
106
- "disableInput": [32],
107
- "quantity": [32],
108
- "fireChangeEvent": [32],
109
- "decrease": [64],
110
- "increase": [64],
111
- "setValue": [64]
112
- }, undefined, {
113
- "quantity": ["watchPropHandler"]
114
- }]);
115
- function defineCustomElement$1() {
116
- if (typeof customElements === "undefined") {
117
- return;
118
- }
119
- const components = ["salla-quantity-input"];
120
- components.forEach(tagName => { switch (tagName) {
121
- case "salla-quantity-input":
122
- if (!customElements.get(tagName)) {
123
- customElements.define(tagName, SallaQuantityInput$1);
124
- }
125
- break;
126
- } });
127
- }
128
- defineCustomElement$1();
4
+ import { S as SallaQuantityInput$1, d as defineCustomElement$1 } from './salla-quantity-input2.js';
129
5
 
130
6
  const SallaQuantityInput = SallaQuantityInput$1;
131
7
  const defineCustomElement = defineCustomElement$1;
@@ -0,0 +1,130 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
+ import { A as Add, M as Minus } from './minus.js';
6
+ import { H as Helper } from './Helper.js';
7
+
8
+ const sallaQuantityInputCss = "";
9
+
10
+ const SallaQuantityInput = /*@__PURE__*/ proxyCustomElement(class SallaQuantityInput extends HTMLElement {
11
+ constructor() {
12
+ super();
13
+ this.__registerHost();
14
+ /**
15
+ * Based on store setting: store.settings.product.manual_quantity
16
+ */
17
+ this.disableInput = false;
18
+ this.hostAttributes = {};
19
+ this.hasIncrementSlot = false;
20
+ this.hasDecrementSlot = false;
21
+ this.didLoaded = false;
22
+ this.quantity = 1;
23
+ this.fireChangeEvent = true;
24
+ }
25
+ /**
26
+ * Workaround to fire change event for the input.
27
+ */
28
+ watchPropHandler() {
29
+ if (!this.didLoaded) {
30
+ return;
31
+ }
32
+ if (!this.fireChangeEvent) {
33
+ this.fireChangeEvent = true;
34
+ return;
35
+ }
36
+ Helper.debounce(() => {
37
+ salla.document.event.fireEvent(this.textInput, 'change', {
38
+ bubbles: true,
39
+ detail: { productId: this.cartItemId, quantity: this.quantity }
40
+ });
41
+ });
42
+ }
43
+ async componentWillLoad() {
44
+ await salla.onReady();
45
+ this.disableInput = !salla.config.get('store.settings.product.manual_quantity');
46
+ this.quantity = parseInt(this.host.getAttribute('value')) || 1;
47
+ this.hasIncrementSlot = !!this.host.querySelector('[slot="increment-button"]');
48
+ this.hasDecrementSlot = !!this.host.querySelector('[slot="decrement-button"]');
49
+ }
50
+ componentDidLoad() {
51
+ this.didLoaded = true;
52
+ this.textInput.addEventListener('input', (event) => salla.helpers.inputDigitsOnly(event.target));
53
+ }
54
+ getInputAttributes() {
55
+ for (let i = 0; i < this.host.attributes.length; i++) {
56
+ if (!['id', 'value', 'min', 'class'].includes(this.host.attributes[i].name)) {
57
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
58
+ }
59
+ }
60
+ return this.hostAttributes;
61
+ }
62
+ /**
63
+ * decrease quantity by one.
64
+ * @return HTMLSallaQuantityInputElement
65
+ */
66
+ async decrease() {
67
+ return this.setValue(this.quantity - 1);
68
+ }
69
+ /**
70
+ * increase quantity by one.
71
+ * @return HTMLSallaQuantityInputElement
72
+ */
73
+ async increase() {
74
+ return this.setValue(Number(this.quantity) + 1);
75
+ }
76
+ /**
77
+ * set quantity by one.
78
+ * @return HTMLSallaQuantityInputElement
79
+ */
80
+ async setValue(value, fireChangeEvent = true) {
81
+ this.fireChangeEvent = fireChangeEvent;
82
+ let maxQuantity = parseInt(this.host.getAttribute('max'));
83
+ if (maxQuantity && value > maxQuantity) {
84
+ value = maxQuantity;
85
+ }
86
+ if (value <= 1) {
87
+ value = 1;
88
+ }
89
+ this.quantity = value;
90
+ return this.host;
91
+ }
92
+ render() {
93
+ const inputAttributes = this.getInputAttributes();
94
+ if (!inputAttributes['aria-label'] && !inputAttributes['aria-labelledby']) {
95
+ inputAttributes['aria-label'] = salla.lang.getWithDefault('common.elements.quantity', 'Quantity');
96
+ }
97
+ return (h(Host, { key: 'c9b83e158f990a40a69100bcc7880bc208433de1', class: "s-quantity-input" }, h("div", { key: '74ee814b486365c28950a675f0e75ed78fad1549', class: "s-quantity-input-container" }, h("button", { key: 'a78de04f1ca0efc4b20d3fc4acdb1d881bf31501', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button", "aria-label": salla.lang.getWithDefault('common.elements.increase_quantity', 'Increase quantity') }, !this.hasIncrementSlot ? h("span", { innerHTML: Add }) : '', h("slot", { key: 'd1222cf3e005c8fbf1d38e42589e5abac08b99bf', name: "increment-button" })), h("input", { key: 'b2402558907f7e0e15bf622b1524a5649d74fe8d', class: "s-quantity-input-input", ...inputAttributes, ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", readOnly: this.disableInput, value: this.quantity }), h("button", { key: '578d4ff2f4c4d6b778d052a2eed68f9abcc8625b', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button", "aria-label": salla.lang.getWithDefault('common.elements.decrease_quantity', 'Decrease quantity') }, !this.hasDecrementSlot ? h("span", { innerHTML: Minus }) : '', h("slot", { key: 'e8540cb6aae1027d76736069f2372ba18903bd25', name: "decrement-button" })))));
98
+ }
99
+ get host() { return this; }
100
+ static get watchers() { return {
101
+ "quantity": ["watchPropHandler"]
102
+ }; }
103
+ static get style() { return sallaQuantityInputCss; }
104
+ }, [4, "salla-quantity-input", {
105
+ "cartItemId": [8, "cart-item-id"],
106
+ "disableInput": [32],
107
+ "quantity": [32],
108
+ "fireChangeEvent": [32],
109
+ "decrease": [64],
110
+ "increase": [64],
111
+ "setValue": [64]
112
+ }, undefined, {
113
+ "quantity": ["watchPropHandler"]
114
+ }]);
115
+ function defineCustomElement() {
116
+ if (typeof customElements === "undefined") {
117
+ return;
118
+ }
119
+ const components = ["salla-quantity-input"];
120
+ components.forEach(tagName => { switch (tagName) {
121
+ case "salla-quantity-input":
122
+ if (!customElements.get(tagName)) {
123
+ customElements.define(tagName, SallaQuantityInput);
124
+ }
125
+ break;
126
+ } });
127
+ }
128
+ defineCustomElement();
129
+
130
+ export { SallaQuantityInput as S, defineCustomElement as d };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-CyfZeaV2.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BcMtCVX0.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-CyfZeaV2.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BcMtCVX0.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-CyfZeaV2.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BcMtCVX0.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-CyfZeaV2.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BcMtCVX0.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-CyfZeaV2.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BcMtCVX0.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-CyfZeaV2.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BcMtCVX0.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-CyfZeaV2.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BcMtCVX0.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {