favesalon-embed 1.0.1 → 1.0.3
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/custom-elements/index.d.ts +24 -0
- package/dist/{cjs/_commonjsHelpers-5cfcba41.js → favesalon-embed/_commonjsHelpers-9bc404fc.js} +14 -6
- package/dist/{esm/_commonjsHelpers-098d5b27.js → favesalon-embed/_commonjsHelpers-a4f66ccd.js} +14 -2
- package/dist/{cjs/global-9073d10e.js → favesalon-embed/app-globals-437cc3f3.js} +15 -8
- package/dist/{esm/global-e1089ffd.js → favesalon-embed/app-globals-60769a2c.js} +16 -7
- package/dist/favesalon-embed/chat-box.entry.js +54 -0
- package/dist/favesalon-embed/chat-button.entry.js +51 -0
- package/dist/favesalon-embed/chat-form.entry.js +39 -0
- package/dist/favesalon-embed/chat-messages.entry.js +53 -0
- package/dist/favesalon-embed/chat-rooms.entry.js +17279 -0
- package/dist/favesalon-embed/css-shim-b7d3d95f.js +4 -0
- package/dist/favesalon-embed/dom-64053c71.js +73 -0
- package/dist/favesalon-embed/favesalon-embed.css +2433 -4
- package/dist/favesalon-embed/favesalon-embed.esm.js +148 -1
- package/dist/{collection/components/google-map/index.js → favesalon-embed/google-map.entry.js} +12 -54
- package/dist/{esm/index-80523fec.js → favesalon-embed/index-00b83e1c.js} +425 -15
- package/dist/favesalon-embed/index-04c09911.js +3371 -0
- package/dist/favesalon-embed/index-888e99e3.js +3371 -0
- package/dist/{cjs/index-7f190886.js → favesalon-embed/index-ac52896a.js} +454 -47
- package/dist/favesalon-embed/index.esm.js +1 -0
- package/dist/favesalon-embed/isObject-13b86c17.js +203 -0
- package/dist/favesalon-embed/relativeTime-15477f02.js +7 -0
- package/dist/favesalon-embed/relativeTime-268e64b0.js +7 -0
- package/dist/{esm → favesalon-embed}/salon-booking-modal.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-booking.entry.js +3 -3
- package/dist/{esm → favesalon-embed}/salon-gift-card-modal.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-gift-card.entry.js +3 -3
- package/dist/favesalon-embed/salon-info.entry.js +29 -0
- package/dist/{esm → favesalon-embed}/salon-latest-reviews.entry.js +4 -4
- package/dist/{collection/components/salon-latest-styles/index.js → favesalon-embed/salon-latest-styles.entry.js} +14 -99
- package/dist/{collection/components/salon-locations/index.js → favesalon-embed/salon-locations.entry.js} +15 -95
- package/dist/{esm → favesalon-embed}/salon-lookbook.entry.js +3 -3
- package/dist/{esm → favesalon-embed}/salon-ranking.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-reviews.entry.js +3 -3
- package/dist/{collection/components/salon-schedules/index.js → favesalon-embed/salon-schedules.entry.js} +14 -95
- package/dist/{esm → favesalon-embed}/salon-services.entry.js +3 -3
- package/dist/{esm → favesalon-embed}/salon-stylists.entry.js +3 -3
- package/dist/{custom-elements/index.js → favesalon-embed/services-55a87166.js} +2465 -7150
- package/dist/{cjs/services-125c82d8.js → favesalon-embed/services-7c46a2fd.js} +2465 -103
- package/dist/{esm/services-40a3e622.js → favesalon-embed/services-7cb8f2a6.js} +2469 -100
- package/dist/favesalon-embed/shadow-css-98135883.js +387 -0
- package/dist/{esm → favesalon-embed}/style-detail.entry.js +4 -4
- package/dist/{esm → favesalon-embed}/user-avatar.entry.js +13 -4
- package/dist/{esm/utils-e97485e0.js → favesalon-embed/utils-2c19db45.js} +6 -0
- package/dist/types/components/chat-box/index.d.ts +12 -0
- package/dist/types/components/chat-button/index.d.ts +0 -8
- package/dist/types/components/chat-form/index.d.ts +6 -0
- package/dist/types/components/chat-messages/index.d.ts +14 -0
- package/dist/types/components/chat-rooms/index.d.ts +12 -0
- package/dist/types/components/user-avatar/index.d.ts +2 -1
- package/dist/types/components.d.ts +84 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/chat-button.cjs.entry.js +0 -118
- package/dist/cjs/colors-38421769.js +0 -69
- package/dist/cjs/favesalon-embed.cjs.js +0 -24
- package/dist/cjs/google-map_5.cjs.entry.js +0 -310
- package/dist/cjs/index-47c2a5f6.js +0 -1533
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -23
- package/dist/cjs/relativeTime-3721080d.js +0 -9
- package/dist/cjs/salon-booking-modal.cjs.entry.js +0 -30
- package/dist/cjs/salon-booking.cjs.entry.js +0 -51
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +0 -29
- package/dist/cjs/salon-gift-card.cjs.entry.js +0 -51
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +0 -97
- package/dist/cjs/salon-lookbook.cjs.entry.js +0 -222
- package/dist/cjs/salon-ranking.cjs.entry.js +0 -60
- package/dist/cjs/salon-reviews.cjs.entry.js +0 -193
- package/dist/cjs/salon-services.cjs.entry.js +0 -81
- package/dist/cjs/salon-stylists.cjs.entry.js +0 -118
- package/dist/cjs/style-detail.cjs.entry.js +0 -312
- package/dist/cjs/user-avatar.cjs.entry.js +0 -45
- package/dist/cjs/utils-c5a33b3c.js +0 -23
- package/dist/collection/collection-manifest.json +0 -29
- package/dist/collection/components/chat-button/index.css +0 -122
- package/dist/collection/components/chat-button/index.js +0 -218
- package/dist/collection/components/chat-conversation/index.js +0 -103
- package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
- package/dist/collection/components/google-map/index.css +0 -5
- package/dist/collection/components/salon-booking/index.css +0 -30
- package/dist/collection/components/salon-booking/index.js +0 -126
- package/dist/collection/components/salon-booking/salon-booking-modal.js +0 -92
- package/dist/collection/components/salon-gift-card/index.css +0 -30
- package/dist/collection/components/salon-gift-card/index.js +0 -126
- package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -73
- package/dist/collection/components/salon-info/index.css +0 -1
- package/dist/collection/components/salon-info/index.js +0 -77
- package/dist/collection/components/salon-latest-reviews/index.css +0 -11
- package/dist/collection/components/salon-latest-reviews/index.js +0 -163
- package/dist/collection/components/salon-latest-styles/index.css +0 -12
- package/dist/collection/components/salon-locations/index.css +0 -24
- package/dist/collection/components/salon-lookbook/index.css +0 -15
- package/dist/collection/components/salon-lookbook/index.js +0 -368
- package/dist/collection/components/salon-ranking/index.css +0 -3
- package/dist/collection/components/salon-ranking/index.js +0 -117
- package/dist/collection/components/salon-reviews/index.css +0 -18
- package/dist/collection/components/salon-reviews/index.js +0 -249
- package/dist/collection/components/salon-schedules/index.css +0 -18
- package/dist/collection/components/salon-services/index.css +0 -1
- package/dist/collection/components/salon-services/index.js +0 -146
- package/dist/collection/components/salon-stylists/index.css +0 -43
- package/dist/collection/components/salon-stylists/index.js +0 -184
- package/dist/collection/components/style-detail/index.css +0 -76
- package/dist/collection/components/style-detail/index.js +0 -386
- package/dist/collection/components/user-avatar/index.css +0 -0
- package/dist/collection/components/user-avatar/index.js +0 -134
- package/dist/collection/constants/colors.js +0 -65
- package/dist/collection/global/global.js +0 -8
- package/dist/collection/index.js +0 -1
- package/dist/collection/mocks/users.js +0 -10
- package/dist/collection/services/services.js +0 -295
- package/dist/collection/types/chat.js +0 -23
- package/dist/collection/types/common.js +0 -11
- package/dist/collection/types/review.js +0 -39
- package/dist/collection/types/salon.js +0 -58
- package/dist/collection/types/service.js +0 -24
- package/dist/collection/types/style.js +0 -128
- package/dist/collection/types/stylist.js +0 -30
- package/dist/collection/types/user.js +0 -10
- package/dist/collection/utils/utils.js +0 -20
- package/dist/esm/chat-button.entry.js +0 -114
- package/dist/esm/favesalon-embed.js +0 -19
- package/dist/esm/google-map_5.entry.js +0 -302
- package/dist/esm/index-3fae868e.js +0 -1506
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -19
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/relativeTime-cd452e6d.js +0 -7
- package/dist/favesalon-embed/p-019c5ccd.entry.js +0 -1
- package/dist/favesalon-embed/p-083a8821.entry.js +0 -1
- package/dist/favesalon-embed/p-0d0ed9ea.entry.js +0 -1
- package/dist/favesalon-embed/p-119db8de.entry.js +0 -1
- package/dist/favesalon-embed/p-1432c51b.entry.js +0 -1
- package/dist/favesalon-embed/p-22093506.entry.js +0 -1
- package/dist/favesalon-embed/p-32b314e9.js +0 -2
- package/dist/favesalon-embed/p-47e646f8.js +0 -1
- package/dist/favesalon-embed/p-4a5eca9a.js +0 -6
- package/dist/favesalon-embed/p-58d2e9be.js +0 -1
- package/dist/favesalon-embed/p-71404b6a.entry.js +0 -1
- package/dist/favesalon-embed/p-857c3a61.entry.js +0 -1
- package/dist/favesalon-embed/p-99ec77f7.entry.js +0 -1
- package/dist/favesalon-embed/p-a33331cc.js +0 -1
- package/dist/favesalon-embed/p-b0c3673a.entry.js +0 -1
- package/dist/favesalon-embed/p-b287b1ea.entry.js +0 -1
- package/dist/favesalon-embed/p-b3af7842.entry.js +0 -1
- package/dist/favesalon-embed/p-b630ae68.js +0 -1580
- package/dist/favesalon-embed/p-ce2c1c9a.entry.js +0 -1
- package/dist/favesalon-embed/p-d6083940.js +0 -1
- package/dist/favesalon-embed/p-d9b7ad58.entry.js +0 -1
- package/dist/favesalon-embed/p-fc9a5551.js +0 -6
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/types/components/chat-conversation/index.d.ts +0 -0
- /package/dist/{esm → favesalon-embed}/colors-ea36347a.js +0 -0
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-47c2a5f6.js');
|
|
6
|
-
const services = require('./services-125c82d8.js');
|
|
7
|
-
const colors = require('./colors-38421769.js');
|
|
8
|
-
require('./_commonjsHelpers-5cfcba41.js');
|
|
9
|
-
|
|
10
|
-
const indexCss = "@media (max-width: 768px){salon-reviews .salon-reviews{flex-direction:column !important}salon-reviews .salon-reviews--filters--options{display:none !important}salon-reviews .salon-reviews--list{padding-top:32px !important;padding-left:0px !important}salon-reviews .reviews-list--sorting>label{display:none !important}}";
|
|
11
|
-
|
|
12
|
-
const pageLimited = 10;
|
|
13
|
-
const sortOptions = [{
|
|
14
|
-
value: 'newest',
|
|
15
|
-
label: 'Newest first',
|
|
16
|
-
}, {
|
|
17
|
-
value: 'oldest',
|
|
18
|
-
label: 'Oldest first',
|
|
19
|
-
}, {
|
|
20
|
-
value: 'rating_desc',
|
|
21
|
-
label: 'High rating first',
|
|
22
|
-
}, {
|
|
23
|
-
value: 'rating_asc',
|
|
24
|
-
label: 'Low rating first',
|
|
25
|
-
}];
|
|
26
|
-
const SalonReviews = class {
|
|
27
|
-
constructor(hostRef) {
|
|
28
|
-
index.registerInstance(this, hostRef);
|
|
29
|
-
this.salonId = undefined;
|
|
30
|
-
this.primaryColor = colors.Colors.Primary;
|
|
31
|
-
this.salonInfo = undefined;
|
|
32
|
-
this.stats = {};
|
|
33
|
-
this.totalReviews = 0;
|
|
34
|
-
this.allReviews = [];
|
|
35
|
-
this.isLoading = undefined;
|
|
36
|
-
this.isSorting = undefined;
|
|
37
|
-
this.isFiltering = undefined;
|
|
38
|
-
this.isLoadingMore = undefined;
|
|
39
|
-
this.canLoadMore = undefined;
|
|
40
|
-
this.page = 1;
|
|
41
|
-
this.filterBy = [];
|
|
42
|
-
this.sortBy = sortOptions[0].value;
|
|
43
|
-
}
|
|
44
|
-
componentWillLoad() {
|
|
45
|
-
this.fetchData();
|
|
46
|
-
}
|
|
47
|
-
fetchData() {
|
|
48
|
-
this.isLoading = true;
|
|
49
|
-
try {
|
|
50
|
-
services.HttpService().fetchSalonReviews(this.salonId, {
|
|
51
|
-
page: 1,
|
|
52
|
-
sort: this.sortBy,
|
|
53
|
-
limit: pageLimited,
|
|
54
|
-
}).then(response => {
|
|
55
|
-
const { total, stats, data: allReviews } = response;
|
|
56
|
-
this.stats = stats;
|
|
57
|
-
this.totalReviews = total;
|
|
58
|
-
this.allReviews = allReviews;
|
|
59
|
-
this.canLoadMore = total > pageLimited;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
catch (e) { }
|
|
63
|
-
this.isLoading = false;
|
|
64
|
-
}
|
|
65
|
-
onLoadMore() {
|
|
66
|
-
this.isLoadingMore = true;
|
|
67
|
-
try {
|
|
68
|
-
services.HttpService().fetchSalonReviews(this.salonId, {
|
|
69
|
-
page: this.page + 1,
|
|
70
|
-
sort: this.sortBy,
|
|
71
|
-
limit: pageLimited,
|
|
72
|
-
}).then(response => {
|
|
73
|
-
const { total, data: allReviews } = response;
|
|
74
|
-
this.page = this.page + 1;
|
|
75
|
-
this.totalReviews = total;
|
|
76
|
-
this.allReviews = this.allReviews.concat(allReviews);
|
|
77
|
-
this.canLoadMore = (allReviews || []).length === pageLimited;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
catch (e) { }
|
|
81
|
-
this.isLoadingMore = false;
|
|
82
|
-
}
|
|
83
|
-
onChangeFilter(filterBy) {
|
|
84
|
-
this.isFiltering = true;
|
|
85
|
-
try {
|
|
86
|
-
services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: this.sortBy, limit: pageLimited }, filterBy.length > 0 ? { avg_point: filterBy } : {})).then(response => {
|
|
87
|
-
const { total, data: allReviews } = response;
|
|
88
|
-
this.page = 1;
|
|
89
|
-
this.totalReviews = total;
|
|
90
|
-
this.allReviews = allReviews;
|
|
91
|
-
this.canLoadMore = (allReviews || []).length === pageLimited;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
catch (e) { }
|
|
95
|
-
this.isFiltering = false;
|
|
96
|
-
}
|
|
97
|
-
onChangeSorting(sortBy) {
|
|
98
|
-
this.isSorting = true;
|
|
99
|
-
try {
|
|
100
|
-
services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: sortBy, limit: pageLimited }, this.filterBy.length > 0 ? { avg_point: this.filterBy } : {})).then(response => {
|
|
101
|
-
const { total, data: allReviews } = response;
|
|
102
|
-
this.page = 1;
|
|
103
|
-
this.totalReviews = total;
|
|
104
|
-
this.allReviews = allReviews;
|
|
105
|
-
this.canLoadMore = (allReviews || []).length === pageLimited;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
catch (e) { }
|
|
109
|
-
this.isSorting = false;
|
|
110
|
-
}
|
|
111
|
-
render() {
|
|
112
|
-
const ratingTexts = ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
|
|
113
|
-
return (index.h("div", { class: "view view--salon-reviews" }, index.h("div", { class: "salon-reviews--filters" }, index.h("div", { class: "salon-reviews--score" }, index.h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => {
|
|
114
|
-
return (index.h("i", { class: score <= this.stats.reviewPoint ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '32px', marginRight: '4px' }, score <= this.stats.reviewPoint ? { color: this.primaryColor } : { color: colors.Colors.Gray04 }) }));
|
|
115
|
-
})), index.h("div", { class: "salon-review--rating--date", style: {
|
|
116
|
-
display: 'flex',
|
|
117
|
-
flexDirection: 'row',
|
|
118
|
-
alignItems: 'center',
|
|
119
|
-
marginTop: '-8px',
|
|
120
|
-
} }, index.h("span", { style: { fontSize: '24px' } }, this.stats.reviewPoint, "/5"), " ", index.h("span", { style: { color: colors.Colors.Gray04, marginLeft: '8px' } }, "(", this.stats.totalReviews, " reviews)"))), index.h("div", { class: "salon-reviews--filters--options", style: { marginTop: '24px' } }, index.h("div", { style: {
|
|
121
|
-
background: colors.Colors.Gray01,
|
|
122
|
-
display: 'flex',
|
|
123
|
-
alignItems: 'center',
|
|
124
|
-
borderRadius: '4px',
|
|
125
|
-
padding: '16px',
|
|
126
|
-
} }, index.h("div", null, index.h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
|
|
127
|
-
this.filterBy = [];
|
|
128
|
-
this.onChangeFilter([]);
|
|
129
|
-
} }), " ", index.h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
|
|
130
|
-
const isChecked = this.filterBy.indexOf(score) > -1;
|
|
131
|
-
return (index.h("div", { key: `salon-reviews--filters-score--${score}`, style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, index.h("input", { type: "checkbox", checked: isChecked, onChange: () => {
|
|
132
|
-
const newFilter = isChecked ? this.filterBy.filter(fs => fs !== score) : this.filterBy.concat([score]);
|
|
133
|
-
this.filterBy = newFilter;
|
|
134
|
-
this.onChangeFilter(newFilter);
|
|
135
|
-
} }), " ", index.h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", index.h("i", { class: "ri-heart-line", style: {
|
|
136
|
-
fontSize: '16px',
|
|
137
|
-
marginLeft: '4px',
|
|
138
|
-
marginRight: '4px',
|
|
139
|
-
lineHeight: '1',
|
|
140
|
-
} }), " ", index.h("span", { style: { color: colors.Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
|
|
141
|
-
})))), index.h("div", { class: "salon-reviews--list-header", style: {
|
|
142
|
-
display: 'flex',
|
|
143
|
-
flexDirection: 'row',
|
|
144
|
-
justifyContent: 'space-between',
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
marginTop: '24px',
|
|
147
|
-
} }, index.h("div", { class: "view--salon-reviews--counter" }, this.totalReviews, " ", this.totalReviews === 1 ? `review` : `reviews`), index.h("div", { style: { display: 'flex', alignItems: 'center' } }, index.h("label", { style: { marginRight: '8px', color: colors.Colors.Gray04 } }, "Sort by"), index.h("select", { class: "search-filter--select", "place-holder": "Most popular", disabled: this.isLoading, onChange: (evt) => {
|
|
148
|
-
this.sortBy = evt.target.value;
|
|
149
|
-
this.onChangeSorting(evt.target.value);
|
|
150
|
-
}, style: {
|
|
151
|
-
display: 'flex',
|
|
152
|
-
alignItems: 'center',
|
|
153
|
-
backgroundColor: colors.Colors.Gray01,
|
|
154
|
-
borderColor: colors.Colors.Gray01,
|
|
155
|
-
borderRadius: '4px',
|
|
156
|
-
height: '40px',
|
|
157
|
-
width: '130px',
|
|
158
|
-
} }, sortOptions.map(sortOption => (index.h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy, key: `search-filter--select-option--${sortOption.value}` }, sortOption.label)))))), index.h("div", { class: "salon-reviews--list-content", style: { marginTop: '24px' } }, this.allReviews.map((review, idx) => {
|
|
159
|
-
const user = review.user || {};
|
|
160
|
-
return (index.h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
|
|
161
|
-
borderBottom: `1px solid ${colors.Colors.Gray02}`,
|
|
162
|
-
marginBottom: '24px',
|
|
163
|
-
paddingBottom: '24px',
|
|
164
|
-
} }, index.h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, index.h("user-avatar", { size: 48, avatar: user.avatar, name: index.h("span", { style: { fontSize: '18px', fontWeight: '600', color: colors.Colors.TextColor } }, (user.firstName || user.lastName) ? `${user.firstName || ''} ${user.lastName || ''}` : ''), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), index.h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (index.h("i", { key: `salon-review--rating--item--score--${score}`, class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
|
|
165
|
-
color: score <= review.point ? this.primaryColor : colors.Colors.Gray04,
|
|
166
|
-
fontSize: '16px',
|
|
167
|
-
marginRight: '4px',
|
|
168
|
-
} }))), review.createdDate && (index.h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: colors.Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, services.dayjs_min(review.createdDate).format(services.shortDateYearFormat)))), index.h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: '600' } }, ratingTexts[review.point]), (review.title || review.description) && (index.h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, index.h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), index.h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (index.h("div", { style: {
|
|
169
|
-
display: 'flex',
|
|
170
|
-
flexDirection: 'row',
|
|
171
|
-
overflowX: 'auto',
|
|
172
|
-
} }, review.photos.map(fileObj => (index.h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
|
|
173
|
-
position: 'relative',
|
|
174
|
-
cursor: 'pointer',
|
|
175
|
-
marginTop: '16px',
|
|
176
|
-
marginRight: '12px',
|
|
177
|
-
} }, index.h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
|
|
178
|
-
})), index.h("div", { class: "salon-reviews--list-footer", style: {
|
|
179
|
-
textAlign: 'center',
|
|
180
|
-
paddingTop: '16px',
|
|
181
|
-
paddingBottom: '16px',
|
|
182
|
-
} }, index.h("button", { class: "btn btn-light btn-lg", style: {
|
|
183
|
-
background: colors.Colors.White,
|
|
184
|
-
border: `1px solid ${colors.Colors.Gray02}`,
|
|
185
|
-
borderRadius: '4px',
|
|
186
|
-
paddingLeft: '24px',
|
|
187
|
-
paddingRight: '24px',
|
|
188
|
-
}, onClick: () => this.onLoadMore() }, "Load more"))));
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
SalonReviews.style = indexCss;
|
|
192
|
-
|
|
193
|
-
exports.salon_reviews = SalonReviews;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-47c2a5f6.js');
|
|
6
|
-
const services = require('./services-125c82d8.js');
|
|
7
|
-
const colors = require('./colors-38421769.js');
|
|
8
|
-
require('./_commonjsHelpers-5cfcba41.js');
|
|
9
|
-
|
|
10
|
-
const indexCss = "";
|
|
11
|
-
|
|
12
|
-
const SalonServices = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.salonId = undefined;
|
|
16
|
-
this.buttonClass = 'btn btn-light';
|
|
17
|
-
this.salonServices = undefined;
|
|
18
|
-
this.isLoading = undefined;
|
|
19
|
-
}
|
|
20
|
-
componentWillLoad() {
|
|
21
|
-
this.fetchData();
|
|
22
|
-
}
|
|
23
|
-
async fetchData() {
|
|
24
|
-
this.isLoading = true;
|
|
25
|
-
try {
|
|
26
|
-
this.salonServices = await services.HttpService().fetchSalonServices(this.salonId);
|
|
27
|
-
}
|
|
28
|
-
catch (e) {
|
|
29
|
-
this.salonServices = [];
|
|
30
|
-
}
|
|
31
|
-
this.isLoading = false;
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
if (this.isLoading) {
|
|
35
|
-
return (index.h("div", { class: "salon-services--container" }, index.h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${colors.Colors.Gray01}` } }, index.h("div", { class: "view-content", style: { overflowX: 'auto' } }, index.h("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden' } }, [1, 2, 3, 4, 5, 6].map((fakeId, index$1) => (index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
|
|
36
|
-
backgroundColor: colors.Colors.Gray02,
|
|
37
|
-
float: 'left',
|
|
38
|
-
marginRight: '12px',
|
|
39
|
-
height: '30px',
|
|
40
|
-
width: '120px',
|
|
41
|
-
} })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index$1) => {
|
|
42
|
-
return (index.h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
|
|
43
|
-
backgroundColor: colors.Colors.Gray03,
|
|
44
|
-
height: '20px',
|
|
45
|
-
width: '120px',
|
|
46
|
-
} }), index.h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${colors.Colors.Gray01}`, marginTop: '12px' } }, index.h("div", { class: "view-content" }, [1, 2, 3].map((fakeGroupId, fakeGroupIndex) => (index.h("div", { key: `service-group--${fakeId}--service-${fakeGroupId}--${fakeGroupIndex}`, class: "salon-service" }, index.h("div", { class: "salon-service--name", style: Object.assign({}, fakeGroupIndex > 0 ? {
|
|
47
|
-
marginTop: '12px',
|
|
48
|
-
paddingTop: '12px',
|
|
49
|
-
borderTop: `1px solid ${colors.Colors.Gray01}`,
|
|
50
|
-
} : {}) }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
|
|
51
|
-
backgroundColor: colors.Colors.Gray01,
|
|
52
|
-
height: '16px',
|
|
53
|
-
width: '120px',
|
|
54
|
-
} })), index.h("div", { style: { marginTop: '4px' } }, index.h("div", { style: {
|
|
55
|
-
backgroundColor: colors.Colors.Gray01,
|
|
56
|
-
height: '16px',
|
|
57
|
-
width: '240px',
|
|
58
|
-
} })))))))));
|
|
59
|
-
})));
|
|
60
|
-
}
|
|
61
|
-
return (index.h("div", { class: "salon-services--container" }, index.h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${colors.Colors.Gray02}` } }, index.h("div", { class: "view-content", style: { overflowX: 'auto' } }, index.h("div", { style: { whiteSpace: 'nowrap' } }, services.sortBy_1(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index$1) => (index.h("a", { href: `#service-group--${serviceGroup.id}` }, index.h("button", { type: "button", class: this.buttonClass, style: index$1 > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), services.sortBy_1(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
|
|
62
|
-
const hasMultipleCates = (serviceGroup.data || []).length > 1;
|
|
63
|
-
return (index.h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, index.h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), index.h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${colors.Colors.Gray02}` } }, index.h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (index.h("div", { class: "salon-service-category" }, hasMultipleCates && (index.h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${colors.Colors.Gray02}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (index.h("div", { class: "salon-service" }, index.h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
|
|
64
|
-
marginTop: '12px',
|
|
65
|
-
paddingTop: '12px',
|
|
66
|
-
borderTop: `1px solid ${colors.Colors.Gray01}`,
|
|
67
|
-
} : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (index.h("div", { style: {
|
|
68
|
-
display: 'block',
|
|
69
|
-
marginTop: '4px',
|
|
70
|
-
fontSize: '90%',
|
|
71
|
-
color: colors.Colors.Gray05,
|
|
72
|
-
} }, [
|
|
73
|
-
!service.hideDuration ? `${service.duration} mins` : '',
|
|
74
|
-
!service.hidePrice ? `$${service.price}` : '',
|
|
75
|
-
].filter(field => !!field).join(' · ')))))))))))));
|
|
76
|
-
})));
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
SalonServices.style = indexCss;
|
|
80
|
-
|
|
81
|
-
exports.salon_services = SalonServices;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-47c2a5f6.js');
|
|
6
|
-
const colors = require('./colors-38421769.js');
|
|
7
|
-
const services = require('./services-125c82d8.js');
|
|
8
|
-
require('./_commonjsHelpers-5cfcba41.js');
|
|
9
|
-
|
|
10
|
-
const indexCss = ".view--salon-stylists{overflow:hidden;margin-left:-12px;margin-top:-12px}.view--salon-stylists .salon-stylist{float:left;padding-left:12px;padding-top:12px;width:50%}.view--salon-stylists .salon-stylist--avatar{height:180px}@media (min-width: 576px){.view--salon-stylists .salon-stylist{width:33.33%;max-width:240px}}@media (min-width: 768px){.view--salon-stylists{margin-left:-24px;margin-top:-24px}.view--salon-stylists .salon-stylist{padding-left:24px;padding-top:24px;width:264px;max-width:none}.view--salon-stylists .salon-stylist--avatar{height:240px}}";
|
|
11
|
-
|
|
12
|
-
const pageLimit = 20;
|
|
13
|
-
const SalonStylists = class {
|
|
14
|
-
constructor(hostRef) {
|
|
15
|
-
index.registerInstance(this, hostRef);
|
|
16
|
-
this.salonId = undefined;
|
|
17
|
-
this.salonStylists = undefined;
|
|
18
|
-
this.totalStylists = undefined;
|
|
19
|
-
this.page = 1;
|
|
20
|
-
this.isLoading = undefined;
|
|
21
|
-
this.isLoadingMore = undefined;
|
|
22
|
-
this.canLoadMore = undefined;
|
|
23
|
-
}
|
|
24
|
-
componentWillLoad() {
|
|
25
|
-
this.fetchData();
|
|
26
|
-
}
|
|
27
|
-
async fetchData() {
|
|
28
|
-
this.isLoading = true;
|
|
29
|
-
try {
|
|
30
|
-
const { total, data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
|
|
31
|
-
this.totalStylists = total;
|
|
32
|
-
this.salonStylists = data;
|
|
33
|
-
this.canLoadMore = data.length === pageLimit;
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
this.totalStylists = 0;
|
|
37
|
-
this.salonStylists = [];
|
|
38
|
-
this.canLoadMore = false;
|
|
39
|
-
}
|
|
40
|
-
this.isLoading = false;
|
|
41
|
-
}
|
|
42
|
-
async onLoadMore() {
|
|
43
|
-
this.isLoadingMore = true;
|
|
44
|
-
try {
|
|
45
|
-
const { data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
|
|
46
|
-
this.salonStylists = this.salonStylists.concat(data || []);
|
|
47
|
-
this.canLoadMore = data.length === pageLimit;
|
|
48
|
-
this.page += 1;
|
|
49
|
-
}
|
|
50
|
-
catch (e) { }
|
|
51
|
-
this.isLoadingMore = false;
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
if (this.isLoading) {
|
|
55
|
-
return (index.h("div", null, index.h("div", { class: "view--salon-stylists" }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((fakeId, index$1) => (index.h("div", { class: "salon-stylist" }, index.h("div", { class: "card", style: {
|
|
56
|
-
background: 'none',
|
|
57
|
-
border: 'none',
|
|
58
|
-
overflow: 'hidden',
|
|
59
|
-
} }, index.h("div", { class: "salon-stylist--avatar", style: {
|
|
60
|
-
backgroundColor: colors.Colors.Gray01,
|
|
61
|
-
backgroundRepeat: 'no-repeat',
|
|
62
|
-
backgroundPosition: 'center top',
|
|
63
|
-
backgroundSize: 'cover',
|
|
64
|
-
border: `1px solid ${colors.Colors.Gray01}`,
|
|
65
|
-
borderRadius: '8px',
|
|
66
|
-
position: 'relative',
|
|
67
|
-
display: 'flex',
|
|
68
|
-
width: '100%',
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
justifyContent: 'center',
|
|
71
|
-
} }), index.h("div", { class: "card-body" }, index.h("div", { key: `stylist--${fakeId}--${index$1}`, style: {
|
|
72
|
-
backgroundColor: colors.Colors.Gray01,
|
|
73
|
-
height: '16px',
|
|
74
|
-
width: '120px',
|
|
75
|
-
margin: 'auto',
|
|
76
|
-
} })))))))));
|
|
77
|
-
}
|
|
78
|
-
return (index.h("div", null, index.h("div", { class: "view--salon-stylists" }, (this.salonStylists || []).map(stylist => (index.h("div", { class: "salon-stylist" }, index.h("div", { class: "card", style: {
|
|
79
|
-
background: 'none',
|
|
80
|
-
border: 'none',
|
|
81
|
-
overflow: 'hidden',
|
|
82
|
-
} }, index.h("div", { class: "salon-stylist--avatar", style: {
|
|
83
|
-
backgroundImage: `url("${stylist.avatar}")`,
|
|
84
|
-
backgroundColor: colors.Colors.Gray01,
|
|
85
|
-
backgroundRepeat: 'no-repeat',
|
|
86
|
-
backgroundPosition: 'center top',
|
|
87
|
-
backgroundSize: 'cover',
|
|
88
|
-
border: `1px solid ${colors.Colors.Gray01}`,
|
|
89
|
-
borderRadius: '8px',
|
|
90
|
-
position: 'relative',
|
|
91
|
-
display: 'flex',
|
|
92
|
-
width: '100%',
|
|
93
|
-
alignItems: 'center',
|
|
94
|
-
justifyContent: 'center',
|
|
95
|
-
} }, !stylist.avatar && (index.h("span", { style: {
|
|
96
|
-
fontSize: '32px',
|
|
97
|
-
fontWeight: 'bold',
|
|
98
|
-
textTransform: 'uppercase',
|
|
99
|
-
} }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), index.h("div", { class: "card-body" }, index.h("div", { style: {
|
|
100
|
-
fontSize: '18px',
|
|
101
|
-
fontWeight: '600',
|
|
102
|
-
textAlign: 'center',
|
|
103
|
-
} }, stylist.fullName))))))), this.canLoadMore && (index.h("div", { class: "view-footer", style: {
|
|
104
|
-
textAlign: 'center',
|
|
105
|
-
paddingTop: '32px',
|
|
106
|
-
paddingBottom: '16px',
|
|
107
|
-
} }, index.h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
|
|
108
|
-
background: colors.Colors.White,
|
|
109
|
-
border: `1px solid ${colors.Colors.Gray02}`,
|
|
110
|
-
borderRadius: '4px',
|
|
111
|
-
paddingLeft: '24px',
|
|
112
|
-
paddingRight: '24px',
|
|
113
|
-
}, onClick: () => this.onLoadMore() }, "Load more")))));
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
SalonStylists.style = indexCss;
|
|
117
|
-
|
|
118
|
-
exports.salon_stylists = SalonStylists;
|