hemfixarna-web-components 1.8.5 → 1.8.8

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/cjs/hemfixarna-address_15.cjs.entry.js +2180 -0
  2. package/dist/cjs/hemfixarna-address_15.cjs.entry.js.map +1 -0
  3. package/dist/cjs/hemfixarna-byggmax.cjs.entry.js +27 -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 +28 -0
  8. package/dist/cjs/hemfixarna-components.cjs.js.map +1 -0
  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-669f8efa.js +55 -0
  48. package/dist/cjs/index-669f8efa.js.map +1 -0
  49. package/dist/cjs/index-6cce99a1.js +264 -0
  50. package/dist/cjs/index-6cce99a1.js.map +1 -0
  51. package/dist/cjs/index-e6926623.js +1741 -0
  52. package/dist/cjs/index-e6926623.js.map +1 -0
  53. package/dist/cjs/index.cjs.js +4 -0
  54. package/dist/cjs/index.cjs.js.map +1 -0
  55. package/dist/cjs/loader.cjs.js +24 -0
  56. package/dist/cjs/loader.cjs.js.map +1 -0
  57. package/dist/collection/assets/back.svg +3 -0
  58. package/dist/collection/assets/cart.svg +10 -0
  59. package/dist/collection/assets/checked.svg +10 -0
  60. package/dist/collection/assets/close.svg +5 -0
  61. package/dist/collection/assets/copy.png +0 -0
  62. package/dist/collection/assets/date.svg +6 -0
  63. package/dist/collection/assets/down.svg +3 -0
  64. package/dist/collection/assets/drag-drop.svg +3 -0
  65. package/dist/collection/assets/elfa.png +0 -0
  66. package/dist/collection/assets/gubbe-pensel.svg +1 -0
  67. package/dist/collection/assets/hemfixarna.svg +11 -0
  68. package/dist/collection/assets/hornbach/logo.svg +42 -0
  69. package/dist/collection/assets/hornbach/nav.jpg +0 -0
  70. package/dist/collection/assets/info.svg +5 -0
  71. package/dist/collection/assets/kbygg.svg +29 -0
  72. package/dist/collection/assets/minus.svg +4 -0
  73. package/dist/collection/assets/montering.svg +15 -0
  74. package/dist/collection/assets/norrgavel.svg +1 -0
  75. package/dist/collection/assets/pensel.svg +1 -0
  76. package/dist/collection/assets/plus.svg +5 -0
  77. package/dist/collection/assets/spinner.gif +0 -0
  78. package/dist/collection/assets/tesla.svg +1 -0
  79. package/dist/collection/assets/zaptec.svg +1 -0
  80. package/dist/collection/collection-manifest.json +47 -0
  81. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.css +0 -0
  82. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js +122 -0
  83. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js.map +1 -0
  84. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.css +0 -0
  85. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js +104 -0
  86. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js.map +1 -0
  87. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.css +0 -0
  88. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js +104 -0
  89. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +1 -0
  90. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +94 -0
  91. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +1 -0
  92. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js +94 -0
  93. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js.map +1 -0
  94. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.css +0 -0
  95. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js +104 -0
  96. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js.map +1 -0
  97. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.css +0 -0
  98. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js +104 -0
  99. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -0
  100. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +94 -0
  101. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +1 -0
  102. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js +94 -0
  103. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js.map +1 -0
  104. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js +94 -0
  105. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +1 -0
  106. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +94 -0
  107. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +1 -0
  108. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +94 -0
  109. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +1 -0
  110. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.css +0 -0
  111. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js +104 -0
  112. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -0
  113. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js +94 -0
  114. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js.map +1 -0
  115. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js +104 -0
  116. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js.map +1 -0
  117. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string.css +0 -0
  118. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js +113 -0
  119. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js.map +1 -0
  120. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js +94 -0
  121. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js.map +1 -0
  122. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +94 -0
  123. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -0
  124. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js +94 -0
  125. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js.map +1 -0
  126. package/dist/{hemfixarna-components/hemfixarna-address.entry.js → collection/components/hemfixarna-address/hemfixarna-address.js} +20 -14
  127. package/dist/collection/components/hemfixarna-address/hemfixarna-address.js.map +1 -0
  128. package/dist/collection/components/hemfixarna-box/hemfixarna-box.js +138 -0
  129. package/dist/collection/components/hemfixarna-box/hemfixarna-box.js.map +1 -0
  130. package/dist/{hemfixarna-components/hemfixarna-breadcrumbs.entry.js → collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js} +28 -13
  131. package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +1 -0
  132. package/dist/{hemfixarna-components/hemfixarna-cart.entry.js → collection/components/hemfixarna-cart/hemfixarna-cart.js} +6 -12
  133. package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js.map +1 -0
  134. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js +18 -0
  135. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +1 -0
  136. package/dist/{hemfixarna-components/hemfixarna-checkout.entry.js → collection/components/hemfixarna-checkout/hemfixarna-checkout.js} +26 -33
  137. package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -0
  138. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +330 -0
  139. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -0
  140. package/dist/collection/components/hemfixarna-component/hemfixarna.css +1077 -0
  141. package/dist/{hemfixarna-components/hemfixarna-contact.entry.js → collection/components/hemfixarna-contact/hemfixarna-contact.js} +29 -11
  142. package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js.map +1 -0
  143. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +135 -0
  144. package/dist/{hemfixarna-components/hemfixarna-demo.entry.js → collection/components/hemfixarna-demo/hemfixarna-demo.js} +46 -21
  145. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -0
  146. package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js +91 -0
  147. package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js.map +1 -0
  148. package/dist/{hemfixarna-components/hemfixarna-info.entry.js → collection/components/hemfixarna-info/hemfixarna-info.js} +7 -11
  149. package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +1 -0
  150. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.css +76 -0
  151. package/dist/{hemfixarna-components/hemfixarna-invoice.entry.js → collection/components/hemfixarna-invoice/hemfixarna-invoice.js} +27 -16
  152. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js.map +1 -0
  153. package/dist/{hemfixarna-components/hemfixarna-order.entry.js → collection/components/hemfixarna-order/hemfixarna-order.js} +7 -11
  154. package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -0
  155. package/dist/{hemfixarna-components/hemfixarna-orderrows.entry.js → collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js} +30 -12
  156. package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js.map +1 -0
  157. package/dist/collection/components/hemfixarna-product/hemfixarna-product.css +0 -0
  158. package/dist/{hemfixarna-components/hemfixarna-product.entry.js → collection/components/hemfixarna-product/hemfixarna-product.js} +28 -19
  159. package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -0
  160. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js +14 -0
  161. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +1 -0
  162. package/dist/{hemfixarna-components/hemfixarna-start.entry.js → collection/components/hemfixarna-start/hemfixarna-start.js} +48 -11
  163. package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +1 -0
  164. package/dist/collection/index.js +2 -0
  165. package/dist/collection/index.js.map +1 -0
  166. package/dist/collection/store/index.js +69 -0
  167. package/dist/collection/store/index.js.map +1 -0
  168. package/dist/collection/types/felixtypes.js +3 -0
  169. package/dist/collection/types/felixtypes.js.map +1 -0
  170. package/dist/collection/types/index.js +52 -0
  171. package/dist/collection/types/index.js.map +1 -0
  172. package/dist/{hemfixarna-components/api-e3c51cb3.js → collection/utils/api.js} +4 -7
  173. package/dist/collection/utils/api.js.map +1 -0
  174. package/dist/{hemfixarna-components/calc-b3b6593c.js → collection/utils/calc.js} +3 -6
  175. package/dist/collection/utils/calc.js.map +1 -0
  176. package/dist/collection/utils/creditSafe.js +18 -0
  177. package/dist/collection/utils/creditSafe.js.map +1 -0
  178. package/dist/{hemfixarna-components/enviroment-fd0a763a.js → collection/utils/enviroment.js} +6 -8
  179. package/dist/collection/utils/enviroment.js.map +1 -0
  180. package/dist/collection/utils/felixApi.js +19 -0
  181. package/dist/collection/utils/felixApi.js.map +1 -0
  182. package/dist/collection/utils/felixFunctions.js +188 -0
  183. package/dist/collection/utils/felixFunctions.js.map +1 -0
  184. package/dist/{hemfixarna-components/form-c53dca29.js → collection/utils/form.js} +2 -4
  185. package/dist/collection/utils/form.js.map +1 -0
  186. package/dist/{hemfixarna-components/scroll-6c26b5da.js → collection/utils/scroll.js} +2 -4
  187. package/dist/collection/utils/scroll.js.map +1 -0
  188. package/dist/{hemfixarna-components/types-6da209ae.js → collection/utils/types.js} +3 -6
  189. package/dist/collection/utils/types.js.map +1 -0
  190. package/dist/esm/hemfixarna-address_15.entry.js +2162 -0
  191. package/dist/esm/hemfixarna-address_15.entry.js.map +1 -0
  192. package/dist/{hemfixarna-components → esm}/hemfixarna-byggmax.entry.js +2 -2
  193. package/dist/esm/hemfixarna-byggmax.entry.js.map +1 -0
  194. package/dist/{hemfixarna-components → esm}/hemfixarna-category.entry.js +2 -2
  195. package/dist/esm/hemfixarna-category.entry.js.map +1 -0
  196. package/dist/esm/hemfixarna-components.js +23 -0
  197. package/dist/esm/hemfixarna-components.js.map +1 -0
  198. package/dist/{hemfixarna-components → esm}/hemfixarna-doro.entry.js +2 -2
  199. package/dist/esm/hemfixarna-doro.entry.js.map +1 -0
  200. package/dist/{hemfixarna-components → esm}/hemfixarna-elfa.entry.js +2 -2
  201. package/dist/esm/hemfixarna-elfa.entry.js.map +1 -0
  202. package/dist/{hemfixarna-components → esm}/hemfixarna-fargvaruhuset.entry.js +2 -2
  203. package/dist/esm/hemfixarna-fargvaruhuset.entry.js.map +1 -0
  204. package/dist/{hemfixarna-components → esm}/hemfixarna-flyttsmart.entry.js +2 -2
  205. package/dist/esm/hemfixarna-flyttsmart.entry.js.map +1 -0
  206. package/dist/{hemfixarna-components → esm}/hemfixarna-forebygg.entry.js +2 -2
  207. package/dist/esm/hemfixarna-forebygg.entry.js.map +1 -0
  208. package/dist/{hemfixarna-components → esm}/hemfixarna-hornbach.entry.js +2 -2
  209. package/dist/esm/hemfixarna-hornbach.entry.js.map +1 -0
  210. package/dist/{hemfixarna-components → esm}/hemfixarna-kbygg.entry.js +2 -2
  211. package/dist/esm/hemfixarna-kbygg.entry.js.map +1 -0
  212. package/dist/{hemfixarna-components → esm}/hemfixarna-klint.entry.js +2 -2
  213. package/dist/esm/hemfixarna-klint.entry.js.map +1 -0
  214. package/dist/{hemfixarna-components → esm}/hemfixarna-kund.entry.js +2 -2
  215. package/dist/esm/hemfixarna-kund.entry.js.map +1 -0
  216. package/dist/{hemfixarna-components → esm}/hemfixarna-norrgavel.entry.js +2 -2
  217. package/dist/esm/hemfixarna-norrgavel.entry.js.map +1 -0
  218. package/dist/{hemfixarna-components → esm}/hemfixarna-power.entry.js +2 -2
  219. package/dist/esm/hemfixarna-power.entry.js.map +1 -0
  220. package/dist/{hemfixarna-components → esm}/hemfixarna-service.entry.js +2 -2
  221. package/dist/esm/hemfixarna-service.entry.js.map +1 -0
  222. package/dist/{hemfixarna-components → esm}/hemfixarna-skanska.entry.js +2 -2
  223. package/dist/esm/hemfixarna-skanska.entry.js.map +1 -0
  224. package/dist/{hemfixarna-components → esm}/hemfixarna-sparfonster.entry.js +2 -2
  225. package/dist/esm/hemfixarna-sparfonster.entry.js.map +1 -0
  226. package/dist/{hemfixarna-components → esm}/hemfixarna-string-furniture.entry.js +2 -2
  227. package/dist/esm/hemfixarna-string-furniture.entry.js.map +1 -0
  228. package/dist/{hemfixarna-components → esm}/hemfixarna-superfront.entry.js +2 -2
  229. package/dist/esm/hemfixarna-superfront.entry.js.map +1 -0
  230. package/dist/{hemfixarna-components → esm}/hemfixarna-tesla.entry.js +2 -2
  231. package/dist/esm/hemfixarna-tesla.entry.js.map +1 -0
  232. package/dist/{hemfixarna-components → esm}/hemfixarna-traningspartner.entry.js +2 -2
  233. package/dist/esm/hemfixarna-traningspartner.entry.js.map +1 -0
  234. package/dist/{hemfixarna-components → esm}/hemfixarna-zaptec.entry.js +2 -2
  235. package/dist/esm/hemfixarna-zaptec.entry.js.map +1 -0
  236. package/dist/{hemfixarna-components/index-c8ce6f4b.js → esm/index-10f224fb.js} +7 -1
  237. package/dist/esm/index-10f224fb.js.map +1 -0
  238. package/dist/{hemfixarna-components/index-21ba2b05.js → esm/index-20d4c934.js} +5 -6
  239. package/dist/esm/index-20d4c934.js.map +1 -0
  240. package/dist/esm/index-ea1d222e.js +1710 -0
  241. package/dist/esm/index-ea1d222e.js.map +1 -0
  242. package/dist/esm/index.js +3 -0
  243. package/dist/esm/index.js.map +1 -0
  244. package/dist/esm/loader.js +20 -0
  245. package/dist/esm/loader.js.map +1 -0
  246. package/dist/esm/polyfills/core-js.js +11 -0
  247. package/dist/esm/polyfills/css-shim.js +1 -0
  248. package/dist/esm/polyfills/dom.js +79 -0
  249. package/dist/esm/polyfills/es5-html-element.js +1 -0
  250. package/dist/esm/polyfills/index.js +34 -0
  251. package/dist/esm/polyfills/system.js +6 -0
  252. package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -162
  253. package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
  254. package/dist/hemfixarna-components/index.esm.js +0 -1
  255. package/dist/hemfixarna-components/index.esm.js.map +1 -1
  256. package/dist/hemfixarna-components/p-07fcb3fc.entry.js +2 -0
  257. package/dist/hemfixarna-components/p-07fcb3fc.entry.js.map +1 -0
  258. package/dist/hemfixarna-components/p-14c97338.entry.js +2 -0
  259. package/dist/hemfixarna-components/p-14c97338.entry.js.map +1 -0
  260. package/dist/hemfixarna-components/p-19f6d847.entry.js +2 -0
  261. package/dist/hemfixarna-components/p-19f6d847.entry.js.map +1 -0
  262. package/dist/hemfixarna-components/p-23fc8b0d.entry.js +2 -0
  263. package/dist/hemfixarna-components/p-23fc8b0d.entry.js.map +1 -0
  264. package/dist/hemfixarna-components/p-2b9a21bc.entry.js +2 -0
  265. package/dist/hemfixarna-components/p-2b9a21bc.entry.js.map +1 -0
  266. package/dist/hemfixarna-components/p-4a026720.entry.js +2 -0
  267. package/dist/hemfixarna-components/p-4a026720.entry.js.map +1 -0
  268. package/dist/hemfixarna-components/p-4ea7af02.entry.js +2 -0
  269. package/dist/hemfixarna-components/p-4ea7af02.entry.js.map +1 -0
  270. package/dist/hemfixarna-components/p-5c9563b4.entry.js +2 -0
  271. package/dist/hemfixarna-components/p-5c9563b4.entry.js.map +1 -0
  272. package/dist/hemfixarna-components/p-6b1fb908.entry.js +2 -0
  273. package/dist/hemfixarna-components/p-6b1fb908.entry.js.map +1 -0
  274. package/dist/hemfixarna-components/p-6cec6885.entry.js +2 -0
  275. package/dist/hemfixarna-components/p-6cec6885.entry.js.map +1 -0
  276. package/dist/hemfixarna-components/p-7c0e45f5.entry.js +2 -0
  277. package/dist/hemfixarna-components/p-7c0e45f5.entry.js.map +1 -0
  278. package/dist/hemfixarna-components/p-7cfe7396.entry.js +2 -0
  279. package/dist/hemfixarna-components/p-7cfe7396.entry.js.map +1 -0
  280. package/dist/hemfixarna-components/p-87ddafde.entry.js +2 -0
  281. package/dist/hemfixarna-components/p-87ddafde.entry.js.map +1 -0
  282. package/dist/hemfixarna-components/p-8db25ce8.entry.js +2 -0
  283. package/dist/hemfixarna-components/p-8db25ce8.entry.js.map +1 -0
  284. package/dist/hemfixarna-components/p-8ec15c26.js +2 -0
  285. package/dist/hemfixarna-components/p-8ec15c26.js.map +1 -0
  286. package/dist/hemfixarna-components/p-9f8f105b.entry.js +2 -0
  287. package/dist/hemfixarna-components/p-9f8f105b.entry.js.map +1 -0
  288. package/dist/hemfixarna-components/p-bd9b6f5e.entry.js +2 -0
  289. package/dist/hemfixarna-components/p-bd9b6f5e.entry.js.map +1 -0
  290. package/dist/hemfixarna-components/p-c707b937.js +3 -0
  291. package/dist/hemfixarna-components/p-c707b937.js.map +1 -0
  292. package/dist/hemfixarna-components/p-cdc0d010.js +2 -0
  293. package/dist/hemfixarna-components/p-cdc0d010.js.map +1 -0
  294. package/dist/hemfixarna-components/p-d2f1b07d.entry.js +2 -0
  295. package/dist/hemfixarna-components/p-d2f1b07d.entry.js.map +1 -0
  296. package/dist/hemfixarna-components/p-db0ee919.entry.js +2 -0
  297. package/dist/hemfixarna-components/p-db0ee919.entry.js.map +1 -0
  298. package/dist/hemfixarna-components/p-e55c9df2.entry.js +2 -0
  299. package/dist/hemfixarna-components/p-e55c9df2.entry.js.map +1 -0
  300. package/dist/hemfixarna-components/p-e9e21b7a.entry.js +2 -0
  301. package/dist/hemfixarna-components/p-e9e21b7a.entry.js.map +1 -0
  302. package/dist/hemfixarna-components/p-ecc84ceb.entry.js +2 -0
  303. package/dist/hemfixarna-components/p-ecc84ceb.entry.js.map +1 -0
  304. package/dist/hemfixarna-components/p-eedfa2a6.entry.js +2 -0
  305. package/dist/hemfixarna-components/p-eedfa2a6.entry.js.map +1 -0
  306. package/dist/index.cjs.js +1 -0
  307. package/dist/index.js +1 -0
  308. package/dist/types/types/index.d.ts +8 -1
  309. package/package.json +1 -1
  310. package/dist/hemfixarna-components/api-e3c51cb3.js.map +0 -1
  311. package/dist/hemfixarna-components/app-globals-0f993ce5.js +0 -5
  312. package/dist/hemfixarna-components/app-globals-0f993ce5.js.map +0 -1
  313. package/dist/hemfixarna-components/calc-b3b6593c.js.map +0 -1
  314. package/dist/hemfixarna-components/css-shim-4fde41f0.js +0 -6
  315. package/dist/hemfixarna-components/css-shim-4fde41f0.js.map +0 -1
  316. package/dist/hemfixarna-components/dom-8de30773.js +0 -75
  317. package/dist/hemfixarna-components/dom-8de30773.js.map +0 -1
  318. package/dist/hemfixarna-components/enviroment-fd0a763a.js.map +0 -1
  319. package/dist/hemfixarna-components/form-c53dca29.js.map +0 -1
  320. package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +0 -1
  321. package/dist/hemfixarna-components/hemfixarna-box.entry.js +0 -49
  322. package/dist/hemfixarna-components/hemfixarna-box.entry.js.map +0 -1
  323. package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js.map +0 -1
  324. package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js.map +0 -1
  325. package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +0 -1
  326. package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +0 -1
  327. package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +0 -1
  328. package/dist/hemfixarna-components/hemfixarna-component.entry.js +0 -189
  329. package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +0 -1
  330. package/dist/hemfixarna-components/hemfixarna-contact.entry.js.map +0 -1
  331. package/dist/hemfixarna-components/hemfixarna-demo.entry.js.map +0 -1
  332. package/dist/hemfixarna-components/hemfixarna-doro.entry.js.map +0 -1
  333. package/dist/hemfixarna-components/hemfixarna-elfa.entry.js.map +0 -1
  334. package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js.map +0 -1
  335. package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js.map +0 -1
  336. package/dist/hemfixarna-components/hemfixarna-forebygg.entry.js.map +0 -1
  337. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +0 -770
  338. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +0 -1
  339. package/dist/hemfixarna-components/hemfixarna-hornbach.entry.js.map +0 -1
  340. package/dist/hemfixarna-components/hemfixarna-info.entry.js.map +0 -1
  341. package/dist/hemfixarna-components/hemfixarna-invoice.entry.js.map +0 -1
  342. package/dist/hemfixarna-components/hemfixarna-kbygg.entry.js.map +0 -1
  343. package/dist/hemfixarna-components/hemfixarna-klint.entry.js.map +0 -1
  344. package/dist/hemfixarna-components/hemfixarna-kund.entry.js.map +0 -1
  345. package/dist/hemfixarna-components/hemfixarna-norrgavel.entry.js.map +0 -1
  346. package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +0 -1
  347. package/dist/hemfixarna-components/hemfixarna-orderrows.entry.js.map +0 -1
  348. package/dist/hemfixarna-components/hemfixarna-power.entry.js.map +0 -1
  349. package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +0 -1
  350. package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +0 -1
  351. package/dist/hemfixarna-components/hemfixarna-skanska.entry.js.map +0 -1
  352. package/dist/hemfixarna-components/hemfixarna-sparfonster.entry.js.map +0 -1
  353. package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +0 -1
  354. package/dist/hemfixarna-components/hemfixarna-string-furniture.entry.js.map +0 -1
  355. package/dist/hemfixarna-components/hemfixarna-superfront.entry.js.map +0 -1
  356. package/dist/hemfixarna-components/hemfixarna-tesla.entry.js.map +0 -1
  357. package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js.map +0 -1
  358. package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js.map +0 -1
  359. package/dist/hemfixarna-components/index-21ba2b05.js.map +0 -1
  360. package/dist/hemfixarna-components/index-2ce8b901.js +0 -3461
  361. package/dist/hemfixarna-components/index-2ce8b901.js.map +0 -1
  362. package/dist/hemfixarna-components/index-c8ce6f4b.js.map +0 -1
  363. package/dist/hemfixarna-components/scroll-6c26b5da.js.map +0 -1
  364. package/dist/hemfixarna-components/shadow-css-af2290df.js +0 -389
  365. package/dist/hemfixarna-components/shadow-css-af2290df.js.map +0 -1
  366. package/dist/hemfixarna-components/types-6da209ae.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-invoice.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-invoice/hemfixarna-invoice.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,IAAI,GAAG,GAAG,SAAS,EAAE,mBAAmB,CAAC;AAsB/C,MAA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,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,GAAI,CACpF,CACH,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { getApiUrl } from '../../utils/enviroment';\n\nconst base = `${getApiUrl()}/wp-json/headless`;\n\ninterface FormElements extends HTMLCollection {\n descriptionInput: {\n value: string;\n };\n emailInput: {\n value: string;\n };\n telInput: {\n value: string;\n };\n termsInput: {\n checked: boolean;\n };\n}\n\n@Component({\n tag: 'hemfixarna-invoice',\n styleUrl: 'hemfixarna-invoice.scss',\n shadow: false,\n})\nexport class HemfixarnaInvoice {\n @State() formError: string | null = null;\n @Element() private el: HTMLElement;\n @State() displayImages: Array<string | ArrayBuffer> = [];\n @State() formImages: Array<File> = [];\n @State() formState: 'initial' | 'loading' = 'initial';\n\n isValidEmail(email: string) {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email);\n }\n\n componentDidRender() {\n const form = this.el.querySelector('form') as HTMLFormElement;\n if (form) {\n form.addEventListener('input', () => {\n this.formError = null;\n });\n }\n }\n\n disconnectedCallback() {\n const form = this.el.querySelector('form') as HTMLFormElement;\n if (form) {\n form.removeEventListener('input', () => {\n this.formError = null;\n });\n }\n }\n\n async submit(e: Event) {\n e.preventDefault();\n this.formState = 'loading';\n this.formError = null;\n const form = (e.currentTarget as HTMLFormElement).elements as FormElements;\n const values = {\n description: form.descriptionInput.value.length ? form.descriptionInput.value : null,\n email: form.emailInput.value.length ? form.emailInput.value : null,\n tel: form.telInput.value.length ? form.telInput.value : null,\n terms: form.termsInput?.checked,\n };\n\n if (!values.description) {\n this.formError = 'Vänligen fyll i formulärtexten';\n this.formState = 'initial';\n return;\n }\n if (!values.email || !this.isValidEmail(values.email)) {\n this.formError = 'Vänligen ange en giltig e-postadress';\n this.formState = 'initial';\n return;\n }\n if (!values.tel) {\n this.formError = 'Vänligen ange ditt telefonnummer';\n this.formState = 'initial';\n return;\n }\n if (state.selectedProduct.terms_show_checkbox && !values.terms) {\n this.formError = 'Vänligen acceptera villkoren';\n this.formState = 'initial';\n return;\n }\n\n const formData = new FormData();\n formData.append('text', values.description);\n formData.append('email', values.email);\n formData.append('phone', values.tel);\n formData.append('customer', state.business);\n\n this.formImages.forEach(file => {\n formData.append('images[]', file);\n });\n\n formData.append(\n 'product',\n JSON.stringify({\n title: state.selectedProduct.title,\n amount: 1,\n has_rut: state.selectedProduct.rut,\n has_rot: state.selectedProduct.rot,\n has_green: state.selectedProduct.green,\n ID: state.selectedProduct.ID,\n parts: [],\n }),\n );\n\n try {\n const res = await fetch(`${base}/saveinvoiceproduct`, {\n method: 'POST',\n body: formData,\n });\n const { response } = await res.json();\n if (response.code === 200) {\n state.checkoutInvoice = true;\n state.step = 6;\n } else {\n this.formError = 'Vi kan inte ta emot din beställning just nu';\n this.formState = 'initial';\n }\n } catch (error) {\n this.formError = 'Vi kan inte ta emot din beställning just nu';\n this.formState = 'initial';\n }\n }\n\n handleImageDrop(e: DragEvent) {\n e.preventDefault();\n const files = e.dataTransfer.files;\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n\n if (file.type.startsWith('image/')) {\n const reader = new FileReader();\n\n reader.onload = () => {\n this.displayImages = [...this.displayImages, reader.result];\n this.formImages = [...this.formImages, file];\n };\n\n reader.readAsDataURL(file);\n }\n }\n }\n\n handleFileInputChange(e: Event) {\n e.preventDefault();\n const files = (e.target as HTMLInputElement).files;\n\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n if (file.type.startsWith('image/')) {\n const reader = new FileReader();\n reader.onload = () => {\n this.displayImages = [...this.displayImages, reader.result];\n this.formImages = [...this.formImages, file];\n };\n\n reader.readAsDataURL(file);\n }\n }\n }\n\n handleImageClick() {\n (this.el.querySelector('.hemfixarna-file-upload') as HTMLInputElement).click();\n }\n\n preventDragOver(e: DragEvent) {\n e.preventDefault();\n }\n\n removeImage(index: number) {\n this.displayImages = this.displayImages.filter((_, i) => i !== index);\n this.formImages = this.formImages.filter((_, i) => i !== index);\n }\n\n render() {\n const upload = getAssetPath(`./assets/drag-drop.svg`);\n return (\n <div class=\"invoice\">\n {state.selectedProduct?.invoice_description ? <p>{state.selectedProduct.invoice_description}</p> : null}\n <form onSubmit={e => this.submit(e)}>\n <textarea name=\"descriptionInput\" placeholder=\"Beskriv ditt ärende\" />\n <div role=\"button\" aria-label=\"upload image\" onDragOver={e => this.preventDragOver(e)} onDrop={e => this.handleImageDrop(e)} onClick={() => this.handleImageClick()}>\n <img src={upload} alt=\"hemfixarna_logo\" width={24} />\n <div>\n <p>Bifoga ev bilder</p>\n <span>(dra bilder hit)</span>\n </div>\n <input onChange={e => this.handleFileInputChange(e)} class=\"hemfixarna-file-upload\" accept=\"image/*\" type=\"file\" multiple name=\"fileInput\" />\n </div>\n <div class=\"invoice-preview\">\n {this.displayImages.map((img, i) => (\n <div key={i}>\n <img src={img as string} alt=\"uploaded image\" />\n <button onClick={() => this.removeImage(i)}>\n <img src={getAssetPath(`./assets/close.svg`)} alt=\"close\" />\n </button>\n </div>\n ))}\n </div>\n <input placeholder=\"E-post\" type=\"email\" name=\"emailInput\" />\n <input placeholder=\"Telefonnummer\" type=\"tel\" name=\"telInput\" />\n {state.selectedProduct.terms_show_checkbox ? (\n <label>\n <input type=\"checkbox\" name=\"termsInput\" />\n {state.selectedProduct.terms}\n </label>\n ) : null}\n {this.formError ? <span>{this.formError}</span> : null}\n <input type=\"submit\" value={this.formState === 'loading' ? 'Skickar' : 'Kontakta mig'} />\n </form>\n </div>\n );\n }\n}\n"]}
@@ -1,9 +1,7 @@
1
- import { r as registerInstance, h } from './index-2ce8b901.js';
2
- import { s as state } from './index-21ba2b05.js';
3
-
4
- const HemfixarnaOrder = class {
5
- constructor(hostRef) {
6
- registerInstance(this, hostRef);
1
+ import { h } from '@stencil/core';
2
+ import state from '../../store';
3
+ export class HemfixarnaOrder {
4
+ constructor() {
7
5
  this.render = () => {
8
6
  return (h("div", { style: { background: `url(${state.options.thank_you_image})` }, class: "hemfixarna_order" }, h("div", null), h("div", null, h("h2", null, state.checkoutInvoice ? 'Tack för din förfrågan' : 'Tack för din bokning'), state.checkoutInvoice ? h("p", null, "Vi \u00E5terkommer inom kort till dig p\u00E5 angivet telefonnummer eller epost") : null, state.checkoutInvoice ? h("div", null) : h("hemfixarna-orderrows", { cart: false }), h("span", { onClick: () => this.resetShop() }, h("button", null, "G\u00F6r en ny bokning")), h("hemfixarna-info", null))));
9
7
  };
@@ -20,8 +18,6 @@ const HemfixarnaOrder = class {
20
18
  disconnectedCallback() {
21
19
  this.resetShop();
22
20
  }
23
- };
24
-
25
- export { HemfixarnaOrder as hemfixarna_order };
26
-
27
- //# sourceMappingURL=hemfixarna-order.entry.js.map
21
+ static get is() { return "hemfixarna-order"; }
22
+ }
23
+ //# sourceMappingURL=hemfixarna-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-order.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-order/hemfixarna-order.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,aAAa,CAAC;AAMhC,MAAM,OAAO,eAAe;EAJ5B;IAmBE,WAAM,GAAG,GAAG,EAAE;MACZ,OAAO,CACL,WAAK,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,eAAe,GAAG,EAAE,EAAE,KAAK,EAAC,kBAAkB;QAC3F,cAAW;QACX;UACE,cAAK,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,sBAAsB,CAAM;UACnF,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,+FAA4E,CAAC,CAAC,CAAC,IAAI;UAC3G,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,cAAW,CAAC,CAAC,CAAC,4BAAsB,IAAI,EAAE,KAAK,GAAyB;UACjG,YAAM,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE;YACnC,2CAAkC,CAC7B;UACP,0BAAmB,CACf,CACF,CACP,CAAC;IACJ,CAAC,CAAC;GACH;EA9BC,SAAS;IACP,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;IAChB,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;EACzB,CAAC;EAED,oBAAoB;IAClB,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;;CAkBF","sourcesContent":["import { Component, h } from '@stencil/core';\nimport state from '../../store';\n\n@Component({\n tag: 'hemfixarna-order',\n shadow: false,\n})\nexport class HemfixarnaOrder {\n resetShop() {\n state.step = 1;\n state.cart = [];\n state.selectedCategory = null;\n state.selectedService = null;\n state.selectedProduct = null;\n state.maleri = null;\n state.checkoutStep = 1;\n }\n\n disconnectedCallback() {\n this.resetShop();\n }\n\n render = () => {\n return (\n <div style={{ background: `url(${state.options.thank_you_image})` }} class=\"hemfixarna_order\">\n <div></div>\n <div>\n <h2>{state.checkoutInvoice ? 'Tack för din förfrågan' : 'Tack för din bokning'}</h2>\n {state.checkoutInvoice ? <p>Vi återkommer inom kort till dig på angivet telefonnummer eller epost</p> : null}\n {state.checkoutInvoice ? <div></div> : <hemfixarna-orderrows cart={false}></hemfixarna-orderrows>}\n <span onClick={() => this.resetShop()}>\n <button>Gör en ny bokning</button>\n </span>\n <hemfixarna-info />\n </div>\n </div>\n );\n };\n}\n"]}
@@ -1,10 +1,8 @@
1
- import { r as registerInstance, h, e as getAssetPath, F as Fragment } from './index-2ce8b901.js';
2
- import { s as state } from './index-21ba2b05.js';
3
- import { c as calculateStartFee, d as groupCartItemsByStartFee, a as getProductPrice, b as getPartPrice, e as calculateRot, f as calculateRut, h as calculateGreenDiscount, i as getTotalPrice } from './calc-b3b6593c.js';
4
-
5
- const HemfixarnaOrderrows = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
1
+ import { Fragment, getAssetPath, h } from '@stencil/core';
2
+ import state from '../../store';
3
+ import { groupCartItemsByStartFee, calculateStartFee, calculateGreenDiscount, calculateRot, calculateRut, getPartPrice, getProductPrice, getTotalPrice } from '../../utils/calc';
4
+ export class HemfixarnaOrderrows {
5
+ constructor() {
8
6
  this.cart = true;
9
7
  }
10
8
  goToProduct(id) {
@@ -67,8 +65,28 @@ const HemfixarnaOrderrows = class {
67
65
  return (h("li", { class: "hemfixarna_cart--item", key: item.id }, h("div", null, h("div", null, item.icon && (h("img", { width: 30, src: (_a = item.icon.url) !== null && _a !== void 0 ? _a : item.icon, alt: item.name })), h("p", null, h("strong", null, item.amount, "x "), item.name)), this.cart && (h("button", { onClick: () => this.goToProduct(item.id) }, "\u00C4ndra"))), h("p", null, h("strong", null, getProductPrice(item, item.price, item.amount), "kr"), h("span", null, this.getDiscountedInfo(item))), item.parts.length > 0 && (h("ul", null, item.parts.map(part => (h("li", { key: part.name }, h("p", null, h("strong", null, part.amount, "x "), part.name), h("p", null, h("strong", null, getPartPrice(part, item, part.amount), "kr")))))))));
68
66
  })))))), h("div", { class: "hemfixarna_cart--additional" }, this.renderStartFees(), this.cart && state.cart.find((item) => item.rot) && (h("div", { class: "hemfixarna_cart--rutrot" }, h("div", null, h("label", { class: "switch" }, h("input", { checked: state.rot, onChange: () => (state.rot = !state.rot), type: "checkbox" }), h("span", { class: "slider" })), h("p", null, "ROT-avdrag")), h("p", null, "(-", state.rot ? calculateRot() : 0, "kr)"))), this.cart && state.cart.find((item) => item.rut) && (h("div", { class: "hemfixarna_cart--rutrot" }, h("div", null, h("label", { class: "switch" }, h("input", { onChange: () => (state.rut = !state.rut), checked: state.rut, type: "checkbox" }), h("span", { class: "slider" })), h("p", null, "RUT-avdrag")), h("p", null, "(-", state.rut ? calculateRut() : 0, "kr)"))), this.cart && state.cart.find((item) => item.green) && (h("div", { class: "hemfixarna_cart--rutrot" }, h("div", null, h("label", { class: "switch" }, h("input", { onChange: () => (state.green = !state.green), checked: state.green, type: "checkbox" }), h("span", { class: "slider" })), h("p", null, "Gr\u00F6n teknik avdrag")), h("p", null, "(-", state.green ? calculateGreenDiscount() : 0, "kr)")))), h("div", { class: "hemfixarna_cart--price" }, h("h2", null, "Totalbelopp: "), h("h2", null, getTotalPrice(), "kr"))));
69
67
  }
70
- };
71
-
72
- export { HemfixarnaOrderrows as hemfixarna_orderrows };
73
-
74
- //# sourceMappingURL=hemfixarna-orderrows.entry.js.map
68
+ static get is() { return "hemfixarna-orderrows"; }
69
+ static get properties() {
70
+ return {
71
+ "cart": {
72
+ "type": "boolean",
73
+ "mutable": false,
74
+ "complexType": {
75
+ "original": "boolean",
76
+ "resolved": "boolean",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": false,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": ""
84
+ },
85
+ "attribute": "cart",
86
+ "reflect": false,
87
+ "defaultValue": "true"
88
+ }
89
+ };
90
+ }
91
+ }
92
+ //# sourceMappingURL=hemfixarna-orderrows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-orderrows.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-orderrows/hemfixarna-orderrows.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAA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xB,CACG,CACZ,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Fragment, Prop, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { CartItem, Icon } from '../../types';\nimport { groupCartItemsByStartFee, calculateStartFee, calculateGreenDiscount, calculateRot, calculateRut, getPartPrice, getProductPrice, getTotalPrice } from '../../utils/calc';\n\n@Component({\n tag: 'hemfixarna-orderrows',\n shadow: false,\n})\nexport class HemfixarnaOrderrows {\n @Prop() cart: boolean = true;\n\n goToProduct(id: number) {\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 === id);\n if (product) {\n state.selectedProduct = product.fields;\n state.step = 4;\n }\n }\n\n openModal(title: string, text: string) {\n state.modal = {\n title,\n text,\n };\n }\n\n getDiscountedInfo(item: CartItem) {\n if (item.rut && state.rut) {\n return ' (efter RUT-avdrag)';\n } else if (item.rot && state.rot) {\n return ' (efter ROT-avdrag)';\n } else if (item.green && state.green) {\n return ' (efter Grön teknik avdrag)';\n } else {\n return '';\n }\n }\n\n renderStartFees() {\n const startFees = new Set();\n const fees = [];\n \n state.cart.forEach(item => {\n const startFee = item.start_fee_obj;\n if (startFee && !startFees.has(startFee.ID)) {\n startFees.add(startFee.ID);\n \n const rotStartFee = item.rot ? calculateStartFee().rot : 0;\n const rutStartFee = item.rut ? calculateStartFee().rut : 0;\n const greenStartFee = item.green ? calculateStartFee().green : 0;\n \n fees.push({\n id: startFee.ID,\n name: startFee.title,\n price: startFee.price,\n text: startFee.pop_up,\n rot: rotStartFee,\n rut: rutStartFee,\n green: greenStartFee,\n });\n }\n });\n \n return fees.map(fee => (\n <div key={fee.id} class=\"hemfixarna_cart--startfee\">\n <p onClick={() =>\n this.openModal(\n fee.name,\n fee.text\n )\n }>\n <strong>\n {fee.name}\n </strong>\n <img\n height={16}\n src={getAssetPath('./assets/info.svg')}\n alt=\"info monteringsavgift\"\n />\n </p>\n <p>\n {!fee.rut && !fee.rot && !fee.green && <span>{fee.price}kr</span>}\n {fee.rut > 0 && <span>{fee.rut}kr (RUT)</span>}\n {fee.rot > 0 && <span>{fee.rot}kr (ROT)</span>}\n {fee.green > 0 && <span>{fee.green}kr (Grön teknik)</span>}\n </p>\n </div>\n ));\n }\n \n\n render() {\n return (\n <Fragment>\n <ul class=\"hemfixarna_cart--items\">\n {Object.entries(groupCartItemsByStartFee(state.cart)).map(([startFeeID, items]) => (\n <li key={startFeeID} class=\"hemfixarna_cart--group\">\n <ul>\n {items.map(item => (\n <li class=\"hemfixarna_cart--item\" key={item.id}>\n <div>\n <div>\n {item.icon && (\n <img\n width={30}\n src={(item.icon as Icon).url ?? (item.icon as string)}\n alt={item.name}\n />\n )}\n <p>\n <strong>{item.amount}x </strong>\n {item.name}\n </p>\n </div>\n {this.cart && (\n <button onClick={() => this.goToProduct(item.id)}>Ändra</button>\n )}\n </div>\n <p>\n <strong>{getProductPrice(item, item.price, item.amount)}kr</strong>\n <span>{this.getDiscountedInfo(item)}</span>\n </p>\n {item.parts.length > 0 && (\n <ul>\n {item.parts.map(part => (\n <li key={part.name}>\n <p>\n <strong>{part.amount}x </strong>\n {part.name}\n </p>\n <p>\n <strong>{getPartPrice(part, item, part.amount)}kr</strong>\n </p>\n </li>\n ))}\n </ul>\n )}\n </li>\n ))}\n </ul>\n </li>\n ))}\n </ul>\n <div class=\"hemfixarna_cart--additional\">\n {this.renderStartFees()} \n {this.cart && state.cart.find((item: CartItem) => item.rot) && (\n <div class=\"hemfixarna_cart--rutrot\">\n <div>\n <label class=\"switch\">\n <input checked={state.rot} onChange={() => (state.rot = !state.rot)} type=\"checkbox\" />\n <span class=\"slider\"></span>\n </label>\n <p>ROT-avdrag</p>\n </div>\n <p>(-{state.rot ? calculateRot() : 0}kr)</p>\n </div>\n )}\n {this.cart && state.cart.find((item: CartItem) => item.rut) && (\n <div class=\"hemfixarna_cart--rutrot\">\n <div>\n <label class=\"switch\">\n <input onChange={() => (state.rut = !state.rut)} checked={state.rut} type=\"checkbox\" />\n <span class=\"slider\"></span>\n </label>\n <p>RUT-avdrag</p>\n </div>\n <p>(-{state.rut ? calculateRut() : 0}kr)</p>\n </div>\n )}\n {this.cart && state.cart.find((item: CartItem) => item.green) && (\n <div class=\"hemfixarna_cart--rutrot\">\n <div>\n <label class=\"switch\">\n <input onChange={() => (state.green = !state.green)} checked={state.green} type=\"checkbox\" />\n <span class=\"slider\"></span>\n </label>\n <p>Grön teknik avdrag</p>\n </div>\n <p>(-{state.green ? calculateGreenDiscount() : 0}kr)</p>\n </div>\n )}\n </div>\n\n <div class=\"hemfixarna_cart--price\">\n <h2>Totalbelopp: </h2>\n <h2>{getTotalPrice()}kr</h2>\n </div>\n </Fragment>\n );\n }\n}\n"]}
@@ -1,14 +1,10 @@
1
- import { r as registerInstance, e as getAssetPath, h, F as Fragment, i as getElement } from './index-2ce8b901.js';
2
- import { s as state } from './index-21ba2b05.js';
3
- import { B as Business } from './index-c8ce6f4b.js';
4
- import { a as getProductPrice, b as getPartPrice } from './calc-b3b6593c.js';
5
- import { s as scrollToTop } from './scroll-6c26b5da.js';
6
-
7
- const hemfixarnaProductCss = "";
8
-
9
- const HemfixarnaProduct = class {
10
- constructor(hostRef) {
11
- registerInstance(this, hostRef);
1
+ import { Fragment, getAssetPath, h } from '@stencil/core';
2
+ import state from '../../store';
3
+ import { Business } from '../../types';
4
+ import { getPartPrice, getProductPrice } from '../../utils/calc';
5
+ import { scrollToTop } from '../../utils/scroll';
6
+ export class HemfixarnaProduct {
7
+ constructor() {
12
8
  this.amount = 0;
13
9
  this.hideDescription = true;
14
10
  }
@@ -142,16 +138,29 @@ const HemfixarnaProduct = class {
142
138
  ? 'https://painting-dev.vercel.app/static/js/main.js'
143
139
  : 'https://painting-frontend.vercel.app/static/js/main.js', defer: true, async: true }), h("hemfixare-calculator", { title: state.options.maleri_title, subtitle: state.options.maleri_text, modal: "true", customer: state.business === Business.string ? 'string' : state.business })));
144
140
  }
145
- return state.selectedProduct ? (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), h("div", null, h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : h("h2", null, state.selectedProduct.invoice_price))), h("div", { class: "hemfixarna_product--grid" }, h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (h("li", { key: l.bullet }, h("img", { src: checked, alt: "checked" }), h("p", null, l.bullet)))))), state.selectedProduct.description && (h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (h("hemfixarna-invoice", null)) : (h(Fragment, null, h("ul", null, h("li", { class: "hemfixarna_product--item" }, h("div", null, h("p", null, state.selectedProduct.title), h("p", { class: "hemfixarna_product--price" }, getProductPrice(state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removeProduct() }), h("span", null, this.getAmount()), h("img", { src: plus, onClick: () => this.addProduct() }))), ((_c = state.selectedProduct.parts) === null || _c === void 0 ? void 0 : _c.length) &&
141
+ return state.selectedProduct ? (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), h("div", null, h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : h("h2", null, state.selectedProduct.invoice_price))), h("div", { class: "hemfixarna_product--grid" }, h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (h("li", { key: l.bullet }, h("img", { src: checked, alt: "checked" }), h("p", null, l.bullet)))))), state.selectedProduct.show_pdf && (h("a", { href: `http://hemfixarna.se/wp-json/felix/generatepdf/${state.selectedProduct.ID}`, target: "_blank", class: "generate-pdf-button" }, "Ladda ner tj\u00E4nstebeskrivning")), state.selectedProduct.description && (h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (h("hemfixarna-invoice", null)) : (h(Fragment, null, h("ul", null, h("li", { class: "hemfixarna_product--item" }, h("div", null, h("p", null, state.selectedProduct.title), h("p", { class: "hemfixarna_product--price" }, getProductPrice(state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removeProduct() }), h("span", null, this.getAmount()), h("img", { src: plus, onClick: () => this.addProduct() }))), ((_c = state.selectedProduct.parts) === null || _c === void 0 ? void 0 : _c.length) &&
146
142
  state.selectedProduct.parts.map(p => {
147
143
  var _a;
148
144
  return (h("li", { class: "hemfixarna_part" }, h("div", null, h("p", null, (_a = p.title) !== null && _a !== void 0 ? _a : p.title), h("p", { class: "hemfixarna_product--price" }, getPartPrice(p, state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removePart(p) }), h("span", null, this.getPartAmount(p.ID)), h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: plus, onClick: () => this.addPart(p) }))));
149
145
  })), h("h4", { class: "hemfixarna_product--total" }, "Totalt ", this.getTotalPrice(), " kr"), h("button", { onClick: () => this.goToCart(), class: `hemfixarna_buy ${this.getAmount() === 0 ? 'disabled' : ''}` }, "Forts\u00E4tt"))), !state.selectedProduct.hide_start_fee && ((_d = state.selectedProduct.start_fee_obj) === null || _d === void 0 ? void 0 : _d.title) && (h("p", { class: "hemfixarna_terms" }, h("strong", null, state.selectedProduct.start_fee_obj.title), h("br", null), h("span", { innerHTML: state.selectedProduct.start_fee_obj.description }))), state.options && h("hemfixarna-info", null))))) : null;
150
146
  }
151
- get el() { return getElement(this); }
152
- };
153
- HemfixarnaProduct.style = hemfixarnaProductCss;
154
-
155
- export { HemfixarnaProduct as hemfixarna_product };
156
-
157
- //# sourceMappingURL=hemfixarna-product.entry.js.map
147
+ static get is() { return "hemfixarna-product"; }
148
+ static get originalStyleUrls() {
149
+ return {
150
+ "$": ["hemfixarna-product.scss"]
151
+ };
152
+ }
153
+ static get styleUrls() {
154
+ return {
155
+ "$": ["hemfixarna-product.css"]
156
+ };
157
+ }
158
+ static get states() {
159
+ return {
160
+ "amount": {},
161
+ "hideDescription": {}
162
+ };
163
+ }
164
+ static get elementRef() { return "el"; }
165
+ }
166
+ //# sourceMappingURL=hemfixarna-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-product.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-product/hemfixarna-product.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,EAAc,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oBA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GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAI,CACpG,CACH,CACN,CAAA;iBAAA,CAAC,CACD;YACL,UAAI,KAAK,EAAC,2BAA2B;;cAAS,IAAI,CAAC,aAAa,EAAE;oBAAS;YAC3E,cAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,kBAAkB,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,oBAElG,CACA,CACZ;UACA,CAAC,KAAK,CAAC,eAAe,CAAC,cAAc,KAAI,MAAA,KAAK,CAAC,eAAe,CAAC,aAAa,0CAAE,KAAK,CAAA,IAAI,CACtF,SAAG,KAAK,EAAC,kBAAkB;YACzB,kBAAS,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,CAAU;YAC5D,aAAM;YACN,YAAM,SAAS,EAAE,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,GAAS,CACvE,CACL;UACA,KAAK,CAAC,OAAO,IAAI,0BAAmB,CACjC,CACF,CACF,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;EACX,CAAC;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Icon, Part } from '../../types';\nimport { getPartPrice, getProductPrice } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-product',\n styleUrl: 'hemfixarna-product.scss',\n shadow: false,\n})\nexport class HemfixarnaProduct {\n @State() amount: number = 0;\n @State() hideDescription: boolean = true;\n @Element() private el: HTMLElement;\n\n addProduct() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n productInCart.amount++;\n state.cart = [...state.cart];\n } else {\n state.cart = [\n ...state.cart,\n {\n id: state.selectedProduct.ID,\n rut: state.selectedProduct.rut,\n rot: state.selectedProduct.rot,\n green: state.selectedProduct.green,\n amount: 1,\n parts: [],\n price: state.selectedProduct.price,\n name: state.selectedProduct.title,\n start_fee: !state.selectedProduct.hide_start_fee,\n terms_checkout: state.selectedProduct.terms_checkout,\n icon: state.selectedProduct.icon,\n start_fee_obj: state.selectedProduct.start_fee_obj,\n },\n ];\n }\n }\n\n removeProduct() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart && productInCart.amount > 1) {\n productInCart.amount--;\n state.cart = [...state.cart];\n } else {\n state.cart = state.cart.filter(p => p.id !== state.selectedProduct.ID);\n }\n }\n\n //Handle cart and parts\n addPart(part: Part) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partInCart = productInCart.parts.find(sp => sp.id === part.ID);\n if (partInCart) {\n partInCart.amount++;\n productInCart.parts = [...productInCart.parts];\n } else {\n productInCart.parts = [...productInCart.parts, { id: part.ID, amount: 1, price: part.price, name: part.title ?? part.title }];\n }\n state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];\n }\n }\n\n removePart(part: Part) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partInCart = productInCart.parts.find(sp => sp.id === part.ID);\n if (partInCart && partInCart.amount > 1) {\n partInCart.amount--;\n productInCart.parts = [...productInCart.parts];\n } else {\n productInCart.parts = productInCart.parts.filter(sp => sp.id !== part.ID);\n }\n state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];\n }\n }\n\n goToCart() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n state.step = 5;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n }\n }\n\n getAmount() {\n return state.cart.find(p => p.id === state.selectedProduct.ID)?.amount || 0;\n }\n\n getPartAmount(partId: number) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n return productInCart?.parts.find(sp => sp.id === partId)?.amount || 0;\n }\n\n getTotalPrice() {\n let price = 0;\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partsPrice = productInCart.parts.reduce((acc, curr) => {\n const part = state.selectedProduct.parts.find(p => p.ID === curr.id);\n if (part) {\n return acc + part.price * curr.amount;\n }\n return acc;\n }, 0);\n price = state.selectedProduct.price * productInCart.amount + partsPrice;\n } else {\n price = state.selectedProduct.price;\n }\n return getProductPrice(state.selectedProduct, price);\n }\n\n componentDidRender() {\n const linkElem = document.createElement('link');\n linkElem.setAttribute('rel', 'stylesheet');\n linkElem.setAttribute('href', 'https://painting-frontend.vercel.app/static/css/main.css');\n const fonts = document.createElement('link');\n fonts.setAttribute('rel', 'stylesheet');\n fonts.setAttribute('href', 'https://painting-frontend.vercel.app/fonts.css');\n\n const checkAndInjectCSS = () => {\n const parents = this.el.getElementsByTagName('hemfixare-calculator');\n if (parents.length > 0 && parents[0].shadowRoot !== null) {\n parents[0].shadowRoot.appendChild(linkElem);\n parents[0].shadowRoot.appendChild(fonts);\n } else {\n setTimeout(checkAndInjectCSS, 1);\n }\n };\n\n checkAndInjectCSS();\n }\n\n render() {\n const checked = getAssetPath(`./assets/checked.svg`);\n const plus = getAssetPath(`./assets/plus.svg`);\n const minus = getAssetPath(`./assets/minus.svg`);\n\n if (state.maleri) {\n return (\n <div class=\"hemfixarna_painting\">\n <script\n type=\"text/javascript\"\n src={\n ['localhost', 'vercel'].some(v => window.location.href.includes(v))\n ? 'https://painting-dev.vercel.app/static/js/main.js'\n : 'https://painting-frontend.vercel.app/static/js/main.js'\n }\n defer\n async\n ></script>\n <hemfixare-calculator\n title={state.options.maleri_title}\n subtitle={state.options.maleri_text}\n modal=\"true\"\n customer={state.business === Business.string ? 'string' : state.business}\n ></hemfixare-calculator>\n </div>\n );\n }\n\n return state.selectedProduct ? (\n <div class=\"hemfixarna_product\">\n <div class=\"hemfixarna_product--top\">\n {state.selectedProduct.icon && (\n <img width={80} src={(state.selectedProduct.icon as Icon).url ?? (state.selectedProduct.icon as string)} alt={state.selectedProduct.title} />\n )}\n <div>\n <h1>{state.selectedProduct.title}</h1>\n {!state.selectedProduct.invoice ? <h2>{getProductPrice(state.selectedProduct)} kr/st</h2> : <h2>{state.selectedProduct.invoice_price}</h2>}\n </div>\n </div>\n\n <div class=\"hemfixarna_product--grid\">\n <div class=\"hemfixarna_product--left\">\n {state.selectedProduct.list?.length && (\n <ul class=\"hemfixarna_features\">\n {state.selectedProduct.list.map(l => (\n <li key={l.bullet}>\n <img src={checked} alt=\"checked\" />\n <p>{l.bullet}</p>\n </li>\n ))}\n </ul>\n )}\n {state.selectedProduct.show_pdf && (\n <a\n href={`http://hemfixarna.se/wp-json/felix/generatepdf/${state.selectedProduct.ID}`}\n target=\"_blank\"\n class=\"generate-pdf-button\"\n >\n Ladda ner tjänstebeskrivning\n </a>\n )}\n {state.selectedProduct.description && (\n <p\n onClick={() => (this.hideDescription = false)}\n class={`hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`}\n innerHTML={state.selectedProduct.description}\n ></p>\n )}\n </div>\n <div class=\"hemfixarna_product--right\">\n {state.selectedProduct.invoice ? (\n <hemfixarna-invoice />\n ) : (\n <Fragment>\n <ul>\n <li class=\"hemfixarna_product--item\">\n <div>\n <p>{state.selectedProduct.title}</p>\n <p class=\"hemfixarna_product--price\">{getProductPrice(state.selectedProduct)}kr/st</p>\n </div>\n <div class=\"hemfixarna_counter\">\n <img class={`${this.getAmount() === 0 ? 'disabled' : ''}`} src={minus} onClick={() => this.removeProduct()} />\n <span>{this.getAmount()}</span>\n <img src={plus} onClick={() => this.addProduct()} />\n </div>\n </li>\n {state.selectedProduct.parts?.length &&\n state.selectedProduct.parts.map(p => (\n <li class=\"hemfixarna_part\">\n <div>\n <p>{p.title ?? p.title}</p>\n <p class=\"hemfixarna_product--price\">{getPartPrice(p, state.selectedProduct)}kr/st</p>\n </div>\n <div class=\"hemfixarna_counter\">\n <img class={`${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`} src={minus} onClick={() => this.removePart(p)} />\n <span>{this.getPartAmount(p.ID)}</span>\n <img class={`${this.getAmount() === 0 ? 'disabled' : ''}`} src={plus} onClick={() => this.addPart(p)} />\n </div>\n </li>\n ))}\n </ul>\n <h4 class=\"hemfixarna_product--total\">Totalt {this.getTotalPrice()} kr</h4>\n <button onClick={() => this.goToCart()} class={`hemfixarna_buy ${this.getAmount() === 0 ? 'disabled' : ''}`}>\n Fortsätt\n </button>\n </Fragment>\n )}\n {!state.selectedProduct.hide_start_fee && state.selectedProduct.start_fee_obj?.title && (\n <p class=\"hemfixarna_terms\">\n <strong>{state.selectedProduct.start_fee_obj.title}</strong>\n <br />\n <span innerHTML={state.selectedProduct.start_fee_obj.description}></span>\n </p>\n )}\n {state.options && <hemfixarna-info />}\n </div>\n </div>\n </div>\n ) : null;\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { h } from '@stencil/core';
2
+ import state from '../../store';
3
+ export class HemfixarnaService {
4
+ render() {
5
+ return (h("div", null, h("h2", null, state.selectedService.post_title), h("div", { class: "hemfixarna_categories--wrapper" }, h("div", null, h("ul", { class: "hemfixarna_categories" }, state.selectedService.products
6
+ .sort((a, b) => (a.post_title < b.post_title ? -1 : 1))
7
+ .map(p => {
8
+ var _a;
9
+ return (h("hemfixarna-box", { post: p, icon: (_a = p.icon.url) !== null && _a !== void 0 ? _a : p.icon, postTitle: p.title }));
10
+ }))), h("hemfixarna-info", null))));
11
+ }
12
+ static get is() { return "hemfixarna-service"; }
13
+ }
14
+ //# sourceMappingURL=hemfixarna-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-service.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-service/hemfixarna-service.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,aAAa,CAAC;AAOhC,MAAM,OAAO,iBAAiB;EAC5B,MAAM;IACJ,OAAO,CACL;MACE,cAAK,KAAK,CAAC,eAAe,CAAC,UAAU,CAAM;MAC3C,WAAK,KAAK,EAAC,gCAAgC;QACzC;UACE,UAAI,KAAK,EAAC,uBAAuB,IAC9B,KAAK,CAAC,eAAe,CAAC,QAAQ;aAC5B,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,KAAK,GAAmB,CACjH,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 } from '../../types';\n\n@Component({\n tag: 'hemfixarna-service',\n shadow: false,\n})\nexport class HemfixarnaService {\n render() {\n return (\n <div>\n <h2>{state.selectedService.post_title}</h2>\n <div class=\"hemfixarna_categories--wrapper\">\n <div>\n <ul class=\"hemfixarna_categories\">\n {state.selectedService.products\n .sort((a, b) => (a.post_title < b.post_title ? -1 : 1))\n .map(p => (\n <hemfixarna-box post={p} icon={(p.icon as Icon).url ?? (p.icon as string)} postTitle={p.title}></hemfixarna-box>\n ))}\n </ul>\n </div>\n <hemfixarna-info />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -1,9 +1,7 @@
1
- import { r as registerInstance, e as getAssetPath, h } from './index-2ce8b901.js';
2
- import { s as state } from './index-21ba2b05.js';
3
-
4
- const HemfixarnaGrid = class {
5
- constructor(hostRef) {
6
- registerInstance(this, hostRef);
1
+ import { getAssetPath, h } from '@stencil/core';
2
+ import state from '../../store';
3
+ export class HemfixarnaGrid {
4
+ constructor() {
7
5
  this.tree = undefined;
8
6
  this.slug = undefined;
9
7
  }
@@ -30,8 +28,47 @@ const HemfixarnaGrid = class {
30
28
  return (h("hemfixarna-box", { post: c, icon: (_a = c.icon.url) !== null && _a !== void 0 ? _a : c.icon, postTitle: c.name }));
31
29
  })), h("hemfixarna-info", null))));
32
30
  }
33
- };
34
-
35
- export { HemfixarnaGrid as hemfixarna_start };
36
-
37
- //# sourceMappingURL=hemfixarna-start.entry.js.map
31
+ static get is() { return "hemfixarna-start"; }
32
+ static get properties() {
33
+ return {
34
+ "tree": {
35
+ "type": "unknown",
36
+ "mutable": false,
37
+ "complexType": {
38
+ "original": "Category",
39
+ "resolved": "Category",
40
+ "references": {
41
+ "Category": {
42
+ "location": "import",
43
+ "path": "../../types"
44
+ }
45
+ }
46
+ },
47
+ "required": false,
48
+ "optional": true,
49
+ "docs": {
50
+ "tags": [],
51
+ "text": ""
52
+ }
53
+ },
54
+ "slug": {
55
+ "type": "string",
56
+ "mutable": false,
57
+ "complexType": {
58
+ "original": "string",
59
+ "resolved": "string",
60
+ "references": {}
61
+ },
62
+ "required": false,
63
+ "optional": true,
64
+ "docs": {
65
+ "tags": [],
66
+ "text": ""
67
+ },
68
+ "attribute": "slug",
69
+ "reflect": false
70
+ }
71
+ };
72
+ }
73
+ }
74
+ //# sourceMappingURL=hemfixarna-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-start.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-start/hemfixarna-start.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;;;;;EAIzB,cAAc,CAAC,Q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,EAAE,CAAC,sBAAgB,QAAQ,EAAE,CAAC,CAAC,MAAM,GAAmB,CAAC;gBACzG,CAAC,CAAC,IAAI;YACV,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,sBAAgB,QAAQ,EAAE,CAAC,GAAmB,CAAC,CACnF;QACL,0BAAmB,CACf,CACF,CACP,CAAC,CAAC,CAAC,CACF;MACE,mCAAsB;MACtB,WAAK,KAAK,EAAC,gCAAgC;QACzC,UAAI,KAAK,EAAC,uBAAuB,IAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;WAChB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;WAC1C,GAAG,CAAC,CAAC,CAAC,EAAE;;UAAC,OAAA,CACR,sBAAgB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAC,CAAC,CAAC,IAAa,CAAC,GAAG,mCAAK,CAAC,CAAC,IAAe,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,GAAmB,CAChH,CAAA;SAAA,CAAC,CACD;QACL,0BAAmB,CACf,CACF,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Category, CustomerCategory, CustomerSubCategory, Icon } from '../../types';\n\n@Component({\n tag: 'hemfixarna-start',\n shadow: false,\n})\nexport class HemfixarnaGrid {\n @Prop() tree?: Category;\n @Prop() slug?: string;\n\n isMainCategory(category: CustomerCategory | CustomerSubCategory): category is CustomerCategory {\n return (category as CustomerCategory).show_products !== undefined;\n }\n\n handleMaleriClick() {\n state.step = 4;\n state.maleri = true;\n }\n\n render() {\n const maleriLogo = getAssetPath('./assets/gubbe-pensel.svg');\n return state.customer ? (\n <div>\n <h2>{state.selectedCustomerCategory ? state.selectedCustomerCategory.name : 'Alla tjänster'}</h2>\n <div class=\"hemfixarna_categories--wrapper\">\n <ul class=\"hemfixarna_categories\">\n {state.selectedCustomerCategory?.add_painting ? (\n <button onClick={() => this.handleMaleriClick()} class=\"hemfixarna_maleribox\">\n <img height={64} src={maleriLogo} alt=\"Måleri Logotyp\" />\n <p>Beräkna fast pris på måleri & tapetsering här</p>\n </button>\n ) : null}\n {state.selectedCustomerCategory\n ? this.isMainCategory(state.selectedCustomerCategory) && state.selectedCustomerCategory.sub_categories && !state.selectedCustomerCategory.show_products\n ? state.selectedCustomerCategory.sub_categories.map(c => <hemfixarna-box category={c}></hemfixarna-box>)\n : state.selectedCustomerCategory.products\n ? state.selectedCustomerCategory.products.map(c => <hemfixarna-box category={c.fields}></hemfixarna-box>)\n : null\n : state.customer.categories.map(c => <hemfixarna-box category={c}></hemfixarna-box>)}\n </ul>\n <hemfixarna-info />\n </div>\n </div>\n ) : (\n <div>\n <h2>Alla tjänster</h2>\n <div class=\"hemfixarna_categories--wrapper\">\n <ul class=\"hemfixarna_categories\">\n {this.tree.sub_cats\n .sort((a, b) => (a.name < b.name ? -1 : 1))\n .map(c => (\n <hemfixarna-box post={c} icon={(c.icon as Icon).url ?? (c.icon as string)} postTitle={c.name}></hemfixarna-box>\n ))}\n </ul>\n <hemfixarna-info />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC","sourcesContent":["export * from './components';\n"]}
@@ -0,0 +1,69 @@
1
+ import { createStore } from '@stencil/store';
2
+ const { state, onChange, } = createStore({
3
+ step: 1,
4
+ checkoutStep: 1,
5
+ checkoutEdit: false,
6
+ selectedCategory: null,
7
+ selectedService: null,
8
+ selectedProduct: null,
9
+ cart: [],
10
+ business: 'undefined',
11
+ options: null,
12
+ rut: true,
13
+ rot: true,
14
+ green: true,
15
+ token: null,
16
+ user: null,
17
+ modal: null,
18
+ rutOptions: null,
19
+ rotOptions: null,
20
+ greenOptions: null,
21
+ customer: null,
22
+ selectedCustomerCategory: null,
23
+ parentCategory: null,
24
+ creditSafeUser: null,
25
+ checkoutInvoice: false,
26
+ maleri: false,
27
+ sources: null,
28
+ selectSource: false,
29
+ showSourcePasswordPrompt: false,
30
+ });
31
+ onChange('cart', cart => {
32
+ window.sessionStorage.setItem(`hemfixarna-${state.business}-cart`, JSON.stringify(cart));
33
+ });
34
+ onChange('user', user => {
35
+ window.sessionStorage.setItem(`hemfixarna-${state.business}-user`, JSON.stringify(user));
36
+ });
37
+ onChange('creditSafeUser', user => {
38
+ window.sessionStorage.setItem(`hemfixarna-${state.business}-creditSafeUser`, JSON.stringify(user));
39
+ });
40
+ onChange('selectSource', selectSource => {
41
+ if (selectSource) {
42
+ localStorage.setItem('select_source', 'true');
43
+ }
44
+ });
45
+ onChange('selectedProduct', product => {
46
+ if (!state.customer || !product)
47
+ return;
48
+ const categories = [...state.customer.categories, ...state.customer.categories.map(c => { var _a; return (_a = c.sub_categories) !== null && _a !== void 0 ? _a : []; })].flat();
49
+ const category = categories.find(c => c && c.id === product.category);
50
+ if (category) {
51
+ state.parentCategory = category;
52
+ return;
53
+ }
54
+ state.parentCategory = null;
55
+ });
56
+ onChange('selectedCustomerCategory', category => {
57
+ if (!state.customer || !category)
58
+ return;
59
+ if (category.parent) {
60
+ const parent = state.customer.categories.find(c => c.id === category.parent);
61
+ if (parent) {
62
+ state.parentCategory = parent;
63
+ return;
64
+ }
65
+ }
66
+ state.parentCategory = null;
67
+ });
68
+ export default state;
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"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AC,CAAC,CAAC,EAAE,KAAM,QAAgC,CAAC,MAAM,CAAC,CAAC;IACtG,IAAI,MAAM,EAAE;MACV,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC;MAC9B,OAAO;KACR;GACF;EACD,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { createStore } from '@stencil/store';\nimport { OnChangeHandler } from '@stencil/store/dist/types';\nimport { Business, CartItem, Category, Customer, CustomerCategory, CustomerSubCategory, GreenOptions, Product, RotOptions, RutOptions, Service, User, WpOptions } from '../types';\nimport { CreditSafeUser } from '../types/felixtypes';\n\ntype StateType = {\n step: number;\n selectedCategory: Category | null;\n selectedService: Service | null;\n selectedProduct: Product | null;\n cart: Array<CartItem>;\n business: Business | 'undefined';\n options: WpOptions | null;\n rut: boolean;\n rot: boolean;\n green: boolean;\n token: string | null;\n checkoutStep: number;\n checkoutEdit: boolean;\n user: User | null;\n creditSafeUser: CreditSafeUser | null;\n modal: {\n title?: string;\n text: string;\n } | null;\n rutOptions: RutOptions | null;\n rotOptions: RotOptions | null;\n greenOptions: GreenOptions | null;\n customer: Customer | null;\n selectedCustomerCategory: CustomerCategory | CustomerSubCategory | null;\n parentCategory: CustomerCategory | CustomerSubCategory;\n checkoutInvoice: boolean;\n maleri: boolean;\n selectSource: boolean;\n showSourcePasswordPrompt: boolean;\n};\n\nconst {\n state,\n onChange,\n}: {\n state: StateType;\n onChange: OnChangeHandler<StateType>;\n} = createStore({\n step: 1,\n checkoutStep: 1,\n checkoutEdit: false,\n selectedCategory: null,\n selectedService: null,\n selectedProduct: null,\n cart: [],\n business: 'undefined',\n options: null,\n rut: true,\n rot: true,\n green: true,\n token: null,\n user: null,\n modal: null,\n rutOptions: null,\n rotOptions: null,\n greenOptions: null,\n customer: null,\n selectedCustomerCategory: null,\n parentCategory: null,\n creditSafeUser: null,\n checkoutInvoice: false,\n maleri: false,\n sources: null,\n selectSource: false,\n showSourcePasswordPrompt: false,\n});\n\nonChange('cart', cart => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-cart`, JSON.stringify(cart));\n});\n\nonChange('user', user => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-user`, JSON.stringify(user));\n});\n\nonChange('creditSafeUser', user => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-creditSafeUser`, JSON.stringify(user));\n});\n\nonChange('selectSource', selectSource => {\n if (selectSource) {\n localStorage.setItem('select_source', 'true');\n }\n});\n\nonChange('selectedProduct', product => {\n if (!state.customer || !product) return;\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === product.category);\n if (category) {\n state.parentCategory = category;\n return;\n }\n state.parentCategory = null;\n});\n\nonChange('selectedCustomerCategory', category => {\n if (!state.customer || !category) return;\n if ((category as CustomerSubCategory).parent) {\n const parent = state.customer.categories.find(c => c.id === (category as CustomerSubCategory).parent);\n if (parent) {\n state.parentCategory = parent;\n return;\n }\n }\n state.parentCategory = null;\n});\n\nexport default state;\n"]}
@@ -0,0 +1,3 @@
1
+ [];
2
+ export {};
3
+ //# sourceMappingURL=felixtypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"felixtypes.js","sourceRoot":"","sources":["../../src/types/felixtypes.ts"],"names":[],"mappings":"AA2BA,EAAE,CAAC","sourcesContent":["import { User } from '.';\n\ninterface FelixPerson {\n Pa01_FirstName: string;\n Pa02_LastName: string;\n Pa03_Address1: string;\n Pa04_Address2: string;\n Pa05_Zipcode: string;\n Pa06_City: string;\n Pa07_State: string;\n Pa08_Country: string;\n Pa12_PersonalNo: string;\n Pa20_Email: string;\n Pa30_Phone: string;\n Pa31_Phone2: string;\n Pa11_StatusExternal: string;\n Pa041_AssignmentAddress: string;\n Pa042_AssignmentZipCode: string;\n Pa043_AssignmentCity: string;\n}\n\ninterface GetFelixPersonRes {\n fieldData: FelixPerson;\n portalData: [];\n recordId: string;\n modId: string;\n}\n[];\n\ntype CreditSafeUser = Pick<User, 'firstName' | 'lastName' | 'street' | 'zip' | 'town'>;\n\nexport type { CreditSafeUser, FelixPerson, GetFelixPersonRes };\n"]}
@@ -0,0 +1,52 @@
1
+ // Match slug with partner slug in wp admin
2
+ // Dont forget to add the partners url to cors for creditsafe
3
+ // https://bitbucket.org/afonso-sweden/creditsafe-lookup/src/main/api/index.ts
4
+ export var Business;
5
+ (function (Business) {
6
+ Business["kund"] = "kund";
7
+ Business["byggmax"] = "byggmax";
8
+ Business["skanska"] = "skanska";
9
+ Business["string"] = "string-furniture";
10
+ Business["hornbach"] = "hornbach";
11
+ Business["forebygg"] = "forebygg";
12
+ Business["doro"] = "doro";
13
+ Business["elfa"] = "elfa";
14
+ Business["kbygg"] = "k-bygg";
15
+ Business["norrgavel"] = "norrgavel";
16
+ Business["fargvaruhuset"] = "fargvaruhuset";
17
+ Business["zaptec"] = "zaptec";
18
+ Business["tesla"] = "tesla";
19
+ Business["klint"] = "klint";
20
+ Business["flyttsmart"] = "flyttsmart";
21
+ Business["lg"] = "lg";
22
+ Business["sparfonster"] = "sparfonster";
23
+ Business["power"] = "power";
24
+ Business["traningspartner"] = "traningspartner";
25
+ Business["superfront"] = "superfront";
26
+ Business["inet"] = "inet";
27
+ Business["design24"] = "design24";
28
+ Business["netatonce"] = "netatonce";
29
+ Business["bygghemma"] = "bygghemma";
30
+ Business["badshop"] = "badshop";
31
+ Business["byggshop"] = "byggshop";
32
+ Business["golvshop"] = "golvshop";
33
+ Business["golvpoolen"] = "golvpoolen";
34
+ Business["webhallen"] = "webhallen";
35
+ Business["homeroom"] = "homeroom";
36
+ Business["pickyliving"] = "picky-living";
37
+ Business["amina"] = "amina";
38
+ Business["stgeorgesecuritystore"] = "st-george-security-store";
39
+ Business["whiteawaygroup"] = "whiteawaygroup";
40
+ })(Business || (Business = {}));
41
+ export var WidgetStyle;
42
+ (function (WidgetStyle) {
43
+ WidgetStyle["standard"] = "standard";
44
+ WidgetStyle["alternative"] = "alternative";
45
+ WidgetStyle["alternative_2"] = "alternative_2";
46
+ WidgetStyle["alternative_3"] = "alternative_3";
47
+ })(WidgetStyle || (WidgetStyle = {}));
48
+ export var TopCategory;
49
+ (function (TopCategory) {
50
+ TopCategory["byggmax"] = "category/bygg";
51
+ })(TopCategory || (TopCategory = {}));
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,6DAA6D;AAC7D,8EAA8E;AAE9E,MAAM,CAAN,IAAY,QAmCX;AAnCD,WAAY,QAAQ;EAClB,yBAAa,CAAA;EACb,+BAAmB,CAAA;EACnB,+BAAmB,CAAA;EACnB,uCAA2B,CAAA;EAC3B,iCAAqB,CAAA;EACrB,iCAAqB,CAAA;EACrB,yBAAa,CAAA;EACb,yBAAa,CAAA;EACb,4BAAgB,CAAA;EAChB,mCAAuB,CAAA;EACvB,2CAA+B,CAAA;EAC/B,6BAAiB,CAAA;EACjB,2BAAe,CAAA;EACf,2BAAe,CAAA;EACf,qCAAyB,CAAA;EACzB,qBAAS,CAAA;EACT,uCAA2B,CAAA;EAC3B,2BAAe,CAAA;EACf,+CAAmC,CAAA;EACnC,qCAAyB,CAAA;EACzB,yBAAa,CAAA;EACb,iCAAqB,CAAA;EACrB,mCAAuB,CAAA;EACvB,mCAAuB,CAAA;EACvB,+BAAmB,CAAA;EACnB,iCAAqB,CAAA;EACrB,iCAAqB,CAAA;EACrB,qCAAyB,CAAA;EACzB,mCAAuB,CAAA;EACvB,iCAAqB,CAAA;EACrB,wCAA4B,CAAA;EAC5B,2BAAe,CAAA;EACf,8DAAkD,CAAA;EAClD,6CAAiC,CAAA;AACnC,CAAC,EAnCW,QAAQ,KAAR,QAAQ,QAmCnB;AAsMD,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;EACrB,oCAAqB,CAAA;EACrB,0CAA2B,CAAA;EAC3B,8CAA+B,CAAA;EAC/B,8CAA+B,CAAA;AACjC,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;EACrB,wCAAyB,CAAA;AAC3B,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB","sourcesContent":["// Match slug with partner slug in wp admin\n// Dont forget to add the partners url to cors for creditsafe\n// https://bitbucket.org/afonso-sweden/creditsafe-lookup/src/main/api/index.ts\n\nexport enum Business {\n kund = 'kund',\n byggmax = 'byggmax',\n skanska = 'skanska',\n string = 'string-furniture',\n hornbach = 'hornbach',\n forebygg = 'forebygg',\n doro = 'doro',\n elfa = 'elfa',\n kbygg = 'k-bygg',\n norrgavel = 'norrgavel',\n fargvaruhuset = 'fargvaruhuset',\n zaptec = 'zaptec',\n tesla = 'tesla',\n klint = 'klint',\n flyttsmart = 'flyttsmart',\n lg = 'lg',\n sparfonster = 'sparfonster',\n power = 'power',\n traningspartner = 'traningspartner',\n superfront = 'superfront',\n inet = 'inet',\n design24 = 'design24',\n netatonce = 'netatonce',\n bygghemma = 'bygghemma',\n badshop = 'badshop',\n byggshop = 'byggshop',\n golvshop = 'golvshop',\n golvpoolen = 'golvpoolen',\n webhallen = 'webhallen',\n homeroom = 'homeroom',\n pickyliving = 'picky-living',\n amina = 'amina',\n stgeorgesecuritystore = 'st-george-security-store',\n whiteawaygroup = 'whiteawaygroup'\n}\n\ntype Icon = {\n url: string;\n};\n\ninterface Customer {\n ID: number;\n post_title: string;\n post_name: string;\n post_type: string;\n filter: string;\n categories: CustomerCategory[];\n logo?: Icon;\n partner_url?: string;\n at_hemfixarna: boolean;\n info_title: string;\n widget_title?: string;\n info_text: string;\n checkout_title: string;\n checkout_trust_badges: { text: string }[];\n trust_badges: { text: string }[];\n source?: Source;\n password_protected: boolean;\n}\n\ninterface CustomerCategory {\n id: string;\n name: string;\n widget_title?: string;\n icon: string;\n show_products: boolean;\n products: { fields: Product }[] | false;\n sub_categories: CustomerSubCategory[] | false;\n add_painting: boolean;\n}\n\ninterface CustomerSubCategory {\n id: string;\n name: string;\n widget_title?: string;\n icon: string;\n products: { fields: Product }[];\n parent: string;\n add_painting: boolean;\n}\n\ninterface Part {\n ID: number;\n post_author: number;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0 | 1;\n guid: string;\n menu_order: 0;\n post_type: string;\n post_mime_type: string;\n comment_count: number;\n filter: string;\n price: number;\n title: string;\n}\n\ninterface Product {\n ID: number;\n show_pdf: string;\n post_author: string;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0;\n guid: string;\n menu_order: 0;\n post_type: string;\n post_mime_type: string;\n comment_count: 0;\n filter: string;\n price: number;\n icon?: Icon | string;\n parts?: Array<Part>;\n list: Array<{ bullet: string }>;\n terms: string;\n terms_checkout: string;\n terms_show_checkbox: boolean;\n rut: boolean;\n rot: boolean;\n green: boolean;\n hide_start_fee: boolean;\n description: string;\n category: string;\n title: string;\n invoice: string;\n invoice_price: string;\n invoice_description?: string;\n start_fee_obj: StartFee | null;\n}\n\ninterface Service {\n ID: 41857;\n icon?: Icon | string;\n post_author: 34419;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0;\n guid: string;\n menu_order: 0;\n post_type: 'service';\n post_mime_type: string;\n comment_count: 0;\n filter: string;\n products: Array<Product>;\n}\n\ninterface Category {\n count: number;\n description: string;\n name: string;\n icon?: Icon | string;\n parent: 0 | 1;\n slug: string;\n taxonomy: 'service_cat';\n term_group: 0 | 1;\n term_id: number;\n term_order: string;\n term_taxonomy_id: number;\n sub_cats?: Array<Category>;\n services?: Array<Service>;\n}\n\ninterface WpOptions {\n link: { title: string; url: string };\n trust: { trust_badge: string }[];\n thank_you_image: string;\n start_fee: number;\n terms: string;\n maleri_title: string;\n maleri_text: string;\n}\ninterface CartPart {\n id: number;\n amount: number;\n price: number;\n name: string;\n}\n\ninterface CartItem {\n id: number;\n price: number;\n name: string;\n amount: number;\n parts: CartPart[];\n rut: boolean;\n rot: boolean;\n green: boolean;\n start_fee: boolean;\n terms_checkout: string;\n icon?: Icon | string;\n start_fee_obj: StartFee | null;\n}\n\nexport enum WidgetStyle {\n standard = 'standard',\n alternative = 'alternative',\n alternative_2 = 'alternative_2',\n alternative_3 = 'alternative_3',\n}\n\nexport enum TopCategory {\n byggmax = 'category/bygg',\n}\n\ninterface User {\n email: string;\n phone: string;\n ssn: string;\n firstName: string;\n lastName: string;\n street: string;\n zip: string;\n town: string;\n}\n\ninterface RutOptions {\n rut_start_fee_heading: string;\n rut_start_fee_text: string;\n rut_start_fee_text_secondary: string;\n}\n\ninterface RotOptions {\n rot_start_fee_heading: string;\n rot_start_fee_text: string;\n rot_start_fee_text_secondary: string;\n}\n\ninterface GreenOptions {\n green_start_fee_heading: string;\n green_start_fee_text: string;\n green_start_fee_text_secondary: string;\n}\n\ninterface SubSource {\n 'recordId': string;\n 'So_SubSource::Sus01_Name': string;\n 'So_SubSource::_id': string;\n 'So_SubSource::_id_Source': string;\n 'modId': string;\n}\n\ninterface FieldData {\n _id: string;\n So01_Name: string;\n So457_Aktiv_ac: number;\n So40_WebSubSource: string | number;\n So39_WebSource: number;\n rec_id: number;\n}\n\ninterface Source {\n fieldData: FieldData;\n sub_sources: SubSource[];\n}\n\ninterface SourcesRespone {\n dataInfo: {\n database: string;\n layout: string;\n table: string;\n totalRecordCount: number;\n foundCount: number;\n returnedCount: number;\n };\n data: Source[];\n}\n\ninterface StartFee {\n ID: number;\n title: string;\n price: number;\n pop_up: string | null;\n discount_type: string | null;\n description: string;\n}\n\nexport type {\n CartItem,\n CartPart,\n Category,\n Customer,\n CustomerCategory,\n CustomerSubCategory,\n GreenOptions,\n Icon,\n Part,\n Product,\n RotOptions,\n RutOptions,\n Service,\n Source,\n SourcesRespone,\n StartFee,\n User,\n WpOptions,\n};\n"]}
@@ -1,7 +1,6 @@
1
- import { g as getApiUrl } from './enviroment-fd0a763a.js';
2
-
1
+ import { getApiUrl } from './enviroment';
3
2
  const base = `${getApiUrl()}/wp-json/headless`;
4
- async function fetchWithType(request, options) {
3
+ export async function fetchWithType(request, options) {
5
4
  const response = await fetch(request, options);
6
5
  const body = await response.json();
7
6
  return body;
@@ -95,7 +94,5 @@ const postOrder = async (data) => {
95
94
  console.log(error);
96
95
  }
97
96
  };
98
-
99
- export { getOptions as a, getRut as b, getRot as c, getGreenDiscount as d, fetchWithType as f, getCustomer as g, loginCustomer as l, postOrder as p };
100
-
101
- //# sourceMappingURL=api-e3c51cb3.js.map
97
+ export { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy, loginCustomer, postOrder };
98
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,IAAI,GAAG,GAAG,SAAS,EAAE,mBAAmB,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,OAAoB,EAAE,OAAqB;EAChF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;EAC/C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;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,EAAE,EAAE;EAC3C,IAAI;IACF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,WAAW,EAAE;MAC1C,MAAM,EAAE,MAAM;MACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MAC1B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;OACnC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA4E,CAAC;GACtG;EAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;GACpB;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { RotOptions, RutOptions, WpOptions } from '../types';\nimport { getApiUrl } from './enviroment';\nimport { FelixOrder } from './felixApi';\n\nconst base = `${getApiUrl()}/wp-json/headless`;\n\nexport async function fetchWithType<T>(request: RequestInfo, options?: RequestInit): Promise<T> {\n const response = await fetch(request, options);\n const body = await response.json();\n return body;\n}\n\nconst getTaxonomy = async (endpoint: string) => {\n if (!endpoint) {\n return;\n }\n const type = endpoint.split('/')[0];\n const slug = endpoint.split('/')[1];\n try {\n const res = await fetch(`${base}/${type}/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getCustomer = async (slug: string) => {\n try {\n const res = await fetch(`${base}/customer/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst loginCustomer = async ({ id, password }: { id: number; password: string }) => {\n try {\n const res = await fetch(`${base}/customer/login`, {\n method: 'POST',\n body: JSON.stringify({ id, password }),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n return res.status;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getOptions = async () => {\n try {\n const res = await fetch(`${base}/webcoptions`);\n return (await res.json()) as WpOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRut = async () => {\n try {\n const data = await fetchWithType<RutOptions>(`${base}/rut`);\n return data;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRot = async () => {\n try {\n const res = await fetch(`${base}/rot`);\n return (await res.json()) as RotOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getGreenDiscount = async () => {\n try {\n const res = await fetch(`${base}/green-discount`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst postOrder = async (data: FelixOrder) => {\n try {\n const res = await fetch(`${base}/weborder`, {\n method: 'POST',\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n return (await res.json()) as { message: string; post_id: number; data: FelixOrder; status?: number };\n } catch (error) {\n console.log(error);\n }\n};\n\nexport { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy, loginCustomer, postOrder };\n"]}