favesalon-embed 0.0.4 → 1.0.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/chat-button.cjs.entry.js +118 -0
- package/dist/cjs/colors-38421769.js +69 -0
- package/dist/cjs/favesalon-embed.cjs.js +24 -0
- package/dist/cjs/google-map_5.cjs.entry.js +310 -0
- package/{cjs/index-d5de0b9d.js → dist/cjs/index-47c2a5f6.js} +513 -199
- package/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/cjs/relativeTime-3721080d.js +9 -0
- package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +7 -6
- package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +8 -8
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
- package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +9 -8
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
- package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +28 -58
- package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +9 -8
- 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/cjs/services-125c82d8.js +21492 -0
- package/dist/cjs/style-detail.cjs.entry.js +312 -0
- package/dist/cjs/user-avatar.cjs.entry.js +45 -0
- package/{collection → dist/collection}/collection-manifest.json +5 -5
- package/dist/collection/components/chat-button/index.css +122 -0
- package/dist/collection/components/chat-button/index.js +218 -0
- package/dist/collection/components/chat-conversation/index.js +103 -0
- 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 +90 -0
- package/{collection → dist/collection}/components/salon-booking/index.css +11 -20
- 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.js +77 -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/collection/components/salon-latest-styles/index.js +183 -0
- package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +7 -4
- package/dist/collection/components/salon-locations/index.js +143 -0
- package/{collection → dist/collection}/components/salon-lookbook/index.css +3 -9
- package/dist/collection/components/salon-lookbook/index.js +368 -0
- package/dist/collection/components/salon-ranking/index.js +117 -0
- package/{collection → dist/collection}/components/salon-reviews/index.css +3 -0
- package/dist/collection/components/salon-reviews/index.js +249 -0
- package/dist/collection/components/salon-schedules/index.css +18 -0
- package/dist/collection/components/salon-schedules/index.js +167 -0
- 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.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.js +134 -0
- package/dist/collection/constants/colors.js +65 -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/{collection → dist/collection}/types/review.js +9 -5
- package/dist/collection/types/salon.js +58 -0
- package/dist/collection/types/style.js +128 -0
- package/{collection → dist/collection}/types/stylist.js +12 -9
- package/dist/collection/types/user.js +10 -0
- package/{custom-elements → dist/custom-elements}/index.d.ts +18 -18
- package/dist/custom-elements/index.js +28340 -0
- package/dist/esm/chat-button.entry.js +114 -0
- package/dist/esm/colors-ea36347a.js +67 -0
- package/dist/esm/favesalon-embed.js +19 -0
- package/dist/esm/google-map_5.entry.js +302 -0
- package/{esm/index-0f8eed73.js → dist/esm/index-3fae868e.js} +512 -200
- package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +19 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/relativeTime-cd452e6d.js +7 -0
- package/{esm → dist/esm}/salon-booking-modal.entry.js +7 -6
- package/{esm → dist/esm}/salon-booking.entry.js +7 -7
- package/dist/esm/salon-gift-card-modal.entry.js +25 -0
- package/{esm → dist/esm}/salon-gift-card.entry.js +8 -7
- package/dist/esm/salon-latest-reviews.entry.js +93 -0
- package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +29 -58
- package/{esm → dist/esm}/salon-ranking.entry.js +9 -8
- package/dist/esm/salon-reviews.entry.js +189 -0
- package/dist/esm/salon-services.entry.js +77 -0
- package/dist/esm/salon-stylists.entry.js +114 -0
- package/dist/esm/services-40a3e622.js +21485 -0
- package/dist/esm/style-detail.entry.js +308 -0
- package/dist/esm/user-avatar.entry.js +41 -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/dist/favesalon-embed/p-019c5ccd.entry.js +1 -0
- package/dist/favesalon-embed/p-083a8821.entry.js +1 -0
- package/dist/favesalon-embed/p-0d0ed9ea.entry.js +1 -0
- package/dist/favesalon-embed/p-119db8de.entry.js +1 -0
- package/dist/favesalon-embed/p-1432c51b.entry.js +1 -0
- package/dist/favesalon-embed/p-22093506.entry.js +1 -0
- package/dist/favesalon-embed/p-32b314e9.js +2 -0
- package/dist/favesalon-embed/p-4a5eca9a.js +6 -0
- package/dist/favesalon-embed/p-58d2e9be.js +1 -0
- package/dist/favesalon-embed/p-71404b6a.entry.js +1 -0
- package/dist/favesalon-embed/p-857c3a61.entry.js +1 -0
- package/dist/favesalon-embed/p-99ec77f7.entry.js +1 -0
- package/dist/favesalon-embed/p-a33331cc.js +1 -0
- package/dist/favesalon-embed/p-b0c3673a.entry.js +1 -0
- package/dist/favesalon-embed/p-b287b1ea.entry.js +1 -0
- package/dist/favesalon-embed/p-b3af7842.entry.js +1 -0
- package/dist/favesalon-embed/p-b630ae68.js +1580 -0
- package/dist/favesalon-embed/p-ce2c1c9a.entry.js +1 -0
- package/dist/favesalon-embed/p-d9b7ad58.entry.js +1 -0
- package/dist/favesalon-embed/p-fc9a5551.js +6 -0
- package/dist/types/components/chat-button/index.d.ts +24 -0
- package/dist/types/components/google-map/index.d.ts +5 -0
- package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -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 +3 -3
- 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 +1 -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.d.ts +76 -59
- package/dist/types/constants/colors.d.ts +65 -0
- package/dist/types/mocks/users.d.ts +10 -0
- package/dist/types/services/services.d.ts +75 -0
- package/{types → dist/types}/stencil-public-runtime.d.ts +85 -11
- package/dist/types/types/chat.d.ts +17 -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/dist/types/types/style.d.ts +88 -0
- package/{types → dist/types}/types/stylist.d.ts +1 -1
- package/{types → dist/types}/types/user.d.ts +2 -2
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +19 -14
- package/readme.md +24 -7
- 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/index-95daad08.js +0 -1928
- package/cjs/loader.cjs.js +0 -22
- package/cjs/salon-contact_4.cjs.entry.js +0 -155
- package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
- package/cjs/salon-info.cjs.entry.js +0 -35
- package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
- package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
- package/cjs/salon-reviews.cjs.entry.js +0 -205
- package/cjs/salon-services.cjs.entry.js +0 -47
- package/cjs/salon-stylists.cjs.entry.js +0 -54
- package/cjs/services-f1102d4a.js +0 -5762
- package/collection/components/google-map/index.js +0 -97
- package/collection/components/salon-booking/index.js +0 -121
- package/collection/components/salon-booking/salon-booking-modal.js +0 -88
- package/collection/components/salon-contact/index.js +0 -88
- package/collection/components/salon-gift-card/index.css +0 -25
- package/collection/components/salon-gift-card/index.js +0 -120
- package/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -48
- package/collection/components/salon-info/index.css +0 -3
- package/collection/components/salon-info/index.js +0 -97
- 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.js +0 -376
- package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
- package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
- package/collection/components/salon-ranking/index.js +0 -114
- package/collection/components/salon-reviews/index.js +0 -317
- 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 -113
- 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/components/user-avatar/index.css +0 -0
- package/collection/components/user-avatar/index.js +0 -127
- package/collection/constants/colors.js +0 -91
- package/collection/services/services.js +0 -225
- package/collection/types/common.js +0 -2
- package/collection/types/salon.js +0 -52
- package/collection/types/style.js +0 -103
- package/collection/types/user.js +0 -10
- package/custom-elements/index.js +0 -12125
- package/esm/colors-1ec90c5f.js +0 -93
- package/esm/favesalon-embed.js +0 -18
- package/esm/google-map.entry.js +0 -43
- package/esm/index-09d43e3e.js +0 -1926
- package/esm/loader.js +0 -18
- package/esm/polyfills/css-shim.js +0 -1
- package/esm/salon-contact_4.entry.js +0 -148
- package/esm/salon-gift-card-modal.entry.js +0 -21
- package/esm/salon-info.entry.js +0 -31
- package/esm/salon-latest-reviews.entry.js +0 -54
- package/esm/salon-lookbook-modal.entry.js +0 -137
- package/esm/salon-reviews.entry.js +0 -201
- package/esm/salon-services.entry.js +0 -43
- package/esm/salon-stylists.entry.js +0 -50
- package/esm/services-74d84ca9.js +0 -5756
- package/favesalon-embed/favesalon-embed.esm.js +0 -1
- package/favesalon-embed/p-0188d4dc.entry.js +0 -1
- package/favesalon-embed/p-0318501e.js +0 -1
- package/favesalon-embed/p-078f242d.entry.js +0 -1
- package/favesalon-embed/p-13e23c61.entry.js +0 -1
- package/favesalon-embed/p-17df13ad.js +0 -1
- package/favesalon-embed/p-1a3179c8.entry.js +0 -1
- package/favesalon-embed/p-20aa75de.js +0 -6
- package/favesalon-embed/p-2901a6d6.entry.js +0 -1
- package/favesalon-embed/p-2b861430.entry.js +0 -1
- package/favesalon-embed/p-44d810a0.js +0 -1
- package/favesalon-embed/p-4a5eca9a.js +0 -6
- package/favesalon-embed/p-4c68700f.entry.js +0 -1
- package/favesalon-embed/p-4e2d7b29.js +0 -1
- package/favesalon-embed/p-6b845bf1.entry.js +0 -1
- package/favesalon-embed/p-7350f6b5.entry.js +0 -1
- package/favesalon-embed/p-897c2b1c.entry.js +0 -1
- package/favesalon-embed/p-8e60f56f.entry.js +0 -1
- package/favesalon-embed/p-a49afdc1.entry.js +0 -1
- package/favesalon-embed/p-c93867c4.entry.js +0 -1
- package/favesalon-embed/p-ea6a097f.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-lookbook/salon-lookbook-modal.d.ts +0 -13
- package/types/components/salon-reviews/index.d.ts +0 -24
- 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 -26
- package/types/types/common.d.ts +0 -2
- package/types/types/style.d.ts +0 -59
- /package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -0
- /package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
- /package/{cjs → dist/cjs}/index.cjs.js +0 -0
- /package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
- /package/{esm/index.js → dist/collection/components/salon-info/index.css} +0 -0
- /package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -0
- /package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
- /package/{collection → dist/collection}/components/salon-stylists/index.css +0 -0
- /package/{collection/components/salon-locations → dist/collection/components/user-avatar}/index.css +0 -0
- /package/{collection → dist/collection}/global/global.js +0 -0
- /package/{collection → dist/collection}/index.js +0 -0
- /package/{collection → dist/collection}/types/service.js +0 -0
- /package/{collection → dist/collection}/utils/utils.js +0 -0
- /package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -0
- /package/{esm → dist/esm}/global-e1089ffd.js +0 -0
- /package/{esm → dist/esm}/polyfills/core-js.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/{esm → dist/esm}/utils-e97485e0.js +0 -0
- /package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
- /package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
- /package/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -0
- /package/{index.cjs.js → dist/index.cjs.js} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{collection/components/salon-services/index.css → dist/types/components/chat-conversation/index.d.ts} +0 -0
- /package/{types → dist/types}/components/salon-booking/index.d.ts +0 -0
- /package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
- /package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
- /package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
- /package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
- /package/{types → dist/types}/index.d.ts +0 -0
- /package/{types → dist/types}/types/service.d.ts +0 -0
- /package/{types → dist/types}/utils/utils.d.ts +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import { Colors } from '../../constants/colors';
|
|
4
|
+
import { shortDateYearFormat } from '../../types/common';
|
|
5
|
+
import HttpService from '../../services/services';
|
|
6
|
+
const pageLimited = 10;
|
|
7
|
+
const sortOptions = [{
|
|
8
|
+
value: 'newest',
|
|
9
|
+
label: 'Newest first',
|
|
10
|
+
}, {
|
|
11
|
+
value: 'oldest',
|
|
12
|
+
label: 'Oldest first',
|
|
13
|
+
}, {
|
|
14
|
+
value: 'rating_desc',
|
|
15
|
+
label: 'High rating first',
|
|
16
|
+
}, {
|
|
17
|
+
value: 'rating_asc',
|
|
18
|
+
label: 'Low rating first',
|
|
19
|
+
}];
|
|
20
|
+
export class SalonReviews {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.salonId = undefined;
|
|
23
|
+
this.primaryColor = Colors.Primary;
|
|
24
|
+
this.salonInfo = undefined;
|
|
25
|
+
this.stats = {};
|
|
26
|
+
this.totalReviews = 0;
|
|
27
|
+
this.allReviews = [];
|
|
28
|
+
this.isLoading = undefined;
|
|
29
|
+
this.isSorting = undefined;
|
|
30
|
+
this.isFiltering = undefined;
|
|
31
|
+
this.isLoadingMore = undefined;
|
|
32
|
+
this.canLoadMore = undefined;
|
|
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
|
+
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
|
+
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
|
+
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
|
+
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 (h("div", { class: "view view--salon-reviews" }, h("div", { class: "salon-reviews--filters" }, h("div", { class: "salon-reviews--score" }, h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => {
|
|
107
|
+
return (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.Gray04 }) }));
|
|
108
|
+
})), h("div", { class: "salon-review--rating--date", style: {
|
|
109
|
+
display: 'flex',
|
|
110
|
+
flexDirection: 'row',
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
marginTop: '-8px',
|
|
113
|
+
} }, h("span", { style: { fontSize: '24px' } }, this.stats.reviewPoint, "/5"), " ", h("span", { style: { color: Colors.Gray04, marginLeft: '8px' } }, "(", this.stats.totalReviews, " reviews)"))), h("div", { class: "salon-reviews--filters--options", style: { marginTop: '24px' } }, h("div", { style: {
|
|
114
|
+
background: Colors.Gray01,
|
|
115
|
+
display: 'flex',
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
borderRadius: '4px',
|
|
118
|
+
padding: '16px',
|
|
119
|
+
} }, h("div", null, h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
|
|
120
|
+
this.filterBy = [];
|
|
121
|
+
this.onChangeFilter([]);
|
|
122
|
+
} }), " ", h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
|
|
123
|
+
const isChecked = this.filterBy.indexOf(score) > -1;
|
|
124
|
+
return (h("div", { key: `salon-reviews--filters-score--${score}`, style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, 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
|
+
} }), " ", h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", h("i", { class: "ri-heart-line", style: {
|
|
129
|
+
fontSize: '16px',
|
|
130
|
+
marginLeft: '4px',
|
|
131
|
+
marginRight: '4px',
|
|
132
|
+
lineHeight: '1',
|
|
133
|
+
} }), " ", h("span", { style: { color: Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
|
|
134
|
+
})))), 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
|
+
} }, h("div", { class: "view--salon-reviews--counter" }, this.totalReviews, " ", this.totalReviews === 1 ? `review` : `reviews`), h("div", { style: { display: 'flex', alignItems: 'center' } }, h("label", { style: { marginRight: '8px', color: Colors.Gray04 } }, "Sort by"), 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.Gray01,
|
|
147
|
+
borderColor: Colors.Gray01,
|
|
148
|
+
borderRadius: '4px',
|
|
149
|
+
height: '40px',
|
|
150
|
+
width: '130px',
|
|
151
|
+
} }, sortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy, key: `search-filter--select-option--${sortOption.value}` }, sortOption.label)))))), h("div", { class: "salon-reviews--list-content", style: { marginTop: '24px' } }, this.allReviews.map((review, idx) => {
|
|
152
|
+
const user = review.user || {};
|
|
153
|
+
return (h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
|
|
154
|
+
borderBottom: `1px solid ${Colors.Gray02}`,
|
|
155
|
+
marginBottom: '24px',
|
|
156
|
+
paddingBottom: '24px',
|
|
157
|
+
} }, h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: h("span", { style: { fontSize: '18px', fontWeight: '600', color: Colors.TextColor } }, (user.firstName || user.lastName) ? `${user.firstName || ''} ${user.lastName || ''}` : ''), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (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.Gray04,
|
|
159
|
+
fontSize: '16px',
|
|
160
|
+
marginRight: '4px',
|
|
161
|
+
} }))), review.createdDate && (h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, dayjs(review.createdDate).format(shortDateYearFormat)))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: '600' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (h("div", { style: {
|
|
162
|
+
display: 'flex',
|
|
163
|
+
flexDirection: 'row',
|
|
164
|
+
overflowX: 'auto',
|
|
165
|
+
} }, review.photos.map(fileObj => (h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
|
|
166
|
+
position: 'relative',
|
|
167
|
+
cursor: 'pointer',
|
|
168
|
+
marginTop: '16px',
|
|
169
|
+
marginRight: '12px',
|
|
170
|
+
} }, h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
|
|
171
|
+
})), h("div", { class: "salon-reviews--list-footer", style: {
|
|
172
|
+
textAlign: 'center',
|
|
173
|
+
paddingTop: '16px',
|
|
174
|
+
paddingBottom: '16px',
|
|
175
|
+
} }, h("button", { class: "btn btn-light btn-lg", style: {
|
|
176
|
+
background: Colors.White,
|
|
177
|
+
border: `1px solid ${Colors.Gray02}`,
|
|
178
|
+
borderRadius: '4px',
|
|
179
|
+
paddingLeft: '24px',
|
|
180
|
+
paddingRight: '24px',
|
|
181
|
+
}, onClick: () => this.onLoadMore() }, "Load more"))));
|
|
182
|
+
}
|
|
183
|
+
static get is() { return "salon-reviews"; }
|
|
184
|
+
static get originalStyleUrls() {
|
|
185
|
+
return {
|
|
186
|
+
"$": ["index.css"]
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
static get styleUrls() {
|
|
190
|
+
return {
|
|
191
|
+
"$": ["index.css"]
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
static get properties() {
|
|
195
|
+
return {
|
|
196
|
+
"salonId": {
|
|
197
|
+
"type": "number",
|
|
198
|
+
"mutable": false,
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "number",
|
|
201
|
+
"resolved": "number",
|
|
202
|
+
"references": {}
|
|
203
|
+
},
|
|
204
|
+
"required": false,
|
|
205
|
+
"optional": false,
|
|
206
|
+
"docs": {
|
|
207
|
+
"tags": [],
|
|
208
|
+
"text": ""
|
|
209
|
+
},
|
|
210
|
+
"attribute": "salon-id",
|
|
211
|
+
"reflect": false
|
|
212
|
+
},
|
|
213
|
+
"primaryColor": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"mutable": false,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "string",
|
|
218
|
+
"resolved": "string",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": false,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": ""
|
|
226
|
+
},
|
|
227
|
+
"attribute": "primary-color",
|
|
228
|
+
"reflect": false,
|
|
229
|
+
"defaultValue": "Colors.Primary"
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
static get states() {
|
|
234
|
+
return {
|
|
235
|
+
"salonInfo": {},
|
|
236
|
+
"stats": {},
|
|
237
|
+
"totalReviews": {},
|
|
238
|
+
"allReviews": {},
|
|
239
|
+
"isLoading": {},
|
|
240
|
+
"isSorting": {},
|
|
241
|
+
"isFiltering": {},
|
|
242
|
+
"isLoadingMore": {},
|
|
243
|
+
"canLoadMore": {},
|
|
244
|
+
"page": {},
|
|
245
|
+
"filterBy": {},
|
|
246
|
+
"sortBy": {}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
salon-schedules .salon-schedules--day {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
min-width: 240px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@media (min-width: 768px) {
|
|
9
|
+
salon-schedules .salon-schedules--dates {
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
margin-left: -32px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
salon-schedules .salon-schedules--day {
|
|
15
|
+
float: left;
|
|
16
|
+
padding-left: 32px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { BusinessHourStatus } from '../../types/salon';
|
|
3
|
+
import HttpService from '../../services/services';
|
|
4
|
+
import { Colors } from '../../constants/colors';
|
|
5
|
+
export class SalonSchedules {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.salonId = undefined;
|
|
8
|
+
this.salonInfo = undefined;
|
|
9
|
+
this.isLoading = undefined;
|
|
10
|
+
this.withBorder = undefined;
|
|
11
|
+
this.salonInfoState = undefined;
|
|
12
|
+
}
|
|
13
|
+
componentWillLoad() {
|
|
14
|
+
if (this.salonInfo) {
|
|
15
|
+
this.salonInfoState = JSON.parse(this.salonInfo);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.fetchData();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
fetchData() {
|
|
22
|
+
try {
|
|
23
|
+
HttpService().fetchSalonInfo(this.salonId)
|
|
24
|
+
.then(salonInfo => this.salonInfoState = salonInfo);
|
|
25
|
+
}
|
|
26
|
+
catch (e) { }
|
|
27
|
+
}
|
|
28
|
+
renderBusinessHour(businessHour) {
|
|
29
|
+
if (businessHour.status === BusinessHourStatus.ByAppointment) {
|
|
30
|
+
return 'By Appointment';
|
|
31
|
+
}
|
|
32
|
+
if (businessHour.status === BusinessHourStatus.Close) {
|
|
33
|
+
return 'Close';
|
|
34
|
+
}
|
|
35
|
+
return `${businessHour.openTime} - ${businessHour.closeTime}`;
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
if (this.isLoading) {
|
|
39
|
+
return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
|
|
40
|
+
backgroundColor: Colors.Gray02,
|
|
41
|
+
height: '20px',
|
|
42
|
+
width: '120px',
|
|
43
|
+
} }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
|
|
44
|
+
backgroundColor: Colors.Gray01,
|
|
45
|
+
height: '16px',
|
|
46
|
+
width: '30%',
|
|
47
|
+
} }), h("div", { style: {
|
|
48
|
+
backgroundColor: Colors.Gray01,
|
|
49
|
+
height: '16px',
|
|
50
|
+
width: '40%',
|
|
51
|
+
marginTop: '8px',
|
|
52
|
+
} }), h("div", { style: {
|
|
53
|
+
backgroundColor: Colors.Gray01,
|
|
54
|
+
height: '16px',
|
|
55
|
+
width: '75%',
|
|
56
|
+
marginTop: '12px',
|
|
57
|
+
} }), h("div", { style: {
|
|
58
|
+
backgroundColor: Colors.Gray01,
|
|
59
|
+
height: '16px',
|
|
60
|
+
width: '75%',
|
|
61
|
+
marginTop: '8px',
|
|
62
|
+
} })), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
|
|
63
|
+
overflow: 'hidden',
|
|
64
|
+
marginLeft: '-16px',
|
|
65
|
+
marginBottom: '-16px',
|
|
66
|
+
} }, [1, 2, 3, 4, 5, 6, 7].map((fakeId, idx) => (h("div", { key: `style-listing--item-${fakeId}-${idx}`, style: {
|
|
67
|
+
float: 'left',
|
|
68
|
+
paddingLeft: '16px',
|
|
69
|
+
marginBottom: '16px',
|
|
70
|
+
} }, h("div", { style: {
|
|
71
|
+
backgroundColor: Colors.Gray01,
|
|
72
|
+
width: '120px',
|
|
73
|
+
height: '20px',
|
|
74
|
+
} })))))))));
|
|
75
|
+
}
|
|
76
|
+
const { about, businessHours, } = (this.salonInfoState || {});
|
|
77
|
+
return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "About"), about && (h("div", { class: "salon-contact--info--desc", style: { fontSize: '16px', marginTop: '16px' }, innerHTML: about })), businessHours && businessHours.length > 0 && (h("div", { class: "salon-schedules", style: { marginTop: '24px' } }, h("div", { class: "salon-schedules--title", style: { fontSize: '16px', fontWeight: 'bold' } }, "Working hours"), h("div", { class: "salon-schedules--dates" }, h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Mon"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[0]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Tue"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[1]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Wed"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[2]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Thur"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[3]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Fri"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[4]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sat"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[5]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sun"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[6])))))))));
|
|
78
|
+
}
|
|
79
|
+
static get is() { return "salon-schedules"; }
|
|
80
|
+
static get originalStyleUrls() {
|
|
81
|
+
return {
|
|
82
|
+
"$": ["index.css"]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static get styleUrls() {
|
|
86
|
+
return {
|
|
87
|
+
"$": ["index.css"]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get properties() {
|
|
91
|
+
return {
|
|
92
|
+
"salonId": {
|
|
93
|
+
"type": "number",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "number",
|
|
97
|
+
"resolved": "number",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
105
|
+
},
|
|
106
|
+
"attribute": "salon-id",
|
|
107
|
+
"reflect": false
|
|
108
|
+
},
|
|
109
|
+
"salonInfo": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"mutable": false,
|
|
112
|
+
"complexType": {
|
|
113
|
+
"original": "string",
|
|
114
|
+
"resolved": "string",
|
|
115
|
+
"references": {}
|
|
116
|
+
},
|
|
117
|
+
"required": false,
|
|
118
|
+
"optional": true,
|
|
119
|
+
"docs": {
|
|
120
|
+
"tags": [],
|
|
121
|
+
"text": ""
|
|
122
|
+
},
|
|
123
|
+
"attribute": "salon-info",
|
|
124
|
+
"reflect": false
|
|
125
|
+
},
|
|
126
|
+
"isLoading": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "boolean",
|
|
131
|
+
"resolved": "boolean",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": true,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": ""
|
|
139
|
+
},
|
|
140
|
+
"attribute": "is-loading",
|
|
141
|
+
"reflect": false
|
|
142
|
+
},
|
|
143
|
+
"withBorder": {
|
|
144
|
+
"type": "boolean",
|
|
145
|
+
"mutable": false,
|
|
146
|
+
"complexType": {
|
|
147
|
+
"original": "boolean",
|
|
148
|
+
"resolved": "boolean",
|
|
149
|
+
"references": {}
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"optional": true,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": ""
|
|
156
|
+
},
|
|
157
|
+
"attribute": "with-border",
|
|
158
|
+
"reflect": false
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
static get states() {
|
|
163
|
+
return {
|
|
164
|
+
"salonInfoState": {}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import sortBy from 'lodash/sortBy';
|
|
3
|
+
import { Colors } from '../../constants/colors';
|
|
4
|
+
import HttpService from '../../services/services';
|
|
5
|
+
export class SalonServices {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.salonId = undefined;
|
|
8
|
+
this.buttonClass = 'btn btn-light';
|
|
9
|
+
this.salonServices = undefined;
|
|
10
|
+
this.isLoading = undefined;
|
|
11
|
+
}
|
|
12
|
+
componentWillLoad() {
|
|
13
|
+
this.fetchData();
|
|
14
|
+
}
|
|
15
|
+
async fetchData() {
|
|
16
|
+
this.isLoading = true;
|
|
17
|
+
try {
|
|
18
|
+
this.salonServices = await HttpService().fetchSalonServices(this.salonId);
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
this.salonServices = [];
|
|
22
|
+
}
|
|
23
|
+
this.isLoading = false;
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
if (this.isLoading) {
|
|
27
|
+
return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray01}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden' } }, [1, 2, 3, 4, 5, 6].map((fakeId, index) => (h("div", { key: `service-group--${fakeId}--${index}`, style: {
|
|
28
|
+
backgroundColor: Colors.Gray02,
|
|
29
|
+
float: 'left',
|
|
30
|
+
marginRight: '12px',
|
|
31
|
+
height: '30px',
|
|
32
|
+
width: '120px',
|
|
33
|
+
} })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index) => {
|
|
34
|
+
return (h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
|
|
35
|
+
backgroundColor: Colors.Gray03,
|
|
36
|
+
height: '20px',
|
|
37
|
+
width: '120px',
|
|
38
|
+
} }), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray01}`, marginTop: '12px' } }, h("div", { class: "view-content" }, [1, 2, 3].map((fakeGroupId, fakeGroupIndex) => (h("div", { key: `service-group--${fakeId}--service-${fakeGroupId}--${fakeGroupIndex}`, class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({}, fakeGroupIndex > 0 ? {
|
|
39
|
+
marginTop: '12px',
|
|
40
|
+
paddingTop: '12px',
|
|
41
|
+
borderTop: `1px solid ${Colors.Gray01}`,
|
|
42
|
+
} : {}) }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
|
|
43
|
+
backgroundColor: Colors.Gray01,
|
|
44
|
+
height: '16px',
|
|
45
|
+
width: '120px',
|
|
46
|
+
} })), h("div", { style: { marginTop: '4px' } }, h("div", { style: {
|
|
47
|
+
backgroundColor: Colors.Gray01,
|
|
48
|
+
height: '16px',
|
|
49
|
+
width: '240px',
|
|
50
|
+
} })))))))));
|
|
51
|
+
})));
|
|
52
|
+
}
|
|
53
|
+
return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap' } }, sortBy(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index) => (h("a", { href: `#service-group--${serviceGroup.id}` }, h("button", { type: "button", class: this.buttonClass, style: index > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), sortBy(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
|
|
54
|
+
const hasMultipleCates = (serviceGroup.data || []).length > 1;
|
|
55
|
+
return (h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (h("div", { class: "salon-service-category" }, hasMultipleCates && (h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${Colors.Gray02}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
|
|
56
|
+
marginTop: '12px',
|
|
57
|
+
paddingTop: '12px',
|
|
58
|
+
borderTop: `1px solid ${Colors.Gray01}`,
|
|
59
|
+
} : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (h("div", { style: {
|
|
60
|
+
display: 'block',
|
|
61
|
+
marginTop: '4px',
|
|
62
|
+
fontSize: '90%',
|
|
63
|
+
color: Colors.Gray05,
|
|
64
|
+
} }, [
|
|
65
|
+
!service.hideDuration ? `${service.duration} mins` : '',
|
|
66
|
+
!service.hidePrice ? `$${service.price}` : '',
|
|
67
|
+
].filter(field => !!field).join(' · ')))))))))))));
|
|
68
|
+
})));
|
|
69
|
+
}
|
|
70
|
+
static get is() { return "salon-services"; }
|
|
71
|
+
static get originalStyleUrls() {
|
|
72
|
+
return {
|
|
73
|
+
"$": ["index.css"]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
static get styleUrls() {
|
|
77
|
+
return {
|
|
78
|
+
"$": ["index.css"]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
static get properties() {
|
|
82
|
+
return {
|
|
83
|
+
"salonId": {
|
|
84
|
+
"type": "number",
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "number",
|
|
88
|
+
"resolved": "number",
|
|
89
|
+
"references": {}
|
|
90
|
+
},
|
|
91
|
+
"required": false,
|
|
92
|
+
"optional": false,
|
|
93
|
+
"docs": {
|
|
94
|
+
"tags": [],
|
|
95
|
+
"text": ""
|
|
96
|
+
},
|
|
97
|
+
"attribute": "salon-id",
|
|
98
|
+
"reflect": false
|
|
99
|
+
},
|
|
100
|
+
"buttonClass": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": ""
|
|
113
|
+
},
|
|
114
|
+
"attribute": "button-class",
|
|
115
|
+
"reflect": false,
|
|
116
|
+
"defaultValue": "'btn btn-light'"
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
static get states() {
|
|
121
|
+
return {
|
|
122
|
+
"salonServices": {},
|
|
123
|
+
"isLoading": {}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static get methods() {
|
|
127
|
+
return {
|
|
128
|
+
"fetchData": {
|
|
129
|
+
"complexType": {
|
|
130
|
+
"signature": "() => Promise<void>",
|
|
131
|
+
"parameters": [],
|
|
132
|
+
"references": {
|
|
133
|
+
"Promise": {
|
|
134
|
+
"location": "global"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"return": "Promise<void>"
|
|
138
|
+
},
|
|
139
|
+
"docs": {
|
|
140
|
+
"text": "",
|
|
141
|
+
"tags": []
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|