hemfixarna-web-components 1.6.2 → 1.6.3
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_36.cjs.entry.js +2763 -0
- package/dist/{hemfixarna-components/index-f1a87cf1.js.map → cjs/hemfixarna-address_36.cjs.entry.js.map} +1 -1
- package/dist/cjs/hemfixarna-components.cjs.js +28 -0
- package/dist/cjs/hemfixarna-components.cjs.js.map +1 -0
- package/dist/cjs/index-b83343b9.js +1687 -0
- package/dist/cjs/index-b83343b9.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 +184 -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 +123 -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 +142 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +132 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js +132 -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 +123 -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 +142 -0
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +132 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js +113 -0
- package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js +113 -0
- package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +132 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +131 -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 +141 -0
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js +131 -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 +123 -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 +132 -0
- package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +113 -0
- package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js +132 -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} +84 -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} +31 -11
- package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-category.entry.js → collection/components/hemfixarna-category.tsx/hemfixarna-category.js} +6 -12
- 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} +27 -32
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +483 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna.css +1031 -0
- package/dist/{hemfixarna-components/hemfixarna-contact.entry.js → collection/components/hemfixarna-contact/hemfixarna-contact.js} +28 -10
- 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 -23
- 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} +31 -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} +50 -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/{hemfixarna-components/hemfixarna-service.entry.js → collection/components/hemfixarna-service/hemfixarna-service.js} +6 -12
- 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 +62 -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/{hemfixarna-components/index-d90ad11b.js → collection/types/index.js} +4 -7
- package/dist/collection/types/index.js.map +1 -0
- package/dist/{hemfixarna-components/api-36f73d0d.js → collection/utils/api.js} +4 -6
- package/dist/collection/utils/api.js.map +1 -0
- package/dist/{hemfixarna-components/calc-4c79b798.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/collection/utils/felixApi.js +18 -0
- package/dist/collection/utils/felixApi.js.map +1 -0
- package/dist/collection/utils/felixFunctions.js +189 -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-641c9a1c.js → collection/utils/types.js} +3 -6
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/esm/hemfixarna-address_36.entry.js +2724 -0
- package/dist/esm/hemfixarna-address_36.entry.js.map +1 -0
- package/dist/esm/hemfixarna-components.js +23 -0
- package/dist/esm/hemfixarna-components.js.map +1 -0
- package/dist/esm/index-8c417125.js +1656 -0
- package/dist/esm/index-8c417125.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-852e7173.js +3 -0
- package/dist/hemfixarna-components/p-852e7173.js.map +1 -0
- package/dist/hemfixarna-components/p-97461831.entry.js +2 -0
- package/dist/hemfixarna-components/p-97461831.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/hemfixarna-components/api-36f73d0d.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-4c79b798.js.map +0 -1
- package/dist/hemfixarna-components/css-shim-62d2171c.js +0 -6
- package/dist/hemfixarna-components/css-shim-62d2171c.js.map +0 -1
- package/dist/hemfixarna-components/dom-46a68c9b.js +0 -75
- package/dist/hemfixarna-components/dom-46a68c9b.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 +0 -27
- 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 -248
- 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 +0 -23
- package/dist/hemfixarna-components/hemfixarna-doro.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-elfa.entry.js +0 -24
- package/dist/hemfixarna-components/hemfixarna-elfa.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-forebygg.entry.js +0 -23
- 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 +0 -24
- 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 +0 -21
- package/dist/hemfixarna-components/hemfixarna-kbygg.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-klint.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-klint.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-kund.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-kund.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-norrgavel.entry.js +0 -21
- 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 +0 -21
- 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 +0 -24
- package/dist/hemfixarna-components/hemfixarna-skanska.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-sparfonster.entry.js +0 -21
- 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 +0 -23
- package/dist/hemfixarna-components/hemfixarna-string-furniture.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-superfront.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-superfront.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-tesla.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-tesla.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js.map +0 -1
- package/dist/hemfixarna-components/index-b6a6e994.js +0 -256
- package/dist/hemfixarna-components/index-b6a6e994.js.map +0 -1
- package/dist/hemfixarna-components/index-d90ad11b.js.map +0 -1
- package/dist/hemfixarna-components/index-f1a87cf1.js +0 -3397
- package/dist/hemfixarna-components/scroll-6c26b5da.js.map +0 -1
- package/dist/hemfixarna-components/shadow-css-05e0c1f4.js +0 -389
- package/dist/hemfixarna-components/shadow-css-05e0c1f4.js.map +0 -1
- package/dist/hemfixarna-components/types-641c9a1c.js.map +0 -1
@@ -1,15 +1,33 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
constructor(hostRef) {
|
5
|
-
registerInstance(this, hostRef);
|
1
|
+
import { h } from '@stencil/core';
|
2
|
+
export class HemfixarnaInfo {
|
3
|
+
constructor() {
|
6
4
|
this.vertical = false;
|
7
5
|
}
|
8
6
|
render() {
|
9
7
|
return (h("div", { class: `hemfixarna_contact ${this.vertical ? 'hemfixarna_contact--vertical' : 'hemfixarna_contact--horizontal'}` }, 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"))));
|
10
8
|
}
|
11
|
-
}
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
static get is() { return "hemfixarna-contact"; }
|
10
|
+
static get properties() {
|
11
|
+
return {
|
12
|
+
"vertical": {
|
13
|
+
"type": "boolean",
|
14
|
+
"mutable": false,
|
15
|
+
"complexType": {
|
16
|
+
"original": "boolean",
|
17
|
+
"resolved": "boolean",
|
18
|
+
"references": {}
|
19
|
+
},
|
20
|
+
"required": false,
|
21
|
+
"optional": true,
|
22
|
+
"docs": {
|
23
|
+
"tags": [],
|
24
|
+
"text": ""
|
25
|
+
},
|
26
|
+
"attribute": "vertical",
|
27
|
+
"reflect": false,
|
28
|
+
"defaultValue": "false"
|
29
|
+
}
|
30
|
+
};
|
31
|
+
}
|
32
|
+
}
|
33
|
+
//# 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;AAMnD,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;MACnH,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';\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 <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,13 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
const MyComponent = class {
|
9
|
-
constructor(hostRef) {
|
10
|
-
registerInstance(this, hostRef);
|
1
|
+
import { getAssetPath, h } from '@stencil/core';
|
2
|
+
import { Business, TopCategory, WidgetStyle } from '../../types';
|
3
|
+
import { getCustomer, getTaxonomy } from '../../utils/api';
|
4
|
+
import { isBusiness } from '../../utils/types';
|
5
|
+
export class MyComponent {
|
6
|
+
constructor() {
|
11
7
|
this.debounce = null;
|
12
8
|
this.cdnLink = '<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"></script>';
|
13
9
|
this.selectedSlug = undefined;
|
@@ -123,16 +119,43 @@ const MyComponent = class {
|
|
123
119
|
render() {
|
124
120
|
var _a;
|
125
121
|
const copy = getAssetPath(`./assets/copy.png`);
|
126
|
-
return (h("div", { class: ((_a = this.customer) === null || _a === void 0 ? void 0 : _a.at_hemfixarna) ? 'hemfixarna_hosted' : '' }, h("div", { class: "hemfixarna_scripts" }, h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, h("p", null, this.getExample()), h("img", { src: copy, height: 20 }), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), this.partner === Business.byggmax && (h("hemfixarna-byggmax", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, forceOldTree: Boolean(process.env.FORCE_OLD_TREE), slug: this.selectedSlug, id: this.selectedID })), this.partner === Business.skanska && h("hemfixarna-skanska", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.sparfonster && (h("hemfixarna-sparfonster", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.string && (h("hemfixarna-string-furniture", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.hornbach && (h("hemfixarna-hornbach", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.traningspartner && (h("hemfixarna-traningspartner", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.superfront && (h("hemfixarna-superfront", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.zaptec && (h("hemfixarna-zaptec", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.tesla && (h("hemfixarna-tesla", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.forebygg && (h("hemfixarna-forebygg", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.doro && h("hemfixarna-doro", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.elfa && h("hemfixarna-elfa", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.kbygg && (h("hemfixarna-kbygg", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.fargvaruhuset && (h("hemfixarna-fargvaruhuset", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.norrgavel && (h("hemfixarna-norrgavel", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.klint && h("hemfixarna-klint", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.flyttsmart && (h("hemfixarna-flyttsmart", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.power && h("hemfixarna-power", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.kund && h("hemfixarna-kund", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), h("div", { class: "hemfixarna_install" }, h("div", { onClick: () => this.copyCdn(), class: "hemfixarna_example" }, h("p", null, this.cdnLink), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText), h("img", { src: copy, height: 20 }))), h("div", { class: "hemfixarna_widgetstyles" }, h("h5", null, "Widget styles"), h("div", null, Object.values(WidgetStyle).map(style => (h("label", { key: style }, h("input", { type: "radio", value: style, checked: this.widgetStyle === style, onChange: () => (this.widgetStyle = style) }), style)))), h("div", null, h("div", null, h("h5", null, "Button background color"), h("input", { type: "text", value: this.buttonBg, onInput: e => (this.buttonBg = e.target.value) })), h("div", null, h("h5", null, "Button text color"), h("input", { type: "text", value: this.buttonColor, onInput: e => (this.buttonColor = e.target.value) })))), h("span", null, "Write an hexa code no # needed"), this.colorAccessibility ? (h("div", null, h("h5", null, "Tillg\u00E4nglighetsrapport"), h("div", null, h("strong", null, "Liten text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.small) } }, this.colorAccessibility.small), h("br", null), h("strong", null, "Fet text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.bold) } }, this.colorAccessibility.bold), h("br", null), h("strong", null, "Stor text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.large) } }, this.colorAccessibility.large), h("br", null), h("strong", null, "Kontrastf\u00F6rh\u00E5llande:"), " ", this.colorAccessibility.contrast))) : null), h("ul", { class: "hemfixarna_categories" }, this.customer ? (h("div", null, this.customer.logo ? (h("div", { style: { width: '100%', display: 'flex', justifyContent: 'center' } }, h("img", { style: { maxWidth: '250px', height: 'auto', margin: '0 auto 2rem' }, src: this.customer.logo.url, alt: this.customer.post_title }))) : null, this.showMaleri() ? (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, "M\u00E5leriverktyget"), h("span", null, "maleri")), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText('maleri') }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a =
|
127
|
-
c.sub_categories.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.name), h("span", null, `c-${sc.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a =
|
128
|
-
}
|
129
|
-
static get
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
122
|
+
return (h("div", { class: ((_a = this.customer) === null || _a === void 0 ? void 0 : _a.at_hemfixarna) ? 'hemfixarna_hosted' : '' }, h("div", { class: "hemfixarna_scripts" }, h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, h("p", null, this.getExample()), h("img", { src: copy, height: 20 }), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), this.partner === Business.byggmax && (h("hemfixarna-byggmax", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, forceOldTree: Boolean(process.env.FORCE_OLD_TREE), slug: this.selectedSlug, id: this.selectedID })), this.partner === Business.skanska && h("hemfixarna-skanska", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.sparfonster && (h("hemfixarna-sparfonster", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.string && (h("hemfixarna-string-furniture", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.hornbach && (h("hemfixarna-hornbach", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.traningspartner && (h("hemfixarna-traningspartner", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.superfront && (h("hemfixarna-superfront", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.zaptec && (h("hemfixarna-zaptec", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.tesla && (h("hemfixarna-tesla", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.forebygg && (h("hemfixarna-forebygg", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.doro && h("hemfixarna-doro", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.elfa && h("hemfixarna-elfa", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.kbygg && (h("hemfixarna-kbygg", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.fargvaruhuset && (h("hemfixarna-fargvaruhuset", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.norrgavel && (h("hemfixarna-norrgavel", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.klint && h("hemfixarna-klint", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.flyttsmart && (h("hemfixarna-flyttsmart", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.power && h("hemfixarna-power", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.kund && h("hemfixarna-kund", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), h("div", { class: "hemfixarna_install" }, h("div", { onClick: () => this.copyCdn(), class: "hemfixarna_example" }, h("p", null, this.cdnLink), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText), h("img", { src: copy, height: 20 }))), h("div", { class: "hemfixarna_widgetstyles" }, h("h5", null, "Widget styles"), h("div", null, Object.values(WidgetStyle).map(style => (h("label", { key: style }, h("input", { type: "radio", value: style, checked: this.widgetStyle === style, onChange: () => (this.widgetStyle = style) }), style)))), h("div", null, h("div", null, h("h5", null, "Button background color"), h("input", { type: "text", value: this.buttonBg, onInput: e => (this.buttonBg = e.target.value) })), h("div", null, h("h5", null, "Button text color"), h("input", { type: "text", value: this.buttonColor, onInput: e => (this.buttonColor = e.target.value) })))), h("span", null, "Write an hexa code no # needed"), this.colorAccessibility ? (h("div", null, h("h5", null, "Tillg\u00E4nglighetsrapport"), h("div", null, h("strong", null, "Liten text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.small) } }, this.colorAccessibility.small), h("br", null), h("strong", null, "Fet text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.bold) } }, this.colorAccessibility.bold), h("br", null), h("strong", null, "Stor text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.large) } }, this.colorAccessibility.large), h("br", null), h("strong", null, "Kontrastf\u00F6rh\u00E5llande:"), " ", this.colorAccessibility.contrast))) : null), h("ul", { class: "hemfixarna_categories" }, this.customer ? (h("div", null, this.customer.logo ? (h("div", { style: { width: '100%', display: 'flex', justifyContent: 'center' } }, h("img", { style: { maxWidth: '250px', height: 'auto', margin: '0 auto 2rem' }, src: this.customer.logo.url, alt: this.customer.post_title }))) : null, this.showMaleri() ? (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, "M\u00E5leriverktyget"), h("span", null, "maleri")), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText('maleri') }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=maleri`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = 'maleri') }, "Ladda m\u00E5leri")))))) : null, this.customer.categories.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `c-${c.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${c.id}`) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = `c-${c.id}`) }, "Ladda kategori")))), c.show_products && c.products ? (h("ul", null, c.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt"))))))))) : (h("ul", null, c.sub_categories &&
|
123
|
+
c.sub_categories.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.name), h("span", null, `c-${sc.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = `c-${sc.id}`) }, "Ladda kategori")))), h("ul", null, sc.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt")))))))))))))))))) : this.tree ? (h("div", null, this.tree.sub_cats.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `category/${c.slug}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`category/${c.slug}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `category/${c.slug}`) }, "Ladda kategori"))), h("ul", null, c.services.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `service/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`service/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `service/${sc.post_name}`) }, "Ladda kategori"))), h("ul", null, sc.products.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `product/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`product/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `product/${sc.post_name}`) }, "Ladda produkt")))))))))))))))) : null)));
|
124
|
+
}
|
125
|
+
static get is() { return "hemfixarna-demo"; }
|
126
|
+
static get encapsulation() { return "shadow"; }
|
127
|
+
static get originalStyleUrls() {
|
128
|
+
return {
|
129
|
+
"$": ["hemfixarna-demo.scss"]
|
130
|
+
};
|
131
|
+
}
|
132
|
+
static get styleUrls() {
|
133
|
+
return {
|
134
|
+
"$": ["hemfixarna-demo.css"]
|
135
|
+
};
|
136
|
+
}
|
137
|
+
static get states() {
|
138
|
+
return {
|
139
|
+
"selectedSlug": {},
|
140
|
+
"selectedID": {},
|
141
|
+
"tooltipText": {},
|
142
|
+
"tree": {},
|
143
|
+
"customer": {},
|
144
|
+
"widgetStyle": {},
|
145
|
+
"buttonBg": {},
|
146
|
+
"buttonColor": {},
|
147
|
+
"partner": {},
|
148
|
+
"colorAccessibility": {}
|
149
|
+
};
|
150
|
+
}
|
151
|
+
static get watchers() {
|
152
|
+
return [{
|
153
|
+
"propName": "buttonBg",
|
154
|
+
"methodName": "debouncedFunction"
|
155
|
+
}, {
|
156
|
+
"propName": "buttonColor",
|
157
|
+
"methodName": "debouncedFunction"
|
158
|
+
}];
|
159
|
+
}
|
160
|
+
}
|
161
|
+
//# sourceMappingURL=hemfixarna-demo.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hemfix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WAAW,EAAE,CAAC,SAAS,EAAE,CAAC,qBAAyB,CAC3F,CACF;UACN,cACG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CACrB;YACE,WAAK,KAAK,EAAC,8BAA8B;cACvC;gBACE,aAAI,EAAE,CAAC,UAAU,CAAK;gBACtB,gBAAO,WAAW,EAAE,CAAC,SAAS,EAAE,CAAQ,CACpC;cACN;gBACE,cAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,CAAC,mBAAuB;gBACtG,cAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,WAAW,EAAE,CAAC,SAAS,EAAE,CAAC,oBAAwB,CAC1F,CACF,CACH,CACN,CAAC,CACC,CACF,CACN,CAAC,CACC,CACF,CACN,CAAC,CACE,CACP,CAAC,CAAC,CAAC,IAAI,CACL,CACD,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, State, Watch, getAssetPath, h } from '@stencil/core';\nimport { Business, Category, Customer, TopCategory, WidgetStyle } from '../../types';\nimport { getCustomer, getTaxonomy } from '../../utils/api';\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 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 fetch('https://www.aremycolorsaccessible.com/api/are-they', {\n mode: 'cors',\n method: 'POST',\n body: JSON.stringify({ colors: [firstColor, secondColor] }),\n })\n .then(response => response.json())\n .then(json => {\n if (json && (json satisfies ColorAccessibility)) {\n this.colorAccessibility = json;\n }\n });\n // Your color accessibility logic here\n }\n\n getTopLevelCategory() {\n switch (process.env.BUSINESS as Business) {\n case Business.byggmax:\n return TopCategory.byggmax;\n default:\n return '';\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 if (process.env.FORCE_OLD_TREE) {\n const tree = await getTaxonomy(this.getTopLevelCategory());\n if ((tree as any)?.code === 'not_found') {\n // console.warn('tree not found');\n } else if (tree) {\n this.tree = tree as Category;\n }\n } else {\n const partner = window.location.pathname.replace('/', '');\n this.partner = isBusiness(partner) ? partner : (process.env.BUSINESS as Business) ?? Business.kund;\n const customer = await getCustomer(this.partner);\n if (customer.code !== 'not_found' && customer) {\n this.customer = customer;\n }\n }\n }\n\n getExample() {\n return `<hemfixarna-${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-${this.partner}>`;\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 render() {\n const copy = getAssetPath(`./assets/copy.png`);\n\n return (\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 {(this.partner as Business) === Business.byggmax && (\n <hemfixarna-byggmax\n buttonColor={this.buttonColor}\n buttonBg={this.buttonBg}\n widgetStyle={this.widgetStyle}\n forceOldTree={Boolean(process.env.FORCE_OLD_TREE)}\n slug={this.selectedSlug}\n id={this.selectedID}\n />\n )}\n {this.partner === Business.skanska && <hemfixarna-skanska buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />}\n {this.partner === Business.sparfonster && (\n <hemfixarna-sparfonster buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.string && (\n <hemfixarna-string-furniture buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.hornbach && (\n <hemfixarna-hornbach isDemo buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.traningspartner && (\n <hemfixarna-traningspartner buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.superfront && (\n <hemfixarna-superfront buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.zaptec && (\n <hemfixarna-zaptec isDemo buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.tesla && (\n <hemfixarna-tesla isDemo buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.forebygg && (\n <hemfixarna-forebygg buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.doro && <hemfixarna-doro buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />}\n {this.partner === Business.elfa && <hemfixarna-elfa isDemo buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />}\n {this.partner === Business.kbygg && (\n <hemfixarna-kbygg isDemo buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.fargvaruhuset && (\n <hemfixarna-fargvaruhuset isDemo buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.norrgavel && (\n <hemfixarna-norrgavel isDemo buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.klint && <hemfixarna-klint buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />}\n {this.partner === Business.flyttsmart && (\n <hemfixarna-flyttsmart buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />\n )}\n {this.partner === Business.power && <hemfixarna-power buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />}\n {this.partner === Business.kund && <hemfixarna-kund buttonColor={this.buttonColor} buttonBg={this.buttonBg} widgetStyle={this.widgetStyle} id={this.selectedID} />}\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 {this.customer ? (\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(`${process.env.API_URL ?? 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=maleri`)}>\n Kopiera URL\n </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(`${process.env.API_URL ?? 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`)}>\n Kopiera URL\n </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\n onClick={() =>\n navigator.clipboard.writeText(`${process.env.API_URL ?? 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`)\n }\n >\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 ) : (\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\n onClick={() =>\n navigator.clipboard.writeText(`${process.env.API_URL ?? 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`)\n }\n >\n Kopiera URL\n </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\n onClick={() =>\n navigator.clipboard.writeText(`${process.env.API_URL ?? 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`)\n }\n >\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 ) : this.tree ? (\n <div>\n {this.tree.sub_cats.map(c => (\n <li>\n <div class=\"hemfixarna_categories--label hemfixarna_categories--label--big\">\n <div>\n <p>{c.name}</p>\n <span>{`category/${c.slug}`}</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText(`category/${c.slug}`)}>Kopiera slug</button>\n <button onClick={() => (this.selectedSlug = `category/${c.slug}`)}>Ladda kategori</button>\n </div>\n </div>\n <ul>\n {c.services.map(sc => (\n <li>\n <div class=\"hemfixarna_categories--label\">\n <div>\n <p>{sc.post_title}</p>\n <span>{`service/${sc.post_name}`}</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText(`service/${sc.post_name}`)}>Kopiera slug</button>\n <button onClick={() => (this.selectedSlug = `service/${sc.post_name}`)}>Ladda kategori</button>\n </div>\n </div>\n <ul>\n {sc.products.map(sc => (\n <li>\n <div class=\"hemfixarna_categories--label\">\n <div>\n <p>{sc.post_title}</p>\n <span>{`product/${sc.post_name}`}</span>\n </div>\n <div>\n <button onClick={() => navigator.clipboard.writeText(`product/${sc.post_name}`)}>Kopiera slug</button>\n <button onClick={() => (this.selectedSlug = `product/${sc.post_name}`)}>Ladda produkt</button>\n </div>\n </div>\n </li>\n ))}\n </ul>\n </li>\n ))}\n </ul>\n </li>\n ))}\n </div>\n ) : null}\n </ul>\n </div>\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":"hemfixarna-getuser.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-getuser/hemfixarna-getuser.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,iBAAiB;;IAiB5B,sBAAiB,GAAG,CAAC,CAAQ,EAAE,EAAE;MAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MACvB,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;IACpD,CAAC,CAAC;IAEF,sBAAiB,GAAG,CAAC,CAAQ,EAAE,EAAE;MAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MACvB,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;IACpD,CAAC,CAAC;IAEF,oBAAe,GAAG,CAAC,CAAQ,EAAE,EAAE;MAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;MACrB,IAAI,CAAC,GAAG,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;IAClD,CAAC,CAAC;IAEF,iBAAY,GAAG,KAAK,EAAE,CAAQ,EAAE,EAAE;MAChC,CAAC,CAAC,cAAc,EAAE,CAAC;MACnB,MAAM,UAAU,GAAG,IAAI,MAAM,CAC3B,wJAAwJ,CACzJ,CAAC;MACF,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MAC/C,IAAI,CAAC,U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AAc,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,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, state.customer.checkout_trust_badges.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,KAAK,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAC7C,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"]}
|