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,461 @@
1
+ import { Component, Prop, h, State, Method } from '@stencil/core';
2
+ import dayjs from 'dayjs';
3
+ import relativeTime from 'dayjs/plugin/relativeTime';
4
+ import { isVideoMedia } from '../../types/style';
5
+ import { Colors } from '../../constants/colors';
6
+ import HttpService from '../../services/services';
7
+ import { getSalonImage } from '../../types/salon';
8
+ import { shortDateYearFormat } from '../../types/common';
9
+ dayjs.extend(relativeTime);
10
+ export class StyleDetail {
11
+ constructor() {
12
+ this.isModalOpen = true;
13
+ this.currentMediaIdx = 0;
14
+ this.albumMedias = [];
15
+ this.similarStyles = [];
16
+ this.totalComments = 0;
17
+ this.lookbookComments = [];
18
+ }
19
+ componentWillLoad() {
20
+ this.injectSDK();
21
+ if (!!this.salonLookbook) {
22
+ this.lookbookInfo = JSON.parse(this.salonLookbook);
23
+ this.fetchData();
24
+ }
25
+ }
26
+ componentDidRender() {
27
+ this.setupGridLayout();
28
+ }
29
+ injectSDK() {
30
+ return new Promise((resolve) => {
31
+ const script = document.createElement('script');
32
+ script.type = 'text/javascript';
33
+ script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
34
+ document.body.appendChild(script);
35
+ return resolve(true);
36
+ });
37
+ }
38
+ setupGridLayout() {
39
+ if (!this.isLayoutSetup && this.similarStyles.length > 0 && document.querySelector('#similar-styles--grid')) {
40
+ const script = document.createElement('script');
41
+ script.type = 'text/javascript';
42
+ script.innerHTML = `
43
+ var masonry = new Macy({
44
+ container: '#similar-styles--grid',
45
+ useContainerForBreakpoints: true,
46
+ margin: 16,
47
+ columns: 2,
48
+ });
49
+ `;
50
+ document.body.appendChild(script);
51
+ this.isLayoutSetup = true;
52
+ }
53
+ }
54
+ fetchData() {
55
+ try {
56
+ const promises = [
57
+ HttpService().fetchStyleDetail(this.lookbookInfo.id).then(response => {
58
+ const { styleInfo, similarStyles } = response;
59
+ this.similarStyles = similarStyles;
60
+ if (styleInfo) {
61
+ this.lookbookInfo = styleInfo;
62
+ this.albumMedias = styleInfo.albumMedias || [];
63
+ this.currentMedia = (styleInfo.albumMedias || [])[0];
64
+ }
65
+ }),
66
+ HttpService().fetchStyleComments(this.lookbookInfo.id).then(response => {
67
+ this.totalComments = response.total;
68
+ this.lookbookComments = response.data;
69
+ }),
70
+ ];
71
+ return Promise.all(promises);
72
+ }
73
+ catch (e) { }
74
+ }
75
+ closeModal() {
76
+ this.isModalOpen = false;
77
+ const el = document.querySelector('style-detail');
78
+ el.remove();
79
+ }
80
+ onClickLookbook(style) {
81
+ const elLookbookModal = document.createElement('div');
82
+ elLookbookModal.innerHTML = `
83
+ <style-detail
84
+ salon-id=${this.salonId}
85
+ salon-lookbook='${JSON.stringify(style)}'
86
+ ></style-detail>
87
+ `;
88
+ document.body.appendChild(elLookbookModal);
89
+ }
90
+ onClickPrev() {
91
+ if (this.currentMediaIdx === 0) {
92
+ this.currentMediaIdx = this.albumMedias.length - 1;
93
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
94
+ }
95
+ else {
96
+ this.currentMediaIdx = this.currentMediaIdx - 1;
97
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
98
+ }
99
+ }
100
+ onClickNext() {
101
+ if (this.currentMediaIdx === this.albumMedias.length - 1) {
102
+ this.currentMediaIdx = 0;
103
+ this.currentMedia = this.albumMedias[0];
104
+ }
105
+ else {
106
+ this.currentMediaIdx = this.currentMediaIdx + 1;
107
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
108
+ }
109
+ }
110
+ render() {
111
+ const { createdDate, totalView, totalLike, totalBooking, album, salon, stylist, } = this.lookbookInfo;
112
+ if (this.isModalOpen) {
113
+ const { caption, description, mediaUrl } = this.currentMedia || {};
114
+ const isVideo = isVideoMedia((this.currentMedia || {}));
115
+ return (h("div", { class: "salon-modal salon-modal--lookbook-detail" },
116
+ h("div", { class: "salon-modal--inner" },
117
+ h("div", { class: "salon-modal--content" },
118
+ h("div", { class: "style-detail" },
119
+ h("div", { class: "style-detail--header" },
120
+ h("div", { style: {
121
+ position: 'relative',
122
+ overflow: 'hidden',
123
+ } },
124
+ h("div", { style: Object.assign({ backgroundColor: Colors.Gray01, backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: '0 0', filter: 'blur(30px)', position: 'absolute', inset: '0', zIndex: '1' }, this.currentMedia && !isVideoMedia(this.currentMedia) ? { backgroundImage: `url("${this.currentMedia.imageThumb}")` } : {}) }),
125
+ h("div", { style: {
126
+ zIndex: '2',
127
+ position: 'relative',
128
+ width: '100%',
129
+ backgroundColor: 'rgba(0, 0, 0, 0.25)',
130
+ padding: '12px 16px',
131
+ overflow: 'hidden',
132
+ } },
133
+ h("span", { style: {
134
+ color: Colors.White,
135
+ border: 'none',
136
+ display: 'flex',
137
+ alignItems: 'center',
138
+ justifyContent: 'center',
139
+ height: '32px',
140
+ } },
141
+ h("span", null,
142
+ this.currentMediaIdx + 1,
143
+ " / ",
144
+ this.albumMedias.length)),
145
+ h("div", { style: {
146
+ display: 'flex',
147
+ alignItems: 'center',
148
+ position: 'absolute',
149
+ right: '16px',
150
+ top: '50%',
151
+ transform: 'translate(0, -50%)',
152
+ } },
153
+ h("button", { type: "text", class: "btn btn-light", style: {
154
+ backgroundColor: Colors.White,
155
+ borderColor: Colors.White,
156
+ border: 'none',
157
+ borderRadius: '50px',
158
+ display: 'flex',
159
+ alignItems: 'center',
160
+ justifyContent: 'center',
161
+ height: '32px',
162
+ width: '32px',
163
+ marginLeft: '12px',
164
+ }, onClick: () => this.closeModal() },
165
+ h("i", { class: "ri-close-fill", style: { fontSize: '16px', lineHeight: '1' } })))),
166
+ h("div", { style: { position: 'relative', zIndex: "3" } },
167
+ h("div", { class: "style-detail--slides", style: {
168
+ marginTop: '16px',
169
+ marginBottom: '12px',
170
+ } },
171
+ h("div", { class: "style-detail--slides--image", style: {
172
+ width: '100%',
173
+ position: 'relative',
174
+ height: '360px',
175
+ } },
176
+ isVideo && (h("video", { muted: true, controls: true, width: "100%", height: "100%" },
177
+ h("source", { src: mediaUrl, type: "video/mp4" }))),
178
+ !isVideo && (h("div", { style: {
179
+ position: 'absolute',
180
+ inset: '0',
181
+ zIndex: '2',
182
+ display: 'flex',
183
+ alignItems: 'center',
184
+ justifyContent: 'center',
185
+ } },
186
+ h("img", { src: mediaUrl, alt: caption, style: {
187
+ objectFit: 'contain',
188
+ maxHeight: '100%',
189
+ maxWidth: '100%',
190
+ } })))),
191
+ h("div", { class: "style-detail--slides--thumbnails", style: {
192
+ width: '100%',
193
+ position: 'relative',
194
+ } }, this.albumMedias.map((media, idx) => {
195
+ const isStyleVideo = isVideoMedia(media);
196
+ return (h("div", { class: "style-detail--slides--thumbnail", style: Object.assign(Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '4px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, this.currentMediaIdx !== idx ? { opacity: '0.75' } : {}), !isStyleVideo ? {
197
+ backgroundImage: `url("${media.imageThumb || media.imageThumbMedium}")`,
198
+ backgroundRepeat: 'no-repeat',
199
+ backgroundPosition: 'center center',
200
+ backgroundSize: 'cover',
201
+ } : {}), onClick: () => {
202
+ this.currentMedia = media;
203
+ this.currentMediaIdx = idx;
204
+ } }, isStyleVideo && (h("div", null,
205
+ h("video", { muted: true, width: "100%", height: "100%", poster: media.imageThumb },
206
+ h("source", { src: media.mediaUrl, type: "video/mp4" })),
207
+ h("i", { class: "ri-play-circle-fill", style: {
208
+ fontSize: '48px',
209
+ color: Colors.TextColor,
210
+ position: 'absolute',
211
+ left: '50%',
212
+ top: '50%',
213
+ transform: 'translate(-50%, -50%)',
214
+ } })))));
215
+ }))),
216
+ this.albumMedias.length > 1 && (h("div", null,
217
+ h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--prev", onClick: () => this.onClickPrev() },
218
+ h("i", { class: "ri-arrow-left-line", style: { color: Colors.TextColor, fontSize: '18px' } })),
219
+ h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--next", onClick: () => this.onClickNext() },
220
+ h("i", { class: "ri-arrow-right-line", style: { color: Colors.TextColor, fontSize: '18px' } }))))))),
221
+ h("div", { class: "style-detail--content" },
222
+ h("div", { class: "container" },
223
+ h("div", { style: {
224
+ paddingBottom: '24px',
225
+ paddingTop: '24px',
226
+ } },
227
+ h("div", { class: "row" },
228
+ h("div", { class: this.similarStyles.length > 0 ? 'col-md-8' : 'col-md-12', style: { marginBottom: '24px' } },
229
+ h("div", { class: "row" },
230
+ salon && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } },
231
+ h("div", { style: {
232
+ backgroundColor: Colors.Red01,
233
+ borderRadius: '4px',
234
+ padding: '8px',
235
+ display: 'flex',
236
+ alignItems: 'center',
237
+ justifyContent: 'space-between',
238
+ } },
239
+ h("div", { style: { paddingLeft: '8px' } },
240
+ h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "At salon"),
241
+ h("div", { style: {
242
+ color: Colors.Secondary,
243
+ fontSize: '20px',
244
+ lineHeight: '24px',
245
+ } }, salon.businessName)),
246
+ h("div", { style: {
247
+ backgroundImage: `url("${getSalonImage(salon)}")`,
248
+ backgroundColor: Colors.Red02,
249
+ backgroundSize: 'cover',
250
+ backgroundRepeat: 'no-repeat',
251
+ backgroundPosition: '0 0',
252
+ borderRadius: '4px',
253
+ height: '48px',
254
+ width: '48px',
255
+ } })))),
256
+ stylist && stylist.id && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } },
257
+ h("div", { style: {
258
+ backgroundColor: Colors.Yellow01,
259
+ borderRadius: '4px',
260
+ padding: '8px',
261
+ display: 'flex',
262
+ alignItems: 'center',
263
+ justifyContent: 'space-between',
264
+ } },
265
+ h("div", { style: { paddingLeft: '8px' } },
266
+ h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "By stylist"),
267
+ h("div", { style: {
268
+ color: Colors.Secondary,
269
+ fontSize: '20px',
270
+ lineHeight: '24px',
271
+ } }, stylist.fullName)),
272
+ h("div", { style: {
273
+ backgroundImage: `url("${stylist.avatar}")`,
274
+ backgroundColor: Colors.Yellow02,
275
+ backgroundSize: 'cover',
276
+ backgroundRepeat: 'no-repeat',
277
+ backgroundPosition: '0 0',
278
+ borderRadius: '4px',
279
+ height: '48px',
280
+ width: '48px',
281
+ } }))))),
282
+ h("div", { style: {
283
+ borderBottom: `1px solid ${Colors.Gray02}`,
284
+ borderTop: `1px solid ${Colors.Gray02}`,
285
+ display: 'flex',
286
+ alignItems: 'center',
287
+ justifyContent: 'space-between',
288
+ paddingBottom: '16px',
289
+ paddingTop: '16px',
290
+ } },
291
+ h("div", { style: {
292
+ display: 'flex',
293
+ alignItems: 'center',
294
+ justifyContent: 'space-around',
295
+ flexShrink: '1',
296
+ flexGrow: '1',
297
+ } },
298
+ h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } },
299
+ h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalLike),
300
+ h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "faves")),
301
+ h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } },
302
+ h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalBooking),
303
+ h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "booked")),
304
+ h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } },
305
+ h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalView),
306
+ h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "views")),
307
+ h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } },
308
+ h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, this.totalComments),
309
+ h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "comments")))),
310
+ (caption || description) && (h("div", { style: { paddingTop: '24px' } },
311
+ h("div", { style: { color: Colors.Gray04, fontSize: '14px' } }, createdDate && dayjs(createdDate).format(shortDateYearFormat)),
312
+ h("div", { style: { fontSize: '24px' } }, caption),
313
+ h("div", { style: {
314
+ fontSize: '16px',
315
+ paddingTop: caption ? '16px' : '0',
316
+ } }, description))),
317
+ album && album.tags.length > 0 && (h("div", { style: {
318
+ paddingTop: '24px',
319
+ marginBottom: '-12px',
320
+ } }, album.tags.map((tag, idx) => (h("button", { class: "btn btn-light", key: `album--tag-${idx}`, style: {
321
+ backgroundColor: Colors.Gray01,
322
+ borderColor: Colors.Gray01,
323
+ borderRadius: '4px',
324
+ marginRight: '12px',
325
+ marginBottom: '12px',
326
+ } }, tag))))),
327
+ h("div", { style: { marginTop: '32px' } }, this.lookbookComments && this.lookbookComments.length > 0 && (h("div", null,
328
+ h("div", { style: { fontWeight: '600', marginBottom: '8px' } },
329
+ this.totalComments,
330
+ " ",
331
+ this.totalComments === 1 ? 'comment' : 'comments'),
332
+ h("div", { class: "view view--style-comments", style: {
333
+ borderTop: `1px solid ${Colors.Gray02}`,
334
+ paddingTop: '24px',
335
+ paddingBottom: '24px',
336
+ } }, this.lookbookComments.map((comment, idx) => {
337
+ const { user, title, description, createdDate } = comment;
338
+ return (h("div", { key: `style-info--comment-${idx}`, style: idx > 0 ? {
339
+ borderTop: `1px solid ${Colors.Gray02}`,
340
+ marginTop: '24px',
341
+ paddingTop: '24px',
342
+ } : {} },
343
+ h("div", { style: { overflow: 'hidden' } },
344
+ h("user-avatar", { size: 48, avatar: user.avatar, name: h("div", null,
345
+ h("div", { style: { color: Colors.Gray04, lineHeight: '1', fontSize: '12px', fontWeight: '400' } }, dayjs(createdDate).fromNow()),
346
+ h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName)), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })),
347
+ h("div", { style: {
348
+ color: Colors.Black,
349
+ fontSize: '16px',
350
+ paddingTop: '16px',
351
+ } }, title),
352
+ description && (h("div", { style: {
353
+ color: Colors.Gray05,
354
+ paddingTop: '8px',
355
+ } }, description))));
356
+ })))))),
357
+ h("div", { class: "col-md-4", style: { marginBottom: '24px' } },
358
+ h("div", { class: "block block--similar-styles" }, this.similarStyles.length > 0 && (h("div", { class: "block--content" },
359
+ h("h3", { style: {
360
+ lineHeight: '1.2',
361
+ fontSize: '24px',
362
+ color: Colors.Secondary,
363
+ } }, "More like this"),
364
+ h("div", { style: { marginTop: '16px' } },
365
+ h("div", { class: "similar-styles--grid", id: "similar-styles--grid" }, this.similarStyles.slice(0, 6).map(style => {
366
+ const { caption, imageThumbMedium, owner } = style;
367
+ return (h("div", { class: "similar-styles--grid-item", onClick: () => {
368
+ this.closeModal();
369
+ this.onClickLookbook(style);
370
+ } },
371
+ h("div", { class: "card", style: {
372
+ background: 'none',
373
+ border: 'none',
374
+ cursor: 'pointer',
375
+ } },
376
+ h("div", { class: "similar-styles--grid-item--image", style: {
377
+ borderRadius: '8px',
378
+ overflow: 'hidden',
379
+ minHeight: '80px',
380
+ background: Colors.Gray01,
381
+ } },
382
+ h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })),
383
+ owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } },
384
+ h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
385
+ }))))))))))))))));
386
+ }
387
+ return null;
388
+ }
389
+ static get is() { return "style-detail"; }
390
+ static get originalStyleUrls() { return {
391
+ "$": ["index.less"]
392
+ }; }
393
+ static get styleUrls() { return {
394
+ "$": ["index.css"]
395
+ }; }
396
+ static get properties() { return {
397
+ "salonId": {
398
+ "type": "number",
399
+ "mutable": false,
400
+ "complexType": {
401
+ "original": "number",
402
+ "resolved": "number",
403
+ "references": {}
404
+ },
405
+ "required": false,
406
+ "optional": false,
407
+ "docs": {
408
+ "tags": [],
409
+ "text": ""
410
+ },
411
+ "attribute": "salon-id",
412
+ "reflect": false
413
+ },
414
+ "salonLookbook": {
415
+ "type": "string",
416
+ "mutable": false,
417
+ "complexType": {
418
+ "original": "string",
419
+ "resolved": "string",
420
+ "references": {}
421
+ },
422
+ "required": false,
423
+ "optional": false,
424
+ "docs": {
425
+ "tags": [],
426
+ "text": ""
427
+ },
428
+ "attribute": "salon-lookbook",
429
+ "reflect": false
430
+ }
431
+ }; }
432
+ static get states() { return {
433
+ "lookbookInfo": {},
434
+ "isModalOpen": {},
435
+ "currentMediaIdx": {},
436
+ "currentMedia": {},
437
+ "albumMedias": {},
438
+ "similarStyles": {},
439
+ "totalComments": {},
440
+ "lookbookComments": {},
441
+ "isLayoutSetup": {}
442
+ }; }
443
+ static get methods() { return {
444
+ "fetchData": {
445
+ "complexType": {
446
+ "signature": "() => Promise<any[]>",
447
+ "parameters": [],
448
+ "references": {
449
+ "Promise": {
450
+ "location": "global"
451
+ }
452
+ },
453
+ "return": "Promise<any[]>"
454
+ },
455
+ "docs": {
456
+ "text": "",
457
+ "tags": []
458
+ }
459
+ }
460
+ }; }
461
+ }
@@ -8,7 +8,7 @@ export class UserAvatar {
8
8
  return (h("div", { style: { display: "flex", alignItems: "center" } },
9
9
  this.avatar && (h("div", { style: {
10
10
  backgroundImage: `url("${this.avatar}")`,
11
- backgroundColor: Colors.Gray06,
11
+ backgroundColor: Colors.Gray01,
12
12
  backgroundPosition: 'center center',
13
13
  backgroundSize: 'cover',
14
14
  borderRadius: '50%',
@@ -17,7 +17,7 @@ export class UserAvatar {
17
17
  minWidth: `${this.size}px`,
18
18
  } })),
19
19
  !this.avatar && (h("div", { style: {
20
- backgroundColor: Colors.Gray06,
20
+ backgroundColor: Colors.Gray01,
21
21
  backgroundPosition: 'center center',
22
22
  backgroundSize: 'cover',
23
23
  borderRadius: '50%',
@@ -0,0 +1,65 @@
1
+ export const Colors = {
2
+ TextColor: '#141414',
3
+ Black: '#000000',
4
+ White: '#ffffff',
5
+ Primary: '#F05A61',
6
+ Secondary: '#001529',
7
+ Black01: '#262626',
8
+ Black02: '#1f1f1f',
9
+ Black03: '#141414',
10
+ Gray01: '#F5F5F5',
11
+ Gray02: '#EFEFEF',
12
+ Gray03: '#DBDBDB',
13
+ Gray04: '#999999',
14
+ Gray05: '#666666',
15
+ Red01: '#FEEFEF',
16
+ Red02: '#F9BDC0',
17
+ Red03: '#F05A61',
18
+ Red04: '#C0484E',
19
+ Red05: '#90363A',
20
+ Orange01: '#FFF4F0',
21
+ Orange02: '#FFD1C3',
22
+ Orange03: '#FF8D69',
23
+ Orange04: '#CC7154',
24
+ Orange05: '#99553F',
25
+ Yellow01: '#FDFBF4',
26
+ Yellow02: '#F8EDD3',
27
+ Yellow03: '#EED291',
28
+ Yellow04: '#BEA874',
29
+ Yellow05: '#8F7E57',
30
+ Lilac01: '#F3F0F4',
31
+ Lilac02: '#CFC1D4',
32
+ Lilac03: '#886594',
33
+ Lilac04: '#6D5176',
34
+ Lilac05: '#523D59',
35
+ Blue01: '#EAECEE',
36
+ Blue02: '#AAB1BD',
37
+ Blue03: '#2B3C59',
38
+ Blue04: '#223047',
39
+ Blue05: '#1A2435',
40
+ Green01: '#ECF7ED',
41
+ Green02: '#B2E1B9',
42
+ Green03: '#3FB34F',
43
+ Green04: '#328F3F',
44
+ Green05: '#266B2F',
45
+ Success01: '#EEF9E8',
46
+ Success02: '#BAE7A3',
47
+ Success03: '#52C41A',
48
+ Success04: '#429D15',
49
+ Success05: '#317610',
50
+ Error01: '#FFEDED',
51
+ Error02: '#FFB8B9',
52
+ Error03: '#FF4D4F',
53
+ Error04: '#CC3E3F',
54
+ Error05: '#992E2F',
55
+ Warning01: '#FFF7E8',
56
+ Warning02: '#FDDEA1',
57
+ Warning03: '#FAAD14',
58
+ Warning04: '#C88A10',
59
+ Warning05: '#96680C',
60
+ Info01: '#E8F4FF',
61
+ Info02: '#A3D3FF',
62
+ Info03: '#1890FF',
63
+ Info04: '#1373CC',
64
+ Info05: '#0E5699',
65
+ };
File without changes
File without changes