hemfixarna-web-components 1.8.3 → 1.8.5

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 (366) hide show
  1. package/dist/{collection/utils/api.js → hemfixarna-components/api-e3c51cb3.js} +7 -4
  2. package/dist/hemfixarna-components/api-e3c51cb3.js.map +1 -0
  3. package/dist/hemfixarna-components/app-globals-0f993ce5.js +5 -0
  4. package/dist/hemfixarna-components/app-globals-0f993ce5.js.map +1 -0
  5. package/dist/{collection/utils/calc.js → hemfixarna-components/calc-b3b6593c.js} +7 -13
  6. package/dist/hemfixarna-components/calc-b3b6593c.js.map +1 -0
  7. package/dist/hemfixarna-components/css-shim-4fde41f0.js +6 -0
  8. package/dist/hemfixarna-components/css-shim-4fde41f0.js.map +1 -0
  9. package/dist/hemfixarna-components/dom-8de30773.js +75 -0
  10. package/dist/hemfixarna-components/dom-8de30773.js.map +1 -0
  11. package/dist/{collection/utils/enviroment.js → hemfixarna-components/enviroment-fd0a763a.js} +8 -6
  12. package/dist/hemfixarna-components/enviroment-fd0a763a.js.map +1 -0
  13. package/dist/{collection/utils/form.js → hemfixarna-components/form-c53dca29.js} +4 -2
  14. package/dist/hemfixarna-components/form-c53dca29.js.map +1 -0
  15. package/dist/{collection/components/hemfixarna-address/hemfixarna-address.js → hemfixarna-components/hemfixarna-address.entry.js} +14 -20
  16. package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +1 -0
  17. package/dist/hemfixarna-components/hemfixarna-box.entry.js +49 -0
  18. package/dist/hemfixarna-components/hemfixarna-box.entry.js.map +1 -0
  19. package/dist/{collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js → hemfixarna-components/hemfixarna-breadcrumbs.entry.js} +13 -28
  20. package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js.map +1 -0
  21. package/dist/{esm → hemfixarna-components}/hemfixarna-byggmax.entry.js +2 -2
  22. package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js.map +1 -0
  23. package/dist/{collection/components/hemfixarna-cart/hemfixarna-cart.js → hemfixarna-components/hemfixarna-cart.entry.js} +12 -6
  24. package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +1 -0
  25. package/dist/{esm → hemfixarna-components}/hemfixarna-category.entry.js +2 -2
  26. package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +1 -0
  27. package/dist/{collection/components/hemfixarna-checkout/hemfixarna-checkout.js → hemfixarna-components/hemfixarna-checkout.entry.js} +33 -26
  28. package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +1 -0
  29. package/dist/hemfixarna-components/hemfixarna-component.entry.js +189 -0
  30. package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +1 -0
  31. package/dist/hemfixarna-components/hemfixarna-components.esm.js +162 -1
  32. package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
  33. package/dist/{collection/components/hemfixarna-contact/hemfixarna-contact.js → hemfixarna-components/hemfixarna-contact.entry.js} +11 -29
  34. package/dist/hemfixarna-components/hemfixarna-contact.entry.js.map +1 -0
  35. package/dist/{collection/components/hemfixarna-demo/hemfixarna-demo.js → hemfixarna-components/hemfixarna-demo.entry.js} +21 -46
  36. package/dist/hemfixarna-components/hemfixarna-demo.entry.js.map +1 -0
  37. package/dist/{esm → hemfixarna-components}/hemfixarna-doro.entry.js +2 -2
  38. package/dist/hemfixarna-components/hemfixarna-doro.entry.js.map +1 -0
  39. package/dist/{esm → hemfixarna-components}/hemfixarna-elfa.entry.js +2 -2
  40. package/dist/hemfixarna-components/hemfixarna-elfa.entry.js.map +1 -0
  41. package/dist/{esm → hemfixarna-components}/hemfixarna-fargvaruhuset.entry.js +2 -2
  42. package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js.map +1 -0
  43. package/dist/{esm → hemfixarna-components}/hemfixarna-flyttsmart.entry.js +2 -2
  44. package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js.map +1 -0
  45. package/dist/{esm → hemfixarna-components}/hemfixarna-forebygg.entry.js +2 -2
  46. package/dist/hemfixarna-components/hemfixarna-forebygg.entry.js.map +1 -0
  47. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +770 -0
  48. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +1 -0
  49. package/dist/{esm → hemfixarna-components}/hemfixarna-hornbach.entry.js +2 -2
  50. package/dist/hemfixarna-components/hemfixarna-hornbach.entry.js.map +1 -0
  51. package/dist/{collection/components/hemfixarna-info/hemfixarna-info.js → hemfixarna-components/hemfixarna-info.entry.js} +11 -7
  52. package/dist/hemfixarna-components/hemfixarna-info.entry.js.map +1 -0
  53. package/dist/{collection/components/hemfixarna-invoice/hemfixarna-invoice.js → hemfixarna-components/hemfixarna-invoice.entry.js} +16 -27
  54. package/dist/hemfixarna-components/hemfixarna-invoice.entry.js.map +1 -0
  55. package/dist/{esm → hemfixarna-components}/hemfixarna-kbygg.entry.js +2 -2
  56. package/dist/hemfixarna-components/hemfixarna-kbygg.entry.js.map +1 -0
  57. package/dist/{esm → hemfixarna-components}/hemfixarna-klint.entry.js +2 -2
  58. package/dist/hemfixarna-components/hemfixarna-klint.entry.js.map +1 -0
  59. package/dist/{esm → hemfixarna-components}/hemfixarna-kund.entry.js +2 -2
  60. package/dist/hemfixarna-components/hemfixarna-kund.entry.js.map +1 -0
  61. package/dist/{esm → hemfixarna-components}/hemfixarna-norrgavel.entry.js +2 -2
  62. package/dist/hemfixarna-components/hemfixarna-norrgavel.entry.js.map +1 -0
  63. package/dist/{collection/components/hemfixarna-order/hemfixarna-order.js → hemfixarna-components/hemfixarna-order.entry.js} +11 -7
  64. package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +1 -0
  65. package/dist/{collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js → hemfixarna-components/hemfixarna-orderrows.entry.js} +12 -30
  66. package/dist/hemfixarna-components/hemfixarna-orderrows.entry.js.map +1 -0
  67. package/dist/{esm → hemfixarna-components}/hemfixarna-power.entry.js +2 -2
  68. package/dist/hemfixarna-components/hemfixarna-power.entry.js.map +1 -0
  69. package/dist/{collection/components/hemfixarna-product/hemfixarna-product.js → hemfixarna-components/hemfixarna-product.entry.js} +18 -27
  70. package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +1 -0
  71. package/dist/{esm → hemfixarna-components}/hemfixarna-service.entry.js +2 -2
  72. package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +1 -0
  73. package/dist/{esm → hemfixarna-components}/hemfixarna-skanska.entry.js +2 -2
  74. package/dist/hemfixarna-components/hemfixarna-skanska.entry.js.map +1 -0
  75. package/dist/{esm → hemfixarna-components}/hemfixarna-sparfonster.entry.js +2 -2
  76. package/dist/hemfixarna-components/hemfixarna-sparfonster.entry.js.map +1 -0
  77. package/dist/{collection/components/hemfixarna-start/hemfixarna-start.js → hemfixarna-components/hemfixarna-start.entry.js} +11 -48
  78. package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +1 -0
  79. package/dist/{esm → hemfixarna-components}/hemfixarna-string-furniture.entry.js +2 -2
  80. package/dist/hemfixarna-components/hemfixarna-string-furniture.entry.js.map +1 -0
  81. package/dist/{esm → hemfixarna-components}/hemfixarna-superfront.entry.js +2 -2
  82. package/dist/hemfixarna-components/hemfixarna-superfront.entry.js.map +1 -0
  83. package/dist/{esm → hemfixarna-components}/hemfixarna-tesla.entry.js +2 -2
  84. package/dist/hemfixarna-components/hemfixarna-tesla.entry.js.map +1 -0
  85. package/dist/{esm → hemfixarna-components}/hemfixarna-traningspartner.entry.js +2 -2
  86. package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js.map +1 -0
  87. package/dist/{esm → hemfixarna-components}/hemfixarna-zaptec.entry.js +2 -2
  88. package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js.map +1 -0
  89. package/dist/{esm/index-8282f88e.js → hemfixarna-components/index-21ba2b05.js} +2 -2
  90. package/dist/{esm/index-8282f88e.js.map → hemfixarna-components/index-21ba2b05.js.map} +1 -1
  91. package/dist/hemfixarna-components/index-2ce8b901.js +3461 -0
  92. package/dist/hemfixarna-components/index-2ce8b901.js.map +1 -0
  93. package/dist/{esm/index-c8aebf0d.js → hemfixarna-components/index-c8ce6f4b.js} +6 -1
  94. package/dist/hemfixarna-components/index-c8ce6f4b.js.map +1 -0
  95. package/dist/hemfixarna-components/index.esm.js +1 -0
  96. package/dist/hemfixarna-components/index.esm.js.map +1 -1
  97. package/dist/{collection/utils/scroll.js → hemfixarna-components/scroll-6c26b5da.js} +4 -2
  98. package/dist/hemfixarna-components/scroll-6c26b5da.js.map +1 -0
  99. package/dist/hemfixarna-components/shadow-css-af2290df.js +389 -0
  100. package/dist/hemfixarna-components/shadow-css-af2290df.js.map +1 -0
  101. package/dist/{collection/utils/types.js → hemfixarna-components/types-6da209ae.js} +6 -3
  102. package/dist/hemfixarna-components/types-6da209ae.js.map +1 -0
  103. package/dist/types/stencil-public-runtime.d.ts +3 -0
  104. package/dist/types/types/index.d.ts +6 -1
  105. package/package.json +1 -1
  106. package/dist/cjs/hemfixarna-address_15.cjs.entry.js +0 -2180
  107. package/dist/cjs/hemfixarna-address_15.cjs.entry.js.map +0 -1
  108. package/dist/cjs/hemfixarna-byggmax.cjs.entry.js +0 -27
  109. package/dist/cjs/hemfixarna-byggmax.cjs.entry.js.map +0 -1
  110. package/dist/cjs/hemfixarna-category.cjs.entry.js +0 -28
  111. package/dist/cjs/hemfixarna-category.cjs.entry.js.map +0 -1
  112. package/dist/cjs/hemfixarna-components.cjs.js +0 -28
  113. package/dist/cjs/hemfixarna-components.cjs.js.map +0 -1
  114. package/dist/cjs/hemfixarna-doro.cjs.entry.js +0 -26
  115. package/dist/cjs/hemfixarna-doro.cjs.entry.js.map +0 -1
  116. package/dist/cjs/hemfixarna-elfa.cjs.entry.js +0 -26
  117. package/dist/cjs/hemfixarna-elfa.cjs.entry.js.map +0 -1
  118. package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js +0 -23
  119. package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js.map +0 -1
  120. package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js +0 -23
  121. package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js.map +0 -1
  122. package/dist/cjs/hemfixarna-forebygg.cjs.entry.js +0 -26
  123. package/dist/cjs/hemfixarna-forebygg.cjs.entry.js.map +0 -1
  124. package/dist/cjs/hemfixarna-hornbach.cjs.entry.js +0 -26
  125. package/dist/cjs/hemfixarna-hornbach.cjs.entry.js.map +0 -1
  126. package/dist/cjs/hemfixarna-kbygg.cjs.entry.js +0 -23
  127. package/dist/cjs/hemfixarna-kbygg.cjs.entry.js.map +0 -1
  128. package/dist/cjs/hemfixarna-klint.cjs.entry.js +0 -23
  129. package/dist/cjs/hemfixarna-klint.cjs.entry.js.map +0 -1
  130. package/dist/cjs/hemfixarna-kund.cjs.entry.js +0 -23
  131. package/dist/cjs/hemfixarna-kund.cjs.entry.js.map +0 -1
  132. package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js +0 -23
  133. package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js.map +0 -1
  134. package/dist/cjs/hemfixarna-power.cjs.entry.js +0 -23
  135. package/dist/cjs/hemfixarna-power.cjs.entry.js.map +0 -1
  136. package/dist/cjs/hemfixarna-service.cjs.entry.js +0 -24
  137. package/dist/cjs/hemfixarna-service.cjs.entry.js.map +0 -1
  138. package/dist/cjs/hemfixarna-skanska.cjs.entry.js +0 -26
  139. package/dist/cjs/hemfixarna-skanska.cjs.entry.js.map +0 -1
  140. package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js +0 -23
  141. package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js.map +0 -1
  142. package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js +0 -26
  143. package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js.map +0 -1
  144. package/dist/cjs/hemfixarna-superfront.cjs.entry.js +0 -24
  145. package/dist/cjs/hemfixarna-superfront.cjs.entry.js.map +0 -1
  146. package/dist/cjs/hemfixarna-tesla.cjs.entry.js +0 -23
  147. package/dist/cjs/hemfixarna-tesla.cjs.entry.js.map +0 -1
  148. package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js +0 -23
  149. package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js.map +0 -1
  150. package/dist/cjs/hemfixarna-zaptec.cjs.entry.js +0 -23
  151. package/dist/cjs/hemfixarna-zaptec.cjs.entry.js.map +0 -1
  152. package/dist/cjs/index-6af772cf.js +0 -265
  153. package/dist/cjs/index-6af772cf.js.map +0 -1
  154. package/dist/cjs/index-739bf321.js +0 -44
  155. package/dist/cjs/index-739bf321.js.map +0 -1
  156. package/dist/cjs/index-b83343b9.js +0 -1687
  157. package/dist/cjs/index-b83343b9.js.map +0 -1
  158. package/dist/cjs/index.cjs.js +0 -4
  159. package/dist/cjs/index.cjs.js.map +0 -1
  160. package/dist/cjs/loader.cjs.js +0 -24
  161. package/dist/cjs/loader.cjs.js.map +0 -1
  162. package/dist/collection/assets/back.svg +0 -3
  163. package/dist/collection/assets/cart.svg +0 -10
  164. package/dist/collection/assets/checked.svg +0 -10
  165. package/dist/collection/assets/close.svg +0 -5
  166. package/dist/collection/assets/copy.png +0 -0
  167. package/dist/collection/assets/date.svg +0 -6
  168. package/dist/collection/assets/down.svg +0 -3
  169. package/dist/collection/assets/drag-drop.svg +0 -3
  170. package/dist/collection/assets/elfa.png +0 -0
  171. package/dist/collection/assets/gubbe-pensel.svg +0 -1
  172. package/dist/collection/assets/hemfixarna.svg +0 -11
  173. package/dist/collection/assets/hornbach/logo.svg +0 -42
  174. package/dist/collection/assets/hornbach/nav.jpg +0 -0
  175. package/dist/collection/assets/info.svg +0 -5
  176. package/dist/collection/assets/kbygg.svg +0 -29
  177. package/dist/collection/assets/minus.svg +0 -4
  178. package/dist/collection/assets/montering.svg +0 -15
  179. package/dist/collection/assets/norrgavel.svg +0 -1
  180. package/dist/collection/assets/pensel.svg +0 -1
  181. package/dist/collection/assets/plus.svg +0 -5
  182. package/dist/collection/assets/spinner.gif +0 -0
  183. package/dist/collection/assets/tesla.svg +0 -1
  184. package/dist/collection/assets/zaptec.svg +0 -1
  185. package/dist/collection/collection-manifest.json +0 -47
  186. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.css +0 -0
  187. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js +0 -122
  188. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js.map +0 -1
  189. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.css +0 -0
  190. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js +0 -104
  191. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js.map +0 -1
  192. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.css +0 -0
  193. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js +0 -104
  194. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +0 -1
  195. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +0 -94
  196. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +0 -1
  197. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js +0 -94
  198. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js.map +0 -1
  199. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.css +0 -0
  200. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js +0 -104
  201. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js.map +0 -1
  202. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.css +0 -0
  203. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js +0 -104
  204. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +0 -1
  205. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +0 -94
  206. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +0 -1
  207. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js +0 -94
  208. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js.map +0 -1
  209. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js +0 -94
  210. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +0 -1
  211. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +0 -94
  212. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +0 -1
  213. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +0 -94
  214. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +0 -1
  215. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.css +0 -0
  216. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js +0 -104
  217. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +0 -1
  218. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js +0 -94
  219. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js.map +0 -1
  220. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js +0 -104
  221. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js.map +0 -1
  222. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string.css +0 -0
  223. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js +0 -113
  224. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js.map +0 -1
  225. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js +0 -94
  226. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js.map +0 -1
  227. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +0 -94
  228. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +0 -1
  229. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js +0 -94
  230. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js.map +0 -1
  231. package/dist/collection/components/hemfixarna-address/hemfixarna-address.js.map +0 -1
  232. package/dist/collection/components/hemfixarna-box/hemfixarna-box.js +0 -138
  233. package/dist/collection/components/hemfixarna-box/hemfixarna-box.js.map +0 -1
  234. package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +0 -1
  235. package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js.map +0 -1
  236. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js +0 -18
  237. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +0 -1
  238. package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +0 -1
  239. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +0 -330
  240. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +0 -1
  241. package/dist/collection/components/hemfixarna-component/hemfixarna.css +0 -1061
  242. package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js.map +0 -1
  243. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +0 -135
  244. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +0 -1
  245. package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js +0 -91
  246. package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js.map +0 -1
  247. package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +0 -1
  248. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.css +0 -76
  249. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js.map +0 -1
  250. package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +0 -1
  251. package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js.map +0 -1
  252. package/dist/collection/components/hemfixarna-product/hemfixarna-product.css +0 -0
  253. package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +0 -1
  254. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js +0 -14
  255. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +0 -1
  256. package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +0 -1
  257. package/dist/collection/index.js +0 -2
  258. package/dist/collection/index.js.map +0 -1
  259. package/dist/collection/store/index.js +0 -69
  260. package/dist/collection/store/index.js.map +0 -1
  261. package/dist/collection/types/felixtypes.js +0 -3
  262. package/dist/collection/types/felixtypes.js.map +0 -1
  263. package/dist/collection/types/index.js +0 -41
  264. package/dist/collection/types/index.js.map +0 -1
  265. package/dist/collection/utils/api.js.map +0 -1
  266. package/dist/collection/utils/calc.js.map +0 -1
  267. package/dist/collection/utils/creditSafe.js +0 -18
  268. package/dist/collection/utils/creditSafe.js.map +0 -1
  269. package/dist/collection/utils/enviroment.js.map +0 -1
  270. package/dist/collection/utils/felixApi.js +0 -19
  271. package/dist/collection/utils/felixApi.js.map +0 -1
  272. package/dist/collection/utils/felixFunctions.js +0 -188
  273. package/dist/collection/utils/felixFunctions.js.map +0 -1
  274. package/dist/collection/utils/form.js.map +0 -1
  275. package/dist/collection/utils/scroll.js.map +0 -1
  276. package/dist/collection/utils/types.js.map +0 -1
  277. package/dist/esm/hemfixarna-address_15.entry.js +0 -2162
  278. package/dist/esm/hemfixarna-address_15.entry.js.map +0 -1
  279. package/dist/esm/hemfixarna-byggmax.entry.js.map +0 -1
  280. package/dist/esm/hemfixarna-category.entry.js.map +0 -1
  281. package/dist/esm/hemfixarna-components.js +0 -23
  282. package/dist/esm/hemfixarna-components.js.map +0 -1
  283. package/dist/esm/hemfixarna-doro.entry.js.map +0 -1
  284. package/dist/esm/hemfixarna-elfa.entry.js.map +0 -1
  285. package/dist/esm/hemfixarna-fargvaruhuset.entry.js.map +0 -1
  286. package/dist/esm/hemfixarna-flyttsmart.entry.js.map +0 -1
  287. package/dist/esm/hemfixarna-forebygg.entry.js.map +0 -1
  288. package/dist/esm/hemfixarna-hornbach.entry.js.map +0 -1
  289. package/dist/esm/hemfixarna-kbygg.entry.js.map +0 -1
  290. package/dist/esm/hemfixarna-klint.entry.js.map +0 -1
  291. package/dist/esm/hemfixarna-kund.entry.js.map +0 -1
  292. package/dist/esm/hemfixarna-norrgavel.entry.js.map +0 -1
  293. package/dist/esm/hemfixarna-power.entry.js.map +0 -1
  294. package/dist/esm/hemfixarna-service.entry.js.map +0 -1
  295. package/dist/esm/hemfixarna-skanska.entry.js.map +0 -1
  296. package/dist/esm/hemfixarna-sparfonster.entry.js.map +0 -1
  297. package/dist/esm/hemfixarna-string-furniture.entry.js.map +0 -1
  298. package/dist/esm/hemfixarna-superfront.entry.js.map +0 -1
  299. package/dist/esm/hemfixarna-tesla.entry.js.map +0 -1
  300. package/dist/esm/hemfixarna-traningspartner.entry.js.map +0 -1
  301. package/dist/esm/hemfixarna-zaptec.entry.js.map +0 -1
  302. package/dist/esm/index-04bcf90e.js +0 -1656
  303. package/dist/esm/index-04bcf90e.js.map +0 -1
  304. package/dist/esm/index-c8aebf0d.js.map +0 -1
  305. package/dist/esm/index.js +0 -3
  306. package/dist/esm/index.js.map +0 -1
  307. package/dist/esm/loader.js +0 -20
  308. package/dist/esm/loader.js.map +0 -1
  309. package/dist/esm/polyfills/core-js.js +0 -11
  310. package/dist/esm/polyfills/css-shim.js +0 -1
  311. package/dist/esm/polyfills/dom.js +0 -79
  312. package/dist/esm/polyfills/es5-html-element.js +0 -1
  313. package/dist/esm/polyfills/index.js +0 -34
  314. package/dist/esm/polyfills/system.js +0 -6
  315. package/dist/hemfixarna-components/p-075a13b6.entry.js +0 -2
  316. package/dist/hemfixarna-components/p-075a13b6.entry.js.map +0 -1
  317. package/dist/hemfixarna-components/p-0aa722e7.entry.js +0 -2
  318. package/dist/hemfixarna-components/p-0aa722e7.entry.js.map +0 -1
  319. package/dist/hemfixarna-components/p-1cbfbf5a.entry.js +0 -2
  320. package/dist/hemfixarna-components/p-1cbfbf5a.entry.js.map +0 -1
  321. package/dist/hemfixarna-components/p-226a06bb.entry.js +0 -2
  322. package/dist/hemfixarna-components/p-226a06bb.entry.js.map +0 -1
  323. package/dist/hemfixarna-components/p-24b53f91.entry.js +0 -2
  324. package/dist/hemfixarna-components/p-24b53f91.entry.js.map +0 -1
  325. package/dist/hemfixarna-components/p-32a8152b.js +0 -3
  326. package/dist/hemfixarna-components/p-32a8152b.js.map +0 -1
  327. package/dist/hemfixarna-components/p-49c372d6.entry.js +0 -2
  328. package/dist/hemfixarna-components/p-49c372d6.entry.js.map +0 -1
  329. package/dist/hemfixarna-components/p-506c766c.entry.js +0 -2
  330. package/dist/hemfixarna-components/p-506c766c.entry.js.map +0 -1
  331. package/dist/hemfixarna-components/p-53edf50e.entry.js +0 -2
  332. package/dist/hemfixarna-components/p-53edf50e.entry.js.map +0 -1
  333. package/dist/hemfixarna-components/p-66515865.entry.js +0 -2
  334. package/dist/hemfixarna-components/p-66515865.entry.js.map +0 -1
  335. package/dist/hemfixarna-components/p-6c0e0f95.entry.js +0 -2
  336. package/dist/hemfixarna-components/p-6c0e0f95.entry.js.map +0 -1
  337. package/dist/hemfixarna-components/p-8cc96dd9.entry.js +0 -2
  338. package/dist/hemfixarna-components/p-8cc96dd9.entry.js.map +0 -1
  339. package/dist/hemfixarna-components/p-9b409902.entry.js +0 -2
  340. package/dist/hemfixarna-components/p-9b409902.entry.js.map +0 -1
  341. package/dist/hemfixarna-components/p-a09f4a5d.entry.js +0 -2
  342. package/dist/hemfixarna-components/p-a09f4a5d.entry.js.map +0 -1
  343. package/dist/hemfixarna-components/p-b397b966.js +0 -2
  344. package/dist/hemfixarna-components/p-b397b966.js.map +0 -1
  345. package/dist/hemfixarna-components/p-bf515028.entry.js +0 -2
  346. package/dist/hemfixarna-components/p-bf515028.entry.js.map +0 -1
  347. package/dist/hemfixarna-components/p-d013eeee.entry.js +0 -2
  348. package/dist/hemfixarna-components/p-d013eeee.entry.js.map +0 -1
  349. package/dist/hemfixarna-components/p-d281e9e3.entry.js +0 -2
  350. package/dist/hemfixarna-components/p-d281e9e3.entry.js.map +0 -1
  351. package/dist/hemfixarna-components/p-d297cb30.js +0 -2
  352. package/dist/hemfixarna-components/p-d297cb30.js.map +0 -1
  353. package/dist/hemfixarna-components/p-d6af83de.entry.js +0 -2
  354. package/dist/hemfixarna-components/p-d6af83de.entry.js.map +0 -1
  355. package/dist/hemfixarna-components/p-e8800c3b.entry.js +0 -2
  356. package/dist/hemfixarna-components/p-e8800c3b.entry.js.map +0 -1
  357. package/dist/hemfixarna-components/p-eaa3e1c0.entry.js +0 -2
  358. package/dist/hemfixarna-components/p-eaa3e1c0.entry.js.map +0 -1
  359. package/dist/hemfixarna-components/p-ee6d1a35.entry.js +0 -2
  360. package/dist/hemfixarna-components/p-ee6d1a35.entry.js.map +0 -1
  361. package/dist/hemfixarna-components/p-f6de66c8.entry.js +0 -2
  362. package/dist/hemfixarna-components/p-f6de66c8.entry.js.map +0 -1
  363. package/dist/hemfixarna-components/p-facaf951.entry.js +0 -2
  364. package/dist/hemfixarna-components/p-facaf951.entry.js.map +0 -1
  365. package/dist/index.cjs.js +0 -1
  366. package/dist/index.js +0 -1
@@ -1,138 +0,0 @@
1
- import { Fragment, h } from '@stencil/core';
2
- import state from '../../store';
3
- import { getProductPrice } from '../../utils/calc';
4
- import { scrollToTop } from '../../utils/scroll';
5
- import { isProduct } from '../../utils/types';
6
- export class HemfixarnaBox {
7
- constructor() {
8
- this.post = undefined;
9
- this.category = undefined;
10
- this.icon = undefined;
11
- this.postTitle = undefined;
12
- }
13
- setTaxonomy(taxonomy) {
14
- if (taxonomy) {
15
- if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.taxonomy) === 'service_cat') {
16
- state.selectedCategory = taxonomy;
17
- state.step = 2;
18
- }
19
- else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'service') {
20
- state.selectedService = taxonomy;
21
- state.step = 3;
22
- }
23
- else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'ikea_product') {
24
- state.selectedProduct = taxonomy;
25
- state.step = 4;
26
- }
27
- const el = this.el.closest('.hemfixarna_content');
28
- scrollToTop(el);
29
- }
30
- }
31
- setProduct() {
32
- state.selectedProduct = this.category;
33
- state.step = 4;
34
- state.selectedCustomerCategory = null;
35
- const el = this.el.closest('.hemfixarna_content');
36
- scrollToTop(el);
37
- }
38
- render() {
39
- return this.category ? (h(Fragment, null, isProduct(this.category) ? (h("li", { onClick: () => this.setProduct() }, h("img", { class: "hemfixarna_logo", height: 82, src: this.category.icon, alt: this.category.post_name }), h("div", null, h("p", null, this.category.title), !this.category.invoice ? h("p", { class: "price" }, "Fr\u00E5n ", getProductPrice(this.category), "kr") : null))) : (h("li", { onClick: () => (state.selectedCustomerCategory = this.category) }, h("img", { class: "hemfixarna_logo", height: 82, src: this.category.icon, alt: this.category.name }), h("div", null, h("p", null, this.category.name)))))) : (h("li", { onClick: () => this.setTaxonomy(this.post) }, this.post.icon && h("img", { class: "hemfixarna_logo", height: 82, src: this.icon, alt: this.postTitle }), h("div", null, h("p", null, this.postTitle), state.step === 3 && h("p", { class: "price" }, "Fr\u00E5n ", getProductPrice(this.post), "kr"))));
40
- }
41
- static get is() { return "hemfixarna-box"; }
42
- static get properties() {
43
- return {
44
- "post": {
45
- "type": "unknown",
46
- "mutable": false,
47
- "complexType": {
48
- "original": "Category | Product | Service",
49
- "resolved": "Category | Product | Service",
50
- "references": {
51
- "Category": {
52
- "location": "import",
53
- "path": "../../types"
54
- },
55
- "Product": {
56
- "location": "import",
57
- "path": "../../types"
58
- },
59
- "Service": {
60
- "location": "import",
61
- "path": "../../types"
62
- }
63
- }
64
- },
65
- "required": false,
66
- "optional": false,
67
- "docs": {
68
- "tags": [],
69
- "text": ""
70
- }
71
- },
72
- "category": {
73
- "type": "unknown",
74
- "mutable": false,
75
- "complexType": {
76
- "original": "CustomerCategory | CustomerSubCategory | Product",
77
- "resolved": "CustomerCategory | CustomerSubCategory | Product",
78
- "references": {
79
- "CustomerCategory": {
80
- "location": "import",
81
- "path": "../../types"
82
- },
83
- "CustomerSubCategory": {
84
- "location": "import",
85
- "path": "../../types"
86
- },
87
- "Product": {
88
- "location": "import",
89
- "path": "../../types"
90
- }
91
- }
92
- },
93
- "required": false,
94
- "optional": false,
95
- "docs": {
96
- "tags": [],
97
- "text": ""
98
- }
99
- },
100
- "icon": {
101
- "type": "string",
102
- "mutable": false,
103
- "complexType": {
104
- "original": "string",
105
- "resolved": "string",
106
- "references": {}
107
- },
108
- "required": false,
109
- "optional": false,
110
- "docs": {
111
- "tags": [],
112
- "text": ""
113
- },
114
- "attribute": "icon",
115
- "reflect": false
116
- },
117
- "postTitle": {
118
- "type": "string",
119
- "mutable": false,
120
- "complexType": {
121
- "original": "string",
122
- "resolved": "string",
123
- "references": {}
124
- },
125
- "required": false,
126
- "optional": false,
127
- "docs": {
128
- "tags": [],
129
- "text": ""
130
- },
131
- "attribute": "post-title",
132
- "reflect": false
133
- }
134
- };
135
- }
136
- static get elementRef() { return "el"; }
137
- }
138
- //# sourceMappingURL=hemfixarna-box.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hemfixarna-box.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-box/hemfixarna-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAM9C,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, Prop, h } from '@stencil/core';\nimport state from '../../store';\nimport { Category, CustomerCategory, CustomerSubCategory, Product, Service } from '../../types';\nimport { getProductPrice } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\nimport { isProduct } from '../../utils/types';\n\n@Component({\n tag: 'hemfixarna-box',\n shadow: false,\n})\nexport class HemfixarnaBox {\n @Prop() post: Category | Product | Service;\n @Prop() category: CustomerCategory | CustomerSubCategory | Product;\n @Prop() icon: string;\n @Prop() postTitle: string;\n @Element() private el: HTMLElement;\n\n setTaxonomy(taxonomy: Category | Service | Product) {\n if (taxonomy) {\n if ((taxonomy as Category)?.taxonomy === 'service_cat') {\n state.selectedCategory = taxonomy as Category;\n state.step = 2;\n } else if ((taxonomy as Service)?.post_type === 'service') {\n state.selectedService = taxonomy as Service;\n state.step = 3;\n } else if ((taxonomy as Product)?.post_type === 'ikea_product') {\n state.selectedProduct = taxonomy as Product;\n state.step = 4;\n }\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n }\n }\n\n setProduct() {\n state.selectedProduct = this.category as Product;\n state.step = 4;\n state.selectedCustomerCategory = null;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n }\n\n render() {\n return this.category ? (\n <Fragment>\n {isProduct(this.category) ? (\n <li onClick={() => this.setProduct()}>\n <img class=\"hemfixarna_logo\" height={82} src={this.category.icon as string} alt={this.category.post_name} />\n <div>\n <p>{this.category.title}</p>\n {!this.category.invoice ? <p class=\"price\">Från {getProductPrice(this.category)}kr</p> : null}\n </div>\n </li>\n ) : (\n <li onClick={() => (state.selectedCustomerCategory = this.category as CustomerCategory)}>\n <img class=\"hemfixarna_logo\" height={82} src={this.category.icon} alt={this.category.name} />\n <div>\n <p>{this.category.name}</p>\n </div>\n </li>\n )}\n </Fragment>\n ) : (\n <li onClick={() => this.setTaxonomy(this.post)}>\n {this.post.icon && <img class=\"hemfixarna_logo\" height={82} src={this.icon} alt={this.postTitle} />}\n <div>\n <p>{this.postTitle}</p>\n {state.step === 3 && <p class=\"price\">Från {getProductPrice(this.post as Product)}kr</p>}\n </div>\n </li>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
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,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;MACf,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;EACH,CAAC;EAED,mBAAmB;IACjB,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;IACf,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC;IACtC,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC1B,UAAU,CAA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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 +0,0 @@
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,18 +0,0 @@
1
- import { h } from '@stencil/core';
2
- import state from '../../store';
3
- export class HemfixarnaCategory {
4
- setSelectedService(service) {
5
- state.selectedService = service;
6
- state.step = 3;
7
- }
8
- render() {
9
- return (h("div", null, h("h2", null, state.selectedCategory.name), h("div", { class: "hemfixarna_categories--wrapper" }, h("div", null, h("ul", { class: "hemfixarna_categories" }, state.selectedCategory.services
10
- .sort((a, b) => (a.post_title < b.post_title ? -1 : 1))
11
- .map(s => {
12
- var _a;
13
- return (h("hemfixarna-box", { post: s, icon: (_a = s.icon.url) !== null && _a !== void 0 ? _a : s.icon, postTitle: s.post_title }));
14
- }))), h("hemfixarna-info", null))));
15
- }
16
- static get is() { return "hemfixarna-category"; }
17
- }
18
- //# sourceMappingURL=hemfixarna-category.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hemfixarna-category.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-category.tsx/hemfixarna-category.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,aAAa,CAAC;AAOhC,MAAM,OAAO,kBAAkB;EAC7B,kBAAkB,CAAC,OAAgB;IACjC,KAAK,CAAC,eAAe,GAAG,OAAO,CAAC;IAChC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;EACjB,CAAC;EAED,MAAM;IACJ,OAAO,CACL;MACE,cAAK,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAM;MACtC,WAAK,KAAK,EAAC,gCAAgC;QACzC;UACE,UAAI,KAAK,EAAC,uBAAuB,IAC9B,KAAK,CAAC,gBAAgB,CAAC,QAAQ;aAC7B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACtD,GAAG,CAAC,CAAC,CAAC,EAAE;;YAAC,OAAA,CACR,sBAAgB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAC,CAAC,CAAC,IAAa,CAAC,GAAG,mCAAK,CAAC,CAAC,IAAe,EAAE,SAAS,EAAE,CAAC,CAAC,UAAU,GAAmB,CACtH,CAAA;WAAA,CAAC,CACD,CACD;QACN,0BAAmB,CACf,CACF,CACP,CAAC;EACJ,CAAC;;CACF","sourcesContent":["import { Component, h } from '@stencil/core';\nimport state from '../../store';\nimport { Icon, Service } from '../../types';\n\n@Component({\n tag: 'hemfixarna-category',\n shadow: false,\n})\nexport class HemfixarnaCategory {\n setSelectedService(service: Service) {\n state.selectedService = service;\n state.step = 3;\n }\n\n render() {\n return (\n <div>\n <h2>{state.selectedCategory.name}</h2>\n <div class=\"hemfixarna_categories--wrapper\">\n <div>\n <ul class=\"hemfixarna_categories\">\n {state.selectedCategory.services\n .sort((a, b) => (a.post_title < b.post_title ? -1 : 1))\n .map(s => (\n <hemfixarna-box post={s} icon={(s.icon as Icon).url ?? (s.icon as string)} postTitle={s.post_title}></hemfixarna-box>\n ))}\n </ul>\n </div>\n <hemfixarna-info />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hemfixarna-checkout.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-checkout/hemfixarna-checkout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAc,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,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AAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,GAAI;cACpE,WAAK,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,GAAG,CACtD,CACD,CACH,CACP,CAAC;OACH;IACH,CAAC,CAAC;gBAnOsB,EAAE;qBACU,IAAI;wBACD,IAAI;mBACxB,KAAK;sBACM,EAAE;6BAEY,IAAI;0BACP,IAAI;oBACV,IAAI;sBACF,IAAI;;EAsHzC,iBAAiB;IACf,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;MAC5C,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;KACxB;EACH,CAAC;;;;;;;;;;;;;;CAiGF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business } from '../../types';\nimport { postOrder } from '../../utils/api';\nimport { FelixOrder, postPerson } from '../../utils/felixApi';\nimport { hideField } from '../../utils/form';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-checkout',\n shadow: false,\n})\nexport class HemfixarnaCheckout {\n @State() date: string = '';\n @State() dateError: string | null = null;\n @State() generalError: string | null = null;\n @State() loading = false;\n @State() enteredPin: string = '';\n @Element() private el: HTMLElement;\n @State() selectedSubSource: string | null = null;\n @State() partnerOrderId: string | null = null;\n @State() sellerID: string | null = null;\n @State() RefferalID: string | null = null;\n\n handleChangeDate = (e: Event) => {\n this.dateError = null;\n this.date = (e.target as HTMLInputElement).value;\n };\n\n handleChangeTerms = () => {\n this.generalError = null;\n };\n\n sendOrder = async () => {\n if (this.loading) return;\n this.loading = true;\n\n const startFees = state.cart\n .filter(item => item.start_fee_obj)\n .map(item => ({\n ID: item.start_fee_obj?.ID,\n title: item.start_fee_obj?.title,\n price: item.start_fee_obj?.price,\n rut: item.rut ? 1 : 0,\n rot: item.rot ? 1 : 0,\n green: item.green ? 1 : 0,\n }));\n\n let order: FelixOrder = {\n firstName: state.creditSafeUser.firstName,\n lastName: state.creditSafeUser.lastName,\n street: state.user.street,\n zip: state.user.zip,\n town: state.user.town,\n ssn: state.user.ssn,\n email: state.user.email,\n phone: state.user.phone,\n url: `${state.business === Business.string ? 'string' : state.business}-webk`,\n date: this.date,\n products: [\n ...state.cart.map(item => {\n const parts = item.parts.map(part => ({\n id: String(part.id),\n name: part.name,\n quantity: part.amount,\n rut: 0,\n rot: 0,\n start_fee_id: item.start_fee_obj ? item.start_fee_obj.ID : null,\n }));\n return [\n {\n id: String(item.id),\n name: item.name,\n quantity: item.amount,\n rot: item.rot ? 1 : 0,\n rut: item.rut ? 1 : 0,\n start_fee_id: item.start_fee_obj ? item.start_fee_obj.ID : null,\n },\n ...parts,\n ];\n }),\n ].flat(),\n start_fees: startFees,\n creditSafe: state.creditSafeUser,\n customer: state.business,\n id_source: state.customer.source ? state.customer.source.fieldData.So01_Name : '',\n id_sub_source: this.selectedSubSource ? this.selectedSubSource : '',\n seller_id: this.sellerID ?? '',\n referral_id: this.RefferalID ?? '',\n };\n\n const felixOrder = await postPerson(order);\n if (!felixOrder || !felixOrder.response?.scriptResult?.includes('OK')) {\n order = { ...order, felixStatus: 'error' };\n } else {\n order = { ...order, felixStatus: 'success' };\n }\n\n try {\n const { data: orderConfirm, status } = await postOrder(order);\n if (orderConfirm && status && status === 200) {\n state.step = 6;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n } else {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n } catch (error) {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n this.loading = false;\n };\n\n handleSubmit = (e: Event) => {\n e.preventDefault();\n this.generalError = null;\n const validDate = this.date.length > 0;\n if (!validDate) {\n this.dateError = 'Ange ett giltigt datum';\n }\n const checkBoxes = Array.from(this.el.querySelectorAll('input[type=\"checkbox\"]'));\n const notValidTerms = checkBoxes.find(i => !(i as HTMLInputElement).checked);\n if (notValidTerms) {\n this.generalError = 'Du måste godkänna villkoren';\n }\n if (state.customer.source && state.selectSource) {\n if (!this.sellerID) {\n this.generalError = 'Ange säljare';\n return;\n }\n if (state.customer.source.sub_sources?.length && !this.selectedSubSource) {\n this.generalError = 'Välj underkälla';\n return;\n }\n }\n if (validDate && !notValidTerms) {\n this.sendOrder();\n }\n };\n\n componentWillLoad() {\n if (Boolean(state.user && state.user.street)) {\n state.checkoutStep = 2;\n }\n }\n\n render = () => {\n const dateLogo = getAssetPath(`./assets/date.svg`);\n const down = getAssetPath(`./assets/down.svg`);\n const loading = getAssetPath(`./assets/spinner.gif`);\n\n if (state.checkoutEdit) {\n return <hemfixarna-address />;\n } else if (state.checkoutStep === 1) {\n return <hemfixarna-getuser />;\n } else if (state.checkoutStep === 2) {\n return (\n <div class=\"mb-2\">\n <div class=\"hemfixarna_addressinfo\">\n <div>\n <p>{hideField(state.user.firstName)}</p>\n <p>{hideField(state.user.lastName)}</p>\n <p>{state.user.email}</p>\n <p>{state.user.phone}</p>\n </div>\n <div>\n <p>{hideField(state.user.street)}</p>\n <p>{hideField(state.user.zip)}</p>\n <p>{hideField(state.user.town)}</p>\n </div>\n <button onClick={() => (state.checkoutEdit = true)}>Behöver du ändra adressen?</button>\n </div>\n <form onSubmit={e => this.handleSubmit(e)}>\n <div>\n <img src={dateLogo} width={24} />\n <input\n class={`${this.date.length ? 'input_active' : ''}`}\n min={new Date().toISOString().split('T')[0]}\n onChange={e => this.handleChangeDate(e)}\n type=\"date\"\n name=\"date\"\n value={this.date}\n />\n <label htmlFor=\"date\">Tidigaste datum för hembesök</label>\n <img src={down} width={24} />\n </div>\n {this.dateError && <span>{this.dateError}</span>}\n {state.customer.source && state.selectSource ? (\n <Fragment>\n <p>\n Inloggad som:\n <strong> {state.customer.source.fieldData.So01_Name}</strong>\n </p>\n <label>\n Säljare (SäljarId)\n <input type=\"text\" value={this.sellerID} onChange={e => (this.sellerID = (e.target as HTMLInputElement).value)} />\n </label>\n <label>\n PartnerOrderID (RefferalID)\n <input type=\"text\" value={this.RefferalID} onChange={e => (this.RefferalID = (e.target as HTMLInputElement).value)} />\n </label>\n {state.customer.source.sub_sources?.length ? (\n <div>\n <select onChange={e => (this.selectedSubSource = (e.target as HTMLSelectElement).value)}>\n <option disabled selected value=\"null\">\n Välj underkälla\n </option>\n {state.customer.source.sub_sources.map(sub => (\n <option value={sub['So_SubSource::Sus01_Name']}>{sub['So_SubSource::Sus01_Name']}</option>\n ))}\n </select>\n </div>\n ) : (\n <p>Det finns inga underkällor att välja</p>\n )}\n </Fragment>\n ) : null}\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span innerHTML={state.options.terms} />\n </label>\n {state.cart\n .filter(i => i.terms_checkout?.length)\n .map(item => (\n <Fragment>\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span>{item.terms_checkout}</span>\n </label>\n </Fragment>\n ))}\n {this.generalError && <span>{this.generalError}</span>}\n <div class={this.loading ? 'loading' : ''}>\n <input type=\"submit\" value={this.loading ? '' : 'Skicka bokning'} />\n <img width={20} height={20} src={loading} alt=\"spinner\" />\n </div>\n </form>\n </div>\n );\n }\n };\n}\n"]}
@@ -1,330 +0,0 @@
1
- import { Fragment, getAssetPath, h } from '@stencil/core';
2
- import state from '../../store';
3
- import { WidgetStyle } from '../../types';
4
- import { getCustomer, getGreenDiscount, getOptions, getRot, getRut, loginCustomer } from '../../utils/api';
5
- import { getProductPriceWithRotAndRut } from '../../utils/calc';
6
- import { scrollToTop } from '../../utils/scroll';
7
- export class HemfixarnaComponent {
8
- constructor() {
9
- this.triggerScrollTotop = () => {
10
- const el = this.el.shadowRoot.querySelector('.hemfixarna_content');
11
- scrollToTop(el);
12
- };
13
- this.modal = false;
14
- this.showModal = false;
15
- this.product = null;
16
- this.id = undefined;
17
- this.slug = undefined;
18
- this.business = undefined;
19
- this.widgetStyle = WidgetStyle.standard;
20
- this.buttonColor = undefined;
21
- this.buttonBg = undefined;
22
- this.proppedProduct = null;
23
- this.loginSourceError = null;
24
- }
25
- loadCategoryOrProduct(id) {
26
- this.proppedProduct = null;
27
- if (id.startsWith('c-')) {
28
- const categories = [...state.customer.categories, ...state.customer.categories.map(c => { var _a; return (_a = c.sub_categories) !== null && _a !== void 0 ? _a : []; })].flat();
29
- const category = categories.find(c => c && c.id === id.replace('c-', ''));
30
- if (category) {
31
- state.selectedCustomerCategory = category;
32
- state.step = 2;
33
- }
34
- }
35
- else {
36
- const products = state.customer.categories
37
- .map(c => (c.show_products ? c.products : c.sub_categories ? c.sub_categories.map(c => c.products) : []))
38
- .flat()
39
- .flat();
40
- const product = products.find(p => p && p.fields.ID === parseInt(id));
41
- if (product) {
42
- state.selectedProduct = product.fields;
43
- state.step = 4;
44
- this.proppedProduct = product.fields;
45
- }
46
- }
47
- }
48
- async watchIdChange(id) {
49
- if (id && state.customer) {
50
- if (id === 'maleri') {
51
- state.maleri = true;
52
- state.step = 4;
53
- }
54
- else {
55
- this.loadCategoryOrProduct(id);
56
- }
57
- }
58
- }
59
- async componentWillLoad() {
60
- state.business = this.business;
61
- const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);
62
- if (cart) {
63
- state.cart = JSON.parse(cart);
64
- }
65
- const user = window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);
66
- if (user) {
67
- state.user = JSON.parse(user);
68
- }
69
- const creditSafeUser = window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);
70
- if (creditSafeUser) {
71
- state.creditSafeUser = JSON.parse(creditSafeUser);
72
- }
73
- const [options, rut, rot, greenDiscount] = await Promise.all([getOptions(), getRut(), getRot(), getGreenDiscount()]);
74
- try {
75
- const customer = await getCustomer(this.business);
76
- if ((customer === null || customer === void 0 ? void 0 : customer.code) === 'not_found') {
77
- console.warn('customer not found');
78
- }
79
- else if (customer) {
80
- state.customer = customer;
81
- const id = this.id || this.slug;
82
- if (id) {
83
- if (id === 'maleri') {
84
- state.maleri = true;
85
- state.step = 4;
86
- }
87
- else {
88
- this.loadCategoryOrProduct(id);
89
- }
90
- }
91
- }
92
- }
93
- catch (error) {
94
- console.warn('customer not found');
95
- }
96
- state.rotOptions = rot;
97
- state.rutOptions = rut;
98
- state.greenOptions = greenDiscount;
99
- state.options = options;
100
- if (localStorage.getItem('select_source')) {
101
- state.selectSource = true;
102
- }
103
- }
104
- // Open close modal && click outside event
105
- openModal() {
106
- if (this.id) {
107
- if (this.id === 'maleri') {
108
- state.maleri = true;
109
- state.step = 4;
110
- }
111
- else {
112
- state.maleri = false;
113
- this.loadCategoryOrProduct(this.id);
114
- }
115
- }
116
- this.modal = true;
117
- setTimeout(() => {
118
- this.showModal = true;
119
- }, 50);
120
- }
121
- closeModal() {
122
- this.showModal = false;
123
- setTimeout(() => {
124
- this.modal = false;
125
- }, 200);
126
- }
127
- handleClick(e) {
128
- if ((e === null || e === void 0 ? void 0 : e.composedPath()[0]).classList.contains('hemfixarna_backdrop')) {
129
- this.closeModal();
130
- }
131
- const infomodal = this.el.shadowRoot.querySelector('.hemfixarna_infomodal');
132
- if (infomodal) {
133
- const isClickInside = infomodal.contains(e.composedPath()[0]);
134
- if (!isClickInside) {
135
- state.modal = null;
136
- }
137
- }
138
- }
139
- async handleLogin() {
140
- this.loginSourceError = null;
141
- const passwordInput = this.el.shadowRoot.querySelector('input[type="password"]');
142
- const password = passwordInput.value;
143
- try {
144
- const status = await loginCustomer({ id: state.customer.ID, password: password });
145
- if (status === 200) {
146
- state.showSourcePasswordPrompt = false;
147
- state.selectSource = true;
148
- }
149
- else {
150
- this.loginSourceError = 'Fel lösenord';
151
- }
152
- }
153
- catch (error) {
154
- console.log(error);
155
- this.loginSourceError = 'Fel lösenord';
156
- }
157
- }
158
- getCartLength() {
159
- return state.cart.reduce((acc, curr) => acc + curr.amount, 0);
160
- }
161
- render() {
162
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
163
- const logo = getAssetPath(`./assets/hemfixarna.svg`);
164
- const pensel = getAssetPath(`./assets/pensel.svg`);
165
- const monteringLogo = getAssetPath(`./assets/montering.svg`);
166
- return (h("div", { class: `hemfixarna hemfixarna-${this.business}` }, 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: {
167
- 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}`,
168
- 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}`,
169
- } }, "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), h("p", { innerHTML: state.modal.text }), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), state.showSourcePasswordPrompt ? (h("div", { class: "hemfixarna_source--pw hemfixarna_infomodal" }, h("form", { onSubmit: e => {
170
- e.preventDefault();
171
- this.handleLogin();
172
- } }, h("input", { type: "password", placeholder: "L\u00F6senord" }), h("input", { type: "submit", value: "Logga in" }), this.loginSourceError && h("span", null, "Fel l\u00F6senord")))) : null, 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' : ''}` })))));
173
- }
174
- static get is() { return "hemfixarna-component"; }
175
- static get encapsulation() { return "shadow"; }
176
- static get originalStyleUrls() {
177
- return {
178
- "$": ["hemfixarna.scss"]
179
- };
180
- }
181
- static get styleUrls() {
182
- return {
183
- "$": ["hemfixarna.css"]
184
- };
185
- }
186
- static get assetsDirs() { return ["assets"]; }
187
- static get properties() {
188
- return {
189
- "id": {
190
- "type": "string",
191
- "mutable": false,
192
- "complexType": {
193
- "original": "string",
194
- "resolved": "string",
195
- "references": {}
196
- },
197
- "required": false,
198
- "optional": true,
199
- "docs": {
200
- "tags": [],
201
- "text": ""
202
- },
203
- "attribute": "id",
204
- "reflect": false
205
- },
206
- "slug": {
207
- "type": "string",
208
- "mutable": false,
209
- "complexType": {
210
- "original": "string",
211
- "resolved": "string",
212
- "references": {}
213
- },
214
- "required": false,
215
- "optional": true,
216
- "docs": {
217
- "tags": [],
218
- "text": ""
219
- },
220
- "attribute": "slug",
221
- "reflect": false
222
- },
223
- "business": {
224
- "type": "string",
225
- "mutable": false,
226
- "complexType": {
227
- "original": "Business",
228
- "resolved": "Business",
229
- "references": {
230
- "Business": {
231
- "location": "import",
232
- "path": "../../types"
233
- }
234
- }
235
- },
236
- "required": false,
237
- "optional": false,
238
- "docs": {
239
- "tags": [],
240
- "text": ""
241
- },
242
- "attribute": "business",
243
- "reflect": false
244
- },
245
- "widgetStyle": {
246
- "type": "string",
247
- "mutable": false,
248
- "complexType": {
249
- "original": "WidgetStyle",
250
- "resolved": "WidgetStyle.alternative | WidgetStyle.alternative_2 | WidgetStyle.alternative_3 | WidgetStyle.standard",
251
- "references": {
252
- "WidgetStyle": {
253
- "location": "import",
254
- "path": "../../types"
255
- }
256
- }
257
- },
258
- "required": false,
259
- "optional": false,
260
- "docs": {
261
- "tags": [],
262
- "text": ""
263
- },
264
- "attribute": "widget-style",
265
- "reflect": false,
266
- "defaultValue": "WidgetStyle.standard"
267
- },
268
- "buttonColor": {
269
- "type": "string",
270
- "mutable": false,
271
- "complexType": {
272
- "original": "string",
273
- "resolved": "string",
274
- "references": {}
275
- },
276
- "required": false,
277
- "optional": true,
278
- "docs": {
279
- "tags": [],
280
- "text": ""
281
- },
282
- "attribute": "button-color",
283
- "reflect": false
284
- },
285
- "buttonBg": {
286
- "type": "string",
287
- "mutable": false,
288
- "complexType": {
289
- "original": "string",
290
- "resolved": "string",
291
- "references": {}
292
- },
293
- "required": false,
294
- "optional": true,
295
- "docs": {
296
- "tags": [],
297
- "text": ""
298
- },
299
- "attribute": "button-bg",
300
- "reflect": false
301
- }
302
- };
303
- }
304
- static get states() {
305
- return {
306
- "modal": {},
307
- "showModal": {},
308
- "product": {},
309
- "proppedProduct": {},
310
- "loginSourceError": {}
311
- };
312
- }
313
- static get elementRef() { return "el"; }
314
- static get watchers() {
315
- return [{
316
- "propName": "id",
317
- "methodName": "watchIdChange"
318
- }];
319
- }
320
- static get listeners() {
321
- return [{
322
- "name": "click",
323
- "method": "handleClick",
324
- "target": undefined,
325
- "capture": false,
326
- "passive": false
327
- }];
328
- }
329
- }
330
- //# sourceMappingURL=hemfixarna-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hemfixarna-component.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-component/hemfixarna-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAqB,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,a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;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, Listen, Prop, State, Watch, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Product, WidgetStyle } from '../../types';\nimport { getCustomer, getGreenDiscount, getOptions, getRot, getRut, loginCustomer } from '../../utils/api';\nimport { getProductPriceWithRotAndRut } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-component',\n styleUrl: 'hemfixarna.scss',\n shadow: true,\n assetsDirs: ['assets'],\n})\nexport class HemfixarnaComponent {\n @State() modal: boolean = false;\n @State() showModal: boolean = false;\n @State() product: Product | null = null;\n @Prop() id?: string;\n @Prop() slug?: string;\n @Prop() business: Business;\n @Prop() widgetStyle: WidgetStyle = WidgetStyle.standard;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n @State() proppedProduct: Product | null = null;\n @State() loginSourceError: null | string = null;\n\n @Element() private el: HTMLElement;\n\n loadCategoryOrProduct(id: string) {\n this.proppedProduct = null;\n if (id.startsWith('c-')) {\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === id.replace('c-', ''));\n if (category) {\n state.selectedCustomerCategory = category;\n state.step = 2;\n }\n } else {\n const products = state.customer.categories\n .map(c => (c.show_products ? c.products : c.sub_categories ? c.sub_categories.map(c => c.products) : []))\n .flat()\n .flat();\n const product = products.find(p => p && p.fields.ID === parseInt(id));\n if (product) {\n state.selectedProduct = product.fields;\n state.step = 4;\n this.proppedProduct = product.fields;\n }\n }\n }\n\n @Watch('id')\n async watchIdChange(id: string) {\n if (id && state.customer) {\n if (id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(id);\n }\n }\n }\n\n async componentWillLoad() {\n state.business = this.business;\n const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);\n if (cart) {\n state.cart = JSON.parse(cart);\n }\n const user = window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);\n if (user) {\n state.user = JSON.parse(user);\n }\n const creditSafeUser = window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);\n if (creditSafeUser) {\n state.creditSafeUser = JSON.parse(creditSafeUser);\n }\n\n const [options, rut, rot, greenDiscount] = await Promise.all([getOptions(), getRut(), getRot(), getGreenDiscount()]);\n\n try {\n const customer = await getCustomer(this.business);\n if (customer?.code === 'not_found') {\n console.warn('customer not found');\n } else if (customer) {\n state.customer = customer;\n const id = this.id || this.slug;\n if (id) {\n if (id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(id);\n }\n }\n }\n } catch (error) {\n console.warn('customer not found');\n }\n\n state.rotOptions = rot;\n state.rutOptions = rut;\n state.greenOptions = greenDiscount;\n state.options = options;\n\n if (localStorage.getItem('select_source')) {\n state.selectSource = true;\n }\n }\n\n triggerScrollTotop = () => {\n const el = this.el.shadowRoot.querySelector('.hemfixarna_content');\n scrollToTop(el);\n };\n\n // Open close modal && click outside event\n openModal() {\n if (this.id) {\n if (this.id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n state.maleri = false;\n this.loadCategoryOrProduct(this.id);\n }\n }\n this.modal = true;\n setTimeout(() => {\n this.showModal = true;\n }, 50);\n }\n closeModal() {\n this.showModal = false;\n setTimeout(() => {\n this.modal = false;\n }, 200);\n }\n @Listen('click')\n handleClick(e: Event) {\n if ((e?.composedPath()[0] as HTMLElement).classList.contains('hemfixarna_backdrop')) {\n this.closeModal();\n }\n const infomodal = this.el.shadowRoot.querySelector('.hemfixarna_infomodal');\n if (infomodal) {\n const isClickInside = infomodal.contains(e.composedPath()[0] as HTMLInputElement);\n if (!isClickInside) {\n state.modal = null;\n }\n }\n }\n\n async handleLogin() {\n this.loginSourceError = null;\n const passwordInput = this.el.shadowRoot.querySelector('input[type=\"password\"]');\n const password = (passwordInput as HTMLInputElement).value;\n\n try {\n const status = await loginCustomer({ id: state.customer.ID, password: password });\n if (status === 200) {\n state.showSourcePasswordPrompt = false;\n state.selectSource = true;\n } else {\n this.loginSourceError = 'Fel lösenord';\n }\n } catch (error) {\n console.log(error);\n this.loginSourceError = 'Fel lösenord';\n }\n }\n\n getCartLength() {\n return state.cart.reduce((acc, curr) => acc + curr.amount, 0);\n }\n\n render() {\n const logo = getAssetPath(`./assets/hemfixarna.svg`);\n const pensel = getAssetPath(`./assets/pensel.svg`);\n const monteringLogo = getAssetPath(`./assets/montering.svg`);\n\n return (\n <div class={`hemfixarna hemfixarna-${this.business}`}>\n <div class={`hemfixarna_box hemfixarna_box--${this.widgetStyle}`}>\n {[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (\n <img src={this.id === 'maleri' ? pensel : monteringLogo} alt=\"montering logo\" width={32} height={32} />\n ) : null}\n <div>\n <div>\n <p\n onClick={() => this.openModal()}\n class={`pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}`}\n >\n {this.id === 'maleri' ? (\n <span>Beräkna fast pris på måleri & tapetsering här</span>\n ) : (\n <Fragment>\n {!state.selectedCustomerCategory && !this.product && !this.proppedProduct ? (\n <Fragment>\n {state.customer?.widget_title ? (\n <span>{state.customer.widget_title}</span>\n ) : (\n <span>\n Montering/Installation - <strong class=\"underline\">se priser här</strong>\n </span>\n )}\n </Fragment>\n ) : (\n <Fragment>\n {this.product?.title || this.proppedProduct?.title || state.selectedCustomerCategory?.widget_title || (\n <span>\n Montering\n <wbr />\n /Installation {state.selectedCustomerCategory?.name ?? 'på plats'} - <strong class=\"underline\">se priser här</strong>\n </span>\n )}\n {this.proppedProduct && !this.product?.invoice && !this.proppedProduct?.invoice ? (\n <span>\n {' från'} <strong>{getProductPriceWithRotAndRut(this.proppedProduct || this.product)}kr</strong>\n </span>\n ) : null}\n </Fragment>\n )}\n </Fragment>\n )}\n </p>\n </div>\n {this.widgetStyle === WidgetStyle.standard ? <img src={logo} width={104} /> : null}\n {this.widgetStyle === WidgetStyle.alternative ? (\n <span class=\"p-s\">\n Utförs av <strong>Hemfixarna</strong>\n </span>\n ) : null}\n </div>\n {[WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (\n <button\n onClick={() => this.openModal()}\n class=\"hemfixarna_btn\"\n style={{\n color: this.buttonColor?.startsWith('#') || !this.buttonColor?.length ? this.buttonColor : `#${this.buttonColor}`,\n backgroundColor: this.buttonBg?.startsWith('#') || !this.buttonBg?.length ? this.buttonBg : `#${this.buttonBg}`,\n }}\n >\n Beställ här\n {this.getCartLength() > 0 && <span>{this.getCartLength()}</span>}\n </button>\n ) : null}\n {WidgetStyle.alternative_2 === this.widgetStyle ? (\n <div class=\"hemfixarna_altbtn\">\n <strong class=\"p-s\">Utförs av</strong>\n <img src={logo} alt=\"hemfixarna logo\" width={98} />\n </div>\n ) : null}\n </div>\n {this.modal && (\n <div>\n <div class={`hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}`}>\n {state.modal && (\n <div class=\"hemfixarna_infomodal\">\n {state.modal.title && <h2>{state.modal.title}</h2>}\n <p innerHTML={state.modal.text}></p>\n <div>\n <button onClick={() => (state.modal = null)}>Stäng</button>\n </div>\n </div>\n )}\n {state.showSourcePasswordPrompt ? (\n <div class=\"hemfixarna_source--pw hemfixarna_infomodal\">\n <form\n onSubmit={e => {\n e.preventDefault();\n this.handleLogin();\n }}\n >\n <input type=\"password\" placeholder=\"Lösenord\" />\n <input type=\"submit\" value=\"Logga in\" />\n {this.loginSourceError && <span>Fel lösenord</span>}\n </form>\n </div>\n ) : null}\n {state.customer && <hemfixarna-breadcrumbs closeModal={() => this.closeModal()} />}\n <div class={`hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}`}>\n {state.step < 4 && <hemfixarna-start />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order />}\n </div>\n </div>\n <div class={`hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}`}></div>\n </div>\n )}\n </div>\n );\n }\n}\n"]}