favesalon-embed 0.0.4 → 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 (241) hide show
  1. package/LICENSE +21 -0
  2. package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -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/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
  8. package/{cjs/index-d5de0b9d.js → dist/cjs/index-e6bea8f5.js} +10 -0
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +5 -5
  12. package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +6 -7
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +7 -7
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +23 -57
  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-f1102d4a.js → dist/cjs/services-eee8f251.js} +265 -393
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/dist/cjs/user-avatar.cjs.entry.js +41 -0
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -3
  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 +3 -3
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +4 -4
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +4 -3
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +24 -3
  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/{collection → dist/collection}/components/salon-lookbook/index.css +0 -9
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +19 -19
  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/{collection → dist/collection}/components/salon-reviews/index.css +0 -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 → dist/collection}/components/salon-services/index.css +0 -0
  52. package/{collection → dist/collection}/components/salon-services/index.js +51 -8
  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 → 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/{collection → dist/collection}/types/stylist.js +12 -9
  69. package/{favesalon-embed/index.esm.js → 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 -18
  73. package/{custom-elements → dist/custom-elements}/index.js +1227 -1035
  74. package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -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-0f8eed73.js → dist/esm/index-6af0a03d.js} +10 -1
  80. package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
  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/{esm → dist/esm}/salon-booking-modal.entry.js +5 -5
  90. package/{esm → dist/esm}/salon-booking.entry.js +5 -6
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/{esm → dist/esm}/salon-gift-card.entry.js +6 -6
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +24 -57
  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-74d84ca9.js → dist/esm/services-295247b1.js} +263 -392
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/dist/esm/user-avatar.entry.js +37 -0
  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/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/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -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 +0 -0
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -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 +3 -3
  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 +1 -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 +54 -59
  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 +1 -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 +24 -7
  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/index-95daad08.js +0 -1928
  172. package/cjs/loader.cjs.js +0 -22
  173. package/cjs/salon-contact_4.cjs.entry.js +0 -155
  174. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
  175. package/cjs/salon-info.cjs.entry.js +0 -35
  176. package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
  177. package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
  178. package/cjs/salon-reviews.cjs.entry.js +0 -205
  179. package/cjs/salon-services.cjs.entry.js +0 -47
  180. package/cjs/salon-stylists.cjs.entry.js +0 -54
  181. package/collection/components/google-map/index.js +0 -97
  182. package/collection/components/salon-contact/index.js +0 -88
  183. package/collection/components/salon-gift-card/index.css +0 -25
  184. package/collection/components/salon-info/index.css +0 -3
  185. package/collection/components/salon-latest-reviews/index.js +0 -108
  186. package/collection/components/salon-locations/index.js +0 -80
  187. package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
  188. package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
  189. package/collection/components/salon-reviews/index.js +0 -317
  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-styles/index.css +0 -23
  193. package/collection/components/salon-styles/index.js +0 -100
  194. package/collection/components/salon-stylists/index.js +0 -96
  195. package/collection/constants/colors.js +0 -91
  196. package/collection/services/services.js +0 -225
  197. package/collection/types/common.js +0 -2
  198. package/collection/types/salon.js +0 -52
  199. package/collection/types/style.js +0 -103
  200. package/esm/colors-1ec90c5f.js +0 -93
  201. package/esm/favesalon-embed.js +0 -18
  202. package/esm/google-map.entry.js +0 -43
  203. package/esm/index-09d43e3e.js +0 -1926
  204. package/esm/loader.js +0 -18
  205. package/esm/salon-contact_4.entry.js +0 -148
  206. package/esm/salon-gift-card-modal.entry.js +0 -21
  207. package/esm/salon-info.entry.js +0 -31
  208. package/esm/salon-latest-reviews.entry.js +0 -54
  209. package/esm/salon-lookbook-modal.entry.js +0 -137
  210. package/esm/salon-reviews.entry.js +0 -201
  211. package/esm/salon-services.entry.js +0 -43
  212. package/esm/salon-stylists.entry.js +0 -50
  213. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  214. package/favesalon-embed/p-0188d4dc.entry.js +0 -1
  215. package/favesalon-embed/p-0318501e.js +0 -1
  216. package/favesalon-embed/p-078f242d.entry.js +0 -1
  217. package/favesalon-embed/p-13e23c61.entry.js +0 -1
  218. package/favesalon-embed/p-17df13ad.js +0 -1
  219. package/favesalon-embed/p-1a3179c8.entry.js +0 -1
  220. package/favesalon-embed/p-20aa75de.js +0 -6
  221. package/favesalon-embed/p-2901a6d6.entry.js +0 -1
  222. package/favesalon-embed/p-2b861430.entry.js +0 -1
  223. package/favesalon-embed/p-44d810a0.js +0 -1
  224. package/favesalon-embed/p-4c68700f.entry.js +0 -1
  225. package/favesalon-embed/p-4e2d7b29.js +0 -1
  226. package/favesalon-embed/p-6b845bf1.entry.js +0 -1
  227. package/favesalon-embed/p-7350f6b5.entry.js +0 -1
  228. package/favesalon-embed/p-897c2b1c.entry.js +0 -1
  229. package/favesalon-embed/p-8e60f56f.entry.js +0 -1
  230. package/favesalon-embed/p-a49afdc1.entry.js +0 -1
  231. package/favesalon-embed/p-c93867c4.entry.js +0 -1
  232. package/favesalon-embed/p-ea6a097f.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-lookbook/salon-lookbook-modal.d.ts +0 -13
  236. package/types/components/salon-reviews/index.d.ts +0 -24
  237. package/types/components/salon-styles/index.d.ts +0 -9
  238. package/types/constants/colors.d.ts +0 -88
  239. package/types/services/services.d.ts +0 -26
  240. package/types/types/common.d.ts +0 -2
  241. package/types/types/style.d.ts +0 -59
@@ -1,6 +1,8 @@
1
1
  import { Component, Prop, h, State } from '@stencil/core';
2
+ import { Colors } from '../../constants/colors';
2
3
  export class SalonGiftCardModal {
3
4
  constructor() {
5
+ this.primaryColor = Colors.Primary;
4
6
  this.isModalOpen = true;
5
7
  }
6
8
  closeModal() {
@@ -9,16 +11,17 @@ export class SalonGiftCardModal {
9
11
  el.remove();
10
12
  }
11
13
  render() {
14
+ const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
12
15
  return (h("div", { class: "salon-gift-card--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--gift-card" },
13
16
  h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }),
17
+ h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }),
14
18
  h("div", { class: "salon-modal--inner" },
15
- h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }),
16
19
  h("div", { class: "salon-modal--content" },
17
- h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/salon/detail/${this.salonId}/gift-cards.html` })))))));
20
+ h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/buy-gift-card?salonId=${this.salonId}&primaryColor=${primaryColor}&closeAble=false` })))))));
18
21
  }
19
22
  static get is() { return "salon-gift-card-modal"; }
20
23
  static get originalStyleUrls() { return {
21
- "$": ["index.css"]
24
+ "$": ["index.less"]
22
25
  }; }
23
26
  static get styleUrls() { return {
24
27
  "$": ["index.css"]
@@ -40,6 +43,24 @@ export class SalonGiftCardModal {
40
43
  },
41
44
  "attribute": "salon-id",
42
45
  "reflect": false
46
+ },
47
+ "primaryColor": {
48
+ "type": "string",
49
+ "mutable": false,
50
+ "complexType": {
51
+ "original": "string",
52
+ "resolved": "string",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "primary-color",
62
+ "reflect": false,
63
+ "defaultValue": "Colors.Primary"
43
64
  }
44
65
  }; }
45
66
  static get states() { return {
@@ -1,10 +1,6 @@
1
1
  import { Component, Prop, h, Method, State } from '@stencil/core';
2
2
  import HttpService from '../../services/services';
3
- import { Colors } from '../../constants/colors';
4
3
  export class SalonInfo {
5
- constructor() {
6
- this.backgroundColor = Colors.Gray06;
7
- }
8
4
  componentWillLoad() {
9
5
  this.fetchData();
10
6
  }
@@ -15,19 +11,15 @@ export class SalonInfo {
15
11
  catch (e) { }
16
12
  }
17
13
  render() {
18
- if (this.salonInfo) {
19
- return (h("div", { class: "salon-info", style: { background: this.backgroundColor } },
14
+ return (h("div", { class: "salon-info" },
15
+ h("div", { class: "container" },
16
+ h("div", { class: "salon-info--schedules", style: { marginBottom: '24px' } },
17
+ h("salon-schedules", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })),
20
18
  h("div", { class: "row" },
21
19
  h("div", { class: "col-md-5", style: { marginBottom: '24px' } },
22
- h("salon-locations", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })),
20
+ h("salon-locations", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })),
23
21
  h("div", { class: "col-md-7", style: { marginBottom: '24px' } },
24
- h("salon-styles", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))),
25
- h("div", { class: "salon-info--schedules", style: { marginBottom: '24px' } },
26
- h("salon-schedules", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })),
27
- h("div", { class: "salon-info--contact" },
28
- h("salon-contact", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))));
29
- }
30
- return (h("div", { class: "salon-info", style: { padding: '24px', textAlign: 'center' } }, "Loading..."));
22
+ h("salon-latest-styles", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))))));
31
23
  }
32
24
  static get is() { return "salon-info"; }
33
25
  static get originalStyleUrls() { return {
@@ -53,24 +45,6 @@ export class SalonInfo {
53
45
  },
54
46
  "attribute": "salon-id",
55
47
  "reflect": false
56
- },
57
- "backgroundColor": {
58
- "type": "string",
59
- "mutable": false,
60
- "complexType": {
61
- "original": "string",
62
- "resolved": "string",
63
- "references": {}
64
- },
65
- "required": false,
66
- "optional": false,
67
- "docs": {
68
- "tags": [],
69
- "text": ""
70
- },
71
- "attribute": "background-color",
72
- "reflect": false,
73
- "defaultValue": "Colors.Gray06"
74
48
  }
75
49
  }; }
76
50
  static get states() { return {
@@ -1,9 +1,6 @@
1
1
  .salon-latest-reviews .salon-review {
2
2
  min-width: 280px;
3
3
  }
4
-
5
-
6
-
7
4
  @media (min-width: 768px) {
8
5
  .salon-latest-reviews .salon-review {
9
6
  min-width: 300px;
@@ -0,0 +1,176 @@
1
+ import { Component, Prop, h, Method, State } from '@stencil/core';
2
+ import dayjs from 'dayjs';
3
+ import { Colors } from '../../constants/colors';
4
+ import { shortDateYearFormat } from '../../types/common';
5
+ import { getRatingText } from '../../utils/utils';
6
+ import HttpService from '../../services/services';
7
+ export class SalonLatestReviews {
8
+ constructor() {
9
+ this.primaryColor = Colors.Primary;
10
+ this.salonReviews = [];
11
+ }
12
+ componentWillLoad() {
13
+ this.fetchData();
14
+ }
15
+ async fetchData() {
16
+ this.isLoading = true;
17
+ try {
18
+ const { data: allReviews } = await HttpService().fetchSalonReviews(this.salonId, { limit: 5 });
19
+ this.salonReviews = [...allReviews];
20
+ }
21
+ catch (e) { }
22
+ this.isLoading = false;
23
+ }
24
+ render() {
25
+ if (this.isLoading) {
26
+ return (h("div", { class: "salon-latest-reviews", style: { overflow: 'hidden' } },
27
+ h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, [1, 2, 3, 4, 5].map((fakeId, index) => {
28
+ return (h("div", { key: `salon-latest-review--${fakeId}`, class: "salon-review", style: Object.assign({ border: `1px solid ${Colors.Gray02}`, background: Colors.White, borderRadius: '8px', overflow: 'hidden' }, index > 0 ? { marginLeft: '16px' } : {}) },
29
+ h("div", { class: "card", style: { border: 'none' } },
30
+ h("div", { class: "card-body" },
31
+ h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } },
32
+ h("div", { style: {
33
+ backgroundColor: Colors.Gray02,
34
+ borderRadius: '50px',
35
+ height: '48px',
36
+ width: '48px',
37
+ float: 'left',
38
+ } }),
39
+ h("div", { style: {
40
+ backgroundColor: Colors.Gray01,
41
+ height: '16px',
42
+ width: '120px',
43
+ marginLeft: '16px',
44
+ marginTop: '14px',
45
+ float: 'left',
46
+ } })),
47
+ h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(() => (h("div", { style: {
48
+ backgroundColor: Colors.Gray01,
49
+ height: '20px',
50
+ width: '20px',
51
+ marginRight: '8px',
52
+ float: 'left',
53
+ } })))),
54
+ h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold', marginTop: '16px' } },
55
+ h("div", { style: {
56
+ backgroundColor: Colors.Gray01,
57
+ height: '16px',
58
+ width: '132px',
59
+ } })),
60
+ h("div", { class: "salon-review--detail", style: { marginTop: '8px' } },
61
+ h("div", { class: "salon-review--description", style: {
62
+ fontSize: '16px',
63
+ lineHeight: '26px',
64
+ overflow: 'hidden',
65
+ } },
66
+ h("div", { style: {
67
+ backgroundColor: Colors.Gray01,
68
+ height: '16px',
69
+ width: '240px',
70
+ float: 'left',
71
+ } })))))));
72
+ }))));
73
+ }
74
+ const ratingTexts = getRatingText();
75
+ return (h("div", { class: "salon-latest-reviews", style: { overflowX: 'auto' } },
76
+ h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, (this.salonReviews || []).map((review, index) => {
77
+ const { user } = review;
78
+ return (h("div", { class: "salon-review", style: Object.assign({ border: `1px solid ${Colors.Gray02}`, background: Colors.White, borderRadius: '8px', overflow: 'hidden' }, index > 0 ? { marginLeft: '16px' } : {}) },
79
+ h("div", { class: "card", style: { border: 'none' } },
80
+ h("div", { class: "card-body" },
81
+ h("div", { class: "salon-review--user", style: { marginBottom: '16px' } },
82
+ h("user-avatar", { size: 48, name: h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, avatar: user.avatar, nameStyle: { fontWeight: 'bold' } })),
83
+ h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } },
84
+ [1, 2, 3, 4, 5].map(score => (h("i", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '16px', marginRight: '4px' }, score <= review.point ? { color: this.primaryColor } : { color: Colors.Gray04 }) }))),
85
+ h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, dayjs(review.createdDate).format(shortDateYearFormat))),
86
+ h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]),
87
+ (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } },
88
+ h("div", { class: "salon-review--description", style: {
89
+ fontSize: '16px',
90
+ lineHeight: '26px',
91
+ overflow: 'hidden',
92
+ maxHeight: review.photos.length > 0 ? '52px' : '104px',
93
+ } }, review.title || review.description))),
94
+ review.photos.length > 0 && (h("div", { style: {
95
+ display: 'flex',
96
+ flexDirection: 'row',
97
+ overflowX: 'auto',
98
+ } }, review.photos.map(photo => (h("div", { style: {
99
+ border: '1px solid #d9d9d9',
100
+ position: 'relative',
101
+ cursor: 'pointer',
102
+ borderRadius: '2px',
103
+ height: '66px',
104
+ marginTop: '12px',
105
+ marginRight: '12px',
106
+ } },
107
+ h("img", { alt: "", src: photo.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))))));
108
+ }))));
109
+ }
110
+ static get is() { return "salon-latest-reviews"; }
111
+ static get originalStyleUrls() { return {
112
+ "$": ["index.less"]
113
+ }; }
114
+ static get styleUrls() { return {
115
+ "$": ["index.css"]
116
+ }; }
117
+ static get properties() { return {
118
+ "salonId": {
119
+ "type": "number",
120
+ "mutable": false,
121
+ "complexType": {
122
+ "original": "number",
123
+ "resolved": "number",
124
+ "references": {}
125
+ },
126
+ "required": false,
127
+ "optional": false,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": ""
131
+ },
132
+ "attribute": "salon-id",
133
+ "reflect": false
134
+ },
135
+ "primaryColor": {
136
+ "type": "string",
137
+ "mutable": false,
138
+ "complexType": {
139
+ "original": "string",
140
+ "resolved": "string",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": ""
148
+ },
149
+ "attribute": "primary-color",
150
+ "reflect": false,
151
+ "defaultValue": "Colors.Primary"
152
+ }
153
+ }; }
154
+ static get states() { return {
155
+ "salonReviews": {},
156
+ "isLoading": {}
157
+ }; }
158
+ static get methods() { return {
159
+ "fetchData": {
160
+ "complexType": {
161
+ "signature": "() => Promise<void>",
162
+ "parameters": [],
163
+ "references": {
164
+ "Promise": {
165
+ "location": "global"
166
+ }
167
+ },
168
+ "return": "Promise<void>"
169
+ },
170
+ "docs": {
171
+ "text": "",
172
+ "tags": []
173
+ }
174
+ }
175
+ }; }
176
+ }
@@ -0,0 +1,10 @@
1
+ salon-latest-styles .view--salon-styles--item {
2
+ width: 120px;
3
+ height: 120px;
4
+ }
5
+ @media (min-width: 1024px) {
6
+ salon-latest-styles .view--salon-styles--item {
7
+ width: 200px;
8
+ height: 200px;
9
+ }
10
+ }
@@ -0,0 +1,178 @@
1
+ import { Component, Prop, h, Method, State } from '@stencil/core';
2
+ import { Colors } from '../../constants/colors';
3
+ import { isVideoMedia } from '../../types/style';
4
+ import HttpService from '../../services/services';
5
+ export class SalonLatestStyles {
6
+ componentDidLoad() {
7
+ this.fetchData();
8
+ }
9
+ async fetchData() {
10
+ this.isLoadingState = true;
11
+ try {
12
+ const promises = [
13
+ HttpService().fetchSalonLatestStyles(this.salonId, { limit: 6 })
14
+ .then(salonStyles => this.latestStyles = salonStyles),
15
+ ];
16
+ return Promise.all(promises)
17
+ .then(() => this.isLoadingState = false)
18
+ .catch(() => this.isLoadingState = false);
19
+ }
20
+ catch (e) { }
21
+ }
22
+ onClickLookbook(style) {
23
+ const elLookbookModal = document.createElement('div');
24
+ elLookbookModal.innerHTML = `
25
+ <style-detail
26
+ salon-id=${this.salonId}
27
+ salon-lookbook='${JSON.stringify(style)}'
28
+ ></style-detail>
29
+ `;
30
+ document.body.appendChild(elLookbookModal);
31
+ }
32
+ render() {
33
+ if (this.isLoading || this.isLoadingState) {
34
+ return (h("div", { class: "view view--salon-styles" },
35
+ h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } },
36
+ h("div", { style: {
37
+ backgroundColor: Colors.Gray02,
38
+ height: '20px',
39
+ width: '120px',
40
+ } }),
41
+ h("div", { style: { marginTop: '24px' } },
42
+ h("div", { style: {
43
+ overflow: 'hidden',
44
+ marginLeft: '-16px',
45
+ marginBottom: '-16px',
46
+ } }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((fakeId, idx) => (h("div", { key: `style-listing--item-${fakeId}-${idx}`, style: {
47
+ float: 'left',
48
+ paddingLeft: '16px',
49
+ marginBottom: '16px',
50
+ } },
51
+ h("div", { style: {
52
+ backgroundColor: Colors.Gray01,
53
+ borderRadius: '8px',
54
+ width: '120px',
55
+ height: '120px',
56
+ overflow: 'hidden',
57
+ position: 'relative',
58
+ cursor: 'pointer',
59
+ } })))))))));
60
+ }
61
+ return (h("div", { class: "view view--salon-styles" },
62
+ h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } },
63
+ h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Photos"),
64
+ h("div", { style: {
65
+ overflow: 'hidden',
66
+ marginLeft: '-16px',
67
+ marginBottom: '-16px',
68
+ marginTop: '16px',
69
+ } }, (this.latestStyles || []).map((faveStyle, idx) => {
70
+ const { imageThumb, albumMedias } = faveStyle;
71
+ const firstMedia = albumMedias.length > 0 ? albumMedias[0] : null;
72
+ const isVideo = firstMedia ? isVideoMedia(firstMedia) : false;
73
+ return (h("div", { key: `style-listing--item-${faveStyle.id}-${idx}`, style: {
74
+ float: 'left',
75
+ paddingLeft: '16px',
76
+ marginBottom: '16px',
77
+ } },
78
+ h("div", { class: "view--salon-styles--item", style: Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '8px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, !isVideo && firstMedia ? {
79
+ backgroundImage: `url("${firstMedia.imageThumb || firstMedia.imageThumbMedium}")`,
80
+ backgroundRepeat: 'no-repeat',
81
+ backgroundPosition: 'center center',
82
+ backgroundSize: 'cover',
83
+ } : {}), onClick: () => this.onClickLookbook(faveStyle) }, isVideo && firstMedia && (h("div", null,
84
+ h("video", { muted: true, width: "100%", height: "100%", poster: imageThumb },
85
+ h("source", { src: firstMedia.mediaUrl, type: "video/mp4" })),
86
+ h("i", { class: "ri-play-circle-fill", style: {
87
+ fontSize: '48px',
88
+ color: Colors.TextColor,
89
+ position: 'absolute',
90
+ left: '50%',
91
+ top: '50%',
92
+ transform: 'translate(-50%, -50%)',
93
+ } }))))));
94
+ })))));
95
+ }
96
+ static get is() { return "salon-latest-styles"; }
97
+ static get originalStyleUrls() { return {
98
+ "$": ["index.less"]
99
+ }; }
100
+ static get styleUrls() { return {
101
+ "$": ["index.css"]
102
+ }; }
103
+ static get properties() { return {
104
+ "salonId": {
105
+ "type": "number",
106
+ "mutable": false,
107
+ "complexType": {
108
+ "original": "number",
109
+ "resolved": "number",
110
+ "references": {}
111
+ },
112
+ "required": false,
113
+ "optional": false,
114
+ "docs": {
115
+ "tags": [],
116
+ "text": ""
117
+ },
118
+ "attribute": "salon-id",
119
+ "reflect": false
120
+ },
121
+ "isLoading": {
122
+ "type": "boolean",
123
+ "mutable": false,
124
+ "complexType": {
125
+ "original": "boolean",
126
+ "resolved": "boolean",
127
+ "references": {}
128
+ },
129
+ "required": false,
130
+ "optional": true,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": ""
134
+ },
135
+ "attribute": "is-loading",
136
+ "reflect": false
137
+ },
138
+ "withBorder": {
139
+ "type": "boolean",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "boolean",
143
+ "resolved": "boolean",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": true,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": ""
151
+ },
152
+ "attribute": "with-border",
153
+ "reflect": false
154
+ }
155
+ }; }
156
+ static get states() { return {
157
+ "isLoadingState": {},
158
+ "latestStyles": {}
159
+ }; }
160
+ static get methods() { return {
161
+ "fetchData": {
162
+ "complexType": {
163
+ "signature": "() => Promise<boolean>",
164
+ "parameters": [],
165
+ "references": {
166
+ "Promise": {
167
+ "location": "global"
168
+ }
169
+ },
170
+ "return": "Promise<boolean>"
171
+ },
172
+ "docs": {
173
+ "text": "",
174
+ "tags": []
175
+ }
176
+ }
177
+ }; }
178
+ }
@@ -1,10 +1,9 @@
1
1
  @media (min-width: 768px) {
2
- .salon-contact--links {
2
+ salon-locations .salon-contact--links {
3
3
  overflow: hidden;
4
4
  margin-left: -32px;
5
5
  }
6
-
7
- .salon-contact--links .salon-contact--links-item {
6
+ salon-locations .salon-contact--links-item {
8
7
  float: left;
9
8
  display: flex;
10
9
  flex-direction: row;
@@ -12,10 +11,11 @@
12
11
  font-size: 16px;
13
12
  min-width: 300px;
14
13
  padding-left: 32px;
15
- margin-top: 8px;
16
14
  }
17
-
18
- .salon-contact--links .salon-contact--links-item:nth-child(2n + 1) {
15
+ salon-locations .salon-contact--links-item:nth-child(2n + 1) {
19
16
  clear: left;
20
17
  }
18
+ salon-locations .salon-contact--links-item + .salon-contact--links-item {
19
+ margin-top: 8px;
20
+ }
21
21
  }
@@ -0,0 +1,151 @@
1
+ import { Component, Prop, h, State } from '@stencil/core';
2
+ import { formatFullAddress, formatWebsiteUrl } from '../../utils/utils';
3
+ import { Colors } from '../../constants/colors';
4
+ import HttpService from '../../services/services';
5
+ export class SalonLocations {
6
+ componentWillLoad() {
7
+ if (this.salonInfo) {
8
+ this.salonInfoState = JSON.parse(this.salonInfo);
9
+ }
10
+ else {
11
+ this.fetchData();
12
+ }
13
+ }
14
+ fetchData() {
15
+ try {
16
+ HttpService().fetchSalonInfo(this.salonId)
17
+ .then(salonInfo => this.salonInfoState = salonInfo);
18
+ }
19
+ catch (e) { }
20
+ }
21
+ render() {
22
+ if (this.isLoading) {
23
+ return (h("div", { class: "view view--salon-locations" },
24
+ h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } },
25
+ h("div", { style: {
26
+ backgroundColor: Colors.Gray02,
27
+ height: '20px',
28
+ width: '120px',
29
+ } }),
30
+ h("div", { style: { marginTop: '24px' } },
31
+ h("div", { style: {
32
+ backgroundColor: Colors.Gray01,
33
+ height: '16px',
34
+ width: '50%',
35
+ } }),
36
+ h("div", { style: {
37
+ backgroundColor: Colors.Gray01,
38
+ height: '16px',
39
+ width: '50%',
40
+ marginTop: '8px',
41
+ } }),
42
+ h("div", { style: {
43
+ backgroundColor: Colors.Gray01,
44
+ height: '192px',
45
+ width: '100%',
46
+ marginTop: '24px',
47
+ } })))));
48
+ }
49
+ const { businessPhone, businessName, website, email, } = this.salonInfoState || {};
50
+ const websiteUrl = formatWebsiteUrl(website);
51
+ const fullAddress = formatFullAddress(this.salonInfoState);
52
+ return (h("div", { class: "view view--salon-locations" },
53
+ h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } },
54
+ h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Contact"),
55
+ h("div", { class: "salon-contact--links", style: { marginTop: '16px' } },
56
+ businessPhone && (h("div", { class: "salon-contact--links-item" },
57
+ h("i", { class: "ri-phone-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }),
58
+ " ",
59
+ h("a", { href: `tel:${businessPhone}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, businessPhone))),
60
+ websiteUrl && (h("div", { class: "salon-contact--links-item" },
61
+ h("i", { class: "ri-links-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }),
62
+ " ",
63
+ h("a", { target: websiteUrl && websiteUrl.indexOf(window.location.hostname) === -1 ? '_blank' : undefined, href: websiteUrl, style: { color: Colors.TextColor, textDecoration: 'none' } }, websiteUrl))),
64
+ email && (h("div", { class: "salon-contact--links-item" },
65
+ h("i", { class: "ri-mail-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }),
66
+ " ",
67
+ h("a", { href: `mailto:${email}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, email)))),
68
+ h("div", { class: "view--salon-info--map", style: { marginTop: '24px' } },
69
+ h("google-map", { "location-name": businessName, "location-address": fullAddress })))));
70
+ }
71
+ static get is() { return "salon-locations"; }
72
+ static get originalStyleUrls() { return {
73
+ "$": ["index.less"]
74
+ }; }
75
+ static get styleUrls() { return {
76
+ "$": ["index.css"]
77
+ }; }
78
+ static get properties() { return {
79
+ "salonId": {
80
+ "type": "number",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "number",
84
+ "resolved": "number",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": ""
92
+ },
93
+ "attribute": "salon-id",
94
+ "reflect": false
95
+ },
96
+ "salonInfo": {
97
+ "type": "string",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "string",
101
+ "resolved": "string",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": true,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": ""
109
+ },
110
+ "attribute": "salon-info",
111
+ "reflect": false
112
+ },
113
+ "isLoading": {
114
+ "type": "boolean",
115
+ "mutable": false,
116
+ "complexType": {
117
+ "original": "boolean",
118
+ "resolved": "boolean",
119
+ "references": {}
120
+ },
121
+ "required": false,
122
+ "optional": true,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": ""
126
+ },
127
+ "attribute": "is-loading",
128
+ "reflect": false
129
+ },
130
+ "withBorder": {
131
+ "type": "boolean",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "boolean",
135
+ "resolved": "boolean",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": true,
140
+ "docs": {
141
+ "tags": [],
142
+ "text": ""
143
+ },
144
+ "attribute": "with-border",
145
+ "reflect": false
146
+ }
147
+ }; }
148
+ static get states() { return {
149
+ "salonInfoState": {}
150
+ }; }
151
+ }