favesalon-embed 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +20 -0
  5. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +291 -0
  7. package/dist/cjs/index-7f190886.js +4396 -0
  8. package/{cjs/index-7d179a70.js → dist/cjs/index-e6bea8f5.js} +87 -3
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/dist/cjs/salon-booking-modal.cjs.entry.js +29 -0
  12. package/dist/cjs/salon-booking.cjs.entry.js +50 -0
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/dist/cjs/salon-gift-card.cjs.entry.js +50 -0
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/dist/cjs/salon-lookbook.cjs.entry.js +218 -0
  17. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
  18. package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +78 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
  21. package/{cjs/services-d6f8214c.js → dist/cjs/services-eee8f251.js} +317 -361
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/{cjs → dist/cjs}/user-avatar.cjs.entry.js +4 -4
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -2
  26. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  27. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  28. package/dist/collection/components/google-map/index.js +86 -0
  29. package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
  30. package/{collection → dist/collection}/components/salon-booking/index.js +29 -11
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +12 -6
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +44 -6
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +30 -4
  35. package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
  36. package/{collection → dist/collection}/components/salon-info/index.js +6 -32
  37. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
  38. package/dist/collection/components/salon-latest-reviews/index.js +176 -0
  39. package/dist/collection/components/salon-latest-styles/index.css +10 -0
  40. package/dist/collection/components/salon-latest-styles/index.js +178 -0
  41. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
  42. package/dist/collection/components/salon-locations/index.js +151 -0
  43. package/dist/collection/components/salon-lookbook/index.css +12 -0
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +122 -49
  45. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  46. package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
  47. package/dist/collection/components/salon-reviews/index.css +15 -0
  48. package/dist/collection/components/salon-reviews/index.js +286 -0
  49. package/dist/collection/components/salon-schedules/index.css +15 -0
  50. package/dist/collection/components/salon-schedules/index.js +189 -0
  51. package/{collection/components/salon-reviews → dist/collection/components/salon-services}/index.css +0 -0
  52. package/dist/collection/components/salon-services/index.js +156 -0
  53. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
  54. package/dist/collection/components/salon-stylists/index.js +183 -0
  55. package/dist/collection/components/style-detail/index.css +62 -0
  56. package/dist/collection/components/style-detail/index.js +461 -0
  57. package/{collection/components/salon-services → dist/collection/components/user-avatar}/index.css +0 -0
  58. package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
  59. package/dist/collection/constants/colors.js +65 -0
  60. package/{collection → dist/collection}/global/global.js +0 -0
  61. package/{collection → dist/collection}/index.js +0 -0
  62. package/dist/collection/services/services.js +174 -0
  63. package/dist/collection/types/common.js +11 -0
  64. package/{collection → dist/collection}/types/review.js +9 -5
  65. package/dist/collection/types/salon.js +58 -0
  66. package/{collection → dist/collection}/types/service.js +0 -0
  67. package/dist/collection/types/style.js +128 -0
  68. package/dist/collection/types/stylist.js +30 -0
  69. package/{collection/components/user-avatar/index.css → dist/collection/types/tmp.js} +0 -0
  70. package/{collection → dist/collection}/types/user.js +2 -2
  71. package/{collection → dist/collection}/utils/utils.js +0 -0
  72. package/{custom-elements → dist/custom-elements}/index.d.ts +12 -12
  73. package/{custom-elements → dist/custom-elements}/index.js +5783 -870
  74. package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
  75. package/dist/esm/colors-ea36347a.js +67 -0
  76. package/dist/esm/favesalon-embed.js +18 -0
  77. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  78. package/dist/esm/google-map_5.entry.js +283 -0
  79. package/{esm/index-2160b80b.js → dist/esm/index-6af0a03d.js} +87 -4
  80. package/dist/esm/index-80523fec.js +4393 -0
  81. package/{esm → dist/esm}/index.js +0 -0
  82. package/dist/esm/loader.js +18 -0
  83. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  84. package/{esm → dist/esm}/polyfills/css-shim.js +0 -0
  85. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  86. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  87. package/{esm → dist/esm}/polyfills/index.js +0 -0
  88. package/{esm → dist/esm}/polyfills/system.js +0 -0
  89. package/dist/esm/salon-booking-modal.entry.js +25 -0
  90. package/dist/esm/salon-booking.entry.js +46 -0
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/dist/esm/salon-gift-card.entry.js +46 -0
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/dist/esm/salon-lookbook.entry.js +214 -0
  95. package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
  96. package/dist/esm/salon-reviews.entry.js +182 -0
  97. package/dist/esm/salon-services.entry.js +74 -0
  98. package/dist/esm/salon-stylists.entry.js +108 -0
  99. package/{esm/services-57fadd0a.js → dist/esm/services-295247b1.js} +310 -355
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/{esm → dist/esm}/user-avatar.entry.js +4 -4
  102. package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  103. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  104. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  105. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  106. package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  107. package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
  108. package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  109. package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
  110. package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
  111. package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
  112. package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
  113. package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
  114. package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
  115. package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
  116. package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
  117. package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
  118. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  119. package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
  120. package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
  121. package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
  122. package/dist/favesalon-embed/p-c2ecb365.js +1 -0
  123. package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
  124. package/dist/favesalon-embed/p-d6083940.js +1 -0
  125. package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
  126. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  127. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  128. package/{index.js → dist/index.js} +0 -0
  129. package/dist/types/components/google-map/index.d.ts +5 -0
  130. package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
  134. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  135. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  136. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  137. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  138. package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
  139. package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  140. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  141. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  142. package/{types → dist/types}/components/salon-services/index.d.ts +2 -0
  143. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  144. package/dist/types/components/style-detail/index.d.ts +24 -0
  145. package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  146. package/{types → dist/types}/components.d.ts +62 -41
  147. package/dist/types/constants/colors.d.ts +65 -0
  148. package/{types → dist/types}/index.d.ts +0 -0
  149. package/dist/types/services/services.d.ts +60 -0
  150. package/{types → dist/types}/stencil-public-runtime.d.ts +0 -0
  151. package/dist/types/types/common.d.ts +11 -0
  152. package/{types → dist/types}/types/review.d.ts +4 -0
  153. package/{types → dist/types}/types/salon.d.ts +3 -1
  154. package/{types → dist/types}/types/service.d.ts +0 -0
  155. package/dist/types/types/style.d.ts +88 -0
  156. package/{types → dist/types}/types/stylist.d.ts +2 -1
  157. package/dist/types/types/tmp.d.ts +0 -0
  158. package/{types → dist/types}/types/user.d.ts +2 -2
  159. package/{types → dist/types}/utils/utils.d.ts +0 -0
  160. package/loader/cdn.js +3 -0
  161. package/loader/index.cjs.js +3 -0
  162. package/loader/index.d.ts +12 -0
  163. package/loader/index.es2017.js +3 -0
  164. package/loader/index.js +4 -0
  165. package/loader/package.json +10 -0
  166. package/package.json +18 -13
  167. package/readme.md +23 -2
  168. package/cjs/colors-7f354880.js +0 -95
  169. package/cjs/favesalon-embed.cjs.js +0 -20
  170. package/cjs/google-map.cjs.entry.js +0 -47
  171. package/cjs/loader.cjs.js +0 -22
  172. package/cjs/salon-booking-modal.cjs.entry.js +0 -23
  173. package/cjs/salon-booking_2.cjs.entry.js +0 -56
  174. package/cjs/salon-contact_4.cjs.entry.js +0 -154
  175. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
  176. package/cjs/salon-info.cjs.entry.js +0 -34
  177. package/cjs/salon-latest-reviews.cjs.entry.js +0 -57
  178. package/cjs/salon-lookbook.cjs.entry.js +0 -187
  179. package/cjs/salon-reviews.cjs.entry.js +0 -196
  180. package/cjs/salon-services.cjs.entry.js +0 -40
  181. package/cjs/salon-stylists.cjs.entry.js +0 -53
  182. package/collection/components/google-map/index.js +0 -97
  183. package/collection/components/salon-contact/index.js +0 -88
  184. package/collection/components/salon-gift-card/index.css +0 -25
  185. package/collection/components/salon-info/index.css +0 -3
  186. package/collection/components/salon-latest-reviews/index.js +0 -108
  187. package/collection/components/salon-locations/index.js +0 -80
  188. package/collection/components/salon-lookbook/index.css +0 -12
  189. package/collection/components/salon-reviews/index.js +0 -291
  190. package/collection/components/salon-schedules/index.css +0 -14
  191. package/collection/components/salon-schedules/index.js +0 -103
  192. package/collection/components/salon-services/index.js +0 -86
  193. package/collection/components/salon-styles/index.css +0 -23
  194. package/collection/components/salon-styles/index.js +0 -100
  195. package/collection/components/salon-stylists/index.js +0 -96
  196. package/collection/constants/colors.js +0 -91
  197. package/collection/services/services.js +0 -203
  198. package/collection/types/common.js +0 -2
  199. package/collection/types/salon.js +0 -52
  200. package/collection/types/style.js +0 -28
  201. package/collection/types/stylist.js +0 -13
  202. package/esm/colors-1ec90c5f.js +0 -93
  203. package/esm/favesalon-embed.js +0 -18
  204. package/esm/google-map.entry.js +0 -43
  205. package/esm/loader.js +0 -18
  206. package/esm/salon-booking-modal.entry.js +0 -19
  207. package/esm/salon-booking_2.entry.js +0 -51
  208. package/esm/salon-contact_4.entry.js +0 -147
  209. package/esm/salon-gift-card-modal.entry.js +0 -16
  210. package/esm/salon-info.entry.js +0 -30
  211. package/esm/salon-latest-reviews.entry.js +0 -53
  212. package/esm/salon-lookbook.entry.js +0 -183
  213. package/esm/salon-reviews.entry.js +0 -192
  214. package/esm/salon-services.entry.js +0 -36
  215. package/esm/salon-stylists.entry.js +0 -49
  216. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  217. package/favesalon-embed/p-14a46adf.entry.js +0 -1
  218. package/favesalon-embed/p-2da2ed75.js +0 -1
  219. package/favesalon-embed/p-3712d9ab.entry.js +0 -1
  220. package/favesalon-embed/p-38066f9f.entry.js +0 -1
  221. package/favesalon-embed/p-4e2d7b29.js +0 -1
  222. package/favesalon-embed/p-520c8ffb.entry.js +0 -1
  223. package/favesalon-embed/p-54a1c294.entry.js +0 -1
  224. package/favesalon-embed/p-762520f2.js +0 -1
  225. package/favesalon-embed/p-94a0991e.entry.js +0 -1
  226. package/favesalon-embed/p-94b179eb.entry.js +0 -1
  227. package/favesalon-embed/p-977bd8bc.entry.js +0 -1
  228. package/favesalon-embed/p-bc363938.entry.js +0 -1
  229. package/favesalon-embed/p-bf9c83a3.entry.js +0 -1
  230. package/favesalon-embed/p-c5ebd3c9.entry.js +0 -1
  231. package/favesalon-embed/p-d84b61b0.entry.js +0 -1
  232. package/favesalon-embed/p-f15bcb43.entry.js +0 -1
  233. package/types/components/google-map/index.d.ts +0 -10
  234. package/types/components/salon-contact/index.d.ts +0 -9
  235. package/types/components/salon-reviews/index.d.ts +0 -23
  236. package/types/components/salon-styles/index.d.ts +0 -9
  237. package/types/constants/colors.d.ts +0 -88
  238. package/types/services/services.d.ts +0 -24
  239. package/types/types/common.d.ts +0 -2
  240. package/types/types/style.d.ts +0 -49
@@ -0,0 +1,25 @@
1
+ .salon-modal.salon-modal--gift-card:before {
2
+ display: none;
3
+ }
4
+ .salon-modal.salon-modal--gift-card .salon-modal--inner,
5
+ .salon-modal.salon-modal--gift-card .salon-modal--content {
6
+ max-width: none;
7
+ width: 100%;
8
+ height: 100%;
9
+ }
10
+ .salon-modal.salon-modal--gift-card .salon-modal--close {
11
+ background-color: #EFEFEF;
12
+ width: 40px;
13
+ height: 40px;
14
+ right: 16px;
15
+ top: 16px;
16
+ -moz-border-radius: 50px;
17
+ -webkit-border-radius: 50px;
18
+ border-radius: 50px;
19
+ }
20
+ @media (min-width: 768px) {
21
+ .salon-modal.salon-modal--gift-card .salon-modal--close {
22
+ right: 20px;
23
+ top: 20px;
24
+ }
25
+ }
@@ -1,26 +1,46 @@
1
1
  import { Component, Prop, h } from '@stencil/core';
2
+ import Color from 'color';
3
+ import { css } from 'glamor';
4
+ import { Colors } from '../../constants/colors';
2
5
  export class SalonGiftCard {
3
6
  constructor() {
7
+ this.buttonClass = '';
4
8
  this.buttonText = 'Buy Gift card';
5
- this.buttonClass = 'btn btn-primary';
9
+ this.primaryColor = Colors.Primary;
6
10
  }
7
11
  openModal() {
8
12
  const elBookingModal = document.createElement('div');
9
13
  elBookingModal.innerHTML = `
10
14
  <salon-gift-card-modal
11
15
  salon-id=${this.salonId}
16
+ primary-color=${this.primaryColor}
12
17
  ></salon-gift-card-modal>
13
18
  `;
14
19
  document.body.appendChild(elBookingModal);
15
20
  }
16
21
  render() {
22
+ const buttonClass = this.buttonClass || 'btn btn-primary';
23
+ let buttonStyle = {};
24
+ if (!this.buttonClass) {
25
+ const primaryColor = Color(this.primaryColor);
26
+ const primaryColorHover = primaryColor.darken(0.05);
27
+ buttonStyle = css({
28
+ backgroundColor: this.primaryColor,
29
+ borderColor: this.primaryColor,
30
+ color: primaryColor.isLight() ? Colors.Black01 : Colors.White,
31
+ ':hover': {
32
+ backgroundColor: primaryColorHover,
33
+ borderColor: primaryColorHover,
34
+ },
35
+ });
36
+ }
17
37
  return (h("div", { class: "salon-gift-card" },
18
38
  h("div", { class: "salon-gift-card--button" },
19
- h("button", { type: "button", class: this.buttonClass, onClick: () => this.openModal() }, this.buttonText))));
39
+ h("button", Object.assign({ type: "button", class: buttonClass, onClick: () => this.openModal() }, buttonStyle), this.buttonText))));
20
40
  }
21
41
  static get is() { return "salon-gift-card"; }
22
42
  static get originalStyleUrls() { return {
23
- "$": ["index.css"]
43
+ "$": ["index.less"]
24
44
  }; }
25
45
  static get styleUrls() { return {
26
46
  "$": ["index.css"]
@@ -43,6 +63,24 @@ export class SalonGiftCard {
43
63
  "attribute": "salon-id",
44
64
  "reflect": false
45
65
  },
66
+ "buttonClass": {
67
+ "type": "string",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "string",
71
+ "resolved": "string",
72
+ "references": {}
73
+ },
74
+ "required": false,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "attribute": "button-class",
81
+ "reflect": false,
82
+ "defaultValue": "''"
83
+ },
46
84
  "buttonText": {
47
85
  "type": "string",
48
86
  "mutable": false,
@@ -61,7 +99,7 @@ export class SalonGiftCard {
61
99
  "reflect": false,
62
100
  "defaultValue": "'Buy Gift card'"
63
101
  },
64
- "buttonClass": {
102
+ "primaryColor": {
65
103
  "type": "string",
66
104
  "mutable": false,
67
105
  "complexType": {
@@ -75,9 +113,9 @@ export class SalonGiftCard {
75
113
  "tags": [],
76
114
  "text": ""
77
115
  },
78
- "attribute": "button-class",
116
+ "attribute": "primary-color",
79
117
  "reflect": false,
80
- "defaultValue": "'btn btn-primary'"
118
+ "defaultValue": "Colors.Primary"
81
119
  }
82
120
  }; }
83
121
  }
@@ -1,19 +1,27 @@
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
  }
8
+ closeModal() {
9
+ this.isModalOpen = false;
10
+ const el = document.querySelector('salon-gift-card-modal');
11
+ el.remove();
12
+ }
6
13
  render() {
14
+ const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
7
15
  return (h("div", { class: "salon-gift-card--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--gift-card" },
8
- h("div", { class: "salon-modal--backdrop", onClick: () => this.isModalOpen = false }),
16
+ h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }),
17
+ h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }),
9
18
  h("div", { class: "salon-modal--inner" },
10
- h("div", { class: "salon-modal--close", onClick: () => this.isModalOpen = false }),
11
19
  h("div", { class: "salon-modal--content" },
12
- 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` })))))));
13
21
  }
14
22
  static get is() { return "salon-gift-card-modal"; }
15
23
  static get originalStyleUrls() { return {
16
- "$": ["index.css"]
24
+ "$": ["index.less"]
17
25
  }; }
18
26
  static get styleUrls() { return {
19
27
  "$": ["index.css"]
@@ -35,6 +43,24 @@ export class SalonGiftCardModal {
35
43
  },
36
44
  "attribute": "salon-id",
37
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"
38
64
  }
39
65
  }; }
40
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
  }