hemfixarna-web-components 1.5.6 → 1.6.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/cjs/{hemfixarna-address_34.cjs.entry.js → hemfixarna-address_36.cjs.entry.js} +106 -103
- package/dist/cjs/{hemfixarna-address_34.cjs.entry.js.map → hemfixarna-address_36.cjs.entry.js.map} +1 -1
- package/dist/cjs/hemfixarna-components.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -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-traningspartner/hemfixarna-traningspartner.js +113 -0
- package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -0
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js +34 -38
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna.css +6 -0
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +1 -2
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
- package/dist/collection/store/index.js.map +1 -1
- package/dist/collection/types/index.js +2 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/collection/utils/api.js +1 -24
- package/dist/collection/utils/api.js.map +1 -1
- package/dist/collection/utils/felixApi.js.map +1 -1
- package/dist/esm/{hemfixarna-address_34.entry.js → hemfixarna-address_36.entry.js} +88 -87
- package/dist/esm/{hemfixarna-address_34.entry.js.map → hemfixarna-address_36.entry.js.map} +1 -1
- package/dist/esm/hemfixarna-components.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
- package/dist/hemfixarna-components/p-211cfa04.entry.js +2 -0
- package/dist/types/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.d.ts +9 -0
- package/dist/types/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.d.ts +9 -0
- package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +3 -4
- package/dist/types/components.d.ts +46 -0
- package/dist/types/store/index.d.ts +1 -2
- package/dist/types/types/index.d.ts +5 -13
- package/dist/types/utils/api.d.ts +1 -2
- package/dist/types/utils/felixApi.d.ts +2 -0
- package/package.json +1 -1
- package/dist/hemfixarna-components/p-e767ccfc.entry.js +0 -2
- /package/dist/hemfixarna-components/{p-e767ccfc.entry.js.map → p-211cfa04.entry.js.map} +0 -0
@@ -80,7 +80,6 @@ export class MyComponent {
|
|
80
80
|
}
|
81
81
|
else {
|
82
82
|
const partner = window.location.pathname.replace('/', '');
|
83
|
-
console.log(partner);
|
84
83
|
this.partner = isBusiness(partner) ? partner : (_a = process.env.BUSINESS) !== null && _a !== void 0 ? _a : Business.kund;
|
85
84
|
const customer = await getCustomer(this.partner);
|
86
85
|
if (customer.code !== 'not_found' && customer) {
|
@@ -120,7 +119,7 @@ export class MyComponent {
|
|
120
119
|
render() {
|
121
120
|
var _a;
|
122
121
|
const copy = getAssetPath(`./assets/copy.png`);
|
123
|
-
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.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 &&
|
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 &&
|
124
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)));
|
125
124
|
}
|
126
125
|
static get is() { return "hemfixarna-demo"; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hemfixarna-demo.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-demo/hemfixarna-demo.tsx"],"names":[],"mappings":"AAAA,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AAC,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 console.log(partner);\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.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"]}
|
1
|
+
{"version":3,"file":"hemfixarna-demo.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-demo/hemfixarna-demo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAsB,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAe/C,MAAM,OAAO,WAAW;;IAWd,aAAQ,GAAY,IAAI,CAAC;IA2FjC,YAAO,GAAG,8JAA8J,CAAC;;;uBAnG1I,sBAAsB;gBACpB,IAAI;oBACA,IAAI;uBACL,WAAW,CAAC,QAAQ;oBAC5B,EAAE;uBACC,EAAE;mBACQ,SAAS;8BACC,SAAS;;EAK5D,iBAAiB;IACf,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE;MAC1B,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;MAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;KACtB;IAED,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;MACrC,IAAI,CAAC,uBAAuB,EAAE,CAAC;MAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC,EAAE,IAAI,CAAC,CAAC;EACX,CAAC;EAED,KAAK,CAAC,uBAAuB;IAC3B,MAAM,gBAAgB,GAAG,MAAM,CAA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AC,SAAS,EAAE,CAAQ,CACpC;YACN;cACE,cAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,CAAC,mBAAuB;cACtG,cAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,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"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,E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MAC9B,OAAO;KACR;GACF;EACD,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { createStore } from '@stencil/store';\nimport { OnChangeHandler } from '@stencil/store/dist/types';\nimport { Business, CartItem, Category, Customer, CustomerCategory, CustomerSubCategory, GreenOptions, Product, RotOptions, RutOptions, Service, User, WpOptions } from '../types';\nimport { CreditSafeUser } from '../types/felixtypes';\n\ntype StateType = {\n step: number;\n selectedCategory: Category | null;\n selectedService: Service | null;\n selectedProduct: Product | null;\n cart: Array<CartItem>;\n business: Business | 'undefined';\n options: WpOptions | null;\n rut: boolean;\n rot: boolean;\n green: boolean;\n token: string | null;\n checkoutStep: number;\n checkoutEdit: boolean;\n user: User | null;\n creditSafeUser: CreditSafeUser | null;\n modal: {\n title?: string;\n text: string[];\n } | null;\n rutOptions: RutOptions | null;\n rotOptions: RotOptions | null;\n greenOptions: GreenOptions | null;\n customer: Customer | null;\n selectedCustomerCategory: CustomerCategory | CustomerSubCategory | null;\n parentCategory: CustomerCategory | CustomerSubCategory;\n checkoutInvoice: boolean;\n maleri: boolean;\n};\n\nconst {\n state,\n onChange,\n}: {\n state: StateType;\n onChange: OnChangeHandler<StateType>;\n} = createStore({\n step: 1,\n checkoutStep: 1,\n checkoutEdit: false,\n selectedCategory: null,\n selectedService: null,\n selectedProduct: null,\n cart: [],\n business: 'undefined',\n options: null,\n rut: true,\n rot: true,\n green: true,\n token: null,\n user: null,\n modal: null,\n rutOptions: null,\n rotOptions: null,\n greenOptions: null,\n customer: null,\n selectedCustomerCategory: null,\n parentCategory: null,\n creditSafeUser: null,\n checkoutInvoice: false,\n maleri: false,\n sources: null,\n});\n\nonChange('cart', cart => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-cart`, JSON.stringify(cart));\n});\n\nonChange('user', user => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-user`, JSON.stringify(user));\n});\n\nonChange('creditSafeUser', user => {\n window.sessionStorage.setItem(`hemfixarna-${state.business}-creditSafeUser`, JSON.stringify(user));\n});\n\nonChange('selectedProduct', product => {\n if (!state.customer || !product) return;\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === product.category);\n if (category) {\n state.parentCategory = category;\n return;\n }\n state.parentCategory = null;\n});\n\nonChange('selectedCustomerCategory', category => {\n if (!state.customer || !category) return;\n if ((category as CustomerSubCategory).parent) {\n const parent = state.customer.categories.find(c => c.id === (category as CustomerSubCategory).parent);\n if (parent) {\n state.parentCategory = parent;\n return;\n }\n }\n state.parentCategory = null;\n});\n\nexport default state;\n"]}
|
@@ -18,6 +18,8 @@ export var Business;
|
|
18
18
|
Business["lg"] = "lg";
|
19
19
|
Business["sparfonster"] = "sparfonster";
|
20
20
|
Business["power"] = "power";
|
21
|
+
Business["traningspartner"] = "traningspartner";
|
22
|
+
Business["superfront"] = "superfront";
|
21
23
|
})(Business || (Business = {}));
|
22
24
|
export var WidgetStyle;
|
23
25
|
(function (WidgetStyle) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAgMA,MAAM,CAAN,IAAY,QAqBX;AArBD,WAAY,QAAQ;EAClB,yBAAa,CAAA;EACb,+BAAmB,CAAA;EACnB,+BAAmB,CAAA;EACnB,uCAA2B,CAAA;EAC3B,iCAAqB,CAAA;EACrB,iCAAqB,CAAA;EACrB,yBAAa,CAAA;EACb,yBAAa,CAAA;EACb,4BAAgB,CAAA;EAChB,mCAAuB,CAAA;EACvB,2CAA+B,CAAA;EAC/B,6BAAiB,CAAA;EACjB,2BAAe,CAAA;EACf,2BAAe,CAAA;EACf,qCAAyB,CAAA;EACzB,qBAAS,CAAA;EACT,uCAA2B,CAAA;EAC3B,2BAAe,CAAA;EACf,+CAAmC,CAAA;EACnC,qCAAyB,CAAA;AAC3B,CAAC,EArBW,QAAQ,KAAR,QAAQ,QAqBnB;AAED,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;EACrB,oCAAqB,CAAA;EACrB,0CAA2B,CAAA;EAC3B,8CAA+B,CAAA;EAC/B,8CAA+B,CAAA;AACjC,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;EACrB,wCAAyB,CAAA;AAC3B,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB","sourcesContent":["type Icon = {\n url: string;\n};\n\ninterface Customer {\n ID: number;\n post_title: string;\n post_name: string;\n post_type: string;\n filter: string;\n categories: CustomerCategory[];\n logo?: Icon;\n partner_url?: string;\n at_hemfixarna: boolean;\n info_title: string;\n widget_title?: string;\n info_text: string;\n checkout_title: string;\n checkout_trust_badges: { text: string }[];\n trust_badges: { text: string }[];\n source?: Source;\n}\n\ninterface CustomerCategory {\n id: string;\n name: string;\n widget_title?: string;\n icon: string;\n show_products: boolean;\n products: { fields: Product }[] | false;\n sub_categories: CustomerSubCategory[] | false;\n add_painting: boolean;\n}\n\ninterface CustomerSubCategory {\n id: string;\n name: string;\n widget_title?: string;\n icon: string;\n products: { fields: Product }[];\n parent: string;\n add_painting: boolean;\n}\n\ninterface Part {\n ID: number;\n post_author: number;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0 | 1;\n guid: string;\n menu_order: 0;\n post_type: string;\n post_mime_type: string;\n comment_count: number;\n filter: string;\n price: number;\n title: string;\n}\n\ninterface Product {\n ID: number;\n post_author: string;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0;\n guid: string;\n menu_order: 0;\n post_type: string;\n post_mime_type: string;\n comment_count: 0;\n filter: string;\n price: number;\n icon?: Icon | string;\n parts?: Array<Part>;\n list: Array<{ bullet: string }>;\n terms: string;\n terms_checkout: string;\n terms_show_checkbox: boolean;\n rut: boolean;\n rot: boolean;\n green: boolean;\n hide_start_fee: boolean;\n description: string;\n category: string;\n title: string;\n invoice: string;\n invoice_price: string;\n invoice_description: string;\n}\n\ninterface Service {\n ID: 41857;\n icon?: Icon | string;\n post_author: 34419;\n post_date: Date;\n post_date_gmt: Date;\n post_content: string;\n post_title: string;\n post_excerpt: string;\n post_status: string;\n comment_status: string;\n ping_status: string;\n post_password: string;\n post_name: string;\n to_ping: string;\n pinged: string;\n post_modified: Date;\n post_modified_gmt: Date;\n post_content_filtered: string;\n post_parent: 0;\n guid: string;\n menu_order: 0;\n post_type: 'service';\n post_mime_type: string;\n comment_count: 0;\n filter: string;\n products: Array<Product>;\n}\n\ninterface Category {\n count: number;\n description: string;\n name: string;\n icon?: Icon | string;\n parent: 0 | 1;\n slug: string;\n taxonomy: 'service_cat';\n term_group: 0 | 1;\n term_id: number;\n term_order: string;\n term_taxonomy_id: number;\n sub_cats?: Array<Category>;\n services?: Array<Service>;\n}\n\ninterface WpOptions {\n link: { title: string; url: string };\n trust: { trust_badge: string }[];\n thank_you_image: string;\n start_fee: number;\n terms: string;\n maleri_title: string;\n maleri_text: string;\n}\ninterface CartPart {\n id: number;\n amount: number;\n price: number;\n name: string;\n}\n\ninterface CartItem {\n id: number;\n price: number;\n name: string;\n amount: number;\n parts: CartPart[];\n rut: boolean;\n rot: boolean;\n green: boolean;\n start_fee: boolean;\n terms_checkout: string;\n icon?: Icon | string;\n}\n\nexport enum Business {\n kund = 'kund',\n byggmax = 'byggmax',\n skanska = 'skanska',\n string = 'string-furniture',\n hornbach = 'hornbach',\n forebygg = 'forebygg',\n doro = 'doro',\n elfa = 'elfa',\n kbygg = 'k-bygg',\n norrgavel = 'norrgavel',\n fargvaruhuset = 'fargvaruhuset',\n zaptec = 'zaptec',\n tesla = 'tesla',\n klint = 'klint',\n flyttsmart = 'flyttsmart',\n lg = 'lg',\n sparfonster = 'sparfonster',\n power = 'power',\n traningspartner = 'traningspartner',\n superfront = 'superfront',\n}\n\nexport enum WidgetStyle {\n standard = 'standard',\n alternative = 'alternative',\n alternative_2 = 'alternative_2',\n alternative_3 = 'alternative_3',\n}\n\nexport enum TopCategory {\n byggmax = 'category/bygg',\n}\n\ninterface User {\n email: string;\n phone: string;\n ssn: string;\n firstName: string;\n lastName: string;\n street: string;\n zip: string;\n town: string;\n}\n\ninterface RutOptions {\n rut_start_fee_heading: string;\n rut_start_fee_text: string;\n rut_start_fee_text_secondary: string;\n}\n\ninterface RotOptions {\n rot_start_fee_heading: string;\n rot_start_fee_text: string;\n rot_start_fee_text_secondary: string;\n}\n\ninterface GreenOptions {\n green_start_fee_heading: string;\n green_start_fee_text: string;\n green_start_fee_text_secondary: string;\n}\n\ninterface SubSource {\n 'recordId': string;\n 'So_SubSource::Sus01_Name': string;\n 'So_SubSource::_id': string;\n 'So_SubSource::_id_Source': string;\n 'modId': string;\n}\n\ninterface FieldData {\n _id: string;\n So01_Name: string;\n So457_Aktiv_ac: number;\n So40_WebSubSource: string | number;\n So39_WebSource: number;\n rec_id: number;\n}\n\ninterface Source {\n fieldData: FieldData;\n sub_sources: SubSource[];\n}\n\ninterface SourcesRespone {\n dataInfo: {\n database: string;\n layout: string;\n table: string;\n totalRecordCount: number;\n foundCount: number;\n returnedCount: number;\n };\n data: Source[];\n}\n\nexport type {\n CartItem,\n CartPart,\n Category,\n Customer,\n CustomerCategory,\n CustomerSubCategory,\n GreenOptions,\n Icon,\n Part,\n Product,\n RotOptions,\n RutOptions,\n Service,\n Source,\n SourcesRespone,\n User,\n WpOptions,\n};\n"]}
|
@@ -63,29 +63,6 @@ const getGreenDiscount = async () => {
|
|
63
63
|
console.log(error);
|
64
64
|
}
|
65
65
|
};
|
66
|
-
const getSources = async () => {
|
67
|
-
var _a;
|
68
|
-
try {
|
69
|
-
const res = await fetchWithType(`${base}/getsources`);
|
70
|
-
return (_a = res === null || res === void 0 ? void 0 : res.response) === null || _a === void 0 ? void 0 : _a.data;
|
71
|
-
}
|
72
|
-
catch (error) {
|
73
|
-
console.log(error);
|
74
|
-
}
|
75
|
-
};
|
76
|
-
// export interface PostOrderData {
|
77
|
-
// name: string;
|
78
|
-
// customer: Business;
|
79
|
-
// phone: string;
|
80
|
-
// social_security_number: string;
|
81
|
-
// email: string;
|
82
|
-
// address: string;
|
83
|
-
// earliest_visit_date: string;
|
84
|
-
// order_items: string;
|
85
|
-
// start_fee: string;
|
86
|
-
// total: number;
|
87
|
-
// felixStatus: 'success' | 'error';
|
88
|
-
// }
|
89
66
|
const postOrder = async (data) => {
|
90
67
|
try {
|
91
68
|
const res = await fetch(`${base}/weborder`, {
|
@@ -101,5 +78,5 @@ const postOrder = async (data) => {
|
|
101
78
|
console.log(error);
|
102
79
|
}
|
103
80
|
};
|
104
|
-
export { getCustomer, getGreenDiscount, getOptions, getRot, getRut,
|
81
|
+
export { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy, postOrder };
|
105
82
|
//# sourceMappingURL=api.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,wCAAwC,CAAC;AAExH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,OAAoB,EAAE,OAAqB;EAChF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC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AAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { RotOptions, RutOptions, WpOptions } from '../types';\nimport { FelixOrder } from './felixApi';\n\nconst base = process.env.API_URL ? `${process.env.API_URL}/wp-json/headless` : 'https://hemfixarna.se/wp-json/headless';\n\nexport async function fetchWithType<T>(request: RequestInfo, options?: RequestInit): Promise<T> {\n const response = await fetch(request, options);\n const body = await response.json();\n return body;\n}\n\nconst getTaxonomy = async (endpoint: string) => {\n if (!endpoint) {\n return;\n }\n const type = endpoint.split('/')[0];\n const slug = endpoint.split('/')[1];\n try {\n const res = await fetch(`${base}/${type}/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getCustomer = async (slug: string) => {\n try {\n const res = await fetch(`${base}/customer/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getOptions = async () => {\n try {\n const res = await fetch(`${base}/webcoptions`);\n return (await res.json()) as WpOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRut = async () => {\n try {\n const data = await fetchWithType<RutOptions>(`${base}/rut`);\n return data;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRot = async () => {\n try {\n const res = await fetch(`${base}/rot`);\n return (await res.json()) as RotOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getGreenDiscount = async () => {\n try {\n const res = await fetch(`${base}/green-discount`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst postOrder = async (data: FelixOrder) => {\n try {\n const res = await fetch(`${base}/weborder`, {\n method: 'POST',\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n return (await res.json()) as { message: string; post_id: number; data: FelixOrder; status?: number };\n } catch (error) {\n console.log(error);\n }\n};\n\nexport { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy, postOrder };\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"felixApi.js","sourceRoot":"","sources":["../../src/utils/felixApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,qCAAqC,CAAC;
|
1
|
+
{"version":3,"file":"felixApi.js","sourceRoot":"","sources":["../../src/utils/felixApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,qCAAqC,CAAC;AAsClH,MAAM,UAAU,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;EAClD,IAAI;IACF,OAAO,MAAM,aAAa,CAcxB,GAAG,IAAI,eAAe,EAAE;MACxB,MAAM,EAAE,MAAM;MACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;MAChC,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;OACnC;KACF,CAAC,CAAC;GACJ;EAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;GACpB;AACH,CAAC,CAAC;AAEF,OAAO,EAAc,UAAU,EAAE,CAAC","sourcesContent":["import { fetchWithType } from './api';\n\nconst base = process.env.API_URL ? `${process.env.API_URL}/wp-json/felix` : 'https://hemfixarna.se/wp-json/felix';\n\ninterface FelixOrder {\n firstName: string;\n lastName: string;\n street: string;\n zip: string;\n town: string;\n ssn: string;\n email: string;\n phone: string;\n url: string;\n date: string;\n notes?: string;\n wws?: string;\n referral_id?: string;\n id_source?: string;\n id_sub_source?: string;\n products: {\n id: string;\n name: string;\n quantity: number;\n rut: number;\n rot: number;\n }[];\n creditSafe: {\n firstName: string;\n lastName: string;\n street: string;\n zip: string;\n town: string;\n };\n felixStatus?: 'success' | 'error';\n customer?: string;\n seller_id?: string;\n refferal_id?: string;\n}\n\nconst postPerson = async (felixOrder: FelixOrder) => {\n try {\n return await fetchWithType<\n | {\n response: {\n scriptResult: string;\n scriptError: string;\n };\n messages: [\n {\n code: string;\n message: string;\n },\n ];\n }\n | false\n >(`${base}/createperson`, {\n method: 'POST',\n body: JSON.stringify(felixOrder),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n } catch (error) {\n console.log(error);\n }\n};\n\nexport { FelixOrder, postPerson };\n"]}
|