favesalon-embed 0.0.2 → 0.1.0
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/LICENSE +21 -0
- package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
- package/dist/cjs/colors-38421769.js +69 -0
- package/dist/cjs/favesalon-embed.cjs.js +20 -0
- package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
- package/dist/cjs/google-map_5.cjs.entry.js +291 -0
- package/dist/cjs/index-7f190886.js +4396 -0
- package/{cjs/index-7d179a70.js → dist/cjs/index-e6bea8f5.js} +87 -3
- package/{cjs → dist/cjs}/index.cjs.js +0 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/cjs/salon-booking-modal.cjs.entry.js +29 -0
- package/dist/cjs/salon-booking.cjs.entry.js +50 -0
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
- package/dist/cjs/salon-gift-card.cjs.entry.js +50 -0
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
- package/dist/cjs/salon-lookbook.cjs.entry.js +218 -0
- package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
- package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
- package/dist/cjs/salon-services.cjs.entry.js +78 -0
- package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
- package/{cjs/services-d6f8214c.js → dist/cjs/services-eee8f251.js} +317 -361
- package/dist/cjs/style-detail.cjs.entry.js +310 -0
- package/{cjs → dist/cjs}/user-avatar.cjs.entry.js +4 -4
- package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
- package/{collection → dist/collection}/collection-manifest.json +2 -2
- package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
- package/{collection → dist/collection}/components/google-map/index.css +0 -1
- package/dist/collection/components/google-map/index.js +86 -0
- package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
- package/{collection → dist/collection}/components/salon-booking/index.js +29 -11
- package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +12 -6
- package/dist/collection/components/salon-gift-card/index.css +25 -0
- package/{collection → dist/collection}/components/salon-gift-card/index.js +44 -6
- package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +30 -4
- package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
- package/{collection → dist/collection}/components/salon-info/index.js +6 -32
- package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
- package/dist/collection/components/salon-latest-reviews/index.js +176 -0
- package/dist/collection/components/salon-latest-styles/index.css +10 -0
- package/dist/collection/components/salon-latest-styles/index.js +178 -0
- package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
- package/dist/collection/components/salon-locations/index.js +151 -0
- package/dist/collection/components/salon-lookbook/index.css +12 -0
- package/{collection → dist/collection}/components/salon-lookbook/index.js +122 -49
- package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
- package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
- package/dist/collection/components/salon-reviews/index.css +15 -0
- package/dist/collection/components/salon-reviews/index.js +286 -0
- package/dist/collection/components/salon-schedules/index.css +15 -0
- package/dist/collection/components/salon-schedules/index.js +189 -0
- package/{collection/components/salon-reviews → dist/collection/components/salon-services}/index.css +0 -0
- package/dist/collection/components/salon-services/index.js +156 -0
- package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
- package/dist/collection/components/salon-stylists/index.js +183 -0
- package/dist/collection/components/style-detail/index.css +62 -0
- package/dist/collection/components/style-detail/index.js +461 -0
- package/{collection/components/salon-services → dist/collection/components/user-avatar}/index.css +0 -0
- package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
- package/dist/collection/constants/colors.js +65 -0
- package/{collection → dist/collection}/global/global.js +0 -0
- package/{collection → dist/collection}/index.js +0 -0
- package/dist/collection/services/services.js +174 -0
- package/dist/collection/types/common.js +11 -0
- package/{collection → dist/collection}/types/review.js +9 -5
- package/dist/collection/types/salon.js +58 -0
- package/{collection → dist/collection}/types/service.js +0 -0
- package/dist/collection/types/style.js +128 -0
- package/dist/collection/types/stylist.js +30 -0
- package/{collection/components/user-avatar/index.css → dist/collection/types/tmp.js} +0 -0
- package/{collection → dist/collection}/types/user.js +2 -2
- package/{collection → dist/collection}/utils/utils.js +0 -0
- package/{custom-elements → dist/custom-elements}/index.d.ts +12 -12
- package/{custom-elements → dist/custom-elements}/index.js +5783 -870
- package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
- package/dist/esm/colors-ea36347a.js +67 -0
- package/dist/esm/favesalon-embed.js +18 -0
- package/{esm → dist/esm}/global-e1089ffd.js +0 -0
- package/dist/esm/google-map_5.entry.js +283 -0
- package/{esm/index-2160b80b.js → dist/esm/index-6af0a03d.js} +87 -4
- package/dist/esm/index-80523fec.js +4393 -0
- package/{esm → dist/esm}/index.js +0 -0
- package/dist/esm/loader.js +18 -0
- package/{esm → dist/esm}/polyfills/core-js.js +0 -0
- package/{esm → dist/esm}/polyfills/css-shim.js +0 -0
- package/{esm → dist/esm}/polyfills/dom.js +0 -0
- package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
- package/{esm → dist/esm}/polyfills/index.js +0 -0
- package/{esm → dist/esm}/polyfills/system.js +0 -0
- package/dist/esm/salon-booking-modal.entry.js +25 -0
- package/dist/esm/salon-booking.entry.js +46 -0
- package/dist/esm/salon-gift-card-modal.entry.js +24 -0
- package/dist/esm/salon-gift-card.entry.js +46 -0
- package/dist/esm/salon-latest-reviews.entry.js +91 -0
- package/dist/esm/salon-lookbook.entry.js +214 -0
- package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
- package/dist/esm/salon-reviews.entry.js +182 -0
- package/dist/esm/salon-services.entry.js +74 -0
- package/dist/esm/salon-stylists.entry.js +108 -0
- package/{esm/services-57fadd0a.js → dist/esm/services-295247b1.js} +310 -355
- package/dist/esm/style-detail.entry.js +306 -0
- package/{esm → dist/esm}/user-avatar.entry.js +4 -4
- package/{esm → dist/esm}/utils-e97485e0.js +0 -0
- package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
- package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
- package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
- package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
- package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
- package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
- package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
- package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
- package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
- package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
- package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
- package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
- package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
- package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
- package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
- package/dist/favesalon-embed/p-a33331cc.js +1 -0
- package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
- package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
- package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
- package/dist/favesalon-embed/p-c2ecb365.js +1 -0
- package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
- package/dist/favesalon-embed/p-d6083940.js +1 -0
- package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
- package/dist/favesalon-embed/p-fc9a5551.js +6 -0
- package/{index.cjs.js → dist/index.cjs.js} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/dist/types/components/google-map/index.d.ts +5 -0
- package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
- package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
- package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
- package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
- package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
- package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
- package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
- package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
- package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
- package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
- package/dist/types/components/salon-reviews/index.d.ts +24 -0
- package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
- package/{types → dist/types}/components/salon-services/index.d.ts +2 -0
- package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
- package/dist/types/components/style-detail/index.d.ts +24 -0
- package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
- package/{types → dist/types}/components.d.ts +62 -41
- package/dist/types/constants/colors.d.ts +65 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/dist/types/services/services.d.ts +60 -0
- package/{types → dist/types}/stencil-public-runtime.d.ts +0 -0
- package/dist/types/types/common.d.ts +11 -0
- package/{types → dist/types}/types/review.d.ts +4 -0
- package/{types → dist/types}/types/salon.d.ts +3 -1
- package/{types → dist/types}/types/service.d.ts +0 -0
- package/dist/types/types/style.d.ts +88 -0
- package/{types → dist/types}/types/stylist.d.ts +2 -1
- package/dist/types/types/tmp.d.ts +0 -0
- package/{types → dist/types}/types/user.d.ts +2 -2
- package/{types → dist/types}/utils/utils.d.ts +0 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +18 -13
- package/readme.md +23 -2
- package/cjs/colors-7f354880.js +0 -95
- package/cjs/favesalon-embed.cjs.js +0 -20
- package/cjs/google-map.cjs.entry.js +0 -47
- package/cjs/loader.cjs.js +0 -22
- package/cjs/salon-booking-modal.cjs.entry.js +0 -23
- package/cjs/salon-booking_2.cjs.entry.js +0 -56
- package/cjs/salon-contact_4.cjs.entry.js +0 -154
- package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
- package/cjs/salon-info.cjs.entry.js +0 -34
- package/cjs/salon-latest-reviews.cjs.entry.js +0 -57
- package/cjs/salon-lookbook.cjs.entry.js +0 -187
- package/cjs/salon-reviews.cjs.entry.js +0 -196
- package/cjs/salon-services.cjs.entry.js +0 -40
- package/cjs/salon-stylists.cjs.entry.js +0 -53
- package/collection/components/google-map/index.js +0 -97
- package/collection/components/salon-contact/index.js +0 -88
- package/collection/components/salon-gift-card/index.css +0 -25
- package/collection/components/salon-info/index.css +0 -3
- package/collection/components/salon-latest-reviews/index.js +0 -108
- package/collection/components/salon-locations/index.js +0 -80
- package/collection/components/salon-lookbook/index.css +0 -12
- package/collection/components/salon-reviews/index.js +0 -291
- package/collection/components/salon-schedules/index.css +0 -14
- package/collection/components/salon-schedules/index.js +0 -103
- package/collection/components/salon-services/index.js +0 -86
- package/collection/components/salon-styles/index.css +0 -23
- package/collection/components/salon-styles/index.js +0 -100
- package/collection/components/salon-stylists/index.js +0 -96
- package/collection/constants/colors.js +0 -91
- package/collection/services/services.js +0 -203
- package/collection/types/common.js +0 -2
- package/collection/types/salon.js +0 -52
- package/collection/types/style.js +0 -28
- package/collection/types/stylist.js +0 -13
- package/esm/colors-1ec90c5f.js +0 -93
- package/esm/favesalon-embed.js +0 -18
- package/esm/google-map.entry.js +0 -43
- package/esm/loader.js +0 -18
- package/esm/salon-booking-modal.entry.js +0 -19
- package/esm/salon-booking_2.entry.js +0 -51
- package/esm/salon-contact_4.entry.js +0 -147
- package/esm/salon-gift-card-modal.entry.js +0 -16
- package/esm/salon-info.entry.js +0 -30
- package/esm/salon-latest-reviews.entry.js +0 -53
- package/esm/salon-lookbook.entry.js +0 -183
- package/esm/salon-reviews.entry.js +0 -192
- package/esm/salon-services.entry.js +0 -36
- package/esm/salon-stylists.entry.js +0 -49
- package/favesalon-embed/favesalon-embed.esm.js +0 -1
- package/favesalon-embed/p-14a46adf.entry.js +0 -1
- package/favesalon-embed/p-2da2ed75.js +0 -1
- package/favesalon-embed/p-3712d9ab.entry.js +0 -1
- package/favesalon-embed/p-38066f9f.entry.js +0 -1
- package/favesalon-embed/p-4e2d7b29.js +0 -1
- package/favesalon-embed/p-520c8ffb.entry.js +0 -1
- package/favesalon-embed/p-54a1c294.entry.js +0 -1
- package/favesalon-embed/p-762520f2.js +0 -1
- package/favesalon-embed/p-94a0991e.entry.js +0 -1
- package/favesalon-embed/p-94b179eb.entry.js +0 -1
- package/favesalon-embed/p-977bd8bc.entry.js +0 -1
- package/favesalon-embed/p-bc363938.entry.js +0 -1
- package/favesalon-embed/p-bf9c83a3.entry.js +0 -1
- package/favesalon-embed/p-c5ebd3c9.entry.js +0 -1
- package/favesalon-embed/p-d84b61b0.entry.js +0 -1
- package/favesalon-embed/p-f15bcb43.entry.js +0 -1
- package/types/components/google-map/index.d.ts +0 -10
- package/types/components/salon-contact/index.d.ts +0 -9
- package/types/components/salon-reviews/index.d.ts +0 -23
- package/types/components/salon-styles/index.d.ts +0 -9
- package/types/constants/colors.d.ts +0 -88
- package/types/services/services.d.ts +0 -24
- package/types/types/common.d.ts +0 -2
- package/types/types/style.d.ts +0 -49
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6bea8f5.js');
|
|
6
|
+
const colors = require('./colors-38421769.js');
|
|
7
|
+
const services = require('./services-eee8f251.js');
|
|
8
|
+
require('./_commonjsHelpers-5cfcba41.js');
|
|
9
|
+
|
|
10
|
+
const indexCss = "@media (max-width: 768px){salon-lookbook .view-header{display:block !important}salon-lookbook .salon-loobook--serch-result{margin-bottom:16px}salon-lookbook .salon-loobook--filter-wrapper>label,salon-lookbook .salon-loobook--sort-wrapper>label{display:none !important}}";
|
|
11
|
+
|
|
12
|
+
const lookbookSortOptions = [{
|
|
13
|
+
value: 'like',
|
|
14
|
+
label: 'Most popular',
|
|
15
|
+
}, {
|
|
16
|
+
value: 'newest',
|
|
17
|
+
label: 'Newest first',
|
|
18
|
+
}, {
|
|
19
|
+
value: 'oldest',
|
|
20
|
+
label: 'Oldest first',
|
|
21
|
+
}];
|
|
22
|
+
const lookbookFilterOptions = [{
|
|
23
|
+
value: 'all',
|
|
24
|
+
label: 'All Category',
|
|
25
|
+
}];
|
|
26
|
+
let SalonLookbook = class {
|
|
27
|
+
constructor(hostRef) {
|
|
28
|
+
index.registerInstance(this, hostRef);
|
|
29
|
+
this.isLoading = true;
|
|
30
|
+
this.currentPage = 1;
|
|
31
|
+
this.totalLookbooks = 0;
|
|
32
|
+
this.salonCategories = [];
|
|
33
|
+
this.salonLookbooks = [];
|
|
34
|
+
this.sortBy = lookbookSortOptions[1].value;
|
|
35
|
+
this.filterBy = lookbookFilterOptions[0].value;
|
|
36
|
+
}
|
|
37
|
+
componentWillLoad() {
|
|
38
|
+
this.fetchData();
|
|
39
|
+
this.injectSDK();
|
|
40
|
+
}
|
|
41
|
+
componentDidRender() {
|
|
42
|
+
this.setupGridLayout();
|
|
43
|
+
}
|
|
44
|
+
injectSDK() {
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
const script = document.createElement('script');
|
|
47
|
+
script.type = 'text/javascript';
|
|
48
|
+
script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
|
|
49
|
+
document.body.appendChild(script);
|
|
50
|
+
return resolve(true);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
setupGridLayout() {
|
|
54
|
+
if (!this.isLayoutSetup && document.querySelector('#salon-loobooks--grid')) {
|
|
55
|
+
const script = document.createElement('script');
|
|
56
|
+
script.type = 'text/javascript';
|
|
57
|
+
script.innerHTML = `
|
|
58
|
+
var masonry = new Macy({
|
|
59
|
+
container: '#salon-loobooks--grid',
|
|
60
|
+
useContainerForBreakpoints: true,
|
|
61
|
+
margin: 16,
|
|
62
|
+
columns: 5,
|
|
63
|
+
breakAt: {
|
|
64
|
+
1024: {
|
|
65
|
+
columns: 4,
|
|
66
|
+
},
|
|
67
|
+
768: {
|
|
68
|
+
columns: 3,
|
|
69
|
+
},
|
|
70
|
+
576: {
|
|
71
|
+
margin: 16,
|
|
72
|
+
columns: 2,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
`;
|
|
77
|
+
document.body.appendChild(script);
|
|
78
|
+
this.isLayoutSetup = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async fetchData() {
|
|
82
|
+
try {
|
|
83
|
+
const promises = [
|
|
84
|
+
this.fetchLookbooks(Object.assign({ page: 1, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {})),
|
|
85
|
+
this.fetchCategories(),
|
|
86
|
+
];
|
|
87
|
+
return Promise.all(promises);
|
|
88
|
+
}
|
|
89
|
+
catch (e) { }
|
|
90
|
+
}
|
|
91
|
+
async fetchLookbooks(options, isLoadingMore) {
|
|
92
|
+
if (isLoadingMore) {
|
|
93
|
+
this.isLoadingMore = true;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this.isLoading = true;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
const { total, allLookbooks } = await services.HttpService().fetchSalonLookbooks(this.salonId, options);
|
|
100
|
+
this.totalLookbooks = total;
|
|
101
|
+
this.salonLookbooks = this.salonLookbooks.concat(allLookbooks);
|
|
102
|
+
this.hideLoadMore = allLookbooks.length < 20;
|
|
103
|
+
}
|
|
104
|
+
catch (error) { }
|
|
105
|
+
if (isLoadingMore) {
|
|
106
|
+
this.isLoadingMore = false;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.isLoading = false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async onChangeFiltering(filterBy) {
|
|
113
|
+
try {
|
|
114
|
+
this.currentPage = 1;
|
|
115
|
+
this.totalLookbooks = 0;
|
|
116
|
+
this.salonLookbooks = [];
|
|
117
|
+
this.hideLoadMore = true;
|
|
118
|
+
this.filterBy = filterBy;
|
|
119
|
+
await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [Number(this.filterBy)] } : {}));
|
|
120
|
+
if (window.masonry) {
|
|
121
|
+
this.isLayoutSetup = false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (error) { }
|
|
125
|
+
}
|
|
126
|
+
async onChangeSorting(sortBy) {
|
|
127
|
+
try {
|
|
128
|
+
this.currentPage = 1;
|
|
129
|
+
this.totalLookbooks = 0;
|
|
130
|
+
this.salonLookbooks = [];
|
|
131
|
+
this.hideLoadMore = true;
|
|
132
|
+
this.sortBy = sortBy;
|
|
133
|
+
await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {}));
|
|
134
|
+
if (window.masonry) {
|
|
135
|
+
this.isLayoutSetup = false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (error) { }
|
|
139
|
+
}
|
|
140
|
+
async onLoadMore() {
|
|
141
|
+
try {
|
|
142
|
+
this.currentPage += 1;
|
|
143
|
+
await this.fetchLookbooks({ page: this.currentPage }, true);
|
|
144
|
+
if (window.masonry) {
|
|
145
|
+
this.isLayoutSetup = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) { }
|
|
149
|
+
}
|
|
150
|
+
async fetchCategories() {
|
|
151
|
+
try {
|
|
152
|
+
this.salonCategories = await services.HttpService().fetchSalonCategories();
|
|
153
|
+
}
|
|
154
|
+
catch (error) { }
|
|
155
|
+
}
|
|
156
|
+
onClickLookbook(style) {
|
|
157
|
+
const elLookbookModal = document.createElement('div');
|
|
158
|
+
elLookbookModal.innerHTML = `
|
|
159
|
+
<style-detail
|
|
160
|
+
salon-id=${this.salonId}
|
|
161
|
+
salon-lookbook='${JSON.stringify(style)}'
|
|
162
|
+
></style-detail>
|
|
163
|
+
`;
|
|
164
|
+
document.body.appendChild(elLookbookModal);
|
|
165
|
+
}
|
|
166
|
+
renderHeader() {
|
|
167
|
+
const allFilterOptions = lookbookFilterOptions.concat(([...this.salonCategories]).map(category => {
|
|
168
|
+
return {
|
|
169
|
+
value: category.id,
|
|
170
|
+
label: category.name,
|
|
171
|
+
};
|
|
172
|
+
}));
|
|
173
|
+
return (index.h("div", { class: "view-header", style: {
|
|
174
|
+
display: 'flex',
|
|
175
|
+
flexDirection: 'row',
|
|
176
|
+
justifyContent: 'space-between',
|
|
177
|
+
alignItems: 'center',
|
|
178
|
+
marginBottom: '24px',
|
|
179
|
+
} }, index.h("div", { class: "salon-loobook--serch-result" }, this.totalLookbooks, " ", this.totalLookbooks === 1 ? 'result' : 'results'), index.h("div", { style: {
|
|
180
|
+
display: 'flex',
|
|
181
|
+
flexDirection: 'row',
|
|
182
|
+
alignItems: 'center',
|
|
183
|
+
} }, index.h("div", { class: "salon-loobook--filter-wrapper", style: {
|
|
184
|
+
display: 'flex',
|
|
185
|
+
flexDirection: 'row',
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
marginRight: '16px',
|
|
188
|
+
} }, index.h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Filter by"), index.h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeFiltering(evt.target.value) }, allFilterOptions.map(filterOption => (index.h("option", { value: filterOption.value, selected: String(filterOption.value) === String(this.filterBy) }, filterOption.label))))), index.h("div", { class: "salon-loobook--sort-wrapper", style: {
|
|
189
|
+
display: 'flex',
|
|
190
|
+
flexDirection: 'row',
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
} }, index.h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Sort by"), index.h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeSorting(evt.target.value) }, lookbookSortOptions.map(sortOption => (index.h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy }, sortOption.label))))))));
|
|
193
|
+
}
|
|
194
|
+
render() {
|
|
195
|
+
return (index.h("div", { class: "salon-loobooks" }, index.h("div", null, index.h("div", { class: "view-content" }, this.renderHeader(), this.salonLookbooks.length > 0 && (index.h("div", { class: "salon-loobooks--grid", id: "salon-loobooks--grid" }, this.salonLookbooks.map(style => {
|
|
196
|
+
const { caption, imageThumbMedium, owner } = style;
|
|
197
|
+
return (index.h("div", { class: "salon-lookbook salon-loobooks--grid-item", onClick: () => this.onClickLookbook(style) }, index.h("div", { class: "card", style: {
|
|
198
|
+
background: 'none',
|
|
199
|
+
border: 'none',
|
|
200
|
+
// maxWidth: '200px',
|
|
201
|
+
} }, index.h("div", { class: "salon-lookbook--image", style: {
|
|
202
|
+
borderRadius: '8px',
|
|
203
|
+
overflow: 'hidden',
|
|
204
|
+
minHeight: '80px',
|
|
205
|
+
background: colors.Colors.Gray01,
|
|
206
|
+
} }, index.h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })), owner && (index.h("div", { class: "card-body", style: { paddingLeft: '0' } }, index.h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
|
|
207
|
+
})))), this.salonLookbooks.length > 0 && !this.hideLoadMore && (index.h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } }, index.h("button", { type: "button", class: "btn btn-light btn-lg", onClick: () => this.onLoadMore(), style: {
|
|
208
|
+
background: colors.Colors.White,
|
|
209
|
+
border: `1px solid ${colors.Colors.Gray02}`,
|
|
210
|
+
borderRadius: '4px',
|
|
211
|
+
paddingLeft: '24px',
|
|
212
|
+
paddingRight: '24px',
|
|
213
|
+
} }, this.isLoadingMore ? 'Loading' : 'Load more'))))));
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
SalonLookbook.style = indexCss;
|
|
217
|
+
|
|
218
|
+
exports.salon_lookbook = SalonLookbook;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const colors = require('./colors-
|
|
5
|
+
const index = require('./index-e6bea8f5.js');
|
|
6
|
+
const colors = require('./colors-38421769.js');
|
|
7
7
|
|
|
8
8
|
const indexCss = "salon-ranking{display:block}";
|
|
9
9
|
|
|
@@ -16,30 +16,30 @@ let SalonRanking = class {
|
|
|
16
16
|
getRankingData(ranking) {
|
|
17
17
|
if (ranking === 5) {
|
|
18
18
|
return {
|
|
19
|
-
color: colors.Colors.
|
|
19
|
+
color: colors.Colors.Primary,
|
|
20
20
|
text: 'Viral',
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
if (ranking === 4) {
|
|
24
24
|
return {
|
|
25
|
-
color: colors.Colors.
|
|
25
|
+
color: colors.Colors.Orange03,
|
|
26
26
|
text: 'Advancing',
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
if (ranking === 3) {
|
|
30
30
|
return {
|
|
31
|
-
color: colors.Colors.
|
|
31
|
+
color: colors.Colors.Lilac03,
|
|
32
32
|
text: 'Progressing',
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
if (ranking === 2) {
|
|
36
36
|
return {
|
|
37
|
-
color: colors.Colors.
|
|
37
|
+
color: colors.Colors.Blue03,
|
|
38
38
|
text: 'Building',
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
return {
|
|
42
|
-
color: colors.Colors.
|
|
42
|
+
color: colors.Colors.Gray05,
|
|
43
43
|
text: 'Starting',
|
|
44
44
|
};
|
|
45
45
|
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6bea8f5.js');
|
|
6
|
+
const services = require('./services-eee8f251.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
|
+
let SalonReviews = class {
|
|
27
|
+
constructor(hostRef) {
|
|
28
|
+
index.registerInstance(this, hostRef);
|
|
29
|
+
this.primaryColor = colors.Colors.Primary;
|
|
30
|
+
this.stats = {};
|
|
31
|
+
this.totalReviews = 0;
|
|
32
|
+
this.allReviews = [];
|
|
33
|
+
this.page = 1;
|
|
34
|
+
this.filterBy = [];
|
|
35
|
+
this.sortBy = sortOptions[0].value;
|
|
36
|
+
}
|
|
37
|
+
componentWillLoad() {
|
|
38
|
+
this.fetchData();
|
|
39
|
+
}
|
|
40
|
+
fetchData() {
|
|
41
|
+
this.isLoading = true;
|
|
42
|
+
try {
|
|
43
|
+
services.HttpService().fetchSalonReviews(this.salonId, {
|
|
44
|
+
page: 1,
|
|
45
|
+
sort: this.sortBy,
|
|
46
|
+
limit: pageLimited,
|
|
47
|
+
}).then(response => {
|
|
48
|
+
const { total, stats, data: allReviews } = response;
|
|
49
|
+
this.stats = stats;
|
|
50
|
+
this.totalReviews = total;
|
|
51
|
+
this.allReviews = allReviews;
|
|
52
|
+
this.canLoadMore = total > pageLimited;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch (e) { }
|
|
56
|
+
this.isLoading = false;
|
|
57
|
+
}
|
|
58
|
+
onLoadMore() {
|
|
59
|
+
this.isLoadingMore = true;
|
|
60
|
+
try {
|
|
61
|
+
services.HttpService().fetchSalonReviews(this.salonId, {
|
|
62
|
+
page: this.page + 1,
|
|
63
|
+
sort: this.sortBy,
|
|
64
|
+
limit: pageLimited,
|
|
65
|
+
}).then(response => {
|
|
66
|
+
const { total, data: allReviews } = response;
|
|
67
|
+
this.page = this.page + 1;
|
|
68
|
+
this.totalReviews = total;
|
|
69
|
+
this.allReviews = this.allReviews.concat(allReviews);
|
|
70
|
+
this.canLoadMore = (allReviews || []).length === pageLimited;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (e) { }
|
|
74
|
+
this.isLoadingMore = false;
|
|
75
|
+
}
|
|
76
|
+
onChangeFilter(filterBy) {
|
|
77
|
+
this.isFiltering = true;
|
|
78
|
+
try {
|
|
79
|
+
services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: this.sortBy, limit: pageLimited }, filterBy.length > 0 ? { avg_point: filterBy } : {})).then(response => {
|
|
80
|
+
const { total, data: allReviews } = response;
|
|
81
|
+
this.page = 1;
|
|
82
|
+
this.totalReviews = total;
|
|
83
|
+
this.allReviews = allReviews;
|
|
84
|
+
this.canLoadMore = (allReviews || []).length === pageLimited;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (e) { }
|
|
88
|
+
this.isFiltering = false;
|
|
89
|
+
}
|
|
90
|
+
onChangeSorting(sortBy) {
|
|
91
|
+
this.isSorting = true;
|
|
92
|
+
try {
|
|
93
|
+
services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: sortBy, limit: pageLimited }, this.filterBy.length > 0 ? { avg_point: this.filterBy } : {})).then(response => {
|
|
94
|
+
const { total, data: allReviews } = response;
|
|
95
|
+
this.page = 1;
|
|
96
|
+
this.totalReviews = total;
|
|
97
|
+
this.allReviews = allReviews;
|
|
98
|
+
this.canLoadMore = (allReviews || []).length === pageLimited;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (e) { }
|
|
102
|
+
this.isSorting = false;
|
|
103
|
+
}
|
|
104
|
+
render() {
|
|
105
|
+
const ratingTexts = ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
|
|
106
|
+
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 => {
|
|
107
|
+
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 }) }));
|
|
108
|
+
})), index.h("div", { class: "salon-review--rating--date", style: {
|
|
109
|
+
display: 'flex',
|
|
110
|
+
flexDirection: 'row',
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
marginTop: '-8px',
|
|
113
|
+
} }, 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: {
|
|
114
|
+
background: colors.Colors.Gray01,
|
|
115
|
+
display: 'flex',
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
borderRadius: '4px',
|
|
118
|
+
padding: '16px',
|
|
119
|
+
} }, index.h("div", null, index.h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
|
|
120
|
+
this.filterBy = [];
|
|
121
|
+
this.onChangeFilter([]);
|
|
122
|
+
} }), " ", index.h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
|
|
123
|
+
const isChecked = this.filterBy.indexOf(score) > -1;
|
|
124
|
+
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: () => {
|
|
125
|
+
const newFilter = isChecked ? this.filterBy.filter(fs => fs !== score) : this.filterBy.concat([score]);
|
|
126
|
+
this.filterBy = newFilter;
|
|
127
|
+
this.onChangeFilter(newFilter);
|
|
128
|
+
} }), " ", index.h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", index.h("i", { class: "ri-heart-line", style: {
|
|
129
|
+
fontSize: '16px',
|
|
130
|
+
marginLeft: '4px',
|
|
131
|
+
marginRight: '4px',
|
|
132
|
+
lineHeight: '1',
|
|
133
|
+
} }), " ", index.h("span", { style: { color: colors.Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
|
|
134
|
+
})))), index.h("div", { class: "salon-reviews--list-header", style: {
|
|
135
|
+
display: 'flex',
|
|
136
|
+
flexDirection: 'row',
|
|
137
|
+
justifyContent: 'space-between',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
marginTop: '24px',
|
|
140
|
+
} }, 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) => {
|
|
141
|
+
this.sortBy = evt.target.value;
|
|
142
|
+
this.onChangeSorting(evt.target.value);
|
|
143
|
+
}, style: {
|
|
144
|
+
display: 'flex',
|
|
145
|
+
alignItems: 'center',
|
|
146
|
+
backgroundColor: colors.Colors.Gray01,
|
|
147
|
+
borderColor: colors.Colors.Gray01,
|
|
148
|
+
borderRadius: '4px',
|
|
149
|
+
height: '40px',
|
|
150
|
+
width: '130px',
|
|
151
|
+
} }, 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) => {
|
|
152
|
+
const user = review.user || {};
|
|
153
|
+
return (index.h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
|
|
154
|
+
borderBottom: `1px solid ${colors.Colors.Gray02}`,
|
|
155
|
+
marginBottom: '24px',
|
|
156
|
+
paddingBottom: '24px',
|
|
157
|
+
} }, 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: {
|
|
158
|
+
color: score <= review.point ? this.primaryColor : colors.Colors.Gray04,
|
|
159
|
+
fontSize: '16px',
|
|
160
|
+
marginRight: '4px',
|
|
161
|
+
} }))), 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: {
|
|
162
|
+
display: 'flex',
|
|
163
|
+
flexDirection: 'row',
|
|
164
|
+
overflowX: 'auto',
|
|
165
|
+
} }, review.photos.map(fileObj => (index.h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
|
|
166
|
+
position: 'relative',
|
|
167
|
+
cursor: 'pointer',
|
|
168
|
+
marginTop: '16px',
|
|
169
|
+
marginRight: '12px',
|
|
170
|
+
} }, index.h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
|
|
171
|
+
})), index.h("div", { class: "salon-reviews--list-footer", style: {
|
|
172
|
+
textAlign: 'center',
|
|
173
|
+
paddingTop: '16px',
|
|
174
|
+
paddingBottom: '16px',
|
|
175
|
+
} }, index.h("button", { class: "btn btn-light btn-lg", style: {
|
|
176
|
+
background: colors.Colors.White,
|
|
177
|
+
border: `1px solid ${colors.Colors.Gray02}`,
|
|
178
|
+
borderRadius: '4px',
|
|
179
|
+
paddingLeft: '24px',
|
|
180
|
+
paddingRight: '24px',
|
|
181
|
+
}, onClick: () => this.onLoadMore() }, "Load more"))));
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
SalonReviews.style = indexCss;
|
|
185
|
+
|
|
186
|
+
exports.salon_reviews = SalonReviews;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6bea8f5.js');
|
|
6
|
+
const services = require('./services-eee8f251.js');
|
|
7
|
+
const colors = require('./colors-38421769.js');
|
|
8
|
+
require('./_commonjsHelpers-5cfcba41.js');
|
|
9
|
+
|
|
10
|
+
const indexCss = "";
|
|
11
|
+
|
|
12
|
+
let SalonServices = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
this.buttonClass = 'btn btn-light';
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
this.fetchData();
|
|
19
|
+
}
|
|
20
|
+
async fetchData() {
|
|
21
|
+
this.isLoading = true;
|
|
22
|
+
try {
|
|
23
|
+
this.salonServices = await services.HttpService().fetchSalonServices(this.salonId);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
this.salonServices = [];
|
|
27
|
+
}
|
|
28
|
+
this.isLoading = false;
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
if (this.isLoading) {
|
|
32
|
+
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: {
|
|
33
|
+
backgroundColor: colors.Colors.Gray02,
|
|
34
|
+
float: 'left',
|
|
35
|
+
marginRight: '12px',
|
|
36
|
+
height: '30px',
|
|
37
|
+
width: '120px',
|
|
38
|
+
} })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index$1) => {
|
|
39
|
+
return (index.h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
|
|
40
|
+
backgroundColor: colors.Colors.Gray03,
|
|
41
|
+
height: '20px',
|
|
42
|
+
width: '120px',
|
|
43
|
+
} }), 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 ? {
|
|
44
|
+
marginTop: '12px',
|
|
45
|
+
paddingTop: '12px',
|
|
46
|
+
borderTop: `1px solid ${colors.Colors.Gray01}`,
|
|
47
|
+
} : {}) }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
|
|
48
|
+
backgroundColor: colors.Colors.Gray01,
|
|
49
|
+
height: '16px',
|
|
50
|
+
width: '120px',
|
|
51
|
+
} })), index.h("div", { style: { marginTop: '4px' } }, index.h("div", { style: {
|
|
52
|
+
backgroundColor: colors.Colors.Gray01,
|
|
53
|
+
height: '16px',
|
|
54
|
+
width: '240px',
|
|
55
|
+
} })))))))));
|
|
56
|
+
})));
|
|
57
|
+
}
|
|
58
|
+
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 => {
|
|
59
|
+
const hasMultipleCates = (serviceGroup.data || []).length > 1;
|
|
60
|
+
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 ? {
|
|
61
|
+
marginTop: '12px',
|
|
62
|
+
paddingTop: '12px',
|
|
63
|
+
borderTop: `1px solid ${colors.Colors.Gray01}`,
|
|
64
|
+
} : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (index.h("div", { style: {
|
|
65
|
+
display: 'block',
|
|
66
|
+
marginTop: '4px',
|
|
67
|
+
fontSize: '90%',
|
|
68
|
+
color: colors.Colors.Gray05,
|
|
69
|
+
} }, [
|
|
70
|
+
!service.hideDuration ? `${service.duration} mins` : '',
|
|
71
|
+
!service.hidePrice ? `$${service.price}` : '',
|
|
72
|
+
].filter(field => !!field).join(' · ')))))))))))));
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
SalonServices.style = indexCss;
|
|
77
|
+
|
|
78
|
+
exports.salon_services = SalonServices;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6bea8f5.js');
|
|
6
|
+
const colors = require('./colors-38421769.js');
|
|
7
|
+
const services = require('./services-eee8f251.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
|
+
let SalonStylists = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
index.registerInstance(this, hostRef);
|
|
16
|
+
this.page = 1;
|
|
17
|
+
}
|
|
18
|
+
componentWillLoad() {
|
|
19
|
+
this.fetchData();
|
|
20
|
+
}
|
|
21
|
+
async fetchData() {
|
|
22
|
+
this.isLoading = true;
|
|
23
|
+
try {
|
|
24
|
+
const { total, data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
|
|
25
|
+
this.totalStylists = total;
|
|
26
|
+
this.salonStylists = data;
|
|
27
|
+
this.canLoadMore = data.length === pageLimit;
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
this.totalStylists = 0;
|
|
31
|
+
this.salonStylists = [];
|
|
32
|
+
this.canLoadMore = false;
|
|
33
|
+
}
|
|
34
|
+
this.isLoading = false;
|
|
35
|
+
}
|
|
36
|
+
async onLoadMore() {
|
|
37
|
+
this.isLoadingMore = true;
|
|
38
|
+
try {
|
|
39
|
+
const { data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
|
|
40
|
+
this.salonStylists = this.salonStylists.concat(data || []);
|
|
41
|
+
this.canLoadMore = data.length === pageLimit;
|
|
42
|
+
this.page += 1;
|
|
43
|
+
}
|
|
44
|
+
catch (e) { }
|
|
45
|
+
this.isLoadingMore = false;
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
if (this.isLoading) {
|
|
49
|
+
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: {
|
|
50
|
+
background: 'none',
|
|
51
|
+
border: 'none',
|
|
52
|
+
overflow: 'hidden',
|
|
53
|
+
} }, index.h("div", { class: "salon-stylist--avatar", style: {
|
|
54
|
+
backgroundColor: colors.Colors.Gray01,
|
|
55
|
+
backgroundRepeat: 'no-repeat',
|
|
56
|
+
backgroundPosition: 'center top',
|
|
57
|
+
backgroundSize: 'cover',
|
|
58
|
+
border: `1px solid ${colors.Colors.Gray01}`,
|
|
59
|
+
borderRadius: '8px',
|
|
60
|
+
position: 'relative',
|
|
61
|
+
display: 'flex',
|
|
62
|
+
width: '100%',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
} }), index.h("div", { class: "card-body" }, index.h("div", { key: `stylist--${fakeId}--${index$1}`, style: {
|
|
66
|
+
backgroundColor: colors.Colors.Gray01,
|
|
67
|
+
height: '16px',
|
|
68
|
+
width: '120px',
|
|
69
|
+
margin: 'auto',
|
|
70
|
+
} })))))))));
|
|
71
|
+
}
|
|
72
|
+
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: {
|
|
73
|
+
background: 'none',
|
|
74
|
+
border: 'none',
|
|
75
|
+
overflow: 'hidden',
|
|
76
|
+
} }, index.h("div", { class: "salon-stylist--avatar", style: {
|
|
77
|
+
backgroundImage: `url("${stylist.avatar}")`,
|
|
78
|
+
backgroundColor: colors.Colors.Gray01,
|
|
79
|
+
backgroundRepeat: 'no-repeat',
|
|
80
|
+
backgroundPosition: 'center top',
|
|
81
|
+
backgroundSize: 'cover',
|
|
82
|
+
border: `1px solid ${colors.Colors.Gray01}`,
|
|
83
|
+
borderRadius: '8px',
|
|
84
|
+
position: 'relative',
|
|
85
|
+
display: 'flex',
|
|
86
|
+
width: '100%',
|
|
87
|
+
alignItems: 'center',
|
|
88
|
+
justifyContent: 'center',
|
|
89
|
+
} }, !stylist.avatar && (index.h("span", { style: {
|
|
90
|
+
fontSize: '32px',
|
|
91
|
+
fontWeight: 'bold',
|
|
92
|
+
textTransform: 'uppercase',
|
|
93
|
+
} }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), index.h("div", { class: "card-body" }, index.h("div", { style: {
|
|
94
|
+
fontSize: '18px',
|
|
95
|
+
fontWeight: '600',
|
|
96
|
+
textAlign: 'center',
|
|
97
|
+
} }, stylist.fullName))))))), this.canLoadMore && (index.h("div", { class: "view-footer", style: {
|
|
98
|
+
textAlign: 'center',
|
|
99
|
+
paddingTop: '32px',
|
|
100
|
+
paddingBottom: '16px',
|
|
101
|
+
} }, index.h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
|
|
102
|
+
background: colors.Colors.White,
|
|
103
|
+
border: `1px solid ${colors.Colors.Gray02}`,
|
|
104
|
+
borderRadius: '4px',
|
|
105
|
+
paddingLeft: '24px',
|
|
106
|
+
paddingRight: '24px',
|
|
107
|
+
}, onClick: () => this.onLoadMore() }, "Load more")))));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
SalonStylists.style = indexCss;
|
|
111
|
+
|
|
112
|
+
exports.salon_stylists = SalonStylists;
|