hemfixarna-web-components 1.6.3 → 1.7.0

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 (261) hide show
  1. package/dist/cjs/{hemfixarna-address_36.cjs.entry.js → hemfixarna-address_15.cjs.entry.js} +341 -1030
  2. package/dist/cjs/hemfixarna-address_15.cjs.entry.js.map +1 -0
  3. package/dist/cjs/hemfixarna-byggmax.cjs.entry.js +26 -0
  4. package/dist/cjs/hemfixarna-byggmax.cjs.entry.js.map +1 -0
  5. package/dist/cjs/hemfixarna-category.cjs.entry.js +28 -0
  6. package/dist/cjs/hemfixarna-category.cjs.entry.js.map +1 -0
  7. package/dist/cjs/hemfixarna-components.cjs.js +1 -1
  8. package/dist/cjs/hemfixarna-components.cjs.js.map +1 -1
  9. package/dist/cjs/hemfixarna-doro.cjs.entry.js +26 -0
  10. package/dist/cjs/hemfixarna-doro.cjs.entry.js.map +1 -0
  11. package/dist/cjs/hemfixarna-elfa.cjs.entry.js +26 -0
  12. package/dist/cjs/hemfixarna-elfa.cjs.entry.js.map +1 -0
  13. package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js +23 -0
  14. package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js.map +1 -0
  15. package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js +23 -0
  16. package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js.map +1 -0
  17. package/dist/cjs/hemfixarna-forebygg.cjs.entry.js +26 -0
  18. package/dist/cjs/hemfixarna-forebygg.cjs.entry.js.map +1 -0
  19. package/dist/cjs/hemfixarna-hornbach.cjs.entry.js +26 -0
  20. package/dist/cjs/hemfixarna-hornbach.cjs.entry.js.map +1 -0
  21. package/dist/cjs/hemfixarna-kbygg.cjs.entry.js +23 -0
  22. package/dist/cjs/hemfixarna-kbygg.cjs.entry.js.map +1 -0
  23. package/dist/cjs/hemfixarna-klint.cjs.entry.js +23 -0
  24. package/dist/cjs/hemfixarna-klint.cjs.entry.js.map +1 -0
  25. package/dist/cjs/hemfixarna-kund.cjs.entry.js +23 -0
  26. package/dist/cjs/hemfixarna-kund.cjs.entry.js.map +1 -0
  27. package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js +23 -0
  28. package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js.map +1 -0
  29. package/dist/cjs/hemfixarna-power.cjs.entry.js +23 -0
  30. package/dist/cjs/hemfixarna-power.cjs.entry.js.map +1 -0
  31. package/dist/cjs/hemfixarna-service.cjs.entry.js +24 -0
  32. package/dist/cjs/hemfixarna-service.cjs.entry.js.map +1 -0
  33. package/dist/cjs/hemfixarna-skanska.cjs.entry.js +26 -0
  34. package/dist/cjs/hemfixarna-skanska.cjs.entry.js.map +1 -0
  35. package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js +23 -0
  36. package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js.map +1 -0
  37. package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js +26 -0
  38. package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js.map +1 -0
  39. package/dist/cjs/hemfixarna-superfront.cjs.entry.js +24 -0
  40. package/dist/cjs/hemfixarna-superfront.cjs.entry.js.map +1 -0
  41. package/dist/cjs/hemfixarna-tesla.cjs.entry.js +23 -0
  42. package/dist/cjs/hemfixarna-tesla.cjs.entry.js.map +1 -0
  43. package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js +23 -0
  44. package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js.map +1 -0
  45. package/dist/cjs/hemfixarna-zaptec.cjs.entry.js +23 -0
  46. package/dist/cjs/hemfixarna-zaptec.cjs.entry.js.map +1 -0
  47. package/dist/cjs/index-4695c475.js +258 -0
  48. package/dist/cjs/index-4695c475.js.map +1 -0
  49. package/dist/cjs/index-8054ce93.js +42 -0
  50. package/dist/cjs/index-8054ce93.js.map +1 -0
  51. package/dist/cjs/index-b83343b9.js.map +1 -1
  52. package/dist/cjs/loader.cjs.js +1 -1
  53. package/dist/cjs/loader.cjs.js.map +1 -1
  54. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js +2 -82
  55. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js.map +1 -1
  56. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js +1 -20
  57. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js.map +1 -1
  58. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js +1 -39
  59. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +1 -1
  60. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +1 -39
  61. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +1 -1
  62. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js +1 -39
  63. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js.map +1 -1
  64. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js +1 -20
  65. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js.map +1 -1
  66. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js +1 -39
  67. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -1
  68. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +1 -39
  69. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +1 -1
  70. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js +1 -20
  71. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js.map +1 -1
  72. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js +1 -20
  73. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +1 -1
  74. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +1 -39
  75. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +1 -1
  76. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +1 -38
  77. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +1 -1
  78. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js +1 -38
  79. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -1
  80. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js +1 -38
  81. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js.map +1 -1
  82. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js +1 -20
  83. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js.map +1 -1
  84. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js +1 -1
  85. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js.map +1 -1
  86. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js +1 -39
  87. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js.map +1 -1
  88. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +1 -20
  89. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -1
  90. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js +1 -39
  91. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js.map +1 -1
  92. package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js +1 -60
  93. package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +1 -1
  94. package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js +1 -28
  95. package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js.map +1 -1
  96. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +27 -236
  97. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -1
  98. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +75 -39
  99. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
  100. package/dist/collection/components/hemfixarna-info/hemfixarna-info.js +2 -2
  101. package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +1 -1
  102. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js +2 -1
  103. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js.map +1 -1
  104. package/dist/collection/components/hemfixarna-order/hemfixarna-order.js +1 -26
  105. package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -1
  106. package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js +7 -41
  107. package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js.map +1 -1
  108. package/dist/collection/types/index.js +4 -0
  109. package/dist/collection/types/index.js.map +1 -1
  110. package/dist/collection/utils/api.js +18 -2
  111. package/dist/collection/utils/api.js.map +1 -1
  112. package/dist/collection/utils/creditSafe.js +2 -2
  113. package/dist/collection/utils/creditSafe.js.map +1 -1
  114. package/dist/collection/utils/enviroment.js +31 -0
  115. package/dist/collection/utils/enviroment.js.map +1 -0
  116. package/dist/collection/utils/felixApi.js +2 -1
  117. package/dist/collection/utils/felixApi.js.map +1 -1
  118. package/dist/collection/utils/felixFunctions.js +0 -1
  119. package/dist/collection/utils/felixFunctions.js.map +1 -1
  120. package/dist/esm/{hemfixarna-address_36.entry.js → hemfixarna-address_15.entry.js} +150 -818
  121. package/dist/esm/hemfixarna-address_15.entry.js.map +1 -0
  122. package/dist/esm/hemfixarna-byggmax.entry.js +22 -0
  123. package/dist/esm/hemfixarna-byggmax.entry.js.map +1 -0
  124. package/dist/esm/hemfixarna-category.entry.js +24 -0
  125. package/dist/esm/hemfixarna-category.entry.js.map +1 -0
  126. package/dist/esm/hemfixarna-components.js +3 -3
  127. package/dist/esm/hemfixarna-components.js.map +1 -1
  128. package/dist/esm/hemfixarna-doro.entry.js +22 -0
  129. package/dist/esm/hemfixarna-doro.entry.js.map +1 -0
  130. package/dist/esm/hemfixarna-elfa.entry.js +22 -0
  131. package/dist/esm/hemfixarna-elfa.entry.js.map +1 -0
  132. package/dist/esm/hemfixarna-fargvaruhuset.entry.js +19 -0
  133. package/dist/esm/hemfixarna-fargvaruhuset.entry.js.map +1 -0
  134. package/dist/esm/hemfixarna-flyttsmart.entry.js +19 -0
  135. package/dist/esm/hemfixarna-flyttsmart.entry.js.map +1 -0
  136. package/dist/esm/hemfixarna-forebygg.entry.js +22 -0
  137. package/dist/esm/hemfixarna-forebygg.entry.js.map +1 -0
  138. package/dist/esm/hemfixarna-hornbach.entry.js +22 -0
  139. package/dist/esm/hemfixarna-hornbach.entry.js.map +1 -0
  140. package/dist/esm/hemfixarna-kbygg.entry.js +19 -0
  141. package/dist/esm/hemfixarna-kbygg.entry.js.map +1 -0
  142. package/dist/esm/hemfixarna-klint.entry.js +19 -0
  143. package/dist/esm/hemfixarna-klint.entry.js.map +1 -0
  144. package/dist/esm/hemfixarna-kund.entry.js +19 -0
  145. package/dist/esm/hemfixarna-kund.entry.js.map +1 -0
  146. package/dist/esm/hemfixarna-norrgavel.entry.js +19 -0
  147. package/dist/esm/hemfixarna-norrgavel.entry.js.map +1 -0
  148. package/dist/esm/hemfixarna-power.entry.js +19 -0
  149. package/dist/esm/hemfixarna-power.entry.js.map +1 -0
  150. package/dist/esm/hemfixarna-service.entry.js +20 -0
  151. package/dist/esm/hemfixarna-service.entry.js.map +1 -0
  152. package/dist/esm/hemfixarna-skanska.entry.js +22 -0
  153. package/dist/esm/hemfixarna-skanska.entry.js.map +1 -0
  154. package/dist/esm/hemfixarna-sparfonster.entry.js +19 -0
  155. package/dist/esm/hemfixarna-sparfonster.entry.js.map +1 -0
  156. package/dist/esm/hemfixarna-string-furniture.entry.js +22 -0
  157. package/dist/esm/hemfixarna-string-furniture.entry.js.map +1 -0
  158. package/dist/esm/hemfixarna-superfront.entry.js +20 -0
  159. package/dist/esm/hemfixarna-superfront.entry.js.map +1 -0
  160. package/dist/esm/hemfixarna-tesla.entry.js +19 -0
  161. package/dist/esm/hemfixarna-tesla.entry.js.map +1 -0
  162. package/dist/esm/hemfixarna-traningspartner.entry.js +19 -0
  163. package/dist/esm/hemfixarna-traningspartner.entry.js.map +1 -0
  164. package/dist/esm/hemfixarna-zaptec.entry.js +19 -0
  165. package/dist/esm/hemfixarna-zaptec.entry.js.map +1 -0
  166. package/dist/esm/{index-8c417125.js → index-04bcf90e.js} +2 -2
  167. package/dist/esm/index-04bcf90e.js.map +1 -0
  168. package/dist/esm/index-113a6b21.js +256 -0
  169. package/dist/esm/index-113a6b21.js.map +1 -0
  170. package/dist/esm/index-1fbc7a74.js +42 -0
  171. package/dist/esm/index-1fbc7a74.js.map +1 -0
  172. package/dist/esm/loader.js +3 -3
  173. package/dist/esm/loader.js.map +1 -1
  174. package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
  175. package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
  176. package/dist/hemfixarna-components/p-12dbf4e6.entry.js +2 -0
  177. package/dist/hemfixarna-components/p-12dbf4e6.entry.js.map +1 -0
  178. package/dist/hemfixarna-components/p-1b80999e.entry.js +2 -0
  179. package/dist/hemfixarna-components/p-1b80999e.entry.js.map +1 -0
  180. package/dist/hemfixarna-components/p-1f875c7a.entry.js +2 -0
  181. package/dist/hemfixarna-components/p-1f875c7a.entry.js.map +1 -0
  182. package/dist/hemfixarna-components/{p-852e7173.js → p-32a8152b.js} +2 -2
  183. package/dist/hemfixarna-components/p-32a8152b.js.map +1 -0
  184. package/dist/hemfixarna-components/p-3acd1346.entry.js +2 -0
  185. package/dist/hemfixarna-components/p-3acd1346.entry.js.map +1 -0
  186. package/dist/hemfixarna-components/p-53afbc10.entry.js +2 -0
  187. package/dist/hemfixarna-components/p-53afbc10.entry.js.map +1 -0
  188. package/dist/hemfixarna-components/p-53f0abfa.entry.js +2 -0
  189. package/dist/hemfixarna-components/p-53f0abfa.entry.js.map +1 -0
  190. package/dist/hemfixarna-components/p-61b4597f.entry.js +2 -0
  191. package/dist/hemfixarna-components/p-61b4597f.entry.js.map +1 -0
  192. package/dist/hemfixarna-components/p-6c1d21dd.entry.js +2 -0
  193. package/dist/hemfixarna-components/p-6c1d21dd.entry.js.map +1 -0
  194. package/dist/hemfixarna-components/p-6f6601b8.entry.js +2 -0
  195. package/dist/hemfixarna-components/p-6f6601b8.entry.js.map +1 -0
  196. package/dist/hemfixarna-components/p-7c122f15.entry.js +2 -0
  197. package/dist/hemfixarna-components/p-7c122f15.entry.js.map +1 -0
  198. package/dist/hemfixarna-components/p-8356796a.entry.js +2 -0
  199. package/dist/hemfixarna-components/p-8356796a.entry.js.map +1 -0
  200. package/dist/hemfixarna-components/p-8d509bf1.entry.js +2 -0
  201. package/dist/hemfixarna-components/p-8d509bf1.entry.js.map +1 -0
  202. package/dist/hemfixarna-components/p-8f0a688c.entry.js +2 -0
  203. package/dist/hemfixarna-components/p-8f0a688c.entry.js.map +1 -0
  204. package/dist/hemfixarna-components/p-9b1e6bc2.entry.js +2 -0
  205. package/dist/hemfixarna-components/p-9b1e6bc2.entry.js.map +1 -0
  206. package/dist/hemfixarna-components/p-a3d759d9.js +2 -0
  207. package/dist/hemfixarna-components/p-a3d759d9.js.map +1 -0
  208. package/dist/hemfixarna-components/p-a9845efc.entry.js +2 -0
  209. package/dist/hemfixarna-components/p-a9845efc.entry.js.map +1 -0
  210. package/dist/hemfixarna-components/p-ae3fc85c.entry.js +2 -0
  211. package/dist/hemfixarna-components/p-ae3fc85c.entry.js.map +1 -0
  212. package/dist/hemfixarna-components/p-b6bc1537.entry.js +2 -0
  213. package/dist/hemfixarna-components/p-b6bc1537.entry.js.map +1 -0
  214. package/dist/hemfixarna-components/p-cb1634e8.entry.js +2 -0
  215. package/dist/hemfixarna-components/p-cb1634e8.entry.js.map +1 -0
  216. package/dist/hemfixarna-components/p-cfdc93e9.js +2 -0
  217. package/dist/hemfixarna-components/p-cfdc93e9.js.map +1 -0
  218. package/dist/hemfixarna-components/p-dabad8a7.entry.js +2 -0
  219. package/dist/hemfixarna-components/p-dabad8a7.entry.js.map +1 -0
  220. package/dist/hemfixarna-components/p-dfcefa54.entry.js +2 -0
  221. package/dist/hemfixarna-components/p-dfcefa54.entry.js.map +1 -0
  222. package/dist/hemfixarna-components/p-e0aad0ff.entry.js +2 -0
  223. package/dist/hemfixarna-components/p-e0aad0ff.entry.js.map +1 -0
  224. package/dist/hemfixarna-components/p-edac9f21.entry.js +2 -0
  225. package/dist/hemfixarna-components/p-edac9f21.entry.js.map +1 -0
  226. package/dist/types/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.d.ts +1 -6
  227. package/dist/types/components/customers/hemfixarna-doro/hemfixarna-doro.d.ts +0 -1
  228. package/dist/types/components/customers/hemfixarna-elfa/hemfixarna-elfa.d.ts +0 -2
  229. package/dist/types/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.d.ts +0 -2
  230. package/dist/types/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.d.ts +0 -2
  231. package/dist/types/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.d.ts +0 -1
  232. package/dist/types/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.d.ts +0 -2
  233. package/dist/types/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.d.ts +0 -2
  234. package/dist/types/components/customers/hemfixarna-klint/hemfixarna-klint.d.ts +0 -1
  235. package/dist/types/components/customers/hemfixarna-kund/hemfixarna-kund.d.ts +0 -1
  236. package/dist/types/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.d.ts +0 -2
  237. package/dist/types/components/customers/hemfixarna-power/hemfixarna-power.d.ts +0 -2
  238. package/dist/types/components/customers/hemfixarna-skanska/hemfixarna-skanska.d.ts +0 -2
  239. package/dist/types/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.d.ts +0 -2
  240. package/dist/types/components/customers/hemfixarna-string/hemfixarna-string-furniture.d.ts +0 -1
  241. package/dist/types/components/customers/hemfixarna-tesla/hemfixarna-tesla.d.ts +0 -2
  242. package/dist/types/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.d.ts +0 -1
  243. package/dist/types/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.d.ts +0 -2
  244. package/dist/types/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.d.ts +0 -4
  245. package/dist/types/components/hemfixarna-cart/hemfixarna-cart.d.ts +0 -2
  246. package/dist/types/components/hemfixarna-component/hemfixarna-component.d.ts +2 -18
  247. package/dist/types/components/hemfixarna-demo/hemfixarna-demo.d.ts +4 -2
  248. package/dist/types/components/hemfixarna-order/hemfixarna-order.d.ts +0 -2
  249. package/dist/types/components/hemfixarna-orderrows/hemfixarna-orderrows.d.ts +1 -2
  250. package/dist/types/components.d.ts +2 -100
  251. package/dist/types/types/index.d.ts +24 -22
  252. package/dist/types/utils/api.d.ts +5 -1
  253. package/dist/types/utils/enviroment.d.ts +3 -0
  254. package/package.json +4 -3
  255. package/readme.md +22 -0
  256. package/dist/cjs/hemfixarna-address_36.cjs.entry.js.map +0 -1
  257. package/dist/esm/hemfixarna-address_36.entry.js.map +0 -1
  258. package/dist/esm/index-8c417125.js.map +0 -1
  259. package/dist/hemfixarna-components/p-852e7173.js.map +0 -1
  260. package/dist/hemfixarna-components/p-97461831.entry.js +0 -2
  261. package/dist/hemfixarna-components/p-97461831.entry.js.map +0 -1
@@ -7,10 +7,7 @@ export class HemfixarnaBreadcrumbs {
7
7
  const el = this.el.nextSibling;
8
8
  scrollToTop(el);
9
9
  };
10
- this.tree = undefined;
11
10
  this.closeModal = undefined;
12
- this.loadFromQuery = false;
13
- this.isDemo = false;
14
11
  }
15
12
  getCartLength() {
16
13
  return state.cart.reduce((acc, curr) => acc + curr.amount, 0);
@@ -39,7 +36,7 @@ export class HemfixarnaBreadcrumbs {
39
36
  const close = getAssetPath(`./assets/close.svg`);
40
37
  const cart = getAssetPath(`./assets/cart.svg`);
41
38
  const back = getAssetPath(`./assets/back.svg`);
42
- return (h("div", null, h("div", { class: "hemfixarna_crumbs" }, h("div", { class: "hemfixarna_crumbs--links" }, h("img", { onClick: () => this.handleHomePageClick(), src: logo, width: 110 }), !this.loadFromQuery || this.isDemo ? h("img", { onClick: () => this.closeModal(), class: "close", src: close, width: 32 }) : null, h("div", null, h("button", { onClick: () => this.handleHomePageClick() }, "Alla tj\u00E4nster"))), h("div", { class: "hemfixarna_crumbs--right" }, h("hemfixarna-contact", null), h("div", { onClick: () => this.handleCartClick(), class: `cart ${this.getCartLength() > 0 ? 'cart_active' : ''}` }, h("img", { src: cart, width: 24 }), h("span", null, this.getCartLength())))), [3, 4].includes(state.step) && !state.customer && (h("button", { class: "hemfixarna_crumbs--back", onClick: () => {
39
+ return (h("div", null, h("div", { class: "hemfixarna_crumbs" }, h("div", { class: "hemfixarna_crumbs--links" }, h("img", { onClick: () => this.handleHomePageClick(), src: logo, width: 110 }), h("img", { onClick: () => this.closeModal(), class: "close", src: close, width: 32 }), h("div", null, h("button", { onClick: () => this.handleHomePageClick() }, "Alla tj\u00E4nster"))), h("div", { class: "hemfixarna_crumbs--right" }, h("hemfixarna-contact", null), h("div", { onClick: () => this.handleCartClick(), class: `cart ${this.getCartLength() > 0 ? 'cart_active' : ''}` }, h("img", { src: cart, width: 24 }), h("span", null, this.getCartLength())))), [3, 4].includes(state.step) && !state.customer && (h("button", { class: "hemfixarna_crumbs--back", onClick: () => {
43
40
  state.step = state.step === 4 ? 3 : 2;
44
41
  } }, h("img", { width: 24, src: back, alt: "back arrow" }), h("span", null, "Se allt ", state.step === 4 ? state.selectedService.post_title : state.selectedCategory.name))), !state.parentCategory && state.step && state.selectedCustomerCategory && (h("button", { class: "hemfixarna_crumbs--back", onClick: () => {
45
42
  state.step = 1;
@@ -56,26 +53,6 @@ export class HemfixarnaBreadcrumbs {
56
53
  static get is() { return "hemfixarna-breadcrumbs"; }
57
54
  static get properties() {
58
55
  return {
59
- "tree": {
60
- "type": "unknown",
61
- "mutable": false,
62
- "complexType": {
63
- "original": "Category",
64
- "resolved": "Category",
65
- "references": {
66
- "Category": {
67
- "location": "import",
68
- "path": "../../types"
69
- }
70
- }
71
- },
72
- "required": false,
73
- "optional": false,
74
- "docs": {
75
- "tags": [],
76
- "text": ""
77
- }
78
- },
79
56
  "closeModal": {
80
57
  "type": "unknown",
81
58
  "mutable": false,
@@ -90,42 +67,6 @@ export class HemfixarnaBreadcrumbs {
90
67
  "tags": [],
91
68
  "text": ""
92
69
  }
93
- },
94
- "loadFromQuery": {
95
- "type": "boolean",
96
- "mutable": false,
97
- "complexType": {
98
- "original": "boolean",
99
- "resolved": "boolean",
100
- "references": {}
101
- },
102
- "required": false,
103
- "optional": false,
104
- "docs": {
105
- "tags": [],
106
- "text": ""
107
- },
108
- "attribute": "load-from-query",
109
- "reflect": false,
110
- "defaultValue": "false"
111
- },
112
- "isDemo": {
113
- "type": "boolean",
114
- "mutable": false,
115
- "complexType": {
116
- "original": "boolean",
117
- "resolved": "boolean",
118
- "references": {}
119
- },
120
- "required": false,
121
- "optional": false,
122
- "docs": {
123
- "tags": [],
124
- "text": ""
125
- },
126
- "attribute": "is-demo",
127
- "reflect": false,
128
- "defaultValue": "false"
129
70
  }
130
71
  };
131
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"hemfixarna-breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,qBAAqB;;IAWhC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from '../../store';\nimport { Category } from '../../types';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-breadcrumbs',\n shadow: false,\n})\nexport class HemfixarnaBreadcrumbs {\n @Prop() tree: Category;\n @Prop() closeModal: () => void;\n @Prop() loadFromQuery: boolean = false;\n @Prop() isDemo: boolean = false;\n @Element() private el: HTMLElement;\n\n getCartLength() {\n return state.cart.reduce((acc, curr) => acc + curr.amount, 0);\n }\n\n triggerScrollTotop = () => {\n const el = this.el.nextSibling as HTMLElement;\n scrollToTop(el);\n };\n\n handleCartClick() {\n if (state.cart?.length) {\n state.step = 5;\n this.triggerScrollTotop();\n }\n }\n\n handleHomePageClick() {\n state.step = 1;\n state.parentCategory = null;\n state.selectedCustomerCategory = null;\n this.triggerScrollTotop();\n setTimeout(() => {\n state.selectedCategory = null;\n state.selectedProduct = null;\n state.maleri = null;\n state.selectedService = null;\n }, 200);\n }\n\n render() {\n const logo = getAssetPath(`./assets/hemfixarna.svg`);\n const close = getAssetPath(`./assets/close.svg`);\n const cart = getAssetPath(`./assets/cart.svg`);\n const back = getAssetPath(`./assets/back.svg`);\n\n return (\n <div>\n <div class=\"hemfixarna_crumbs\">\n <div class=\"hemfixarna_crumbs--links\">\n <img onClick={() => this.handleHomePageClick()} src={logo} width={110} />\n {!this.loadFromQuery || this.isDemo ? <img onClick={() => this.closeModal()} class=\"close\" src={close} width={32} /> : null}\n <div>\n <button onClick={() => this.handleHomePageClick()}>Alla tjänster</button>\n </div>\n </div>\n <div class=\"hemfixarna_crumbs--right\">\n <hemfixarna-contact></hemfixarna-contact>\n <div onClick={() => this.handleCartClick()} class={`cart ${this.getCartLength() > 0 ? 'cart_active' : ''}`}>\n <img src={cart} width={24} />\n <span>{this.getCartLength()}</span>\n </div>\n </div>\n </div>\n {[3, 4].includes(state.step) && !state.customer && (\n <button\n class=\"hemfixarna_crumbs--back\"\n onClick={() => {\n state.step = state.step === 4 ? 3 : 2;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n <span>Se allt {state.step === 4 ? state.selectedService.post_title : state.selectedCategory.name}</span>\n </button>\n )}\n {!state.parentCategory && state.step && state.selectedCustomerCategory && (\n <button\n class=\"hemfixarna_crumbs--back\"\n onClick={() => {\n state.step = 1;\n state.selectedCustomerCategory = null;\n state.selectedProduct = null;\n state.maleri = null;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n <span>Se alla tjänster</span>\n </button>\n )}\n {state.parentCategory && state.step < 5 && (\n <button\n class=\"hemfixarna_crumbs--back\"\n onClick={() => {\n state.step = 1;\n state.selectedCustomerCategory = state.parentCategory;\n state.selectedProduct = null;\n state.maleri = null;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n <span>Se allt {state.parentCategory.name}</span>\n </button>\n )}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"hemfixarna-breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,qBAAqB;;IAQhC,uBAAkB,GAAG,GAAG,EAAE;MACxB,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,WAA0B,CAAC;MAC9C,WAAW,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC;;;EAPF,aAAa;IACX,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;EAChE,CAAC;EAOD,eAAe;;IACb,IAAI,MAAA,KAAK,CAAC,IAAI,0CAAE,MAAM,EAAE;MACtB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E,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,YAAY,GAAG;QAC9C,wCAA6B,CACtB,CACV;MACA,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,CACzC,cACE,KAAK,EAAC,yBAAyB,EAC/B,OAAO,EAAE,GAAG,EAAE;UACZ,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;UACf,KAAK,CAAC,wBAAwB,GAAG,KAAK,CAAC,cAAc,CAAC;UACtD,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;UAC7B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACtB,CAAC;QAED,WAAK,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,YAAY,GAAG;QAC9C;;UAAe,KAAK,CAAC,cAAc,CAAC,IAAI,CAAQ,CACzC,CACV,CACG,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Prop, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-breadcrumbs',\n shadow: false,\n})\nexport class HemfixarnaBreadcrumbs {\n @Prop() closeModal: () => void;\n @Element() private el: HTMLElement;\n\n getCartLength() {\n return state.cart.reduce((acc, curr) => acc + curr.amount, 0);\n }\n\n triggerScrollTotop = () => {\n const el = this.el.nextSibling as HTMLElement;\n scrollToTop(el);\n };\n\n handleCartClick() {\n if (state.cart?.length) {\n state.step = 5;\n this.triggerScrollTotop();\n }\n }\n\n handleHomePageClick() {\n state.step = 1;\n state.parentCategory = null;\n state.selectedCustomerCategory = null;\n this.triggerScrollTotop();\n setTimeout(() => {\n state.selectedCategory = null;\n state.selectedProduct = null;\n state.maleri = null;\n state.selectedService = null;\n }, 200);\n }\n\n render() {\n const logo = getAssetPath(`./assets/hemfixarna.svg`);\n const close = getAssetPath(`./assets/close.svg`);\n const cart = getAssetPath(`./assets/cart.svg`);\n const back = getAssetPath(`./assets/back.svg`);\n\n return (\n <div>\n <div class=\"hemfixarna_crumbs\">\n <div class=\"hemfixarna_crumbs--links\">\n <img onClick={() => this.handleHomePageClick()} src={logo} width={110} />\n <img onClick={() => this.closeModal()} class=\"close\" src={close} width={32} />\n <div>\n <button onClick={() => this.handleHomePageClick()}>Alla tjänster</button>\n </div>\n </div>\n <div class=\"hemfixarna_crumbs--right\">\n <hemfixarna-contact></hemfixarna-contact>\n <div onClick={() => this.handleCartClick()} class={`cart ${this.getCartLength() > 0 ? 'cart_active' : ''}`}>\n <img src={cart} width={24} />\n <span>{this.getCartLength()}</span>\n </div>\n </div>\n </div>\n {[3, 4].includes(state.step) && !state.customer && (\n <button\n class=\"hemfixarna_crumbs--back\"\n onClick={() => {\n state.step = state.step === 4 ? 3 : 2;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n <span>Se allt {state.step === 4 ? state.selectedService.post_title : state.selectedCategory.name}</span>\n </button>\n )}\n {!state.parentCategory && state.step && state.selectedCustomerCategory && (\n <button\n class=\"hemfixarna_crumbs--back\"\n onClick={() => {\n state.step = 1;\n state.selectedCustomerCategory = null;\n state.selectedProduct = null;\n state.maleri = null;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n <span>Se alla tjänster</span>\n </button>\n )}\n {state.parentCategory && state.step < 5 && (\n <button\n class=\"hemfixarna_crumbs--back\"\n onClick={() => {\n state.step = 1;\n state.selectedCustomerCategory = state.parentCategory;\n state.selectedProduct = null;\n state.maleri = null;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n <span>Se allt {state.parentCategory.name}</span>\n </button>\n )}\n </div>\n );\n }\n}\n"]}
@@ -1,41 +1,14 @@
1
1
  import { getAssetPath, h } from '@stencil/core';
2
2
  import state from '../../store';
3
3
  export class HemfixarnaCart {
4
- constructor() {
5
- this.tree = undefined;
6
- }
7
4
  render() {
8
5
  const back = getAssetPath(`./assets/back.svg`);
9
6
  return (h("div", { class: "hemfixarna_cart" }, h("div", { class: "hemfixarna_cart--left" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
10
7
  state.checkoutStep = 1;
11
- } }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Din bokning"), h("hemfixarna-orderrows", { tree: this.tree })), h("div", { class: "hemfixarna_cart--right" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
8
+ } }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Din bokning"), h("hemfixarna-orderrows", null)), h("div", { class: "hemfixarna_cart--right" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
12
9
  state.checkoutStep = 1;
13
10
  } }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Dina uppgifter"), h("hemfixarna-checkout", null), h("hemfixarna-info", null))));
14
11
  }
15
12
  static get is() { return "hemfixarna-cart"; }
16
- static get properties() {
17
- return {
18
- "tree": {
19
- "type": "unknown",
20
- "mutable": false,
21
- "complexType": {
22
- "original": "Category",
23
- "resolved": "Category",
24
- "references": {
25
- "Category": {
26
- "location": "import",
27
- "path": "../../types"
28
- }
29
- }
30
- },
31
- "required": false,
32
- "optional": false,
33
- "docs": {
34
- "tags": [],
35
- "text": ""
36
- }
37
- }
38
- };
39
- }
40
13
  }
41
14
  //# sourceMappingURL=hemfixarna-cart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hemfixarna-cart.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-cart/hemfixarna-cart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,MAAM,aAAa,CAAC;AAOhC,MAAM,OAAO,cAAc;;;;EAGzB,MAAM;IACJ,MAAM,IAAI,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAE/C,OAAO,CACL,WAAK,KAAK,EAAC,iBAAiB;MAC1B,WAAK,KAAK,EAAC,uBAAuB;QAChC;UACG,KAAK,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAClD,cACE,OAAO,EAAE,GAAG,EAAE;cACZ,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;YACzB,CAAC;YAED,WAAK,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,YAAY,GAAG,CACvC,CACV;wBAEE;QACL,4BAAsB,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CACrC;MACN,WAAK,KAAK,EAAC,wBAAwB;QACjC;UACG,KAAK,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAClD,cACE,OAAO,EAAE,GAAG,EAAE;cACZ,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;YACzB,CAAC;YAED,WAAK,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,YAAY,GAAG,CACvC,CACV;2BAEE;QACL,8BAAuB;QACvB,0BAAmB,CACf,CACF,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Category } from '../../types';\n\n@Component({\n tag: 'hemfixarna-cart',\n shadow: false,\n})\nexport class HemfixarnaCart {\n @Prop() tree: Category;\n\n render() {\n const back = getAssetPath(`./assets/back.svg`);\n\n return (\n <div class=\"hemfixarna_cart\">\n <div class=\"hemfixarna_cart--left\">\n <h2>\n {state.checkoutStep === 2 && !state.checkoutEdit && (\n <button\n onClick={() => {\n state.checkoutStep = 1;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n </button>\n )}\n Din bokning\n </h2>\n <hemfixarna-orderrows tree={this.tree} />\n </div>\n <div class=\"hemfixarna_cart--right\">\n <h2>\n {state.checkoutStep === 2 && !state.checkoutEdit && (\n <button\n onClick={() => {\n state.checkoutStep = 1;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n </button>\n )}\n Dina uppgifter\n </h2>\n <hemfixarna-checkout />\n <hemfixarna-info />\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"hemfixarna-cart.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-cart/hemfixarna-cart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,MAAM,aAAa,CAAC;AAMhC,MAAM,OAAO,cAAc;EACzB,MAAM;IACJ,MAAM,IAAI,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAE/C,OAAO,CACL,WAAK,KAAK,EAAC,iBAAiB;MAC1B,WAAK,KAAK,EAAC,uBAAuB;QAChC;UACG,KAAK,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAClD,cACE,OAAO,EAAE,GAAG,EAAE;cACZ,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;YACzB,CAAC;YAED,WAAK,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,YAAY,GAAG,CACvC,CACV;wBAEE;QACL,+BAAwB,CACpB;MACN,WAAK,KAAK,EAAC,wBAAwB;QACjC;UACG,KAAK,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAClD,cACE,OAAO,EAAE,GAAG,EAAE;cACZ,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;YACzB,CAAC;YAED,WAAK,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,YAAY,GAAG,CACvC,CACV;2BAEE;QACL,8BAAuB;QACvB,0BAAmB,CACf,CACF,CACP,CAAC;EACJ,CAAC;;CACF","sourcesContent":["import { Component, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\n\n@Component({\n tag: 'hemfixarna-cart',\n shadow: false,\n})\nexport class HemfixarnaCart {\n render() {\n const back = getAssetPath(`./assets/back.svg`);\n\n return (\n <div class=\"hemfixarna_cart\">\n <div class=\"hemfixarna_cart--left\">\n <h2>\n {state.checkoutStep === 2 && !state.checkoutEdit && (\n <button\n onClick={() => {\n state.checkoutStep = 1;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n </button>\n )}\n Din bokning\n </h2>\n <hemfixarna-orderrows />\n </div>\n <div class=\"hemfixarna_cart--right\">\n <h2>\n {state.checkoutStep === 2 && !state.checkoutEdit && (\n <button\n onClick={() => {\n state.checkoutStep = 1;\n }}\n >\n <img width={24} src={back} alt=\"back arrow\" />\n </button>\n )}\n Dina uppgifter\n </h2>\n <hemfixarna-checkout />\n <hemfixarna-info />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -1,36 +1,24 @@
1
1
  import { Fragment, getAssetPath, h } from '@stencil/core';
2
2
  import state from '../../store';
3
3
  import { WidgetStyle } from '../../types';
4
- import { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy } from '../../utils/api';
4
+ import { getCustomer, getGreenDiscount, getOptions, getRot, getRut } from '../../utils/api';
5
5
  import { getProductPriceWithRotAndRut } from '../../utils/calc';
6
6
  import { scrollToTop } from '../../utils/scroll';
7
7
  export class HemfixarnaComponent {
8
8
  constructor() {
9
- this.slugIsOldFormat = (slug) => {
10
- if (!slug)
11
- return false;
12
- return ['product', 'service', 'category'].some(str => slug.includes(str));
13
- };
14
9
  this.triggerScrollTotop = () => {
15
10
  const el = this.el.shadowRoot.querySelector('.hemfixarna_content');
16
11
  scrollToTop(el);
17
12
  };
18
13
  this.modal = false;
19
14
  this.showModal = false;
20
- this.tree = null;
21
15
  this.product = null;
22
- this.proppedProduct = null;
23
- this.slug = undefined;
24
16
  this.id = undefined;
25
17
  this.business = undefined;
26
- this.topCategory = undefined;
27
- this.forceOldTree = false;
28
- this.loadFromQuery = false;
29
- this.isDemo = false;
30
- this.widgetStyle = undefined;
31
- this.nav = undefined;
18
+ this.widgetStyle = WidgetStyle.standard;
32
19
  this.buttonColor = undefined;
33
20
  this.buttonBg = undefined;
21
+ this.proppedProduct = null;
34
22
  }
35
23
  loadCategoryOrProduct(id) {
36
24
  this.proppedProduct = null;
@@ -55,14 +43,6 @@ export class HemfixarnaComponent {
55
43
  }
56
44
  }
57
45
  }
58
- async watchSlugChange(newValue) {
59
- if (this.slugIsOldFormat(newValue)) {
60
- this.fetchNewTaxonomy(newValue);
61
- }
62
- else if (state.customer && newValue) {
63
- this.loadCategoryOrProduct(newValue);
64
- }
65
- }
66
46
  async watchIdChange(id) {
67
47
  if (id && state.customer) {
68
48
  if (id === 'maleri') {
@@ -74,22 +54,6 @@ export class HemfixarnaComponent {
74
54
  }
75
55
  }
76
56
  }
77
- async fetchNewTaxonomy(slug) {
78
- state.selectedCategory = null;
79
- state.selectedProduct = null;
80
- state.selectedService = null;
81
- state.maleri = null;
82
- const res = await getTaxonomy(slug);
83
- if ((res === null || res === void 0 ? void 0 : res.code) === 'not_found' || (res === null || res === void 0 ? void 0 : res.code) === 'rest_no_route') {
84
- console.log('taxonomy not found');
85
- }
86
- else if (res) {
87
- this.setTaxonomy(res);
88
- if ((res === null || res === void 0 ? void 0 : res.post_type) === 'ikea_product') {
89
- this.product = res;
90
- }
91
- }
92
- }
93
57
  async componentWillLoad() {
94
58
  state.business = this.business;
95
59
  const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);
@@ -104,90 +68,33 @@ export class HemfixarnaComponent {
104
68
  if (creditSafeUser) {
105
69
  state.creditSafeUser = JSON.parse(creditSafeUser);
106
70
  }
107
- const [tree, res, options, rut, rot, greenDiscount] = await Promise.all([
108
- this.topCategory ? getTaxonomy(this.topCategory) : null,
109
- this.slug ? getTaxonomy(this.slug) : Promise.resolve(null),
110
- getOptions(),
111
- getRut(),
112
- getRot(),
113
- getGreenDiscount(),
114
- ]);
115
- if ((!this.slug || !this.slugIsOldFormat(this.slug)) && !this.forceOldTree) {
116
- try {
117
- const customer = await getCustomer(this.business);
118
- if ((customer === null || customer === void 0 ? void 0 : customer.code) === 'not_found') {
119
- console.warn('customer not found');
120
- }
121
- else if (customer) {
122
- state.customer = customer;
123
- if (this.id) {
124
- if (this.id === 'maleri') {
125
- state.maleri = true;
126
- state.step = 4;
127
- }
128
- else {
129
- this.loadCategoryOrProduct(this.id);
130
- }
71
+ const [options, rut, rot, greenDiscount] = await Promise.all([getOptions(), getRut(), getRot(), getGreenDiscount()]);
72
+ try {
73
+ const customer = await getCustomer(this.business);
74
+ if ((customer === null || customer === void 0 ? void 0 : customer.code) === 'not_found') {
75
+ console.warn('customer not found');
76
+ }
77
+ else if (customer) {
78
+ state.customer = customer;
79
+ if (this.id) {
80
+ if (this.id === 'maleri') {
81
+ state.maleri = true;
82
+ state.step = 4;
131
83
  }
132
- else if (this.slug && !this.slugIsOldFormat(this.slug)) {
133
- this.loadCategoryOrProduct(this.slug);
84
+ else {
85
+ this.loadCategoryOrProduct(this.id);
134
86
  }
135
87
  }
136
88
  }
137
- catch (error) {
138
- console.warn('customer not found');
139
- }
140
- }
141
- if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found') {
142
- // console.warn('tree not found');
143
- }
144
- else if (tree) {
145
- this.tree = tree;
146
- }
147
- if ((res === null || res === void 0 ? void 0 : res.code) === 'not_found') {
148
- console.log('taxonomy not found');
149
- }
150
- else if (res) {
151
- this.setTaxonomy(res);
152
- if ((res === null || res === void 0 ? void 0 : res.post_type) === 'ikea_product') {
153
- this.product = res;
154
- }
155
89
  }
156
- if (this.loadFromQuery) {
157
- const params = new URL(document.location.toString()).searchParams;
158
- this.id = params.get('id');
159
- if (!this.isDemo) {
160
- this.openModal();
161
- }
90
+ catch (error) {
91
+ console.warn('customer not found');
162
92
  }
163
93
  state.rotOptions = rot;
164
94
  state.rutOptions = rut;
165
95
  state.greenOptions = greenDiscount;
166
96
  state.options = options;
167
97
  }
168
- setTaxonomy(taxonomy) {
169
- if (taxonomy) {
170
- if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.taxonomy) === 'service_cat') {
171
- state.selectedCategory = taxonomy;
172
- state.step = 2;
173
- }
174
- else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'service') {
175
- state.selectedService = taxonomy;
176
- state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === taxonomy.ID));
177
- state.step = 3;
178
- }
179
- else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'ikea_product') {
180
- state.selectedProduct = taxonomy;
181
- state.selectedService = this.tree.sub_cats
182
- .map(c => c.services)
183
- .flat()
184
- .find(s => s.products.find(p => p.ID === state.selectedProduct.ID));
185
- state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === state.selectedService.ID));
186
- state.step = 4;
187
- }
188
- this.triggerScrollTotop();
189
- }
190
- }
191
98
  // Open close modal && click outside event
192
99
  openModal() {
193
100
  this.modal = true;
@@ -202,8 +109,6 @@ export class HemfixarnaComponent {
202
109
  }, 200);
203
110
  }
204
111
  handleClick(e) {
205
- if (this.loadFromQuery && !this.isDemo)
206
- return;
207
112
  if ((e === null || e === void 0 ? void 0 : e.composedPath()[0]).classList.contains('hemfixarna_backdrop')) {
208
113
  this.closeModal();
209
114
  }
@@ -219,16 +124,14 @@ export class HemfixarnaComponent {
219
124
  return state.cart.reduce((acc, curr) => acc + curr.amount, 0);
220
125
  }
221
126
  render() {
222
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
127
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
223
128
  const logo = getAssetPath(`./assets/hemfixarna.svg`);
224
129
  const pensel = getAssetPath(`./assets/pensel.svg`);
225
130
  const monteringLogo = getAssetPath(`./assets/montering.svg`);
226
- const navBackground = ((_a = this.nav) === null || _a === void 0 ? void 0 : _a.background) ? getAssetPath(this.nav.background) : '';
227
- const navLogo = ((_b = this.nav) === null || _b === void 0 ? void 0 : _b.logo) ? getAssetPath(this.nav.logo) : '';
228
- return (h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (h("nav", { class: "hemfixarna_nav", style: { backgroundColor: (_c = this.nav.backgroundColor) !== null && _c !== void 0 ? _c : '' } }, h("div", null, h("div", { class: "hemfixarna_nav--logos" }, h("a", { href: this.nav.url, target: "_blank" }, h("img", { class: "hemfixarna_partnerlogo", src: navLogo, alt: `${this.business} logo` })), h("a", { href: "https://hemfixarna.se/", target: "_blank" }, h("p", { class: navBackground || this.nav.backgroundColor ? 'with-bg' : '' }, "I samarbete med:"), h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), h("div", { class: "hemfixarna_nav--links" }, h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), navBackground ? h("img", { src: navBackground, class: "nav_background", alt: "nav_background" }) : null))) : null, !this.loadFromQuery || this.isDemo ? (h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (h("img", { src: this.id === 'maleri' ? pensel : monteringLogo, alt: "montering logo", width: 32, height: 32 })) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, this.id === 'maleri' ? (h("span", null, "Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r")) : (h(Fragment, null, !state.selectedCustomerCategory && !this.product && !this.proppedProduct ? (h(Fragment, null, ((_d = state.customer) === null || _d === void 0 ? void 0 : _d.widget_title) ? (h("span", null, state.customer.widget_title)) : (h("span", null, "Montering/Installation - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))))) : (h(Fragment, null, ((_e = this.product) === null || _e === void 0 ? void 0 : _e.title) || ((_f = this.proppedProduct) === null || _f === void 0 ? void 0 : _f.title) || ((_g = state.selectedCustomerCategory) === null || _g === void 0 ? void 0 : _g.widget_title) || (h("span", null, "Montering", h("wbr", null), "/Installation ", (_j = (_h = state.selectedCustomerCategory) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : 'på plats', " - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))), (this.product && ((_k = this.slug) === null || _k === void 0 ? void 0 : _k.includes('product'))) || (this.proppedProduct && !((_l = this.product) === null || _l === void 0 ? void 0 : _l.invoice) && !((_m = this.proppedProduct) === null || _m === void 0 ? void 0 : _m.invoice)) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null)))))), this.widgetStyle === WidgetStyle.standard ? h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (h("span", { class: "p-s" }, "Utf\u00F6rs av ", h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
229
- color: ((_o = this.buttonColor) === null || _o === void 0 ? void 0 : _o.startsWith('#')) || !((_p = this.buttonColor) === null || _p === void 0 ? void 0 : _p.length) ? this.buttonColor : `#${this.buttonColor}`,
230
- backgroundColor: ((_q = this.buttonBg) === null || _q === void 0 ? void 0 : _q.startsWith('#')) || !((_r = this.buttonBg) === null || _r === void 0 ? void 0 : _r.length) ? this.buttonBg : `#${this.buttonBg}`,
231
- } }, "Best\u00E4ll h\u00E4r", this.getCartLength() > 0 && h("span", null, this.getCartLength()))) : null, WidgetStyle.alternative_2 === this.widgetStyle ? (h("div", { class: "hemfixarna_altbtn" }, h("strong", { class: "p-s" }, "Utf\u00F6rs av"), h("img", { src: logo, alt: "hemfixarna logo", width: 98 }))) : null)) : null, this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, state.modal.title && h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", { innerHTML: t }))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), (this.tree || state.customer) && (h("hemfixarna-breadcrumbs", { isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, closeModal: () => this.closeModal(), tree: this.tree })), !state.customer || this.slugIsOldFormat(this.slug) ? (h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step === 1 && this.tree && h("hemfixarna-start", { tree: this.tree }), state.step === 2 && state.selectedCategory && h("hemfixarna-category", null), state.step === 3 && state.selectedService && h("hemfixarna-service", null), state.step === 4 && state.selectedProduct && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree }))) : (h("div", { class: `hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}` }, state.step < 4 && h("hemfixarna-start", null), state.step === 4 && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree })))), !this.isDemo ? h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` }) : null))));
131
+ return (h("div", { class: "hemfixarna" }, h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (h("img", { src: this.id === 'maleri' ? pensel : monteringLogo, alt: "montering logo", width: 32, height: 32 })) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, this.id === 'maleri' ? (h("span", null, "Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r")) : (h(Fragment, null, !state.selectedCustomerCategory && !this.product && !this.proppedProduct ? (h(Fragment, null, ((_a = state.customer) === null || _a === void 0 ? void 0 : _a.widget_title) ? (h("span", null, state.customer.widget_title)) : (h("span", null, "Montering/Installation - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))))) : (h(Fragment, null, ((_b = this.product) === null || _b === void 0 ? void 0 : _b.title) || ((_c = this.proppedProduct) === null || _c === void 0 ? void 0 : _c.title) || ((_d = state.selectedCustomerCategory) === null || _d === void 0 ? void 0 : _d.widget_title) || (h("span", null, "Montering", h("wbr", null), "/Installation ", (_f = (_e = state.selectedCustomerCategory) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : 'på plats', " - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))), this.proppedProduct && !((_g = this.product) === null || _g === void 0 ? void 0 : _g.invoice) && !((_h = this.proppedProduct) === null || _h === void 0 ? void 0 : _h.invoice) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null)))))), this.widgetStyle === WidgetStyle.standard ? h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (h("span", { class: "p-s" }, "Utf\u00F6rs av ", h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
132
+ color: ((_j = this.buttonColor) === null || _j === void 0 ? void 0 : _j.startsWith('#')) || !((_k = this.buttonColor) === null || _k === void 0 ? void 0 : _k.length) ? this.buttonColor : `#${this.buttonColor}`,
133
+ backgroundColor: ((_l = this.buttonBg) === null || _l === void 0 ? void 0 : _l.startsWith('#')) || !((_m = this.buttonBg) === null || _m === void 0 ? void 0 : _m.length) ? this.buttonBg : `#${this.buttonBg}`,
134
+ } }, "Best\u00E4ll h\u00E4r", this.getCartLength() > 0 && h("span", null, this.getCartLength()))) : null, WidgetStyle.alternative_2 === this.widgetStyle ? (h("div", { class: "hemfixarna_altbtn" }, h("strong", { class: "p-s" }, "Utf\u00F6rs av"), h("img", { src: logo, alt: "hemfixarna logo", width: 98 }))) : null), this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, state.modal.title && h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", { innerHTML: t }))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), state.customer && h("hemfixarna-breadcrumbs", { closeModal: () => this.closeModal() }), h("div", { class: `hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}` }, state.step < 4 && h("hemfixarna-start", null), state.step === 4 && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", null), state.step === 6 && h("hemfixarna-order", null))), h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` })))));
232
135
  }
233
136
  static get is() { return "hemfixarna-component"; }
234
137
  static get encapsulation() { return "shadow"; }
@@ -245,23 +148,6 @@ export class HemfixarnaComponent {
245
148
  static get assetsDirs() { return ["assets"]; }
246
149
  static get properties() {
247
150
  return {
248
- "slug": {
249
- "type": "string",
250
- "mutable": false,
251
- "complexType": {
252
- "original": "string",
253
- "resolved": "string",
254
- "references": {}
255
- },
256
- "required": false,
257
- "optional": true,
258
- "docs": {
259
- "tags": [],
260
- "text": ""
261
- },
262
- "attribute": "slug",
263
- "reflect": false
264
- },
265
151
  "id": {
266
152
  "type": "string",
267
153
  "mutable": false,
@@ -284,7 +170,7 @@ export class HemfixarnaComponent {
284
170
  "mutable": false,
285
171
  "complexType": {
286
172
  "original": "Business",
287
- "resolved": "Business.byggmax | Business.doro | Business.elfa | Business.fargvaruhuset | Business.flyttsmart | Business.forebygg | Business.hornbach | Business.kbygg | Business.klint | Business.kund | Business.lg | Business.norrgavel | Business.power | Business.skanska | Business.sparfonster | Business.string | Business.superfront | Business.tesla | Business.traningspartner | Business.zaptec",
173
+ "resolved": "Business",
288
174
  "references": {
289
175
  "Business": {
290
176
  "location": "import",
@@ -301,82 +187,6 @@ export class HemfixarnaComponent {
301
187
  "attribute": "business",
302
188
  "reflect": false
303
189
  },
304
- "topCategory": {
305
- "type": "string",
306
- "mutable": false,
307
- "complexType": {
308
- "original": "TopCategory",
309
- "resolved": "TopCategory",
310
- "references": {
311
- "TopCategory": {
312
- "location": "import",
313
- "path": "../../types"
314
- }
315
- }
316
- },
317
- "required": false,
318
- "optional": true,
319
- "docs": {
320
- "tags": [],
321
- "text": ""
322
- },
323
- "attribute": "top-category",
324
- "reflect": false
325
- },
326
- "forceOldTree": {
327
- "type": "boolean",
328
- "mutable": false,
329
- "complexType": {
330
- "original": "boolean",
331
- "resolved": "boolean",
332
- "references": {}
333
- },
334
- "required": false,
335
- "optional": true,
336
- "docs": {
337
- "tags": [],
338
- "text": ""
339
- },
340
- "attribute": "force-old-tree",
341
- "reflect": false,
342
- "defaultValue": "false"
343
- },
344
- "loadFromQuery": {
345
- "type": "boolean",
346
- "mutable": false,
347
- "complexType": {
348
- "original": "boolean",
349
- "resolved": "boolean",
350
- "references": {}
351
- },
352
- "required": false,
353
- "optional": true,
354
- "docs": {
355
- "tags": [],
356
- "text": ""
357
- },
358
- "attribute": "load-from-query",
359
- "reflect": false,
360
- "defaultValue": "false"
361
- },
362
- "isDemo": {
363
- "type": "boolean",
364
- "mutable": false,
365
- "complexType": {
366
- "original": "boolean",
367
- "resolved": "boolean",
368
- "references": {}
369
- },
370
- "required": false,
371
- "optional": true,
372
- "docs": {
373
- "tags": [],
374
- "text": ""
375
- },
376
- "attribute": "is-demo",
377
- "reflect": false,
378
- "defaultValue": "false"
379
- },
380
190
  "widgetStyle": {
381
191
  "type": "string",
382
192
  "mutable": false,
@@ -397,23 +207,8 @@ export class HemfixarnaComponent {
397
207
  "text": ""
398
208
  },
399
209
  "attribute": "widget-style",
400
- "reflect": false
401
- },
402
- "nav": {
403
- "type": "unknown",
404
- "mutable": false,
405
- "complexType": {
406
- "original": "{\n url: string;\n logo: string;\n background?: string;\n backgroundColor?: string;\n }",
407
- "resolved": "{ url: string; logo: string; background?: string; backgroundColor?: string; }",
408
- "references": {}
409
- },
410
- "required": false,
411
- "optional": true,
412
- "docs": {
413
- "tags": [],
414
- "text": ""
415
- },
416
- "defaultValue": "undefined"
210
+ "reflect": false,
211
+ "defaultValue": "WidgetStyle.standard"
417
212
  },
418
213
  "buttonColor": {
419
214
  "type": "string",
@@ -455,7 +250,6 @@ export class HemfixarnaComponent {
455
250
  return {
456
251
  "modal": {},
457
252
  "showModal": {},
458
- "tree": {},
459
253
  "product": {},
460
254
  "proppedProduct": {}
461
255
  };
@@ -463,9 +257,6 @@ export class HemfixarnaComponent {
463
257
  static get elementRef() { return "el"; }
464
258
  static get watchers() {
465
259
  return [{
466
- "propName": "slug",
467
- "methodName": "watchSlugChange"
468
- }, {
469
260
  "propName": "id",
470
261
  "methodName": "watchIdChange"
471
262
  }];