favesalon-embed 0.0.4 → 0.0.5

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 (270) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/chat-button.cjs.entry.js +118 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +24 -0
  5. package/dist/cjs/google-map_5.cjs.entry.js +310 -0
  6. package/{cjs/index-d5de0b9d.js → dist/cjs/index-47c2a5f6.js} +513 -199
  7. package/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
  8. package/dist/cjs/loader.cjs.js +23 -0
  9. package/dist/cjs/relativeTime-3721080d.js +9 -0
  10. package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +7 -6
  11. package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +8 -8
  12. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
  13. package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +9 -8
  14. package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
  15. package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +28 -58
  16. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +9 -8
  17. package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
  18. package/dist/cjs/salon-services.cjs.entry.js +81 -0
  19. package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
  20. package/dist/cjs/services-125c82d8.js +21492 -0
  21. package/dist/cjs/style-detail.cjs.entry.js +312 -0
  22. package/dist/cjs/user-avatar.cjs.entry.js +45 -0
  23. package/{collection → dist/collection}/collection-manifest.json +5 -5
  24. package/dist/collection/components/chat-button/index.css +122 -0
  25. package/dist/collection/components/chat-button/index.js +218 -0
  26. package/dist/collection/components/chat-conversation/index.js +103 -0
  27. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  28. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  29. package/dist/collection/components/google-map/index.js +90 -0
  30. package/{collection → dist/collection}/components/salon-booking/index.css +11 -20
  31. package/dist/collection/components/salon-booking/index.js +126 -0
  32. package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
  33. package/dist/collection/components/salon-gift-card/index.css +30 -0
  34. package/dist/collection/components/salon-gift-card/index.js +126 -0
  35. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
  36. package/dist/collection/components/salon-info/index.js +77 -0
  37. package/dist/collection/components/salon-latest-reviews/index.js +163 -0
  38. package/dist/collection/components/salon-latest-styles/index.css +12 -0
  39. package/dist/collection/components/salon-latest-styles/index.js +183 -0
  40. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +7 -4
  41. package/dist/collection/components/salon-locations/index.js +143 -0
  42. package/{collection → dist/collection}/components/salon-lookbook/index.css +3 -9
  43. package/dist/collection/components/salon-lookbook/index.js +368 -0
  44. package/dist/collection/components/salon-ranking/index.js +117 -0
  45. package/{collection → dist/collection}/components/salon-reviews/index.css +3 -0
  46. package/dist/collection/components/salon-reviews/index.js +249 -0
  47. package/dist/collection/components/salon-schedules/index.css +18 -0
  48. package/dist/collection/components/salon-schedules/index.js +167 -0
  49. package/dist/collection/components/salon-services/index.css +1 -0
  50. package/dist/collection/components/salon-services/index.js +146 -0
  51. package/dist/collection/components/salon-stylists/index.js +184 -0
  52. package/dist/collection/components/style-detail/index.css +76 -0
  53. package/dist/collection/components/style-detail/index.js +386 -0
  54. package/dist/collection/components/user-avatar/index.js +134 -0
  55. package/dist/collection/constants/colors.js +65 -0
  56. package/dist/collection/mocks/users.js +10 -0
  57. package/dist/collection/services/services.js +295 -0
  58. package/dist/collection/types/chat.js +23 -0
  59. package/dist/collection/types/common.js +11 -0
  60. package/{collection → dist/collection}/types/review.js +9 -5
  61. package/dist/collection/types/salon.js +58 -0
  62. package/dist/collection/types/style.js +128 -0
  63. package/{collection → dist/collection}/types/stylist.js +12 -9
  64. package/dist/collection/types/user.js +10 -0
  65. package/{custom-elements → dist/custom-elements}/index.d.ts +18 -18
  66. package/dist/custom-elements/index.js +28340 -0
  67. package/dist/esm/chat-button.entry.js +114 -0
  68. package/dist/esm/colors-ea36347a.js +67 -0
  69. package/dist/esm/favesalon-embed.js +19 -0
  70. package/dist/esm/google-map_5.entry.js +302 -0
  71. package/{esm/index-0f8eed73.js → dist/esm/index-3fae868e.js} +512 -200
  72. package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
  73. package/dist/esm/index.js +1 -0
  74. package/dist/esm/loader.js +19 -0
  75. package/dist/esm/polyfills/css-shim.js +1 -0
  76. package/dist/esm/relativeTime-cd452e6d.js +7 -0
  77. package/{esm → dist/esm}/salon-booking-modal.entry.js +7 -6
  78. package/{esm → dist/esm}/salon-booking.entry.js +7 -7
  79. package/dist/esm/salon-gift-card-modal.entry.js +25 -0
  80. package/{esm → dist/esm}/salon-gift-card.entry.js +8 -7
  81. package/dist/esm/salon-latest-reviews.entry.js +93 -0
  82. package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +29 -58
  83. package/{esm → dist/esm}/salon-ranking.entry.js +9 -8
  84. package/dist/esm/salon-reviews.entry.js +189 -0
  85. package/dist/esm/salon-services.entry.js +77 -0
  86. package/dist/esm/salon-stylists.entry.js +114 -0
  87. package/dist/esm/services-40a3e622.js +21485 -0
  88. package/dist/esm/style-detail.entry.js +308 -0
  89. package/dist/esm/user-avatar.entry.js +41 -0
  90. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  91. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  92. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  93. package/dist/favesalon-embed/p-019c5ccd.entry.js +1 -0
  94. package/dist/favesalon-embed/p-083a8821.entry.js +1 -0
  95. package/dist/favesalon-embed/p-0d0ed9ea.entry.js +1 -0
  96. package/dist/favesalon-embed/p-119db8de.entry.js +1 -0
  97. package/dist/favesalon-embed/p-1432c51b.entry.js +1 -0
  98. package/dist/favesalon-embed/p-22093506.entry.js +1 -0
  99. package/dist/favesalon-embed/p-32b314e9.js +2 -0
  100. package/dist/favesalon-embed/p-4a5eca9a.js +6 -0
  101. package/dist/favesalon-embed/p-58d2e9be.js +1 -0
  102. package/dist/favesalon-embed/p-71404b6a.entry.js +1 -0
  103. package/dist/favesalon-embed/p-857c3a61.entry.js +1 -0
  104. package/dist/favesalon-embed/p-99ec77f7.entry.js +1 -0
  105. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  106. package/dist/favesalon-embed/p-b0c3673a.entry.js +1 -0
  107. package/dist/favesalon-embed/p-b287b1ea.entry.js +1 -0
  108. package/dist/favesalon-embed/p-b3af7842.entry.js +1 -0
  109. package/dist/favesalon-embed/p-b630ae68.js +1580 -0
  110. package/dist/favesalon-embed/p-ce2c1c9a.entry.js +1 -0
  111. package/dist/favesalon-embed/p-d9b7ad58.entry.js +1 -0
  112. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  113. package/dist/types/components/chat-button/index.d.ts +24 -0
  114. package/dist/types/components/google-map/index.d.ts +5 -0
  115. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -0
  116. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  117. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  118. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  119. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  120. package/{types → dist/types}/components/salon-lookbook/index.d.ts +3 -3
  121. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  122. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  123. package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
  124. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  125. package/dist/types/components/style-detail/index.d.ts +24 -0
  126. package/{types → dist/types}/components.d.ts +76 -59
  127. package/dist/types/constants/colors.d.ts +65 -0
  128. package/dist/types/mocks/users.d.ts +10 -0
  129. package/dist/types/services/services.d.ts +75 -0
  130. package/{types → dist/types}/stencil-public-runtime.d.ts +85 -11
  131. package/dist/types/types/chat.d.ts +17 -0
  132. package/dist/types/types/common.d.ts +11 -0
  133. package/{types → dist/types}/types/review.d.ts +4 -0
  134. package/{types → dist/types}/types/salon.d.ts +3 -1
  135. package/dist/types/types/style.d.ts +88 -0
  136. package/{types → dist/types}/types/stylist.d.ts +1 -1
  137. package/{types → dist/types}/types/user.d.ts +2 -2
  138. package/loader/cdn.js +3 -0
  139. package/loader/index.cjs.js +3 -0
  140. package/loader/index.d.ts +21 -0
  141. package/loader/index.es2017.js +3 -0
  142. package/loader/index.js +4 -0
  143. package/loader/package.json +11 -0
  144. package/package.json +19 -14
  145. package/readme.md +24 -7
  146. package/cjs/colors-7f354880.js +0 -95
  147. package/cjs/favesalon-embed.cjs.js +0 -20
  148. package/cjs/google-map.cjs.entry.js +0 -47
  149. package/cjs/index-95daad08.js +0 -1928
  150. package/cjs/loader.cjs.js +0 -22
  151. package/cjs/salon-contact_4.cjs.entry.js +0 -155
  152. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
  153. package/cjs/salon-info.cjs.entry.js +0 -35
  154. package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
  155. package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
  156. package/cjs/salon-reviews.cjs.entry.js +0 -205
  157. package/cjs/salon-services.cjs.entry.js +0 -47
  158. package/cjs/salon-stylists.cjs.entry.js +0 -54
  159. package/cjs/services-f1102d4a.js +0 -5762
  160. package/collection/components/google-map/index.js +0 -97
  161. package/collection/components/salon-booking/index.js +0 -121
  162. package/collection/components/salon-booking/salon-booking-modal.js +0 -88
  163. package/collection/components/salon-contact/index.js +0 -88
  164. package/collection/components/salon-gift-card/index.css +0 -25
  165. package/collection/components/salon-gift-card/index.js +0 -120
  166. package/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -48
  167. package/collection/components/salon-info/index.css +0 -3
  168. package/collection/components/salon-info/index.js +0 -97
  169. package/collection/components/salon-latest-reviews/index.js +0 -108
  170. package/collection/components/salon-locations/index.js +0 -80
  171. package/collection/components/salon-lookbook/index.js +0 -376
  172. package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
  173. package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
  174. package/collection/components/salon-ranking/index.js +0 -114
  175. package/collection/components/salon-reviews/index.js +0 -317
  176. package/collection/components/salon-schedules/index.css +0 -14
  177. package/collection/components/salon-schedules/index.js +0 -103
  178. package/collection/components/salon-services/index.js +0 -113
  179. package/collection/components/salon-styles/index.css +0 -23
  180. package/collection/components/salon-styles/index.js +0 -100
  181. package/collection/components/salon-stylists/index.js +0 -96
  182. package/collection/components/user-avatar/index.css +0 -0
  183. package/collection/components/user-avatar/index.js +0 -127
  184. package/collection/constants/colors.js +0 -91
  185. package/collection/services/services.js +0 -225
  186. package/collection/types/common.js +0 -2
  187. package/collection/types/salon.js +0 -52
  188. package/collection/types/style.js +0 -103
  189. package/collection/types/user.js +0 -10
  190. package/custom-elements/index.js +0 -12125
  191. package/esm/colors-1ec90c5f.js +0 -93
  192. package/esm/favesalon-embed.js +0 -18
  193. package/esm/google-map.entry.js +0 -43
  194. package/esm/index-09d43e3e.js +0 -1926
  195. package/esm/loader.js +0 -18
  196. package/esm/polyfills/css-shim.js +0 -1
  197. package/esm/salon-contact_4.entry.js +0 -148
  198. package/esm/salon-gift-card-modal.entry.js +0 -21
  199. package/esm/salon-info.entry.js +0 -31
  200. package/esm/salon-latest-reviews.entry.js +0 -54
  201. package/esm/salon-lookbook-modal.entry.js +0 -137
  202. package/esm/salon-reviews.entry.js +0 -201
  203. package/esm/salon-services.entry.js +0 -43
  204. package/esm/salon-stylists.entry.js +0 -50
  205. package/esm/services-74d84ca9.js +0 -5756
  206. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  207. package/favesalon-embed/p-0188d4dc.entry.js +0 -1
  208. package/favesalon-embed/p-0318501e.js +0 -1
  209. package/favesalon-embed/p-078f242d.entry.js +0 -1
  210. package/favesalon-embed/p-13e23c61.entry.js +0 -1
  211. package/favesalon-embed/p-17df13ad.js +0 -1
  212. package/favesalon-embed/p-1a3179c8.entry.js +0 -1
  213. package/favesalon-embed/p-20aa75de.js +0 -6
  214. package/favesalon-embed/p-2901a6d6.entry.js +0 -1
  215. package/favesalon-embed/p-2b861430.entry.js +0 -1
  216. package/favesalon-embed/p-44d810a0.js +0 -1
  217. package/favesalon-embed/p-4a5eca9a.js +0 -6
  218. package/favesalon-embed/p-4c68700f.entry.js +0 -1
  219. package/favesalon-embed/p-4e2d7b29.js +0 -1
  220. package/favesalon-embed/p-6b845bf1.entry.js +0 -1
  221. package/favesalon-embed/p-7350f6b5.entry.js +0 -1
  222. package/favesalon-embed/p-897c2b1c.entry.js +0 -1
  223. package/favesalon-embed/p-8e60f56f.entry.js +0 -1
  224. package/favesalon-embed/p-a49afdc1.entry.js +0 -1
  225. package/favesalon-embed/p-c93867c4.entry.js +0 -1
  226. package/favesalon-embed/p-ea6a097f.entry.js +0 -1
  227. package/types/components/google-map/index.d.ts +0 -10
  228. package/types/components/salon-contact/index.d.ts +0 -9
  229. package/types/components/salon-lookbook/salon-lookbook-modal.d.ts +0 -13
  230. package/types/components/salon-reviews/index.d.ts +0 -24
  231. package/types/components/salon-styles/index.d.ts +0 -9
  232. package/types/constants/colors.d.ts +0 -88
  233. package/types/services/services.d.ts +0 -26
  234. package/types/types/common.d.ts +0 -2
  235. package/types/types/style.d.ts +0 -59
  236. /package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -0
  237. /package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  238. /package/{cjs → dist/cjs}/index.cjs.js +0 -0
  239. /package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  240. /package/{esm/index.js → dist/collection/components/salon-info/index.css} +0 -0
  241. /package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -0
  242. /package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  243. /package/{collection → dist/collection}/components/salon-stylists/index.css +0 -0
  244. /package/{collection/components/salon-locations → dist/collection/components/user-avatar}/index.css +0 -0
  245. /package/{collection → dist/collection}/global/global.js +0 -0
  246. /package/{collection → dist/collection}/index.js +0 -0
  247. /package/{collection → dist/collection}/types/service.js +0 -0
  248. /package/{collection → dist/collection}/utils/utils.js +0 -0
  249. /package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -0
  250. /package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  251. /package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  252. /package/{esm → dist/esm}/polyfills/dom.js +0 -0
  253. /package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  254. /package/{esm → dist/esm}/polyfills/index.js +0 -0
  255. /package/{esm → dist/esm}/polyfills/system.js +0 -0
  256. /package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  257. /package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  258. /package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  259. /package/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -0
  260. /package/{index.cjs.js → dist/index.cjs.js} +0 -0
  261. /package/{index.js → dist/index.js} +0 -0
  262. /package/{collection/components/salon-services/index.css → dist/types/components/chat-conversation/index.d.ts} +0 -0
  263. /package/{types → dist/types}/components/salon-booking/index.d.ts +0 -0
  264. /package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
  265. /package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
  266. /package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  267. /package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  268. /package/{types → dist/types}/index.d.ts +0 -0
  269. /package/{types → dist/types}/types/service.d.ts +0 -0
  270. /package/{types → dist/types}/utils/utils.d.ts +0 -0
@@ -0,0 +1,184 @@
1
+ import { h } from '@stencil/core';
2
+ import { Colors } from '../../constants/colors';
3
+ import HttpService from '../../services/services';
4
+ const pageLimit = 20;
5
+ export class SalonStylists {
6
+ constructor() {
7
+ this.salonId = undefined;
8
+ this.salonStylists = undefined;
9
+ this.totalStylists = undefined;
10
+ this.page = 1;
11
+ this.isLoading = undefined;
12
+ this.isLoadingMore = undefined;
13
+ this.canLoadMore = undefined;
14
+ }
15
+ componentWillLoad() {
16
+ this.fetchData();
17
+ }
18
+ async fetchData() {
19
+ this.isLoading = true;
20
+ try {
21
+ const { total, data } = await HttpService().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
22
+ this.totalStylists = total;
23
+ this.salonStylists = data;
24
+ this.canLoadMore = data.length === pageLimit;
25
+ }
26
+ catch (e) {
27
+ this.totalStylists = 0;
28
+ this.salonStylists = [];
29
+ this.canLoadMore = false;
30
+ }
31
+ this.isLoading = false;
32
+ }
33
+ async onLoadMore() {
34
+ this.isLoadingMore = true;
35
+ try {
36
+ const { data } = await HttpService().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
37
+ this.salonStylists = this.salonStylists.concat(data || []);
38
+ this.canLoadMore = data.length === pageLimit;
39
+ this.page += 1;
40
+ }
41
+ catch (e) { }
42
+ this.isLoadingMore = false;
43
+ }
44
+ render() {
45
+ if (this.isLoading) {
46
+ return (h("div", null, h("div", { class: "view--salon-stylists" }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((fakeId, index) => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
47
+ background: 'none',
48
+ border: 'none',
49
+ overflow: 'hidden',
50
+ } }, h("div", { class: "salon-stylist--avatar", style: {
51
+ backgroundColor: Colors.Gray01,
52
+ backgroundRepeat: 'no-repeat',
53
+ backgroundPosition: 'center top',
54
+ backgroundSize: 'cover',
55
+ border: `1px solid ${Colors.Gray01}`,
56
+ borderRadius: '8px',
57
+ position: 'relative',
58
+ display: 'flex',
59
+ width: '100%',
60
+ alignItems: 'center',
61
+ justifyContent: 'center',
62
+ } }), h("div", { class: "card-body" }, h("div", { key: `stylist--${fakeId}--${index}`, style: {
63
+ backgroundColor: Colors.Gray01,
64
+ height: '16px',
65
+ width: '120px',
66
+ margin: 'auto',
67
+ } })))))))));
68
+ }
69
+ return (h("div", null, h("div", { class: "view--salon-stylists" }, (this.salonStylists || []).map(stylist => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
70
+ background: 'none',
71
+ border: 'none',
72
+ overflow: 'hidden',
73
+ } }, h("div", { class: "salon-stylist--avatar", style: {
74
+ backgroundImage: `url("${stylist.avatar}")`,
75
+ backgroundColor: Colors.Gray01,
76
+ backgroundRepeat: 'no-repeat',
77
+ backgroundPosition: 'center top',
78
+ backgroundSize: 'cover',
79
+ border: `1px solid ${Colors.Gray01}`,
80
+ borderRadius: '8px',
81
+ position: 'relative',
82
+ display: 'flex',
83
+ width: '100%',
84
+ alignItems: 'center',
85
+ justifyContent: 'center',
86
+ } }, !stylist.avatar && (h("span", { style: {
87
+ fontSize: '32px',
88
+ fontWeight: 'bold',
89
+ textTransform: 'uppercase',
90
+ } }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), h("div", { class: "card-body" }, h("div", { style: {
91
+ fontSize: '18px',
92
+ fontWeight: '600',
93
+ textAlign: 'center',
94
+ } }, stylist.fullName))))))), this.canLoadMore && (h("div", { class: "view-footer", style: {
95
+ textAlign: 'center',
96
+ paddingTop: '32px',
97
+ paddingBottom: '16px',
98
+ } }, h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
99
+ background: Colors.White,
100
+ border: `1px solid ${Colors.Gray02}`,
101
+ borderRadius: '4px',
102
+ paddingLeft: '24px',
103
+ paddingRight: '24px',
104
+ }, onClick: () => this.onLoadMore() }, "Load more")))));
105
+ }
106
+ static get is() { return "salon-stylists"; }
107
+ static get originalStyleUrls() {
108
+ return {
109
+ "$": ["index.css"]
110
+ };
111
+ }
112
+ static get styleUrls() {
113
+ return {
114
+ "$": ["index.css"]
115
+ };
116
+ }
117
+ static get properties() {
118
+ return {
119
+ "salonId": {
120
+ "type": "number",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "number",
124
+ "resolved": "number",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": false,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": ""
132
+ },
133
+ "attribute": "salon-id",
134
+ "reflect": false
135
+ }
136
+ };
137
+ }
138
+ static get states() {
139
+ return {
140
+ "salonStylists": {},
141
+ "totalStylists": {},
142
+ "page": {},
143
+ "isLoading": {},
144
+ "isLoadingMore": {},
145
+ "canLoadMore": {}
146
+ };
147
+ }
148
+ static get methods() {
149
+ return {
150
+ "fetchData": {
151
+ "complexType": {
152
+ "signature": "() => Promise<void>",
153
+ "parameters": [],
154
+ "references": {
155
+ "Promise": {
156
+ "location": "global"
157
+ }
158
+ },
159
+ "return": "Promise<void>"
160
+ },
161
+ "docs": {
162
+ "text": "",
163
+ "tags": []
164
+ }
165
+ },
166
+ "onLoadMore": {
167
+ "complexType": {
168
+ "signature": "() => Promise<void>",
169
+ "parameters": [],
170
+ "references": {
171
+ "Promise": {
172
+ "location": "global"
173
+ }
174
+ },
175
+ "return": "Promise<void>"
176
+ },
177
+ "docs": {
178
+ "text": "",
179
+ "tags": []
180
+ }
181
+ }
182
+ };
183
+ }
184
+ }
@@ -0,0 +1,76 @@
1
+ .salon-modal.salon-modal--lookbook-detail .salon-modal--close {
2
+ display: none !important;
3
+ }
4
+
5
+ .salon-modal.salon-modal--lookbook-detail .salon-modal--content {
6
+ background-color: #fff;
7
+ position: fixed;
8
+ top: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ left: 0;
12
+ width: 100%;
13
+ height: 100%;
14
+ z-index: 1000;
15
+ overflow-y: auto;
16
+ }
17
+
18
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--image {
19
+ height: 240px !important;
20
+ }
21
+
22
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnails {
23
+ text-align: center;
24
+ }
25
+
26
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail {
27
+ display: inline-block;
28
+ margin-top: 12px;
29
+ margin-right: 12px;
30
+ height: 40px;
31
+ width: 60px;
32
+ }
33
+
34
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--button {
35
+ border: none;
36
+ position: absolute;
37
+ top: 50%;
38
+ z-index: 20;
39
+ height: 40px;
40
+ width: 40px;
41
+
42
+ -moz-border-radius: 50px;
43
+ -webkit-border-radius: 50px;
44
+ border-radius: 50px;
45
+
46
+ -moz-transform: translate(0, -50%);
47
+ -webkit-transform: translate(0, -50%);
48
+ transform: translate(0, -50%);
49
+ }
50
+
51
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--prev {
52
+ left: 24px;
53
+ }
54
+
55
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--next {
56
+ right: 24px;
57
+ }
58
+
59
+
60
+ @media (min-width: 768px) {
61
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--image {
62
+ height: 360px !important;
63
+ }
64
+ }
65
+
66
+
67
+ @media (min-width: 992px) {
68
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--image {
69
+ height: 480px !important;
70
+ }
71
+
72
+ .salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail {
73
+ height: 56px;
74
+ width: 72px;
75
+ }
76
+ }
@@ -0,0 +1,386 @@
1
+ import { h } from '@stencil/core';
2
+ import dayjs from 'dayjs';
3
+ import relativeTime from 'dayjs/plugin/relativeTime';
4
+ import { isVideoMedia } from '../../types/style';
5
+ import { Colors } from '../../constants/colors';
6
+ import HttpService from '../../services/services';
7
+ import { getSalonImage } from '../../types/salon';
8
+ import { shortDateYearFormat } from '../../types/common';
9
+ dayjs.extend(relativeTime);
10
+ export class StyleDetail {
11
+ constructor() {
12
+ this.salonId = undefined;
13
+ this.salonLookbook = undefined;
14
+ this.lookbookInfo = undefined;
15
+ this.isModalOpen = true;
16
+ this.currentMediaIdx = 0;
17
+ this.currentMedia = undefined;
18
+ this.albumMedias = [];
19
+ this.similarStyles = [];
20
+ this.totalComments = 0;
21
+ this.lookbookComments = [];
22
+ this.isLayoutSetup = undefined;
23
+ }
24
+ componentWillLoad() {
25
+ this.injectSDK();
26
+ if (!!this.salonLookbook) {
27
+ this.lookbookInfo = JSON.parse(this.salonLookbook);
28
+ this.fetchData();
29
+ }
30
+ }
31
+ componentDidRender() {
32
+ this.setupGridLayout();
33
+ }
34
+ injectSDK() {
35
+ return new Promise((resolve) => {
36
+ const script = document.createElement('script');
37
+ script.type = 'text/javascript';
38
+ script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
39
+ document.body.appendChild(script);
40
+ return resolve(true);
41
+ });
42
+ }
43
+ setupGridLayout() {
44
+ if (!this.isLayoutSetup && this.similarStyles.length > 0 && document.querySelector('#similar-styles--grid')) {
45
+ const script = document.createElement('script');
46
+ script.type = 'text/javascript';
47
+ script.innerHTML = `
48
+ var masonry = new Macy({
49
+ container: '#similar-styles--grid',
50
+ useContainerForBreakpoints: true,
51
+ margin: 16,
52
+ columns: 2,
53
+ });
54
+ `;
55
+ document.body.appendChild(script);
56
+ this.isLayoutSetup = true;
57
+ }
58
+ }
59
+ fetchData() {
60
+ try {
61
+ const promises = [
62
+ HttpService().fetchStyleDetail(this.lookbookInfo.id).then(response => {
63
+ const { styleInfo, similarStyles } = response;
64
+ this.similarStyles = similarStyles;
65
+ if (styleInfo) {
66
+ this.lookbookInfo = styleInfo;
67
+ this.albumMedias = styleInfo.albumMedias || [];
68
+ this.currentMedia = (styleInfo.albumMedias || [])[0];
69
+ }
70
+ }),
71
+ HttpService().fetchStyleComments(this.lookbookInfo.id).then(response => {
72
+ this.totalComments = response.total;
73
+ this.lookbookComments = response.data;
74
+ }),
75
+ ];
76
+ return Promise.all(promises);
77
+ }
78
+ catch (e) { }
79
+ }
80
+ closeModal() {
81
+ this.isModalOpen = false;
82
+ const el = document.querySelector('style-detail');
83
+ el.remove();
84
+ }
85
+ onClickLookbook(style) {
86
+ const elLookbookModal = document.createElement('div');
87
+ elLookbookModal.innerHTML = `
88
+ <style-detail
89
+ salon-id=${this.salonId}
90
+ salon-lookbook='${JSON.stringify(style)}'
91
+ ></style-detail>
92
+ `;
93
+ document.body.appendChild(elLookbookModal);
94
+ }
95
+ onClickPrev() {
96
+ if (this.currentMediaIdx === 0) {
97
+ this.currentMediaIdx = this.albumMedias.length - 1;
98
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
99
+ }
100
+ else {
101
+ this.currentMediaIdx = this.currentMediaIdx - 1;
102
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
103
+ }
104
+ }
105
+ onClickNext() {
106
+ if (this.currentMediaIdx === this.albumMedias.length - 1) {
107
+ this.currentMediaIdx = 0;
108
+ this.currentMedia = this.albumMedias[0];
109
+ }
110
+ else {
111
+ this.currentMediaIdx = this.currentMediaIdx + 1;
112
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
113
+ }
114
+ }
115
+ render() {
116
+ const { createdDate, totalView, totalLike, totalBooking, album, salon, stylist, } = this.lookbookInfo;
117
+ if (this.isModalOpen) {
118
+ const { caption, description, mediaUrl } = this.currentMedia || {};
119
+ const isVideo = isVideoMedia((this.currentMedia || {}));
120
+ return (h("div", { class: "salon-modal salon-modal--lookbook-detail" }, h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("div", { class: "style-detail" }, h("div", { class: "style-detail--header" }, h("div", { style: {
121
+ position: 'relative',
122
+ overflow: 'hidden',
123
+ } }, h("div", { style: Object.assign({ backgroundColor: Colors.Gray01, backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: '0 0', filter: 'blur(30px)', position: 'absolute', inset: '0', zIndex: '1' }, this.currentMedia && !isVideoMedia(this.currentMedia) ? { backgroundImage: `url("${this.currentMedia.imageThumb}")` } : {}) }), h("div", { style: {
124
+ zIndex: '2',
125
+ position: 'relative',
126
+ width: '100%',
127
+ backgroundColor: 'rgba(0, 0, 0, 0.25)',
128
+ padding: '12px 16px',
129
+ overflow: 'hidden',
130
+ } }, h("span", { style: {
131
+ color: Colors.White,
132
+ border: 'none',
133
+ display: 'flex',
134
+ alignItems: 'center',
135
+ justifyContent: 'center',
136
+ height: '32px',
137
+ } }, h("span", null, this.currentMediaIdx + 1, " / ", this.albumMedias.length)), h("div", { style: {
138
+ display: 'flex',
139
+ alignItems: 'center',
140
+ position: 'absolute',
141
+ right: '16px',
142
+ top: '50%',
143
+ transform: 'translate(0, -50%)',
144
+ } }, h("button", { type: "text", class: "btn btn-light", style: {
145
+ backgroundColor: Colors.White,
146
+ borderColor: Colors.White,
147
+ border: 'none',
148
+ borderRadius: '50px',
149
+ display: 'flex',
150
+ alignItems: 'center',
151
+ justifyContent: 'center',
152
+ height: '32px',
153
+ width: '32px',
154
+ marginLeft: '12px',
155
+ }, onClick: () => this.closeModal() }, h("i", { class: "ri-close-fill", style: { fontSize: '16px', lineHeight: '1' } })))), h("div", { style: { position: 'relative', zIndex: "3" } }, h("div", { class: "style-detail--slides", style: {
156
+ marginTop: '16px',
157
+ marginBottom: '12px',
158
+ } }, h("div", { class: "style-detail--slides--image", style: {
159
+ width: '100%',
160
+ position: 'relative',
161
+ height: '360px',
162
+ } }, isVideo && (h("video", { muted: true, controls: true, width: "100%", height: "100%" }, h("source", { src: mediaUrl, type: "video/mp4" }))), !isVideo && (h("div", { style: {
163
+ position: 'absolute',
164
+ inset: '0',
165
+ zIndex: '2',
166
+ display: 'flex',
167
+ alignItems: 'center',
168
+ justifyContent: 'center',
169
+ } }, h("img", { src: mediaUrl, alt: caption, style: {
170
+ objectFit: 'contain',
171
+ maxHeight: '100%',
172
+ maxWidth: '100%',
173
+ } })))), h("div", { class: "style-detail--slides--thumbnails", style: {
174
+ width: '100%',
175
+ position: 'relative',
176
+ } }, this.albumMedias.map((media, idx) => {
177
+ const isStyleVideo = isVideoMedia(media);
178
+ return (h("div", { class: "style-detail--slides--thumbnail", style: Object.assign(Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '4px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, this.currentMediaIdx !== idx ? { opacity: '0.75' } : {}), !isStyleVideo ? {
179
+ backgroundImage: `url("${media.imageThumb || media.imageThumbMedium}")`,
180
+ backgroundRepeat: 'no-repeat',
181
+ backgroundPosition: 'center center',
182
+ backgroundSize: 'cover',
183
+ } : {}), onClick: () => {
184
+ this.currentMedia = media;
185
+ this.currentMediaIdx = idx;
186
+ } }, isStyleVideo && (h("div", null, h("video", { muted: true, width: "100%", height: "100%", poster: media.imageThumb }, h("source", { src: media.mediaUrl, type: "video/mp4" })), h("i", { class: "ri-play-circle-fill", style: {
187
+ fontSize: '48px',
188
+ color: Colors.TextColor,
189
+ position: 'absolute',
190
+ left: '50%',
191
+ top: '50%',
192
+ transform: 'translate(-50%, -50%)',
193
+ } })))));
194
+ }))), this.albumMedias.length > 1 && (h("div", null, h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--prev", onClick: () => this.onClickPrev() }, h("i", { class: "ri-arrow-left-line", style: { color: Colors.TextColor, fontSize: '18px' } })), h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--next", onClick: () => this.onClickNext() }, h("i", { class: "ri-arrow-right-line", style: { color: Colors.TextColor, fontSize: '18px' } }))))))), h("div", { class: "style-detail--content" }, h("div", { class: "container" }, h("div", { style: {
195
+ paddingBottom: '24px',
196
+ paddingTop: '24px',
197
+ } }, h("div", { class: "row" }, h("div", { class: this.similarStyles.length > 0 ? 'col-md-8' : 'col-md-12', style: { marginBottom: '24px' } }, h("div", { class: "row" }, salon && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, h("div", { style: {
198
+ backgroundColor: Colors.Red01,
199
+ borderRadius: '4px',
200
+ padding: '8px',
201
+ display: 'flex',
202
+ alignItems: 'center',
203
+ justifyContent: 'space-between',
204
+ } }, h("div", { style: { paddingLeft: '8px' } }, h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "At salon"), h("div", { style: {
205
+ color: Colors.Secondary,
206
+ fontSize: '20px',
207
+ lineHeight: '24px',
208
+ } }, salon.businessName)), h("div", { style: {
209
+ backgroundImage: `url("${getSalonImage(salon)}")`,
210
+ backgroundColor: Colors.Red02,
211
+ backgroundSize: 'cover',
212
+ backgroundRepeat: 'no-repeat',
213
+ backgroundPosition: '0 0',
214
+ borderRadius: '4px',
215
+ height: '48px',
216
+ width: '48px',
217
+ } })))), stylist && stylist.id && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, h("div", { style: {
218
+ backgroundColor: Colors.Yellow01,
219
+ borderRadius: '4px',
220
+ padding: '8px',
221
+ display: 'flex',
222
+ alignItems: 'center',
223
+ justifyContent: 'space-between',
224
+ } }, h("div", { style: { paddingLeft: '8px' } }, h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "By stylist"), h("div", { style: {
225
+ color: Colors.Secondary,
226
+ fontSize: '20px',
227
+ lineHeight: '24px',
228
+ } }, stylist.fullName)), h("div", { style: {
229
+ backgroundImage: `url("${stylist.avatar}")`,
230
+ backgroundColor: Colors.Yellow02,
231
+ backgroundSize: 'cover',
232
+ backgroundRepeat: 'no-repeat',
233
+ backgroundPosition: '0 0',
234
+ borderRadius: '4px',
235
+ height: '48px',
236
+ width: '48px',
237
+ } }))))), h("div", { style: {
238
+ borderBottom: `1px solid ${Colors.Gray02}`,
239
+ borderTop: `1px solid ${Colors.Gray02}`,
240
+ display: 'flex',
241
+ alignItems: 'center',
242
+ justifyContent: 'space-between',
243
+ paddingBottom: '16px',
244
+ paddingTop: '16px',
245
+ } }, h("div", { style: {
246
+ display: 'flex',
247
+ alignItems: 'center',
248
+ justifyContent: 'space-around',
249
+ flexShrink: '1',
250
+ flexGrow: '1',
251
+ } }, h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalLike), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "faves")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalBooking), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "booked")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalView), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "views")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, this.totalComments), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "comments")))), (caption || description) && (h("div", { style: { paddingTop: '24px' } }, h("div", { style: { color: Colors.Gray04, fontSize: '14px' } }, createdDate && dayjs(createdDate).format(shortDateYearFormat)), h("div", { style: { fontSize: '24px' } }, caption), h("div", { style: {
252
+ fontSize: '16px',
253
+ paddingTop: caption ? '16px' : '0',
254
+ } }, description))), album && album.tags.length > 0 && (h("div", { style: {
255
+ paddingTop: '24px',
256
+ marginBottom: '-12px',
257
+ } }, album.tags.map((tag, idx) => (h("button", { class: "btn btn-light", key: `album--tag-${idx}`, style: {
258
+ backgroundColor: Colors.Gray01,
259
+ borderColor: Colors.Gray01,
260
+ borderRadius: '4px',
261
+ marginRight: '12px',
262
+ marginBottom: '12px',
263
+ } }, tag))))), h("div", { style: { marginTop: '32px' } }, this.lookbookComments && this.lookbookComments.length > 0 && (h("div", null, h("div", { style: { fontWeight: '600', marginBottom: '8px' } }, this.totalComments, " ", this.totalComments === 1 ? 'comment' : 'comments'), h("div", { class: "view view--style-comments", style: {
264
+ borderTop: `1px solid ${Colors.Gray02}`,
265
+ paddingTop: '24px',
266
+ paddingBottom: '24px',
267
+ } }, this.lookbookComments.map((comment, idx) => {
268
+ const { user, title, description, createdDate } = comment;
269
+ return (h("div", { key: `style-info--comment-${idx}`, style: idx > 0 ? {
270
+ borderTop: `1px solid ${Colors.Gray02}`,
271
+ marginTop: '24px',
272
+ paddingTop: '24px',
273
+ } : {} }, h("div", { style: { overflow: 'hidden' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: h("div", null, h("div", { style: { color: Colors.Gray04, lineHeight: '1', fontSize: '12px', fontWeight: '400' } }, dayjs(createdDate).fromNow()), h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName)), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { style: {
274
+ color: Colors.Black,
275
+ fontSize: '16px',
276
+ paddingTop: '16px',
277
+ } }, title), description && (h("div", { style: {
278
+ color: Colors.Gray05,
279
+ paddingTop: '8px',
280
+ } }, description))));
281
+ })))))), h("div", { class: "col-md-4", style: { marginBottom: '24px' } }, h("div", { class: "block block--similar-styles" }, this.similarStyles.length > 0 && (h("div", { class: "block--content" }, h("h3", { style: {
282
+ lineHeight: '1.2',
283
+ fontSize: '24px',
284
+ color: Colors.Secondary,
285
+ } }, "More like this"), h("div", { style: { marginTop: '16px' } }, h("div", { class: "similar-styles--grid", id: "similar-styles--grid" }, this.similarStyles.slice(0, 6).map(style => {
286
+ const { caption, imageThumbMedium, owner } = style;
287
+ return (h("div", { class: "similar-styles--grid-item", onClick: () => {
288
+ this.closeModal();
289
+ this.onClickLookbook(style);
290
+ } }, h("div", { class: "card", style: {
291
+ background: 'none',
292
+ border: 'none',
293
+ cursor: 'pointer',
294
+ } }, h("div", { class: "similar-styles--grid-item--image", style: {
295
+ borderRadius: '8px',
296
+ overflow: 'hidden',
297
+ minHeight: '80px',
298
+ background: Colors.Gray01,
299
+ } }, h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })), owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } }, h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
300
+ }))))))))))))))));
301
+ }
302
+ return null;
303
+ }
304
+ static get is() { return "style-detail"; }
305
+ static get originalStyleUrls() {
306
+ return {
307
+ "$": ["index.css"]
308
+ };
309
+ }
310
+ static get styleUrls() {
311
+ return {
312
+ "$": ["index.css"]
313
+ };
314
+ }
315
+ static get properties() {
316
+ return {
317
+ "salonId": {
318
+ "type": "number",
319
+ "mutable": false,
320
+ "complexType": {
321
+ "original": "number",
322
+ "resolved": "number",
323
+ "references": {}
324
+ },
325
+ "required": false,
326
+ "optional": false,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": ""
330
+ },
331
+ "attribute": "salon-id",
332
+ "reflect": false
333
+ },
334
+ "salonLookbook": {
335
+ "type": "string",
336
+ "mutable": false,
337
+ "complexType": {
338
+ "original": "string",
339
+ "resolved": "string",
340
+ "references": {}
341
+ },
342
+ "required": false,
343
+ "optional": false,
344
+ "docs": {
345
+ "tags": [],
346
+ "text": ""
347
+ },
348
+ "attribute": "salon-lookbook",
349
+ "reflect": false
350
+ }
351
+ };
352
+ }
353
+ static get states() {
354
+ return {
355
+ "lookbookInfo": {},
356
+ "isModalOpen": {},
357
+ "currentMediaIdx": {},
358
+ "currentMedia": {},
359
+ "albumMedias": {},
360
+ "similarStyles": {},
361
+ "totalComments": {},
362
+ "lookbookComments": {},
363
+ "isLayoutSetup": {}
364
+ };
365
+ }
366
+ static get methods() {
367
+ return {
368
+ "fetchData": {
369
+ "complexType": {
370
+ "signature": "() => Promise<any[]>",
371
+ "parameters": [],
372
+ "references": {
373
+ "Promise": {
374
+ "location": "global"
375
+ }
376
+ },
377
+ "return": "Promise<any[]>"
378
+ },
379
+ "docs": {
380
+ "text": "",
381
+ "tags": []
382
+ }
383
+ }
384
+ };
385
+ }
386
+ }