hemfixarna-web-components 1.4.0 → 1.4.2
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_24.cjs.entry.js → hemfixarna-address_27.cjs.entry.js} +81 -30
- package/dist/{esm/hemfixarna-address_24.entry.js.map → cjs/hemfixarna-address_27.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/assets/fargvaruhuset.png +0 -0
- package/dist/collection/assets/kbygg.svg +29 -0
- package/dist/collection/assets/norrgavel.svg +1 -0
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +132 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +132 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +132 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +1 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +7 -7
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna.css +8 -0
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +2 -2
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
- package/dist/collection/types/index.js +3 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/esm/{hemfixarna-address_24.entry.js → hemfixarna-address_27.entry.js} +72 -24
- package/dist/{cjs/hemfixarna-address_24.cjs.entry.js.map → esm/hemfixarna-address_27.entry.js.map} +1 -1
- package/dist/esm/hemfixarna-components.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hemfixarna-components/assets/fargvaruhuset.png +0 -0
- package/dist/hemfixarna-components/assets/kbygg.svg +29 -0
- package/dist/hemfixarna-components/assets/norrgavel.svg +1 -0
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
- package/dist/hemfixarna-components/p-693d466c.entry.js +2 -0
- package/dist/types/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.d.ts +10 -0
- package/dist/types/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.d.ts +10 -0
- package/dist/types/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.d.ts +10 -0
- package/dist/types/components/hemfixarna-component/hemfixarna-component.d.ts +1 -0
- package/dist/types/components.d.ts +77 -0
- package/dist/types/types/index.d.ts +4 -1
- package/package.json +1 -1
- package/dist/hemfixarna-components/p-891367c9.entry.js +0 -2
- /package/dist/hemfixarna-components/{p-891367c9.entry.js.map → p-693d466c.entry.js.map} +0 -0
package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
import { h } from '@stencil/core';
|
2
|
+
import { Business, WidgetStyle } from '../../../types';
|
3
|
+
export class MyComponent {
|
4
|
+
constructor() {
|
5
|
+
this.id = undefined;
|
6
|
+
this.loadFromQuery = 'true';
|
7
|
+
this.widgetStyle = WidgetStyle.standard;
|
8
|
+
this.buttonColor = undefined;
|
9
|
+
this.buttonBg = undefined;
|
10
|
+
this.isDemo = false;
|
11
|
+
}
|
12
|
+
render() {
|
13
|
+
return (h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, nav: { url: 'https://www.fargvaruhuset.se', logo: 'assets/fargvaruhuset.png' }, loadFromQuery: Boolean(this.loadFromQuery), id: this.id, business: Business.fargvaruhuset, isDemo: this.isDemo }));
|
14
|
+
}
|
15
|
+
static get is() { return "hemfixarna-fargvaruhuset"; }
|
16
|
+
static get encapsulation() { return "shadow"; }
|
17
|
+
static get properties() {
|
18
|
+
return {
|
19
|
+
"id": {
|
20
|
+
"type": "string",
|
21
|
+
"mutable": false,
|
22
|
+
"complexType": {
|
23
|
+
"original": "string",
|
24
|
+
"resolved": "string",
|
25
|
+
"references": {}
|
26
|
+
},
|
27
|
+
"required": false,
|
28
|
+
"optional": true,
|
29
|
+
"docs": {
|
30
|
+
"tags": [],
|
31
|
+
"text": ""
|
32
|
+
},
|
33
|
+
"attribute": "id",
|
34
|
+
"reflect": false
|
35
|
+
},
|
36
|
+
"loadFromQuery": {
|
37
|
+
"type": "string",
|
38
|
+
"mutable": false,
|
39
|
+
"complexType": {
|
40
|
+
"original": "string",
|
41
|
+
"resolved": "string",
|
42
|
+
"references": {}
|
43
|
+
},
|
44
|
+
"required": false,
|
45
|
+
"optional": true,
|
46
|
+
"docs": {
|
47
|
+
"tags": [],
|
48
|
+
"text": ""
|
49
|
+
},
|
50
|
+
"attribute": "load-from-query",
|
51
|
+
"reflect": false,
|
52
|
+
"defaultValue": "'true'"
|
53
|
+
},
|
54
|
+
"widgetStyle": {
|
55
|
+
"type": "string",
|
56
|
+
"mutable": false,
|
57
|
+
"complexType": {
|
58
|
+
"original": "WidgetStyle",
|
59
|
+
"resolved": "WidgetStyle.alternative | WidgetStyle.alternative_2 | WidgetStyle.alternative_3 | WidgetStyle.standard",
|
60
|
+
"references": {
|
61
|
+
"WidgetStyle": {
|
62
|
+
"location": "import",
|
63
|
+
"path": "../../../types"
|
64
|
+
}
|
65
|
+
}
|
66
|
+
},
|
67
|
+
"required": false,
|
68
|
+
"optional": true,
|
69
|
+
"docs": {
|
70
|
+
"tags": [],
|
71
|
+
"text": ""
|
72
|
+
},
|
73
|
+
"attribute": "widget-style",
|
74
|
+
"reflect": false,
|
75
|
+
"defaultValue": "WidgetStyle.standard"
|
76
|
+
},
|
77
|
+
"buttonColor": {
|
78
|
+
"type": "string",
|
79
|
+
"mutable": false,
|
80
|
+
"complexType": {
|
81
|
+
"original": "string",
|
82
|
+
"resolved": "string",
|
83
|
+
"references": {}
|
84
|
+
},
|
85
|
+
"required": false,
|
86
|
+
"optional": true,
|
87
|
+
"docs": {
|
88
|
+
"tags": [],
|
89
|
+
"text": ""
|
90
|
+
},
|
91
|
+
"attribute": "button-color",
|
92
|
+
"reflect": false
|
93
|
+
},
|
94
|
+
"buttonBg": {
|
95
|
+
"type": "string",
|
96
|
+
"mutable": false,
|
97
|
+
"complexType": {
|
98
|
+
"original": "string",
|
99
|
+
"resolved": "string",
|
100
|
+
"references": {}
|
101
|
+
},
|
102
|
+
"required": false,
|
103
|
+
"optional": true,
|
104
|
+
"docs": {
|
105
|
+
"tags": [],
|
106
|
+
"text": ""
|
107
|
+
},
|
108
|
+
"attribute": "button-bg",
|
109
|
+
"reflect": false
|
110
|
+
},
|
111
|
+
"isDemo": {
|
112
|
+
"type": "boolean",
|
113
|
+
"mutable": false,
|
114
|
+
"complexType": {
|
115
|
+
"original": "boolean",
|
116
|
+
"resolved": "boolean",
|
117
|
+
"references": {}
|
118
|
+
},
|
119
|
+
"required": false,
|
120
|
+
"optional": true,
|
121
|
+
"docs": {
|
122
|
+
"tags": [],
|
123
|
+
"text": ""
|
124
|
+
},
|
125
|
+
"attribute": "is-demo",
|
126
|
+
"reflect": false,
|
127
|
+
"defaultValue": "false"
|
128
|
+
}
|
129
|
+
};
|
130
|
+
}
|
131
|
+
}
|
132
|
+
//# sourceMappingURL=hemfixarna-fargvaruhuset.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hemfixarna-fargvaruhuset.js","sourceRoot":"","sources":["../../../../src/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMvD,MAAM,OAAO,WAAW;;;yBAEW,MAAM;uBACH,WAAW,CAAC,QAAQ;;;kBAG7B,KAAK;;EAEhC,MAAM;IACJ,OAAO,CACL,4BACE,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,GAAG,EAAE,EAAE,GAAG,EAAE,8BAA8B,EAAE,IAAI,EAAE,0BAA0B,EAAE,EAC9E,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAC1C,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,QAAQ,EAAE,QAAQ,CAAC,aAAa,EAChC,MAAM,EAAE,IAAI,CAAC,MAAM,GACG,CACzB,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { Business, WidgetStyle } from '../../../types';\n\n@Component({\n tag: 'hemfixarna-fargvaruhuset',\n shadow: true,\n})\nexport class MyComponent {\n @Prop() id?: string;\n @Prop() loadFromQuery?: string = 'true';\n @Prop() widgetStyle?: WidgetStyle = WidgetStyle.standard;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n @Prop() isDemo?: boolean = false;\n\n render() {\n return (\n <hemfixarna-component\n widgetStyle={this.widgetStyle}\n buttonBg={this.buttonBg}\n buttonColor={this.buttonColor}\n nav={{ url: 'https://www.fargvaruhuset.se', logo: 'assets/fargvaruhuset.png' }}\n loadFromQuery={Boolean(this.loadFromQuery)}\n id={this.id}\n business={Business.fargvaruhuset}\n isDemo={this.isDemo}\n ></hemfixarna-component>\n );\n }\n}\n"]}
|
@@ -0,0 +1,132 @@
|
|
1
|
+
import { h } from '@stencil/core';
|
2
|
+
import { Business, WidgetStyle } from '../../../types';
|
3
|
+
export class MyComponent {
|
4
|
+
constructor() {
|
5
|
+
this.id = undefined;
|
6
|
+
this.loadFromQuery = 'true';
|
7
|
+
this.widgetStyle = WidgetStyle.standard;
|
8
|
+
this.buttonColor = undefined;
|
9
|
+
this.buttonBg = undefined;
|
10
|
+
this.isDemo = false;
|
11
|
+
}
|
12
|
+
render() {
|
13
|
+
return (h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, nav: { url: 'https://k-bygg.se', logo: 'assets/kbygg.svg', backgroundColor: '#651d32' }, loadFromQuery: Boolean(this.loadFromQuery), id: this.id, business: Business.kbygg, isDemo: this.isDemo }));
|
14
|
+
}
|
15
|
+
static get is() { return "hemfixarna-kbygg"; }
|
16
|
+
static get encapsulation() { return "shadow"; }
|
17
|
+
static get properties() {
|
18
|
+
return {
|
19
|
+
"id": {
|
20
|
+
"type": "string",
|
21
|
+
"mutable": false,
|
22
|
+
"complexType": {
|
23
|
+
"original": "string",
|
24
|
+
"resolved": "string",
|
25
|
+
"references": {}
|
26
|
+
},
|
27
|
+
"required": false,
|
28
|
+
"optional": true,
|
29
|
+
"docs": {
|
30
|
+
"tags": [],
|
31
|
+
"text": ""
|
32
|
+
},
|
33
|
+
"attribute": "id",
|
34
|
+
"reflect": false
|
35
|
+
},
|
36
|
+
"loadFromQuery": {
|
37
|
+
"type": "string",
|
38
|
+
"mutable": false,
|
39
|
+
"complexType": {
|
40
|
+
"original": "string",
|
41
|
+
"resolved": "string",
|
42
|
+
"references": {}
|
43
|
+
},
|
44
|
+
"required": false,
|
45
|
+
"optional": true,
|
46
|
+
"docs": {
|
47
|
+
"tags": [],
|
48
|
+
"text": ""
|
49
|
+
},
|
50
|
+
"attribute": "load-from-query",
|
51
|
+
"reflect": false,
|
52
|
+
"defaultValue": "'true'"
|
53
|
+
},
|
54
|
+
"widgetStyle": {
|
55
|
+
"type": "string",
|
56
|
+
"mutable": false,
|
57
|
+
"complexType": {
|
58
|
+
"original": "WidgetStyle",
|
59
|
+
"resolved": "WidgetStyle.alternative | WidgetStyle.alternative_2 | WidgetStyle.alternative_3 | WidgetStyle.standard",
|
60
|
+
"references": {
|
61
|
+
"WidgetStyle": {
|
62
|
+
"location": "import",
|
63
|
+
"path": "../../../types"
|
64
|
+
}
|
65
|
+
}
|
66
|
+
},
|
67
|
+
"required": false,
|
68
|
+
"optional": true,
|
69
|
+
"docs": {
|
70
|
+
"tags": [],
|
71
|
+
"text": ""
|
72
|
+
},
|
73
|
+
"attribute": "widget-style",
|
74
|
+
"reflect": false,
|
75
|
+
"defaultValue": "WidgetStyle.standard"
|
76
|
+
},
|
77
|
+
"buttonColor": {
|
78
|
+
"type": "string",
|
79
|
+
"mutable": false,
|
80
|
+
"complexType": {
|
81
|
+
"original": "string",
|
82
|
+
"resolved": "string",
|
83
|
+
"references": {}
|
84
|
+
},
|
85
|
+
"required": false,
|
86
|
+
"optional": true,
|
87
|
+
"docs": {
|
88
|
+
"tags": [],
|
89
|
+
"text": ""
|
90
|
+
},
|
91
|
+
"attribute": "button-color",
|
92
|
+
"reflect": false
|
93
|
+
},
|
94
|
+
"buttonBg": {
|
95
|
+
"type": "string",
|
96
|
+
"mutable": false,
|
97
|
+
"complexType": {
|
98
|
+
"original": "string",
|
99
|
+
"resolved": "string",
|
100
|
+
"references": {}
|
101
|
+
},
|
102
|
+
"required": false,
|
103
|
+
"optional": true,
|
104
|
+
"docs": {
|
105
|
+
"tags": [],
|
106
|
+
"text": ""
|
107
|
+
},
|
108
|
+
"attribute": "button-bg",
|
109
|
+
"reflect": false
|
110
|
+
},
|
111
|
+
"isDemo": {
|
112
|
+
"type": "boolean",
|
113
|
+
"mutable": false,
|
114
|
+
"complexType": {
|
115
|
+
"original": "boolean",
|
116
|
+
"resolved": "boolean",
|
117
|
+
"references": {}
|
118
|
+
},
|
119
|
+
"required": false,
|
120
|
+
"optional": true,
|
121
|
+
"docs": {
|
122
|
+
"tags": [],
|
123
|
+
"text": ""
|
124
|
+
},
|
125
|
+
"attribute": "is-demo",
|
126
|
+
"reflect": false,
|
127
|
+
"defaultValue": "false"
|
128
|
+
}
|
129
|
+
};
|
130
|
+
}
|
131
|
+
}
|
132
|
+
//# sourceMappingURL=hemfixarna-kbygg.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hemfixarna-kbygg.js","sourceRoot":"","sources":["../../../../src/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMvD,MAAM,OAAO,WAAW;;;yBAEW,MAAM;uBACH,WAAW,CAAC,QAAQ;;;kBAG7B,KAAK;;EAEhC,MAAM;IACJ,OAAO,CACL,4BACE,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,GAAG,EAAE,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,eAAe,EAAE,SAAS,EAAE,EACvF,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAC1C,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,QAAQ,EAAE,QAAQ,CAAC,KAAK,EACxB,MAAM,EAAE,IAAI,CAAC,MAAM,GACG,CACzB,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { Business, WidgetStyle } from '../../../types';\n\n@Component({\n tag: 'hemfixarna-kbygg',\n shadow: true,\n})\nexport class MyComponent {\n @Prop() id?: string;\n @Prop() loadFromQuery?: string = 'true';\n @Prop() widgetStyle?: WidgetStyle = WidgetStyle.standard;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n @Prop() isDemo?: boolean = false;\n\n render() {\n return (\n <hemfixarna-component\n widgetStyle={this.widgetStyle}\n buttonBg={this.buttonBg}\n buttonColor={this.buttonColor}\n nav={{ url: 'https://k-bygg.se', logo: 'assets/kbygg.svg', backgroundColor: '#651d32' }}\n loadFromQuery={Boolean(this.loadFromQuery)}\n id={this.id}\n business={Business.kbygg}\n isDemo={this.isDemo}\n ></hemfixarna-component>\n );\n }\n}\n"]}
|
@@ -0,0 +1,132 @@
|
|
1
|
+
import { h } from '@stencil/core';
|
2
|
+
import { Business, WidgetStyle } from '../../../types';
|
3
|
+
export class MyComponent {
|
4
|
+
constructor() {
|
5
|
+
this.id = undefined;
|
6
|
+
this.loadFromQuery = 'true';
|
7
|
+
this.widgetStyle = WidgetStyle.standard;
|
8
|
+
this.buttonColor = undefined;
|
9
|
+
this.buttonBg = undefined;
|
10
|
+
this.isDemo = false;
|
11
|
+
}
|
12
|
+
render() {
|
13
|
+
return (h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, nav: { url: 'https://norrgavel.se', logo: 'assets/norrgavel.svg' }, loadFromQuery: Boolean(this.loadFromQuery), id: this.id, business: Business.norrgavel, isDemo: this.isDemo }));
|
14
|
+
}
|
15
|
+
static get is() { return "hemfixarna-norrgavel"; }
|
16
|
+
static get encapsulation() { return "shadow"; }
|
17
|
+
static get properties() {
|
18
|
+
return {
|
19
|
+
"id": {
|
20
|
+
"type": "string",
|
21
|
+
"mutable": false,
|
22
|
+
"complexType": {
|
23
|
+
"original": "string",
|
24
|
+
"resolved": "string",
|
25
|
+
"references": {}
|
26
|
+
},
|
27
|
+
"required": false,
|
28
|
+
"optional": true,
|
29
|
+
"docs": {
|
30
|
+
"tags": [],
|
31
|
+
"text": ""
|
32
|
+
},
|
33
|
+
"attribute": "id",
|
34
|
+
"reflect": false
|
35
|
+
},
|
36
|
+
"loadFromQuery": {
|
37
|
+
"type": "string",
|
38
|
+
"mutable": false,
|
39
|
+
"complexType": {
|
40
|
+
"original": "string",
|
41
|
+
"resolved": "string",
|
42
|
+
"references": {}
|
43
|
+
},
|
44
|
+
"required": false,
|
45
|
+
"optional": true,
|
46
|
+
"docs": {
|
47
|
+
"tags": [],
|
48
|
+
"text": ""
|
49
|
+
},
|
50
|
+
"attribute": "load-from-query",
|
51
|
+
"reflect": false,
|
52
|
+
"defaultValue": "'true'"
|
53
|
+
},
|
54
|
+
"widgetStyle": {
|
55
|
+
"type": "string",
|
56
|
+
"mutable": false,
|
57
|
+
"complexType": {
|
58
|
+
"original": "WidgetStyle",
|
59
|
+
"resolved": "WidgetStyle.alternative | WidgetStyle.alternative_2 | WidgetStyle.alternative_3 | WidgetStyle.standard",
|
60
|
+
"references": {
|
61
|
+
"WidgetStyle": {
|
62
|
+
"location": "import",
|
63
|
+
"path": "../../../types"
|
64
|
+
}
|
65
|
+
}
|
66
|
+
},
|
67
|
+
"required": false,
|
68
|
+
"optional": true,
|
69
|
+
"docs": {
|
70
|
+
"tags": [],
|
71
|
+
"text": ""
|
72
|
+
},
|
73
|
+
"attribute": "widget-style",
|
74
|
+
"reflect": false,
|
75
|
+
"defaultValue": "WidgetStyle.standard"
|
76
|
+
},
|
77
|
+
"buttonColor": {
|
78
|
+
"type": "string",
|
79
|
+
"mutable": false,
|
80
|
+
"complexType": {
|
81
|
+
"original": "string",
|
82
|
+
"resolved": "string",
|
83
|
+
"references": {}
|
84
|
+
},
|
85
|
+
"required": false,
|
86
|
+
"optional": true,
|
87
|
+
"docs": {
|
88
|
+
"tags": [],
|
89
|
+
"text": ""
|
90
|
+
},
|
91
|
+
"attribute": "button-color",
|
92
|
+
"reflect": false
|
93
|
+
},
|
94
|
+
"buttonBg": {
|
95
|
+
"type": "string",
|
96
|
+
"mutable": false,
|
97
|
+
"complexType": {
|
98
|
+
"original": "string",
|
99
|
+
"resolved": "string",
|
100
|
+
"references": {}
|
101
|
+
},
|
102
|
+
"required": false,
|
103
|
+
"optional": true,
|
104
|
+
"docs": {
|
105
|
+
"tags": [],
|
106
|
+
"text": ""
|
107
|
+
},
|
108
|
+
"attribute": "button-bg",
|
109
|
+
"reflect": false
|
110
|
+
},
|
111
|
+
"isDemo": {
|
112
|
+
"type": "boolean",
|
113
|
+
"mutable": false,
|
114
|
+
"complexType": {
|
115
|
+
"original": "boolean",
|
116
|
+
"resolved": "boolean",
|
117
|
+
"references": {}
|
118
|
+
},
|
119
|
+
"required": false,
|
120
|
+
"optional": true,
|
121
|
+
"docs": {
|
122
|
+
"tags": [],
|
123
|
+
"text": ""
|
124
|
+
},
|
125
|
+
"attribute": "is-demo",
|
126
|
+
"reflect": false,
|
127
|
+
"defaultValue": "false"
|
128
|
+
}
|
129
|
+
};
|
130
|
+
}
|
131
|
+
}
|
132
|
+
//# sourceMappingURL=hemfixarna-norrgavel.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hemfixarna-norrgavel.js","sourceRoot":"","sources":["../../../../src/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMvD,MAAM,OAAO,WAAW;;;yBAEW,MAAM;uBACH,WAAW,CAAC,QAAQ;;;kBAG7B,KAAK;;EAEhC,MAAM;IACJ,OAAO,CACL,4BACE,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,GAAG,EAAE,EAAE,GAAG,EAAE,sBAAsB,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAClE,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAC1C,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,QAAQ,EAAE,QAAQ,CAAC,SAAS,EAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,GACG,CACzB,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { Business, WidgetStyle } from '../../../types';\n\n@Component({\n tag: 'hemfixarna-norrgavel',\n shadow: true,\n})\nexport class MyComponent {\n @Prop() id?: string;\n @Prop() loadFromQuery?: string = 'true';\n @Prop() widgetStyle?: WidgetStyle = WidgetStyle.standard;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n @Prop() isDemo?: boolean = false;\n\n render() {\n return (\n <hemfixarna-component\n widgetStyle={this.widgetStyle}\n buttonBg={this.buttonBg}\n buttonColor={this.buttonColor}\n nav={{ url: 'https://norrgavel.se', logo: 'assets/norrgavel.svg' }}\n loadFromQuery={Boolean(this.loadFromQuery)}\n id={this.id}\n business={Business.norrgavel}\n isDemo={this.isDemo}\n ></hemfixarna-component>\n );\n }\n}\n"]}
|
@@ -217,15 +217,15 @@ export class HemfixarnaComponent {
|
|
217
217
|
return state.cart.reduce((acc, curr) => acc + curr.amount, 0);
|
218
218
|
}
|
219
219
|
render() {
|
220
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
220
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
221
221
|
const logo = getAssetPath(`./assets/hemfixarna.svg`);
|
222
222
|
const pensel = getAssetPath(`./assets/pensel.svg`);
|
223
223
|
const monteringLogo = getAssetPath(`./assets/montering.svg`);
|
224
224
|
const navBackground = ((_a = this.nav) === null || _a === void 0 ? void 0 : _a.background) ? getAssetPath(this.nav.background) : '';
|
225
225
|
const navLogo = ((_b = this.nav) === null || _b === void 0 ? void 0 : _b.logo) ? getAssetPath(this.nav.logo) : '';
|
226
|
-
return (h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (h("nav", { class: "hemfixarna_nav" }, h("div", null, h("div", { class: "hemfixarna_nav--logos" }, h("a", { href: this.nav.url, target: "_blank" }, h("img", { class: "hemfixarna_partnerlogo", src: navLogo, alt: `${this.business} logo` })), h("a", { href: "https://hemfixarna.se/", target: "_blank" }, h("p", { class: navBackground ? 'with-bg' : '' }, "I samarbete med:"), h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), h("div", { class: "hemfixarna_nav--links" }, h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), navBackground ? h("img", { src: navBackground, class: "nav_background", alt: "nav_background" }) : null))) : null, !this.loadFromQuery || this.isDemo ? (h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (h("img", { src: this.id === 'maleri' ? pensel : monteringLogo, alt: "montering logo", width: 32, height: 32 })) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, this.id === 'maleri' ? (h("span", null, "Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r")) : (h(Fragment, null, ((
|
227
|
-
color: ((
|
228
|
-
backgroundColor: ((
|
226
|
+
return (h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (h("nav", { class: "hemfixarna_nav", style: { backgroundColor: (_c = this.nav.backgroundColor) !== null && _c !== void 0 ? _c : '' } }, h("div", null, h("div", { class: "hemfixarna_nav--logos" }, h("a", { href: this.nav.url, target: "_blank" }, h("img", { class: "hemfixarna_partnerlogo", src: navLogo, alt: `${this.business} logo` })), h("a", { href: "https://hemfixarna.se/", target: "_blank" }, h("p", { class: navBackground || this.nav.backgroundColor ? 'with-bg' : '' }, "I samarbete med:"), h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), h("div", { class: "hemfixarna_nav--links" }, h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), navBackground ? h("img", { src: navBackground, class: "nav_background", alt: "nav_background" }) : null))) : null, !this.loadFromQuery || this.isDemo ? (h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (h("img", { src: this.id === 'maleri' ? pensel : monteringLogo, alt: "montering logo", width: 32, height: 32 })) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, this.id === 'maleri' ? (h("span", null, "Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r")) : (h(Fragment, null, ((_d = this.product) === null || _d === void 0 ? void 0 : _d.post_title) || ((_e = this.proppedProduct) === null || _e === void 0 ? void 0 : _e.post_title) || (h("span", null, "Montering", h("wbr", null), "/Installation ", (_g = (_f = state.selectedCustomerCategory) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : 'på plats', " - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))), (this.product && ((_h = this.slug) === null || _h === void 0 ? void 0 : _h.includes('product'))) || (this.proppedProduct && !((_j = this.product) === null || _j === void 0 ? void 0 : _j.invoice) && !((_k = this.proppedProduct) === null || _k === void 0 ? void 0 : _k.invoice)) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null, ((_l = this.product) === null || _l === void 0 ? void 0 : _l.invoice) || ((_m = this.proppedProduct) === null || _m === void 0 ? void 0 : _m.invoice) ? (h("span", null, ' - ', h("strong", { class: "underling" }, "se priser h\u00E4r"))) : null)))), this.widgetStyle === WidgetStyle.standard ? h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (h("span", { class: "p-s" }, "Utf\u00F6rs av ", h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
|
227
|
+
color: ((_o = this.buttonColor) === null || _o === void 0 ? void 0 : _o.startsWith('#')) || !((_p = this.buttonColor) === null || _p === void 0 ? void 0 : _p.length) ? this.buttonColor : `#${this.buttonColor}`,
|
228
|
+
backgroundColor: ((_q = this.buttonBg) === null || _q === void 0 ? void 0 : _q.startsWith('#')) || !((_r = this.buttonBg) === null || _r === void 0 ? void 0 : _r.length) ? this.buttonBg : `#${this.buttonBg}`,
|
229
229
|
} }, "Best\u00E4ll h\u00E4r", this.getCartLength() > 0 && h("span", null, this.getCartLength()))) : null, WidgetStyle.alternative_2 === this.widgetStyle ? (h("div", { class: "hemfixarna_altbtn" }, h("strong", { class: "p-s" }, "Utf\u00F6rs av"), h("img", { src: logo, alt: "hemfixarna logo", width: 98 }))) : null)) : null, this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, state.modal.title && h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", { innerHTML: t }))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), (this.tree || state.customer) && (h("hemfixarna-breadcrumbs", { isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, closeModal: () => this.closeModal(), tree: this.tree })), !state.customer || this.slugIsOldFormat(this.slug) ? (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", { tree: this.tree }))) : (h("div", { class: `hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}` }, state.step < 4 && h("hemfixarna-start", null), state.step === 4 && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree })))), !this.isDemo ? h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` }) : null))));
|
230
230
|
}
|
231
231
|
static get is() { return "hemfixarna-component"; }
|
@@ -282,7 +282,7 @@ export class HemfixarnaComponent {
|
|
282
282
|
"mutable": false,
|
283
283
|
"complexType": {
|
284
284
|
"original": "Business",
|
285
|
-
"resolved": "Business.byggmax | Business.doro | Business.elfa | Business.forebygg | Business.hornbach | Business.kund | Business.skanska | Business.string",
|
285
|
+
"resolved": "Business.byggmax | Business.doro | Business.elfa | Business.fargvaruhuset | Business.forebygg | Business.hornbach | Business.kbygg | Business.kund | Business.norrgavel | Business.skanska | Business.string",
|
286
286
|
"references": {
|
287
287
|
"Business": {
|
288
288
|
"location": "import",
|
@@ -401,8 +401,8 @@ export class HemfixarnaComponent {
|
|
401
401
|
"type": "unknown",
|
402
402
|
"mutable": false,
|
403
403
|
"complexType": {
|
404
|
-
"original": "{\n url: string;\n logo: string;\n background?: string;\n }",
|
405
|
-
"resolved": "{ url: string; logo: string; background?: string; }",
|
404
|
+
"original": "{\n url: string;\n logo: string;\n background?: string;\n backgroundColor?: string;\n }",
|
405
|
+
"resolved": "{ url: string; logo: string; background?: string; backgroundColor?: string; }",
|
406
406
|
"references": {}
|
407
407
|
},
|
408
408
|
"required": false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hemfixarna-component.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-component/hemfixarna-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAqD,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQjD,MAAM,OAAO,mBAAmB;;IAqF9B,oBAAe,GAAG,CAAC,IAAa,EAAE,EAAE;MAClC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;MACxB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC;IA4EF,uBAAkB,GAAG,GAAG,EAAE;MACxB,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;MACnE,WAAW,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC;iBAtKwB,KAAK;qBACD,KAAK;gBACF,IAAI;mBACF,IAAI;0BACG,IAAI;;;;;wBAKb,KAAK;yBACJ,KAAK;kBACZ,KAAK;;eAM5B,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C,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,uBAAiB,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;YAExD,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,wBAAkB,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CACtD,CACP,CACG;QACL,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,WAAK,KAAK,EAAE,uBAAuB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,EAAE,GAAQ,CAAC,CAAC,CAAC,IAAI,CACjH,CACP,CACG,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, Listen, Prop, State, Watch, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Category, Product, Service, TopCategory, WidgetStyle } from '../../types';\nimport { getCustomer, getOptions, getRot, getRut, getTaxonomy } from '../../utils/api';\nimport { getProductPriceWithRotAndRut } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-component',\n styleUrl: 'hemfixarna.scss',\n shadow: true,\n assetsDirs: ['assets'],\n})\nexport class HemfixarnaComponent {\n @State() modal: boolean = false;\n @State() showModal: boolean = false;\n @State() tree: Category | null = null;\n @State() product: Product | null = null;\n @State() proppedProduct: Product | null = null;\n @Prop() slug?: string;\n @Prop() id?: string;\n @Prop() business: Business;\n @Prop() topCategory?: TopCategory;\n @Prop() forceOldTree?: boolean = false;\n @Prop() loadFromQuery?: boolean = false;\n @Prop() isDemo?: boolean = false;\n @Prop() widgetStyle: WidgetStyle;\n @Prop() nav?: {\n url: string;\n logo: string;\n background?: string;\n } = undefined;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n\n @Element() private el: HTMLElement;\n\n loadCategoryOrProduct(id: string) {\n this.proppedProduct = null;\n if (id.startsWith('c-')) {\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === id.replace('c-', ''));\n if (category) {\n state.selectedCustomerCategory = category;\n state.step = 2;\n }\n } else {\n const products = state.customer.categories\n .map(c => (c.show_products ? c.products : c.sub_categories ? c.sub_categories.map(c => c.products) : []))\n .flat()\n .flat();\n const product = products.find(p => p && p.fields.ID === parseInt(id));\n if (product) {\n state.selectedProduct = product.fields;\n state.step = 4;\n this.proppedProduct = product.fields;\n }\n }\n }\n\n @Watch('slug')\n async watchSlugChange(newValue: string) {\n if (this.slugIsOldFormat(newValue)) {\n this.fetchNewTaxonomy(newValue);\n } else if (state.customer && newValue) {\n this.loadCategoryOrProduct(newValue);\n }\n }\n\n @Watch('id')\n async watchIdChange(id: string) {\n if (id && state.customer) {\n if (id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(id);\n }\n }\n }\n\n async fetchNewTaxonomy(slug: string) {\n state.selectedCategory = null;\n state.selectedProduct = null;\n state.selectedService = null;\n state.maleri = null;\n\n const res = await getTaxonomy(slug);\n if (res?.code === 'not_found' || res?.code === 'rest_no_route') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n }\n\n slugIsOldFormat = (slug?: string) => {\n if (!slug) return false;\n return ['product', 'service', 'category'].some(str => slug.includes(str));\n };\n\n async componentWillLoad() {\n state.business = this.business;\n const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);\n if (cart) {\n state.cart = JSON.parse(cart);\n }\n const user = window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);\n if (user) {\n state.user = JSON.parse(user);\n }\n const creditSafeUser = window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);\n if (creditSafeUser) {\n state.creditSafeUser = JSON.parse(creditSafeUser);\n }\n\n const [tree, res, options, rut, rot] = await Promise.all([\n this.topCategory ? getTaxonomy(this.topCategory) : null,\n this.slug ? getTaxonomy(this.slug) : Promise.resolve(null),\n getOptions(),\n getRut(),\n getRot(),\n ]);\n\n if ((!this.slug || !this.slugIsOldFormat(this.slug)) && !this.forceOldTree) {\n try {\n const customer = await getCustomer(this.business);\n if (customer?.code === 'not_found') {\n console.warn('customer not found');\n } else if (customer) {\n state.customer = customer;\n if (this.id) {\n if (this.id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(this.id);\n }\n } else if (this.slug && !this.slugIsOldFormat(this.slug)) {\n this.loadCategoryOrProduct(this.slug);\n }\n }\n } catch (error) {\n console.warn('customer not found');\n }\n }\n\n if (tree?.code === 'not_found') {\n // console.warn('tree not found');\n } else if (tree) {\n this.tree = tree;\n }\n\n if (res?.code === 'not_found') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n\n if (this.loadFromQuery) {\n const params = new URL(document.location.toString()).searchParams;\n this.id = params.get('id');\n if (!this.isDemo) {\n this.openModal();\n }\n }\n\n state.rotOptions = rot;\n state.rutOptions = rut;\n state.options = options;\n }\n\n triggerScrollTotop = () => {\n const el = this.el.shadowRoot.querySelector('.hemfixarna_content');\n scrollToTop(el);\n };\n\n setTaxonomy(taxonomy: Category | Service | Product) {\n if (taxonomy) {\n if ((taxonomy as Category)?.taxonomy === 'service_cat') {\n state.selectedCategory = taxonomy as Category;\n state.step = 2;\n } else if ((taxonomy as Service)?.post_type === 'service') {\n state.selectedService = taxonomy as Service;\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === (taxonomy as Service).ID));\n state.step = 3;\n } else if ((taxonomy as Product)?.post_type === 'ikea_product') {\n state.selectedProduct = taxonomy as Product;\n state.selectedService = this.tree.sub_cats\n .map(c => c.services)\n .flat()\n .find(s => s.products.find(p => p.ID === state.selectedProduct.ID));\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === state.selectedService.ID));\n state.step = 4;\n }\n this.triggerScrollTotop();\n }\n }\n\n // Open close modal && click outside event\n openModal() {\n this.modal = true;\n setTimeout(() => {\n this.showModal = true;\n }, 50);\n }\n closeModal() {\n this.showModal = false;\n setTimeout(() => {\n this.modal = false;\n }, 200);\n }\n @Listen('click')\n handleClick(e: Event) {\n if (this.loadFromQuery && !this.isDemo) return;\n if ((e?.composedPath()[0] as HTMLElement).classList.contains('hemfixarna_backdrop')) {\n this.closeModal();\n }\n const infomodal = this.el.shadowRoot.querySelector('.hemfixarna_infomodal');\n if (infomodal) {\n const isClickInside = infomodal.contains(e.composedPath()[0] as HTMLInputElement);\n if (!isClickInside) {\n state.modal = null;\n }\n }\n }\n\n getCartLength() {\n return state.cart.reduce((acc, curr) => acc + curr.amount, 0);\n }\n\n render() {\n const logo = getAssetPath(`./assets/hemfixarna.svg`);\n const pensel = getAssetPath(`./assets/pensel.svg`);\n const monteringLogo = getAssetPath(`./assets/montering.svg`);\n const navBackground = this.nav?.background ? getAssetPath(this.nav.background) : '';\n const navLogo = this.nav?.logo ? getAssetPath(this.nav.logo) : '';\n\n return (\n <div class={`hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}`}>\n {this.loadFromQuery && !this.isDemo && this.nav ? (\n <nav class=\"hemfixarna_nav\">\n <div>\n <div class=\"hemfixarna_nav--logos\">\n <a href={this.nav.url} target=\"_blank\">\n <img class=\"hemfixarna_partnerlogo\" src={navLogo} alt={`${this.business} logo`} />\n </a>\n <a href=\"https://hemfixarna.se/\" target=\"_blank\">\n <p class={navBackground ? 'with-bg' : ''}>I samarbete med:</p>\n <img src={logo} alt=\"hemfixarna_logo\" width={104} />\n </a>\n </div>\n\n <div class=\"hemfixarna_nav--links\">\n <a href={this.nav.url} target=\"_blank\">\n Till {this.business}\n </a>\n <a href=\"https://www.hemfixarna.se/\" target=\"_blank\">\n Till Hemfixarna\n </a>\n </div>\n {navBackground ? <img src={navBackground} class=\"nav_background\" alt=\"nav_background\" /> : null}\n </div>\n </nav>\n ) : null}\n {!this.loadFromQuery || this.isDemo ? (\n <div class={`hemfixarna_box hemfixarna_box--${this.widgetStyle}`}>\n {[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (\n <img src={this.id === 'maleri' ? pensel : monteringLogo} alt=\"montering logo\" width={32} height={32} />\n ) : null}\n <div>\n <div>\n <p\n onClick={() => this.openModal()}\n class={`pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}`}\n >\n {this.id === 'maleri' ? (\n <span>Beräkna fast pris på måleri & tapetsering här</span>\n ) : (\n <Fragment>\n {this.product?.post_title || this.proppedProduct?.post_title || (\n <span>\n Montering\n <wbr />\n /Installation {state.selectedCustomerCategory?.name ?? 'på plats'} - <strong class=\"underline\">se priser här</strong>\n </span>\n )}\n {(this.product && this.slug?.includes('product')) || (this.proppedProduct && !this.product?.invoice && !this.proppedProduct?.invoice) ? (\n <span>\n {' från'} <strong>{getProductPriceWithRotAndRut(this.proppedProduct || this.product)}kr</strong>\n </span>\n ) : null}\n {this.product?.invoice || this.proppedProduct?.invoice ? (\n <span>\n {' - '}\n <strong class=\"underling\">se priser här</strong>\n </span>\n ) : null}\n </Fragment>\n )}\n </p>\n </div>\n {this.widgetStyle === WidgetStyle.standard ? <img src={logo} width={104} /> : null}\n {this.widgetStyle === WidgetStyle.alternative ? (\n <span class=\"p-s\">\n Utförs av <strong>Hemfixarna</strong>\n </span>\n ) : null}\n </div>\n {[WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (\n <button\n onClick={() => this.openModal()}\n class=\"hemfixarna_btn\"\n style={{\n color: this.buttonColor?.startsWith('#') || !this.buttonColor?.length ? this.buttonColor : `#${this.buttonColor}`,\n backgroundColor: this.buttonBg?.startsWith('#') || !this.buttonBg?.length ? this.buttonBg : `#${this.buttonBg}`,\n }}\n >\n Beställ här\n {this.getCartLength() > 0 && <span>{this.getCartLength()}</span>}\n </button>\n ) : null}\n {WidgetStyle.alternative_2 === this.widgetStyle ? (\n <div class=\"hemfixarna_altbtn\">\n <strong class=\"p-s\">Utförs av</strong>\n <img src={logo} alt=\"hemfixarna logo\" width={98} />\n </div>\n ) : null}\n </div>\n ) : null}\n {this.modal && (\n <div>\n <div class={`hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}`}>\n {state.modal && (\n <div class=\"hemfixarna_infomodal\">\n {state.modal.title && <h2>{state.modal.title}</h2>}\n {state.modal.text.map((t: string) => (\n <p innerHTML={t}></p>\n ))}\n <div>\n <button onClick={() => (state.modal = null)}>Stäng</button>\n </div>\n </div>\n )}\n {(this.tree || state.customer) && (\n <hemfixarna-breadcrumbs isDemo={this.isDemo} loadFromQuery={this.loadFromQuery} closeModal={() => this.closeModal()} tree={this.tree} />\n )}\n {!state.customer || this.slugIsOldFormat(this.slug) ? (\n <div class={`hemfixarna_content hemfixarna_content--${state.step}`}>\n {/* // IF AT TOP LEVEL (step 1) */}\n {state.step === 1 && this.tree && <hemfixarna-start tree={this.tree} />}\n {/* // IF SELECTED CATEGORY (step 2) */}\n {state.step === 2 && state.selectedCategory && <hemfixarna-category />}\n {/* // IF SELECTED SERVICE (step 3) */}\n {state.step === 3 && state.selectedService && <hemfixarna-service />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && state.selectedProduct && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n ) : (\n <div class={`hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}`}>\n {state.step < 4 && <hemfixarna-start />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n )}\n </div>\n {!this.isDemo ? <div class={`hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}`}></div> : null}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"hemfixarna-component.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-component/hemfixarna-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAqD,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQjD,MAAM,OAAO,mBAAmB;;IAsF9B,oBAAe,GAAG,CAAC,IAAa,EAAE,EAAE;MAClC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;MACxB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IA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ath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Category, Product, Service, TopCategory, WidgetStyle } from '../../types';\nimport { getCustomer, getOptions, getRot, getRut, getTaxonomy } from '../../utils/api';\nimport { getProductPriceWithRotAndRut } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-component',\n styleUrl: 'hemfixarna.scss',\n shadow: true,\n assetsDirs: ['assets'],\n})\nexport class HemfixarnaComponent {\n @State() modal: boolean = false;\n @State() showModal: boolean = false;\n @State() tree: Category | null = null;\n @State() product: Product | null = null;\n @State() proppedProduct: Product | null = null;\n @Prop() slug?: string;\n @Prop() id?: string;\n @Prop() business: Business;\n @Prop() topCategory?: TopCategory;\n @Prop() forceOldTree?: boolean = false;\n @Prop() loadFromQuery?: boolean = false;\n @Prop() isDemo?: boolean = false;\n @Prop() widgetStyle: WidgetStyle;\n @Prop() nav?: {\n url: string;\n logo: string;\n background?: string;\n backgroundColor?: string;\n } = undefined;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n\n @Element() private el: HTMLElement;\n\n loadCategoryOrProduct(id: string) {\n this.proppedProduct = null;\n if (id.startsWith('c-')) {\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === id.replace('c-', ''));\n if (category) {\n state.selectedCustomerCategory = category;\n state.step = 2;\n }\n } else {\n const products = state.customer.categories\n .map(c => (c.show_products ? c.products : c.sub_categories ? c.sub_categories.map(c => c.products) : []))\n .flat()\n .flat();\n const product = products.find(p => p && p.fields.ID === parseInt(id));\n if (product) {\n state.selectedProduct = product.fields;\n state.step = 4;\n this.proppedProduct = product.fields;\n }\n }\n }\n\n @Watch('slug')\n async watchSlugChange(newValue: string) {\n if (this.slugIsOldFormat(newValue)) {\n this.fetchNewTaxonomy(newValue);\n } else if (state.customer && newValue) {\n this.loadCategoryOrProduct(newValue);\n }\n }\n\n @Watch('id')\n async watchIdChange(id: string) {\n if (id && state.customer) {\n if (id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(id);\n }\n }\n }\n\n async fetchNewTaxonomy(slug: string) {\n state.selectedCategory = null;\n state.selectedProduct = null;\n state.selectedService = null;\n state.maleri = null;\n\n const res = await getTaxonomy(slug);\n if (res?.code === 'not_found' || res?.code === 'rest_no_route') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n }\n\n slugIsOldFormat = (slug?: string) => {\n if (!slug) return false;\n return ['product', 'service', 'category'].some(str => slug.includes(str));\n };\n\n async componentWillLoad() {\n state.business = this.business;\n const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);\n if (cart) {\n state.cart = JSON.parse(cart);\n }\n const user = window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);\n if (user) {\n state.user = JSON.parse(user);\n }\n const creditSafeUser = window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);\n if (creditSafeUser) {\n state.creditSafeUser = JSON.parse(creditSafeUser);\n }\n\n const [tree, res, options, rut, rot] = await Promise.all([\n this.topCategory ? getTaxonomy(this.topCategory) : null,\n this.slug ? getTaxonomy(this.slug) : Promise.resolve(null),\n getOptions(),\n getRut(),\n getRot(),\n ]);\n\n if ((!this.slug || !this.slugIsOldFormat(this.slug)) && !this.forceOldTree) {\n try {\n const customer = await getCustomer(this.business);\n if (customer?.code === 'not_found') {\n console.warn('customer not found');\n } else if (customer) {\n state.customer = customer;\n if (this.id) {\n if (this.id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(this.id);\n }\n } else if (this.slug && !this.slugIsOldFormat(this.slug)) {\n this.loadCategoryOrProduct(this.slug);\n }\n }\n } catch (error) {\n console.warn('customer not found');\n }\n }\n\n if (tree?.code === 'not_found') {\n // console.warn('tree not found');\n } else if (tree) {\n this.tree = tree;\n }\n\n if (res?.code === 'not_found') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n\n if (this.loadFromQuery) {\n const params = new URL(document.location.toString()).searchParams;\n this.id = params.get('id');\n if (!this.isDemo) {\n this.openModal();\n }\n }\n\n state.rotOptions = rot;\n state.rutOptions = rut;\n state.options = options;\n }\n\n triggerScrollTotop = () => {\n const el = this.el.shadowRoot.querySelector('.hemfixarna_content');\n scrollToTop(el);\n };\n\n setTaxonomy(taxonomy: Category | Service | Product) {\n if (taxonomy) {\n if ((taxonomy as Category)?.taxonomy === 'service_cat') {\n state.selectedCategory = taxonomy as Category;\n state.step = 2;\n } else if ((taxonomy as Service)?.post_type === 'service') {\n state.selectedService = taxonomy as Service;\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === (taxonomy as Service).ID));\n state.step = 3;\n } else if ((taxonomy as Product)?.post_type === 'ikea_product') {\n state.selectedProduct = taxonomy as Product;\n state.selectedService = this.tree.sub_cats\n .map(c => c.services)\n .flat()\n .find(s => s.products.find(p => p.ID === state.selectedProduct.ID));\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === state.selectedService.ID));\n state.step = 4;\n }\n this.triggerScrollTotop();\n }\n }\n\n // Open close modal && click outside event\n openModal() {\n this.modal = true;\n setTimeout(() => {\n this.showModal = true;\n }, 50);\n }\n closeModal() {\n this.showModal = false;\n setTimeout(() => {\n this.modal = false;\n }, 200);\n }\n @Listen('click')\n handleClick(e: Event) {\n if (this.loadFromQuery && !this.isDemo) return;\n if ((e?.composedPath()[0] as HTMLElement).classList.contains('hemfixarna_backdrop')) {\n this.closeModal();\n }\n const infomodal = this.el.shadowRoot.querySelector('.hemfixarna_infomodal');\n if (infomodal) {\n const isClickInside = infomodal.contains(e.composedPath()[0] as HTMLInputElement);\n if (!isClickInside) {\n state.modal = null;\n }\n }\n }\n\n getCartLength() {\n return state.cart.reduce((acc, curr) => acc + curr.amount, 0);\n }\n\n render() {\n const logo = getAssetPath(`./assets/hemfixarna.svg`);\n const pensel = getAssetPath(`./assets/pensel.svg`);\n const monteringLogo = getAssetPath(`./assets/montering.svg`);\n const navBackground = this.nav?.background ? getAssetPath(this.nav.background) : '';\n const navLogo = this.nav?.logo ? getAssetPath(this.nav.logo) : '';\n\n return (\n <div class={`hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}`}>\n {this.loadFromQuery && !this.isDemo && this.nav ? (\n <nav class=\"hemfixarna_nav\" style={{ backgroundColor: this.nav.backgroundColor ?? '' }}>\n <div>\n <div class=\"hemfixarna_nav--logos\">\n <a href={this.nav.url} target=\"_blank\">\n <img class=\"hemfixarna_partnerlogo\" src={navLogo} alt={`${this.business} logo`} />\n </a>\n <a href=\"https://hemfixarna.se/\" target=\"_blank\">\n <p class={navBackground || this.nav.backgroundColor ? 'with-bg' : ''}>I samarbete med:</p>\n <img src={logo} alt=\"hemfixarna_logo\" width={104} />\n </a>\n </div>\n\n <div class=\"hemfixarna_nav--links\">\n <a href={this.nav.url} target=\"_blank\">\n Till {this.business}\n </a>\n <a href=\"https://www.hemfixarna.se/\" target=\"_blank\">\n Till Hemfixarna\n </a>\n </div>\n {navBackground ? <img src={navBackground} class=\"nav_background\" alt=\"nav_background\" /> : null}\n </div>\n </nav>\n ) : null}\n {!this.loadFromQuery || this.isDemo ? (\n <div class={`hemfixarna_box hemfixarna_box--${this.widgetStyle}`}>\n {[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (\n <img src={this.id === 'maleri' ? pensel : monteringLogo} alt=\"montering logo\" width={32} height={32} />\n ) : null}\n <div>\n <div>\n <p\n onClick={() => this.openModal()}\n class={`pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}`}\n >\n {this.id === 'maleri' ? (\n <span>Beräkna fast pris på måleri & tapetsering här</span>\n ) : (\n <Fragment>\n {this.product?.post_title || this.proppedProduct?.post_title || (\n <span>\n Montering\n <wbr />\n /Installation {state.selectedCustomerCategory?.name ?? 'på plats'} - <strong class=\"underline\">se priser här</strong>\n </span>\n )}\n {(this.product && this.slug?.includes('product')) || (this.proppedProduct && !this.product?.invoice && !this.proppedProduct?.invoice) ? (\n <span>\n {' från'} <strong>{getProductPriceWithRotAndRut(this.proppedProduct || this.product)}kr</strong>\n </span>\n ) : null}\n {this.product?.invoice || this.proppedProduct?.invoice ? (\n <span>\n {' - '}\n <strong class=\"underling\">se priser här</strong>\n </span>\n ) : null}\n </Fragment>\n )}\n </p>\n </div>\n {this.widgetStyle === WidgetStyle.standard ? <img src={logo} width={104} /> : null}\n {this.widgetStyle === WidgetStyle.alternative ? (\n <span class=\"p-s\">\n Utförs av <strong>Hemfixarna</strong>\n </span>\n ) : null}\n </div>\n {[WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (\n <button\n onClick={() => this.openModal()}\n class=\"hemfixarna_btn\"\n style={{\n color: this.buttonColor?.startsWith('#') || !this.buttonColor?.length ? this.buttonColor : `#${this.buttonColor}`,\n backgroundColor: this.buttonBg?.startsWith('#') || !this.buttonBg?.length ? this.buttonBg : `#${this.buttonBg}`,\n }}\n >\n Beställ här\n {this.getCartLength() > 0 && <span>{this.getCartLength()}</span>}\n </button>\n ) : null}\n {WidgetStyle.alternative_2 === this.widgetStyle ? (\n <div class=\"hemfixarna_altbtn\">\n <strong class=\"p-s\">Utförs av</strong>\n <img src={logo} alt=\"hemfixarna logo\" width={98} />\n </div>\n ) : null}\n </div>\n ) : null}\n {this.modal && (\n <div>\n <div class={`hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}`}>\n {state.modal && (\n <div class=\"hemfixarna_infomodal\">\n {state.modal.title && <h2>{state.modal.title}</h2>}\n {state.modal.text.map((t: string) => (\n <p innerHTML={t}></p>\n ))}\n <div>\n <button onClick={() => (state.modal = null)}>Stäng</button>\n </div>\n </div>\n )}\n {(this.tree || state.customer) && (\n <hemfixarna-breadcrumbs isDemo={this.isDemo} loadFromQuery={this.loadFromQuery} closeModal={() => this.closeModal()} tree={this.tree} />\n )}\n {!state.customer || this.slugIsOldFormat(this.slug) ? (\n <div class={`hemfixarna_content hemfixarna_content--${state.step}`}>\n {/* // IF AT TOP LEVEL (step 1) */}\n {state.step === 1 && this.tree && <hemfixarna-start tree={this.tree} />}\n {/* // IF SELECTED CATEGORY (step 2) */}\n {state.step === 2 && state.selectedCategory && <hemfixarna-category />}\n {/* // IF SELECTED SERVICE (step 3) */}\n {state.step === 3 && state.selectedService && <hemfixarna-service />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && state.selectedProduct && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n ) : (\n <div class={`hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}`}>\n {state.step < 4 && <hemfixarna-start />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n )}\n </div>\n {!this.isDemo ? <div class={`hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}`}></div> : null}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
@@ -113,6 +113,14 @@
|
|
113
113
|
}
|
114
114
|
:host .hemfixarna_partnerlogo {
|
115
115
|
max-height: 50px;
|
116
|
+
min-height: 45px;
|
117
|
+
object-fit: contain;
|
118
|
+
max-width: 150px;
|
119
|
+
}
|
120
|
+
@media (min-width: 769px) {
|
121
|
+
:host .hemfixarna_partnerlogo {
|
122
|
+
max-width: 200px;
|
123
|
+
}
|
116
124
|
}
|
117
125
|
:host .hemfixarna_nav {
|
118
126
|
position: absolute;
|