favesalon-embed 1.0.3 → 1.0.4
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/{favesalon-embed/_commonjsHelpers-9bc404fc.js → cjs/_commonjsHelpers-5cfcba41.js} +6 -14
- package/dist/cjs/chat-box_5.cjs.entry.js +17439 -0
- package/dist/cjs/chat-button.cjs.entry.js +55 -0
- package/dist/cjs/colors-38421769.js +69 -0
- package/dist/cjs/favesalon-embed.cjs.js +23 -0
- package/dist/cjs/google-map.cjs.entry.js +52 -0
- package/dist/{favesalon-embed/index-ac52896a.js → cjs/index-7f190886.js} +47 -454
- package/dist/cjs/index-dd8176c4.js +1531 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/cjs/relativeTime-3721080d.js +9 -0
- package/dist/cjs/salon-booking-modal.cjs.entry.js +30 -0
- package/dist/cjs/salon-booking.cjs.entry.js +51 -0
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
- package/dist/cjs/salon-gift-card.cjs.entry.js +51 -0
- package/dist/cjs/salon-info.cjs.entry.js +33 -0
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
- package/dist/cjs/salon-latest-styles_3.cjs.entry.js +241 -0
- package/dist/cjs/salon-lookbook.cjs.entry.js +222 -0
- package/dist/cjs/salon-ranking.cjs.entry.js +60 -0
- package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
- package/dist/cjs/salon-services.cjs.entry.js +81 -0
- package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
- package/dist/{favesalon-embed/services-7cb8f2a6.js → cjs/services-d1bdf299.js} +55 -2415
- package/dist/cjs/style-detail.cjs.entry.js +312 -0
- package/dist/cjs/utils-c5a33b3c.js +23 -0
- package/dist/collection/collection-manifest.json +33 -0
- package/dist/collection/components/chat-box/index.css +105 -0
- package/dist/collection/components/chat-box/index.js +138 -0
- package/dist/collection/components/chat-button/index.css +101 -0
- package/dist/collection/components/chat-button/index.js +155 -0
- package/dist/collection/components/chat-form/index.css +40 -0
- package/dist/collection/components/chat-form/index.js +79 -0
- package/dist/collection/components/chat-messages/index.css +48 -0
- package/dist/collection/components/chat-messages/index.js +142 -0
- package/dist/collection/components/chat-rooms/index.css +102 -0
- package/dist/collection/components/chat-rooms/index.js +157 -0
- package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
- package/dist/collection/components/google-map/index.css +5 -0
- package/dist/collection/components/google-map/index.js +90 -0
- package/dist/collection/components/salon-booking/index.css +30 -0
- package/dist/collection/components/salon-booking/index.js +126 -0
- package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
- package/dist/collection/components/salon-gift-card/index.css +30 -0
- package/dist/collection/components/salon-gift-card/index.js +126 -0
- package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
- package/dist/collection/components/salon-info/index.css +1 -0
- package/dist/collection/components/salon-info/index.js +77 -0
- package/dist/collection/components/salon-latest-reviews/index.css +11 -0
- package/dist/collection/components/salon-latest-reviews/index.js +163 -0
- package/dist/collection/components/salon-latest-styles/index.css +12 -0
- package/dist/{favesalon-embed/salon-latest-styles.entry.js → collection/components/salon-latest-styles/index.js} +99 -14
- package/dist/collection/components/salon-locations/index.css +24 -0
- package/dist/{favesalon-embed/salon-locations.entry.js → collection/components/salon-locations/index.js} +95 -15
- package/dist/collection/components/salon-lookbook/index.css +15 -0
- package/dist/collection/components/salon-lookbook/index.js +368 -0
- package/dist/collection/components/salon-ranking/index.css +3 -0
- package/dist/collection/components/salon-ranking/index.js +117 -0
- package/dist/collection/components/salon-reviews/index.css +18 -0
- package/dist/collection/components/salon-reviews/index.js +249 -0
- package/dist/collection/components/salon-schedules/index.css +18 -0
- package/dist/{favesalon-embed/salon-schedules.entry.js → collection/components/salon-schedules/index.js} +95 -14
- package/dist/collection/components/salon-services/index.css +1 -0
- package/dist/collection/components/salon-services/index.js +146 -0
- package/dist/collection/components/salon-stylists/index.css +43 -0
- package/dist/collection/components/salon-stylists/index.js +184 -0
- package/dist/collection/components/style-detail/index.css +76 -0
- package/dist/collection/components/style-detail/index.js +386 -0
- package/dist/collection/components/user-avatar/index.css +0 -0
- package/dist/collection/components/user-avatar/index.js +159 -0
- package/dist/collection/constants/colors.js +65 -0
- package/dist/collection/global/global.js +0 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/mocks/users.js +10 -0
- package/dist/collection/services/services.js +295 -0
- package/dist/collection/types/chat.js +23 -0
- package/dist/collection/types/common.js +11 -0
- package/dist/collection/types/review.js +39 -0
- package/dist/collection/types/salon.js +58 -0
- package/dist/collection/types/service.js +24 -0
- package/dist/collection/types/style.js +128 -0
- package/dist/collection/types/stylist.js +30 -0
- package/dist/collection/types/user.js +10 -0
- package/dist/collection/utils/utils.js +23 -0
- package/dist/custom-elements/index.js +44974 -0
- package/dist/{favesalon-embed/_commonjsHelpers-a4f66ccd.js → esm/_commonjsHelpers-66ac50f5.js} +2 -14
- package/dist/{favesalon-embed/chat-rooms.entry.js → esm/chat-box_5.entry.js} +182 -30
- package/dist/{favesalon-embed → esm}/chat-button.entry.js +3 -3
- package/dist/esm/favesalon-embed.js +18 -0
- package/dist/{favesalon-embed → esm}/google-map.entry.js +1 -1
- package/dist/esm/index-0494771f.js +1504 -0
- package/dist/{favesalon-embed/index-00b83e1c.js → esm/index-a1c7583c.js} +15 -425
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/relativeTime-baa50aa2.js +7 -0
- package/dist/{favesalon-embed → esm}/salon-booking-modal.entry.js +1 -1
- package/dist/{favesalon-embed → esm}/salon-booking.entry.js +3 -3
- package/dist/{favesalon-embed → esm}/salon-gift-card-modal.entry.js +1 -1
- package/dist/{favesalon-embed → esm}/salon-gift-card.entry.js +3 -3
- package/dist/{favesalon-embed → esm}/salon-info.entry.js +3 -3
- package/dist/{favesalon-embed → esm}/salon-latest-reviews.entry.js +4 -4
- package/dist/esm/salon-latest-styles_3.entry.js +235 -0
- package/dist/{favesalon-embed → esm}/salon-lookbook.entry.js +3 -3
- package/dist/{favesalon-embed → esm}/salon-ranking.entry.js +1 -1
- package/dist/{favesalon-embed → esm}/salon-reviews.entry.js +3 -3
- package/dist/{favesalon-embed → esm}/salon-services.entry.js +3 -3
- package/dist/{favesalon-embed → esm}/salon-stylists.entry.js +3 -3
- package/dist/{favesalon-embed/services-7c46a2fd.js → esm/services-257442e2.js} +99 -2467
- package/dist/{favesalon-embed → esm}/style-detail.entry.js +4 -4
- package/dist/{favesalon-embed/utils-2c19db45.js → esm/utils-e97485e0.js} +0 -6
- package/dist/favesalon-embed/favesalon-embed.css +1 -2439
- package/dist/favesalon-embed/favesalon-embed.esm.js +1 -148
- package/dist/favesalon-embed/index.esm.js +0 -1
- package/dist/favesalon-embed/p-05a1c88a.entry.js +1 -0
- package/dist/favesalon-embed/p-0acf0447.entry.js +1 -0
- package/dist/favesalon-embed/p-0bc4f624.js +1 -0
- package/dist/favesalon-embed/p-1af1515f.entry.js +1 -0
- package/dist/favesalon-embed/p-1cba5fc9.entry.js +1 -0
- package/dist/favesalon-embed/p-39a4ef15.entry.js +1 -0
- package/dist/favesalon-embed/p-3e2cb05b.entry.js +1 -0
- package/dist/favesalon-embed/p-47e646f8.js +1 -0
- package/dist/favesalon-embed/p-487b311f.entry.js +1 -0
- package/dist/favesalon-embed/p-55387c2f.entry.js +1 -0
- package/dist/favesalon-embed/p-566f05b4.entry.js +1 -0
- package/dist/favesalon-embed/p-862a0de0.entry.js +1 -0
- package/dist/favesalon-embed/p-9fe0cbeb.js +2 -0
- package/dist/favesalon-embed/p-a33331cc.js +1 -0
- package/dist/favesalon-embed/p-aeeb7b5f.entry.js +1 -0
- package/dist/favesalon-embed/p-b08e5b54.js +6 -0
- package/dist/favesalon-embed/p-b5cca5fc.entry.js +1 -0
- package/dist/favesalon-embed/p-c7fb7af5.js +1580 -0
- package/dist/favesalon-embed/p-ccab56d8.js +1 -0
- package/dist/favesalon-embed/p-d6e13053.entry.js +1 -0
- package/dist/favesalon-embed/p-dee42d34.entry.js +1 -0
- package/dist/favesalon-embed/p-e661ca1d.entry.js +1 -0
- package/dist/favesalon-embed/p-eeceab9c.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/favesalon-embed/app-globals-437cc3f3.js +0 -712
- package/dist/favesalon-embed/app-globals-60769a2c.js +0 -712
- package/dist/favesalon-embed/chat-box.entry.js +0 -54
- package/dist/favesalon-embed/chat-form.entry.js +0 -39
- package/dist/favesalon-embed/chat-messages.entry.js +0 -53
- package/dist/favesalon-embed/css-shim-b7d3d95f.js +0 -4
- package/dist/favesalon-embed/dom-64053c71.js +0 -73
- package/dist/favesalon-embed/index-04c09911.js +0 -3371
- package/dist/favesalon-embed/index-888e99e3.js +0 -3371
- package/dist/favesalon-embed/isObject-13b86c17.js +0 -203
- package/dist/favesalon-embed/relativeTime-15477f02.js +0 -7
- package/dist/favesalon-embed/relativeTime-268e64b0.js +0 -7
- package/dist/favesalon-embed/services-55a87166.js +0 -23655
- package/dist/favesalon-embed/shadow-css-98135883.js +0 -387
- package/dist/favesalon-embed/user-avatar.entry.js +0 -50
- /package/dist/{favesalon-embed → esm}/colors-ea36347a.js +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { debounce, last } from 'lodash';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { Colors } from '../../constants/colors';
|
|
4
|
+
export class ChatRooms {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.clickRoom = (chatRoom) => {
|
|
7
|
+
this.onClickRoom(chatRoom);
|
|
8
|
+
};
|
|
9
|
+
this.onSearchRooms = debounce((keyword) => {
|
|
10
|
+
this.keyword = keyword;
|
|
11
|
+
}, 500);
|
|
12
|
+
this.renderChatRoom = (chatRoom, index) => {
|
|
13
|
+
const { uid, members, messages } = chatRoom;
|
|
14
|
+
const receiverUser = members.find(user => user.id !== this.senderId);
|
|
15
|
+
const isActiveRoom = (this.activeRoom || {}).uid === uid;
|
|
16
|
+
let unreadMessages = 0;
|
|
17
|
+
const lastMessage = last(messages || []);
|
|
18
|
+
(messages || []).forEach(message => {
|
|
19
|
+
if (Boolean(message.unRead) && message.senderId !== this.senderId) {
|
|
20
|
+
unreadMessages += 1;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return (h("div", { key: `chat-room--${uid}-${index}`, class: `chat-room ${isActiveRoom ? 'is-active' : ''}`, onClick: () => !isActiveRoom && this.clickRoom(chatRoom) }, h("div", { class: "chat-room--user" }, h("user-avatar", { size: 48, avatar: receiverUser.avatar, name: h("div", { class: "chat-room--user-name" }, receiverUser.fullName), description: lastMessage && (h("div", { class: "chat-room--latest-message" }, lastMessage.senderId === this.senderId ? 'You: ' : '', lastMessage.message)), shortName: String(receiverUser.fullName || '').charAt(0) })), unreadMessages > 0 && (h("div", { class: "chat-room--user-indicator" }))));
|
|
24
|
+
};
|
|
25
|
+
this.senderId = undefined;
|
|
26
|
+
this.chatRooms = undefined;
|
|
27
|
+
this.activeRoom = undefined;
|
|
28
|
+
this.onClickRoom = undefined;
|
|
29
|
+
this.keyword = undefined;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const visibleRooms = (this.chatRooms || []).filter(chatRoom => {
|
|
33
|
+
if (this.keyword) {
|
|
34
|
+
const receiverUser = chatRoom.members.find(user => user.id !== this.senderId);
|
|
35
|
+
return String(receiverUser.fullName).toLowerCase().indexOf(String(this.keyword).toLowerCase()) > -1;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
});
|
|
39
|
+
return (h("div", { class: "chat-rooms" }, h("div", { class: "chat-rooms--search" }, h("input", { autoComplete: "off", placeholder: "Enter a name...", onInput: evt => this.onSearchRooms(evt.target.value) })), h("div", { class: "chat-rooms--list" }, !this.chatRooms && [1, 2, 3, 4].map(fakeId => (h("div", { key: `chat-room--${fakeId}`, class: "chat-room" }, h("div", { class: "chat-room--user" }, h("div", { style: { display: "flex", alignItems: "center" } }, h("div", { style: {
|
|
40
|
+
backgroundColor: Colors.Gray02,
|
|
41
|
+
borderRadius: '50%',
|
|
42
|
+
height: `48px`,
|
|
43
|
+
width: `48px`,
|
|
44
|
+
minWidth: `48px`,
|
|
45
|
+
} }), h("div", { style: {
|
|
46
|
+
flexShrink: '1',
|
|
47
|
+
flexGrow: '1',
|
|
48
|
+
marginLeft: '12px',
|
|
49
|
+
} }, h("div", { style: {
|
|
50
|
+
backgroundColor: Colors.Gray02,
|
|
51
|
+
height: '16px',
|
|
52
|
+
width: '30%',
|
|
53
|
+
} }), h("div", { style: {
|
|
54
|
+
backgroundColor: Colors.Gray01,
|
|
55
|
+
marginTop: '12px',
|
|
56
|
+
height: '16px',
|
|
57
|
+
width: '60%',
|
|
58
|
+
} }))))))), this.chatRooms && visibleRooms.length > 0 && visibleRooms.map(this.renderChatRoom), this.chatRooms && visibleRooms.length === 0 && (h("div", { style: { color: Colors.Gray04, padding: '64px 24px', textAlign: 'center' } }, "No available users")))));
|
|
59
|
+
}
|
|
60
|
+
static get is() { return "chat-rooms"; }
|
|
61
|
+
static get originalStyleUrls() {
|
|
62
|
+
return {
|
|
63
|
+
"$": ["index.css"]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static get styleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["index.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get properties() {
|
|
72
|
+
return {
|
|
73
|
+
"senderId": {
|
|
74
|
+
"type": "number",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "number",
|
|
78
|
+
"resolved": "number",
|
|
79
|
+
"references": {}
|
|
80
|
+
},
|
|
81
|
+
"required": false,
|
|
82
|
+
"optional": false,
|
|
83
|
+
"docs": {
|
|
84
|
+
"tags": [],
|
|
85
|
+
"text": ""
|
|
86
|
+
},
|
|
87
|
+
"attribute": "sender-id",
|
|
88
|
+
"reflect": false
|
|
89
|
+
},
|
|
90
|
+
"chatRooms": {
|
|
91
|
+
"type": "unknown",
|
|
92
|
+
"mutable": false,
|
|
93
|
+
"complexType": {
|
|
94
|
+
"original": "ChatRoom[]",
|
|
95
|
+
"resolved": "ChatRoom[]",
|
|
96
|
+
"references": {
|
|
97
|
+
"ChatRoom": {
|
|
98
|
+
"location": "import",
|
|
99
|
+
"path": "../../types/chat"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"required": false,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": ""
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"activeRoom": {
|
|
111
|
+
"type": "unknown",
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "ChatRoom",
|
|
115
|
+
"resolved": "ChatRoom",
|
|
116
|
+
"references": {
|
|
117
|
+
"ChatRoom": {
|
|
118
|
+
"location": "import",
|
|
119
|
+
"path": "../../types/chat"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": ""
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"onClickRoom": {
|
|
131
|
+
"type": "unknown",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "(chatRoom: ChatRoom) => void",
|
|
135
|
+
"resolved": "(chatRoom: ChatRoom) => void",
|
|
136
|
+
"references": {
|
|
137
|
+
"ChatRoom": {
|
|
138
|
+
"location": "import",
|
|
139
|
+
"path": "../../types/chat"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": ""
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
static get states() {
|
|
153
|
+
return {
|
|
154
|
+
"keyword": {}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { getAssetPath, h } from '@stencil/core';
|
|
2
|
+
import { Colors } from '../../constants/colors';
|
|
3
|
+
export class GoogleMap {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.locationName = undefined;
|
|
6
|
+
this.locationAddress = undefined;
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
const mapPlaceholder = getAssetPath('./assets/map--placeholder.jpeg');
|
|
10
|
+
return (h("div", { style: {
|
|
11
|
+
backgroundImage: `url("${mapPlaceholder}")`,
|
|
12
|
+
backgroundColor: Colors.Gray01,
|
|
13
|
+
backgroundPosition: 'center center',
|
|
14
|
+
backgroundRepeat: 'no-repeat',
|
|
15
|
+
backgroundSize: 'cover',
|
|
16
|
+
borderRadius: '8px',
|
|
17
|
+
position: 'relative',
|
|
18
|
+
height: '296px',
|
|
19
|
+
} }, h("div", { style: {
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
left: '50%',
|
|
22
|
+
top: '50%',
|
|
23
|
+
transform: 'translate(-50%, -50%)',
|
|
24
|
+
} }, h("a", { target: "_blank", rel: "noopener noreferrer", href: `https://www.google.com/maps/search/?api=1&query=${this.locationAddress}`, style: {
|
|
25
|
+
backgroundColor: Colors.Red01,
|
|
26
|
+
border: `1px solid ${Colors.Red02}`,
|
|
27
|
+
borderRadius: '4px',
|
|
28
|
+
color: Colors.TextColor,
|
|
29
|
+
padding: '12px',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexWrap: 'wrap',
|
|
32
|
+
height: 'auto',
|
|
33
|
+
width: 'auto',
|
|
34
|
+
whiteSpace: 'normal',
|
|
35
|
+
textAlign: 'left',
|
|
36
|
+
maxWidth: '320px',
|
|
37
|
+
textDecoration: 'none',
|
|
38
|
+
} }, this.locationName && h("span", { style: { fontSize: '16px', marginBottom: '4px' } }, this.locationName), this.locationAddress && h("span", { style: { fontSize: '12px' } }, this.locationAddress)), h("div", { style: { marginTop: '8px', textAlign: 'center' } }, h("i", { class: "ri-map-pin-fill", style: { fontSize: '24px' } })))));
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "google-map"; }
|
|
41
|
+
static get originalStyleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["index.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get styleUrls() {
|
|
47
|
+
return {
|
|
48
|
+
"$": ["index.css"]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
static get assetsDirs() { return ["assets"]; }
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
"locationName": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "string",
|
|
59
|
+
"resolved": "string",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": true,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": ""
|
|
67
|
+
},
|
|
68
|
+
"attribute": "location-name",
|
|
69
|
+
"reflect": false
|
|
70
|
+
},
|
|
71
|
+
"locationAddress": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": true,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": ""
|
|
84
|
+
},
|
|
85
|
+
"attribute": "location-address",
|
|
86
|
+
"reflect": false
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.salon-modal.salon-modal--booking:before {
|
|
2
|
+
display: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.salon-modal.salon-modal--booking .salon-modal--inner,
|
|
6
|
+
.salon-modal.salon-modal--booking .salon-modal--content {
|
|
7
|
+
max-width: none;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.salon-modal.salon-modal--booking .salon-modal--close {
|
|
13
|
+
background-color: #EFEFEF;
|
|
14
|
+
width: 40px;
|
|
15
|
+
height: 40px;
|
|
16
|
+
right: 16px;
|
|
17
|
+
top: 16px;
|
|
18
|
+
|
|
19
|
+
-moz-border-radius: 50px;
|
|
20
|
+
-webkit-border-radius: 50px;
|
|
21
|
+
border-radius: 50px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@media (min-width: 768px) {
|
|
26
|
+
.salon-modal.salon-modal--booking .salon-modal--close {
|
|
27
|
+
right: 20px;
|
|
28
|
+
top: 20px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import Color from 'color';
|
|
3
|
+
import { css } from 'glamor';
|
|
4
|
+
import { Colors } from '../../constants/colors';
|
|
5
|
+
export class SalonBooking {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.salonId = undefined;
|
|
8
|
+
this.buttonClass = '';
|
|
9
|
+
this.buttonText = 'Book now';
|
|
10
|
+
this.primaryColor = Colors.Primary;
|
|
11
|
+
}
|
|
12
|
+
openModal() {
|
|
13
|
+
const elBookingModal = document.createElement('div');
|
|
14
|
+
elBookingModal.innerHTML = `
|
|
15
|
+
<salon-booking-modal
|
|
16
|
+
salon-id=${this.salonId}
|
|
17
|
+
primary-color=${this.primaryColor}
|
|
18
|
+
></salon-booking-modal>
|
|
19
|
+
`;
|
|
20
|
+
document.body.appendChild(elBookingModal);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const buttonClass = this.buttonClass || 'btn btn-primary';
|
|
24
|
+
let buttonStyle = {};
|
|
25
|
+
if (!this.buttonClass) {
|
|
26
|
+
const primaryColor = Color(this.primaryColor);
|
|
27
|
+
const primaryColorHover = primaryColor.darken(0.05);
|
|
28
|
+
buttonStyle = css({
|
|
29
|
+
backgroundColor: this.primaryColor,
|
|
30
|
+
borderColor: this.primaryColor,
|
|
31
|
+
color: primaryColor.isLight() ? Colors.Black01 : Colors.White,
|
|
32
|
+
':hover': {
|
|
33
|
+
backgroundColor: primaryColorHover,
|
|
34
|
+
borderColor: primaryColorHover,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return (h("div", { class: "salon-booking" }, h("div", { class: "salon-booking--button" }, h("button", Object.assign({ type: "button", class: buttonClass, onClick: () => this.openModal() }, buttonStyle), this.buttonText))));
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "salon-booking"; }
|
|
41
|
+
static get originalStyleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["index.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get styleUrls() {
|
|
47
|
+
return {
|
|
48
|
+
"$": ["index.css"]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
static get properties() {
|
|
52
|
+
return {
|
|
53
|
+
"salonId": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "number",
|
|
58
|
+
"resolved": "number",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": ""
|
|
66
|
+
},
|
|
67
|
+
"attribute": "salon-id",
|
|
68
|
+
"reflect": false
|
|
69
|
+
},
|
|
70
|
+
"buttonClass": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"mutable": false,
|
|
73
|
+
"complexType": {
|
|
74
|
+
"original": "string",
|
|
75
|
+
"resolved": "string",
|
|
76
|
+
"references": {}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": false,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
},
|
|
84
|
+
"attribute": "button-class",
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"defaultValue": "''"
|
|
87
|
+
},
|
|
88
|
+
"buttonText": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "string",
|
|
93
|
+
"resolved": "string",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": ""
|
|
101
|
+
},
|
|
102
|
+
"attribute": "button-text",
|
|
103
|
+
"reflect": false,
|
|
104
|
+
"defaultValue": "'Book now'"
|
|
105
|
+
},
|
|
106
|
+
"primaryColor": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "string",
|
|
111
|
+
"resolved": "string",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": ""
|
|
119
|
+
},
|
|
120
|
+
"attribute": "primary-color",
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"defaultValue": "Colors.Primary"
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { Colors } from '../../constants/colors';
|
|
3
|
+
export class SalonBookingModal {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.salonId = undefined;
|
|
6
|
+
this.primaryColor = Colors.Primary;
|
|
7
|
+
this.redirectUrl = window.btoa(window.location.href);
|
|
8
|
+
this.isModalOpen = true;
|
|
9
|
+
}
|
|
10
|
+
closeModal() {
|
|
11
|
+
this.isModalOpen = false;
|
|
12
|
+
const el = document.querySelector('salon-booking-modal');
|
|
13
|
+
el.remove();
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
|
|
17
|
+
return (h("div", { class: "salon-booking--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--booking" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/booking?salonId=${this.salonId}&primaryColor=${primaryColor}&closeAble=false` })))))));
|
|
18
|
+
}
|
|
19
|
+
static get is() { return "salon-booking-modal"; }
|
|
20
|
+
static get originalStyleUrls() {
|
|
21
|
+
return {
|
|
22
|
+
"$": ["index.css"]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
static get styleUrls() {
|
|
26
|
+
return {
|
|
27
|
+
"$": ["index.css"]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static get properties() {
|
|
31
|
+
return {
|
|
32
|
+
"salonId": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"mutable": false,
|
|
35
|
+
"complexType": {
|
|
36
|
+
"original": "number",
|
|
37
|
+
"resolved": "number",
|
|
38
|
+
"references": {}
|
|
39
|
+
},
|
|
40
|
+
"required": false,
|
|
41
|
+
"optional": false,
|
|
42
|
+
"docs": {
|
|
43
|
+
"tags": [],
|
|
44
|
+
"text": ""
|
|
45
|
+
},
|
|
46
|
+
"attribute": "salon-id",
|
|
47
|
+
"reflect": false
|
|
48
|
+
},
|
|
49
|
+
"primaryColor": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "string",
|
|
54
|
+
"resolved": "string",
|
|
55
|
+
"references": {}
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"optional": false,
|
|
59
|
+
"docs": {
|
|
60
|
+
"tags": [],
|
|
61
|
+
"text": ""
|
|
62
|
+
},
|
|
63
|
+
"attribute": "primary-color",
|
|
64
|
+
"reflect": false,
|
|
65
|
+
"defaultValue": "Colors.Primary"
|
|
66
|
+
},
|
|
67
|
+
"redirectUrl": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "string",
|
|
72
|
+
"resolved": "string",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": false,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": ""
|
|
80
|
+
},
|
|
81
|
+
"attribute": "redirect-url",
|
|
82
|
+
"reflect": false,
|
|
83
|
+
"defaultValue": "window.btoa(window.location.href)"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
static get states() {
|
|
88
|
+
return {
|
|
89
|
+
"isModalOpen": {}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.salon-modal.salon-modal--gift-card:before {
|
|
2
|
+
display: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.salon-modal.salon-modal--gift-card .salon-modal--inner,
|
|
6
|
+
.salon-modal.salon-modal--gift-card .salon-modal--content {
|
|
7
|
+
max-width: none;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.salon-modal.salon-modal--gift-card .salon-modal--close {
|
|
13
|
+
background-color: #EFEFEF;
|
|
14
|
+
width: 40px;
|
|
15
|
+
height: 40px;
|
|
16
|
+
right: 16px;
|
|
17
|
+
top: 16px;
|
|
18
|
+
|
|
19
|
+
-moz-border-radius: 50px;
|
|
20
|
+
-webkit-border-radius: 50px;
|
|
21
|
+
border-radius: 50px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@media (min-width: 768px) {
|
|
26
|
+
.salon-modal.salon-modal--gift-card .salon-modal--close {
|
|
27
|
+
right: 20px;
|
|
28
|
+
top: 20px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import Color from 'color';
|
|
3
|
+
import { css } from 'glamor';
|
|
4
|
+
import { Colors } from '../../constants/colors';
|
|
5
|
+
export class SalonGiftCard {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.salonId = undefined;
|
|
8
|
+
this.buttonClass = '';
|
|
9
|
+
this.buttonText = 'Buy Gift card';
|
|
10
|
+
this.primaryColor = Colors.Primary;
|
|
11
|
+
}
|
|
12
|
+
openModal() {
|
|
13
|
+
const elBookingModal = document.createElement('div');
|
|
14
|
+
elBookingModal.innerHTML = `
|
|
15
|
+
<salon-gift-card-modal
|
|
16
|
+
salon-id=${this.salonId}
|
|
17
|
+
primary-color=${this.primaryColor}
|
|
18
|
+
></salon-gift-card-modal>
|
|
19
|
+
`;
|
|
20
|
+
document.body.appendChild(elBookingModal);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const buttonClass = this.buttonClass || 'btn btn-primary';
|
|
24
|
+
let buttonStyle = {};
|
|
25
|
+
if (!this.buttonClass) {
|
|
26
|
+
const primaryColor = Color(this.primaryColor);
|
|
27
|
+
const primaryColorHover = primaryColor.darken(0.05);
|
|
28
|
+
buttonStyle = css({
|
|
29
|
+
backgroundColor: this.primaryColor,
|
|
30
|
+
borderColor: this.primaryColor,
|
|
31
|
+
color: primaryColor.isLight() ? Colors.Black01 : Colors.White,
|
|
32
|
+
':hover': {
|
|
33
|
+
backgroundColor: primaryColorHover,
|
|
34
|
+
borderColor: primaryColorHover,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return (h("div", { class: "salon-gift-card" }, h("div", { class: "salon-gift-card--button" }, h("button", Object.assign({ type: "button", class: buttonClass, onClick: () => this.openModal() }, buttonStyle), this.buttonText))));
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "salon-gift-card"; }
|
|
41
|
+
static get originalStyleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["index.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get styleUrls() {
|
|
47
|
+
return {
|
|
48
|
+
"$": ["index.css"]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
static get properties() {
|
|
52
|
+
return {
|
|
53
|
+
"salonId": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "number",
|
|
58
|
+
"resolved": "number",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": ""
|
|
66
|
+
},
|
|
67
|
+
"attribute": "salon-id",
|
|
68
|
+
"reflect": false
|
|
69
|
+
},
|
|
70
|
+
"buttonClass": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"mutable": false,
|
|
73
|
+
"complexType": {
|
|
74
|
+
"original": "string",
|
|
75
|
+
"resolved": "string",
|
|
76
|
+
"references": {}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": false,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
},
|
|
84
|
+
"attribute": "button-class",
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"defaultValue": "''"
|
|
87
|
+
},
|
|
88
|
+
"buttonText": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "string",
|
|
93
|
+
"resolved": "string",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": ""
|
|
101
|
+
},
|
|
102
|
+
"attribute": "button-text",
|
|
103
|
+
"reflect": false,
|
|
104
|
+
"defaultValue": "'Buy Gift card'"
|
|
105
|
+
},
|
|
106
|
+
"primaryColor": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "string",
|
|
111
|
+
"resolved": "string",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": ""
|
|
119
|
+
},
|
|
120
|
+
"attribute": "primary-color",
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"defaultValue": "Colors.Primary"
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|