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,310 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e6bea8f5.js');
6
+ const services = require('./services-eee8f251.js');
7
+ const _commonjsHelpers = require('./_commonjsHelpers-5cfcba41.js');
8
+ const colors = require('./colors-38421769.js');
9
+
10
+ var relativeTime = _commonjsHelpers.createCommonjsModule(function (module, exports) {
11
+ !function(r,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
12
+ });
13
+
14
+ const indexCss = ".salon-modal.salon-modal--lookbook-detail .salon-modal--close{display:none !important}.salon-modal.salon-modal--lookbook-detail .salon-modal--content{background-color:#fff;position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1000;overflow-y:auto}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:240px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnails{text-align:center}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{display:inline-block;margin-top:12px;margin-right:12px;height:40px;width:60px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--button{border:none;position:absolute;top:50%;z-index:20;height:40px;width:40px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px;-moz-transform:translate(0, -50%);-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--prev{left:24px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--next{right:24px}@media (min-width: 768px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:360px !important}}@media (min-width: 992px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:480px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{height:56px;width:72px}}";
15
+
16
+ services.dayjs_min.extend(relativeTime);
17
+ let StyleDetail = class {
18
+ constructor(hostRef) {
19
+ index.registerInstance(this, hostRef);
20
+ this.isModalOpen = true;
21
+ this.currentMediaIdx = 0;
22
+ this.albumMedias = [];
23
+ this.similarStyles = [];
24
+ this.totalComments = 0;
25
+ this.lookbookComments = [];
26
+ }
27
+ componentWillLoad() {
28
+ this.injectSDK();
29
+ if (!!this.salonLookbook) {
30
+ this.lookbookInfo = JSON.parse(this.salonLookbook);
31
+ this.fetchData();
32
+ }
33
+ }
34
+ componentDidRender() {
35
+ this.setupGridLayout();
36
+ }
37
+ injectSDK() {
38
+ return new Promise((resolve) => {
39
+ const script = document.createElement('script');
40
+ script.type = 'text/javascript';
41
+ script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
42
+ document.body.appendChild(script);
43
+ return resolve(true);
44
+ });
45
+ }
46
+ setupGridLayout() {
47
+ if (!this.isLayoutSetup && this.similarStyles.length > 0 && document.querySelector('#similar-styles--grid')) {
48
+ const script = document.createElement('script');
49
+ script.type = 'text/javascript';
50
+ script.innerHTML = `
51
+ var masonry = new Macy({
52
+ container: '#similar-styles--grid',
53
+ useContainerForBreakpoints: true,
54
+ margin: 16,
55
+ columns: 2,
56
+ });
57
+ `;
58
+ document.body.appendChild(script);
59
+ this.isLayoutSetup = true;
60
+ }
61
+ }
62
+ fetchData() {
63
+ try {
64
+ const promises = [
65
+ services.HttpService().fetchStyleDetail(this.lookbookInfo.id).then(response => {
66
+ const { styleInfo, similarStyles } = response;
67
+ this.similarStyles = similarStyles;
68
+ if (styleInfo) {
69
+ this.lookbookInfo = styleInfo;
70
+ this.albumMedias = styleInfo.albumMedias || [];
71
+ this.currentMedia = (styleInfo.albumMedias || [])[0];
72
+ }
73
+ }),
74
+ services.HttpService().fetchStyleComments(this.lookbookInfo.id).then(response => {
75
+ this.totalComments = response.total;
76
+ this.lookbookComments = response.data;
77
+ }),
78
+ ];
79
+ return Promise.all(promises);
80
+ }
81
+ catch (e) { }
82
+ }
83
+ closeModal() {
84
+ this.isModalOpen = false;
85
+ const el = document.querySelector('style-detail');
86
+ el.remove();
87
+ }
88
+ onClickLookbook(style) {
89
+ const elLookbookModal = document.createElement('div');
90
+ elLookbookModal.innerHTML = `
91
+ <style-detail
92
+ salon-id=${this.salonId}
93
+ salon-lookbook='${JSON.stringify(style)}'
94
+ ></style-detail>
95
+ `;
96
+ document.body.appendChild(elLookbookModal);
97
+ }
98
+ onClickPrev() {
99
+ if (this.currentMediaIdx === 0) {
100
+ this.currentMediaIdx = this.albumMedias.length - 1;
101
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
102
+ }
103
+ else {
104
+ this.currentMediaIdx = this.currentMediaIdx - 1;
105
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
106
+ }
107
+ }
108
+ onClickNext() {
109
+ if (this.currentMediaIdx === this.albumMedias.length - 1) {
110
+ this.currentMediaIdx = 0;
111
+ this.currentMedia = this.albumMedias[0];
112
+ }
113
+ else {
114
+ this.currentMediaIdx = this.currentMediaIdx + 1;
115
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
116
+ }
117
+ }
118
+ render() {
119
+ const { createdDate, totalView, totalLike, totalBooking, album, salon, stylist, } = this.lookbookInfo;
120
+ if (this.isModalOpen) {
121
+ const { caption, description, mediaUrl } = this.currentMedia || {};
122
+ const isVideo = services.isVideoMedia((this.currentMedia || {}));
123
+ return (index.h("div", { class: "salon-modal salon-modal--lookbook-detail" }, index.h("div", { class: "salon-modal--inner" }, index.h("div", { class: "salon-modal--content" }, index.h("div", { class: "style-detail" }, index.h("div", { class: "style-detail--header" }, index.h("div", { style: {
124
+ position: 'relative',
125
+ overflow: 'hidden',
126
+ } }, index.h("div", { style: Object.assign({ backgroundColor: colors.Colors.Gray01, backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: '0 0', filter: 'blur(30px)', position: 'absolute', inset: '0', zIndex: '1' }, this.currentMedia && !services.isVideoMedia(this.currentMedia) ? { backgroundImage: `url("${this.currentMedia.imageThumb}")` } : {}) }), index.h("div", { style: {
127
+ zIndex: '2',
128
+ position: 'relative',
129
+ width: '100%',
130
+ backgroundColor: 'rgba(0, 0, 0, 0.25)',
131
+ padding: '12px 16px',
132
+ overflow: 'hidden',
133
+ } }, index.h("span", { style: {
134
+ color: colors.Colors.White,
135
+ border: 'none',
136
+ display: 'flex',
137
+ alignItems: 'center',
138
+ justifyContent: 'center',
139
+ height: '32px',
140
+ } }, index.h("span", null, this.currentMediaIdx + 1, " / ", this.albumMedias.length)), index.h("div", { style: {
141
+ display: 'flex',
142
+ alignItems: 'center',
143
+ position: 'absolute',
144
+ right: '16px',
145
+ top: '50%',
146
+ transform: 'translate(0, -50%)',
147
+ } }, index.h("button", { type: "text", class: "btn btn-light", style: {
148
+ backgroundColor: colors.Colors.White,
149
+ borderColor: colors.Colors.White,
150
+ border: 'none',
151
+ borderRadius: '50px',
152
+ display: 'flex',
153
+ alignItems: 'center',
154
+ justifyContent: 'center',
155
+ height: '32px',
156
+ width: '32px',
157
+ marginLeft: '12px',
158
+ }, onClick: () => this.closeModal() }, index.h("i", { class: "ri-close-fill", style: { fontSize: '16px', lineHeight: '1' } })))), index.h("div", { style: { position: 'relative', zIndex: "3" } }, index.h("div", { class: "style-detail--slides", style: {
159
+ marginTop: '16px',
160
+ marginBottom: '12px',
161
+ } }, index.h("div", { class: "style-detail--slides--image", style: {
162
+ width: '100%',
163
+ position: 'relative',
164
+ height: '360px',
165
+ } }, isVideo && (index.h("video", { muted: true, controls: true, width: "100%", height: "100%" }, index.h("source", { src: mediaUrl, type: "video/mp4" }))), !isVideo && (index.h("div", { style: {
166
+ position: 'absolute',
167
+ inset: '0',
168
+ zIndex: '2',
169
+ display: 'flex',
170
+ alignItems: 'center',
171
+ justifyContent: 'center',
172
+ } }, index.h("img", { src: mediaUrl, alt: caption, style: {
173
+ objectFit: 'contain',
174
+ maxHeight: '100%',
175
+ maxWidth: '100%',
176
+ } })))), index.h("div", { class: "style-detail--slides--thumbnails", style: {
177
+ width: '100%',
178
+ position: 'relative',
179
+ } }, this.albumMedias.map((media, idx) => {
180
+ const isStyleVideo = services.isVideoMedia(media);
181
+ return (index.h("div", { class: "style-detail--slides--thumbnail", style: Object.assign(Object.assign({ backgroundColor: colors.Colors.Gray01, borderRadius: '4px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, this.currentMediaIdx !== idx ? { opacity: '0.75' } : {}), !isStyleVideo ? {
182
+ backgroundImage: `url("${media.imageThumb || media.imageThumbMedium}")`,
183
+ backgroundRepeat: 'no-repeat',
184
+ backgroundPosition: 'center center',
185
+ backgroundSize: 'cover',
186
+ } : {}), onClick: () => {
187
+ this.currentMedia = media;
188
+ this.currentMediaIdx = idx;
189
+ } }, isStyleVideo && (index.h("div", null, index.h("video", { muted: true, width: "100%", height: "100%", poster: media.imageThumb }, index.h("source", { src: media.mediaUrl, type: "video/mp4" })), index.h("i", { class: "ri-play-circle-fill", style: {
190
+ fontSize: '48px',
191
+ color: colors.Colors.TextColor,
192
+ position: 'absolute',
193
+ left: '50%',
194
+ top: '50%',
195
+ transform: 'translate(-50%, -50%)',
196
+ } })))));
197
+ }))), this.albumMedias.length > 1 && (index.h("div", null, index.h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--prev", onClick: () => this.onClickPrev() }, index.h("i", { class: "ri-arrow-left-line", style: { color: colors.Colors.TextColor, fontSize: '18px' } })), index.h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--next", onClick: () => this.onClickNext() }, index.h("i", { class: "ri-arrow-right-line", style: { color: colors.Colors.TextColor, fontSize: '18px' } }))))))), index.h("div", { class: "style-detail--content" }, index.h("div", { class: "container" }, index.h("div", { style: {
198
+ paddingBottom: '24px',
199
+ paddingTop: '24px',
200
+ } }, index.h("div", { class: "row" }, index.h("div", { class: this.similarStyles.length > 0 ? 'col-md-8' : 'col-md-12', style: { marginBottom: '24px' } }, index.h("div", { class: "row" }, salon && (index.h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, index.h("div", { style: {
201
+ backgroundColor: colors.Colors.Red01,
202
+ borderRadius: '4px',
203
+ padding: '8px',
204
+ display: 'flex',
205
+ alignItems: 'center',
206
+ justifyContent: 'space-between',
207
+ } }, index.h("div", { style: { paddingLeft: '8px' } }, index.h("div", { style: { color: colors.Colors.Gray05, fontSize: '12px' } }, "At salon"), index.h("div", { style: {
208
+ color: colors.Colors.Secondary,
209
+ fontSize: '20px',
210
+ lineHeight: '24px',
211
+ } }, salon.businessName)), index.h("div", { style: {
212
+ backgroundImage: `url("${services.getSalonImage(salon)}")`,
213
+ backgroundColor: colors.Colors.Red02,
214
+ backgroundSize: 'cover',
215
+ backgroundRepeat: 'no-repeat',
216
+ backgroundPosition: '0 0',
217
+ borderRadius: '4px',
218
+ height: '48px',
219
+ width: '48px',
220
+ } })))), stylist && stylist.id && (index.h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, index.h("div", { style: {
221
+ backgroundColor: colors.Colors.Yellow01,
222
+ borderRadius: '4px',
223
+ padding: '8px',
224
+ display: 'flex',
225
+ alignItems: 'center',
226
+ justifyContent: 'space-between',
227
+ } }, index.h("div", { style: { paddingLeft: '8px' } }, index.h("div", { style: { color: colors.Colors.Gray05, fontSize: '12px' } }, "By stylist"), index.h("div", { style: {
228
+ color: colors.Colors.Secondary,
229
+ fontSize: '20px',
230
+ lineHeight: '24px',
231
+ } }, stylist.fullName)), index.h("div", { style: {
232
+ backgroundImage: `url("${stylist.avatar}")`,
233
+ backgroundColor: colors.Colors.Yellow02,
234
+ backgroundSize: 'cover',
235
+ backgroundRepeat: 'no-repeat',
236
+ backgroundPosition: '0 0',
237
+ borderRadius: '4px',
238
+ height: '48px',
239
+ width: '48px',
240
+ } }))))), index.h("div", { style: {
241
+ borderBottom: `1px solid ${colors.Colors.Gray02}`,
242
+ borderTop: `1px solid ${colors.Colors.Gray02}`,
243
+ display: 'flex',
244
+ alignItems: 'center',
245
+ justifyContent: 'space-between',
246
+ paddingBottom: '16px',
247
+ paddingTop: '16px',
248
+ } }, index.h("div", { style: {
249
+ display: 'flex',
250
+ alignItems: 'center',
251
+ justifyContent: 'space-around',
252
+ flexShrink: '1',
253
+ flexGrow: '1',
254
+ } }, index.h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, index.h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalLike), index.h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "faves")), index.h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, index.h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalBooking), index.h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "booked")), index.h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, index.h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalView), index.h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "views")), index.h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, index.h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, this.totalComments), index.h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "comments")))), (caption || description) && (index.h("div", { style: { paddingTop: '24px' } }, index.h("div", { style: { color: colors.Colors.Gray04, fontSize: '14px' } }, createdDate && services.dayjs_min(createdDate).format(services.shortDateYearFormat)), index.h("div", { style: { fontSize: '24px' } }, caption), index.h("div", { style: {
255
+ fontSize: '16px',
256
+ paddingTop: caption ? '16px' : '0',
257
+ } }, description))), album && album.tags.length > 0 && (index.h("div", { style: {
258
+ paddingTop: '24px',
259
+ marginBottom: '-12px',
260
+ } }, album.tags.map((tag, idx) => (index.h("button", { class: "btn btn-light", key: `album--tag-${idx}`, style: {
261
+ backgroundColor: colors.Colors.Gray01,
262
+ borderColor: colors.Colors.Gray01,
263
+ borderRadius: '4px',
264
+ marginRight: '12px',
265
+ marginBottom: '12px',
266
+ } }, tag))))), index.h("div", { style: { marginTop: '32px' } }, this.lookbookComments && this.lookbookComments.length > 0 && (index.h("div", null, index.h("div", { style: { fontWeight: '600', marginBottom: '8px' } }, this.totalComments, " ", this.totalComments === 1 ? 'comment' : 'comments'), index.h("div", { class: "view view--style-comments", style: {
267
+ borderTop: `1px solid ${colors.Colors.Gray02}`,
268
+ paddingTop: '24px',
269
+ paddingBottom: '24px',
270
+ } }, this.lookbookComments.map((comment, idx) => {
271
+ const { user, title, description, createdDate } = comment;
272
+ return (index.h("div", { key: `style-info--comment-${idx}`, style: idx > 0 ? {
273
+ borderTop: `1px solid ${colors.Colors.Gray02}`,
274
+ marginTop: '24px',
275
+ paddingTop: '24px',
276
+ } : {} }, index.h("div", { style: { overflow: 'hidden' } }, index.h("user-avatar", { size: 48, avatar: user.avatar, name: index.h("div", null, index.h("div", { style: { color: colors.Colors.Gray04, lineHeight: '1', fontSize: '12px', fontWeight: '400' } }, services.dayjs_min(createdDate).fromNow()), index.h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName)), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), index.h("div", { style: {
277
+ color: colors.Colors.Black,
278
+ fontSize: '16px',
279
+ paddingTop: '16px',
280
+ } }, title), description && (index.h("div", { style: {
281
+ color: colors.Colors.Gray05,
282
+ paddingTop: '8px',
283
+ } }, description))));
284
+ })))))), index.h("div", { class: "col-md-4", style: { marginBottom: '24px' } }, index.h("div", { class: "block block--similar-styles" }, this.similarStyles.length > 0 && (index.h("div", { class: "block--content" }, index.h("h3", { style: {
285
+ lineHeight: '1.2',
286
+ fontSize: '24px',
287
+ color: colors.Colors.Secondary,
288
+ } }, "More like this"), index.h("div", { style: { marginTop: '16px' } }, index.h("div", { class: "similar-styles--grid", id: "similar-styles--grid" }, this.similarStyles.slice(0, 6).map(style => {
289
+ const { caption, imageThumbMedium, owner } = style;
290
+ return (index.h("div", { class: "similar-styles--grid-item", onClick: () => {
291
+ this.closeModal();
292
+ this.onClickLookbook(style);
293
+ } }, index.h("div", { class: "card", style: {
294
+ background: 'none',
295
+ border: 'none',
296
+ cursor: 'pointer',
297
+ } }, index.h("div", { class: "similar-styles--grid-item--image", style: {
298
+ borderRadius: '8px',
299
+ overflow: 'hidden',
300
+ minHeight: '80px',
301
+ background: colors.Colors.Gray01,
302
+ } }, index.h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })), owner && (index.h("div", { class: "card-body", style: { paddingLeft: '0' } }, index.h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
303
+ }))))))))))))))));
304
+ }
305
+ return null;
306
+ }
307
+ };
308
+ StyleDetail.style = indexCss;
309
+
310
+ exports.style_detail = StyleDetail;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7d179a70.js');
6
- const colors = require('./colors-7f354880.js');
5
+ const index = require('./index-e6bea8f5.js');
6
+ const colors = require('./colors-38421769.js');
7
7
 
8
8
  const indexCss = "";
9
9
 
@@ -15,7 +15,7 @@ let UserAvatar = class {
15
15
  render() {
16
16
  return (index.h("div", { style: { display: "flex", alignItems: "center" } }, this.avatar && (index.h("div", { style: {
17
17
  backgroundImage: `url("${this.avatar}")`,
18
- backgroundColor: colors.Colors.Gray06,
18
+ backgroundColor: colors.Colors.Gray01,
19
19
  backgroundPosition: 'center center',
20
20
  backgroundSize: 'cover',
21
21
  borderRadius: '50%',
@@ -23,7 +23,7 @@ let UserAvatar = class {
23
23
  width: `${this.size}px`,
24
24
  minWidth: `${this.size}px`,
25
25
  } })), !this.avatar && (index.h("div", { style: {
26
- backgroundColor: colors.Colors.Gray06,
26
+ backgroundColor: colors.Colors.Gray01,
27
27
  backgroundPosition: 'center center',
28
28
  backgroundSize: 'cover',
29
29
  borderRadius: '50%',
File without changes
@@ -3,19 +3,19 @@
3
3
  "./components/google-map/index.js",
4
4
  "./components/salon-booking/index.js",
5
5
  "./components/salon-booking/salon-booking-modal.js",
6
- "./components/salon-contact/index.js",
7
6
  "./components/salon-gift-card/index.js",
8
7
  "./components/salon-gift-card/salon-gift-card-modal.js",
9
8
  "./components/salon-info/index.js",
10
9
  "./components/salon-latest-reviews/index.js",
10
+ "./components/salon-latest-styles/index.js",
11
11
  "./components/salon-locations/index.js",
12
12
  "./components/salon-lookbook/index.js",
13
13
  "./components/salon-ranking/index.js",
14
14
  "./components/salon-reviews/index.js",
15
15
  "./components/salon-schedules/index.js",
16
16
  "./components/salon-services/index.js",
17
- "./components/salon-styles/index.js",
18
17
  "./components/salon-stylists/index.js",
18
+ "./components/style-detail/index.js",
19
19
  "./components/user-avatar/index.js"
20
20
  ],
21
21
  "compiler": {
@@ -1,4 +1,3 @@
1
- #google-map-container,
2
1
  google-map {
3
2
  display: block;
4
3
  width: 100%;
@@ -0,0 +1,86 @@
1
+ import { Component, getAssetPath, h, Prop } from '@stencil/core';
2
+ import { Colors } from '../../constants/colors';
3
+ export class GoogleMap {
4
+ render() {
5
+ const mapPlaceholder = getAssetPath('./assets/map--placeholder.jpeg');
6
+ return (h("div", { style: {
7
+ backgroundImage: `url("${mapPlaceholder}")`,
8
+ backgroundColor: Colors.Gray01,
9
+ backgroundPosition: 'center center',
10
+ backgroundRepeat: 'no-repeat',
11
+ backgroundSize: 'cover',
12
+ borderRadius: '8px',
13
+ position: 'relative',
14
+ height: '296px',
15
+ } },
16
+ h("div", { style: {
17
+ position: 'absolute',
18
+ left: '50%',
19
+ top: '50%',
20
+ transform: 'translate(-50%, -50%)',
21
+ } },
22
+ h("a", { target: "_blank", rel: "noopener noreferrer", href: `https://www.google.com/maps/search/?api=1&query=${this.locationAddress}`, style: {
23
+ backgroundColor: Colors.Red01,
24
+ border: `1px solid ${Colors.Red02}`,
25
+ borderRadius: '4px',
26
+ color: Colors.TextColor,
27
+ padding: '12px',
28
+ display: 'flex',
29
+ flexWrap: 'wrap',
30
+ height: 'auto',
31
+ width: 'auto',
32
+ whiteSpace: 'normal',
33
+ textAlign: 'left',
34
+ maxWidth: '320px',
35
+ textDecoration: 'none',
36
+ } },
37
+ this.locationName && h("span", { style: { fontSize: '16px', marginBottom: '4px' } }, this.locationName),
38
+ this.locationAddress && h("span", { style: { fontSize: '12px' } }, this.locationAddress)),
39
+ h("div", { style: { marginTop: '8px', textAlign: 'center' } },
40
+ h("i", { class: "ri-map-pin-fill", style: { fontSize: '24px' } })))));
41
+ }
42
+ static get is() { return "google-map"; }
43
+ static get originalStyleUrls() { return {
44
+ "$": ["index.less"]
45
+ }; }
46
+ static get styleUrls() { return {
47
+ "$": ["index.css"]
48
+ }; }
49
+ static get assetsDirs() { return ["assets"]; }
50
+ static get properties() { return {
51
+ "locationName": {
52
+ "type": "string",
53
+ "mutable": false,
54
+ "complexType": {
55
+ "original": "string",
56
+ "resolved": "string",
57
+ "references": {}
58
+ },
59
+ "required": false,
60
+ "optional": true,
61
+ "docs": {
62
+ "tags": [],
63
+ "text": ""
64
+ },
65
+ "attribute": "location-name",
66
+ "reflect": false
67
+ },
68
+ "locationAddress": {
69
+ "type": "string",
70
+ "mutable": false,
71
+ "complexType": {
72
+ "original": "string",
73
+ "resolved": "string",
74
+ "references": {}
75
+ },
76
+ "required": false,
77
+ "optional": true,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": ""
81
+ },
82
+ "attribute": "location-address",
83
+ "reflect": false
84
+ }
85
+ }; }
86
+ }
@@ -1,39 +1,25 @@
1
1
  .salon-modal.salon-modal--booking:before {
2
2
  display: none;
3
3
  }
4
-
5
4
  .salon-modal.salon-modal--booking .salon-modal--inner,
6
5
  .salon-modal.salon-modal--booking .salon-modal--content {
7
6
  max-width: none;
8
7
  width: 100%;
9
8
  height: 100%;
10
9
  }
11
-
12
10
  .salon-modal.salon-modal--booking .salon-modal--close {
13
- width: 48px;
14
- height: 48px;
15
- right: 10px;
16
- top: 12px;
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;
17
19
  }
18
-
19
-
20
- @media (min-width: 576px) {
21
- .salon-modal.salon-modal--booking .salon-modal--close {
22
- right: 16px;
23
- }
24
- }
25
-
26
-
27
20
  @media (min-width: 768px) {
28
21
  .salon-modal.salon-modal--booking .salon-modal--close {
29
- right: 24px;
30
- }
31
- }
32
-
33
-
34
- @media (min-width: 1200px) {
35
- .salon-modal.salon-modal--booking .salon-modal--close {
36
- right: 50%;
37
- margin-right: -585px;
22
+ right: 20px;
23
+ top: 20px;
38
24
  }
39
25
  }
@@ -1,9 +1,12 @@
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 SalonBooking {
3
6
  constructor() {
7
+ this.buttonClass = '';
4
8
  this.buttonText = 'Book now';
5
- this.buttonClass = 'btn btn-primary';
6
- this.primaryColor = '#d47b99';
9
+ this.primaryColor = Colors.Primary;
7
10
  }
8
11
  openModal() {
9
12
  const elBookingModal = document.createElement('div');
@@ -16,13 +19,28 @@ export class SalonBooking {
16
19
  document.body.appendChild(elBookingModal);
17
20
  }
18
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
+ }
19
37
  return (h("div", { class: "salon-booking" },
20
38
  h("div", { class: "salon-booking--button" },
21
- 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))));
22
40
  }
23
41
  static get is() { return "salon-booking"; }
24
42
  static get originalStyleUrls() { return {
25
- "$": ["index.css"]
43
+ "$": ["index.less"]
26
44
  }; }
27
45
  static get styleUrls() { return {
28
46
  "$": ["index.css"]
@@ -45,7 +63,7 @@ export class SalonBooking {
45
63
  "attribute": "salon-id",
46
64
  "reflect": false
47
65
  },
48
- "buttonText": {
66
+ "buttonClass": {
49
67
  "type": "string",
50
68
  "mutable": false,
51
69
  "complexType": {
@@ -59,11 +77,11 @@ export class SalonBooking {
59
77
  "tags": [],
60
78
  "text": ""
61
79
  },
62
- "attribute": "button-text",
80
+ "attribute": "button-class",
63
81
  "reflect": false,
64
- "defaultValue": "'Book now'"
82
+ "defaultValue": "''"
65
83
  },
66
- "buttonClass": {
84
+ "buttonText": {
67
85
  "type": "string",
68
86
  "mutable": false,
69
87
  "complexType": {
@@ -77,9 +95,9 @@ export class SalonBooking {
77
95
  "tags": [],
78
96
  "text": ""
79
97
  },
80
- "attribute": "button-class",
98
+ "attribute": "button-text",
81
99
  "reflect": false,
82
- "defaultValue": "'btn btn-primary'"
100
+ "defaultValue": "'Book now'"
83
101
  },
84
102
  "primaryColor": {
85
103
  "type": "string",
@@ -97,7 +115,7 @@ export class SalonBooking {
97
115
  },
98
116
  "attribute": "primary-color",
99
117
  "reflect": false,
100
- "defaultValue": "'#d47b99'"
118
+ "defaultValue": "Colors.Primary"
101
119
  }
102
120
  }; }
103
121
  }
@@ -1,22 +1,28 @@
1
1
  import { Component, Prop, h, State } from '@stencil/core';
2
+ import { Colors } from '../../constants/colors';
2
3
  export class SalonBookingModal {
3
4
  constructor() {
4
- this.primaryColor = '#d47b99';
5
+ this.primaryColor = Colors.Primary;
5
6
  this.redirectUrl = window.btoa(window.location.href);
6
7
  this.isModalOpen = true;
7
8
  }
9
+ closeModal() {
10
+ this.isModalOpen = false;
11
+ const el = document.querySelector('salon-booking-modal');
12
+ el.remove();
13
+ }
8
14
  render() {
9
15
  const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
10
16
  return (h("div", { class: "salon-booking--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--booking" },
11
- h("div", { class: "salon-modal--backdrop", onClick: () => this.isModalOpen = false }),
12
- h("div", { class: "salon-modal--close", onClick: () => this.isModalOpen = false }),
17
+ h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }),
18
+ h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }),
13
19
  h("div", { class: "salon-modal--inner" },
14
20
  h("div", { class: "salon-modal--content" },
15
- h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/booking?salonId=${this.salonId}&primaryColor=${primaryColor}&redirectUrl=${this.redirectUrl}` })))))));
21
+ h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/booking?salonId=${this.salonId}&primaryColor=${primaryColor}&closeAble=false` })))))));
16
22
  }
17
23
  static get is() { return "salon-booking-modal"; }
18
24
  static get originalStyleUrls() { return {
19
- "$": ["index.css"]
25
+ "$": ["index.less"]
20
26
  }; }
21
27
  static get styleUrls() { return {
22
28
  "$": ["index.css"]
@@ -55,7 +61,7 @@ export class SalonBookingModal {
55
61
  },
56
62
  "attribute": "primary-color",
57
63
  "reflect": false,
58
- "defaultValue": "'#d47b99'"
64
+ "defaultValue": "Colors.Primary"
59
65
  },
60
66
  "redirectUrl": {
61
67
  "type": "string",