hemfixarna-web-components 0.3.0 → 0.3.1
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/hemfixarna-components/api-3228fe30.js +28 -0
- package/dist/hemfixarna-components/api-3228fe30.js.map +1 -0
- package/dist/hemfixarna-components/app-globals-0f993ce5.js.map +1 -1
- package/dist/hemfixarna-components/assets/back.svg +3 -0
- package/dist/hemfixarna-components/assets/cart.svg +10 -0
- package/dist/hemfixarna-components/assets/checked.svg +10 -0
- package/dist/hemfixarna-components/assets/close.svg +5 -0
- package/dist/hemfixarna-components/assets/date.svg +6 -0
- package/dist/hemfixarna-components/assets/down.svg +3 -0
- package/dist/hemfixarna-components/assets/info.svg +5 -0
- package/dist/hemfixarna-components/assets/minus.svg +4 -0
- package/dist/hemfixarna-components/assets/plus.svg +5 -0
- package/dist/hemfixarna-components/calc-a9ece205.js +85 -0
- package/dist/hemfixarna-components/calc-a9ece205.js.map +1 -0
- package/dist/hemfixarna-components/css-shim-62d2171c.js.map +1 -1
- package/dist/hemfixarna-components/dom-46a68c9b.js.map +1 -1
- package/dist/hemfixarna-components/hemfixarna-address.entry.js +52 -0
- package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-box.entry.js +35 -0
- package/dist/hemfixarna-components/hemfixarna-box.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js +40 -0
- package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js +3 -35
- package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js.map +1 -1
- package/dist/hemfixarna-components/hemfixarna-cart.entry.js +82 -0
- package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-category.entry.js +21 -0
- package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-checkout.entry.js +54 -0
- package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-component.entry.js +133 -0
- package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +3 -3
- package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
- package/dist/hemfixarna-components/{my-component.entry.js → hemfixarna-demo.entry.js} +19 -15
- package/dist/hemfixarna-components/hemfixarna-demo.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +410 -0
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-info.entry.js +25 -0
- package/dist/hemfixarna-components/hemfixarna-info.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-order.entry.js +24 -0
- package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-product.entry.js +121 -0
- package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-service.entry.js +9 -139
- package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +1 -1
- package/dist/hemfixarna-components/hemfixarna-start.entry.js +18 -0
- package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +1 -0
- package/dist/hemfixarna-components/index-2bf8566c.js +12 -0
- package/dist/hemfixarna-components/index-2bf8566c.js.map +1 -0
- package/dist/hemfixarna-components/{index-06272934.js → index-59ed730c.js} +3 -3
- package/dist/hemfixarna-components/index-59ed730c.js.map +1 -0
- package/dist/hemfixarna-components/index-75ed3bb8.js +216 -0
- package/dist/hemfixarna-components/index-75ed3bb8.js.map +1 -0
- package/dist/hemfixarna-components/shadow-css-05e0c1f4.js.map +1 -1
- package/dist/types/components/hemfixarna-address/hemfixarna-address.d.ts +13 -0
- package/dist/types/components/hemfixarna-box/hemfixarna-box.d.ts +8 -0
- package/dist/types/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.d.ts +9 -0
- package/dist/types/components/hemfixarna-byggmax/hemfixarna-byggmax.d.ts +1 -7
- package/dist/types/components/hemfixarna-cart/hemfixarna-cart.d.ts +13 -0
- package/dist/types/components/hemfixarna-category.tsx/hemfixarna-category.d.ts +5 -0
- package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +10 -0
- package/dist/types/components/hemfixarna-component/hemfixarna-component.d.ts +19 -0
- package/dist/types/components/{my-component/my-component.d.ts → hemfixarna-demo/hemfixarna-demo.d.ts} +2 -1
- package/dist/types/components/hemfixarna-getuser/hemfixarna-getuser.d.ts +14 -0
- package/dist/types/components/hemfixarna-info/hemfixarna-info.d.ts +13 -0
- package/dist/types/components/hemfixarna-order/hemfixarna-order.d.ts +4 -0
- package/dist/types/components/hemfixarna-product/hemfixarna-product.d.ts +13 -0
- package/dist/types/components/hemfixarna-service/hemfixarna-service.d.ts +2 -39
- package/dist/types/components/hemfixarna-start/hemfixarna-start.d.ts +5 -0
- package/dist/types/components.d.ts +189 -21
- package/dist/types/store/index.d.ts +26 -0
- package/dist/types/types/index.d.ts +41 -1
- package/dist/types/utils/api.d.ts +4 -2
- package/dist/types/utils/calc.d.ts +18 -0
- package/dist/types/utils/felixFunctions.d.ts +21 -0
- package/package.json +10 -2
- package/dist/hemfixarna-components/api-609888bb.js +0 -18
- package/dist/hemfixarna-components/api-609888bb.js.map +0 -1
- package/dist/hemfixarna-components/index-06272934.js.map +0 -1
- package/dist/hemfixarna-components/my-component.entry.js.map +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { r as registerInstance, g as getAssetPath, h } from './index-59ed730c.js';
|
|
2
|
+
import { s as state } from './index-75ed3bb8.js';
|
|
3
|
+
import { a as getProductPrice, b as getStartFee, c as getPartPrice } from './calc-a9ece205.js';
|
|
4
|
+
|
|
5
|
+
const HemfixarnaCart = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.tree = undefined;
|
|
9
|
+
}
|
|
10
|
+
getItemPrice(item) {
|
|
11
|
+
const partsPrice = item.parts.reduce((acc, curr) => {
|
|
12
|
+
return acc + curr.price * curr.amount;
|
|
13
|
+
}, 0);
|
|
14
|
+
return getProductPrice(item, item.price * item.amount + partsPrice);
|
|
15
|
+
}
|
|
16
|
+
getTotalPrice() {
|
|
17
|
+
return state.cart.reduce((acc, curr) => acc + this.getItemPrice(curr), 0) + getStartFee().rot + getStartFee().rut;
|
|
18
|
+
}
|
|
19
|
+
goToProduct(id) {
|
|
20
|
+
const services = this.tree.sub_cats.map((c) => c.services).flat();
|
|
21
|
+
const products = services.map((s) => s.products).flat();
|
|
22
|
+
const product = products.find((p) => p.ID === id);
|
|
23
|
+
const service = services.find((s) => s.products.find((p) => p.ID === id));
|
|
24
|
+
const category = this.tree.sub_cats.find((c) => c.services.find((s) => s.products.find((p) => p.ID === id)));
|
|
25
|
+
state.selectedCategory = category;
|
|
26
|
+
state.selectedService = service;
|
|
27
|
+
state.selectedProduct = product;
|
|
28
|
+
state.step = 4;
|
|
29
|
+
}
|
|
30
|
+
toggleRot() {
|
|
31
|
+
state.rot = !state.rot;
|
|
32
|
+
}
|
|
33
|
+
toggleRut() {
|
|
34
|
+
state.rut = !state.rut;
|
|
35
|
+
}
|
|
36
|
+
calculateRot() {
|
|
37
|
+
const totalWithRot = state.cart.reduce((acc, curr) => {
|
|
38
|
+
return curr.rot ? acc + this.getItemPrice(curr) : acc;
|
|
39
|
+
}, 0) + getStartFee().rot;
|
|
40
|
+
const totalWithoutRot = state.cart.reduce((acc, curr) => {
|
|
41
|
+
const partsPrice = curr.parts.reduce((acc, curr) => {
|
|
42
|
+
return acc + curr.price * curr.amount;
|
|
43
|
+
}, 0);
|
|
44
|
+
return curr.rot ? acc + curr.price * curr.amount + partsPrice : acc;
|
|
45
|
+
}, 0) + Number(state.options.start_fee);
|
|
46
|
+
return totalWithoutRot - totalWithRot;
|
|
47
|
+
}
|
|
48
|
+
calculateRut() {
|
|
49
|
+
const totalWithRut = state.cart.reduce((acc, curr) => {
|
|
50
|
+
return curr.rut ? acc + this.getItemPrice(curr) : acc;
|
|
51
|
+
}, 0) + getStartFee().rut;
|
|
52
|
+
const totalWithoutRut = state.cart.reduce((acc, curr) => {
|
|
53
|
+
const partsPrice = curr.parts.reduce((acc, curr) => {
|
|
54
|
+
return acc + curr.price * curr.amount;
|
|
55
|
+
}, 0);
|
|
56
|
+
return curr.rut ? acc + curr.price * curr.amount + partsPrice : acc;
|
|
57
|
+
}, 0) + Number(state.options.start_fee);
|
|
58
|
+
return totalWithoutRut - totalWithRut;
|
|
59
|
+
}
|
|
60
|
+
openMontering() {
|
|
61
|
+
state.modal = {
|
|
62
|
+
title: 'Monteringsavgift',
|
|
63
|
+
text: [
|
|
64
|
+
'Monteringsavgiften är en fast avgift som läggs på din beställning. Avgiften täcker kostnader för att montera produkterna du beställer.',
|
|
65
|
+
'Monteringsavgiften debiteras per påbörjat nytt uppdrag. Om du bokar ett uppdrag som både innehåller RUT- och ROT-avdrag så kommer uppdraget att delas upp och således kommer två monteringsavgifter att debiteras och två fakturor att utställas.',
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
const back = getAssetPath(`./assets/back.svg`);
|
|
71
|
+
const info = getAssetPath(`./assets/info.svg`);
|
|
72
|
+
return (h("div", { class: "hemfixarna_cart" }, h("div", { class: "hemfixarna_cart--left" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
|
|
73
|
+
state.checkoutStep = 1;
|
|
74
|
+
} }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Din bokning"), h("ul", { class: "hemfixarna_cart--items" }, state.cart.map(item => (h("li", { class: "hemfixarna_cart--item" }, h("div", null, h("div", null, item.icon && h("img", { width: 30, src: item.icon, alt: item.name }), h("p", null, h("strong", null, item.amount, "x "), item.name)), h("button", { onClick: () => this.goToProduct(item.id) }, "\u00C4ndra")), h("p", null, h("strong", null, getProductPrice(item, item.price, item.amount), "kr")), item.parts.length > 0 && (h("ul", null, item.parts.map(part => (h("li", null, h("p", null, h("strong", null, part.amount, "x "), part.name), h("p", null, h("strong", null, getPartPrice(part, item, part.amount), "kr"))))))))))), h("div", { class: "hemfixarna_cart--additional" }, getStartFee().length > 0 && (h("div", { class: "hemfixarna_cart--startfee" }, h("p", null, getStartFee().length, "x", ' ', h("strong", { onClick: () => this.openMontering() }, "Monteringsavgift", h("img", { height: 16, src: info, alt: "info monteringsavgift" }))), h("p", null, getStartFee().rot + getStartFee().rut, "kr"))), state.cart.find((item) => item.rot) && (h("div", { class: "hemfixarna_cart--rutrot" }, h("div", null, h("label", { class: "switch" }, h("input", { checked: state.rot, onChange: () => this.toggleRot(), type: "checkbox" }), h("span", { class: "slider" })), h("p", null, "ROT-avdrag")), h("p", null, "(-", state.rot ? this.calculateRot() : 0, "kr)"))), state.cart.find((item) => item.rut) && (h("div", { class: "hemfixarna_cart--rutrot" }, h("div", null, h("label", { class: "switch" }, h("input", { onChange: () => this.toggleRut(), checked: state.rut, type: "checkbox" }), h("span", { class: "slider" })), h("p", null, "RUT-avdrag")), h("p", null, "(-", state.rut ? this.calculateRut() : 0, "kr)")))), h("div", { class: "hemfixarna_cart--price" }, h("h2", null, "Totalbelopp: "), h("h2", null, this.getTotalPrice(), "kr"))), h("div", { class: "hemfixarna_cart--right" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
|
|
75
|
+
state.checkoutStep = 1;
|
|
76
|
+
} }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Dina uppgifter"), h("hemfixarna-checkout", null), h("hemfixarna-info", null))));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { HemfixarnaCart as hemfixarna_cart };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=hemfixarna-cart.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"hemfixarna-cart.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-59ed730c.js';
|
|
2
|
+
import { s as state } from './index-75ed3bb8.js';
|
|
3
|
+
|
|
4
|
+
const HemfixarnaCategory = class {
|
|
5
|
+
constructor(hostRef) {
|
|
6
|
+
registerInstance(this, hostRef);
|
|
7
|
+
}
|
|
8
|
+
setSelectedService(service) {
|
|
9
|
+
state.selectedService = service;
|
|
10
|
+
state.step = 3;
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h("div", null, h("h2", null, state.selectedCategory.name), h("div", { class: "hemfixarna_categories--wrapper" }, h("div", null, h("ul", { class: "hemfixarna_categories" }, state.selectedCategory.services
|
|
14
|
+
.sort((a, b) => (a.post_title < b.post_title ? -1 : 1))
|
|
15
|
+
.map(s => (h("hemfixarna-box", { post: s, icon: s.icon.url, postTitle: s.post_title }))))), h("hemfixarna-info", { list: state.options.trust }))));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { HemfixarnaCategory as hemfixarna_category };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=hemfixarna-category.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"hemfixarna-category.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { r as registerInstance, g as getAssetPath, h, F as Fragment, e as getElement } from './index-59ed730c.js';
|
|
2
|
+
import { s as state } from './index-75ed3bb8.js';
|
|
3
|
+
|
|
4
|
+
const HemfixarnaCheckout = class {
|
|
5
|
+
constructor(hostRef) {
|
|
6
|
+
registerInstance(this, hostRef);
|
|
7
|
+
this.handleChangeDate = (e) => {
|
|
8
|
+
this.dateError = null;
|
|
9
|
+
this.date = e.target.value;
|
|
10
|
+
};
|
|
11
|
+
this.handleChangeTerms = () => {
|
|
12
|
+
this.termsError = null;
|
|
13
|
+
};
|
|
14
|
+
this.handleSubmit = (e) => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
const validDate = this.date.length > 0;
|
|
17
|
+
if (!validDate) {
|
|
18
|
+
this.dateError = 'Ange ett giltigt datum';
|
|
19
|
+
}
|
|
20
|
+
const checkBoxes = Array.from(this.el.querySelectorAll('input[type="checkbox"]'));
|
|
21
|
+
const notValidTerms = checkBoxes.find(i => !i.checked);
|
|
22
|
+
if (notValidTerms) {
|
|
23
|
+
this.termsError = 'Du måste godkänna villkoren';
|
|
24
|
+
}
|
|
25
|
+
if (validDate && !notValidTerms) {
|
|
26
|
+
state.step = 6;
|
|
27
|
+
state.cart = [];
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
this.render = () => {
|
|
31
|
+
const dateLogo = getAssetPath(`./assets/date.svg`);
|
|
32
|
+
const down = getAssetPath(`./assets/down.svg`);
|
|
33
|
+
if (state.checkoutEdit) {
|
|
34
|
+
return h("hemfixarna-address", null);
|
|
35
|
+
}
|
|
36
|
+
else if (state.checkoutStep === 1) {
|
|
37
|
+
return h("hemfixarna-getuser", null);
|
|
38
|
+
}
|
|
39
|
+
else if (state.checkoutStep === 2) {
|
|
40
|
+
return (h("div", { class: "mb-2" }, h("div", { class: "hemfixarna_addressinfo" }, h("p", null, "namn"), h("p", null, state.user.email), h("p", null, state.user.phone), h("button", { onClick: () => (state.checkoutEdit = true) }, "Beh\u00F6ver du \u00E4ndra adressen?")), h("form", { onSubmit: e => this.handleSubmit(e) }, h("div", null, h("img", { src: dateLogo, width: 24 }), h("input", { class: `${this.date.length ? 'input_active' : ''}`, min: new Date().toISOString().split('T')[0], onChange: e => this.handleChangeDate(e), type: "date", name: "date", value: this.date }), h("label", { htmlFor: "date" }, "Tidigaste datum f\u00F6r hembes\u00F6k"), h("img", { src: down, width: 24 })), this.dateError && h("span", null, this.dateError), h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", { innerHTML: state.options.terms })), state.cart
|
|
41
|
+
.filter(i => i.terms_checkout && i.terms_show_checkbox)
|
|
42
|
+
.map(item => (h(Fragment, null, h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", null, item.terms_checkout))))), this.termsError && h("span", null, this.termsError), h("input", { type: "submit", value: "Slutf\u00F6r Bokning" }))));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
this.date = '';
|
|
46
|
+
this.dateError = null;
|
|
47
|
+
this.termsError = null;
|
|
48
|
+
}
|
|
49
|
+
get el() { return getElement(this); }
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { HemfixarnaCheckout as hemfixarna_checkout };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=hemfixarna-checkout.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"hemfixarna-checkout.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { r as registerInstance, g as getAssetPath, h, e as getElement } from './index-59ed730c.js';
|
|
2
|
+
import { s as state } from './index-75ed3bb8.js';
|
|
3
|
+
import { g as getTaxonomy, a as getOptions } from './api-3228fe30.js';
|
|
4
|
+
import { g as getProductPriceWithRotAndRut } from './calc-a9ece205.js';
|
|
5
|
+
|
|
6
|
+
const hemfixarnaCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); *{box-sizing:border-box}:host{font-family:\"Inter\", sans-serif}:host .mb-2{margin-bottom:2rem}:host form{display:flex;flex-direction:column;gap:1rem}:host form img{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none}:host form img:first-of-type{left:1rem}:host form img:last-of-type{right:1rem}:host form span{margin-top:-0.5rem;color:#ec6632}:host form p{text-align:center}:host form p{margin:0}:host form div{position:relative}:host form div label{pointer-events:none;position:absolute;left:1rem;top:50%;transform:translateY(-50%);background:#fff;padding:0.25rem;transition:0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host form div input{padding:1rem;width:100%;font-size:1rem;border:1px solid #fcd9c9}:host form div input:focus~label,:host form div .input_active~label{top:0;transform:translateY(-50%);background:linear-gradient(180deg, #fffaf2 50%, #fff 50%)}:host h1{font-size:24px;font-weight:400;line-height:32px;letter-spacing:-3%;text-align:left;margin:0 0 0.5rem}:host h2{margin:0 0 1.5rem;font-weight:700;font-size:20px;line-height:28px;letter-spacing:-3%}:host p{font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna{width:100%;}:host .hemfixarna .switch{position:relative;display:inline-block;width:40px;height:20px}:host .hemfixarna .switch input{opacity:0;width:0;height:0}:host .hemfixarna .slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:0.4s;transition:0.4s;border-radius:34px}:host .hemfixarna .slider:before{position:absolute;content:\"\";height:18px;width:18px;left:2px;bottom:1px;background-color:white;-webkit-transition:0.4s;transition:0.4s;border-radius:50%}:host .hemfixarna input:checked+.slider{background-color:#fcd9c9}:host .hemfixarna input:focus+.slider{box-shadow:0 0 1px #fcd9c9}:host .hemfixarna input:checked+.slider:before{-webkit-transform:translateX(18px);-ms-transform:translateX(18px);transform:translateX(18px);background:#ec6632}:host .hemfixarna_checkbox{display:grid;grid-template-columns:2.5rem auto;font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna_checkbox>span{transform:translateY(6px)}:host .hemfixarna_checkbox span,:host .hemfixarna_checkbox span p{color:#474444;font-size:14px}:host .hemfixarna_checkbox p{text-align:left}:host .hemfixarna_info{display:flex;flex-direction:column;gap:1.5rem;padding:2rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);border-radius:0.25rem;border:1px solid #fcd9c9}:host .hemfixarna_info h2{margin:0}@media (min-width: 769px){:host .hemfixarna_info{position:sticky;top:0}}:host .hemfixarna_infomodal{position:absolute;top:40%;left:50%;transform:translate(-50%, -50%);width:100%;max-width:80%;background:#fffaf2;border:1px solid #fcd9c9;padding:2rem;z-index:99;border-radius:0.25rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;flex-direction:column;gap:1rem}:host .hemfixarna_infomodal button{background:#ec6632;color:#fff;border-radius:60px;font-size:16px;padding:0.5rem 1rem}:host .hemfixarna_addressinfo{padding:1rem 1rem 4rem;border:1px solid #fcd9c9;position:relative;margin-bottom:2rem}:host .hemfixarna_addressinfo button{position:absolute;bottom:1rem;right:1rem;font-weight:500;text-underline-offset:2px;text-decoration:underline}:host .hemfixarna_part{background:#fff;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:grid;padding:1rem;grid-template-columns:auto 75px}:host .hemfixarna_counter{display:flex;align-items:center}:host .hemfixarna_counter span{padding:0 0.5rem}:host .hemfixarna_counter img{cursor:pointer}:host .hemfixarna_counter img:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_terms{font-size:14px}:host .hemfixarna_terms a{color:inherit}:host .hemfixarna_logo{height:4rem}:host .hemfixarna_box{padding:1rem;display:flex;align-items:center;justify-content:space-between;background:#fffaf2;border:1px solid #fcd9c9;width:100%;box-sizing:border-box;border-radius:0.25rem;gap:1rem 0.5rem}:host .hemfixarna_box>div{display:grid;gap:0.5rem}:host .hemfixarna_btn,:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{border:none;border-radius:60px;font-weight:600;letter-spacing:0.5px;line-height:20px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn:not(.disabled):hover,:host .hemfixarna_buy:not(.disabled):hover,:host .hemfixarna input[type=submit]:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn{font-size:14px;background:#c84e18;color:#fff;padding:1rem 2rem;white-space:nowrap;position:relative}:host .hemfixarna_btn span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-0.5rem;right:-0.75rem}:host .hemfixarna_btn span{background:#25a710;color:#fff;right:0 !important}:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{font-size:21px;background:#25a710;color:#fff;padding:1rem 1.5rem}:host .hemfixarna .disabled{opacity:0.5;cursor:default}:host .hemfixarna_modal{position:fixed;background:#fffaf2;border:1px solid #fcd9c9;border-radius:0.25rem;top:50%;left:50%;z-index:1000;transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);transform:translate(-50%, -50%) scale(0.7);opacity:0;height:92%;width:92%;max-width:920px;display:flex;flex-direction:column;gap:0.5rem}:host .hemfixarna_modal--open{opacity:1;transform:translate(-50%, -50%) scale(1)}:host .hemfixarna_backdrop{z-index:999;position:fixed;background:#474444;top:0;left:0;bottom:0;right:0;opacity:0;transition:transform 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946), opacity 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host .hemfixarna_backdrop--open{opacity:0.3}:host .hemfixarna_order{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;background-repeat:no-repeat !important;background-size:cover !important;background-position:center !important;display:grid;grid-template-columns:1fr 1fr;padding:3rem 2rem 4rem}@media (max-width: 768px){:host .hemfixarna_order{grid-template-columns:1fr;grid-template-rows:0 auto}}:host .hemfixarna_order div:last-of-type{background:#fffaf2;padding:2rem;display:flex;flex-direction:column}:host .hemfixarna_order img{cursor:pointer}:host .hemfixarna_order button{margin:1rem 0;padding:0;text-decoration:underline;text-underline-offset:2px;font-size:14px;font-weight:600}:host .hemfixarna_cart{display:grid;grid-template-columns:1fr 1fr;gap:2rem}@media (max-width: 768px){:host .hemfixarna_cart{grid-template-columns:1fr;gap:0}}:host .hemfixarna_cart--right h2,:host .hemfixarna_cart--left h2{display:flex;align-items:center}:host .hemfixarna_cart--right h2 img,:host .hemfixarna_cart--left h2 img{margin-top:0.2rem}@media (min-width: 769px){:host .hemfixarna_cart--left h2 button{display:none}}@media (max-width: 768px){:host .hemfixarna_cart--right h2 button{display:none}}:host .hemfixarna_cart--startfee{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot div{display:flex;gap:1rem;align-items:center}:host .hemfixarna_cart--additional{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--additional p{font-size:14px}:host .hemfixarna_cart--additional strong{text-decoration:underline;text-underline-offset:2px;cursor:pointer;position:relative}:host .hemfixarna_cart--additional strong img{position:absolute;top:50%;transform:translateY(-50%);right:-1.5rem}:host .hemfixarna_cart--price{border-top:1px solid #fcd9c9;padding:1rem;display:flex;justify-content:space-between}:host .hemfixarna_cart--price h3{margin:0}:host .hemfixarna_cart--item{display:flex;flex-direction:column;gap:0.5rem;padding:1rem 0;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--item>div{display:flex;justify-content:space-between}:host .hemfixarna_cart--item>div>div{display:flex;align-items:center;gap:1rem}:host .hemfixarna_cart--item>div button{color:#ec6632}:host .hemfixarna_categories{display:grid;gap:1.5rem}:host .hemfixarna_categories--wrapper{gap:2rem;display:grid;grid-template-columns:1fr 1fr}@media (max-width: 768px){:host .hemfixarna_categories--wrapper{grid-template-columns:1fr}}:host .hemfixarna_categories li{position:relative;background:#fff;border-radius:0.25rem;min-height:132px;padding:1.5rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;align-items:center;gap:1.5rem;cursor:pointer}:host .hemfixarna_categories li:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_categories li>button{height:100%;width:100%}:host .hemfixarna_categories li .price{font-weight:700}:host .hemfixarna_content{height:100%;overflow:auto;padding:0 2rem 4rem}:host .hemfixarna_content--5{padding-top:1rem}:host .hemfixarna_crumbs{position:relative;padding:1rem 1.5rem;border-bottom:1px solid #fcd9c9;display:flex;justify-content:space-between}:host .hemfixarna_crumbs--back{padding:1rem 1.5rem 0.5rem;display:flex;align-items:center;gap:0.5rem;box-shadow:none !important}:host .hemfixarna_crumbs--back:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs img{cursor:pointer}:host .hemfixarna_crumbs .close{position:absolute;right:-1rem;top:-1rem;z-index:9}:host .hemfixarna_crumbs .cart{padding-left:1rem;position:relative}:host .hemfixarna_crumbs .cart img{cursor:inherit}:host .hemfixarna_crumbs .cart span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-0.5rem;right:-0.75rem}:host .hemfixarna_crumbs .cart_active{cursor:pointer}:host .hemfixarna_crumbs .cart_active span{background:#25a710;color:#fff}:host .hemfixarna_crumbs--links{display:flex;align-items:center;gap:1rem;overflow:auto}@media (min-width: 769px){:host .hemfixarna_crumbs--links{-ms-overflow-style:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar{display:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar-button{display:none}}:host .hemfixarna_crumbs button{white-space:nowrap;background:#f1ded6;border-radius:4rem;padding:0.75rem 1rem;font-size:12px;font-weight:600;letter-spacing:0.3px;box-shadow:none !important}:host .hemfixarna_crumbs button:not(.active):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs .active{background:#fffaf2;cursor:default}:host .hemfixarna_features{gap:0.75rem !important}:host .hemfixarna_features li{display:flex;gap:1rem;align-items:center}:host .hemfixarna_address{margin-bottom:1rem}:host .hemfixarna_product{display:grid;gap:1rem}:host .hemfixarna_product--link{font-weight:700;color:#474444;text-underline-offset:0.25rem}:host .hemfixarna_product--left{gap:2rem}:host .hemfixarna_product--right{gap:2rem}:host .hemfixarna_product--price{margin-top:0.25rem;font-weight:700}:host .hemfixarna_product--total{text-align:center;margin:-1rem 0;font-size:21px;line-height:28px}:host .hemfixarna_product--item{background:#fff;padding:1rem;display:grid;grid-template-columns:auto 75px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_product--grid{display:grid;grid-template-columns:1fr 1fr;gap:2rem}@media (max-width: 768px){:host .hemfixarna_product--grid{grid-template-columns:1fr}}:host .hemfixarna_product--grid>div{display:flex;flex-direction:column}:host .hemfixarna_product--grid ul{display:flex;flex-direction:column;gap:0.5rem}:host .hemfixarna_product p{margin:0}:host .hemfixarna_product--top{display:flex;gap:2rem}:host .hemfixarna_product--top>div{width:100%}:host .hemfixarna_product--top>div h1{max-width:80%}@media (max-width: 768px){:host .hemfixarna_product--top>div h1{max-width:100%}}:host .hemfixarna_product--top h4{margin-bottom:0.5rem}:host h5,:host p{margin:0}:host input[type=submit]{cursor:pointer}:host input[type=date]~label{left:3.5rem}:host input[type=date]{border:1px solid #fcd9c9;padding-left:4rem}:host input[type=checkbox]{height:1.125rem;width:1.125rem;border:1px solid #fcd9c9}:host input[type=checkbox]:checked{background:red}:host input[type=date]::-webkit-calendar-picker-indicator{background:transparent;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}:host button,:host a{cursor:pointer;background:none;border:none}:host ul{list-style:none;margin:0;padding:0}";
|
|
7
|
+
|
|
8
|
+
const HemfixarnaComponent = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.modal = false;
|
|
12
|
+
this.showModal = false;
|
|
13
|
+
this.tree = null;
|
|
14
|
+
this.product = null;
|
|
15
|
+
this.slug = undefined;
|
|
16
|
+
this.business = undefined;
|
|
17
|
+
this.topCategory = undefined;
|
|
18
|
+
}
|
|
19
|
+
async fetchNewTaxonomy(newValue) {
|
|
20
|
+
state.selectedCategory = null;
|
|
21
|
+
state.selectedProduct = null;
|
|
22
|
+
state.selectedService = null;
|
|
23
|
+
const res = await getTaxonomy(newValue);
|
|
24
|
+
if ((res === null || res === void 0 ? void 0 : res.code) === 'not_found' || (res === null || res === void 0 ? void 0 : res.code) === 'rest_no_route') {
|
|
25
|
+
console.log('taxonomy not found');
|
|
26
|
+
}
|
|
27
|
+
else if (res) {
|
|
28
|
+
this.setTaxonomy(res);
|
|
29
|
+
if ((res === null || res === void 0 ? void 0 : res.post_type) === 'ikea_product') {
|
|
30
|
+
this.product = res;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async componentWillLoad() {
|
|
35
|
+
state.business = this.business;
|
|
36
|
+
const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);
|
|
37
|
+
if (cart) {
|
|
38
|
+
state.cart = JSON.parse(cart);
|
|
39
|
+
}
|
|
40
|
+
const tree = await getTaxonomy(this.topCategory);
|
|
41
|
+
if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found') {
|
|
42
|
+
console.warn('tree not found');
|
|
43
|
+
}
|
|
44
|
+
else if (tree) {
|
|
45
|
+
this.tree = tree;
|
|
46
|
+
console.log(this.tree);
|
|
47
|
+
}
|
|
48
|
+
if (this.slug) {
|
|
49
|
+
const res = await getTaxonomy(this.slug);
|
|
50
|
+
if ((res === null || res === void 0 ? void 0 : res.code) === 'not_found') {
|
|
51
|
+
console.log('taxonomy not found');
|
|
52
|
+
}
|
|
53
|
+
else if (res) {
|
|
54
|
+
this.setTaxonomy(res);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const options = await getOptions();
|
|
58
|
+
state.options = options;
|
|
59
|
+
// const token = await initializeFelix();
|
|
60
|
+
// if (token) {
|
|
61
|
+
// console.log(token);
|
|
62
|
+
// }
|
|
63
|
+
}
|
|
64
|
+
setTaxonomy(taxonomy) {
|
|
65
|
+
if (taxonomy) {
|
|
66
|
+
if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.taxonomy) === 'service_cat') {
|
|
67
|
+
state.selectedCategory = taxonomy;
|
|
68
|
+
state.step = 2;
|
|
69
|
+
}
|
|
70
|
+
else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'service') {
|
|
71
|
+
state.selectedService = taxonomy;
|
|
72
|
+
state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === taxonomy.ID));
|
|
73
|
+
state.step = 3;
|
|
74
|
+
}
|
|
75
|
+
else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'ikea_product') {
|
|
76
|
+
state.selectedProduct = taxonomy;
|
|
77
|
+
state.selectedService = this.tree.sub_cats
|
|
78
|
+
.map(c => c.services)
|
|
79
|
+
.flat()
|
|
80
|
+
.find(s => s.products.find(p => p.ID === state.selectedProduct.ID));
|
|
81
|
+
state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === state.selectedService.ID));
|
|
82
|
+
state.step = 4;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Open close modal && click outside event
|
|
87
|
+
openModal() {
|
|
88
|
+
this.modal = true;
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
this.showModal = true;
|
|
91
|
+
}, 50);
|
|
92
|
+
}
|
|
93
|
+
closeModal() {
|
|
94
|
+
this.showModal = false;
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
this.modal = false;
|
|
97
|
+
}, 200);
|
|
98
|
+
}
|
|
99
|
+
handleClick(e) {
|
|
100
|
+
const el = this.el.shadowRoot.querySelector('.hemfixarna_modal');
|
|
101
|
+
if (el) {
|
|
102
|
+
const isClickInside = el.contains(e.composedPath()[0]);
|
|
103
|
+
if (!isClickInside) {
|
|
104
|
+
this.closeModal();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const infomodal = this.el.shadowRoot.querySelector('.hemfixarna_infomodal');
|
|
108
|
+
if (infomodal) {
|
|
109
|
+
const isClickInside = infomodal.contains(e.composedPath()[0]);
|
|
110
|
+
if (!isClickInside) {
|
|
111
|
+
state.modal = null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
getCartLength() {
|
|
116
|
+
return state.cart.reduce((acc, curr) => acc + curr.amount, 0);
|
|
117
|
+
}
|
|
118
|
+
render() {
|
|
119
|
+
var _a, _b;
|
|
120
|
+
const logo = getAssetPath(`./assets/hemfixarna.svg`);
|
|
121
|
+
return (h("div", { class: "hemfixarna" }, h("div", { class: "hemfixarna_box" }, h("div", null, h("div", null, h("p", null, ((_a = this.product) === null || _a === void 0 ? void 0 : _a.post_title) || (h("span", null, "Montering/Installation p\u00E5 plats - ", h("strong", null, "se priser h\u00E4r"))), this.product && ((_b = this.slug) === null || _b === void 0 ? void 0 : _b.includes('product')) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.product), "kr"))) : null)), h("img", { src: logo, width: 104 })), h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn" }, "Till montering", this.getCartLength() > 0 && h("span", null, this.getCartLength()))), this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", null, t))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), this.tree && h("hemfixarna-breadcrumbs", { closeModal: () => this.closeModal(), tree: this.tree }), h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step === 1 && this.tree && h("hemfixarna-start", { tree: this.tree }), state.step === 2 && state.selectedCategory && h("hemfixarna-category", null), state.step === 3 && state.selectedService && h("hemfixarna-service", null), state.step === 4 && state.selectedProduct && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", null))), h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` })))));
|
|
122
|
+
}
|
|
123
|
+
static get assetsDirs() { return ["assets"]; }
|
|
124
|
+
get el() { return getElement(this); }
|
|
125
|
+
static get watchers() { return {
|
|
126
|
+
"slug": ["fetchNewTaxonomy"]
|
|
127
|
+
}; }
|
|
128
|
+
};
|
|
129
|
+
HemfixarnaComponent.style = hemfixarnaCss;
|
|
130
|
+
|
|
131
|
+
export { HemfixarnaComponent as hemfixarna_component };
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=hemfixarna-component.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"hemfixarna-component.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-59ed730c.js';
|
|
2
|
+
export { s as setNonce } from './index-59ed730c.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -157,7 +157,7 @@ const patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
157
157
|
|
|
158
158
|
patchBrowser().then(options => {
|
|
159
159
|
globalScripts();
|
|
160
|
-
return bootstrapLazy([["hemfixarna-service",[[
|
|
160
|
+
return bootstrapLazy([["hemfixarna-cart",[[0,"hemfixarna-cart",{"tree":[16]}]]],["hemfixarna-category",[[0,"hemfixarna-category"]]],["hemfixarna-service",[[0,"hemfixarna-service"]]],["hemfixarna-start",[[0,"hemfixarna-start",{"tree":[16]}]]],["hemfixarna-product",[[0,"hemfixarna-product",{"amount":[32]}]]],["hemfixarna-breadcrumbs",[[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16]}]]],["hemfixarna-order",[[0,"hemfixarna-order"]]],["hemfixarna-address",[[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}]]],["hemfixarna-getuser",[[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}]]],["hemfixarna-checkout",[[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"termsError":[32]}]]],["hemfixarna-box",[[0,"hemfixarna-box",{"post":[16],"icon":[1],"postTitle":[1,"post-title"]}]]],["hemfixarna-info",[[0,"hemfixarna-info",{"list":[16]}]]],["hemfixarna-component",[[1,"hemfixarna-component",{"slug":[1],"business":[1],"topCategory":[1,"top-category"],"modal":[32],"showModal":[32],"tree":[32],"product":[32]},[[0,"click","handleClick"]]]]],["hemfixarna-byggmax",[[1,"hemfixarna-byggmax",{"slug":[1],"tree":[32]}]]],["hemfixarna-demo",[[1,"hemfixarna-demo",{"selectedSlug":[32],"tooltipText":[32],"tree":[32]}]]]], options);
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
//# sourceMappingURL=hemfixarna-components.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hemfixarna-components.esm.js","mappings":";;;;AAAA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB,CAAC,GAAG,EAAE;AACvC,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACnB,IAAI,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,wBAAwB,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;AACpO,CAAC;AACD;AACA,MAAM,wBAAwB,GAAG,CAAC,SAAS,KAAK,CAAC,YAAY,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACjG,MAAM,YAAY,GAAG,MAAM;AAC3B;AACA,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;AACzC,QAAQ,cAAc,CAAC,8BAA8B,CAAC,CAAC;AACvD,KAAK;AACL;AACA,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;AAC1B;AACA;AACA,QAAQ,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;AACtC,KAAK;AACL,IAAI,IAA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AAI,CAAC,OAAO,IAAI;AAC/B,EAAE,aAAa,EAAE,CAAC;AAClB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC","names":[],"sources":["./node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.2.1 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"version":3}
|
|
1
|
+
{"file":"hemfixarna-components.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import { r as registerInstance, g as getAssetPath, h } from './index-
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, g as getAssetPath, h } from './index-59ed730c.js';
|
|
2
|
+
import { B as Business, T as TopCategory } from './index-2bf8566c.js';
|
|
3
|
+
import { g as getTaxonomy } from './api-3228fe30.js';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
(function (Business) {
|
|
6
|
-
Business["byggmax"] = "byggmax";
|
|
7
|
-
})(Business || (Business = {}));
|
|
8
|
-
|
|
9
|
-
const myComponentCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); :host{font-family:\"Inter\", sans-serif}:host .hemfixarna_example{margin-bottom:1rem;background:#000;padding:1rem;color:#fff;display:flex;justify-content:space-between;cursor:pointer;max-width:500px;box-sizing:border-box;position:relative}:host .hemfixarna_example--tooltip{background:#000;top:-3rem;font-size:16px;left:40%;color:white;padding:0.5rem;position:absolute;opacity:0}:host .hemfixarna_example--tooltip::after{content:\"\";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}:host .hemfixarna_example:hover .hemfixarna_example--tooltip{opacity:1}:host .hemfixarna_example p{font-size:14px}:host .hemfixarna_example img{filter:invert(1)}:host .hemfixarna_install{display:grid;gap:0.5rem;margin-top:1rem}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:0.5rem}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:0.2rem 0.6rem;border-radius:10px;margin-right:0.5rem;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;background:#9f9da9}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:2rem;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:1rem 2rem;box-sizing:border-box}:host>div>*{width:100%}:host>div ul{margin:0;padding:0;list-style:none}:host>div ul ul{background:#000;gap:1px;display:grid}:host>div ul li{padding-left:1rem;background:#fff}";
|
|
5
|
+
const hemfixarnaDemoCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); :host{font-family:\"Inter\", sans-serif}:host .hemfixarna_example{margin-bottom:1rem;background:#000;padding:1rem;color:#fff;display:flex;justify-content:space-between;cursor:pointer;max-width:500px;box-sizing:border-box;position:relative}:host .hemfixarna_example--tooltip{background:#000;top:-3rem;font-size:16px;left:40%;color:white;padding:0.5rem;position:absolute;opacity:0}:host .hemfixarna_example--tooltip::after{content:\"\";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}:host .hemfixarna_example:hover .hemfixarna_example--tooltip{opacity:1}:host .hemfixarna_example p{font-size:14px}:host .hemfixarna_example img{filter:invert(1)}:host .hemfixarna_install{display:grid;gap:0.5rem;margin-top:1rem}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:0.5rem}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:0.2rem 0.6rem;border-radius:10px;margin-right:0.5rem;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;background:#9f9da9}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:2rem;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:1rem 2rem;box-sizing:border-box}:host>div>*{width:100%}:host>div>div{max-width:500px}:host>div ul{margin:0;padding:0;list-style:none}:host>div ul ul{background:#000;gap:1px;display:grid}:host>div ul li{padding-left:1rem;background:#fff}";
|
|
10
6
|
|
|
11
7
|
const MyComponent = class {
|
|
12
8
|
constructor(hostRef) {
|
|
13
9
|
registerInstance(this, hostRef);
|
|
14
|
-
this.cdnLink = '<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"
|
|
10
|
+
this.cdnLink = '<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"></script>';
|
|
15
11
|
this.selectedSlug = undefined;
|
|
16
12
|
this.tooltipText = 'Kopiera till urklipp';
|
|
17
13
|
this.tree = null;
|
|
18
14
|
}
|
|
15
|
+
getTopLevelCategory() {
|
|
16
|
+
switch ("byggmax") {
|
|
17
|
+
case Business.byggmax:
|
|
18
|
+
return TopCategory.byggmax;
|
|
19
|
+
default:
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
19
23
|
async componentWillLoad() {
|
|
20
|
-
const tree = await getTaxonomy(
|
|
24
|
+
const tree = await getTaxonomy(this.getTopLevelCategory());
|
|
21
25
|
if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found') {
|
|
22
|
-
console.
|
|
26
|
+
console.warn('tree not found');
|
|
23
27
|
}
|
|
24
28
|
else if (tree) {
|
|
25
29
|
this.tree = tree;
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
32
|
getExample() {
|
|
29
|
-
return `<hemfixarna-${"byggmax"}${this.selectedSlug ? ` slug="${this.selectedSlug}" ` : ''}
|
|
33
|
+
return `<hemfixarna-${"byggmax"}${this.selectedSlug ? ` slug="${this.selectedSlug}" ` : ''}></hemfixarna-${"byggmax"}>`;
|
|
30
34
|
}
|
|
31
35
|
copyExample() {
|
|
32
36
|
navigator.clipboard.writeText(this.getExample());
|
|
@@ -54,8 +58,8 @@ const MyComponent = class {
|
|
|
54
58
|
return (h("div", null, h("div", null, 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)), "byggmax" === Business.byggmax && h("hemfixarna-byggmax", { slug: this.selectedSlug }), h("div", { class: "hemfixarna_install" }, h("div", null, h("a", { target: "_blank", href: "https://www.npmjs.com/package/hemfixarna-web-components" }, "Install with npm")), h("div", { onClick: () => this.copyNpmInstall(), class: "hemfixarna_example" }, h("p", null, "npm i hemfixarna-web-components"), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText), h("img", { src: copy, height: 20 })), h("p", null, "Or use cdn"), 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("ul", { class: "hemfixarna_categories" }, 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 kategori")))))))))))))))));
|
|
55
59
|
}
|
|
56
60
|
};
|
|
57
|
-
MyComponent.style =
|
|
61
|
+
MyComponent.style = hemfixarnaDemoCss;
|
|
58
62
|
|
|
59
|
-
export { MyComponent as
|
|
63
|
+
export { MyComponent as hemfixarna_demo };
|
|
60
64
|
|
|
61
|
-
//# sourceMappingURL=
|
|
65
|
+
//# sourceMappingURL=hemfixarna-demo.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"hemfixarna-demo.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|