@salla.sa/twilight-components 2.14.549 → 2.14.551

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 (341) hide show
  1. package/dist/cjs/{Helper-6RI07gZo.js → Helper-D1YsoJud.js} +46 -0
  2. package/dist/cjs/{filepond-COUccQWv.js → filepond-C99K1KEB.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-B_yyvbJ6.js → filepond-plugin-file-poster-CggRjTNg.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-KDZtJpSs.js → filepond-plugin-file-validate-size-B009kdAV.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-Dbm_-1V2.js → filepond-plugin-file-validate-type-DZs9-bai.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-C-q8yFXi.js → filepond-plugin-image-edit-DNNheErX.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-C2Q2chpj.js → filepond-plugin-image-exif-orientation-ChN0IpOy.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-DVK8eIMv.js → filepond-plugin-image-preview-BZo2ftGo.js} +1 -1
  9. package/dist/cjs/{index-CSq9uCjw.js → index-0JUvtl0d.js} +6 -2
  10. package/dist/cjs/{intlTelInput-NQOLNYxO.js → intlTelInput-D84-rI5D.js} +1 -1
  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 +2 -2
  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-applied-filters.cjs.entry.js +175 -0
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +10 -11
  38. package/dist/cjs/salla-filters.cjs.entry.js +14 -79
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  83. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  105. package/dist/cjs/twilight.cjs.js +2 -2
  106. package/dist/cjs/{vanilla-picker-My41190Y.js → vanilla-picker-D8r5xyK7.js} +1 -1
  107. package/dist/collection/Helpers/Helper.js +28 -0
  108. package/dist/collection/collection-manifest.json +1 -0
  109. package/dist/collection/components/salla-applied-filters/salla-applied-filters.css +115 -0
  110. package/dist/collection/components/salla-applied-filters/salla-applied-filters.js +185 -0
  111. package/dist/collection/components/salla-filters/salla-filters.css +0 -119
  112. package/dist/collection/components/salla-filters/salla-filters.js +27 -73
  113. package/dist/components/Helper.js +47 -1
  114. package/dist/components/index.js +2 -2
  115. package/dist/components/salla-applied-filters.d.ts +11 -0
  116. package/dist/components/salla-applied-filters.js +195 -0
  117. package/dist/components/salla-filters-widget2.js +2 -21
  118. package/dist/components/salla-filters.js +10 -76
  119. package/dist/esm/{Helper-CBmYxrzX.js → Helper-DsjZ6kte.js} +47 -1
  120. package/dist/esm/{filepond-CA4TWKuz.js → filepond-DuMUHI7t.js} +1 -1
  121. package/dist/esm/{filepond-plugin-file-poster-C4_NyGjO.js → filepond-plugin-file-poster-Dv25V2UU.js} +1 -1
  122. package/dist/esm/{filepond-plugin-file-validate-size-DVV7mZ-K.js → filepond-plugin-file-validate-size-Dxl4yPm6.js} +1 -1
  123. package/dist/esm/{filepond-plugin-file-validate-type-DT1IX9KM.js → filepond-plugin-file-validate-type-C602myuq.js} +1 -1
  124. package/dist/esm/{filepond-plugin-image-edit-RrqhOPfq.js → filepond-plugin-image-edit-DLd3ht_R.js} +1 -1
  125. package/dist/esm/{filepond-plugin-image-exif-orientation-Dc9_Qlva.js → filepond-plugin-image-exif-orientation-BaQ5DNLu.js} +1 -1
  126. package/dist/esm/{filepond-plugin-image-preview-Iu7ULzAy.js → filepond-plugin-image-preview-C-RFNs7l.js} +1 -1
  127. package/dist/esm/{index-C0qiFNJn.js → index-BsIeN-bg.js} +6 -2
  128. package/dist/esm/{intlTelInput-CrkMI_sC.js → intlTelInput-Cf6zBu5Y.js} +1 -1
  129. package/dist/esm/loader.js +3 -3
  130. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  131. package/dist/esm/salla-accordion_6.entry.js +2 -2
  132. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  133. package/dist/esm/salla-advertisement.entry.js +1 -1
  134. package/dist/esm/salla-alert_2.entry.js +1 -1
  135. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  136. package/dist/esm/salla-applied-filters.entry.js +173 -0
  137. package/dist/esm/salla-apps-icons.entry.js +1 -1
  138. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  139. package/dist/esm/salla-badge.entry.js +1 -1
  140. package/dist/esm/salla-basket-gap.entry.js +1 -1
  141. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  142. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  143. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  144. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  145. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  146. package/dist/esm/salla-comment-factors.entry.js +1 -1
  147. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  148. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  149. package/dist/esm/salla-contacts.entry.js +1 -1
  150. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  151. package/dist/esm/salla-count-down.entry.js +1 -1
  152. package/dist/esm/salla-custom-fields.entry.js +1 -1
  153. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  154. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  155. package/dist/esm/salla-filters-widget.entry.js +2 -3
  156. package/dist/esm/salla-filters.entry.js +8 -73
  157. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  158. package/dist/esm/salla-gifting.entry.js +1 -1
  159. package/dist/esm/salla-hook.entry.js +1 -1
  160. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  161. package/dist/esm/salla-installment.entry.js +1 -1
  162. package/dist/esm/salla-list-tile.entry.js +1 -1
  163. package/dist/esm/salla-localization-modal.entry.js +1 -1
  164. package/dist/esm/salla-login-modal.entry.js +1 -1
  165. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  166. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  167. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  168. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  169. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  170. package/dist/esm/salla-loyalty.entry.js +1 -1
  171. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  172. package/dist/esm/salla-map_2.entry.js +1 -1
  173. package/dist/esm/salla-menu.entry.js +1 -1
  174. package/dist/esm/salla-metadata.entry.js +1 -1
  175. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  176. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  177. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  178. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  179. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  180. package/dist/esm/salla-offer-modal.entry.js +1 -1
  181. package/dist/esm/salla-offer.entry.js +1 -1
  182. package/dist/esm/salla-order-branch.entry.js +1 -1
  183. package/dist/esm/salla-order-cancel.entry.js +1 -1
  184. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  185. package/dist/esm/salla-order-details-options.entry.js +1 -1
  186. package/dist/esm/salla-order-details.entry.js +1 -1
  187. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  188. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  189. package/dist/esm/salla-order-edit.entry.js +1 -1
  190. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  191. package/dist/esm/salla-order-shipments.entry.js +1 -1
  192. package/dist/esm/salla-order-summary.entry.js +1 -1
  193. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  194. package/dist/esm/salla-orders.entry.js +2 -2
  195. package/dist/esm/salla-payments.entry.js +1 -1
  196. package/dist/esm/salla-placeholder.entry.js +1 -1
  197. package/dist/esm/salla-price-range.entry.js +1 -1
  198. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  199. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  200. package/dist/esm/salla-products-list.entry.js +2 -2
  201. package/dist/esm/salla-products-slider.entry.js +2 -2
  202. package/dist/esm/salla-quick-order.entry.js +1 -1
  203. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  204. package/dist/esm/salla-rating-modal.entry.js +2 -2
  205. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  206. package/dist/esm/salla-review-order-item.entry.js +1 -1
  207. package/dist/esm/salla-scopes.entry.js +1 -1
  208. package/dist/esm/salla-search.entry.js +2 -2
  209. package/dist/esm/salla-skeleton.entry.js +1 -1
  210. package/dist/esm/salla-slider.entry.js +1 -1
  211. package/dist/esm/salla-social-share.entry.js +1 -1
  212. package/dist/esm/salla-social.entry.js +1 -1
  213. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  214. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  215. package/dist/esm/salla-tooltip.entry.js +1 -1
  216. package/dist/esm/salla-trust-badges.entry.js +1 -1
  217. package/dist/esm/salla-user-menu.entry.js +1 -1
  218. package/dist/esm/salla-user-profile.entry.js +1 -1
  219. package/dist/esm/salla-user-settings.entry.js +1 -1
  220. package/dist/esm/salla-verify.entry.js +1 -1
  221. package/dist/esm/salla-wallet.entry.js +1 -1
  222. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  223. package/dist/esm/twilight.js +3 -3
  224. package/dist/esm/{vanilla-picker-Cf9pEgos.js → vanilla-picker-S7qZ7YZm.js} +1 -1
  225. package/dist/twilight/{p-2a64e50b.entry.js → p-01406425.entry.js} +1 -1
  226. package/dist/twilight/{p-i-tkvIE0.js → p-035DwuUC.js} +1 -1
  227. package/dist/twilight/{p-bbd2cb8c.entry.js → p-07adeb89.entry.js} +1 -1
  228. package/dist/twilight/{p-e806b976.entry.js → p-0944d367.entry.js} +1 -1
  229. package/dist/twilight/{p-e190e1cf.entry.js → p-0a332226.entry.js} +1 -1
  230. package/dist/twilight/{p-adbf6324.entry.js → p-0e3d72ab.entry.js} +1 -1
  231. package/dist/twilight/{p-368beadc.entry.js → p-1118bee2.entry.js} +1 -1
  232. package/dist/twilight/{p-a37a692a.entry.js → p-13c4b450.entry.js} +1 -1
  233. package/dist/twilight/{p-e36310e2.entry.js → p-18639885.entry.js} +1 -1
  234. package/dist/twilight/{p-dc7f11e4.entry.js → p-18a604c5.entry.js} +1 -1
  235. package/dist/twilight/{p-5364f42e.entry.js → p-1abe8321.entry.js} +1 -1
  236. package/dist/twilight/{p-27b6fd51.entry.js → p-1bf18c56.entry.js} +1 -1
  237. package/dist/twilight/{p-c3bed022.entry.js → p-211324e6.entry.js} +1 -1
  238. package/dist/twilight/p-22cb8a9c.entry.js +4 -0
  239. package/dist/twilight/{p-c2005d4a.entry.js → p-2331e63a.entry.js} +1 -1
  240. package/dist/twilight/{p-ab86dc29.entry.js → p-27456209.entry.js} +1 -1
  241. package/dist/twilight/{p-c72a1861.entry.js → p-2a3d30d1.entry.js} +1 -1
  242. package/dist/twilight/{p-4d149e9e.entry.js → p-2a683382.entry.js} +1 -1
  243. package/dist/twilight/{p-7e26332e.entry.js → p-2bef08e8.entry.js} +1 -1
  244. package/dist/twilight/{p-73db9793.entry.js → p-2c48bb97.entry.js} +1 -1
  245. package/dist/twilight/p-2df31e90.entry.js +4 -0
  246. package/dist/twilight/{p-7122a097.entry.js → p-2ff7bb22.entry.js} +1 -1
  247. package/dist/twilight/{p-ed5d8787.entry.js → p-357b5593.entry.js} +1 -1
  248. package/dist/twilight/{p-8c086859.entry.js → p-3aa6fa7d.entry.js} +1 -1
  249. package/dist/twilight/{p-a5185029.entry.js → p-3c2cc4fe.entry.js} +1 -1
  250. package/dist/twilight/{p-c15eeb62.entry.js → p-3fb485a6.entry.js} +1 -1
  251. package/dist/twilight/{p-e4c3ca60.entry.js → p-43f8f33b.entry.js} +1 -1
  252. package/dist/twilight/{p-354da069.entry.js → p-47713dd1.entry.js} +1 -1
  253. package/dist/twilight/{p-86cec54b.entry.js → p-49738042.entry.js} +1 -1
  254. package/dist/twilight/{p-499ccb8b.entry.js → p-49f9e536.entry.js} +1 -1
  255. package/dist/twilight/{p-945b3f38.entry.js → p-4ef06a6f.entry.js} +1 -1
  256. package/dist/twilight/{p-55c716a4.entry.js → p-501c0798.entry.js} +1 -1
  257. package/dist/twilight/{p-a5f477fd.entry.js → p-523572e9.entry.js} +1 -1
  258. package/dist/twilight/{p-f3bd1c09.entry.js → p-54974d98.entry.js} +1 -1
  259. package/dist/twilight/{p-a9554697.entry.js → p-56845467.entry.js} +1 -1
  260. package/dist/twilight/{p-3c99951e.entry.js → p-569c6d6c.entry.js} +1 -1
  261. package/dist/twilight/{p-14f2c393.entry.js → p-56f164bb.entry.js} +1 -1
  262. package/dist/twilight/{p-8fa81b10.entry.js → p-5918dd8d.entry.js} +1 -1
  263. package/dist/twilight/{p-95117a08.entry.js → p-5ba2eb55.entry.js} +1 -1
  264. package/dist/twilight/{p-28efc3a8.entry.js → p-5cd4b67f.entry.js} +1 -1
  265. package/dist/twilight/{p-bf9cc549.entry.js → p-5dfd449d.entry.js} +1 -1
  266. package/dist/twilight/{p-a30ae3e6.entry.js → p-683db553.entry.js} +1 -1
  267. package/dist/twilight/{p-d322a3e8.entry.js → p-68d754be.entry.js} +1 -1
  268. package/dist/twilight/{p-84181d45.entry.js → p-6a746b8a.entry.js} +1 -1
  269. package/dist/twilight/{p-0357b501.entry.js → p-6c5a1ded.entry.js} +1 -1
  270. package/dist/twilight/{p-4358c48e.entry.js → p-6d787fa0.entry.js} +1 -1
  271. package/dist/twilight/{p-6da4a9b3.entry.js → p-6edd1008.entry.js} +1 -1
  272. package/dist/twilight/{p-7bdf543a.entry.js → p-6f3516a1.entry.js} +1 -1
  273. package/dist/twilight/{p-a72bf47b.entry.js → p-6f58ac6a.entry.js} +1 -1
  274. package/dist/twilight/{p-4cfccc31.entry.js → p-704553fb.entry.js} +1 -1
  275. package/dist/twilight/{p-f51a1326.entry.js → p-709c2184.entry.js} +1 -1
  276. package/dist/twilight/{p-453f92f9.entry.js → p-83a5b8a4.entry.js} +1 -1
  277. package/dist/twilight/{p-c0d89d74.entry.js → p-847cdd79.entry.js} +1 -1
  278. package/dist/twilight/p-84cffb13.entry.js +4 -0
  279. package/dist/twilight/{p-dc51e991.entry.js → p-869fe4c0.entry.js} +1 -1
  280. package/dist/twilight/{p-32af49cd.entry.js → p-8711224a.entry.js} +1 -1
  281. package/dist/twilight/{p-ee7530fe.entry.js → p-8ebb86ce.entry.js} +1 -1
  282. package/dist/twilight/{p-875beddd.entry.js → p-9025e5d9.entry.js} +1 -1
  283. package/dist/twilight/{p-4a8b3e89.entry.js → p-906b36e3.entry.js} +1 -1
  284. package/dist/twilight/{p-a9b9deb9.entry.js → p-90f29c99.entry.js} +1 -1
  285. package/dist/twilight/{p-42efd1b1.entry.js → p-9dd126e2.entry.js} +1 -1
  286. package/dist/twilight/{p-a909aff5.entry.js → p-9f431f78.entry.js} +1 -1
  287. package/dist/twilight/{p-5be5be8b.entry.js → p-9fdbe8a0.entry.js} +1 -1
  288. package/dist/twilight/{p-CW2JQnYK.js → p-B3oo4tIx.js} +1 -1
  289. package/dist/twilight/p-BRZVMxhy.js +9 -0
  290. package/dist/twilight/{p-C0qiFNJn.js → p-BsIeN-bg.js} +1 -1
  291. package/dist/twilight/{p-ClV-F79e.js → p-CPiqlSTo.js} +1 -1
  292. package/dist/twilight/{p-CyO2XGkr.js → p-CaCiueRc.js} +1 -1
  293. package/dist/twilight/p-D6rFREuQ.js +4 -0
  294. package/dist/twilight/{p-BeFR_h3q.js → p-DNS31w5e.js} +1 -1
  295. package/dist/twilight/{p-l7Rr63jq.js → p-DeX830vG.js} +1 -1
  296. package/dist/twilight/{p-b5028411.entry.js → p-a01f64e7.entry.js} +1 -1
  297. package/dist/twilight/{p-344f751a.entry.js → p-a037e47d.entry.js} +1 -1
  298. package/dist/twilight/{p-709af483.entry.js → p-a0ed97f5.entry.js} +1 -1
  299. package/dist/twilight/{p-8f2f8693.entry.js → p-a30390a7.entry.js} +1 -1
  300. package/dist/twilight/{p-b3ba53c5.entry.js → p-a344db00.entry.js} +1 -1
  301. package/dist/twilight/{p-b6d259be.entry.js → p-a3579980.entry.js} +1 -1
  302. package/dist/twilight/{p-7a1169f6.entry.js → p-a46a9d28.entry.js} +1 -1
  303. package/dist/twilight/{p-33c2f3bc.entry.js → p-a64771f7.entry.js} +1 -1
  304. package/dist/twilight/{p-a243d3cc.entry.js → p-a8316527.entry.js} +1 -1
  305. package/dist/twilight/{p-e2d501f5.entry.js → p-a9ef3c52.entry.js} +1 -1
  306. package/dist/twilight/{p-ecaf7d87.entry.js → p-aa8962f8.entry.js} +1 -1
  307. package/dist/twilight/{p-0dea4239.entry.js → p-aa91a230.entry.js} +1 -1
  308. package/dist/twilight/{p-b2662a4f.entry.js → p-af348a67.entry.js} +1 -1
  309. package/dist/twilight/{p-1adf1893.entry.js → p-b1e0bc90.entry.js} +1 -1
  310. package/dist/twilight/{p-0d44c47f.entry.js → p-b238c74b.entry.js} +1 -1
  311. package/dist/twilight/{p-6da0b2b3.entry.js → p-b5a2342c.entry.js} +1 -1
  312. package/dist/twilight/{p-b73b7e15.entry.js → p-be0ac755.entry.js} +1 -1
  313. package/dist/twilight/{p-6bedb896.entry.js → p-cdba9d35.entry.js} +1 -1
  314. package/dist/twilight/{p-fba13fd5.entry.js → p-d5215891.entry.js} +1 -1
  315. package/dist/twilight/{p-a8561cc8.entry.js → p-e3e2baa2.entry.js} +1 -1
  316. package/dist/twilight/{p-7f11af86.entry.js → p-e875f53e.entry.js} +1 -1
  317. package/dist/twilight/{p-ae96e338.entry.js → p-ea968ba3.entry.js} +1 -1
  318. package/dist/twilight/{p-88148fed.entry.js → p-eb3a095b.entry.js} +1 -1
  319. package/dist/twilight/{p-c82b8aa7.entry.js → p-ebc6ba28.entry.js} +1 -1
  320. package/dist/twilight/{p-b8da968d.entry.js → p-ecdbd18f.entry.js} +1 -1
  321. package/dist/twilight/{p-4ebdef90.entry.js → p-ef145c1e.entry.js} +1 -1
  322. package/dist/twilight/{p-5d71c16a.entry.js → p-efe6493f.entry.js} +1 -1
  323. package/dist/twilight/{p-5d261682.entry.js → p-f037e508.entry.js} +1 -1
  324. package/dist/twilight/{p-34889d17.entry.js → p-f4f355e5.entry.js} +1 -1
  325. package/dist/twilight/{p-862f7fda.entry.js → p-fed3efba.entry.js} +1 -1
  326. package/dist/twilight/{p-b217fea1.entry.js → p-ff37c2af.entry.js} +1 -1
  327. package/dist/twilight/{p-yV2X3Oc1.js → p-mgSPapOV.js} +1 -1
  328. package/dist/twilight/{p-C7NprL2x.js → p-wqmCmzsY.js} +1 -1
  329. package/dist/twilight/twilight.esm.js +1 -1
  330. package/dist/types/Helpers/Helper.d.ts +10 -0
  331. package/dist/types/components/salla-applied-filters/salla-applied-filters.d.ts +37 -0
  332. package/dist/types/components/salla-filters/salla-filters.d.ts +3 -11
  333. package/dist/types/components.d.ts +17 -0
  334. package/package.json +5 -5
  335. package/dist/cjs/interfaces-DZDQwN6-.js +0 -23
  336. package/dist/esm/interfaces-DL4h2bc3.js +0 -23
  337. package/dist/twilight/p-01b52f2f.entry.js +0 -4
  338. package/dist/twilight/p-B3th5No1.js +0 -9
  339. package/dist/twilight/p-DL4h2bc3.js +0 -4
  340. package/dist/twilight/p-DOBDDG4K.js +0 -4
  341. package/dist/twilight/p-c55c576c.entry.js +0 -4
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SallaAppliedFilters extends Components.SallaAppliedFilters, HTMLElement {}
4
+ export const SallaAppliedFilters: {
5
+ prototype: SallaAppliedFilters;
6
+ new (): SallaAppliedFilters;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,195 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
+ import { H as Helper, F as FilterOptionTypes } from './Helper.js';
6
+
7
+ const sallaAppliedFiltersCss = "/*!twlt*/:host{display:block}.s-applied-filters-tags{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;margin-bottom:1rem}.s-applied-filters-tag{display:inline-flex;align-items:center;gap:0.4rem;border-radius:999px;border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);color:var(--main-text-color);font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem}.s-applied-filters-tag-remove{display:inline-flex;align-items:center;justify-content:center;border:0;padding:0;background:transparent;color:inherit;font-size:0.75rem;cursor:pointer}.s-applied-filters-clear-tag{display:inline-flex;align-items:center;gap:0.4rem;border-radius:999px;border:1px solid var(--color-danger, #dc3545);background:transparent;color:var(--color-danger, #dc3545);font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem;cursor:pointer}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-applied-filters-wrapper{display:block}.s-applied-filters-tags{margin-bottom:1rem;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:0.5rem}.s-applied-filters-tag{display:inline-flex;align-items:center;gap:0.375rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));background-color:rgb(255 255 255 / 0.3);padding-top:0.375rem;padding-bottom:0.375rem;padding-left:0.625rem;padding-right:0.625rem;font-size:0.875rem;line-height:1.25rem;color:var(--main-text-color)}.s-applied-filters-tag-name{color:inherit}.s-applied-filters-tag-remove{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;border-width:0px;background-color:transparent;padding:0px;font-size:0.75rem;line-height:1rem;color:inherit}.s-applied-filters-clear-tag{display:inline-flex;cursor:pointer;align-items:center;gap:0.375rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1));background-color:transparent;padding-top:0.375rem;padding-bottom:0.375rem;padding-left:0.625rem;padding-right:0.625rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}";
8
+
9
+ const SallaAppliedFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaAppliedFilters extends HTMLElement {
10
+ constructor() {
11
+ super();
12
+ this.__registerHost();
13
+ this.filters = [];
14
+ this.filtersData = {};
15
+ this.clearAllLabel = '';
16
+ this.removeLabel = '';
17
+ this.translationDefaults = {
18
+ 'pages.categories.clear_all_filters': { ar: 'إزالة التصفية', en: 'Clear All' },
19
+ 'common.elements.delete': { ar: 'حذف', en: 'Delete' },
20
+ };
21
+ }
22
+ async componentWillLoad() {
23
+ salla.event.on('filters::fetched', ({ filters }) => {
24
+ this.filters = Helper.resolveFilterLabels(filters);
25
+ this.syncFiltersDataFromFiltersElement();
26
+ });
27
+ salla.event.on('filters::hidden', () => {
28
+ this.filters = [];
29
+ });
30
+ // The current selections, kept in sync with salla-filters' own state.
31
+ salla.event.on('salla-filters::changed', (filtersData) => {
32
+ this.filtersData = { ...filtersData };
33
+ });
34
+ salla.event.on('salla-filters::reset', () => {
35
+ this.filtersData = {};
36
+ });
37
+ salla.lang.onLoaded(() => {
38
+ this.registerTranslationDefaults();
39
+ this.loadTranslations();
40
+ });
41
+ this.getInitialFiltersData();
42
+ }
43
+ getInitialFiltersData() {
44
+ const searchParams = new URLSearchParams(window.location.search);
45
+ this.filtersData = Helper.extractFiltersFromUrl(searchParams);
46
+ }
47
+ /**
48
+ * salla-filters reconciles its own filtersData synchronously in its `filters::fetched`
49
+ * handler, dropping any key whose filter group no longer exists in the fresh backend
50
+ * response (e.g. a disabled category). Pull that reconciled state instead of keeping our
51
+ * own copy sourced from the raw URL, which would otherwise go stale forever — it's only
52
+ * ever updated by user-driven `salla-filters::changed`/`reset` events, never by a fetch.
53
+ * Deferred a tick so it runs after salla-filters' own (synchronous) listener, regardless
54
+ * of which component happened to register its `filters::fetched` listener first.
55
+ */
56
+ syncFiltersDataFromFiltersElement() {
57
+ setTimeout(async () => {
58
+ const filtersData = await this.getFiltersElement()?.getFilters();
59
+ if (filtersData) {
60
+ this.filtersData = { ...filtersData };
61
+ }
62
+ });
63
+ }
64
+ /**
65
+ * Register bilingual (ar/en) defaults for our keys, without overriding any
66
+ * translation that already exists in the store/central translations.
67
+ */
68
+ registerTranslationDefaults() {
69
+ const missing = Object.entries(this.translationDefaults).reduce((acc, [key, value]) => {
70
+ // `get` returns the key itself when no translation is found.
71
+ if (salla.lang.get(key) === key) {
72
+ acc[key] = value;
73
+ }
74
+ return acc;
75
+ }, {});
76
+ if (Object.keys(missing).length) {
77
+ salla.lang.addBulk(missing);
78
+ }
79
+ }
80
+ loadTranslations() {
81
+ this.clearAllLabel = salla.lang.get('pages.categories.clear_all_filters');
82
+ this.removeLabel = salla.lang.get('common.elements.delete');
83
+ }
84
+ /**
85
+ * Flatten the selected filtersData into displayable chips, resolving the
86
+ * human label for each group + option from `this.filters`. Selections that
87
+ * can't be resolved to a known option (e.g. the auto-added base category)
88
+ * are skipped. Ported from salla-filters, which no longer renders this UI.
89
+ */
90
+ getAppliedFilters() {
91
+ const chips = [];
92
+ const data = this.filtersData || {};
93
+ for (const key of Object.keys(data)) {
94
+ if (key === 'variants') {
95
+ const variantFilter = this.filters?.find(f => f.type === FilterOptionTypes.VARIANTS);
96
+ for (const variantKey of Object.keys(data.variants || {})) {
97
+ const value = data.variants[variantKey];
98
+ const opt = variantFilter?.values?.find(o => (o.key || o.value) == value);
99
+ if (!opt)
100
+ continue;
101
+ chips.push({
102
+ key,
103
+ variantKey,
104
+ value,
105
+ type: FilterOptionTypes.VARIANTS,
106
+ groupLabel: variantFilter?.label,
107
+ optionLabel: opt.value,
108
+ });
109
+ }
110
+ continue;
111
+ }
112
+ const group = this.filters?.find(f => f.key === key);
113
+ if (!group)
114
+ continue;
115
+ const raw = data[key];
116
+ // RANGE (e.g. price) is stored as a { min, max } object
117
+ if (group.type === FilterOptionTypes.RANGE ||
118
+ (raw && typeof raw === 'object' && !Array.isArray(raw))) {
119
+ const min = raw.min;
120
+ const max = raw.max;
121
+ chips.push({
122
+ key,
123
+ value: raw,
124
+ type: FilterOptionTypes.RANGE,
125
+ groupLabel: group.label,
126
+ optionLabel: `${min} - ${max}`,
127
+ });
128
+ continue;
129
+ }
130
+ // the auto-appended base category (see filters::fetched) is page scoping, not a user
131
+ // selection — skip it. It's stored as a scalar; user selections are always arrays.
132
+ if (key === 'category_id' &&
133
+ !Array.isArray(raw) &&
134
+ salla.config.get('page.slug') == 'product.index' &&
135
+ raw == salla.config.get('page.id')) {
136
+ continue;
137
+ }
138
+ const values = Array.isArray(raw) ? raw : [raw];
139
+ for (const value of values) {
140
+ // rating values are bare numbers; everything else maps key -> value label
141
+ const opt = group.values?.find(o => (typeof o === 'number' ? o : o.key || o.value) == value);
142
+ const optionLabel = group.key === 'rating'
143
+ ? `${value}`
144
+ : opt && typeof opt !== 'number'
145
+ ? opt.value
146
+ : undefined;
147
+ if (optionLabel == null)
148
+ continue;
149
+ chips.push({ key, value, type: group.type, groupLabel: group.label, optionLabel });
150
+ }
151
+ }
152
+ return chips;
153
+ }
154
+ getFiltersElement() {
155
+ return document.querySelector('salla-filters');
156
+ }
157
+ removeFilter(chip) {
158
+ this.getFiltersElement()?.removeFilter(chip);
159
+ }
160
+ clearAll() {
161
+ this.getFiltersElement()?.resetFilters();
162
+ }
163
+ render() {
164
+ const chips = this.getAppliedFilters();
165
+ if (!chips.length) {
166
+ return null;
167
+ }
168
+ return (h(Host, { class: "s-applied-filters-wrapper" }, h("div", { class: "s-applied-filters-tags" }, chips.map(chip => (h("div", { class: "s-applied-filters-tag" }, h("span", { class: "s-applied-filters-tag-name" }, chip.groupLabel, ": ", chip.optionLabel), h("button", { type: "button", class: "s-applied-filters-tag-remove", "aria-label": `${this.removeLabel} ${chip.groupLabel}: ${chip.optionLabel}`, onClick: () => this.removeFilter(chip) }, h("i", { class: "sicon-cancel", "aria-hidden": "true" }))))), h("button", { type: "button", class: "s-applied-filters-clear-tag", onClick: () => this.clearAll() }, h("span", null, this.clearAllLabel)))));
169
+ }
170
+ static get style() { return sallaAppliedFiltersCss; }
171
+ }, [0, "salla-applied-filters", {
172
+ "filters": [32],
173
+ "filtersData": [32],
174
+ "clearAllLabel": [32],
175
+ "removeLabel": [32]
176
+ }]);
177
+ function defineCustomElement$1() {
178
+ if (typeof customElements === "undefined") {
179
+ return;
180
+ }
181
+ const components = ["salla-applied-filters"];
182
+ components.forEach(tagName => { switch (tagName) {
183
+ case "salla-applied-filters":
184
+ if (!customElements.get(tagName)) {
185
+ customElements.define(tagName, SallaAppliedFilters$1);
186
+ }
187
+ break;
188
+ } });
189
+ }
190
+ defineCustomElement$1();
191
+
192
+ const SallaAppliedFilters = SallaAppliedFilters$1;
193
+ const defineCustomElement = defineCustomElement$1;
194
+
195
+ export { SallaAppliedFilters, defineCustomElement };
@@ -2,30 +2,11 @@
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
5
- import { H as Helper } from './Helper.js';
5
+ import { F as FilterOptionTypes, H as Helper } from './Helper.js';
6
6
  import { d as defineCustomElement$3 } from './salla-button2.js';
7
7
  import { d as defineCustomElement$2 } from './salla-price-range2.js';
8
8
  import { d as defineCustomElement$1 } from './salla-rating-stars2.js';
9
9
 
10
- var FilterOptionTypes;
11
- (function (FilterOptionTypes) {
12
- // CATEGORIES = "categories",
13
- // BRANDs = "brands",
14
- // RATING = "rating",
15
- // PRICE = "price",
16
- // RADIO = "radio",
17
- FilterOptionTypes["VALUES"] = "values";
18
- FilterOptionTypes["VARIANTS"] = "variants";
19
- FilterOptionTypes["MINIMUM"] = "minimum";
20
- FilterOptionTypes["RANGE"] = "range";
21
- })(FilterOptionTypes || (FilterOptionTypes = {}));
22
- var FilterOptionInputType;
23
- (function (FilterOptionInputType) {
24
- FilterOptionInputType["VALUES"] = "values";
25
- FilterOptionInputType["VARIANT"] = "variants";
26
- FilterOptionInputType["RANGE"] = "range";
27
- })(FilterOptionInputType || (FilterOptionInputType = {}));
28
-
29
10
  const sallaFiltersWidgetCss = "/*!twlt*/:host{display:block}.collapse{visibility:collapse}.fixed{position:fixed}.hidden{display:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.duration-300{transition-duration:300ms}.s-filters-widget-container{display:block;overflow:hidden;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0.5rem}@media (min-width: 768px){.s-filters-widget-container{margin-bottom:1.25rem;padding-bottom:1.25rem;padding-top:1.25rem}}.s-filters-widget-content{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-opened{visibility:visible;opacity:1}.s-filters-widget-closed{visibility:hidden;height:0px !important;padding:0px;opacity:0}.s-filters-widget-title{display:flex;cursor:pointer;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:700}.s-filters-widget-arrow{font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-arrow svg{height:1.25rem;width:1.25rem}.s-filters-widget-active-arrow{--tw-rotate:90deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-filters-widget-values{overflow:hidden;padding-top:1rem;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-more{margin-top:0.5rem;display:block;cursor:pointer;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-filters-widget-plusminus{position:relative;height:0.75rem;width:0.75rem;--tw-rotate:90deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-filters-widget-plusminus::before{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus::after{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus-active:before{transform:translatey(-50%) rotate(-90deg);opacity:0}.s-filters-widget-plusminus-active:after{transform:translatey(-50%) rotate(0);background-color:var(--color-primary)}.s-filters-widget-plusminus:before{transform:translatey(-50%)}.s-filters-widget-plusminus:after{transform:translatey(-50%) rotate(90deg)}.s-filters-widget-search-input{width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding:0.5rem}.s-filters-widget-search-input:focus{border-color:var(--color-primary);outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary)}.s-filters-widget-empty-state{padding:0.5rem;text-align:center;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}";
30
11
 
31
12
  const SallaFiltersWidget = /*@__PURE__*/ proxyCustomElement(class SallaFiltersWidget extends HTMLElement {
@@ -252,4 +233,4 @@ function defineCustomElement() {
252
233
  }
253
234
  defineCustomElement();
254
235
 
255
- export { FilterOptionTypes as F, SallaFiltersWidget as S, defineCustomElement as d };
236
+ export { SallaFiltersWidget as S, defineCustomElement as d };
@@ -2,13 +2,13 @@
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
5
- import { d as defineCustomElement$4, F as FilterOptionTypes } from './salla-filters-widget2.js';
6
- import { H as Helper } from './Helper.js';
5
+ import { H as Helper, F as FilterOptionTypes } from './Helper.js';
7
6
  import { d as defineCustomElement$5 } from './salla-button2.js';
7
+ import { d as defineCustomElement$4 } from './salla-filters-widget2.js';
8
8
  import { d as defineCustomElement$3 } from './salla-price-range2.js';
9
9
  import { d as defineCustomElement$2 } from './salla-rating-stars2.js';
10
10
 
11
- const sallaFiltersCss = "/*!twlt*/:host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.s-filters-applied-remove{pointer-events:auto !important;cursor:pointer}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-filters-checkbox{height:1.25rem;width:1.25rem;border-radius:6px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-filters-checkbox:focus{--tw-ring-color:transparent}.s-filters-radio{position:relative;height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1)) !important;color:var(--color-primary)}.s-filters-radio:focus{--tw-ring-color:transparent}.s-filters-radio:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-right:0.75rem}.s-filters-radio:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-left:0.75rem}.s-filters-radio:checked{border-color:var(--color-primary)}.s-filters-radio:checked::after{position:absolute;left:0.125rem;top:0.125rem;display:block;height:0.625rem;width:0.625rem;border-radius:9999px;background-color:var(--color-primary);--tw-content:'';content:var(--tw-content)}.s-filters-radio:checked:hover{border-color:var(--color-primary)}.s-filters-radio:checked:focus{border-color:var(--color-primary)}.s-filters-label{position:relative;margin-bottom:0.75rem;display:flex;cursor:pointer;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-filters-label:last-child{margin-bottom:0px}.s-filters-option-name{margin-left:0.5rem;margin-right:0.5rem;--tw-text-opacity:1;color:rgb(129 127 127 / var(--tw-text-opacity, 1))}.s-filters-footer{margin-top:1rem;display:flex}.s-filters-footer salla-button{flex:1 1 0%}.s-filters-footer salla-button button{width:100%}.s-filters-applied-item{justify-content:space-between}.s-filters-applied-remove{cursor:pointer;border-width:0px;background-color:transparent;padding:0px;color:inherit}.s-filters-widget-container{display:block;overflow:hidden;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0.5rem}@media (min-width: 768px){.s-filters-widget-container{margin-bottom:1.25rem;padding-bottom:1.25rem;padding-top:1.25rem}}.s-filters-widget-content{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-opened{visibility:visible;opacity:1}.s-filters-widget-closed{visibility:hidden;height:0px !important;padding:0px;opacity:0}.s-filters-widget-title{display:flex;cursor:pointer;align-items:center;justify-content:space-between;font-size:1rem;line-height:1.5rem;font-weight:700}.s-filters-widget-values{overflow:hidden;padding-top:1rem;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-filters-widget-plusminus{position:relative;height:0.75rem;width:0.75rem;--tw-rotate:90deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-filters-widget-plusminus::before{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus::after{position:absolute;left:0px;top:50%;display:block;height:0.125rem;width:100%;--tw-bg-opacity:1;background-color:rgb(153 153 153 / var(--tw-bg-opacity, 1));transition-property:0.35s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-content:'';content:var(--tw-content)}.s-filters-widget-plusminus-active:before{transform:translatey(-50%) rotate(-90deg);opacity:0}.s-filters-widget-plusminus-active:after{transform:translatey(-50%) rotate(0);background-color:var(--color-primary)}.s-filters-widget-plusminus:before{transform:translatey(-50%)}.s-filters-widget-plusminus:after{transform:translatey(-50%) rotate(90deg)}";
11
+ const sallaFiltersCss = "/*!twlt*/:host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-filters-checkbox{height:1.25rem;width:1.25rem;border-radius:6px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-filters-checkbox:focus{--tw-ring-color:transparent}.s-filters-radio{position:relative;height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1)) !important;color:var(--color-primary)}.s-filters-radio:focus{--tw-ring-color:transparent}.s-filters-radio:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-right:0.75rem}.s-filters-radio:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-left:0.75rem}.s-filters-radio:checked{border-color:var(--color-primary)}.s-filters-radio:checked::after{position:absolute;left:0.125rem;top:0.125rem;display:block;height:0.625rem;width:0.625rem;border-radius:9999px;background-color:var(--color-primary);--tw-content:'';content:var(--tw-content)}.s-filters-radio:checked:hover{border-color:var(--color-primary)}.s-filters-radio:checked:focus{border-color:var(--color-primary)}.s-filters-label{position:relative;margin-bottom:0.75rem;display:flex;cursor:pointer;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-filters-label:last-child{margin-bottom:0px}.s-filters-option-name{margin-left:0.5rem;margin-right:0.5rem;--tw-text-opacity:1;color:rgb(129 127 127 / var(--tw-text-opacity, 1))}.s-filters-footer{margin-top:1rem;display:flex}.s-filters-footer salla-button{flex:1 1 0%}.s-filters-footer salla-button button{width:100%}";
12
12
 
13
13
  const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters extends HTMLElement {
14
14
  constructor() {
@@ -18,32 +18,15 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
18
18
  this.isReady = false; //to avoid triggering the changed event
19
19
  this.isInitialFetch = true; //the base-category auto-append may only run on the first filters::fetched
20
20
  this.filtersData = {};
21
- this.appliedOpen = true;
22
21
  salla.event.on('filters::hidden', () => this.host.style.display = 'none');
23
22
  salla.lang.onLoaded(() => {
24
23
  this.apply = salla.lang.get('pages.checkout.apply');
25
- this.reset = salla.lang.get('pages.categories.filters_reset');
26
- this.selectedTitle = salla.lang.getWithDefault('pages.categories.selected_filters', 'لقد اخترت');
27
24
  });
28
25
  salla.event.on('filters::fetched', ({ filters }) => {
29
26
  this.host.style.display = '';
30
27
  let freshFilterData = {};
31
- this.filters = filters
28
+ this.filters = Helper.resolveFilterLabels(filters)
32
29
  .map((filter) => {
33
- filter.label = {
34
- category_id: salla.lang.get('common.titles.categories'),
35
- brand_id: salla.lang.get('common.titles.brands'),
36
- rating: salla.lang.get('pages.categories.filter_rating'),
37
- price: salla.lang.get('pages.categories.filter_price'),
38
- }[filter.key] || filter.label;
39
- // filter.type = FilterOptionTypes.VALUES;
40
- if (filter.key == 'rating') {
41
- filter.type = FilterOptionTypes.VALUES;
42
- //@ts-ignore
43
- let { max, min } = filter.values;
44
- //@ts-ignore
45
- filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max);
46
- }
47
30
  if (this.filtersData.variants && filter.type == FilterOptionTypes.VARIANTS) {
48
31
  freshFilterData.variants = this.filtersData.variants;
49
32
  }
@@ -206,57 +189,12 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
206
189
  this.filtersData = { ...this.filtersData }; // reassign so @State re-renders the applied chips
207
190
  this.applyFilters();
208
191
  }
209
- /**
210
- * Flatten the selected filtersData into displayable chips, resolving the
211
- * human label for each group + option from `this.filters`. Selections that
212
- * can't be resolved to a known option (e.g. the auto-added base category)
213
- * are skipped.
214
- */
215
- getAppliedFilters() {
216
- const chips = [];
217
- const data = this.filtersData || {};
218
- for (const key of Object.keys(data)) {
219
- if (key === 'variants') {
220
- const variantFilter = this.filters?.find(f => f.type === FilterOptionTypes.VARIANTS);
221
- for (const variantKey of Object.keys(data.variants || {})) {
222
- const value = data.variants[variantKey];
223
- const opt = variantFilter?.values?.find(o => (o.key || o.value) == value);
224
- if (!opt)
225
- continue;
226
- chips.push({ key, variantKey, value, type: FilterOptionTypes.VARIANTS, groupLabel: variantFilter?.label, optionLabel: opt.value });
227
- }
228
- continue;
229
- }
230
- const group = this.filters?.find(f => f.key === key);
231
- if (!group)
232
- continue;
233
- const raw = data[key];
234
- // RANGE (e.g. price) is stored as a { min, max } object
235
- if (group.type === FilterOptionTypes.RANGE || (raw && typeof raw === 'object' && !Array.isArray(raw))) {
236
- chips.push({ key, value: raw, type: FilterOptionTypes.RANGE, groupLabel: group.label, optionLabel: `${raw.min} - ${raw.max}` });
237
- continue;
238
- }
239
- // the auto-appended base category (see filters::fetched) is page scoping, not a user
240
- // selection — skip it. It's stored as a scalar; user selections are always arrays.
241
- if (key === 'category_id' && !Array.isArray(raw) && salla.config.get('page.slug') == 'product.index' && raw == salla.config.get('page.id')) {
242
- continue;
243
- }
244
- const values = Array.isArray(raw) ? raw : [raw];
245
- for (const value of values) {
246
- // rating values are bare numbers; everything else maps key -> value label
247
- const opt = group.values?.find(o => (typeof o === 'number' ? o : (o.key || o.value)) == value);
248
- const optionLabel = group.key === 'rating' ? `${value}` : (opt && typeof opt !== 'number' ? opt.value : undefined);
249
- if (optionLabel == null)
250
- continue;
251
- chips.push({ key, value, type: group.type, groupLabel: group.label, optionLabel });
252
- }
253
- }
254
- return chips;
255
- }
256
192
  /**
257
193
  * Remove a single applied filter — the direct inverse of handleOptionChange.
194
+ * Public so salla-applied-filters (which owns the applied-chips UI) can
195
+ * drive removal on the live salla-filters element it reads chips from.
258
196
  */
259
- removeFilter(chip) {
197
+ async removeFilter(chip) {
260
198
  if (chip.type === FilterOptionTypes.VARIANTS) {
261
199
  if (this.filtersData.variants) {
262
200
  delete this.filtersData.variants[chip.variantKey];
@@ -282,9 +220,7 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
282
220
  this.applyFilters();
283
221
  }
284
222
  render() {
285
- const appliedFilters = this.getAppliedFilters();
286
- const removeText = salla.lang.getWithDefault('common.elements.delete', 'Remove');
287
- return h(Host, { key: 'f0493d0e85ebb9e6612a1edc6cd7f45e7473017e' }, appliedFilters.length ? h("div", { class: "s-filters-applied s-filters-widget-container" }, h("h3", { class: "s-filters-widget-title", onClick: () => this.appliedOpen = !this.appliedOpen }, h("span", null, this.selectedTitle), h("span", { class: `s-filters-widget-plusminus ${this.appliedOpen ? 's-filters-widget-plusminus-active' : ''}` })), h("div", { class: `s-filters-widget-content ${this.appliedOpen ? 's-filters-widget-opened' : 's-filters-widget-closed'}` }, h("div", { class: "s-filters-widget-values" }, appliedFilters.map(chip => h("div", { class: "s-filters-label s-filters-applied-item" }, h("span", { class: "s-filters-option-name" }, chip.groupLabel, ": ", chip.optionLabel), h("button", { type: "button", class: "s-filters-applied-remove", "aria-label": `${removeText} ${chip.groupLabel}: ${chip.optionLabel}`, onClick: () => this.removeFilter(chip) }, h("i", { class: "sicon-cancel", "aria-hidden": "true" }))))), h("div", { class: "s-filters-footer" }, h("salla-button", { color: 'gray', fill: 'outline', onClick: () => this.resetFilters() }, this.reset)))) : '', this.filters?.map(option => h("salla-filters-widget", { option: option, filtersData: this.filtersData, onChanged: ({ detail: { event, option, value } }) => {
223
+ return h(Host, { key: '32ede23f7fb3d9c7fbcd136ad2773e3212c2f5b8' }, this.filters?.map(option => h("salla-filters-widget", { option: option, filtersData: this.filtersData, onChanged: ({ detail: { event, option, value } }) => {
288
224
  this.handleOptionChange(event, option, value);
289
225
  } })));
290
226
  }
@@ -298,12 +234,10 @@ const SallaFilters$1 = /*@__PURE__*/ proxyCustomElement(class SallaFilters exten
298
234
  "isSidebarOpen": [32],
299
235
  "filtersData": [32],
300
236
  "apply": [32],
301
- "reset": [32],
302
- "selectedTitle": [32],
303
- "appliedOpen": [32],
304
237
  "getFilters": [64],
305
238
  "applyFilters": [64],
306
- "resetFilters": [64]
239
+ "resetFilters": [64],
240
+ "removeFilter": [64]
307
241
  }]);
308
242
  function defineCustomElement$1() {
309
243
  if (typeof customElements === "undefined") {
@@ -3,6 +3,25 @@
3
3
  */
4
4
  import { a as anime } from './anime.es-CgtvEd63.js';
5
5
 
6
+ var FilterOptionTypes;
7
+ (function (FilterOptionTypes) {
8
+ // CATEGORIES = "categories",
9
+ // BRANDs = "brands",
10
+ // RATING = "rating",
11
+ // PRICE = "price",
12
+ // RADIO = "radio",
13
+ FilterOptionTypes["VALUES"] = "values";
14
+ FilterOptionTypes["VARIANTS"] = "variants";
15
+ FilterOptionTypes["MINIMUM"] = "minimum";
16
+ FilterOptionTypes["RANGE"] = "range";
17
+ })(FilterOptionTypes || (FilterOptionTypes = {}));
18
+ var FilterOptionInputType;
19
+ (function (FilterOptionInputType) {
20
+ FilterOptionInputType["VALUES"] = "values";
21
+ FilterOptionInputType["VARIANT"] = "variants";
22
+ FilterOptionInputType["RANGE"] = "range";
23
+ })(FilterOptionInputType || (FilterOptionInputType = {}));
24
+
6
25
  //TODO::reduce it to 10
7
26
  salla.event.setMaxListeners(100);
8
27
  class Helper {
@@ -139,6 +158,33 @@ class Helper {
139
158
  });
140
159
  return filters;
141
160
  }
161
+ /**
162
+ * Resolve i18n labels for the known filter groups (category/brand/rating/price)
163
+ * and normalize the `rating` group's `{min,max}` values into a plain 1-5 star
164
+ * array. Shared by salla-filters (the filter panel) and salla-applied-filters
165
+ * (the applied chips) so both agree on the same group labels. Returns shallow
166
+ * copies rather than mutating in place, since both components receive the
167
+ * same `filters::fetched` payload by reference.
168
+ */
169
+ resolveFilterLabels(filters) {
170
+ return filters.map((filter) => {
171
+ const resolved = { ...filter };
172
+ resolved.label = {
173
+ category_id: salla.lang.get('common.titles.categories'),
174
+ brand_id: salla.lang.get('common.titles.brands'),
175
+ rating: salla.lang.get('pages.categories.filter_rating'),
176
+ price: salla.lang.get('pages.categories.filter_price'),
177
+ }[resolved.key] || resolved.label;
178
+ if (resolved.key == 'rating') {
179
+ resolved.type = FilterOptionTypes.VALUES;
180
+ //@ts-ignore
181
+ const { max, min } = filter.values;
182
+ //@ts-ignore
183
+ resolved.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max);
184
+ }
185
+ return resolved;
186
+ });
187
+ }
142
188
  async injectExtraFieldsToResponse(response) {
143
189
  if (!response || !this.includes)
144
190
  return response;
@@ -472,4 +518,4 @@ class Helper {
472
518
  }
473
519
  var Helper$1 = new Helper;
474
520
 
475
- export { Helper$1 as H };
521
+ export { FilterOptionTypes as F, Helper$1 as H };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-C0qiFNJn.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BsIeN-bg.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-C0qiFNJn.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BsIeN-bg.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-C0qiFNJn.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BsIeN-bg.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-C0qiFNJn.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BsIeN-bg.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-C0qiFNJn.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BsIeN-bg.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-C0qiFNJn.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BsIeN-bg.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-C0qiFNJn.js';
4
+ import { d as getDefaultExportFromCjs } from './index-BsIeN-bg.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {