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
@@ -1,108 +0,0 @@
1
- import { Component, Prop, h, Method, State } from '@stencil/core';
2
- import dayjs from 'dayjs';
3
- import { Colors } from '../../constants/colors';
4
- import { getRatingText } from '../../utils/utils';
5
- import HttpService from '../../services/services';
6
- import { shortDate } from '../../types/common';
7
- export class SalonLatestReviews {
8
- constructor() {
9
- this.salonReviews = [];
10
- }
11
- componentWillLoad() {
12
- this.fetchData();
13
- }
14
- async fetchData() {
15
- try {
16
- const { allItems } = await HttpService().fetchSalonReviews(this.salonId, { noLoop: true });
17
- this.salonReviews = [...allItems];
18
- }
19
- catch (e) { }
20
- }
21
- render() {
22
- const ratingTexts = getRatingText();
23
- return (h("div", { class: "salon-latest-reviews", style: { overflowX: 'auto' } },
24
- h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, (this.salonReviews || []).map((review, index) => {
25
- const { user } = review;
26
- return (h("div", { class: "salon-review", style: Object.assign({ border: `1px solid ${Colors.Gray05}`, background: Colors.White, borderRadius: '8px', overflow: 'hidden' }, index > 0 ? { marginLeft: '16px' } : {}) },
27
- h("div", { class: "card", style: { border: 'none' } },
28
- h("div", { class: "card-body" },
29
- h("div", { class: "salon-review--user", style: { marginBottom: '16px' } },
30
- h("user-avatar", { size: 48, name: user.name, shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, avatar: user.avatar, nameStyle: { fontWeight: 'bold' } })),
31
- h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } },
32
- [1, 2, 3, 4, 5].map(score => (h("i", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
33
- fontSize: '16px',
34
- marginRight: '4px',
35
- } }))),
36
- h("div", { class: "salon-review--rating--date", style: { color: Colors.Gray03, marginLeft: '16px' } }, dayjs(review.createdDate).format(shortDate))),
37
- h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]),
38
- (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } },
39
- h("div", { class: "salon-review--description", style: {
40
- fontSize: '16px',
41
- lineHeight: '26px',
42
- overflow: 'hidden',
43
- maxHeight: review.photos.length > 0 ? '52px' : '104px',
44
- } }, review.title || review.description))),
45
- review.photos.length > 0 && (h("div", { style: {
46
- display: 'flex',
47
- flexDirection: 'row',
48
- overflowX: 'auto',
49
- } }, review.photos.map(photo => (h("div", { style: {
50
- border: '1px solid #d9d9d9',
51
- position: 'relative',
52
- cursor: 'pointer',
53
- borderRadius: '2px',
54
- height: '66px',
55
- marginTop: '16px',
56
- marginRight: '16px',
57
- } },
58
- h("img", { alt: "", src: photo.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))))));
59
- }))));
60
- }
61
- static get is() { return "salon-latest-reviews"; }
62
- static get originalStyleUrls() { return {
63
- "$": ["index.css"]
64
- }; }
65
- static get styleUrls() { return {
66
- "$": ["index.css"]
67
- }; }
68
- static get properties() { return {
69
- "salonId": {
70
- "type": "number",
71
- "mutable": false,
72
- "complexType": {
73
- "original": "number",
74
- "resolved": "number",
75
- "references": {}
76
- },
77
- "required": false,
78
- "optional": false,
79
- "docs": {
80
- "tags": [],
81
- "text": ""
82
- },
83
- "attribute": "salon-id",
84
- "reflect": false
85
- }
86
- }; }
87
- static get states() { return {
88
- "salonReviews": {}
89
- }; }
90
- static get methods() { return {
91
- "fetchData": {
92
- "complexType": {
93
- "signature": "() => Promise<void>",
94
- "parameters": [],
95
- "references": {
96
- "Promise": {
97
- "location": "global"
98
- }
99
- },
100
- "return": "Promise<void>"
101
- },
102
- "docs": {
103
- "text": "",
104
- "tags": []
105
- }
106
- }
107
- }; }
108
- }
@@ -1,80 +0,0 @@
1
- import { Component, Prop, h, State } from '@stencil/core';
2
- import { formatFullAddress } from '../../utils/utils';
3
- import HttpService from '../../services/services';
4
- export class SalonLocations {
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
- render() {
21
- const { businessLocationLat: lat, businessLocationLng: lng } = this.salonInfoState || {};
22
- return (h("div", { class: "view view--salon-locations" },
23
- h("div", { class: "view-content", style: { height: '380px' } },
24
- h("div", { style: {
25
- fontSize: '16px',
26
- lineHeight: '26px',
27
- maxHeight: '52px',
28
- marginBottom: '16px',
29
- overflow: 'hidden',
30
- textOverflow: 'ellipsis',
31
- } }, formatFullAddress(this.salonInfoState)),
32
- h("div", { class: "view--salon-info--map", style: { height: '264px' } }, lat && lng && h("google-map", { lat: lat, lng: lng })))));
33
- }
34
- static get is() { return "salon-locations"; }
35
- static get originalStyleUrls() { return {
36
- "$": ["index.css"]
37
- }; }
38
- static get styleUrls() { return {
39
- "$": ["index.css"]
40
- }; }
41
- static get properties() { return {
42
- "salonId": {
43
- "type": "number",
44
- "mutable": false,
45
- "complexType": {
46
- "original": "number",
47
- "resolved": "number",
48
- "references": {}
49
- },
50
- "required": false,
51
- "optional": false,
52
- "docs": {
53
- "tags": [],
54
- "text": ""
55
- },
56
- "attribute": "salon-id",
57
- "reflect": false
58
- },
59
- "salonInfo": {
60
- "type": "string",
61
- "mutable": false,
62
- "complexType": {
63
- "original": "string",
64
- "resolved": "string",
65
- "references": {}
66
- },
67
- "required": false,
68
- "optional": true,
69
- "docs": {
70
- "tags": [],
71
- "text": ""
72
- },
73
- "attribute": "salon-info",
74
- "reflect": false
75
- }
76
- }; }
77
- static get states() { return {
78
- "salonInfoState": {}
79
- }; }
80
- }
@@ -1,376 +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
- const lookbookSortOptions = [{
5
- value: 'like',
6
- label: 'Most popular',
7
- }, {
8
- value: 'newest',
9
- label: 'Newest first',
10
- }, {
11
- value: 'oldest',
12
- label: 'Oldest first',
13
- }];
14
- const lookbookFilterOptions = [{
15
- value: 'all',
16
- label: 'All Category',
17
- }];
18
- export class SalonLookbook {
19
- constructor() {
20
- this.isLoading = true;
21
- this.currentPage = 1;
22
- this.totalLookbooks = 0;
23
- this.salonCategories = [];
24
- this.salonLookbooks = [];
25
- this.sortBy = lookbookSortOptions[1].value;
26
- this.filterBy = lookbookFilterOptions[0].value;
27
- }
28
- componentWillLoad() {
29
- this.fetchData();
30
- this.injectSDK();
31
- }
32
- componentDidRender() {
33
- this.setupGridLayout();
34
- }
35
- injectSDK() {
36
- return new Promise((resolve) => {
37
- const script = document.createElement('script');
38
- script.type = 'text/javascript';
39
- script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
40
- document.body.appendChild(script);
41
- return resolve(true);
42
- });
43
- }
44
- setupGridLayout() {
45
- if (!this.isLayoutSetup && document.querySelector('#salon-loobooks--grid')) {
46
- const script = document.createElement('script');
47
- script.type = 'text/javascript';
48
- script.innerHTML = `
49
- var masonry = new Macy({
50
- container: '#salon-loobooks--grid',
51
- useContainerForBreakpoints: true,
52
- margin: 12,
53
- columns: 7,
54
- breakAt: {
55
- 1200: {
56
- margin: 16,
57
- columns: 6,
58
- },
59
- 992: {
60
- margin: 16,
61
- columns: 5,
62
- },
63
- 768: {
64
- margin: 16,
65
- columns: 3,
66
- },
67
- 576: {
68
- margin: 16,
69
- columns: 2,
70
- },
71
- },
72
- });
73
- `;
74
- document.body.appendChild(script);
75
- this.isLayoutSetup = true;
76
- }
77
- }
78
- async fetchData() {
79
- try {
80
- const promises = [
81
- this.fetchLookbooks(Object.assign({ page: 1, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {})),
82
- this.fetchCategories(),
83
- ];
84
- return Promise.all(promises);
85
- }
86
- catch (e) { }
87
- }
88
- async fetchLookbooks(options, isLoadingMore) {
89
- if (isLoadingMore) {
90
- this.isLoadingMore = true;
91
- }
92
- else {
93
- this.isLoading = true;
94
- }
95
- try {
96
- const { total, allLookbooks } = await HttpService().fetchSalonLookbooks(this.salonId, options);
97
- this.totalLookbooks = total;
98
- this.salonLookbooks = this.salonLookbooks.concat(allLookbooks);
99
- this.hideLoadMore = allLookbooks.length < 20;
100
- }
101
- catch (error) { }
102
- if (isLoadingMore) {
103
- this.isLoadingMore = false;
104
- }
105
- else {
106
- this.isLoading = false;
107
- }
108
- }
109
- async onChangeFiltering(filterBy) {
110
- try {
111
- this.currentPage = 1;
112
- this.totalLookbooks = 0;
113
- this.salonLookbooks = [];
114
- this.hideLoadMore = true;
115
- this.filterBy = filterBy;
116
- await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {}));
117
- if (window.masonry) {
118
- this.isLayoutSetup = false;
119
- }
120
- }
121
- catch (error) { }
122
- }
123
- async onChangeSorting(sortBy) {
124
- try {
125
- this.currentPage = 1;
126
- this.totalLookbooks = 0;
127
- this.salonLookbooks = [];
128
- this.hideLoadMore = true;
129
- this.sortBy = sortBy;
130
- await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {}));
131
- if (window.masonry) {
132
- this.isLayoutSetup = false;
133
- }
134
- }
135
- catch (error) { }
136
- }
137
- async onLoadMore() {
138
- try {
139
- this.currentPage += 1;
140
- await this.fetchLookbooks({ page: this.currentPage }, true);
141
- if (window.masonry) {
142
- this.isLayoutSetup = false;
143
- }
144
- }
145
- catch (error) { }
146
- }
147
- async fetchCategories() {
148
- try {
149
- this.salonCategories = await HttpService().fetchSalonCategories();
150
- }
151
- catch (error) { }
152
- }
153
- onClickLookbook(style) {
154
- const elLookbookModal = document.createElement('div');
155
- elLookbookModal.innerHTML = `
156
- <salon-lookbook-modal
157
- salon-id=${this.salonId}
158
- salon-lookbook='${JSON.stringify(style)}'
159
- ></salon-lookbook-modal>
160
- `;
161
- document.body.appendChild(elLookbookModal);
162
- }
163
- renderHeader() {
164
- const allFilterOptions = lookbookFilterOptions.concat(([...this.salonCategories]).map(category => {
165
- return {
166
- value: category.id,
167
- label: category.name,
168
- };
169
- }));
170
- return (h("div", { class: "view-header", style: {
171
- display: 'flex',
172
- flexDirection: 'row',
173
- justifyContent: 'space-between',
174
- alignItems: 'center',
175
- marginBottom: '24px',
176
- } },
177
- h("div", { class: "salon-loobook--serch-result" },
178
- this.totalLookbooks,
179
- " ",
180
- this.totalLookbooks === 1 ? 'result' : 'results'),
181
- h("div", { style: {
182
- display: 'flex',
183
- flexDirection: 'row',
184
- alignItems: 'center',
185
- } },
186
- h("div", { class: "salon-loobook--filter-wrapper", style: {
187
- display: 'flex',
188
- flexDirection: 'row',
189
- alignItems: 'center',
190
- marginRight: '16px',
191
- } },
192
- h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Filter by"),
193
- h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeFiltering(evt.target.value) }, allFilterOptions.map(filterOption => (h("option", { value: filterOption.value, selected: String(filterOption.value) === String(this.filterBy) }, filterOption.label))))),
194
- h("div", { class: "salon-loobook--sort-wrapper", style: {
195
- display: 'flex',
196
- flexDirection: 'row',
197
- alignItems: 'center',
198
- } },
199
- h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Sort by"),
200
- h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeSorting(evt.target.value) }, lookbookSortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy }, sortOption.label))))))));
201
- }
202
- render() {
203
- return (h("div", { class: "salon-loobooks" },
204
- h("div", null,
205
- h("div", { class: "view-content" },
206
- this.renderHeader(),
207
- this.salonLookbooks.length > 0 && (h("div", { class: "salon-loobooks--grid", id: "salon-loobooks--grid" }, this.salonLookbooks.map(style => {
208
- const { caption, fullImageUrlThumb, owner } = style;
209
- return (h("div", { class: "salon-lookbook salon-loobooks--grid-item", onClick: () => this.onClickLookbook(style) },
210
- h("div", { class: "card", style: {
211
- background: 'none',
212
- border: 'none',
213
- maxWidth: '200px',
214
- } },
215
- h("div", { class: "salon-lookbook--image", style: {
216
- borderRadius: '8px',
217
- overflow: 'hidden',
218
- minHeight: '80px',
219
- background: Colors.Gray06,
220
- } },
221
- h("img", { src: fullImageUrlThumb, alt: caption })),
222
- owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } },
223
- h("user-avatar", { name: owner.name, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
224
- })))),
225
- this.salonLookbooks.length > 0 && !this.hideLoadMore && (h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } },
226
- h("button", { type: "button", class: "btn btn-light", onClick: () => this.onLoadMore() }, this.isLoadingMore ? 'Loading' : 'Load more'))))));
227
- }
228
- static get is() { return "salon-lookbook"; }
229
- static get originalStyleUrls() { return {
230
- "$": ["index.less"]
231
- }; }
232
- static get styleUrls() { return {
233
- "$": ["index.css"]
234
- }; }
235
- static get properties() { return {
236
- "salonId": {
237
- "type": "number",
238
- "mutable": false,
239
- "complexType": {
240
- "original": "number",
241
- "resolved": "number",
242
- "references": {}
243
- },
244
- "required": false,
245
- "optional": false,
246
- "docs": {
247
- "tags": [],
248
- "text": ""
249
- },
250
- "attribute": "salon-id",
251
- "reflect": false
252
- }
253
- }; }
254
- static get states() { return {
255
- "isLoading": {},
256
- "isLoadingMore": {},
257
- "hideLoadMore": {},
258
- "currentPage": {},
259
- "totalLookbooks": {},
260
- "salonCategories": {},
261
- "salonLookbooks": {},
262
- "sortBy": {},
263
- "filterBy": {},
264
- "isLayoutSetup": {}
265
- }; }
266
- static get methods() { return {
267
- "fetchData": {
268
- "complexType": {
269
- "signature": "() => Promise<any[]>",
270
- "parameters": [],
271
- "references": {
272
- "Promise": {
273
- "location": "global"
274
- }
275
- },
276
- "return": "Promise<any[]>"
277
- },
278
- "docs": {
279
- "text": "",
280
- "tags": []
281
- }
282
- },
283
- "fetchLookbooks": {
284
- "complexType": {
285
- "signature": "(options: any, isLoadingMore?: boolean) => Promise<void>",
286
- "parameters": [{
287
- "tags": [],
288
- "text": ""
289
- }, {
290
- "tags": [],
291
- "text": ""
292
- }],
293
- "references": {
294
- "Promise": {
295
- "location": "global"
296
- }
297
- },
298
- "return": "Promise<void>"
299
- },
300
- "docs": {
301
- "text": "",
302
- "tags": []
303
- }
304
- },
305
- "onChangeFiltering": {
306
- "complexType": {
307
- "signature": "(filterBy: string) => Promise<void>",
308
- "parameters": [{
309
- "tags": [],
310
- "text": ""
311
- }],
312
- "references": {
313
- "Promise": {
314
- "location": "global"
315
- }
316
- },
317
- "return": "Promise<void>"
318
- },
319
- "docs": {
320
- "text": "",
321
- "tags": []
322
- }
323
- },
324
- "onChangeSorting": {
325
- "complexType": {
326
- "signature": "(sortBy: string) => Promise<void>",
327
- "parameters": [{
328
- "tags": [],
329
- "text": ""
330
- }],
331
- "references": {
332
- "Promise": {
333
- "location": "global"
334
- }
335
- },
336
- "return": "Promise<void>"
337
- },
338
- "docs": {
339
- "text": "",
340
- "tags": []
341
- }
342
- },
343
- "onLoadMore": {
344
- "complexType": {
345
- "signature": "() => Promise<void>",
346
- "parameters": [],
347
- "references": {
348
- "Promise": {
349
- "location": "global"
350
- }
351
- },
352
- "return": "Promise<void>"
353
- },
354
- "docs": {
355
- "text": "",
356
- "tags": []
357
- }
358
- },
359
- "fetchCategories": {
360
- "complexType": {
361
- "signature": "() => Promise<void>",
362
- "parameters": [],
363
- "references": {
364
- "Promise": {
365
- "location": "global"
366
- }
367
- },
368
- "return": "Promise<void>"
369
- },
370
- "docs": {
371
- "text": "",
372
- "tags": []
373
- }
374
- }
375
- }; }
376
- }
@@ -1,72 +0,0 @@
1
- salon-lookbook-modal .salon-modal--close {
2
- right: 8px;
3
- top: 8px;
4
- }
5
- salon-lookbook-modal .salon-modal--inner {
6
- height: 100%;
7
- width: 100%;
8
- max-width: none;
9
- }
10
- salon-lookbook-modal .salon-styles--item-background {
11
- -moz-filter: blur(32px);
12
- -webkit-filter: blur(32px);
13
- filter: blur(32px);
14
- }
15
- salon-lookbook-modal .salon-styles--item .salon-styles--item-background {
16
- z-index: 1;
17
- }
18
- salon-lookbook-modal .salon-styles--item .salon-styles--item-image {
19
- position: relative;
20
- z-index: 2;
21
- }
22
- salon-lookbook-modal .salon-styles--item .carousel-caption {
23
- padding-bottom: 0;
24
- z-index: 2;
25
- }
26
- salon-lookbook-modal .salon-styles--slides .carousel-control-prev {
27
- z-index: 2;
28
- }
29
- @media (min-width: 576px) {
30
- salon-lookbook-modal .salon-styles--item {
31
- height: 380px !important;
32
- }
33
- }
34
- @media (min-width: 992px) {
35
- salon-lookbook-modal .salon-modal--inner {
36
- height: 90%;
37
- width: 90%;
38
- max-width: 900px;
39
- -moz-border-radius: 8px;
40
- -webkit-border-radius: 8px;
41
- border-radius: 8px;
42
- overflow: hidden !important;
43
- }
44
- salon-lookbook-modal .carousel,
45
- salon-lookbook-modal .carousel-inner,
46
- salon-lookbook-modal .carousel-item,
47
- salon-lookbook-modal .salon-styles--item,
48
- salon-lookbook-modal .salon-modal--content,
49
- salon-lookbook-modal .style-detail--metadata-detail,
50
- salon-lookbook-modal .style-detail--container {
51
- height: 100% !important;
52
- }
53
- salon-lookbook-modal .style-detail--container {
54
- display: flex;
55
- }
56
- salon-lookbook-modal .carousel-inner {
57
- z-index: 1 !important;
58
- }
59
- salon-lookbook-modal .carousel-control-next,
60
- salon-lookbook-modal .carousel-control-prev {
61
- z-index: 2 !important;
62
- }
63
- salon-lookbook-modal .style-detail--photos,
64
- salon-lookbook-modal .style-detail--metadata {
65
- width: 50%;
66
- }
67
- salon-lookbook-modal .salon-styles--item {
68
- -moz-border-radius: 0 !important;
69
- -webkit-border-radius: 0 !important;
70
- border-radius: 0 !important;
71
- }
72
- }