hemfixarna-web-components 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hemfixarna-components/api-3228fe30.js +28 -0
- package/dist/hemfixarna-components/api-3228fe30.js.map +1 -0
- package/dist/hemfixarna-components/app-globals-0f993ce5.js.map +1 -1
- package/dist/hemfixarna-components/assets/back.svg +3 -0
- package/dist/hemfixarna-components/assets/cart.svg +10 -0
- package/dist/hemfixarna-components/assets/checked.svg +10 -0
- package/dist/hemfixarna-components/assets/close.svg +5 -0
- package/dist/hemfixarna-components/assets/date.svg +6 -0
- package/dist/hemfixarna-components/assets/down.svg +3 -0
- package/dist/hemfixarna-components/assets/info.svg +5 -0
- package/dist/hemfixarna-components/assets/minus.svg +4 -0
- package/dist/hemfixarna-components/assets/plus.svg +5 -0
- package/dist/hemfixarna-components/calc-a9ece205.js +85 -0
- package/dist/hemfixarna-components/calc-a9ece205.js.map +1 -0
- package/dist/hemfixarna-components/css-shim-62d2171c.js.map +1 -1
- package/dist/hemfixarna-components/dom-46a68c9b.js.map +1 -1
- package/dist/hemfixarna-components/hemfixarna-address.entry.js +52 -0
- package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-box.entry.js +35 -0
- package/dist/hemfixarna-components/hemfixarna-box.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js +40 -0
- package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js +3 -35
- package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js.map +1 -1
- package/dist/hemfixarna-components/hemfixarna-cart.entry.js +82 -0
- package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-category.entry.js +21 -0
- package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-checkout.entry.js +54 -0
- package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-component.entry.js +133 -0
- package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +3 -3
- package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
- package/dist/hemfixarna-components/{my-component.entry.js → hemfixarna-demo.entry.js} +19 -15
- package/dist/hemfixarna-components/hemfixarna-demo.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +410 -0
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-info.entry.js +25 -0
- package/dist/hemfixarna-components/hemfixarna-info.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-order.entry.js +24 -0
- package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-product.entry.js +121 -0
- package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +1 -0
- package/dist/hemfixarna-components/hemfixarna-service.entry.js +9 -139
- package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +1 -1
- package/dist/hemfixarna-components/hemfixarna-start.entry.js +18 -0
- package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +1 -0
- package/dist/hemfixarna-components/index-2bf8566c.js +12 -0
- package/dist/hemfixarna-components/index-2bf8566c.js.map +1 -0
- package/dist/hemfixarna-components/{index-06272934.js → index-59ed730c.js} +3 -3
- package/dist/hemfixarna-components/index-59ed730c.js.map +1 -0
- package/dist/hemfixarna-components/index-75ed3bb8.js +216 -0
- package/dist/hemfixarna-components/index-75ed3bb8.js.map +1 -0
- package/dist/hemfixarna-components/shadow-css-05e0c1f4.js.map +1 -1
- package/dist/types/components/hemfixarna-address/hemfixarna-address.d.ts +13 -0
- package/dist/types/components/hemfixarna-box/hemfixarna-box.d.ts +8 -0
- package/dist/types/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.d.ts +9 -0
- package/dist/types/components/hemfixarna-byggmax/hemfixarna-byggmax.d.ts +1 -7
- package/dist/types/components/hemfixarna-cart/hemfixarna-cart.d.ts +13 -0
- package/dist/types/components/hemfixarna-category.tsx/hemfixarna-category.d.ts +5 -0
- package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +10 -0
- package/dist/types/components/hemfixarna-component/hemfixarna-component.d.ts +19 -0
- package/dist/types/components/{my-component/my-component.d.ts → hemfixarna-demo/hemfixarna-demo.d.ts} +2 -1
- package/dist/types/components/hemfixarna-getuser/hemfixarna-getuser.d.ts +14 -0
- package/dist/types/components/hemfixarna-info/hemfixarna-info.d.ts +13 -0
- package/dist/types/components/hemfixarna-order/hemfixarna-order.d.ts +4 -0
- package/dist/types/components/hemfixarna-product/hemfixarna-product.d.ts +13 -0
- package/dist/types/components/hemfixarna-service/hemfixarna-service.d.ts +2 -39
- package/dist/types/components/hemfixarna-start/hemfixarna-start.d.ts +5 -0
- package/dist/types/components.d.ts +189 -21
- package/dist/types/store/index.d.ts +26 -0
- package/dist/types/types/index.d.ts +41 -1
- package/dist/types/utils/api.d.ts +4 -2
- package/dist/types/utils/calc.d.ts +18 -0
- package/dist/types/utils/felixFunctions.d.ts +21 -0
- package/package.json +10 -2
- package/dist/hemfixarna-components/api-609888bb.js +0 -18
- package/dist/hemfixarna-components/api-609888bb.js.map +0 -1
- package/dist/hemfixarna-components/index-06272934.js.map +0 -1
- package/dist/hemfixarna-components/my-component.entry.js.map +0 -1
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { Category
|
|
1
|
+
import { Category } from '../../types';
|
|
2
2
|
export declare class MyComponent {
|
|
3
|
-
category: Category | Service | null;
|
|
4
3
|
tree: Category | null;
|
|
5
|
-
/**
|
|
6
|
-
* Category slug
|
|
7
|
-
*/
|
|
8
4
|
slug: string;
|
|
9
|
-
fetchNewTaxonomy(newValue: string): Promise<void>;
|
|
10
|
-
componentWillLoad(): Promise<void>;
|
|
11
5
|
render(): any;
|
|
12
6
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CartItem, Category } from '../../types';
|
|
2
|
+
export declare class HemfixarnaCart {
|
|
3
|
+
tree: Category;
|
|
4
|
+
getItemPrice(item: CartItem): number;
|
|
5
|
+
getTotalPrice(): number;
|
|
6
|
+
goToProduct(id: number): void;
|
|
7
|
+
toggleRot(): void;
|
|
8
|
+
toggleRut(): void;
|
|
9
|
+
calculateRot(): number;
|
|
10
|
+
calculateRut(): number;
|
|
11
|
+
openMontering(): void;
|
|
12
|
+
render(): any;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class HemfixarnaCheckout {
|
|
2
|
+
date: string;
|
|
3
|
+
dateError: string | null;
|
|
4
|
+
termsError: string | null;
|
|
5
|
+
private el;
|
|
6
|
+
handleChangeDate: (e: Event) => void;
|
|
7
|
+
handleChangeTerms: () => void;
|
|
8
|
+
handleSubmit: (e: Event) => void;
|
|
9
|
+
render: () => any;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Business, Category, Product, Service, TopCategory } from '../../types';
|
|
2
|
+
export declare class HemfixarnaComponent {
|
|
3
|
+
modal: boolean;
|
|
4
|
+
showModal: boolean;
|
|
5
|
+
tree: Category | null;
|
|
6
|
+
product: Product | null;
|
|
7
|
+
private el;
|
|
8
|
+
slug: string;
|
|
9
|
+
business: Business;
|
|
10
|
+
topCategory: TopCategory;
|
|
11
|
+
fetchNewTaxonomy(newValue: string): Promise<void>;
|
|
12
|
+
componentWillLoad(): Promise<void>;
|
|
13
|
+
setTaxonomy(taxonomy: Category | Service | Product): void;
|
|
14
|
+
openModal(): void;
|
|
15
|
+
closeModal(): void;
|
|
16
|
+
handleClick(e: Event): void;
|
|
17
|
+
getCartLength(): number;
|
|
18
|
+
render(): any;
|
|
19
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Category } from '../../types';
|
|
1
|
+
import { Category, TopCategory } from '../../types';
|
|
2
2
|
export declare class MyComponent {
|
|
3
3
|
selectedSlug: string;
|
|
4
4
|
tooltipText: string;
|
|
5
5
|
tree: Category | null;
|
|
6
|
+
getTopLevelCategory(): "" | TopCategory.byggmax;
|
|
6
7
|
componentWillLoad(): Promise<void>;
|
|
7
8
|
getExample(): string;
|
|
8
9
|
copyExample(): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class HemfixarnaGetuser {
|
|
2
|
+
email: string;
|
|
3
|
+
emailError: string | null;
|
|
4
|
+
phone: string;
|
|
5
|
+
phoneError: string | null;
|
|
6
|
+
ssn: string;
|
|
7
|
+
ssnError: string | null;
|
|
8
|
+
componentWillLoad(): void;
|
|
9
|
+
handleChangeEmail: (e: Event) => void;
|
|
10
|
+
handleChangePhone: (e: Event) => void;
|
|
11
|
+
handleChangessn: (e: Event) => void;
|
|
12
|
+
handleSubmit: (e: Event) => void;
|
|
13
|
+
render: () => any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Part } from '../../types';
|
|
2
|
+
export declare class HemfixarnaProduct {
|
|
3
|
+
amount: number;
|
|
4
|
+
addProduct(): void;
|
|
5
|
+
removeProduct(): void;
|
|
6
|
+
addPart(part: Part): void;
|
|
7
|
+
removePart(part: Part): void;
|
|
8
|
+
goToCart(): void;
|
|
9
|
+
getAmount(): number;
|
|
10
|
+
getPartAmount(partId: number): number;
|
|
11
|
+
getTotalPrice(): number;
|
|
12
|
+
render(): any;
|
|
13
|
+
}
|
|
@@ -1,42 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class
|
|
3
|
-
modal: boolean;
|
|
4
|
-
showModal: boolean;
|
|
5
|
-
selectedCategory: Category | null;
|
|
6
|
-
selectedService: Service | null;
|
|
7
|
-
selectedProduct: Product | null;
|
|
8
|
-
amount: number;
|
|
9
|
-
selectedParts: Array<{
|
|
10
|
-
id: number;
|
|
11
|
-
amount: number;
|
|
12
|
-
}>;
|
|
13
|
-
cart: Array<{
|
|
14
|
-
id: number;
|
|
15
|
-
amount: number;
|
|
16
|
-
parts: Array<{
|
|
17
|
-
id: number;
|
|
18
|
-
amount: number;
|
|
19
|
-
}>;
|
|
20
|
-
}>;
|
|
21
|
-
step: number;
|
|
22
|
-
private el;
|
|
23
|
-
tree: Category | null;
|
|
24
|
-
taxonomy: Category | Service | Product | null;
|
|
25
|
-
componentWillLoad(): void;
|
|
26
|
-
setStartingState(): void;
|
|
27
|
-
setTaxonomy(): void;
|
|
28
|
-
openModal(): void;
|
|
29
|
-
closeModal(): void;
|
|
30
|
-
handleClick(e: Event): void;
|
|
31
|
-
setDefaultState(): void;
|
|
32
|
-
setSelectedCategory(category: Category): void;
|
|
33
|
-
setSelectedService(service: Service): void;
|
|
1
|
+
import { Product } from '../../types';
|
|
2
|
+
export declare class HemfixarnaService {
|
|
34
3
|
setSelectedProduct(product: Product): void;
|
|
35
|
-
setStep(step: number): void;
|
|
36
|
-
addPart(id: number): void;
|
|
37
|
-
removePart(id: number): void;
|
|
38
|
-
addProduct(): void;
|
|
39
|
-
removeProduct(): void;
|
|
40
|
-
addToCart(): void;
|
|
41
4
|
render(): any;
|
|
42
5
|
}
|
|
@@ -5,73 +5,241 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
import { Category, Product, Service } from "./types";
|
|
9
|
-
export { Category, Product, Service } from "./types";
|
|
8
|
+
import { Business, Category, Product, Service, TopCategory } from "./types";
|
|
9
|
+
export { Business, Category, Product, Service, TopCategory } from "./types";
|
|
10
10
|
export namespace Components {
|
|
11
|
+
interface HemfixarnaAddress {
|
|
12
|
+
}
|
|
13
|
+
interface HemfixarnaBox {
|
|
14
|
+
"icon": string;
|
|
15
|
+
"post": Category | Product | Service;
|
|
16
|
+
"postTitle": string;
|
|
17
|
+
}
|
|
18
|
+
interface HemfixarnaBreadcrumbs {
|
|
19
|
+
"closeModal": () => void;
|
|
20
|
+
"tree": Category;
|
|
21
|
+
}
|
|
11
22
|
interface HemfixarnaByggmax {
|
|
12
|
-
/**
|
|
13
|
-
* Category slug
|
|
14
|
-
*/
|
|
15
23
|
"slug": string;
|
|
16
24
|
}
|
|
25
|
+
interface HemfixarnaCart {
|
|
26
|
+
"tree": Category;
|
|
27
|
+
}
|
|
28
|
+
interface HemfixarnaCategory {
|
|
29
|
+
}
|
|
30
|
+
interface HemfixarnaCheckout {
|
|
31
|
+
}
|
|
32
|
+
interface HemfixarnaComponent {
|
|
33
|
+
"business": Business;
|
|
34
|
+
"slug": string;
|
|
35
|
+
"topCategory": TopCategory;
|
|
36
|
+
}
|
|
37
|
+
interface HemfixarnaDemo {
|
|
38
|
+
}
|
|
39
|
+
interface HemfixarnaGetuser {
|
|
40
|
+
}
|
|
41
|
+
interface HemfixarnaInfo {
|
|
42
|
+
"list"?: { trust_badge: string }[];
|
|
43
|
+
}
|
|
44
|
+
interface HemfixarnaOrder {
|
|
45
|
+
}
|
|
46
|
+
interface HemfixarnaProduct {
|
|
47
|
+
}
|
|
17
48
|
interface HemfixarnaService {
|
|
18
|
-
"taxonomy": Category | Service | Product | null;
|
|
19
|
-
"tree": Category | null;
|
|
20
49
|
}
|
|
21
|
-
interface
|
|
50
|
+
interface HemfixarnaStart {
|
|
51
|
+
"tree": Category;
|
|
22
52
|
}
|
|
23
53
|
}
|
|
24
54
|
declare global {
|
|
55
|
+
interface HTMLHemfixarnaAddressElement extends Components.HemfixarnaAddress, HTMLStencilElement {
|
|
56
|
+
}
|
|
57
|
+
var HTMLHemfixarnaAddressElement: {
|
|
58
|
+
prototype: HTMLHemfixarnaAddressElement;
|
|
59
|
+
new (): HTMLHemfixarnaAddressElement;
|
|
60
|
+
};
|
|
61
|
+
interface HTMLHemfixarnaBoxElement extends Components.HemfixarnaBox, HTMLStencilElement {
|
|
62
|
+
}
|
|
63
|
+
var HTMLHemfixarnaBoxElement: {
|
|
64
|
+
prototype: HTMLHemfixarnaBoxElement;
|
|
65
|
+
new (): HTMLHemfixarnaBoxElement;
|
|
66
|
+
};
|
|
67
|
+
interface HTMLHemfixarnaBreadcrumbsElement extends Components.HemfixarnaBreadcrumbs, HTMLStencilElement {
|
|
68
|
+
}
|
|
69
|
+
var HTMLHemfixarnaBreadcrumbsElement: {
|
|
70
|
+
prototype: HTMLHemfixarnaBreadcrumbsElement;
|
|
71
|
+
new (): HTMLHemfixarnaBreadcrumbsElement;
|
|
72
|
+
};
|
|
25
73
|
interface HTMLHemfixarnaByggmaxElement extends Components.HemfixarnaByggmax, HTMLStencilElement {
|
|
26
74
|
}
|
|
27
75
|
var HTMLHemfixarnaByggmaxElement: {
|
|
28
76
|
prototype: HTMLHemfixarnaByggmaxElement;
|
|
29
77
|
new (): HTMLHemfixarnaByggmaxElement;
|
|
30
78
|
};
|
|
79
|
+
interface HTMLHemfixarnaCartElement extends Components.HemfixarnaCart, HTMLStencilElement {
|
|
80
|
+
}
|
|
81
|
+
var HTMLHemfixarnaCartElement: {
|
|
82
|
+
prototype: HTMLHemfixarnaCartElement;
|
|
83
|
+
new (): HTMLHemfixarnaCartElement;
|
|
84
|
+
};
|
|
85
|
+
interface HTMLHemfixarnaCategoryElement extends Components.HemfixarnaCategory, HTMLStencilElement {
|
|
86
|
+
}
|
|
87
|
+
var HTMLHemfixarnaCategoryElement: {
|
|
88
|
+
prototype: HTMLHemfixarnaCategoryElement;
|
|
89
|
+
new (): HTMLHemfixarnaCategoryElement;
|
|
90
|
+
};
|
|
91
|
+
interface HTMLHemfixarnaCheckoutElement extends Components.HemfixarnaCheckout, HTMLStencilElement {
|
|
92
|
+
}
|
|
93
|
+
var HTMLHemfixarnaCheckoutElement: {
|
|
94
|
+
prototype: HTMLHemfixarnaCheckoutElement;
|
|
95
|
+
new (): HTMLHemfixarnaCheckoutElement;
|
|
96
|
+
};
|
|
97
|
+
interface HTMLHemfixarnaComponentElement extends Components.HemfixarnaComponent, HTMLStencilElement {
|
|
98
|
+
}
|
|
99
|
+
var HTMLHemfixarnaComponentElement: {
|
|
100
|
+
prototype: HTMLHemfixarnaComponentElement;
|
|
101
|
+
new (): HTMLHemfixarnaComponentElement;
|
|
102
|
+
};
|
|
103
|
+
interface HTMLHemfixarnaDemoElement extends Components.HemfixarnaDemo, HTMLStencilElement {
|
|
104
|
+
}
|
|
105
|
+
var HTMLHemfixarnaDemoElement: {
|
|
106
|
+
prototype: HTMLHemfixarnaDemoElement;
|
|
107
|
+
new (): HTMLHemfixarnaDemoElement;
|
|
108
|
+
};
|
|
109
|
+
interface HTMLHemfixarnaGetuserElement extends Components.HemfixarnaGetuser, HTMLStencilElement {
|
|
110
|
+
}
|
|
111
|
+
var HTMLHemfixarnaGetuserElement: {
|
|
112
|
+
prototype: HTMLHemfixarnaGetuserElement;
|
|
113
|
+
new (): HTMLHemfixarnaGetuserElement;
|
|
114
|
+
};
|
|
115
|
+
interface HTMLHemfixarnaInfoElement extends Components.HemfixarnaInfo, HTMLStencilElement {
|
|
116
|
+
}
|
|
117
|
+
var HTMLHemfixarnaInfoElement: {
|
|
118
|
+
prototype: HTMLHemfixarnaInfoElement;
|
|
119
|
+
new (): HTMLHemfixarnaInfoElement;
|
|
120
|
+
};
|
|
121
|
+
interface HTMLHemfixarnaOrderElement extends Components.HemfixarnaOrder, HTMLStencilElement {
|
|
122
|
+
}
|
|
123
|
+
var HTMLHemfixarnaOrderElement: {
|
|
124
|
+
prototype: HTMLHemfixarnaOrderElement;
|
|
125
|
+
new (): HTMLHemfixarnaOrderElement;
|
|
126
|
+
};
|
|
127
|
+
interface HTMLHemfixarnaProductElement extends Components.HemfixarnaProduct, HTMLStencilElement {
|
|
128
|
+
}
|
|
129
|
+
var HTMLHemfixarnaProductElement: {
|
|
130
|
+
prototype: HTMLHemfixarnaProductElement;
|
|
131
|
+
new (): HTMLHemfixarnaProductElement;
|
|
132
|
+
};
|
|
31
133
|
interface HTMLHemfixarnaServiceElement extends Components.HemfixarnaService, HTMLStencilElement {
|
|
32
134
|
}
|
|
33
135
|
var HTMLHemfixarnaServiceElement: {
|
|
34
136
|
prototype: HTMLHemfixarnaServiceElement;
|
|
35
137
|
new (): HTMLHemfixarnaServiceElement;
|
|
36
138
|
};
|
|
37
|
-
interface
|
|
139
|
+
interface HTMLHemfixarnaStartElement extends Components.HemfixarnaStart, HTMLStencilElement {
|
|
38
140
|
}
|
|
39
|
-
var
|
|
40
|
-
prototype:
|
|
41
|
-
new ():
|
|
141
|
+
var HTMLHemfixarnaStartElement: {
|
|
142
|
+
prototype: HTMLHemfixarnaStartElement;
|
|
143
|
+
new (): HTMLHemfixarnaStartElement;
|
|
42
144
|
};
|
|
43
145
|
interface HTMLElementTagNameMap {
|
|
146
|
+
"hemfixarna-address": HTMLHemfixarnaAddressElement;
|
|
147
|
+
"hemfixarna-box": HTMLHemfixarnaBoxElement;
|
|
148
|
+
"hemfixarna-breadcrumbs": HTMLHemfixarnaBreadcrumbsElement;
|
|
44
149
|
"hemfixarna-byggmax": HTMLHemfixarnaByggmaxElement;
|
|
150
|
+
"hemfixarna-cart": HTMLHemfixarnaCartElement;
|
|
151
|
+
"hemfixarna-category": HTMLHemfixarnaCategoryElement;
|
|
152
|
+
"hemfixarna-checkout": HTMLHemfixarnaCheckoutElement;
|
|
153
|
+
"hemfixarna-component": HTMLHemfixarnaComponentElement;
|
|
154
|
+
"hemfixarna-demo": HTMLHemfixarnaDemoElement;
|
|
155
|
+
"hemfixarna-getuser": HTMLHemfixarnaGetuserElement;
|
|
156
|
+
"hemfixarna-info": HTMLHemfixarnaInfoElement;
|
|
157
|
+
"hemfixarna-order": HTMLHemfixarnaOrderElement;
|
|
158
|
+
"hemfixarna-product": HTMLHemfixarnaProductElement;
|
|
45
159
|
"hemfixarna-service": HTMLHemfixarnaServiceElement;
|
|
46
|
-
"
|
|
160
|
+
"hemfixarna-start": HTMLHemfixarnaStartElement;
|
|
47
161
|
}
|
|
48
162
|
}
|
|
49
163
|
declare namespace LocalJSX {
|
|
164
|
+
interface HemfixarnaAddress {
|
|
165
|
+
}
|
|
166
|
+
interface HemfixarnaBox {
|
|
167
|
+
"icon"?: string;
|
|
168
|
+
"post"?: Category | Product | Service;
|
|
169
|
+
"postTitle"?: string;
|
|
170
|
+
}
|
|
171
|
+
interface HemfixarnaBreadcrumbs {
|
|
172
|
+
"closeModal"?: () => void;
|
|
173
|
+
"tree"?: Category;
|
|
174
|
+
}
|
|
50
175
|
interface HemfixarnaByggmax {
|
|
51
|
-
/**
|
|
52
|
-
* Category slug
|
|
53
|
-
*/
|
|
54
176
|
"slug"?: string;
|
|
55
177
|
}
|
|
178
|
+
interface HemfixarnaCart {
|
|
179
|
+
"tree"?: Category;
|
|
180
|
+
}
|
|
181
|
+
interface HemfixarnaCategory {
|
|
182
|
+
}
|
|
183
|
+
interface HemfixarnaCheckout {
|
|
184
|
+
}
|
|
185
|
+
interface HemfixarnaComponent {
|
|
186
|
+
"business"?: Business;
|
|
187
|
+
"slug"?: string;
|
|
188
|
+
"topCategory"?: TopCategory;
|
|
189
|
+
}
|
|
190
|
+
interface HemfixarnaDemo {
|
|
191
|
+
}
|
|
192
|
+
interface HemfixarnaGetuser {
|
|
193
|
+
}
|
|
194
|
+
interface HemfixarnaInfo {
|
|
195
|
+
"list"?: { trust_badge: string }[];
|
|
196
|
+
}
|
|
197
|
+
interface HemfixarnaOrder {
|
|
198
|
+
}
|
|
199
|
+
interface HemfixarnaProduct {
|
|
200
|
+
}
|
|
56
201
|
interface HemfixarnaService {
|
|
57
|
-
"taxonomy"?: Category | Service | Product | null;
|
|
58
|
-
"tree"?: Category | null;
|
|
59
202
|
}
|
|
60
|
-
interface
|
|
203
|
+
interface HemfixarnaStart {
|
|
204
|
+
"tree"?: Category;
|
|
61
205
|
}
|
|
62
206
|
interface IntrinsicElements {
|
|
207
|
+
"hemfixarna-address": HemfixarnaAddress;
|
|
208
|
+
"hemfixarna-box": HemfixarnaBox;
|
|
209
|
+
"hemfixarna-breadcrumbs": HemfixarnaBreadcrumbs;
|
|
63
210
|
"hemfixarna-byggmax": HemfixarnaByggmax;
|
|
211
|
+
"hemfixarna-cart": HemfixarnaCart;
|
|
212
|
+
"hemfixarna-category": HemfixarnaCategory;
|
|
213
|
+
"hemfixarna-checkout": HemfixarnaCheckout;
|
|
214
|
+
"hemfixarna-component": HemfixarnaComponent;
|
|
215
|
+
"hemfixarna-demo": HemfixarnaDemo;
|
|
216
|
+
"hemfixarna-getuser": HemfixarnaGetuser;
|
|
217
|
+
"hemfixarna-info": HemfixarnaInfo;
|
|
218
|
+
"hemfixarna-order": HemfixarnaOrder;
|
|
219
|
+
"hemfixarna-product": HemfixarnaProduct;
|
|
64
220
|
"hemfixarna-service": HemfixarnaService;
|
|
65
|
-
"
|
|
221
|
+
"hemfixarna-start": HemfixarnaStart;
|
|
66
222
|
}
|
|
67
223
|
}
|
|
68
224
|
export { LocalJSX as JSX };
|
|
69
225
|
declare module "@stencil/core" {
|
|
70
226
|
export namespace JSX {
|
|
71
227
|
interface IntrinsicElements {
|
|
228
|
+
"hemfixarna-address": LocalJSX.HemfixarnaAddress & JSXBase.HTMLAttributes<HTMLHemfixarnaAddressElement>;
|
|
229
|
+
"hemfixarna-box": LocalJSX.HemfixarnaBox & JSXBase.HTMLAttributes<HTMLHemfixarnaBoxElement>;
|
|
230
|
+
"hemfixarna-breadcrumbs": LocalJSX.HemfixarnaBreadcrumbs & JSXBase.HTMLAttributes<HTMLHemfixarnaBreadcrumbsElement>;
|
|
72
231
|
"hemfixarna-byggmax": LocalJSX.HemfixarnaByggmax & JSXBase.HTMLAttributes<HTMLHemfixarnaByggmaxElement>;
|
|
232
|
+
"hemfixarna-cart": LocalJSX.HemfixarnaCart & JSXBase.HTMLAttributes<HTMLHemfixarnaCartElement>;
|
|
233
|
+
"hemfixarna-category": LocalJSX.HemfixarnaCategory & JSXBase.HTMLAttributes<HTMLHemfixarnaCategoryElement>;
|
|
234
|
+
"hemfixarna-checkout": LocalJSX.HemfixarnaCheckout & JSXBase.HTMLAttributes<HTMLHemfixarnaCheckoutElement>;
|
|
235
|
+
"hemfixarna-component": LocalJSX.HemfixarnaComponent & JSXBase.HTMLAttributes<HTMLHemfixarnaComponentElement>;
|
|
236
|
+
"hemfixarna-demo": LocalJSX.HemfixarnaDemo & JSXBase.HTMLAttributes<HTMLHemfixarnaDemoElement>;
|
|
237
|
+
"hemfixarna-getuser": LocalJSX.HemfixarnaGetuser & JSXBase.HTMLAttributes<HTMLHemfixarnaGetuserElement>;
|
|
238
|
+
"hemfixarna-info": LocalJSX.HemfixarnaInfo & JSXBase.HTMLAttributes<HTMLHemfixarnaInfoElement>;
|
|
239
|
+
"hemfixarna-order": LocalJSX.HemfixarnaOrder & JSXBase.HTMLAttributes<HTMLHemfixarnaOrderElement>;
|
|
240
|
+
"hemfixarna-product": LocalJSX.HemfixarnaProduct & JSXBase.HTMLAttributes<HTMLHemfixarnaProductElement>;
|
|
73
241
|
"hemfixarna-service": LocalJSX.HemfixarnaService & JSXBase.HTMLAttributes<HTMLHemfixarnaServiceElement>;
|
|
74
|
-
"
|
|
242
|
+
"hemfixarna-start": LocalJSX.HemfixarnaStart & JSXBase.HTMLAttributes<HTMLHemfixarnaStartElement>;
|
|
75
243
|
}
|
|
76
244
|
}
|
|
77
245
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Business, CartItem, Category, Product, Service, WpOptions } from '../types';
|
|
2
|
+
type StateType = {
|
|
3
|
+
step: number;
|
|
4
|
+
selectedCategory: Category | null;
|
|
5
|
+
selectedService: Service | null;
|
|
6
|
+
selectedProduct: Product | null;
|
|
7
|
+
cart: Array<CartItem>;
|
|
8
|
+
business: Business | 'undefined';
|
|
9
|
+
options: WpOptions | null;
|
|
10
|
+
rut: boolean;
|
|
11
|
+
rot: boolean;
|
|
12
|
+
token: string | null;
|
|
13
|
+
checkoutStep: number;
|
|
14
|
+
checkoutEdit: boolean;
|
|
15
|
+
user: {
|
|
16
|
+
email: string;
|
|
17
|
+
phone: string;
|
|
18
|
+
ssn: string;
|
|
19
|
+
} | null;
|
|
20
|
+
modal: {
|
|
21
|
+
title: string;
|
|
22
|
+
text: string[];
|
|
23
|
+
} | null;
|
|
24
|
+
};
|
|
25
|
+
declare const state: StateType;
|
|
26
|
+
export default state;
|
|
@@ -23,6 +23,7 @@ interface Part {
|
|
|
23
23
|
post_mime_type: string;
|
|
24
24
|
comment_count: number;
|
|
25
25
|
filter: string;
|
|
26
|
+
price: number;
|
|
26
27
|
}
|
|
27
28
|
interface Product {
|
|
28
29
|
ID: number;
|
|
@@ -56,6 +57,11 @@ interface Product {
|
|
|
56
57
|
bullet: string;
|
|
57
58
|
}>;
|
|
58
59
|
terms: string;
|
|
60
|
+
terms_checkout: string;
|
|
61
|
+
terms_show_checkbox: boolean;
|
|
62
|
+
rut: boolean;
|
|
63
|
+
rot: boolean;
|
|
64
|
+
start_fee: boolean;
|
|
59
65
|
}
|
|
60
66
|
interface Service {
|
|
61
67
|
ID: 41857;
|
|
@@ -102,7 +108,41 @@ interface Category {
|
|
|
102
108
|
sub_cats?: Array<Category>;
|
|
103
109
|
services?: Array<Service>;
|
|
104
110
|
}
|
|
111
|
+
interface WpOptions {
|
|
112
|
+
link: {
|
|
113
|
+
title: string;
|
|
114
|
+
url: string;
|
|
115
|
+
};
|
|
116
|
+
trust: {
|
|
117
|
+
trust_badge: string;
|
|
118
|
+
}[];
|
|
119
|
+
thank_you_image: string;
|
|
120
|
+
start_fee: number;
|
|
121
|
+
terms: string;
|
|
122
|
+
}
|
|
123
|
+
interface CartPart {
|
|
124
|
+
id: number;
|
|
125
|
+
amount: number;
|
|
126
|
+
price: number;
|
|
127
|
+
name: string;
|
|
128
|
+
}
|
|
129
|
+
interface CartItem {
|
|
130
|
+
id: number;
|
|
131
|
+
price: number;
|
|
132
|
+
name: string;
|
|
133
|
+
amount: number;
|
|
134
|
+
parts: CartPart[];
|
|
135
|
+
rut: boolean;
|
|
136
|
+
rot: boolean;
|
|
137
|
+
start_fee: boolean;
|
|
138
|
+
terms_checkout: string;
|
|
139
|
+
terms_show_checkbox: boolean;
|
|
140
|
+
icon?: string;
|
|
141
|
+
}
|
|
105
142
|
export declare enum Business {
|
|
106
143
|
byggmax = "byggmax"
|
|
107
144
|
}
|
|
108
|
-
export
|
|
145
|
+
export declare enum TopCategory {
|
|
146
|
+
byggmax = "category/bygg"
|
|
147
|
+
}
|
|
148
|
+
export type { Category, Product, Service, Part, WpOptions, CartItem, CartPart };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { WpOptions } from '../types';
|
|
2
|
+
declare const getTaxonomy: (endpoint: string) => Promise<any>;
|
|
3
|
+
declare const getOptions: () => Promise<WpOptions>;
|
|
4
|
+
export { getTaxonomy, getOptions };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CartItem, CartPart, Part, Product } from '../types';
|
|
2
|
+
declare const getRutPrice: (price: number) => number;
|
|
3
|
+
declare const getRotPrice: (price: number) => number;
|
|
4
|
+
declare const getRutStartFee: () => number;
|
|
5
|
+
declare const getRotStartFee: () => number;
|
|
6
|
+
declare const getProductPrice: (product: Product | CartItem, price?: number, amount?: number) => number;
|
|
7
|
+
declare const getProductPriceWithRotAndRut: (product: Product) => number;
|
|
8
|
+
declare const getPartPrice: (part: Part | CartPart, product: Product | CartItem, amount?: number) => number;
|
|
9
|
+
declare const getStartFee: () => {
|
|
10
|
+
rut: number;
|
|
11
|
+
rot: number;
|
|
12
|
+
length?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
rut: number;
|
|
15
|
+
rot: number;
|
|
16
|
+
length: number;
|
|
17
|
+
};
|
|
18
|
+
export { getProductPriceWithRotAndRut, getProductPrice, getRotPrice, getRutPrice, getRotStartFee, getRutStartFee, getPartPrice, getStartFee };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface Product {
|
|
2
|
+
[index: number]: string;
|
|
3
|
+
}
|
|
4
|
+
interface Service {
|
|
5
|
+
[index: number]: string;
|
|
6
|
+
}
|
|
7
|
+
declare function initializeFelix(): Promise<string>;
|
|
8
|
+
declare function sendPerson(data: {
|
|
9
|
+
products: Product[];
|
|
10
|
+
serviceArr: Service[];
|
|
11
|
+
}): Promise<string | false>;
|
|
12
|
+
declare function checkPerson(ssn: string, url: string): Promise<string | null>;
|
|
13
|
+
declare function getPersonData(id: string): Promise<any>;
|
|
14
|
+
declare function updatePerson(data: {
|
|
15
|
+
products: Product[];
|
|
16
|
+
serviceArr: Service[];
|
|
17
|
+
recievedChanged: boolean;
|
|
18
|
+
}, id: string): Promise<string | false>;
|
|
19
|
+
declare function findPricing(data: string): Promise<any>;
|
|
20
|
+
declare function processPassageRecords(data: string): Promise<any>;
|
|
21
|
+
export { initializeFelix, sendPerson, checkPerson, getPersonData, updatePerson, findPricing, processPassageRecords };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hemfixarna-web-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"author": "Afonso <info@afonso.se> (http://afonso.se)",
|
|
5
5
|
"description": "Web components to integrate with hemfixarna api",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -27,11 +27,19 @@
|
|
|
27
27
|
"generate": "stencil generate"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@jumpgroup/stencil-env": "^0.0.1",
|
|
30
31
|
"@stencil/core": "^3.0.0",
|
|
31
32
|
"@stencil/sass": "^3.0.1",
|
|
32
|
-
"
|
|
33
|
+
"@types/react": "^18.2.21",
|
|
34
|
+
"axios": "^1.5.0",
|
|
35
|
+
"buffer": "^6.0.3",
|
|
36
|
+
"personnummer": "^3.2.1",
|
|
37
|
+
"react": "^18.2.0",
|
|
38
|
+
"rollup-plugin-dotenv": "^0.4.1",
|
|
39
|
+
"rollup-plugin-node-polyfills": "^0.2.1"
|
|
33
40
|
},
|
|
34
41
|
"devDependencies": {
|
|
42
|
+
"@stencil/store": "^2.0.9",
|
|
35
43
|
"@types/jest": "^27.5.2",
|
|
36
44
|
"@types/node": "^20.1.0",
|
|
37
45
|
"jest": "^27.5.1",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const getTaxonomy = async (string) => {
|
|
2
|
-
if (!string) {
|
|
3
|
-
return;
|
|
4
|
-
}
|
|
5
|
-
const type = string.split('/')[0];
|
|
6
|
-
const slug = string.split('/')[1];
|
|
7
|
-
try {
|
|
8
|
-
const res = await fetch(`https://hemfixare.dev.afonso.se/wp-json/headless/${type}/${slug}`);
|
|
9
|
-
return await res.json();
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
12
|
-
console.log(error);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { getTaxonomy as g };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=api-609888bb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"api-609888bb.js","mappings":"MAAM,WAAW,GAAG,OAAO,MAAc;EACvC,IAAI,CAAC,MAAM,EAAE;IACX,OAAO;GACR;EACD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;EAClC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;EAClC,IAAI;IACF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,oDAAoD,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IAC5F,OAAO,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;GACzB;EAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;GACpB;AACH;;;;","names":[],"sources":["./src/utils/api.ts"],"sourcesContent":["const getTaxonomy = async (string: string) => {\n if (!string) {\n return;\n }\n const type = string.split('/')[0];\n const slug = string.split('/')[1];\n try {\n const res = await fetch(`https://hemfixare.dev.afonso.se/wp-json/headless/${type}/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nexport { getTaxonomy };\n"],"version":3}
|