favesalon-embed 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/LICENSE +21 -0
  2. package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +20 -0
  5. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +291 -0
  7. package/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
  8. package/{cjs/index-d5de0b9d.js → dist/cjs/index-e6bea8f5.js} +10 -0
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +5 -5
  12. package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +6 -7
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +7 -7
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +23 -57
  17. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
  18. package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +78 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
  21. package/{cjs/services-f1102d4a.js → dist/cjs/services-eee8f251.js} +265 -393
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/dist/cjs/user-avatar.cjs.entry.js +41 -0
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -3
  26. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  27. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  28. package/dist/collection/components/google-map/index.js +86 -0
  29. package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
  30. package/{collection → dist/collection}/components/salon-booking/index.js +3 -3
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +4 -4
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +4 -3
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +24 -3
  35. package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
  36. package/{collection → dist/collection}/components/salon-info/index.js +6 -32
  37. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
  38. package/dist/collection/components/salon-latest-reviews/index.js +176 -0
  39. package/dist/collection/components/salon-latest-styles/index.css +10 -0
  40. package/dist/collection/components/salon-latest-styles/index.js +178 -0
  41. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
  42. package/dist/collection/components/salon-locations/index.js +151 -0
  43. package/{collection → dist/collection}/components/salon-lookbook/index.css +0 -9
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +19 -19
  45. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  46. package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
  47. package/{collection → dist/collection}/components/salon-reviews/index.css +0 -0
  48. package/dist/collection/components/salon-reviews/index.js +286 -0
  49. package/dist/collection/components/salon-schedules/index.css +15 -0
  50. package/dist/collection/components/salon-schedules/index.js +189 -0
  51. package/{collection → dist/collection}/components/salon-services/index.css +0 -0
  52. package/{collection → dist/collection}/components/salon-services/index.js +51 -8
  53. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
  54. package/dist/collection/components/salon-stylists/index.js +183 -0
  55. package/dist/collection/components/style-detail/index.css +62 -0
  56. package/dist/collection/components/style-detail/index.js +461 -0
  57. package/{collection → dist/collection}/components/user-avatar/index.css +0 -0
  58. package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
  59. package/dist/collection/constants/colors.js +65 -0
  60. package/{collection → dist/collection}/global/global.js +0 -0
  61. package/{collection → dist/collection}/index.js +0 -0
  62. package/dist/collection/services/services.js +174 -0
  63. package/dist/collection/types/common.js +11 -0
  64. package/{collection → dist/collection}/types/review.js +9 -5
  65. package/dist/collection/types/salon.js +58 -0
  66. package/{collection → dist/collection}/types/service.js +0 -0
  67. package/dist/collection/types/style.js +128 -0
  68. package/{collection → dist/collection}/types/stylist.js +12 -9
  69. package/{favesalon-embed/index.esm.js → dist/collection/types/tmp.js} +0 -0
  70. package/{collection → dist/collection}/types/user.js +2 -2
  71. package/{collection → dist/collection}/utils/utils.js +0 -0
  72. package/{custom-elements → dist/custom-elements}/index.d.ts +12 -18
  73. package/{custom-elements → dist/custom-elements}/index.js +1227 -1035
  74. package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -0
  75. package/dist/esm/colors-ea36347a.js +67 -0
  76. package/dist/esm/favesalon-embed.js +18 -0
  77. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  78. package/dist/esm/google-map_5.entry.js +283 -0
  79. package/{esm/index-0f8eed73.js → dist/esm/index-6af0a03d.js} +10 -1
  80. package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
  81. package/{esm → dist/esm}/index.js +0 -0
  82. package/dist/esm/loader.js +18 -0
  83. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  84. package/{esm → dist/esm}/polyfills/css-shim.js +0 -0
  85. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  86. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  87. package/{esm → dist/esm}/polyfills/index.js +0 -0
  88. package/{esm → dist/esm}/polyfills/system.js +0 -0
  89. package/{esm → dist/esm}/salon-booking-modal.entry.js +5 -5
  90. package/{esm → dist/esm}/salon-booking.entry.js +5 -6
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/{esm → dist/esm}/salon-gift-card.entry.js +6 -6
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +24 -57
  95. package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
  96. package/dist/esm/salon-reviews.entry.js +182 -0
  97. package/dist/esm/salon-services.entry.js +74 -0
  98. package/dist/esm/salon-stylists.entry.js +108 -0
  99. package/{esm/services-74d84ca9.js → dist/esm/services-295247b1.js} +263 -392
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/dist/esm/user-avatar.entry.js +37 -0
  102. package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  103. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  104. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  105. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  106. package/dist/favesalon-embed/index.esm.js +0 -0
  107. package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
  108. package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  109. package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
  110. package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
  111. package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
  112. package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
  113. package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
  114. package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
  115. package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
  116. package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
  117. package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
  118. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  119. package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
  120. package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
  121. package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
  122. package/dist/favesalon-embed/p-c2ecb365.js +1 -0
  123. package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
  124. package/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -0
  125. package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
  126. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  127. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  128. package/{index.js → dist/index.js} +0 -0
  129. package/dist/types/components/google-map/index.d.ts +5 -0
  130. package/{types → dist/types}/components/salon-booking/index.d.ts +0 -0
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -0
  134. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  135. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  136. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  137. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  138. package/{types → dist/types}/components/salon-lookbook/index.d.ts +3 -3
  139. package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  140. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  141. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  142. package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
  143. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  144. package/dist/types/components/style-detail/index.d.ts +24 -0
  145. package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  146. package/{types → dist/types}/components.d.ts +54 -59
  147. package/dist/types/constants/colors.d.ts +65 -0
  148. package/{types → dist/types}/index.d.ts +0 -0
  149. package/dist/types/services/services.d.ts +60 -0
  150. package/{types → dist/types}/stencil-public-runtime.d.ts +0 -0
  151. package/dist/types/types/common.d.ts +11 -0
  152. package/{types → dist/types}/types/review.d.ts +4 -0
  153. package/{types → dist/types}/types/salon.d.ts +3 -1
  154. package/{types → dist/types}/types/service.d.ts +0 -0
  155. package/dist/types/types/style.d.ts +88 -0
  156. package/{types → dist/types}/types/stylist.d.ts +1 -1
  157. package/dist/types/types/tmp.d.ts +0 -0
  158. package/{types → dist/types}/types/user.d.ts +2 -2
  159. package/{types → dist/types}/utils/utils.d.ts +0 -0
  160. package/loader/cdn.js +3 -0
  161. package/loader/index.cjs.js +3 -0
  162. package/loader/index.d.ts +12 -0
  163. package/loader/index.es2017.js +3 -0
  164. package/loader/index.js +4 -0
  165. package/loader/package.json +10 -0
  166. package/package.json +18 -13
  167. package/readme.md +24 -7
  168. package/cjs/colors-7f354880.js +0 -95
  169. package/cjs/favesalon-embed.cjs.js +0 -20
  170. package/cjs/google-map.cjs.entry.js +0 -47
  171. package/cjs/index-95daad08.js +0 -1928
  172. package/cjs/loader.cjs.js +0 -22
  173. package/cjs/salon-contact_4.cjs.entry.js +0 -155
  174. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
  175. package/cjs/salon-info.cjs.entry.js +0 -35
  176. package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
  177. package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
  178. package/cjs/salon-reviews.cjs.entry.js +0 -205
  179. package/cjs/salon-services.cjs.entry.js +0 -47
  180. package/cjs/salon-stylists.cjs.entry.js +0 -54
  181. package/collection/components/google-map/index.js +0 -97
  182. package/collection/components/salon-contact/index.js +0 -88
  183. package/collection/components/salon-gift-card/index.css +0 -25
  184. package/collection/components/salon-info/index.css +0 -3
  185. package/collection/components/salon-latest-reviews/index.js +0 -108
  186. package/collection/components/salon-locations/index.js +0 -80
  187. package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
  188. package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
  189. package/collection/components/salon-reviews/index.js +0 -317
  190. package/collection/components/salon-schedules/index.css +0 -14
  191. package/collection/components/salon-schedules/index.js +0 -103
  192. package/collection/components/salon-styles/index.css +0 -23
  193. package/collection/components/salon-styles/index.js +0 -100
  194. package/collection/components/salon-stylists/index.js +0 -96
  195. package/collection/constants/colors.js +0 -91
  196. package/collection/services/services.js +0 -225
  197. package/collection/types/common.js +0 -2
  198. package/collection/types/salon.js +0 -52
  199. package/collection/types/style.js +0 -103
  200. package/esm/colors-1ec90c5f.js +0 -93
  201. package/esm/favesalon-embed.js +0 -18
  202. package/esm/google-map.entry.js +0 -43
  203. package/esm/index-09d43e3e.js +0 -1926
  204. package/esm/loader.js +0 -18
  205. package/esm/salon-contact_4.entry.js +0 -148
  206. package/esm/salon-gift-card-modal.entry.js +0 -21
  207. package/esm/salon-info.entry.js +0 -31
  208. package/esm/salon-latest-reviews.entry.js +0 -54
  209. package/esm/salon-lookbook-modal.entry.js +0 -137
  210. package/esm/salon-reviews.entry.js +0 -201
  211. package/esm/salon-services.entry.js +0 -43
  212. package/esm/salon-stylists.entry.js +0 -50
  213. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  214. package/favesalon-embed/p-0188d4dc.entry.js +0 -1
  215. package/favesalon-embed/p-0318501e.js +0 -1
  216. package/favesalon-embed/p-078f242d.entry.js +0 -1
  217. package/favesalon-embed/p-13e23c61.entry.js +0 -1
  218. package/favesalon-embed/p-17df13ad.js +0 -1
  219. package/favesalon-embed/p-1a3179c8.entry.js +0 -1
  220. package/favesalon-embed/p-20aa75de.js +0 -6
  221. package/favesalon-embed/p-2901a6d6.entry.js +0 -1
  222. package/favesalon-embed/p-2b861430.entry.js +0 -1
  223. package/favesalon-embed/p-44d810a0.js +0 -1
  224. package/favesalon-embed/p-4c68700f.entry.js +0 -1
  225. package/favesalon-embed/p-4e2d7b29.js +0 -1
  226. package/favesalon-embed/p-6b845bf1.entry.js +0 -1
  227. package/favesalon-embed/p-7350f6b5.entry.js +0 -1
  228. package/favesalon-embed/p-897c2b1c.entry.js +0 -1
  229. package/favesalon-embed/p-8e60f56f.entry.js +0 -1
  230. package/favesalon-embed/p-a49afdc1.entry.js +0 -1
  231. package/favesalon-embed/p-c93867c4.entry.js +0 -1
  232. package/favesalon-embed/p-ea6a097f.entry.js +0 -1
  233. package/types/components/google-map/index.d.ts +0 -10
  234. package/types/components/salon-contact/index.d.ts +0 -9
  235. package/types/components/salon-lookbook/salon-lookbook-modal.d.ts +0 -13
  236. package/types/components/salon-reviews/index.d.ts +0 -24
  237. package/types/components/salon-styles/index.d.ts +0 -9
  238. package/types/constants/colors.d.ts +0 -88
  239. package/types/services/services.d.ts +0 -26
  240. package/types/types/common.d.ts +0 -2
  241. package/types/types/style.d.ts +0 -59
@@ -0,0 +1,186 @@
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 colors = require('./colors-38421769.js');
8
+ require('./_commonjsHelpers-5cfcba41.js');
9
+
10
+ const indexCss = "@media (max-width: 768px){salon-reviews .salon-reviews{flex-direction:column !important}salon-reviews .salon-reviews--filters--options{display:none !important}salon-reviews .salon-reviews--list{padding-top:32px !important;padding-left:0px !important}salon-reviews .reviews-list--sorting>label{display:none !important}}";
11
+
12
+ const pageLimited = 10;
13
+ const sortOptions = [{
14
+ value: 'newest',
15
+ label: 'Newest first',
16
+ }, {
17
+ value: 'oldest',
18
+ label: 'Oldest first',
19
+ }, {
20
+ value: 'rating_desc',
21
+ label: 'High rating first',
22
+ }, {
23
+ value: 'rating_asc',
24
+ label: 'Low rating first',
25
+ }];
26
+ let SalonReviews = class {
27
+ constructor(hostRef) {
28
+ index.registerInstance(this, hostRef);
29
+ this.primaryColor = colors.Colors.Primary;
30
+ this.stats = {};
31
+ this.totalReviews = 0;
32
+ this.allReviews = [];
33
+ this.page = 1;
34
+ this.filterBy = [];
35
+ this.sortBy = sortOptions[0].value;
36
+ }
37
+ componentWillLoad() {
38
+ this.fetchData();
39
+ }
40
+ fetchData() {
41
+ this.isLoading = true;
42
+ try {
43
+ services.HttpService().fetchSalonReviews(this.salonId, {
44
+ page: 1,
45
+ sort: this.sortBy,
46
+ limit: pageLimited,
47
+ }).then(response => {
48
+ const { total, stats, data: allReviews } = response;
49
+ this.stats = stats;
50
+ this.totalReviews = total;
51
+ this.allReviews = allReviews;
52
+ this.canLoadMore = total > pageLimited;
53
+ });
54
+ }
55
+ catch (e) { }
56
+ this.isLoading = false;
57
+ }
58
+ onLoadMore() {
59
+ this.isLoadingMore = true;
60
+ try {
61
+ services.HttpService().fetchSalonReviews(this.salonId, {
62
+ page: this.page + 1,
63
+ sort: this.sortBy,
64
+ limit: pageLimited,
65
+ }).then(response => {
66
+ const { total, data: allReviews } = response;
67
+ this.page = this.page + 1;
68
+ this.totalReviews = total;
69
+ this.allReviews = this.allReviews.concat(allReviews);
70
+ this.canLoadMore = (allReviews || []).length === pageLimited;
71
+ });
72
+ }
73
+ catch (e) { }
74
+ this.isLoadingMore = false;
75
+ }
76
+ onChangeFilter(filterBy) {
77
+ this.isFiltering = true;
78
+ try {
79
+ services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: this.sortBy, limit: pageLimited }, filterBy.length > 0 ? { avg_point: filterBy } : {})).then(response => {
80
+ const { total, data: allReviews } = response;
81
+ this.page = 1;
82
+ this.totalReviews = total;
83
+ this.allReviews = allReviews;
84
+ this.canLoadMore = (allReviews || []).length === pageLimited;
85
+ });
86
+ }
87
+ catch (e) { }
88
+ this.isFiltering = false;
89
+ }
90
+ onChangeSorting(sortBy) {
91
+ this.isSorting = true;
92
+ try {
93
+ services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: sortBy, limit: pageLimited }, this.filterBy.length > 0 ? { avg_point: this.filterBy } : {})).then(response => {
94
+ const { total, data: allReviews } = response;
95
+ this.page = 1;
96
+ this.totalReviews = total;
97
+ this.allReviews = allReviews;
98
+ this.canLoadMore = (allReviews || []).length === pageLimited;
99
+ });
100
+ }
101
+ catch (e) { }
102
+ this.isSorting = false;
103
+ }
104
+ render() {
105
+ const ratingTexts = ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
106
+ return (index.h("div", { class: "view view--salon-reviews" }, index.h("div", { class: "salon-reviews--filters" }, index.h("div", { class: "salon-reviews--score" }, index.h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => {
107
+ return (index.h("i", { class: score <= this.stats.reviewPoint ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '32px', marginRight: '4px' }, score <= this.stats.reviewPoint ? { color: this.primaryColor } : { color: colors.Colors.Gray04 }) }));
108
+ })), index.h("div", { class: "salon-review--rating--date", style: {
109
+ display: 'flex',
110
+ flexDirection: 'row',
111
+ alignItems: 'center',
112
+ marginTop: '-8px',
113
+ } }, index.h("span", { style: { fontSize: '24px' } }, this.stats.reviewPoint, "/5"), " ", index.h("span", { style: { color: colors.Colors.Gray04, marginLeft: '8px' } }, "(", this.stats.totalReviews, " reviews)"))), index.h("div", { class: "salon-reviews--filters--options", style: { marginTop: '24px' } }, index.h("div", { style: {
114
+ background: colors.Colors.Gray01,
115
+ display: 'flex',
116
+ alignItems: 'center',
117
+ borderRadius: '4px',
118
+ padding: '16px',
119
+ } }, index.h("div", null, index.h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
120
+ this.filterBy = [];
121
+ this.onChangeFilter([]);
122
+ } }), " ", index.h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
123
+ const isChecked = this.filterBy.indexOf(score) > -1;
124
+ return (index.h("div", { key: `salon-reviews--filters-score--${score}`, style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, index.h("input", { type: "checkbox", checked: isChecked, onChange: () => {
125
+ const newFilter = isChecked ? this.filterBy.filter(fs => fs !== score) : this.filterBy.concat([score]);
126
+ this.filterBy = newFilter;
127
+ this.onChangeFilter(newFilter);
128
+ } }), " ", index.h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", index.h("i", { class: "ri-heart-line", style: {
129
+ fontSize: '16px',
130
+ marginLeft: '4px',
131
+ marginRight: '4px',
132
+ lineHeight: '1',
133
+ } }), " ", index.h("span", { style: { color: colors.Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
134
+ })))), index.h("div", { class: "salon-reviews--list-header", style: {
135
+ display: 'flex',
136
+ flexDirection: 'row',
137
+ justifyContent: 'space-between',
138
+ alignItems: 'center',
139
+ marginTop: '24px',
140
+ } }, index.h("div", { class: "view--salon-reviews--counter" }, this.totalReviews, " ", this.totalReviews === 1 ? `review` : `reviews`), index.h("div", { style: { display: 'flex', alignItems: 'center' } }, index.h("label", { style: { marginRight: '8px', color: colors.Colors.Gray04 } }, "Sort by"), index.h("select", { class: "search-filter--select", "place-holder": "Most popular", disabled: this.isLoading, onChange: (evt) => {
141
+ this.sortBy = evt.target.value;
142
+ this.onChangeSorting(evt.target.value);
143
+ }, style: {
144
+ display: 'flex',
145
+ alignItems: 'center',
146
+ backgroundColor: colors.Colors.Gray01,
147
+ borderColor: colors.Colors.Gray01,
148
+ borderRadius: '4px',
149
+ height: '40px',
150
+ width: '130px',
151
+ } }, sortOptions.map(sortOption => (index.h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy, key: `search-filter--select-option--${sortOption.value}` }, sortOption.label)))))), index.h("div", { class: "salon-reviews--list-content", style: { marginTop: '24px' } }, this.allReviews.map((review, idx) => {
152
+ const user = review.user || {};
153
+ return (index.h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
154
+ borderBottom: `1px solid ${colors.Colors.Gray02}`,
155
+ marginBottom: '24px',
156
+ paddingBottom: '24px',
157
+ } }, index.h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, index.h("user-avatar", { size: 48, avatar: user.avatar, name: index.h("span", { style: { fontSize: '18px', fontWeight: '600', color: colors.Colors.TextColor } }, (user.firstName || user.lastName) ? `${user.firstName || ''} ${user.lastName || ''}` : ''), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), index.h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (index.h("i", { key: `salon-review--rating--item--score--${score}`, class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
158
+ color: score <= review.point ? this.primaryColor : colors.Colors.Gray04,
159
+ fontSize: '16px',
160
+ marginRight: '4px',
161
+ } }))), review.createdDate && (index.h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: colors.Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, services.dayjs_min(review.createdDate).format(services.shortDateYearFormat)))), index.h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: '600' } }, ratingTexts[review.point]), (review.title || review.description) && (index.h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, index.h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), index.h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (index.h("div", { style: {
162
+ display: 'flex',
163
+ flexDirection: 'row',
164
+ overflowX: 'auto',
165
+ } }, review.photos.map(fileObj => (index.h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
166
+ position: 'relative',
167
+ cursor: 'pointer',
168
+ marginTop: '16px',
169
+ marginRight: '12px',
170
+ } }, index.h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
171
+ })), index.h("div", { class: "salon-reviews--list-footer", style: {
172
+ textAlign: 'center',
173
+ paddingTop: '16px',
174
+ paddingBottom: '16px',
175
+ } }, index.h("button", { class: "btn btn-light btn-lg", style: {
176
+ background: colors.Colors.White,
177
+ border: `1px solid ${colors.Colors.Gray02}`,
178
+ borderRadius: '4px',
179
+ paddingLeft: '24px',
180
+ paddingRight: '24px',
181
+ }, onClick: () => this.onLoadMore() }, "Load more"))));
182
+ }
183
+ };
184
+ SalonReviews.style = indexCss;
185
+
186
+ exports.salon_reviews = SalonReviews;
@@ -0,0 +1,78 @@
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 colors = require('./colors-38421769.js');
8
+ require('./_commonjsHelpers-5cfcba41.js');
9
+
10
+ const indexCss = "";
11
+
12
+ let SalonServices = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.buttonClass = 'btn btn-light';
16
+ }
17
+ componentWillLoad() {
18
+ this.fetchData();
19
+ }
20
+ async fetchData() {
21
+ this.isLoading = true;
22
+ try {
23
+ this.salonServices = await services.HttpService().fetchSalonServices(this.salonId);
24
+ }
25
+ catch (e) {
26
+ this.salonServices = [];
27
+ }
28
+ this.isLoading = false;
29
+ }
30
+ render() {
31
+ if (this.isLoading) {
32
+ return (index.h("div", { class: "salon-services--container" }, index.h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${colors.Colors.Gray01}` } }, index.h("div", { class: "view-content", style: { overflowX: 'auto' } }, index.h("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden' } }, [1, 2, 3, 4, 5, 6].map((fakeId, index$1) => (index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
33
+ backgroundColor: colors.Colors.Gray02,
34
+ float: 'left',
35
+ marginRight: '12px',
36
+ height: '30px',
37
+ width: '120px',
38
+ } })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index$1) => {
39
+ return (index.h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
40
+ backgroundColor: colors.Colors.Gray03,
41
+ height: '20px',
42
+ width: '120px',
43
+ } }), index.h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${colors.Colors.Gray01}`, marginTop: '12px' } }, index.h("div", { class: "view-content" }, [1, 2, 3].map((fakeGroupId, fakeGroupIndex) => (index.h("div", { key: `service-group--${fakeId}--service-${fakeGroupId}--${fakeGroupIndex}`, class: "salon-service" }, index.h("div", { class: "salon-service--name", style: Object.assign({}, fakeGroupIndex > 0 ? {
44
+ marginTop: '12px',
45
+ paddingTop: '12px',
46
+ borderTop: `1px solid ${colors.Colors.Gray01}`,
47
+ } : {}) }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
48
+ backgroundColor: colors.Colors.Gray01,
49
+ height: '16px',
50
+ width: '120px',
51
+ } })), index.h("div", { style: { marginTop: '4px' } }, index.h("div", { style: {
52
+ backgroundColor: colors.Colors.Gray01,
53
+ height: '16px',
54
+ width: '240px',
55
+ } })))))))));
56
+ })));
57
+ }
58
+ return (index.h("div", { class: "salon-services--container" }, index.h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${colors.Colors.Gray02}` } }, index.h("div", { class: "view-content", style: { overflowX: 'auto' } }, index.h("div", { style: { whiteSpace: 'nowrap' } }, services.sortBy_1(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index$1) => (index.h("a", { href: `#service-group--${serviceGroup.id}` }, index.h("button", { type: "button", class: this.buttonClass, style: index$1 > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), services.sortBy_1(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
59
+ const hasMultipleCates = (serviceGroup.data || []).length > 1;
60
+ return (index.h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, index.h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), index.h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${colors.Colors.Gray02}` } }, index.h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (index.h("div", { class: "salon-service-category" }, hasMultipleCates && (index.h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${colors.Colors.Gray02}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (index.h("div", { class: "salon-service" }, index.h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
61
+ marginTop: '12px',
62
+ paddingTop: '12px',
63
+ borderTop: `1px solid ${colors.Colors.Gray01}`,
64
+ } : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (index.h("div", { style: {
65
+ display: 'block',
66
+ marginTop: '4px',
67
+ fontSize: '90%',
68
+ color: colors.Colors.Gray05,
69
+ } }, [
70
+ !service.hideDuration ? `${service.duration} mins` : '',
71
+ !service.hidePrice ? `$${service.price}` : '',
72
+ ].filter(field => !!field).join(' · ')))))))))))));
73
+ })));
74
+ }
75
+ };
76
+ SalonServices.style = indexCss;
77
+
78
+ exports.salon_services = SalonServices;
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e6bea8f5.js');
6
+ const colors = require('./colors-38421769.js');
7
+ const services = require('./services-eee8f251.js');
8
+ require('./_commonjsHelpers-5cfcba41.js');
9
+
10
+ const indexCss = ".view--salon-stylists{overflow:hidden;margin-left:-12px;margin-top:-12px}.view--salon-stylists .salon-stylist{float:left;padding-left:12px;padding-top:12px;width:50%}.view--salon-stylists .salon-stylist--avatar{height:180px}@media (min-width: 576px){.view--salon-stylists .salon-stylist{width:33.33%;max-width:240px}}@media (min-width: 768px){.view--salon-stylists{margin-left:-24px;margin-top:-24px}.view--salon-stylists .salon-stylist{padding-left:24px;padding-top:24px;width:264px;max-width:none}.view--salon-stylists .salon-stylist--avatar{height:240px}}";
11
+
12
+ const pageLimit = 20;
13
+ let SalonStylists = class {
14
+ constructor(hostRef) {
15
+ index.registerInstance(this, hostRef);
16
+ this.page = 1;
17
+ }
18
+ componentWillLoad() {
19
+ this.fetchData();
20
+ }
21
+ async fetchData() {
22
+ this.isLoading = true;
23
+ try {
24
+ const { total, data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
25
+ this.totalStylists = total;
26
+ this.salonStylists = data;
27
+ this.canLoadMore = data.length === pageLimit;
28
+ }
29
+ catch (e) {
30
+ this.totalStylists = 0;
31
+ this.salonStylists = [];
32
+ this.canLoadMore = false;
33
+ }
34
+ this.isLoading = false;
35
+ }
36
+ async onLoadMore() {
37
+ this.isLoadingMore = true;
38
+ try {
39
+ const { data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
40
+ this.salonStylists = this.salonStylists.concat(data || []);
41
+ this.canLoadMore = data.length === pageLimit;
42
+ this.page += 1;
43
+ }
44
+ catch (e) { }
45
+ this.isLoadingMore = false;
46
+ }
47
+ render() {
48
+ if (this.isLoading) {
49
+ return (index.h("div", null, index.h("div", { class: "view--salon-stylists" }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((fakeId, index$1) => (index.h("div", { class: "salon-stylist" }, index.h("div", { class: "card", style: {
50
+ background: 'none',
51
+ border: 'none',
52
+ overflow: 'hidden',
53
+ } }, index.h("div", { class: "salon-stylist--avatar", style: {
54
+ backgroundColor: colors.Colors.Gray01,
55
+ backgroundRepeat: 'no-repeat',
56
+ backgroundPosition: 'center top',
57
+ backgroundSize: 'cover',
58
+ border: `1px solid ${colors.Colors.Gray01}`,
59
+ borderRadius: '8px',
60
+ position: 'relative',
61
+ display: 'flex',
62
+ width: '100%',
63
+ alignItems: 'center',
64
+ justifyContent: 'center',
65
+ } }), index.h("div", { class: "card-body" }, index.h("div", { key: `stylist--${fakeId}--${index$1}`, style: {
66
+ backgroundColor: colors.Colors.Gray01,
67
+ height: '16px',
68
+ width: '120px',
69
+ margin: 'auto',
70
+ } })))))))));
71
+ }
72
+ return (index.h("div", null, index.h("div", { class: "view--salon-stylists" }, (this.salonStylists || []).map(stylist => (index.h("div", { class: "salon-stylist" }, index.h("div", { class: "card", style: {
73
+ background: 'none',
74
+ border: 'none',
75
+ overflow: 'hidden',
76
+ } }, index.h("div", { class: "salon-stylist--avatar", style: {
77
+ backgroundImage: `url("${stylist.avatar}")`,
78
+ backgroundColor: colors.Colors.Gray01,
79
+ backgroundRepeat: 'no-repeat',
80
+ backgroundPosition: 'center top',
81
+ backgroundSize: 'cover',
82
+ border: `1px solid ${colors.Colors.Gray01}`,
83
+ borderRadius: '8px',
84
+ position: 'relative',
85
+ display: 'flex',
86
+ width: '100%',
87
+ alignItems: 'center',
88
+ justifyContent: 'center',
89
+ } }, !stylist.avatar && (index.h("span", { style: {
90
+ fontSize: '32px',
91
+ fontWeight: 'bold',
92
+ textTransform: 'uppercase',
93
+ } }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), index.h("div", { class: "card-body" }, index.h("div", { style: {
94
+ fontSize: '18px',
95
+ fontWeight: '600',
96
+ textAlign: 'center',
97
+ } }, stylist.fullName))))))), this.canLoadMore && (index.h("div", { class: "view-footer", style: {
98
+ textAlign: 'center',
99
+ paddingTop: '32px',
100
+ paddingBottom: '16px',
101
+ } }, index.h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
102
+ background: colors.Colors.White,
103
+ border: `1px solid ${colors.Colors.Gray02}`,
104
+ borderRadius: '4px',
105
+ paddingLeft: '24px',
106
+ paddingRight: '24px',
107
+ }, onClick: () => this.onLoadMore() }, "Load more")))));
108
+ }
109
+ };
110
+ SalonStylists.style = indexCss;
111
+
112
+ exports.salon_stylists = SalonStylists;