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.
Files changed (240) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +20 -0
  5. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +291 -0
  7. package/dist/cjs/index-7f190886.js +4396 -0
  8. package/{cjs/index-7d179a70.js → dist/cjs/index-e6bea8f5.js} +87 -3
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/dist/cjs/salon-booking-modal.cjs.entry.js +29 -0
  12. package/dist/cjs/salon-booking.cjs.entry.js +50 -0
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/dist/cjs/salon-gift-card.cjs.entry.js +50 -0
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/dist/cjs/salon-lookbook.cjs.entry.js +218 -0
  17. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
  18. package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +78 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
  21. package/{cjs/services-d6f8214c.js → dist/cjs/services-eee8f251.js} +317 -361
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/{cjs → dist/cjs}/user-avatar.cjs.entry.js +4 -4
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -2
  26. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  27. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  28. package/dist/collection/components/google-map/index.js +86 -0
  29. package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
  30. package/{collection → dist/collection}/components/salon-booking/index.js +29 -11
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +12 -6
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +44 -6
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +30 -4
  35. package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
  36. package/{collection → dist/collection}/components/salon-info/index.js +6 -32
  37. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
  38. package/dist/collection/components/salon-latest-reviews/index.js +176 -0
  39. package/dist/collection/components/salon-latest-styles/index.css +10 -0
  40. package/dist/collection/components/salon-latest-styles/index.js +178 -0
  41. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
  42. package/dist/collection/components/salon-locations/index.js +151 -0
  43. package/dist/collection/components/salon-lookbook/index.css +12 -0
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +122 -49
  45. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  46. package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
  47. package/dist/collection/components/salon-reviews/index.css +15 -0
  48. package/dist/collection/components/salon-reviews/index.js +286 -0
  49. package/dist/collection/components/salon-schedules/index.css +15 -0
  50. package/dist/collection/components/salon-schedules/index.js +189 -0
  51. package/{collection/components/salon-reviews → dist/collection/components/salon-services}/index.css +0 -0
  52. package/dist/collection/components/salon-services/index.js +156 -0
  53. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
  54. package/dist/collection/components/salon-stylists/index.js +183 -0
  55. package/dist/collection/components/style-detail/index.css +62 -0
  56. package/dist/collection/components/style-detail/index.js +461 -0
  57. package/{collection/components/salon-services → dist/collection/components/user-avatar}/index.css +0 -0
  58. package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
  59. package/dist/collection/constants/colors.js +65 -0
  60. package/{collection → dist/collection}/global/global.js +0 -0
  61. package/{collection → dist/collection}/index.js +0 -0
  62. package/dist/collection/services/services.js +174 -0
  63. package/dist/collection/types/common.js +11 -0
  64. package/{collection → dist/collection}/types/review.js +9 -5
  65. package/dist/collection/types/salon.js +58 -0
  66. package/{collection → dist/collection}/types/service.js +0 -0
  67. package/dist/collection/types/style.js +128 -0
  68. package/dist/collection/types/stylist.js +30 -0
  69. package/{collection/components/user-avatar/index.css → dist/collection/types/tmp.js} +0 -0
  70. package/{collection → dist/collection}/types/user.js +2 -2
  71. package/{collection → dist/collection}/utils/utils.js +0 -0
  72. package/{custom-elements → dist/custom-elements}/index.d.ts +12 -12
  73. package/{custom-elements → dist/custom-elements}/index.js +5783 -870
  74. package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
  75. package/dist/esm/colors-ea36347a.js +67 -0
  76. package/dist/esm/favesalon-embed.js +18 -0
  77. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  78. package/dist/esm/google-map_5.entry.js +283 -0
  79. package/{esm/index-2160b80b.js → dist/esm/index-6af0a03d.js} +87 -4
  80. package/dist/esm/index-80523fec.js +4393 -0
  81. package/{esm → dist/esm}/index.js +0 -0
  82. package/dist/esm/loader.js +18 -0
  83. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  84. package/{esm → dist/esm}/polyfills/css-shim.js +0 -0
  85. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  86. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  87. package/{esm → dist/esm}/polyfills/index.js +0 -0
  88. package/{esm → dist/esm}/polyfills/system.js +0 -0
  89. package/dist/esm/salon-booking-modal.entry.js +25 -0
  90. package/dist/esm/salon-booking.entry.js +46 -0
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/dist/esm/salon-gift-card.entry.js +46 -0
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/dist/esm/salon-lookbook.entry.js +214 -0
  95. package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
  96. package/dist/esm/salon-reviews.entry.js +182 -0
  97. package/dist/esm/salon-services.entry.js +74 -0
  98. package/dist/esm/salon-stylists.entry.js +108 -0
  99. package/{esm/services-57fadd0a.js → dist/esm/services-295247b1.js} +310 -355
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/{esm → dist/esm}/user-avatar.entry.js +4 -4
  102. package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  103. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  104. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  105. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  106. package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  107. package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
  108. package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  109. package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
  110. package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
  111. package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
  112. package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
  113. package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
  114. package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
  115. package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
  116. package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
  117. package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
  118. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  119. package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
  120. package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
  121. package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
  122. package/dist/favesalon-embed/p-c2ecb365.js +1 -0
  123. package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
  124. package/dist/favesalon-embed/p-d6083940.js +1 -0
  125. package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
  126. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  127. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  128. package/{index.js → dist/index.js} +0 -0
  129. package/dist/types/components/google-map/index.d.ts +5 -0
  130. package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
  134. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  135. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  136. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  137. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  138. package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
  139. package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  140. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  141. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  142. package/{types → dist/types}/components/salon-services/index.d.ts +2 -0
  143. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  144. package/dist/types/components/style-detail/index.d.ts +24 -0
  145. package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  146. package/{types → dist/types}/components.d.ts +62 -41
  147. package/dist/types/constants/colors.d.ts +65 -0
  148. package/{types → dist/types}/index.d.ts +0 -0
  149. package/dist/types/services/services.d.ts +60 -0
  150. package/{types → dist/types}/stencil-public-runtime.d.ts +0 -0
  151. package/dist/types/types/common.d.ts +11 -0
  152. package/{types → dist/types}/types/review.d.ts +4 -0
  153. package/{types → dist/types}/types/salon.d.ts +3 -1
  154. package/{types → dist/types}/types/service.d.ts +0 -0
  155. package/dist/types/types/style.d.ts +88 -0
  156. package/{types → dist/types}/types/stylist.d.ts +2 -1
  157. package/dist/types/types/tmp.d.ts +0 -0
  158. package/{types → dist/types}/types/user.d.ts +2 -2
  159. package/{types → dist/types}/utils/utils.d.ts +0 -0
  160. package/loader/cdn.js +3 -0
  161. package/loader/index.cjs.js +3 -0
  162. package/loader/index.d.ts +12 -0
  163. package/loader/index.es2017.js +3 -0
  164. package/loader/index.js +4 -0
  165. package/loader/package.json +10 -0
  166. package/package.json +18 -13
  167. package/readme.md +23 -2
  168. package/cjs/colors-7f354880.js +0 -95
  169. package/cjs/favesalon-embed.cjs.js +0 -20
  170. package/cjs/google-map.cjs.entry.js +0 -47
  171. package/cjs/loader.cjs.js +0 -22
  172. package/cjs/salon-booking-modal.cjs.entry.js +0 -23
  173. package/cjs/salon-booking_2.cjs.entry.js +0 -56
  174. package/cjs/salon-contact_4.cjs.entry.js +0 -154
  175. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
  176. package/cjs/salon-info.cjs.entry.js +0 -34
  177. package/cjs/salon-latest-reviews.cjs.entry.js +0 -57
  178. package/cjs/salon-lookbook.cjs.entry.js +0 -187
  179. package/cjs/salon-reviews.cjs.entry.js +0 -196
  180. package/cjs/salon-services.cjs.entry.js +0 -40
  181. package/cjs/salon-stylists.cjs.entry.js +0 -53
  182. package/collection/components/google-map/index.js +0 -97
  183. package/collection/components/salon-contact/index.js +0 -88
  184. package/collection/components/salon-gift-card/index.css +0 -25
  185. package/collection/components/salon-info/index.css +0 -3
  186. package/collection/components/salon-latest-reviews/index.js +0 -108
  187. package/collection/components/salon-locations/index.js +0 -80
  188. package/collection/components/salon-lookbook/index.css +0 -12
  189. package/collection/components/salon-reviews/index.js +0 -291
  190. package/collection/components/salon-schedules/index.css +0 -14
  191. package/collection/components/salon-schedules/index.js +0 -103
  192. package/collection/components/salon-services/index.js +0 -86
  193. package/collection/components/salon-styles/index.css +0 -23
  194. package/collection/components/salon-styles/index.js +0 -100
  195. package/collection/components/salon-stylists/index.js +0 -96
  196. package/collection/constants/colors.js +0 -91
  197. package/collection/services/services.js +0 -203
  198. package/collection/types/common.js +0 -2
  199. package/collection/types/salon.js +0 -52
  200. package/collection/types/style.js +0 -28
  201. package/collection/types/stylist.js +0 -13
  202. package/esm/colors-1ec90c5f.js +0 -93
  203. package/esm/favesalon-embed.js +0 -18
  204. package/esm/google-map.entry.js +0 -43
  205. package/esm/loader.js +0 -18
  206. package/esm/salon-booking-modal.entry.js +0 -19
  207. package/esm/salon-booking_2.entry.js +0 -51
  208. package/esm/salon-contact_4.entry.js +0 -147
  209. package/esm/salon-gift-card-modal.entry.js +0 -16
  210. package/esm/salon-info.entry.js +0 -30
  211. package/esm/salon-latest-reviews.entry.js +0 -53
  212. package/esm/salon-lookbook.entry.js +0 -183
  213. package/esm/salon-reviews.entry.js +0 -192
  214. package/esm/salon-services.entry.js +0 -36
  215. package/esm/salon-stylists.entry.js +0 -49
  216. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  217. package/favesalon-embed/p-14a46adf.entry.js +0 -1
  218. package/favesalon-embed/p-2da2ed75.js +0 -1
  219. package/favesalon-embed/p-3712d9ab.entry.js +0 -1
  220. package/favesalon-embed/p-38066f9f.entry.js +0 -1
  221. package/favesalon-embed/p-4e2d7b29.js +0 -1
  222. package/favesalon-embed/p-520c8ffb.entry.js +0 -1
  223. package/favesalon-embed/p-54a1c294.entry.js +0 -1
  224. package/favesalon-embed/p-762520f2.js +0 -1
  225. package/favesalon-embed/p-94a0991e.entry.js +0 -1
  226. package/favesalon-embed/p-94b179eb.entry.js +0 -1
  227. package/favesalon-embed/p-977bd8bc.entry.js +0 -1
  228. package/favesalon-embed/p-bc363938.entry.js +0 -1
  229. package/favesalon-embed/p-bf9c83a3.entry.js +0 -1
  230. package/favesalon-embed/p-c5ebd3c9.entry.js +0 -1
  231. package/favesalon-embed/p-d84b61b0.entry.js +0 -1
  232. package/favesalon-embed/p-f15bcb43.entry.js +0 -1
  233. package/types/components/google-map/index.d.ts +0 -10
  234. package/types/components/salon-contact/index.d.ts +0 -9
  235. package/types/components/salon-reviews/index.d.ts +0 -23
  236. package/types/components/salon-styles/index.d.ts +0 -9
  237. package/types/constants/colors.d.ts +0 -88
  238. package/types/services/services.d.ts +0 -24
  239. package/types/types/common.d.ts +0 -2
  240. package/types/types/style.d.ts +0 -49
@@ -1,291 +0,0 @@
1
- import { Component, Prop, h, Method, State } from '@stencil/core';
2
- import dayjs from 'dayjs';
3
- import groupBy from 'lodash/groupBy';
4
- import sortBy from 'lodash/sortBy';
5
- import { Colors } from '../../constants/colors';
6
- import { getRatingText } from '../../utils/utils';
7
- import { shortDate } from '../../types/common';
8
- import HttpService from '../../services/services';
9
- const pageLimited = 20;
10
- const sortOptions = [{
11
- value: 'newest',
12
- label: 'Newest first',
13
- }, {
14
- value: 'oldest',
15
- label: 'Oldest first',
16
- }, {
17
- value: 'rating_desc',
18
- label: 'High rating first',
19
- }, {
20
- value: 'rating_asc',
21
- label: 'Low rating first',
22
- }];
23
- const scoreValuesMapping = {
24
- all: 'all',
25
- star1: 1,
26
- star2: 2,
27
- star3: 3,
28
- star4: 4,
29
- star5: 5,
30
- };
31
- export class SalonReviews {
32
- constructor() {
33
- this.totalReviews = 0;
34
- this.salonReviews = [];
35
- this.pageOffset = pageLimited;
36
- this.ratings = [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5'];
37
- this.sorting = sortOptions[0].value;
38
- this.renderReviewsList = () => {
39
- const ratingTexts = getRatingText();
40
- const filteredReviews = this.getFilteredReviews(this.pageOffset);
41
- const filteredReviewsCount = this.ratings.indexOf(scoreValuesMapping.all) > -1
42
- ? this.totalReviews : filteredReviews.length;
43
- return (h("div", { class: "reviews-list" },
44
- h("div", { class: "reviews-list--header", style: {
45
- display: 'flex',
46
- flexDirection: 'row',
47
- justifyContent: 'space-between',
48
- alignItems: 'center',
49
- marginBottom: '24px',
50
- } },
51
- h("div", { class: "reviews-list--couter", style: { fontWeight: 'bold' } },
52
- filteredReviewsCount,
53
- " ",
54
- filteredReviewsCount === 1 ? `review` : `reviews`),
55
- h("div", { class: "reviews-list--sorting", style: {
56
- display: 'flex',
57
- flexDirection: 'row',
58
- alignItems: 'center',
59
- } },
60
- h("label", { style: { marginRight: '8px' } }, "Sort by"),
61
- h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeSorting(evt.target.value) }, sortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sorting }, sortOption.label)))))),
62
- h("div", { class: "view-content" }, filteredReviewsCount > 0 && filteredReviews.map(review => {
63
- const { user } = review;
64
- return (h("div", { class: "salon-review", style: {
65
- marginBottom: '24px',
66
- paddingBottom: '24px',
67
- borderBottom: `1px solid ${Colors.Gray05}`,
68
- } },
69
- h("div", { class: "salon-review--user", style: { marginBottom: '24px' } },
70
- h("user-avatar", { size: 48, avatar: user.avatar, name: user.name, shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })),
71
- h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } },
72
- [1, 2, 3, 4, 5].map(score => (h("i", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
73
- fontSize: '16px',
74
- marginRight: '4px',
75
- } }))),
76
- review.createdDate && (h("div", { class: "salon-review--rating--date", style: { color: Colors.Gray03, marginLeft: '16px' } }, dayjs(review.createdDate).format(shortDate)))),
77
- h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]),
78
- (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '24px' } },
79
- h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }),
80
- h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))),
81
- review.photos.length > 0 && (h("div", { style: {
82
- display: 'flex',
83
- flexDirection: 'row',
84
- overflowX: 'auto',
85
- } }, review.photos.map(fileObj => (h("div", { style: {
86
- border: '1px solid #d9d9d9',
87
- position: 'relative',
88
- cursor: 'pointer',
89
- borderRadius: '2px',
90
- height: '66px',
91
- marginTop: '16px',
92
- marginRight: '16px',
93
- } },
94
- h("img", { alt: "", src: fileObj.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))));
95
- })),
96
- this.canLoadMore && (h("div", { class: "view-footer", style: { textAlign: 'center' } },
97
- h("button", { type: "button", class: "btn btn-light", onClick: () => this.onLoadMore() }, this.isLoadingMore ? 'Loading' : 'Load more')))));
98
- };
99
- }
100
- componentWillLoad() {
101
- this.fetchData();
102
- }
103
- fetchData() {
104
- try {
105
- const promises = [
106
- HttpService().fetchSalonInfo(this.salonId).then(salonInfo => this.salonInfo = salonInfo),
107
- HttpService().fetchSalonReviews(this.salonId, { limit: pageLimited }).then(response => {
108
- const { total, allItems } = response;
109
- this.totalReviews = total;
110
- this.salonReviews = allItems;
111
- if (total > pageLimited) {
112
- this.canLoadMore = true;
113
- }
114
- }),
115
- ];
116
- return Promise.all(promises);
117
- }
118
- catch (e) { }
119
- }
120
- sortReviews(filteredReviews) {
121
- return sortBy(filteredReviews, [review => {
122
- if (this.sorting === 'rating_desc') {
123
- return -review.point;
124
- }
125
- if (this.sorting === 'rating_asc') {
126
- return review.point;
127
- }
128
- const createdTime = dayjs(review.createdDate).unix();
129
- return this.sorting === 'oldest' ? createdTime : -createdTime;
130
- }]);
131
- }
132
- getFilteredReviews(pageOffset) {
133
- let filteredReviews = [...this.salonReviews];
134
- if (this.ratings.indexOf(scoreValuesMapping.all) === -1) {
135
- const reviewRatingScores = this.ratings.map(r => scoreValuesMapping[r]);
136
- filteredReviews = [...filteredReviews].filter(review => reviewRatingScores.indexOf(review.point) > -1);
137
- }
138
- const sortedReviews = this.sortReviews(filteredReviews);
139
- return pageOffset ? sortedReviews.slice(0, pageOffset) : sortedReviews;
140
- }
141
- onLoadMore() {
142
- this.isLoadingMore = true;
143
- try {
144
- this.pageOffset += pageLimited;
145
- const totalResults = this.getFilteredReviews(this.pageOffset).length;
146
- if (this.pageOffset > totalResults) {
147
- this.canLoadMore = false;
148
- }
149
- }
150
- catch (error) { }
151
- this.isLoadingMore = false;
152
- }
153
- onChangeSorting(sorting) {
154
- this.sorting = sorting;
155
- this.pageOffset = pageLimited;
156
- this.canLoadMore = this.getFilteredReviews(pageLimited).length >= pageLimited;
157
- }
158
- ;
159
- onChangeFilterRating(rating) {
160
- if (rating === scoreValuesMapping.all) {
161
- this.ratings = [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5'];
162
- }
163
- else if (this.ratings.indexOf(rating) > -1) {
164
- this.ratings = this.ratings.filter(r => r !== scoreValuesMapping.all && r !== rating);
165
- }
166
- else {
167
- const needFilterByAll = this.ratings.concat([rating]).filter(r => r !== scoreValuesMapping.all).length === 5;
168
- this.ratings = needFilterByAll
169
- ? [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5']
170
- : this.ratings.concat([rating]);
171
- }
172
- this.pageOffset = pageLimited;
173
- this.canLoadMore = this.getFilteredReviews(pageLimited).length >= pageLimited;
174
- }
175
- ;
176
- renderReviewsFilters() {
177
- const reviewsByScore = groupBy(this.salonReviews, review => review.point);
178
- return (h("div", { class: "salon-reviews--filters-by-ratings" },
179
- h("div", { style: {
180
- fontWeight: 'bold',
181
- marginBottom: '12px',
182
- marginTop: '32px',
183
- } }, "Filter by ratings"),
184
- h("div", { class: "salon-reviews--filters-by-ratings--options" },
185
- h("div", { class: "antd-checkbox--wrapper", style: { marginBottom: '12px' } },
186
- h("div", { class: "antd-checkbox--box" },
187
- h("div", { class: "form-check" },
188
- h("input", { type: "checkbox", class: "form-check-input", value: scoreValuesMapping.all, onChange: () => this.onChangeFilterRating(scoreValuesMapping.all), checked: this.ratings.indexOf(scoreValuesMapping.all) > -1 }),
189
- h("label", { class: "form-check-label" }, "All ratings")))),
190
- [5, 4, 3, 2, 1].filter(score => reviewsByScore[score]).map(score => {
191
- const scoreReviewCount = reviewsByScore[score].length;
192
- return (h("div", { style: {
193
- display: 'flex',
194
- flexDirection: 'row',
195
- justifyContent: 'space-between',
196
- marginBottom: '12px',
197
- } },
198
- h("div", { class: "form-check" },
199
- h("input", { value: "", type: "checkbox", class: "form-check-input", onChange: () => this.onChangeFilterRating(`star${score}`), checked: this.ratings.indexOf(scoreValuesMapping.all) > -1 || this.ratings.indexOf(`star${score}`) > -1 }),
200
- h("label", { class: "form-check-label" }, [1, 2, 3, 4, 5].slice(0, score).map(() => (h("i", { class: "ri-heart-fill", style: {
201
- fontSize: '16px',
202
- marginRight: '4px',
203
- } }))))),
204
- h("div", { style: { color: Colors.Gray01 } }, scoreReviewCount)));
205
- }))));
206
- }
207
- render() {
208
- const { rating } = this.salonInfo || {};
209
- return (h("div", { class: "salon-reviews", style: { display: 'flex', flexDirection: 'row' } },
210
- h("div", { class: "salon-reviews--filters", style: { width: '264px' } },
211
- h("div", { class: "salon-reviews--score" },
212
- h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => (h("i", { class: score <= rating ? 'ri-heart-fill' : 'ri-heart-line', style: {
213
- fontSize: '32px',
214
- marginRight: '4px',
215
- } })))),
216
- h("div", { class: "salon-review--rating--date", style: {
217
- display: 'flex',
218
- flexDirection: 'row',
219
- alignItems: 'center',
220
- marginTop: '-8px',
221
- } },
222
- h("span", { style: { fontSize: '24px' } },
223
- rating,
224
- "/5"),
225
- " ",
226
- h("span", { style: { color: Colors.Gray02, marginLeft: '8px' } },
227
- "(",
228
- this.totalReviews,
229
- " reviews)"))),
230
- h("div", { class: "salon-reviews--filters--options" }, this.renderReviewsFilters())),
231
- h("div", { class: "salon-reviews--list", style: {
232
- flexGrow: '1',
233
- flexShrink: '1',
234
- paddingLeft: '64px',
235
- } }, this.renderReviewsList())));
236
- }
237
- static get is() { return "salon-reviews"; }
238
- static get originalStyleUrls() { return {
239
- "$": ["index.css"]
240
- }; }
241
- static get styleUrls() { return {
242
- "$": ["index.css"]
243
- }; }
244
- static get properties() { return {
245
- "salonId": {
246
- "type": "number",
247
- "mutable": false,
248
- "complexType": {
249
- "original": "number",
250
- "resolved": "number",
251
- "references": {}
252
- },
253
- "required": false,
254
- "optional": false,
255
- "docs": {
256
- "tags": [],
257
- "text": ""
258
- },
259
- "attribute": "salon-id",
260
- "reflect": false
261
- }
262
- }; }
263
- static get states() { return {
264
- "salonInfo": {},
265
- "totalReviews": {},
266
- "salonReviews": {},
267
- "canLoadMore": {},
268
- "isLoadingMore": {},
269
- "pageOffset": {},
270
- "ratings": {},
271
- "sorting": {}
272
- }; }
273
- static get methods() { return {
274
- "fetchData": {
275
- "complexType": {
276
- "signature": "() => Promise<any[]>",
277
- "parameters": [],
278
- "references": {
279
- "Promise": {
280
- "location": "global"
281
- }
282
- },
283
- "return": "Promise<any[]>"
284
- },
285
- "docs": {
286
- "text": "",
287
- "tags": []
288
- }
289
- }
290
- }; }
291
- }
@@ -1,14 +0,0 @@
1
- @media (min-width: 768px) {
2
- .salon-schedules--dates {
3
- overflow: hidden;
4
- margin-left: -32px;
5
- }
6
-
7
- .salon-schedules--dates .salon-schedules--day {
8
- float: left;
9
- display: flex;
10
- flex-direction: row;
11
- min-width: 240px;
12
- padding-left: 32px;
13
- }
14
- }
@@ -1,103 +0,0 @@
1
- import { Component, Prop, h, State } from '@stencil/core';
2
- import { BusinessHourStatus } from '../../types/salon';
3
- import HttpService from '../../services/services';
4
- export class SalonSchedules {
5
- componentWillLoad() {
6
- if (this.salonInfo) {
7
- this.salonInfoState = JSON.parse(this.salonInfo);
8
- }
9
- else {
10
- this.fetchData();
11
- }
12
- }
13
- fetchData() {
14
- try {
15
- HttpService().fetchSalonInfo(this.salonId)
16
- .then(salonInfo => this.salonInfoState = salonInfo);
17
- }
18
- catch (e) { }
19
- }
20
- renderBusinessHour(businessHour) {
21
- if (businessHour.status === BusinessHourStatus.ByAppointment) {
22
- return 'By Appointment';
23
- }
24
- if (businessHour.status === BusinessHourStatus.Close) {
25
- return 'Close';
26
- }
27
- return `${businessHour.openTime} - ${businessHour.closeTime}`;
28
- }
29
- render() {
30
- const businessHours = (this.salonInfoState && this.salonInfoState.businessHours) || [];
31
- return (h("div", { class: "view view--salon-schedules" },
32
- h("div", { class: "view-content" }, businessHours.length > 0 && (h("div", { class: "salon-schedules" },
33
- h("div", { style: { fontSize: '16px', fontWeight: 'bold' } }, "Working hours"),
34
- h("div", { class: "salon-schedules--dates" },
35
- h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } },
36
- h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Mon"),
37
- h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[0]))),
38
- h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } },
39
- h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Tue"),
40
- h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[1]))),
41
- h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } },
42
- h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Wed"),
43
- h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[2]))),
44
- h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } },
45
- h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Thur"),
46
- h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[3]))),
47
- h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } },
48
- h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Fri"),
49
- h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[4]))),
50
- h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } },
51
- h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sat"),
52
- h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[5]))),
53
- h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } },
54
- h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sun"),
55
- h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[6])))))))));
56
- }
57
- static get is() { return "salon-schedules"; }
58
- static get originalStyleUrls() { return {
59
- "$": ["index.css"]
60
- }; }
61
- static get styleUrls() { return {
62
- "$": ["index.css"]
63
- }; }
64
- static get properties() { return {
65
- "salonId": {
66
- "type": "number",
67
- "mutable": false,
68
- "complexType": {
69
- "original": "number",
70
- "resolved": "number",
71
- "references": {}
72
- },
73
- "required": false,
74
- "optional": false,
75
- "docs": {
76
- "tags": [],
77
- "text": ""
78
- },
79
- "attribute": "salon-id",
80
- "reflect": false
81
- },
82
- "salonInfo": {
83
- "type": "string",
84
- "mutable": false,
85
- "complexType": {
86
- "original": "string",
87
- "resolved": "string",
88
- "references": {}
89
- },
90
- "required": false,
91
- "optional": true,
92
- "docs": {
93
- "tags": [],
94
- "text": ""
95
- },
96
- "attribute": "salon-info",
97
- "reflect": false
98
- }
99
- }; }
100
- static get states() { return {
101
- "salonInfoState": {}
102
- }; }
103
- }
@@ -1,86 +0,0 @@
1
- import { Component, Prop, h, Method, State } 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
- componentWillLoad() {
7
- this.fetchData();
8
- }
9
- async fetchData() {
10
- try {
11
- this.salonServices = await HttpService().fetchSalonServices(this.salonId);
12
- }
13
- catch (e) { }
14
- }
15
- render() {
16
- return (h("div", { class: "salon-services--container" },
17
- h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray05}` } },
18
- h("div", { class: "view-content", style: { overflowX: 'auto' } },
19
- h("div", { style: { whiteSpace: 'nowrap' } }, sortBy(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index) => (h("button", { type: "button", class: "btn btn-light", style: index > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name)))))),
20
- sortBy(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
21
- const hasMultipleCates = (serviceGroup.data || []).length > 1;
22
- return (h("div", { style: { marginTop: '32px' } },
23
- h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name),
24
- h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray05}` } },
25
- h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (h("div", { class: "salon-service-category" },
26
- hasMultipleCates && (h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${Colors.Gray06}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)),
27
- (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" },
28
- h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px' }, serviceIndex > 0 ? {
29
- marginTop: '12px',
30
- paddingTop: '12px',
31
- borderTop: `1px solid ${Colors.Gray06}`,
32
- } : {}) }, service.name),
33
- (!service.hideDuration || !service.hidePrice) && (h("div", { style: { display: 'block', marginTop: '4px' } }, [
34
- !service.hideDuration ? `${service.duration} mins` : '',
35
- !service.hidePrice ? `$${service.price}` : '',
36
- ].join(' · ')))))))))))));
37
- })));
38
- }
39
- static get is() { return "salon-services"; }
40
- static get originalStyleUrls() { return {
41
- "$": ["index.css"]
42
- }; }
43
- static get styleUrls() { return {
44
- "$": ["index.css"]
45
- }; }
46
- static get properties() { return {
47
- "salonId": {
48
- "type": "number",
49
- "mutable": false,
50
- "complexType": {
51
- "original": "number",
52
- "resolved": "number",
53
- "references": {}
54
- },
55
- "required": false,
56
- "optional": false,
57
- "docs": {
58
- "tags": [],
59
- "text": ""
60
- },
61
- "attribute": "salon-id",
62
- "reflect": false
63
- }
64
- }; }
65
- static get states() { return {
66
- "salonServices": {}
67
- }; }
68
- static get methods() { return {
69
- "fetchData": {
70
- "complexType": {
71
- "signature": "() => Promise<void>",
72
- "parameters": [],
73
- "references": {
74
- "Promise": {
75
- "location": "global"
76
- }
77
- },
78
- "return": "Promise<void>"
79
- },
80
- "docs": {
81
- "text": "",
82
- "tags": []
83
- }
84
- }
85
- }; }
86
- }
@@ -1,23 +0,0 @@
1
- .salon-styles--item-background {
2
- -moz-filter: blur(32px);
3
- -webkit-filter: blur(32px);
4
- filter: blur(32px);
5
- }
6
-
7
- .salon-styles--item .salon-styles--item-background {
8
- z-index: 1;
9
- }
10
-
11
- .salon-styles--item .salon-styles--item-image {
12
- position: relative;
13
- z-index: 2;
14
- }
15
-
16
- .salon-styles--item .carousel-caption {
17
- padding-bottom: 0;
18
- z-index: 2;
19
- }
20
-
21
- .salon-styles--slides .carousel-control-prev {
22
- z-index: 2;
23
- }
@@ -1,100 +0,0 @@
1
- import { Component, Prop, h, Method, State } from '@stencil/core';
2
- import { Colors } from '../../constants/colors';
3
- import HttpService from '../../services/services';
4
- export class SalonStyles {
5
- componentDidLoad() {
6
- this.fetchData();
7
- }
8
- async fetchData() {
9
- try {
10
- const promises = [
11
- HttpService().fetchSalonPhotos(this.salonId).then(salonStyles => this.firstPageStyles = salonStyles),
12
- HttpService().fetchAllSalonPhotos(this.salonId, { page: 2 }).then(nestPageStyles => this.nestPageStyles = nestPageStyles),
13
- ];
14
- return Promise.all(promises);
15
- }
16
- catch (e) { }
17
- }
18
- render() {
19
- return (h("div", { class: "view view--salon-styles" },
20
- h("div", { class: "view-content" },
21
- h("div", { class: "salon-styles--slides" },
22
- h("div", { id: "salon-styles-carousel", class: "carousel slide", "data-bs-ride": "carousel" },
23
- h("div", { class: "carousel-inner" }, (this.firstPageStyles || []).concat(this.nestPageStyles || []).map((photo, index) => {
24
- const { caption, description,
25
- // mediaType,
26
- fullImageUrl, fullImageUrlThumb, fullImageUrlMedium, imgWidth, imgHeight, } = photo;
27
- const isLandscape = imgWidth > imgHeight;
28
- return (h("div", { class: `carousel-item salon-styles--item ${index === 0 ? 'active' : ''}` },
29
- h("div", { class: "salon-styles--item", style: {
30
- flexDirection: isLandscape ? 'column' : 'row',
31
- justifyContent: 'center',
32
- alignItems: 'center',
33
- overflow: 'hidden',
34
- position: 'relative',
35
- display: 'flex',
36
- height: '380px',
37
- borderRadius: '8px',
38
- } },
39
- h("div", { class: "salon-styles--item-background", style: Object.assign(Object.assign({}, fullImageUrlThumb ? { backgroundImage: `url(${fullImageUrlThumb})` } : {}), { backgroundColor: Colors.Gray06, backgroundPosition: 'center', backgroundRepeat: 'no-repeat', backgroundSize: 'cover', position: 'absolute', bottom: '0px', right: '0px', left: '0px', top: '0px' }) }),
40
- h("img", { alt: caption, class: "salon-styles--item-image", src: fullImageUrlMedium || fullImageUrl, style: Object.assign({ display: 'inline-block' }, isLandscape ? { width: '100%' } : { height: '100%' }) }),
41
- h("div", { class: "carousel-caption d-none d-md-block" },
42
- caption && h("h5", null, caption),
43
- description && h("p", null, description)))));
44
- })),
45
- h("button", { type: "button", "data-bs-slide": "prev", class: "carousel-control-prev", "data-bs-target": "#salon-styles-carousel" },
46
- h("span", { class: "carousel-control-prev-icon", "aria-hidden": "true" }),
47
- h("span", { class: "visually-hidden" }, "Previous")),
48
- h("button", { type: "button", "data-bs-slide": "next", class: "carousel-control-next", "data-bs-target": "#salon-styles-carousel" },
49
- h("span", { class: "carousel-control-next-icon", "aria-hidden": "true" }),
50
- h("span", { class: "visually-hidden" }, "Next")))))));
51
- }
52
- static get is() { return "salon-styles"; }
53
- static get originalStyleUrls() { return {
54
- "$": ["index.css"]
55
- }; }
56
- static get styleUrls() { return {
57
- "$": ["index.css"]
58
- }; }
59
- static get properties() { return {
60
- "salonId": {
61
- "type": "number",
62
- "mutable": false,
63
- "complexType": {
64
- "original": "number",
65
- "resolved": "number",
66
- "references": {}
67
- },
68
- "required": false,
69
- "optional": false,
70
- "docs": {
71
- "tags": [],
72
- "text": ""
73
- },
74
- "attribute": "salon-id",
75
- "reflect": false
76
- }
77
- }; }
78
- static get states() { return {
79
- "firstPageStyles": {},
80
- "nestPageStyles": {}
81
- }; }
82
- static get methods() { return {
83
- "fetchData": {
84
- "complexType": {
85
- "signature": "() => Promise<any[]>",
86
- "parameters": [],
87
- "references": {
88
- "Promise": {
89
- "location": "global"
90
- }
91
- },
92
- "return": "Promise<any[]>"
93
- },
94
- "docs": {
95
- "text": "",
96
- "tags": []
97
- }
98
- }
99
- }; }
100
- }