hemfixarna-web-components 1.8.5 → 1.8.7
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.
- package/dist/cjs/hemfixarna-address_15.cjs.entry.js +2180 -0
- package/dist/cjs/hemfixarna-address_15.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-byggmax.cjs.entry.js +27 -0
- package/dist/cjs/hemfixarna-byggmax.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-category.cjs.entry.js +28 -0
- package/dist/cjs/hemfixarna-category.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-components.cjs.js +28 -0
- package/dist/cjs/hemfixarna-components.cjs.js.map +1 -0
- package/dist/cjs/hemfixarna-doro.cjs.entry.js +26 -0
- package/dist/cjs/hemfixarna-doro.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-elfa.cjs.entry.js +26 -0
- package/dist/cjs/hemfixarna-elfa.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-forebygg.cjs.entry.js +26 -0
- package/dist/cjs/hemfixarna-forebygg.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-hornbach.cjs.entry.js +26 -0
- package/dist/cjs/hemfixarna-hornbach.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-kbygg.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-kbygg.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-klint.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-klint.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-kund.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-kund.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-power.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-power.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-service.cjs.entry.js +24 -0
- package/dist/cjs/hemfixarna-service.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-skanska.cjs.entry.js +26 -0
- package/dist/cjs/hemfixarna-skanska.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js +26 -0
- package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-superfront.cjs.entry.js +24 -0
- package/dist/cjs/hemfixarna-superfront.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-tesla.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-tesla.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js.map +1 -0
- package/dist/cjs/hemfixarna-zaptec.cjs.entry.js +23 -0
- package/dist/cjs/hemfixarna-zaptec.cjs.entry.js.map +1 -0
- package/dist/cjs/index-6cce99a1.js +264 -0
- package/dist/cjs/index-6cce99a1.js.map +1 -0
- package/dist/cjs/index-dc8e80e4.js +53 -0
- package/dist/cjs/index-dc8e80e4.js.map +1 -0
- package/dist/cjs/index-e6926623.js +1741 -0
- package/dist/cjs/index-e6926623.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +24 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/assets/back.svg +3 -0
- package/dist/collection/assets/cart.svg +10 -0
- package/dist/collection/assets/checked.svg +10 -0
- package/dist/collection/assets/close.svg +5 -0
- package/dist/collection/assets/copy.png +0 -0
- package/dist/collection/assets/date.svg +6 -0
- package/dist/collection/assets/down.svg +3 -0
- package/dist/collection/assets/drag-drop.svg +3 -0
- package/dist/collection/assets/elfa.png +0 -0
- package/dist/collection/assets/gubbe-pensel.svg +1 -0
- package/dist/collection/assets/hemfixarna.svg +11 -0
- package/dist/collection/assets/hornbach/logo.svg +42 -0
- package/dist/collection/assets/hornbach/nav.jpg +0 -0
- package/dist/collection/assets/info.svg +5 -0
- package/dist/collection/assets/kbygg.svg +29 -0
- package/dist/collection/assets/minus.svg +4 -0
- package/dist/collection/assets/montering.svg +15 -0
- package/dist/collection/assets/norrgavel.svg +1 -0
- package/dist/collection/assets/pensel.svg +1 -0
- package/dist/collection/assets/plus.svg +5 -0
- package/dist/collection/assets/spinner.gif +0 -0
- package/dist/collection/assets/tesla.svg +1 -0
- package/dist/collection/assets/zaptec.svg +1 -0
- package/dist/collection/collection-manifest.json +47 -0
- package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.css +0 -0
- package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js +122 -0
- package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.css +0 -0
- package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js +104 -0
- package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.css +0 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js +104 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +94 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js +94 -0
- package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.css +0 -0
- package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js +104 -0
- package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.css +0 -0
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js +104 -0
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +94 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js +94 -0
- package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js +94 -0
- package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +94 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +94 -0
- package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.css +0 -0
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js +104 -0
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js +94 -0
- package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js +104 -0
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string.css +0 -0
- package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js +113 -0
- package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js +94 -0
- package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +94 -0
- package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js +94 -0
- package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-address.entry.js → collection/components/hemfixarna-address/hemfixarna-address.js} +20 -14
- package/dist/collection/components/hemfixarna-address/hemfixarna-address.js.map +1 -0
- package/dist/collection/components/hemfixarna-box/hemfixarna-box.js +138 -0
- package/dist/collection/components/hemfixarna-box/hemfixarna-box.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-breadcrumbs.entry.js → collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js} +28 -13
- package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-cart.entry.js → collection/components/hemfixarna-cart/hemfixarna-cart.js} +6 -12
- package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js.map +1 -0
- package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js +18 -0
- package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-checkout.entry.js → collection/components/hemfixarna-checkout/hemfixarna-checkout.js} +26 -33
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +330 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna.css +1061 -0
- package/dist/{hemfixarna-components/hemfixarna-contact.entry.js → collection/components/hemfixarna-contact/hemfixarna-contact.js} +29 -11
- package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js.map +1 -0
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +135 -0
- package/dist/{hemfixarna-components/hemfixarna-demo.entry.js → collection/components/hemfixarna-demo/hemfixarna-demo.js} +46 -21
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -0
- package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js +91 -0
- package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-info.entry.js → collection/components/hemfixarna-info/hemfixarna-info.js} +7 -11
- package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +1 -0
- package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.css +76 -0
- package/dist/{hemfixarna-components/hemfixarna-invoice.entry.js → collection/components/hemfixarna-invoice/hemfixarna-invoice.js} +27 -16
- package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-order.entry.js → collection/components/hemfixarna-order/hemfixarna-order.js} +7 -11
- package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-orderrows.entry.js → collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js} +30 -12
- package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js.map +1 -0
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.css +0 -0
- package/dist/{hemfixarna-components/hemfixarna-product.entry.js → collection/components/hemfixarna-product/hemfixarna-product.js} +27 -18
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -0
- package/dist/collection/components/hemfixarna-service/hemfixarna-service.js +14 -0
- package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-start.entry.js → collection/components/hemfixarna-start/hemfixarna-start.js} +48 -11
- package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/store/index.js +69 -0
- package/dist/collection/store/index.js.map +1 -0
- package/dist/collection/types/felixtypes.js +3 -0
- package/dist/collection/types/felixtypes.js.map +1 -0
- package/dist/collection/types/index.js +50 -0
- package/dist/collection/types/index.js.map +1 -0
- package/dist/{hemfixarna-components/api-e3c51cb3.js → collection/utils/api.js} +4 -7
- package/dist/collection/utils/api.js.map +1 -0
- package/dist/{hemfixarna-components/calc-b3b6593c.js → collection/utils/calc.js} +3 -6
- package/dist/collection/utils/calc.js.map +1 -0
- package/dist/collection/utils/creditSafe.js +18 -0
- package/dist/collection/utils/creditSafe.js.map +1 -0
- package/dist/{hemfixarna-components/enviroment-fd0a763a.js → collection/utils/enviroment.js} +6 -8
- package/dist/collection/utils/enviroment.js.map +1 -0
- package/dist/collection/utils/felixApi.js +19 -0
- package/dist/collection/utils/felixApi.js.map +1 -0
- package/dist/collection/utils/felixFunctions.js +188 -0
- package/dist/collection/utils/felixFunctions.js.map +1 -0
- package/dist/{hemfixarna-components/form-c53dca29.js → collection/utils/form.js} +2 -4
- package/dist/collection/utils/form.js.map +1 -0
- package/dist/{hemfixarna-components/scroll-6c26b5da.js → collection/utils/scroll.js} +2 -4
- package/dist/collection/utils/scroll.js.map +1 -0
- package/dist/{hemfixarna-components/types-6da209ae.js → collection/utils/types.js} +3 -6
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/esm/hemfixarna-address_15.entry.js +2162 -0
- package/dist/esm/hemfixarna-address_15.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-byggmax.entry.js +2 -2
- package/dist/esm/hemfixarna-byggmax.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-category.entry.js +2 -2
- package/dist/esm/hemfixarna-category.entry.js.map +1 -0
- package/dist/esm/hemfixarna-components.js +23 -0
- package/dist/esm/hemfixarna-components.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-doro.entry.js +2 -2
- package/dist/esm/hemfixarna-doro.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-elfa.entry.js +2 -2
- package/dist/esm/hemfixarna-elfa.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-fargvaruhuset.entry.js +2 -2
- package/dist/esm/hemfixarna-fargvaruhuset.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-flyttsmart.entry.js +2 -2
- package/dist/esm/hemfixarna-flyttsmart.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-forebygg.entry.js +2 -2
- package/dist/esm/hemfixarna-forebygg.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-hornbach.entry.js +2 -2
- package/dist/esm/hemfixarna-hornbach.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-kbygg.entry.js +2 -2
- package/dist/esm/hemfixarna-kbygg.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-klint.entry.js +2 -2
- package/dist/esm/hemfixarna-klint.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-kund.entry.js +2 -2
- package/dist/esm/hemfixarna-kund.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-norrgavel.entry.js +2 -2
- package/dist/esm/hemfixarna-norrgavel.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-power.entry.js +2 -2
- package/dist/esm/hemfixarna-power.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-service.entry.js +2 -2
- package/dist/esm/hemfixarna-service.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-skanska.entry.js +2 -2
- package/dist/esm/hemfixarna-skanska.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-sparfonster.entry.js +2 -2
- package/dist/esm/hemfixarna-sparfonster.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-string-furniture.entry.js +2 -2
- package/dist/esm/hemfixarna-string-furniture.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-superfront.entry.js +2 -2
- package/dist/esm/hemfixarna-superfront.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-tesla.entry.js +2 -2
- package/dist/esm/hemfixarna-tesla.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-traningspartner.entry.js +2 -2
- package/dist/esm/hemfixarna-traningspartner.entry.js.map +1 -0
- package/dist/{hemfixarna-components → esm}/hemfixarna-zaptec.entry.js +2 -2
- package/dist/esm/hemfixarna-zaptec.entry.js.map +1 -0
- package/dist/{hemfixarna-components/index-c8ce6f4b.js → esm/index-17dff2be.js} +5 -1
- package/dist/esm/index-17dff2be.js.map +1 -0
- package/dist/{hemfixarna-components/index-21ba2b05.js → esm/index-20d4c934.js} +5 -6
- package/dist/esm/index-20d4c934.js.map +1 -0
- package/dist/esm/index-ea1d222e.js +1710 -0
- package/dist/esm/index-ea1d222e.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +20 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -162
- package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
- package/dist/hemfixarna-components/index.esm.js +0 -1
- package/dist/hemfixarna-components/index.esm.js.map +1 -1
- package/dist/hemfixarna-components/p-13c814e5.entry.js +2 -0
- package/dist/hemfixarna-components/p-13c814e5.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-22402dcd.entry.js +2 -0
- package/dist/hemfixarna-components/p-22402dcd.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-2af882e6.entry.js +2 -0
- package/dist/hemfixarna-components/p-2af882e6.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-3038b208.entry.js +2 -0
- package/dist/hemfixarna-components/p-3038b208.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-45ab00f1.entry.js +2 -0
- package/dist/hemfixarna-components/p-45ab00f1.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-5c9563b4.entry.js +2 -0
- package/dist/hemfixarna-components/p-5c9563b4.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-6bd272c5.entry.js +2 -0
- package/dist/hemfixarna-components/p-6bd272c5.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-6e20e1b0.js +2 -0
- package/dist/hemfixarna-components/p-6e20e1b0.js.map +1 -0
- package/dist/hemfixarna-components/p-7b495586.entry.js +2 -0
- package/dist/hemfixarna-components/p-7b495586.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-7c0e45f5.entry.js +2 -0
- package/dist/hemfixarna-components/p-7c0e45f5.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-7cb8e61f.entry.js +2 -0
- package/dist/hemfixarna-components/p-7cb8e61f.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-7df046a3.entry.js +2 -0
- package/dist/hemfixarna-components/p-7df046a3.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-81571614.entry.js +2 -0
- package/dist/hemfixarna-components/p-81571614.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-82273497.entry.js +2 -0
- package/dist/hemfixarna-components/p-82273497.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-8b7e8357.entry.js +2 -0
- package/dist/hemfixarna-components/p-8b7e8357.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-9c484473.entry.js +2 -0
- package/dist/hemfixarna-components/p-9c484473.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-9cf1fb6b.entry.js +2 -0
- package/dist/hemfixarna-components/p-9cf1fb6b.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-b115aec3.entry.js +2 -0
- package/dist/hemfixarna-components/p-b115aec3.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-c707b937.js +3 -0
- package/dist/hemfixarna-components/p-c707b937.js.map +1 -0
- package/dist/hemfixarna-components/p-cdc0d010.js +2 -0
- package/dist/hemfixarna-components/p-cdc0d010.js.map +1 -0
- package/dist/hemfixarna-components/p-de0582a4.entry.js +2 -0
- package/dist/hemfixarna-components/p-de0582a4.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-e162b027.entry.js +2 -0
- package/dist/hemfixarna-components/p-e162b027.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-ea31b5fc.entry.js +2 -0
- package/dist/hemfixarna-components/p-ea31b5fc.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-f9fdaa51.entry.js +2 -0
- package/dist/hemfixarna-components/p-f9fdaa51.entry.js.map +1 -0
- package/dist/hemfixarna-components/p-fe40c699.entry.js +2 -0
- package/dist/hemfixarna-components/p-fe40c699.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/types/index.d.ts +5 -1
- package/package.json +1 -1
- package/dist/hemfixarna-components/api-e3c51cb3.js.map +0 -1
- package/dist/hemfixarna-components/app-globals-0f993ce5.js +0 -5
- package/dist/hemfixarna-components/app-globals-0f993ce5.js.map +0 -1
- package/dist/hemfixarna-components/calc-b3b6593c.js.map +0 -1
- package/dist/hemfixarna-components/css-shim-4fde41f0.js +0 -6
- package/dist/hemfixarna-components/css-shim-4fde41f0.js.map +0 -1
- package/dist/hemfixarna-components/dom-8de30773.js +0 -75
- package/dist/hemfixarna-components/dom-8de30773.js.map +0 -1
- package/dist/hemfixarna-components/enviroment-fd0a763a.js.map +0 -1
- package/dist/hemfixarna-components/form-c53dca29.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-box.entry.js +0 -49
- package/dist/hemfixarna-components/hemfixarna-box.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-component.entry.js +0 -189
- package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-contact.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-demo.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-doro.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-elfa.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-forebygg.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +0 -770
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-hornbach.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-info.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-invoice.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-kbygg.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-klint.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-kund.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-norrgavel.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-orderrows.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-power.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-skanska.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-sparfonster.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-string-furniture.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-superfront.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-tesla.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js.map +0 -1
- package/dist/hemfixarna-components/index-21ba2b05.js.map +0 -1
- package/dist/hemfixarna-components/index-2ce8b901.js +0 -3461
- package/dist/hemfixarna-components/index-2ce8b901.js.map +0 -1
- package/dist/hemfixarna-components/index-c8ce6f4b.js.map +0 -1
- package/dist/hemfixarna-components/scroll-6c26b5da.js.map +0 -1
- package/dist/hemfixarna-components/shadow-css-af2290df.js +0 -389
- package/dist/hemfixarna-components/shadow-css-af2290df.js.map +0 -1
- package/dist/hemfixarna-components/types-6da209ae.js.map +0 -1
@@ -1,9 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
constructor(hostRef) {
|
6
|
-
registerInstance(this, hostRef);
|
1
|
+
import { h } from '@stencil/core';
|
2
|
+
import state from '../../store';
|
3
|
+
export class HemfixarnaInfo {
|
4
|
+
constructor() {
|
7
5
|
this.vertical = false;
|
8
6
|
}
|
9
7
|
render() {
|
@@ -13,8 +11,28 @@ const HemfixarnaInfo = class {
|
|
13
11
|
}
|
14
12
|
}, class: "hemfixarna_source" }, state.selectSource ? (h("svg", { viewBox: "0 0 1024 1024", fill: "#C84E18", height: "1em", width: "1em" }, h("path", { d: "M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1156 0z" }))) : (h("svg", { viewBox: "0 0 1024 1024", fill: "#C84E18", height: "1em", width: "1em" }, h("path", { d: "M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1156 0zm152-237H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224z" }))))) : null, h("a", { href: "tel:0770-220 720" }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M7 4V20H17V4H7ZM6 2H18C18.5523 2 19 2.44772 19 3V21C19 21.5523 18.5523 22 18 22H6C5.44772 22 5 21.5523 5 21V3C5 2.44772 5.44772 2 6 2ZM12 17C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18C11 17.4477 11.4477 17 12 17Z", fill: "#C84E18" })), h("span", null, "0770-220 720")), h("a", { href: "https://hemfixarna.se/kundservice/", target: "_blank" }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "clip-path": "url(#clip0_1001_894)" }, h("path", { d: "M21 12.22C21 6.73 16.74 3 12 3C7.31 3 3 6.65 3 12.28C2.4 12.62 2 13.26 2 14V16C2 17.1 2.9 18 4 18H5V11.9C5 8.03 8.13 4.9 12 4.9C15.87 4.9 19 8.03 19 11.9V19H11V21H19C20.1 21 21 20.1 21 19V17.78C21.59 17.47 22 16.86 22 16.14V13.84C22 13.14 21.59 12.53 21 12.22Z", fill: "#C84E18" }), h("path", { d: "M9 14C9.55228 14 10 13.5523 10 13C10 12.4477 9.55228 12 9 12C8.44772 12 8 12.4477 8 13C8 13.5523 8.44772 14 9 14Z", fill: "#C84E18" }), h("path", { d: "M15 14C15.5523 14 16 13.5523 16 13C16 12.4477 15.5523 12 15 12C14.4477 12 14 12.4477 14 13C14 13.5523 14.4477 14 15 14Z", fill: "#C84E18" }), h("path", { d: "M18 11.03C17.52 8.18 15.04 6 12.05 6C9.01997 6 5.75997 8.51 6.01997 12.45C8.48997 11.44 10.35 9.24 10.88 6.56C12.19 9.19 14.88 11 18 11.03Z", fill: "#C84E18" })), h("defs", null, h("clipPath", { id: "clip0_1001_894" }, h("rect", { width: "24", height: "24", fill: "white" })))), h("span", null, "Kundservice"))));
|
15
13
|
}
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
static get is() { return "hemfixarna-contact"; }
|
15
|
+
static get properties() {
|
16
|
+
return {
|
17
|
+
"vertical": {
|
18
|
+
"type": "boolean",
|
19
|
+
"mutable": false,
|
20
|
+
"complexType": {
|
21
|
+
"original": "boolean",
|
22
|
+
"resolved": "boolean",
|
23
|
+
"references": {}
|
24
|
+
},
|
25
|
+
"required": false,
|
26
|
+
"optional": true,
|
27
|
+
"docs": {
|
28
|
+
"tags": [],
|
29
|
+
"text": ""
|
30
|
+
},
|
31
|
+
"attribute": "vertical",
|
32
|
+
"reflect": false,
|
33
|
+
"defaultValue": "false"
|
34
|
+
}
|
35
|
+
};
|
36
|
+
}
|
37
|
+
}
|
38
|
+
//# sourceMappingURL=hemfixarna-contact.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hemfixarna-contact.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-contact/hemfixarna-contact.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,MAAM,aAAa,CAAC;AAMhC,MAAM,OAAO,cAAc;;oBACI,KAAK;;EAElC,MAAM;IACJ,OAAO,CACL,WAAK,KAAK,EAAE,sBAAsB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,gCAAgC,EAAE;MAClH,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CACvB,WACE,OAAO,EAAE,GAAG,EAAE;UACZ,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;YACvB,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC;WACvC;QACH,CAAC,EACD,KAAK,EAAC,mBAAmB,IAExB,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CACpB,WAAK,OAAO,EAAC,eAAe,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK;QAClE,YAAM,CAAC,EAAC,mVAAmV,GAAG,CAC1V,CACP,CAAC,CAAC,CAAC,CACF,WAAK,OAAO,EAAC,eAAe,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK;QAClE,YAAM,CAAC,EAAC,8TAA8T,GAAG,CACrU,CACP,CACG,CACP,CAAC,CAAC,CAAC,IAAI;MACR,SAAG,IAAI,EAAC,kBAAkB;QACxB,WAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;UAC5F,YACE,CAAC,EAAC,+PAA+P,EACjQ,IAAI,EAAC,SAAS,GACd,CACE;QACN,+BAAyB,CACvB;MACJ,SAAG,IAAI,EAAC,oCAAoC,EAAC,MAAM,EAAC,QAAQ;QAC1D,WAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;UAC5F,sBAAa,sBAAsB;YACjC,YACE,CAAC,EAAC,sQAAsQ,EACxQ,IAAI,EAAC,SAAS,GACd;YACF,YAAM,CAAC,EAAC,mHAAmH,EAAC,IAAI,EAAC,SAAS,GAAG;YAC7I,YAAM,CAAC,EAAC,yHAAyH,EAAC,IAAI,EAAC,SAAS,GAAG;YACnJ,YACE,CAAC,EAAC,6IAA6I,EAC/I,IAAI,EAAC,SAAS,GACd,CACA;UACJ;YACE,gBAAU,EAAE,EAAC,gBAAgB;cAC3B,YAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,GAAG,CACnC,CACN,CACH;QACN,8BAAwB,CACtB,CACA,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport state from '../../store';\n\n@Component({\n tag: 'hemfixarna-contact',\n shadow: false,\n})\nexport class HemfixarnaInfo {\n @Prop() vertical?: boolean = false;\n\n render() {\n return (\n <div class={`hemfixarna_contact ${this.vertical ? 'hemfixarna_contact--vertical' : 'hemfixarna_contact--horizontal'}`}>\n {state.customer.source ? (\n <div\n onClick={() => {\n if (!state.selectSource) {\n state.showSourcePasswordPrompt = true;\n }\n }}\n class=\"hemfixarna_source\"\n >\n {state.selectSource ? (\n <svg viewBox=\"0 0 1024 1024\" fill=\"#C84E18\" height=\"1em\" width=\"1em\">\n <path d=\"M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1156 0z\" />\n </svg>\n ) : (\n <svg viewBox=\"0 0 1024 1024\" fill=\"#C84E18\" height=\"1em\" width=\"1em\">\n <path d=\"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1156 0zm152-237H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224z\" />\n </svg>\n )}\n </div>\n ) : null}\n <a href=\"tel:0770-220 720\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M7 4V20H17V4H7ZM6 2H18C18.5523 2 19 2.44772 19 3V21C19 21.5523 18.5523 22 18 22H6C5.44772 22 5 21.5523 5 21V3C5 2.44772 5.44772 2 6 2ZM12 17C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18C11 17.4477 11.4477 17 12 17Z\"\n fill=\"#C84E18\"\n />\n </svg>\n <span>0770-220 720</span>\n </a>\n <a href=\"https://hemfixarna.se/kundservice/\" target=\"_blank\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_1001_894)\">\n <path\n d=\"M21 12.22C21 6.73 16.74 3 12 3C7.31 3 3 6.65 3 12.28C2.4 12.62 2 13.26 2 14V16C2 17.1 2.9 18 4 18H5V11.9C5 8.03 8.13 4.9 12 4.9C15.87 4.9 19 8.03 19 11.9V19H11V21H19C20.1 21 21 20.1 21 19V17.78C21.59 17.47 22 16.86 22 16.14V13.84C22 13.14 21.59 12.53 21 12.22Z\"\n fill=\"#C84E18\"\n />\n <path d=\"M9 14C9.55228 14 10 13.5523 10 13C10 12.4477 9.55228 12 9 12C8.44772 12 8 12.4477 8 13C8 13.5523 8.44772 14 9 14Z\" fill=\"#C84E18\" />\n <path d=\"M15 14C15.5523 14 16 13.5523 16 13C16 12.4477 15.5523 12 15 12C14.4477 12 14 12.4477 14 13C14 13.5523 14.4477 14 15 14Z\" fill=\"#C84E18\" />\n <path\n d=\"M18 11.03C17.52 8.18 15.04 6 12.05 6C9.01997 6 5.75997 8.51 6.01997 12.45C8.48997 11.44 10.35 9.24 10.88 6.56C12.19 9.19 14.88 11 18 11.03Z\"\n fill=\"#C84E18\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_1001_894\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n <span>Kundservice</span>\n </a>\n </div>\n );\n }\n}\n"]}
|
@@ -0,0 +1,135 @@
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");
|
2
|
+
:host {
|
3
|
+
font-family: "Inter", sans-serif;
|
4
|
+
}
|
5
|
+
:host .hemfixarna_widgetstyles label {
|
6
|
+
cursor: pointer;
|
7
|
+
}
|
8
|
+
:host .hemfixarna_widgetstyles > div {
|
9
|
+
display: flex;
|
10
|
+
gap: 1rem;
|
11
|
+
}
|
12
|
+
:host .hemfixarna_widgetstyles h5 {
|
13
|
+
margin: 1rem 0;
|
14
|
+
}
|
15
|
+
:host .hemfixarna_example {
|
16
|
+
margin-bottom: 16px;
|
17
|
+
background: #000;
|
18
|
+
padding: 16px;
|
19
|
+
color: #fff;
|
20
|
+
display: flex;
|
21
|
+
justify-content: space-between;
|
22
|
+
cursor: pointer;
|
23
|
+
max-width: 500px;
|
24
|
+
box-sizing: border-box;
|
25
|
+
position: relative;
|
26
|
+
}
|
27
|
+
:host .hemfixarna_example--tooltip {
|
28
|
+
background: #000;
|
29
|
+
top: -48px;
|
30
|
+
font-size: 16px;
|
31
|
+
left: 40%;
|
32
|
+
color: white;
|
33
|
+
padding: 8px;
|
34
|
+
position: absolute;
|
35
|
+
opacity: 0;
|
36
|
+
}
|
37
|
+
:host .hemfixarna_example--tooltip::after {
|
38
|
+
content: "";
|
39
|
+
position: absolute;
|
40
|
+
top: 100%;
|
41
|
+
left: 50%;
|
42
|
+
margin-left: -5px;
|
43
|
+
border-width: 5px;
|
44
|
+
border-style: solid;
|
45
|
+
border-color: #000 transparent transparent transparent;
|
46
|
+
}
|
47
|
+
:host .hemfixarna_example:hover .hemfixarna_example--tooltip {
|
48
|
+
opacity: 1;
|
49
|
+
}
|
50
|
+
:host .hemfixarna_example p {
|
51
|
+
font-size: 14px;
|
52
|
+
}
|
53
|
+
:host .hemfixarna_example img {
|
54
|
+
filter: invert(1);
|
55
|
+
}
|
56
|
+
:host .hemfixarna_install {
|
57
|
+
display: grid;
|
58
|
+
gap: 8px;
|
59
|
+
margin-top: 16px;
|
60
|
+
}
|
61
|
+
:host .hemfixarna_product--label {
|
62
|
+
background: #e1e0f5;
|
63
|
+
}
|
64
|
+
:host .hemfixarna_categories {
|
65
|
+
max-height: 100%;
|
66
|
+
overflow: auto;
|
67
|
+
position: relative;
|
68
|
+
}
|
69
|
+
:host .hemfixarna_categories--label {
|
70
|
+
display: flex;
|
71
|
+
align-items: center;
|
72
|
+
justify-content: space-between;
|
73
|
+
padding: 8px;
|
74
|
+
}
|
75
|
+
:host .hemfixarna_categories--label button {
|
76
|
+
background: #3f3a92;
|
77
|
+
border: none;
|
78
|
+
font-weight: 600;
|
79
|
+
padding: 3.2px 9.6px;
|
80
|
+
border-radius: 10px;
|
81
|
+
margin-right: 8px;
|
82
|
+
color: #ece8e8;
|
83
|
+
}
|
84
|
+
:host .hemfixarna_categories--label button:active {
|
85
|
+
transform: scale(0.95);
|
86
|
+
}
|
87
|
+
:host .hemfixarna_categories--label--big {
|
88
|
+
font-weight: 600;
|
89
|
+
border-bottom: 1px solid black;
|
90
|
+
}
|
91
|
+
:host p {
|
92
|
+
margin: 0;
|
93
|
+
}
|
94
|
+
:host span {
|
95
|
+
color: darkolivegreen;
|
96
|
+
font-size: 10px;
|
97
|
+
}
|
98
|
+
:host button {
|
99
|
+
cursor: pointer;
|
100
|
+
}
|
101
|
+
:host > div:not(.hemfixarna_hosted) {
|
102
|
+
grid-template-columns: 1fr 1fr;
|
103
|
+
}
|
104
|
+
:host .hemfixarna_hosted .hemfixarna_scripts {
|
105
|
+
display: none;
|
106
|
+
}
|
107
|
+
:host > div {
|
108
|
+
display: grid;
|
109
|
+
gap: 32px;
|
110
|
+
width: 100%;
|
111
|
+
height: 100vh;
|
112
|
+
place-items: center;
|
113
|
+
overflow: hidden;
|
114
|
+
padding: 16px 32px;
|
115
|
+
box-sizing: border-box;
|
116
|
+
}
|
117
|
+
:host > div > * {
|
118
|
+
width: 100%;
|
119
|
+
}
|
120
|
+
:host > div > div {
|
121
|
+
max-width: 500px;
|
122
|
+
}
|
123
|
+
:host > div ul {
|
124
|
+
margin: 0;
|
125
|
+
padding: 0;
|
126
|
+
list-style: none;
|
127
|
+
}
|
128
|
+
:host > div ul ul {
|
129
|
+
gap: 1px;
|
130
|
+
display: grid;
|
131
|
+
}
|
132
|
+
:host > div ul li {
|
133
|
+
padding-left: 16px;
|
134
|
+
background: #fff;
|
135
|
+
}
|
@@ -1,14 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
const MyComponent = class {
|
10
|
-
constructor(hostRef) {
|
11
|
-
registerInstance(this, hostRef);
|
1
|
+
import { Fragment, getAssetPath, h } from '@stencil/core';
|
2
|
+
import { Business, WidgetStyle } from '../../types';
|
3
|
+
import { getCustomer, loginCustomer } from '../../utils/api';
|
4
|
+
import { getApiUrl } from '../../utils/enviroment';
|
5
|
+
import { isBusiness } from '../../utils/types';
|
6
|
+
export class MyComponent {
|
7
|
+
constructor() {
|
12
8
|
this.debounce = null;
|
13
9
|
this.cdnLink = '<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"></script>';
|
14
10
|
this.selectedSlug = undefined;
|
@@ -160,13 +156,42 @@ const MyComponent = class {
|
|
160
156
|
color: 'red',
|
161
157
|
} }, "No customer found"));
|
162
158
|
}
|
163
|
-
static get
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
159
|
+
static get is() { return "hemfixarna-demo"; }
|
160
|
+
static get encapsulation() { return "shadow"; }
|
161
|
+
static get originalStyleUrls() {
|
162
|
+
return {
|
163
|
+
"$": ["hemfixarna-demo.scss"]
|
164
|
+
};
|
165
|
+
}
|
166
|
+
static get styleUrls() {
|
167
|
+
return {
|
168
|
+
"$": ["hemfixarna-demo.css"]
|
169
|
+
};
|
170
|
+
}
|
171
|
+
static get states() {
|
172
|
+
return {
|
173
|
+
"selectedSlug": {},
|
174
|
+
"selectedID": {},
|
175
|
+
"tooltipText": {},
|
176
|
+
"tree": {},
|
177
|
+
"customer": {},
|
178
|
+
"widgetStyle": {},
|
179
|
+
"buttonBg": {},
|
180
|
+
"buttonColor": {},
|
181
|
+
"partner": {},
|
182
|
+
"colorAccessibility": {},
|
183
|
+
"loggedIn": {},
|
184
|
+
"loginError": {}
|
185
|
+
};
|
186
|
+
}
|
187
|
+
static get watchers() {
|
188
|
+
return [{
|
189
|
+
"propName": "buttonBg",
|
190
|
+
"methodName": "debouncedFunction"
|
191
|
+
}, {
|
192
|
+
"propName": "buttonColor",
|
193
|
+
"methodName": "debouncedFunction"
|
194
|
+
}];
|
195
|
+
}
|
196
|
+
}
|
197
|
+
//# sourceMappingURL=hemfixarna-demo.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hemfixarna-demo.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-demo/hemfixarna-demo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAsB,WAAW,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAe/C,MAAM,OAAO,WAAW;;IAad,aAAQ,GAAY,IAAI,CAAC;IAmFjC,YAAO,GAAG,8JAA8J,CAAC;;;uBA7F1I,sBAAsB;gBACpB,IAAI;oBACA,IAAI;uBACL,WAAW,CAAC,QAAQ;oBAC5B,EAAE;uBACC,EAAE;mBACQ,SAAS;8BACC,SAAS;oBAC/B,KAAK;sBACH,KAAK;;EAKpC,iBAAiB;IACf,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE;MAC1B,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;MAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;KACtB;IAED,IAAI,CAAC,QAAQ,GAAG,MAAM,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,QAAQ,eAAkB;QACtC,IAAI,CAAC,UAAU,IAAI,oCAAyB,CACxC,CACH,CACP,CACQ,CACZ,CAAC,CAAC,CAAC,CACF,UACE,KAAK,EAAE;QACL,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,KAAK;OACb,wBAGE,CACN,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Fragment, State, Watch, getAssetPath, h } from '@stencil/core';\nimport { Business, Category, Customer, WidgetStyle } from '../../types';\nimport { getCustomer, loginCustomer } from '../../utils/api';\nimport { getApiUrl } from '../../utils/enviroment';\nimport { isBusiness } from '../../utils/types';\n\ninterface ColorAccessibility {\n small: string;\n bold: string;\n large: string;\n overall: string;\n contrast: string;\n}\n\n@Component({\n tag: 'hemfixarna-demo',\n styleUrl: 'hemfixarna-demo.scss',\n shadow: true,\n})\nexport class MyComponent {\n @State() selectedSlug: string;\n @State() selectedID: string;\n @State() tooltipText: string = 'Kopiera till urklipp';\n @State() tree: Category | null = null;\n @State() customer: Customer | null = null;\n @State() widgetStyle: WidgetStyle = WidgetStyle.standard;\n @State() buttonBg: string = '';\n @State() buttonColor: string = '';\n @State() partner: Business | undefined = undefined;\n @State() colorAccessibility?: ColorAccessibility = undefined;\n @State() loggedIn: boolean = false;\n @State() loginError: boolean = false;\n private debounce?: number = null;\n\n @Watch('buttonBg')\n @Watch('buttonColor')\n debouncedFunction() {\n if (this.debounce !== null) {\n clearTimeout(this.debounce);\n this.debounce = null;\n }\n\n this.debounce = window.setTimeout(() => {\n this.checkColorAccessibility();\n this.debounce = null;\n }, 1500);\n }\n\n async checkColorAccessibility() {\n const defaultTextColor = '#fff';\n const defaultBgColor = '#c84e18';\n const firstColor = this.buttonBg.length ? (this.buttonBg.startsWith('#') ? this.buttonBg : `#${this.buttonBg}`) : defaultBgColor;\n const secondColor = this.buttonColor.length ? (this.buttonColor.startsWith('#') ? this.buttonColor : `#${this.buttonColor}`) : defaultTextColor;\n try {\n const response = await fetch('https://www.aremycolorsaccessible.com/api/are-they', {\n mode: 'cors',\n method: 'POST',\n body: JSON.stringify({ colors: [firstColor, secondColor] }),\n });\n\n if (!response) {\n throw new Error('Network response was not ok');\n }\n\n const json = await response.json();\n if (json && (json satisfies ColorAccessibility)) {\n this.colorAccessibility = json;\n }\n } catch (error) {\n console.warn('Error fetching color accessibility:', error);\n }\n }\n\n getColor(rating: string) {\n switch (rating) {\n case 'AAA':\n return 'green';\n case 'AA':\n return 'orange';\n case 'A':\n return 'yellow';\n case 'Fail':\n return 'red';\n default:\n return 'black';\n }\n }\n\n async componentWillLoad() {\n const partner = window.location.pathname.replace('/', '');\n if (!isBusiness(partner) && partner) return;\n this.partner = partner ? (partner as Business) : Business.kund;\n const customer = await getCustomer(this.partner);\n if (customer.code !== 'not_found' && customer) {\n this.customer = customer;\n if (!this.customer.password_protected || window.localStorage.getItem(`${this.customer.ID}-loggedin`)) {\n this.loggedIn = true;\n }\n }\n }\n\n getExample() {\n return `<hemfixarna-component business=\"${this.partner}\"${this.selectedSlug ? ` slug=\"${this.selectedSlug}\" ` : ''}${this.selectedID ? ` id=\"${this.selectedID}\" ` : ''} ${\n this.widgetStyle === WidgetStyle.standard ? '' : `widget-style=\"${this.widgetStyle}\"`\n } ${this.buttonColor.length ? `button-color=\"${this.buttonColor}\"` : ''} ${this.buttonBg.length ? `button-bg=\"${this.buttonBg}\"` : ''}></hemfixarna-component>`;\n }\n\n copyExample() {\n navigator.clipboard.writeText(this.getExample());\n this.tooltipText = 'Snippet kopierad';\n setTimeout(() => {\n this.tooltipText = 'Kopiera till urklipp';\n }, 2000);\n }\n\n cdnLink = '<script type=\"module\" src=\"https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js\"></script>';\n\n copyCdn() {\n navigator.clipboard.writeText(this.cdnLink);\n this.tooltipText = 'Text kopierad';\n setTimeout(() => {\n this.tooltipText = 'Kopiera till urklipp';\n }, 2000);\n }\n\n copyNpmInstall() {\n navigator.clipboard.writeText('npm i hemfixarna-web-components');\n this.tooltipText = 'Text kopierad';\n setTimeout(() => {\n this.tooltipText = 'Kopiera till urklipp';\n }, 2000);\n }\n\n showMaleri() {\n const allCategories = this.customer?.categories.map(c => (c.sub_categories ? c.sub_categories : c)).flat();\n return allCategories?.some(c => c.add_painting);\n }\n\n async handleLogin() {\n const shadowHost = document.querySelector('hemfixarna-demo');\n const shadowRoot = shadowHost.shadowRoot;\n const passwordInput = shadowRoot.querySelector('input[type=\"password\"]');\n const password = (passwordInput as HTMLInputElement).value;\n\n this.loginError = false;\n try {\n const status = await loginCustomer({ id: this.customer.ID, password: password });\n if (status === 200) {\n this.loggedIn = true;\n window.localStorage.setItem(`${this.customer.ID}-loggedin`, 'true');\n } else {\n this.loginError = true;\n }\n } catch (error) {\n console.log(error);\n this.loginError = true;\n }\n }\n\n render() {\n const copy = getAssetPath(`./assets/copy.png`);\n\n return this.customer ? (\n <Fragment>\n {this.loggedIn ? (\n <div class={this.customer?.at_hemfixarna ? 'hemfixarna_hosted' : ''}>\n <div class=\"hemfixarna_scripts\">\n <div onClick={() => this.copyExample()} class=\"hemfixarna_example\">\n <p>{this.getExample()}</p>\n <img src={copy} height={20} />\n <span class=\"hemfixarna_example--tooltip\">{this.tooltipText}</span>\n </div>\n <hemfixarna-component\n business={this.partner}\n buttonBg={this.buttonBg}\n buttonColor={this.buttonColor}\n widgetStyle={this.widgetStyle}\n id={this.selectedID}\n ></hemfixarna-component>\n <div class=\"hemfixarna_install\">\n <div onClick={() => this.copyCdn()} class=\"hemfixarna_example\">\n <p>{this.cdnLink}</p>\n <span class=\"hemfixarna_example--tooltip\">{this.tooltipText}</span>\n <img src={copy} height={20} />\n </div>\n </div>\n <div class=\"hemfixarna_widgetstyles\">\n <h5>Widget styles</h5>\n <div>\n {Object.values(WidgetStyle).map(style => (\n <label key={style}>\n <input type=\"radio\" value={style} checked={this.widgetStyle === style} onChange={() => (this.widgetStyle = style)} />\n {style}\n </label>\n ))}\n </div>\n <div>\n <div>\n <h5>Button background color</h5>\n <input type=\"text\" value={this.buttonBg} onInput={e => (this.buttonBg = (e.target as HTMLInputElement).value)} />\n </div>\n <div>\n <h5>Button text color</h5>\n <input type=\"text\" value={this.buttonColor} onInput={e => (this.buttonColor = (e.target as HTMLInputElement).value)} />\n </div>\n </div>\n </div>\n <span>Write an hexa code no # needed</span>\n {this.colorAccessibility ? (\n <div>\n <h5>Tillgänglighetsrapport</h5>\n <div>\n <strong>Liten text:</strong>\n <span style={{ color: this.getColor(this.colorAccessibility.small) }}>{this.colorAccessibility.small}</span>\n <br />\n <strong>Fet text:</strong>\n <span style={{ color: this.getColor(this.colorAccessibility.bold) }}>{this.colorAccessibility.bold}</span>\n <br />\n <strong>Stor text:</strong>\n <span style={{ color: this.getColor(this.colorAccessibility.large) }}>{this.colorAccessibility.large}</span>\n <br />\n <strong>Kontrastförhållande:</strong> {this.colorAccessibility.contrast}\n </div>\n </div>\n ) : null}\n </div>\n <ul class=\"hemfixarna_categories\">\n <div>\n {this.customer.logo ? (\n <div style={{ width: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ maxWidth: '250px', height: 'auto', margin: '0 auto 2rem' }} src={this.customer.logo.url} alt={this.customer.post_title} />\n </div>\n ) : null}\n {this.showMaleri() ? (\n <li>\n <div class=\"hemfixarna_categories--label hemfixarna_categories--label--big\">\n <div>\n <p>Måleriverktyget</p>\n <span>maleri</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText('maleri')}>Kopiera ID</button>\n {this.customer.at_hemfixarna ? (\n <button onClick={() => navigator.clipboard.writeText(`${getApiUrl()}/partner/${this.customer.post_name}?id=maleri`)}>Kopiera URL</button>\n ) : (\n <button onClick={() => (this.selectedID = 'maleri')}>Ladda måleri</button>\n )}\n </div>\n </div>\n </li>\n ) : null}\n {this.customer.categories.map(c => (\n <li>\n <div class=\"hemfixarna_categories--label hemfixarna_categories--label--big\">\n <div>\n <p>{c.name}</p>\n <span>{`c-${c.id}`}</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText(`c-${c.id}`)}>Kopiera ID</button>\n {this.customer.at_hemfixarna ? (\n <button onClick={() => navigator.clipboard.writeText(`${getApiUrl()}/partner/${this.customer.post_name}?id=c-${c.id}`)}>Kopiera URL</button>\n ) : (\n <button onClick={() => (this.selectedID = `c-${c.id}`)}>Ladda kategori</button>\n )}\n </div>\n </div>\n {c.show_products && c.products ? (\n <ul>\n {c.products.map(p => (\n <li>\n <div class=\"hemfixarna_categories--label hemfixarna_product--label\">\n <div>\n <p>{p.fields.title}</p>\n <span>{p.fields.ID}</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText(String(p.fields.ID))}>Kopiera ID</button>\n {this.customer.at_hemfixarna ? (\n <button onClick={() => navigator.clipboard.writeText(`${getApiUrl()}/partner/${this.customer.post_name}?id=${p.fields.ID}`)}>Kopiera URL</button>\n ) : (\n <button onClick={() => (this.selectedID = String(p.fields.ID))}>Ladda produkt</button>\n )}\n </div>\n </div>\n </li>\n ))}\n </ul>\n ) : (\n <ul>\n {c.sub_categories &&\n c.sub_categories.map(sc => (\n <li>\n <div class=\"hemfixarna_categories--label\">\n <div>\n <p>{sc.name}</p>\n <span>{`c-${sc.id}`}</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText(`c-${sc.id}`)}>Kopiera ID</button>\n {this.customer.at_hemfixarna ? (\n <button onClick={() => navigator.clipboard.writeText(`${getApiUrl()}/partner/${this.customer.post_name}?id=c-${c.id}`)}>Kopiera URL</button>\n ) : (\n <button onClick={() => (this.selectedID = `c-${sc.id}`)}>Ladda kategori</button>\n )}\n </div>\n </div>\n <ul>\n {sc.products.map(p => (\n <li>\n <div class=\"hemfixarna_categories--label hemfixarna_product--label\">\n <div>\n <p>{p.fields.title}</p>\n <span>{p.fields.ID}</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText(String(p.fields.ID))}>Kopiera ID</button>\n {this.customer.at_hemfixarna ? (\n <button onClick={() => navigator.clipboard.writeText(`${getApiUrl()}/partner/${this.customer.post_name}?id=${p.fields.ID}`)}>\n Kopiera URL\n </button>\n ) : (\n <button onClick={() => (this.selectedID = String(p.fields.ID))}>Ladda produkt</button>\n )}\n </div>\n </div>\n </li>\n ))}\n </ul>\n </li>\n ))}\n </ul>\n )}\n </li>\n ))}\n </div>\n </ul>\n </div>\n ) : (\n <div>\n <form\n onSubmit={e => {\n e.preventDefault();\n this.handleLogin();\n }}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '1rem',\n maxWidth: '300px',\n margin: 'auto',\n padding: '20px',\n border: '1px solid #ccc',\n borderRadius: '5px',\n gridColumn: 'span 2',\n }}\n >\n <input type=\"password\" placeholder=\"Lösenord\" />\n <button type=\"submit\">Logga in</button>\n {this.loginError && <span>Fel lösenord</span>}\n </form>\n </div>\n )}\n </Fragment>\n ) : (\n <h1\n style={{\n textAlign: 'center',\n margin: 'auto',\n padding: '20px',\n fontSize: '24px',\n fontWeight: 'bold',\n color: 'red',\n }}\n >\n No customer found\n </h1>\n );\n }\n}\n"]}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { h } from '@stencil/core';
|
2
|
+
import Personnummer from 'personnummer';
|
3
|
+
import state from '../../store';
|
4
|
+
import apiSearch from '../../utils/creditSafe';
|
5
|
+
import { scrollToTop } from '../../utils/scroll';
|
6
|
+
export class HemfixarnaGetuser {
|
7
|
+
constructor() {
|
8
|
+
this.handleChangeEmail = (e) => {
|
9
|
+
this.emailError = null;
|
10
|
+
this.email = e.target.value;
|
11
|
+
};
|
12
|
+
this.handleChangePhone = (e) => {
|
13
|
+
this.phoneError = null;
|
14
|
+
this.phone = e.target.value;
|
15
|
+
};
|
16
|
+
this.handleChangessn = (e) => {
|
17
|
+
this.ssnError = null;
|
18
|
+
this.ssn = e.target.value;
|
19
|
+
};
|
20
|
+
this.handleSubmit = async (e) => {
|
21
|
+
e.preventDefault();
|
22
|
+
const emailRegex = new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
|
23
|
+
const validEmail = emailRegex.test(this.email);
|
24
|
+
if (!validEmail) {
|
25
|
+
this.emailError = 'Ange en giltig e-postadress';
|
26
|
+
}
|
27
|
+
const validPhone = /^[\d\s()+-]{6,}$/.test(this.phone);
|
28
|
+
if (!validPhone) {
|
29
|
+
this.phoneError = 'Ange ett giltigt telefonnummer';
|
30
|
+
}
|
31
|
+
const validssn = Personnummer.valid(this.ssn);
|
32
|
+
if (!validssn) {
|
33
|
+
this.ssnError = 'Ange ett giltigt personnummer';
|
34
|
+
}
|
35
|
+
else if (validssn) {
|
36
|
+
const pn = Personnummer.parse(this.ssn).format(true);
|
37
|
+
this.ssn = [pn.slice(0, 8), '-', pn.slice(8)].join('');
|
38
|
+
}
|
39
|
+
if (validEmail && validPhone && validssn) {
|
40
|
+
try {
|
41
|
+
const creditSafeData = await apiSearch(this.ssn);
|
42
|
+
if (creditSafeData) {
|
43
|
+
state.creditSafeUser = creditSafeData;
|
44
|
+
state.checkoutStep = 2;
|
45
|
+
state.user = Object.assign(Object.assign({}, creditSafeData), { email: this.email, phone: this.phone, ssn: this.ssn });
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';
|
49
|
+
}
|
50
|
+
}
|
51
|
+
catch (e) {
|
52
|
+
this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';
|
53
|
+
console.log(e);
|
54
|
+
}
|
55
|
+
finally {
|
56
|
+
const el = this.el.closest('.hemfixarna_content');
|
57
|
+
scrollToTop(el);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
};
|
61
|
+
this.render = () => {
|
62
|
+
return (h("form", { class: "mb-2", onSubmit: e => this.handleSubmit(e) }, h("div", null, h("input", { class: `${this.email.length ? 'input_active' : ''}`, onChange: e => this.handleChangeEmail(e), type: "email", name: "email", value: this.email }), h("label", { htmlFor: "email" }, "E-post ")), this.emailError && h("span", null, this.emailError), h("div", null, h("input", { class: `${this.phone.length ? 'input_active' : ''}`, onChange: e => this.handleChangePhone(e), type: "tel", name: "phone", value: this.phone }), h("label", { htmlFor: "phone" }, "Mobiltelefon ")), this.phoneError && h("span", null, this.phoneError), h("div", null, h("input", { class: `${this.ssn.length ? 'input_active' : ''}`, onChange: e => this.handleChangessn(e), type: "tel", name: "ssn", value: this.ssn }), h("label", { htmlFor: "phone" }, "Personnummer*")), this.ssnError && h("span", null, this.ssnError), h("input", { type: "submit", value: "Forts\u00E4tt*" }), h("p", null, "*Vi h\u00E4mtar din adress")));
|
63
|
+
};
|
64
|
+
this.email = '';
|
65
|
+
this.emailError = null;
|
66
|
+
this.phone = '';
|
67
|
+
this.phoneError = null;
|
68
|
+
this.ssn = '';
|
69
|
+
this.ssnError = null;
|
70
|
+
}
|
71
|
+
componentWillLoad() {
|
72
|
+
if (state.user) {
|
73
|
+
this.email = state.user.email;
|
74
|
+
this.phone = state.user.phone;
|
75
|
+
this.ssn = state.user.ssn;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
static get is() { return "hemfixarna-getuser"; }
|
79
|
+
static get states() {
|
80
|
+
return {
|
81
|
+
"email": {},
|
82
|
+
"emailError": {},
|
83
|
+
"phone": {},
|
84
|
+
"phoneError": {},
|
85
|
+
"ssn": {},
|
86
|
+
"ssnError": {}
|
87
|
+
};
|
88
|
+
}
|
89
|
+
static get elementRef() { return "el"; }
|
90
|
+
}
|
91
|
+
//# sourceMappingURL=hemfixarna-getuser.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hem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CAAC,CAAC,CAAC,EAAE,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAE,IAAI,CAAC,GAAG,GAAI;UAC3I,aAAO,OAAO,EAAC,OAAO,oBAAsB,CACxC;QACL,IAAI,CAAC,QAAQ,IAAI,gBAAO,IAAI,CAAC,QAAQ,CAAQ;QAC9C,aAAO,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAW,GAAG;QACzC,0CAA4B,CACvB,CACR,CAAC;IACJ,CAAC,CAAC;iBAlGuB,EAAE;sBACU,IAAI;iBAChB,EAAE;sBACU,IAAI;eAClB,EAAE;oBACU,IAAI;;EAGvC,iBAAiB;IACf,IAAI,KAAK,CAAC,IAAI,EAAE;MACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;MAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;MAC9B,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;KAC3B;EACH,CAAC;;;;;;;;;;;CAqFF","sourcesContent":["import { Component, Element, State, h } from '@stencil/core';\nimport Personnummer from 'personnummer';\nimport state from '../../store';\nimport apiSearch from '../../utils/creditSafe';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-getuser',\n shadow: false,\n})\nexport class HemfixarnaGetuser {\n @State() email: string = '';\n @State() emailError: string | null = null;\n @State() phone: string = '';\n @State() phoneError: string | null = null;\n @State() ssn: string = '';\n @State() ssnError: string | null = null;\n @Element() private el: HTMLElement;\n\n componentWillLoad() {\n if (state.user) {\n this.email = state.user.email;\n this.phone = state.user.phone;\n this.ssn = state.user.ssn;\n }\n }\n\n handleChangeEmail = (e: Event) => {\n this.emailError = null;\n this.email = (e.target as HTMLInputElement).value;\n };\n\n handleChangePhone = (e: Event) => {\n this.phoneError = null;\n this.phone = (e.target as HTMLInputElement).value;\n };\n\n handleChangessn = (e: Event) => {\n this.ssnError = null;\n this.ssn = (e.target as HTMLInputElement).value;\n };\n\n handleSubmit = async (e: Event) => {\n e.preventDefault();\n const emailRegex = new RegExp(\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n );\n const validEmail = emailRegex.test(this.email);\n if (!validEmail) {\n this.emailError = 'Ange en giltig e-postadress';\n }\n const validPhone = /^[\\d\\s()+-]{6,}$/.test(this.phone);\n if (!validPhone) {\n this.phoneError = 'Ange ett giltigt telefonnummer';\n }\n const validssn = Personnummer.valid(this.ssn);\n if (!validssn) {\n this.ssnError = 'Ange ett giltigt personnummer';\n } else if (validssn) {\n const pn = Personnummer.parse(this.ssn).format(true);\n this.ssn = [pn.slice(0, 8), '-', pn.slice(8)].join('');\n }\n if (validEmail && validPhone && validssn) {\n try {\n const creditSafeData = await apiSearch(this.ssn);\n if (creditSafeData) {\n state.creditSafeUser = creditSafeData;\n state.checkoutStep = 2;\n state.user = {\n ...creditSafeData,\n email: this.email,\n phone: this.phone,\n ssn: this.ssn,\n };\n } else {\n this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';\n }\n } catch (e) {\n this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';\n console.log(e);\n } finally {\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n }\n }\n };\n\n render = () => {\n return (\n <form class=\"mb-2\" onSubmit={e => this.handleSubmit(e)}>\n <div>\n <input class={`${this.email.length ? 'input_active' : ''}`} onChange={e => this.handleChangeEmail(e)} type=\"email\" name=\"email\" value={this.email} />\n <label htmlFor=\"email\">E-post </label>\n </div>\n {this.emailError && <span>{this.emailError}</span>}\n <div>\n <input class={`${this.phone.length ? 'input_active' : ''}`} onChange={e => this.handleChangePhone(e)} type=\"tel\" name=\"phone\" value={this.phone} />\n <label htmlFor=\"phone\">Mobiltelefon </label>\n </div>\n {this.phoneError && <span>{this.phoneError}</span>}\n <div>\n <input class={`${this.ssn.length ? 'input_active' : ''}`} onChange={e => this.handleChangessn(e)} type=\"tel\" name=\"ssn\" value={this.ssn} />\n <label htmlFor=\"phone\">Personnummer*</label>\n </div>\n {this.ssnError && <span>{this.ssnError}</span>}\n <input type=\"submit\" value=\"Fortsätt*\" />\n <p>*Vi hämtar din adress</p>\n </form>\n );\n };\n}\n"]}
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
constructor(hostRef) {
|
6
|
-
registerInstance(this, hostRef);
|
1
|
+
import { Fragment, getAssetPath, h } from '@stencil/core';
|
2
|
+
import state from '../../store';
|
3
|
+
export class HemfixarnaInfo {
|
4
|
+
constructor() {
|
7
5
|
this.logo = getAssetPath(`./assets/hemfixarna.svg`);
|
8
6
|
}
|
9
7
|
render() {
|
@@ -11,8 +9,6 @@ const HemfixarnaInfo = class {
|
|
11
9
|
const checked = getAssetPath(`./assets/checked.svg`);
|
12
10
|
return (h("div", { class: "hemfixarna_info" }, state.step < 5 ? (h(Fragment, null, h("h2", null, state.customer.info_title), h("p", null, state.customer.info_text))) : (h("h2", null, state.customer.checkout_title)), h("ul", { class: "hemfixarna_features" }, state.step < 5 ? (h(Fragment, null, ((_a = state.customer.trust_badges) === null || _a === void 0 ? void 0 : _a.length) ? (h(Fragment, null, state.customer.trust_badges.map(l => (h("li", { key: l.text }, h("img", { src: checked, alt: "checked" }), h("p", null, l.text)))))) : (h(Fragment, null, state.options.trust.map(l => (h("li", { key: l.trust_badge }, h("img", { src: checked, alt: "checked" }), h("p", null, l.trust_badge)))))))) : (h(Fragment, null, (_b = state.customer.checkout_trust_badges) === null || _b === void 0 ? void 0 : _b.map(l => (h("li", { key: l.text }, h("img", { src: checked, alt: "checked" }), h("p", null, l.text))))))), h("img", { src: this.logo, width: 200, alt: "hemfixarna" }), h("a", { class: "hemfixarna_product--link", target: "_blank", href: state.options.link.url }, state.options.link.title)));
|
13
11
|
}
|
14
|
-
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
//# sourceMappingURL=hemfixarna-info.entry.js.map
|
12
|
+
static get is() { return "hemfixarna-info"; }
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=hemfixarna-info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hemfixarna-info.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-info/hemfixarna-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,MAAM,aAAa,CAAC;AAMhC,MAAM,OAAO,cAAc;EAJ3B;IAKE,SAAI,GAAG,YAAY,CAAC,yBAAyB,CAAC,CAAC;GAuDhD;EArDC,MAAM;;IACJ,MAAM,OAAO,GAAG,YAAY,CAAC,sBAAsB,CAAC,CAAC;IACrD,OAAO,CACL,WAAK,KAAK,EAAC,iBAAiB;MACzB,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAChB,EAAC,QAAQ;QACP,cAAK,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAM;QACpC,aAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAK,CACxB,CACZ,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAM,CACzC;MACD,UAAI,KAAK,EAAC,qBAAqB,IAC5B,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAChB,EAAC,QAAQ,QACN,CAAA,MAAA,KAAK,CAAC,QAAQ,CAAC,YAAY,0CAAE,MAAM,EAAC,CAAC,CAAC,CACrC,EAAC,QAAQ,QACN,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACpC,UAAI,GAAG,EAAE,CAAC,CAAC,IAAI;QACb,WAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,GAAG;QACnC,aAAI,CAAC,CAAC,IAAI,CAAK,CACZ,CACN,CAAC,CACO,CACZ,CAAC,CAAC,CAAC,CACF,EAAC,QAAQ,QACN,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAC5B,UAAI,GAAG,EAAE,CAAC,CAAC,WAAW;QACpB,WAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,GAAG;QACnC,aAAI,CAAC,CAAC,WAAW,CAAK,CACnB,CACN,CAAC,CACO,CACZ,CACQ,CACZ,CAAC,CAAC,CAAC,CACF,EAAC,QAAQ,QACN,MAAA,KAAK,CAAC,QAAQ,CAAC,qBAAqB,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAC9C,UAAI,GAAG,EAAE,CAAC,CAAC,IAAI;QACb,WAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,GAAG;QACnC,aAAI,CAAC,CAAC,IAAI,CAAK,CACZ,CACN,CAAC,CACO,CACZ,CACE;MACL,WAAK,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAC,YAAY,GAAG;MACpD,SAAG,KAAK,EAAC,0BAA0B,EAAC,MAAM,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAC7E,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CACvB,CACA,CACP,CAAC;EACJ,CAAC;;CACF","sourcesContent":["import { Component, Fragment, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\n\n@Component({\n tag: 'hemfixarna-info',\n shadow: false,\n})\nexport class HemfixarnaInfo {\n logo = getAssetPath(`./assets/hemfixarna.svg`);\n\n render() {\n const checked = getAssetPath(`./assets/checked.svg`);\n return (\n <div class=\"hemfixarna_info\">\n {state.step < 5 ? (\n <Fragment>\n <h2>{state.customer.info_title}</h2>\n <p>{state.customer.info_text}</p>\n </Fragment>\n ) : (\n <h2>{state.customer.checkout_title}</h2>\n )}\n <ul class=\"hemfixarna_features\">\n {state.step < 5 ? (\n <Fragment>\n {state.customer.trust_badges?.length ? (\n <Fragment>\n {state.customer.trust_badges.map(l => (\n <li key={l.text}>\n <img src={checked} alt=\"checked\" />\n <p>{l.text}</p>\n </li>\n ))}\n </Fragment>\n ) : (\n <Fragment>\n {state.options.trust.map(l => (\n <li key={l.trust_badge}>\n <img src={checked} alt=\"checked\" />\n <p>{l.trust_badge}</p>\n </li>\n ))}\n </Fragment>\n )}\n </Fragment>\n ) : (\n <Fragment>\n {state.customer.checkout_trust_badges?.map(l => (\n <li key={l.text}>\n <img src={checked} alt=\"checked\" />\n <p>{l.text}</p>\n </li>\n ))}\n </Fragment>\n )}\n </ul>\n <img src={this.logo} width={200} alt=\"hemfixarna\" />\n <a class=\"hemfixarna_product--link\" target=\"_blank\" href={state.options.link.url}>\n {state.options.link.title}\n </a>\n </div>\n );\n }\n}\n"]}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
:host .invoice {
|
2
|
+
gap: 16px;
|
3
|
+
display: grid;
|
4
|
+
}
|
5
|
+
:host .invoice form > span {
|
6
|
+
text-align: center;
|
7
|
+
padding: 16px 0;
|
8
|
+
}
|
9
|
+
:host .invoice img {
|
10
|
+
right: unset;
|
11
|
+
left: unset;
|
12
|
+
position: initial;
|
13
|
+
transform: none;
|
14
|
+
}
|
15
|
+
:host .invoice label {
|
16
|
+
cursor: pointer;
|
17
|
+
font-size: 14px;
|
18
|
+
display: flex;
|
19
|
+
align-items: flex-start;
|
20
|
+
padding: 16px 0;
|
21
|
+
}
|
22
|
+
:host .invoice label input {
|
23
|
+
margin: 0 5px 0 0;
|
24
|
+
accent-color: #ea662c;
|
25
|
+
}
|
26
|
+
:host .invoice-preview {
|
27
|
+
display: flex;
|
28
|
+
gap: 4px;
|
29
|
+
}
|
30
|
+
:host .invoice-preview div {
|
31
|
+
position: relative;
|
32
|
+
}
|
33
|
+
:host .invoice-preview div button {
|
34
|
+
position: absolute;
|
35
|
+
top: 0;
|
36
|
+
right: 0;
|
37
|
+
padding: 0;
|
38
|
+
}
|
39
|
+
:host .invoice-preview div button img {
|
40
|
+
width: 24px;
|
41
|
+
height: 24px;
|
42
|
+
}
|
43
|
+
:host .invoice-preview div > img {
|
44
|
+
width: 100px;
|
45
|
+
height: 80px;
|
46
|
+
object-fit: cover;
|
47
|
+
}
|
48
|
+
:host .invoice input[type=email],
|
49
|
+
:host .invoice input[type=tel],
|
50
|
+
:host .invoice textarea {
|
51
|
+
padding: 16px;
|
52
|
+
border: 1px solid #fcd9c9;
|
53
|
+
font-size: 16px;
|
54
|
+
}
|
55
|
+
:host .invoice textarea {
|
56
|
+
resize: none;
|
57
|
+
height: 200px;
|
58
|
+
font-family: "Inter", sans-serif;
|
59
|
+
}
|
60
|
+
:host .invoice div:has(> input[type=file]) {
|
61
|
+
display: flex;
|
62
|
+
align-items: center;
|
63
|
+
justify-content: center;
|
64
|
+
cursor: pointer;
|
65
|
+
background: #fff;
|
66
|
+
border: 1px solid #fcd9c9;
|
67
|
+
padding: 32px 16px;
|
68
|
+
gap: 16px;
|
69
|
+
}
|
70
|
+
:host .invoice div:has(> input[type=file]) span {
|
71
|
+
color: #000;
|
72
|
+
font-size: 12px;
|
73
|
+
}
|
74
|
+
:host .invoice input[type=file] {
|
75
|
+
display: none;
|
76
|
+
}
|
@@ -1,13 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
import {
|
4
|
-
|
5
|
-
const hemfixarnaInvoiceCss = ":host .invoice{gap:16px;display:grid}:host .invoice form>span{text-align:center;padding:16px 0}:host .invoice img{right:unset;left:unset;position:initial;transform:none}:host .invoice label{cursor:pointer;font-size:14px;display:flex;align-items:flex-start;padding:16px 0}:host .invoice label input{margin:0 5px 0 0;accent-color:#ea662c}:host .invoice-preview{display:flex;gap:4px}:host .invoice-preview div{position:relative}:host .invoice-preview div button{position:absolute;top:0;right:0;padding:0}:host .invoice-preview div button img{width:24px;height:24px}:host .invoice-preview div>img{width:100px;height:80px;object-fit:cover}:host .invoice input[type=email],:host .invoice input[type=tel],:host .invoice textarea{padding:16px;border:1px solid #fcd9c9;font-size:16px}:host .invoice textarea{resize:none;height:200px;font-family:\"Inter\", sans-serif}:host .invoice div:has(>input[type=file]){display:flex;align-items:center;justify-content:center;cursor:pointer;background:#fff;border:1px solid #fcd9c9;padding:32px 16px;gap:16px}:host .invoice div:has(>input[type=file]) span{color:#000;font-size:12px}:host .invoice input[type=file]{display:none}";
|
6
|
-
|
1
|
+
import { getAssetPath, h } from '@stencil/core';
|
2
|
+
import state from '../../store';
|
3
|
+
import { getApiUrl } from '../../utils/enviroment';
|
7
4
|
const base = `${getApiUrl()}/wp-json/headless`;
|
8
|
-
|
9
|
-
constructor(
|
10
|
-
registerInstance(this, hostRef);
|
5
|
+
export class HemfixarnaInvoice {
|
6
|
+
constructor() {
|
11
7
|
this.formError = null;
|
12
8
|
this.displayImages = [];
|
13
9
|
this.formImages = [];
|
@@ -147,10 +143,25 @@ const HemfixarnaInvoice = class {
|
|
147
143
|
const upload = getAssetPath(`./assets/drag-drop.svg`);
|
148
144
|
return (h("div", { class: "invoice" }, ((_a = state.selectedProduct) === null || _a === void 0 ? void 0 : _a.invoice_description) ? h("p", null, state.selectedProduct.invoice_description) : null, h("form", { onSubmit: e => this.submit(e) }, h("textarea", { name: "descriptionInput", placeholder: "Beskriv ditt \u00E4rende" }), h("div", { role: "button", "aria-label": "upload image", onDragOver: e => this.preventDragOver(e), onDrop: e => this.handleImageDrop(e), onClick: () => this.handleImageClick() }, h("img", { src: upload, alt: "hemfixarna_logo", width: 24 }), h("div", null, h("p", null, "Bifoga ev bilder"), h("span", null, "(dra bilder hit)")), h("input", { onChange: e => this.handleFileInputChange(e), class: "hemfixarna-file-upload", accept: "image/*", type: "file", multiple: true, name: "fileInput" })), h("div", { class: "invoice-preview" }, this.displayImages.map((img, i) => (h("div", { key: i }, h("img", { src: img, alt: "uploaded image" }), h("button", { onClick: () => this.removeImage(i) }, h("img", { src: getAssetPath(`./assets/close.svg`), alt: "close" })))))), h("input", { placeholder: "E-post", type: "email", name: "emailInput" }), h("input", { placeholder: "Telefonnummer", type: "tel", name: "telInput" }), state.selectedProduct.terms_show_checkbox ? (h("label", null, h("input", { type: "checkbox", name: "termsInput" }), state.selectedProduct.terms)) : null, this.formError ? h("span", null, this.formError) : null, h("input", { type: "submit", value: this.formState === 'loading' ? 'Skickar' : 'Kontakta mig' }))));
|
149
145
|
}
|
150
|
-
get
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
146
|
+
static get is() { return "hemfixarna-invoice"; }
|
147
|
+
static get originalStyleUrls() {
|
148
|
+
return {
|
149
|
+
"$": ["hemfixarna-invoice.scss"]
|
150
|
+
};
|
151
|
+
}
|
152
|
+
static get styleUrls() {
|
153
|
+
return {
|
154
|
+
"$": ["hemfixarna-invoice.css"]
|
155
|
+
};
|
156
|
+
}
|
157
|
+
static get states() {
|
158
|
+
return {
|
159
|
+
"formError": {},
|
160
|
+
"displayImages": {},
|
161
|
+
"formImages": {},
|
162
|
+
"formState": {}
|
163
|
+
};
|
164
|
+
}
|
165
|
+
static get elementRef() { return "el"; }
|
166
|
+
}
|
167
|
+
//# sourceMappingURL=hemfixarna-invoice.js.map
|