favesalon-embed 0.0.3 → 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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
  3. package/dist/cjs/chat-button.cjs.entry.js +118 -0
  4. package/dist/cjs/colors-38421769.js +69 -0
  5. package/dist/cjs/favesalon-embed.cjs.js +24 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +310 -0
  7. package/{cjs/index-7d179a70.js → dist/cjs/index-47c2a5f6.js} +587 -199
  8. package/dist/cjs/index-7f190886.js +4396 -0
  9. package/dist/cjs/loader.cjs.js +23 -0
  10. package/dist/cjs/relativeTime-3721080d.js +9 -0
  11. package/dist/cjs/salon-booking-modal.cjs.entry.js +30 -0
  12. package/dist/cjs/salon-booking.cjs.entry.js +51 -0
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
  14. package/dist/cjs/salon-gift-card.cjs.entry.js +51 -0
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
  16. package/dist/cjs/salon-lookbook.cjs.entry.js +222 -0
  17. package/dist/cjs/salon-ranking.cjs.entry.js +60 -0
  18. package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +81 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
  21. package/dist/cjs/services-125c82d8.js +21492 -0
  22. package/dist/cjs/style-detail.cjs.entry.js +312 -0
  23. package/dist/cjs/user-avatar.cjs.entry.js +45 -0
  24. package/dist/cjs/utils-c5a33b3c.js +23 -0
  25. package/{collection → dist/collection}/collection-manifest.json +5 -4
  26. package/dist/collection/components/chat-button/index.css +122 -0
  27. package/dist/collection/components/chat-button/index.js +218 -0
  28. package/dist/collection/components/chat-conversation/index.js +103 -0
  29. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  30. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  31. package/dist/collection/components/google-map/index.js +90 -0
  32. package/{collection → dist/collection}/components/salon-booking/index.css +11 -20
  33. package/dist/collection/components/salon-booking/index.js +126 -0
  34. package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
  35. package/dist/collection/components/salon-gift-card/index.css +30 -0
  36. package/dist/collection/components/salon-gift-card/index.js +126 -0
  37. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
  38. package/dist/collection/components/salon-info/index.js +77 -0
  39. package/dist/collection/components/salon-latest-reviews/index.js +163 -0
  40. package/dist/collection/components/salon-latest-styles/index.css +12 -0
  41. package/dist/collection/components/salon-latest-styles/index.js +183 -0
  42. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +7 -4
  43. package/dist/collection/components/salon-locations/index.js +143 -0
  44. package/dist/collection/components/salon-lookbook/index.css +15 -0
  45. package/dist/collection/components/salon-lookbook/index.js +368 -0
  46. package/dist/collection/components/salon-ranking/index.js +117 -0
  47. package/dist/collection/components/salon-reviews/index.css +18 -0
  48. package/dist/collection/components/salon-reviews/index.js +249 -0
  49. package/dist/collection/components/salon-schedules/index.css +18 -0
  50. package/dist/collection/components/salon-schedules/index.js +167 -0
  51. package/dist/collection/components/salon-services/index.css +1 -0
  52. package/dist/collection/components/salon-services/index.js +146 -0
  53. package/dist/collection/components/salon-stylists/index.js +184 -0
  54. package/dist/collection/components/style-detail/index.css +76 -0
  55. package/dist/collection/components/style-detail/index.js +386 -0
  56. package/dist/collection/components/user-avatar/index.js +134 -0
  57. package/dist/collection/constants/colors.js +65 -0
  58. package/dist/collection/mocks/users.js +10 -0
  59. package/dist/collection/services/services.js +295 -0
  60. package/dist/collection/types/chat.js +23 -0
  61. package/dist/collection/types/common.js +11 -0
  62. package/{collection → dist/collection}/types/review.js +9 -5
  63. package/dist/collection/types/salon.js +58 -0
  64. package/dist/collection/types/style.js +128 -0
  65. package/dist/collection/types/stylist.js +30 -0
  66. package/dist/collection/types/user.js +10 -0
  67. package/{custom-elements → dist/custom-elements}/index.d.ts +18 -12
  68. package/dist/custom-elements/index.js +28340 -0
  69. package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
  70. package/dist/esm/chat-button.entry.js +114 -0
  71. package/dist/esm/colors-ea36347a.js +67 -0
  72. package/dist/esm/favesalon-embed.js +19 -0
  73. package/dist/esm/google-map_5.entry.js +302 -0
  74. package/{esm/index-2160b80b.js → dist/esm/index-3fae868e.js} +586 -200
  75. package/dist/esm/index-80523fec.js +4393 -0
  76. package/dist/esm/index.js +1 -0
  77. package/dist/esm/loader.js +19 -0
  78. package/dist/esm/polyfills/css-shim.js +1 -0
  79. package/dist/esm/relativeTime-cd452e6d.js +7 -0
  80. package/dist/esm/salon-booking-modal.entry.js +26 -0
  81. package/dist/esm/salon-booking.entry.js +47 -0
  82. package/dist/esm/salon-gift-card-modal.entry.js +25 -0
  83. package/dist/esm/salon-gift-card.entry.js +47 -0
  84. package/dist/esm/salon-latest-reviews.entry.js +93 -0
  85. package/dist/esm/salon-lookbook.entry.js +218 -0
  86. package/dist/esm/salon-ranking.entry.js +56 -0
  87. package/dist/esm/salon-reviews.entry.js +189 -0
  88. package/dist/esm/salon-services.entry.js +77 -0
  89. package/dist/esm/salon-stylists.entry.js +114 -0
  90. package/dist/esm/services-40a3e622.js +21485 -0
  91. package/dist/esm/style-detail.entry.js +308 -0
  92. package/dist/esm/user-avatar.entry.js +41 -0
  93. package/dist/esm/utils-e97485e0.js +19 -0
  94. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  95. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  96. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  97. package/dist/favesalon-embed/p-019c5ccd.entry.js +1 -0
  98. package/dist/favesalon-embed/p-083a8821.entry.js +1 -0
  99. package/dist/favesalon-embed/p-0d0ed9ea.entry.js +1 -0
  100. package/dist/favesalon-embed/p-119db8de.entry.js +1 -0
  101. package/dist/favesalon-embed/p-1432c51b.entry.js +1 -0
  102. package/dist/favesalon-embed/p-22093506.entry.js +1 -0
  103. package/dist/favesalon-embed/p-32b314e9.js +2 -0
  104. package/dist/favesalon-embed/p-47e646f8.js +1 -0
  105. package/dist/favesalon-embed/p-4a5eca9a.js +6 -0
  106. package/dist/favesalon-embed/p-58d2e9be.js +1 -0
  107. package/dist/favesalon-embed/p-71404b6a.entry.js +1 -0
  108. package/dist/favesalon-embed/p-857c3a61.entry.js +1 -0
  109. package/dist/favesalon-embed/p-99ec77f7.entry.js +1 -0
  110. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  111. package/dist/favesalon-embed/p-b0c3673a.entry.js +1 -0
  112. package/dist/favesalon-embed/p-b287b1ea.entry.js +1 -0
  113. package/dist/favesalon-embed/p-b3af7842.entry.js +1 -0
  114. package/dist/favesalon-embed/p-b630ae68.js +1580 -0
  115. package/dist/favesalon-embed/p-ce2c1c9a.entry.js +1 -0
  116. package/dist/favesalon-embed/p-d6083940.js +1 -0
  117. package/dist/favesalon-embed/p-d9b7ad58.entry.js +1 -0
  118. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  119. package/dist/types/components/chat-button/index.d.ts +24 -0
  120. package/dist/types/components/google-map/index.d.ts +5 -0
  121. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
  122. package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
  123. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
  124. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  125. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  126. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  127. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  128. package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
  129. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  130. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  131. package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
  132. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  133. package/dist/types/components/style-detail/index.d.ts +24 -0
  134. package/{types → dist/types}/components.d.ts +82 -41
  135. package/dist/types/constants/colors.d.ts +65 -0
  136. package/dist/types/mocks/users.d.ts +10 -0
  137. package/dist/types/services/services.d.ts +75 -0
  138. package/{types → dist/types}/stencil-public-runtime.d.ts +85 -11
  139. package/dist/types/types/chat.d.ts +17 -0
  140. package/dist/types/types/common.d.ts +11 -0
  141. package/{types → dist/types}/types/review.d.ts +4 -0
  142. package/{types → dist/types}/types/salon.d.ts +3 -1
  143. package/dist/types/types/style.d.ts +88 -0
  144. package/{types → dist/types}/types/stylist.d.ts +2 -1
  145. package/{types → dist/types}/types/user.d.ts +2 -2
  146. package/loader/cdn.js +3 -0
  147. package/loader/index.cjs.js +3 -0
  148. package/loader/index.d.ts +21 -0
  149. package/loader/index.es2017.js +3 -0
  150. package/loader/index.js +4 -0
  151. package/loader/package.json +11 -0
  152. package/package.json +19 -14
  153. package/readme.md +25 -2
  154. package/cjs/favesalon-embed.cjs.js +0 -20
  155. package/cjs/google-map_15.cjs.entry.js +0 -6632
  156. package/cjs/loader.cjs.js +0 -22
  157. package/cjs/salon-booking-modal.cjs.entry.js +0 -23
  158. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
  159. package/collection/components/google-map/index.js +0 -97
  160. package/collection/components/salon-booking/index.js +0 -103
  161. package/collection/components/salon-booking/salon-booking-modal.js +0 -82
  162. package/collection/components/salon-contact/index.js +0 -88
  163. package/collection/components/salon-gift-card/index.css +0 -25
  164. package/collection/components/salon-gift-card/index.js +0 -83
  165. package/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -43
  166. package/collection/components/salon-info/index.css +0 -3
  167. package/collection/components/salon-info/index.js +0 -97
  168. package/collection/components/salon-latest-reviews/index.js +0 -108
  169. package/collection/components/salon-locations/index.js +0 -80
  170. package/collection/components/salon-lookbook/index.css +0 -12
  171. package/collection/components/salon-lookbook/index.js +0 -303
  172. package/collection/components/salon-ranking/index.js +0 -114
  173. package/collection/components/salon-reviews/index.js +0 -291
  174. package/collection/components/salon-schedules/index.css +0 -14
  175. package/collection/components/salon-schedules/index.js +0 -103
  176. package/collection/components/salon-services/index.css +0 -0
  177. package/collection/components/salon-services/index.js +0 -113
  178. package/collection/components/salon-styles/index.css +0 -23
  179. package/collection/components/salon-styles/index.js +0 -100
  180. package/collection/components/salon-stylists/index.js +0 -96
  181. package/collection/components/user-avatar/index.css +0 -0
  182. package/collection/components/user-avatar/index.js +0 -127
  183. package/collection/constants/colors.js +0 -91
  184. package/collection/services/services.js +0 -203
  185. package/collection/types/common.js +0 -2
  186. package/collection/types/salon.js +0 -52
  187. package/collection/types/style.js +0 -28
  188. package/collection/types/stylist.js +0 -13
  189. package/collection/types/user.js +0 -10
  190. package/custom-elements/index.js +0 -7410
  191. package/esm/favesalon-embed.js +0 -18
  192. package/esm/google-map_15.entry.js +0 -6614
  193. package/esm/loader.js +0 -18
  194. package/esm/polyfills/css-shim.js +0 -1
  195. package/esm/salon-booking-modal.entry.js +0 -19
  196. package/esm/salon-gift-card-modal.entry.js +0 -16
  197. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  198. package/favesalon-embed/p-1432ab16.entry.js +0 -1
  199. package/favesalon-embed/p-2da2ed75.js +0 -1
  200. package/favesalon-embed/p-4a5eca9a.js +0 -6
  201. package/favesalon-embed/p-94a0991e.entry.js +0 -1
  202. package/favesalon-embed/p-f15bcb43.entry.js +0 -1
  203. package/types/components/google-map/index.d.ts +0 -10
  204. package/types/components/salon-contact/index.d.ts +0 -9
  205. package/types/components/salon-reviews/index.d.ts +0 -23
  206. package/types/components/salon-styles/index.d.ts +0 -9
  207. package/types/constants/colors.d.ts +0 -88
  208. package/types/services/services.d.ts +0 -24
  209. package/types/types/common.d.ts +0 -2
  210. package/types/types/style.d.ts +0 -49
  211. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  212. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  213. package/{esm/index.js → dist/collection/components/salon-info/index.css} +0 -0
  214. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -0
  215. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  216. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -0
  217. package/{collection/components/salon-locations → dist/collection/components/user-avatar}/index.css +0 -0
  218. package/{collection → dist/collection}/global/global.js +0 -0
  219. package/{collection → dist/collection}/index.js +0 -0
  220. package/{collection → dist/collection}/types/service.js +0 -0
  221. package/{collection → dist/collection}/utils/utils.js +0 -0
  222. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  223. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  224. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  225. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  226. package/{esm → dist/esm}/polyfills/index.js +0 -0
  227. package/{esm → dist/esm}/polyfills/system.js +0 -0
  228. package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  229. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  230. package/{index.js → dist/index.js} +0 -0
  231. package/{collection/components/salon-reviews/index.css → dist/types/components/chat-conversation/index.d.ts} +0 -0
  232. package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
  233. /package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  234. /package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  235. /package/{types → dist/types}/index.d.ts +0 -0
  236. /package/{types → dist/types}/types/service.d.ts +0 -0
  237. /package/{types → dist/types}/utils/utils.d.ts +0 -0
@@ -0,0 +1,30 @@
1
+ .salon-modal.salon-modal--gift-card:before {
2
+ display: none;
3
+ }
4
+
5
+ .salon-modal.salon-modal--gift-card .salon-modal--inner,
6
+ .salon-modal.salon-modal--gift-card .salon-modal--content {
7
+ max-width: none;
8
+ width: 100%;
9
+ height: 100%;
10
+ }
11
+
12
+ .salon-modal.salon-modal--gift-card .salon-modal--close {
13
+ background-color: #EFEFEF;
14
+ width: 40px;
15
+ height: 40px;
16
+ right: 16px;
17
+ top: 16px;
18
+
19
+ -moz-border-radius: 50px;
20
+ -webkit-border-radius: 50px;
21
+ border-radius: 50px;
22
+ }
23
+
24
+
25
+ @media (min-width: 768px) {
26
+ .salon-modal.salon-modal--gift-card .salon-modal--close {
27
+ right: 20px;
28
+ top: 20px;
29
+ }
30
+ }
@@ -0,0 +1,126 @@
1
+ import { h } from '@stencil/core';
2
+ import Color from 'color';
3
+ import { css } from 'glamor';
4
+ import { Colors } from '../../constants/colors';
5
+ export class SalonGiftCard {
6
+ constructor() {
7
+ this.salonId = undefined;
8
+ this.buttonClass = '';
9
+ this.buttonText = 'Buy Gift card';
10
+ this.primaryColor = Colors.Primary;
11
+ }
12
+ openModal() {
13
+ const elBookingModal = document.createElement('div');
14
+ elBookingModal.innerHTML = `
15
+ <salon-gift-card-modal
16
+ salon-id=${this.salonId}
17
+ primary-color=${this.primaryColor}
18
+ ></salon-gift-card-modal>
19
+ `;
20
+ document.body.appendChild(elBookingModal);
21
+ }
22
+ render() {
23
+ const buttonClass = this.buttonClass || 'btn btn-primary';
24
+ let buttonStyle = {};
25
+ if (!this.buttonClass) {
26
+ const primaryColor = Color(this.primaryColor);
27
+ const primaryColorHover = primaryColor.darken(0.05);
28
+ buttonStyle = css({
29
+ backgroundColor: this.primaryColor,
30
+ borderColor: this.primaryColor,
31
+ color: primaryColor.isLight() ? Colors.Black01 : Colors.White,
32
+ ':hover': {
33
+ backgroundColor: primaryColorHover,
34
+ borderColor: primaryColorHover,
35
+ },
36
+ });
37
+ }
38
+ return (h("div", { class: "salon-gift-card" }, h("div", { class: "salon-gift-card--button" }, h("button", Object.assign({ type: "button", class: buttonClass, onClick: () => this.openModal() }, buttonStyle), this.buttonText))));
39
+ }
40
+ static get is() { return "salon-gift-card"; }
41
+ static get originalStyleUrls() {
42
+ return {
43
+ "$": ["index.css"]
44
+ };
45
+ }
46
+ static get styleUrls() {
47
+ return {
48
+ "$": ["index.css"]
49
+ };
50
+ }
51
+ static get properties() {
52
+ return {
53
+ "salonId": {
54
+ "type": "number",
55
+ "mutable": false,
56
+ "complexType": {
57
+ "original": "number",
58
+ "resolved": "number",
59
+ "references": {}
60
+ },
61
+ "required": false,
62
+ "optional": false,
63
+ "docs": {
64
+ "tags": [],
65
+ "text": ""
66
+ },
67
+ "attribute": "salon-id",
68
+ "reflect": false
69
+ },
70
+ "buttonClass": {
71
+ "type": "string",
72
+ "mutable": false,
73
+ "complexType": {
74
+ "original": "string",
75
+ "resolved": "string",
76
+ "references": {}
77
+ },
78
+ "required": false,
79
+ "optional": false,
80
+ "docs": {
81
+ "tags": [],
82
+ "text": ""
83
+ },
84
+ "attribute": "button-class",
85
+ "reflect": false,
86
+ "defaultValue": "''"
87
+ },
88
+ "buttonText": {
89
+ "type": "string",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "string",
93
+ "resolved": "string",
94
+ "references": {}
95
+ },
96
+ "required": false,
97
+ "optional": false,
98
+ "docs": {
99
+ "tags": [],
100
+ "text": ""
101
+ },
102
+ "attribute": "button-text",
103
+ "reflect": false,
104
+ "defaultValue": "'Buy Gift card'"
105
+ },
106
+ "primaryColor": {
107
+ "type": "string",
108
+ "mutable": false,
109
+ "complexType": {
110
+ "original": "string",
111
+ "resolved": "string",
112
+ "references": {}
113
+ },
114
+ "required": false,
115
+ "optional": false,
116
+ "docs": {
117
+ "tags": [],
118
+ "text": ""
119
+ },
120
+ "attribute": "primary-color",
121
+ "reflect": false,
122
+ "defaultValue": "Colors.Primary"
123
+ }
124
+ };
125
+ }
126
+ }
@@ -0,0 +1,73 @@
1
+ import { h } from '@stencil/core';
2
+ import { Colors } from '../../constants/colors';
3
+ export class SalonGiftCardModal {
4
+ constructor() {
5
+ this.salonId = undefined;
6
+ this.primaryColor = Colors.Primary;
7
+ this.isModalOpen = true;
8
+ }
9
+ closeModal() {
10
+ this.isModalOpen = false;
11
+ const el = document.querySelector('salon-gift-card-modal');
12
+ el.remove();
13
+ }
14
+ render() {
15
+ const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
16
+ return (h("div", { class: "salon-gift-card--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--gift-card" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, 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` })))))));
17
+ }
18
+ static get is() { return "salon-gift-card-modal"; }
19
+ static get originalStyleUrls() {
20
+ return {
21
+ "$": ["index.css"]
22
+ };
23
+ }
24
+ static get styleUrls() {
25
+ return {
26
+ "$": ["index.css"]
27
+ };
28
+ }
29
+ static get properties() {
30
+ return {
31
+ "salonId": {
32
+ "type": "number",
33
+ "mutable": false,
34
+ "complexType": {
35
+ "original": "number",
36
+ "resolved": "number",
37
+ "references": {}
38
+ },
39
+ "required": false,
40
+ "optional": false,
41
+ "docs": {
42
+ "tags": [],
43
+ "text": ""
44
+ },
45
+ "attribute": "salon-id",
46
+ "reflect": false
47
+ },
48
+ "primaryColor": {
49
+ "type": "string",
50
+ "mutable": false,
51
+ "complexType": {
52
+ "original": "string",
53
+ "resolved": "string",
54
+ "references": {}
55
+ },
56
+ "required": false,
57
+ "optional": false,
58
+ "docs": {
59
+ "tags": [],
60
+ "text": ""
61
+ },
62
+ "attribute": "primary-color",
63
+ "reflect": false,
64
+ "defaultValue": "Colors.Primary"
65
+ }
66
+ };
67
+ }
68
+ static get states() {
69
+ return {
70
+ "isModalOpen": {}
71
+ };
72
+ }
73
+ }
@@ -0,0 +1,77 @@
1
+ import { h } from '@stencil/core';
2
+ import HttpService from '../../services/services';
3
+ export class SalonInfo {
4
+ constructor() {
5
+ this.salonId = undefined;
6
+ this.salonInfo = undefined;
7
+ }
8
+ componentWillLoad() {
9
+ this.fetchData();
10
+ }
11
+ async fetchData() {
12
+ try {
13
+ this.salonInfo = await HttpService().fetchSalonInfo(this.salonId);
14
+ }
15
+ catch (e) { }
16
+ }
17
+ render() {
18
+ return (h("div", { class: "salon-info" }, h("div", { class: "container" }, h("div", { class: "salon-info--schedules", style: { marginBottom: '24px' } }, h("salon-schedules", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "row" }, h("div", { class: "col-md-5", style: { marginBottom: '24px' } }, h("salon-locations", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "col-md-7", style: { marginBottom: '24px' } }, h("salon-latest-styles", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))))));
19
+ }
20
+ static get is() { return "salon-info"; }
21
+ static get originalStyleUrls() {
22
+ return {
23
+ "$": ["index.css"]
24
+ };
25
+ }
26
+ static get styleUrls() {
27
+ return {
28
+ "$": ["index.css"]
29
+ };
30
+ }
31
+ static get properties() {
32
+ return {
33
+ "salonId": {
34
+ "type": "number",
35
+ "mutable": false,
36
+ "complexType": {
37
+ "original": "number",
38
+ "resolved": "number",
39
+ "references": {}
40
+ },
41
+ "required": false,
42
+ "optional": false,
43
+ "docs": {
44
+ "tags": [],
45
+ "text": ""
46
+ },
47
+ "attribute": "salon-id",
48
+ "reflect": false
49
+ }
50
+ };
51
+ }
52
+ static get states() {
53
+ return {
54
+ "salonInfo": {}
55
+ };
56
+ }
57
+ static get methods() {
58
+ return {
59
+ "fetchData": {
60
+ "complexType": {
61
+ "signature": "() => Promise<void>",
62
+ "parameters": [],
63
+ "references": {
64
+ "Promise": {
65
+ "location": "global"
66
+ }
67
+ },
68
+ "return": "Promise<void>"
69
+ },
70
+ "docs": {
71
+ "text": "",
72
+ "tags": []
73
+ }
74
+ }
75
+ };
76
+ }
77
+ }
@@ -0,0 +1,163 @@
1
+ import { h } 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.salonId = undefined;
10
+ this.primaryColor = Colors.Primary;
11
+ this.salonReviews = [];
12
+ this.isLoading = undefined;
13
+ }
14
+ componentWillLoad() {
15
+ this.fetchData();
16
+ }
17
+ async fetchData() {
18
+ this.isLoading = true;
19
+ try {
20
+ const { data: allReviews } = await HttpService().fetchSalonReviews(this.salonId, { limit: 5 });
21
+ this.salonReviews = [...allReviews];
22
+ }
23
+ catch (e) { }
24
+ this.isLoading = false;
25
+ }
26
+ render() {
27
+ if (this.isLoading) {
28
+ return (h("div", { class: "salon-latest-reviews", style: { overflow: 'hidden' } }, h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, [1, 2, 3, 4, 5].map((fakeId, index) => {
29
+ 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' } : {}) }, h("div", { class: "card", style: { border: 'none' } }, h("div", { class: "card-body" }, h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, h("div", { style: {
30
+ backgroundColor: Colors.Gray02,
31
+ borderRadius: '50px',
32
+ height: '48px',
33
+ width: '48px',
34
+ float: 'left',
35
+ } }), h("div", { style: {
36
+ backgroundColor: Colors.Gray01,
37
+ height: '16px',
38
+ width: '120px',
39
+ marginLeft: '16px',
40
+ marginTop: '14px',
41
+ float: 'left',
42
+ } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(() => (h("div", { style: {
43
+ backgroundColor: Colors.Gray01,
44
+ height: '20px',
45
+ width: '20px',
46
+ marginRight: '8px',
47
+ float: 'left',
48
+ } })))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold', marginTop: '16px' } }, h("div", { style: {
49
+ backgroundColor: Colors.Gray01,
50
+ height: '16px',
51
+ width: '132px',
52
+ } })), h("div", { class: "salon-review--detail", style: { marginTop: '8px' } }, h("div", { class: "salon-review--description", style: {
53
+ fontSize: '16px',
54
+ lineHeight: '26px',
55
+ overflow: 'hidden',
56
+ } }, h("div", { style: {
57
+ backgroundColor: Colors.Gray01,
58
+ height: '16px',
59
+ width: '240px',
60
+ float: 'left',
61
+ } })))))));
62
+ }))));
63
+ }
64
+ const ratingTexts = getRatingText();
65
+ return (h("div", { class: "salon-latest-reviews", style: { overflowX: 'auto' } }, h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, (this.salonReviews || []).map((review, index) => {
66
+ const { user } = review;
67
+ 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' } : {}) }, h("div", { class: "card", style: { border: 'none' } }, h("div", { class: "card-body" }, h("div", { class: "salon-review--user", style: { marginBottom: '16px' } }, 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' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [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 }) }))), h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, dayjs(review.createdDate).format(shortDateYearFormat))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--description", style: {
68
+ fontSize: '16px',
69
+ lineHeight: '26px',
70
+ overflow: 'hidden',
71
+ maxHeight: review.photos.length > 0 ? '52px' : '104px',
72
+ } }, review.title || review.description))), review.photos.length > 0 && (h("div", { style: {
73
+ display: 'flex',
74
+ flexDirection: 'row',
75
+ overflowX: 'auto',
76
+ } }, review.photos.map(photo => (h("div", { style: {
77
+ border: '1px solid #d9d9d9',
78
+ position: 'relative',
79
+ cursor: 'pointer',
80
+ borderRadius: '2px',
81
+ height: '66px',
82
+ marginTop: '12px',
83
+ marginRight: '12px',
84
+ } }, h("img", { alt: "", src: photo.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))))));
85
+ }))));
86
+ }
87
+ static get is() { return "salon-latest-reviews"; }
88
+ static get originalStyleUrls() {
89
+ return {
90
+ "$": ["index.css"]
91
+ };
92
+ }
93
+ static get styleUrls() {
94
+ return {
95
+ "$": ["index.css"]
96
+ };
97
+ }
98
+ static get properties() {
99
+ return {
100
+ "salonId": {
101
+ "type": "number",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "number",
105
+ "resolved": "number",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": ""
113
+ },
114
+ "attribute": "salon-id",
115
+ "reflect": false
116
+ },
117
+ "primaryColor": {
118
+ "type": "string",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "string",
122
+ "resolved": "string",
123
+ "references": {}
124
+ },
125
+ "required": false,
126
+ "optional": false,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": ""
130
+ },
131
+ "attribute": "primary-color",
132
+ "reflect": false,
133
+ "defaultValue": "Colors.Primary"
134
+ }
135
+ };
136
+ }
137
+ static get states() {
138
+ return {
139
+ "salonReviews": {},
140
+ "isLoading": {}
141
+ };
142
+ }
143
+ static get methods() {
144
+ return {
145
+ "fetchData": {
146
+ "complexType": {
147
+ "signature": "() => Promise<void>",
148
+ "parameters": [],
149
+ "references": {
150
+ "Promise": {
151
+ "location": "global"
152
+ }
153
+ },
154
+ "return": "Promise<void>"
155
+ },
156
+ "docs": {
157
+ "text": "",
158
+ "tags": []
159
+ }
160
+ }
161
+ };
162
+ }
163
+ }
@@ -0,0 +1,12 @@
1
+ salon-latest-styles .view--salon-styles--item {
2
+ width: 120px;
3
+ height: 120px;
4
+ }
5
+
6
+
7
+ @media (min-width: 1024px) {
8
+ salon-latest-styles .view--salon-styles--item {
9
+ width: 200px;
10
+ height: 200px;
11
+ }
12
+ }
@@ -0,0 +1,183 @@
1
+ import { h } 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
+ constructor() {
7
+ this.salonId = undefined;
8
+ this.isLoading = undefined;
9
+ this.withBorder = undefined;
10
+ this.isLoadingState = undefined;
11
+ this.latestStyles = undefined;
12
+ }
13
+ componentDidLoad() {
14
+ this.fetchData();
15
+ }
16
+ async fetchData() {
17
+ this.isLoadingState = true;
18
+ try {
19
+ const promises = [
20
+ HttpService().fetchSalonLatestStyles(this.salonId, { limit: 6 })
21
+ .then(salonStyles => this.latestStyles = salonStyles),
22
+ ];
23
+ return Promise.all(promises)
24
+ .then(() => this.isLoadingState = false)
25
+ .catch(() => this.isLoadingState = false);
26
+ }
27
+ catch (e) { }
28
+ }
29
+ onClickLookbook(style) {
30
+ const elLookbookModal = document.createElement('div');
31
+ elLookbookModal.innerHTML = `
32
+ <style-detail
33
+ salon-id=${this.salonId}
34
+ salon-lookbook='${JSON.stringify(style)}'
35
+ ></style-detail>
36
+ `;
37
+ document.body.appendChild(elLookbookModal);
38
+ }
39
+ render() {
40
+ if (this.isLoading || this.isLoadingState) {
41
+ return (h("div", { class: "view view--salon-styles" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
42
+ backgroundColor: Colors.Gray02,
43
+ height: '20px',
44
+ width: '120px',
45
+ } }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
46
+ overflow: 'hidden',
47
+ marginLeft: '-16px',
48
+ marginBottom: '-16px',
49
+ } }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((fakeId, idx) => (h("div", { key: `style-listing--item-${fakeId}-${idx}`, style: {
50
+ float: 'left',
51
+ paddingLeft: '16px',
52
+ marginBottom: '16px',
53
+ } }, h("div", { style: {
54
+ backgroundColor: Colors.Gray01,
55
+ borderRadius: '8px',
56
+ width: '120px',
57
+ height: '120px',
58
+ overflow: 'hidden',
59
+ position: 'relative',
60
+ cursor: 'pointer',
61
+ } })))))))));
62
+ }
63
+ return (h("div", { class: "view view--salon-styles" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Photos"), h("div", { style: {
64
+ overflow: 'hidden',
65
+ marginLeft: '-16px',
66
+ marginBottom: '-16px',
67
+ marginTop: '16px',
68
+ } }, (this.latestStyles || []).map((faveStyle, idx) => {
69
+ const { imageThumb, albumMedias } = faveStyle;
70
+ const firstMedia = albumMedias.length > 0 ? albumMedias[0] : null;
71
+ const isVideo = firstMedia ? isVideoMedia(firstMedia) : false;
72
+ return (h("div", { key: `style-listing--item-${faveStyle.id}-${idx}`, style: {
73
+ float: 'left',
74
+ paddingLeft: '16px',
75
+ marginBottom: '16px',
76
+ } }, h("div", { class: "view--salon-styles--item", style: Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '8px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, !isVideo && firstMedia ? {
77
+ backgroundImage: `url("${firstMedia.imageThumb || firstMedia.imageThumbMedium}")`,
78
+ backgroundRepeat: 'no-repeat',
79
+ backgroundPosition: 'center center',
80
+ backgroundSize: 'cover',
81
+ } : {}), onClick: () => this.onClickLookbook(faveStyle) }, isVideo && firstMedia && (h("div", null, h("video", { muted: true, width: "100%", height: "100%", poster: imageThumb }, h("source", { src: firstMedia.mediaUrl, type: "video/mp4" })), h("i", { class: "ri-play-circle-fill", style: {
82
+ fontSize: '48px',
83
+ color: Colors.TextColor,
84
+ position: 'absolute',
85
+ left: '50%',
86
+ top: '50%',
87
+ transform: 'translate(-50%, -50%)',
88
+ } }))))));
89
+ })))));
90
+ }
91
+ static get is() { return "salon-latest-styles"; }
92
+ static get originalStyleUrls() {
93
+ return {
94
+ "$": ["index.css"]
95
+ };
96
+ }
97
+ static get styleUrls() {
98
+ return {
99
+ "$": ["index.css"]
100
+ };
101
+ }
102
+ static get properties() {
103
+ 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
+ }
157
+ static get states() {
158
+ return {
159
+ "isLoadingState": {},
160
+ "latestStyles": {}
161
+ };
162
+ }
163
+ static get methods() {
164
+ return {
165
+ "fetchData": {
166
+ "complexType": {
167
+ "signature": "() => Promise<boolean>",
168
+ "parameters": [],
169
+ "references": {
170
+ "Promise": {
171
+ "location": "global"
172
+ }
173
+ },
174
+ "return": "Promise<boolean>"
175
+ },
176
+ "docs": {
177
+ "text": "",
178
+ "tags": []
179
+ }
180
+ }
181
+ };
182
+ }
183
+ }