favesalon-embed 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
  3. package/dist/cjs/chat-button.cjs.entry.js +118 -0
  4. package/dist/cjs/colors-38421769.js +69 -0
  5. package/dist/cjs/favesalon-embed.cjs.js +24 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +310 -0
  7. package/{cjs/index-7d179a70.js → dist/cjs/index-47c2a5f6.js} +587 -199
  8. package/dist/cjs/index-7f190886.js +4396 -0
  9. package/dist/cjs/loader.cjs.js +23 -0
  10. package/dist/cjs/relativeTime-3721080d.js +9 -0
  11. package/dist/cjs/salon-booking-modal.cjs.entry.js +30 -0
  12. package/dist/cjs/salon-booking.cjs.entry.js +51 -0
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
  14. package/dist/cjs/salon-gift-card.cjs.entry.js +51 -0
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
  16. package/dist/cjs/salon-lookbook.cjs.entry.js +222 -0
  17. package/dist/cjs/salon-ranking.cjs.entry.js +60 -0
  18. package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +81 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
  21. package/dist/cjs/services-125c82d8.js +21492 -0
  22. package/dist/cjs/style-detail.cjs.entry.js +312 -0
  23. package/dist/cjs/user-avatar.cjs.entry.js +45 -0
  24. package/dist/cjs/utils-c5a33b3c.js +23 -0
  25. package/{collection → dist/collection}/collection-manifest.json +5 -4
  26. package/dist/collection/components/chat-button/index.css +122 -0
  27. package/dist/collection/components/chat-button/index.js +218 -0
  28. package/dist/collection/components/chat-conversation/index.js +103 -0
  29. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  30. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  31. package/dist/collection/components/google-map/index.js +90 -0
  32. package/{collection → dist/collection}/components/salon-booking/index.css +11 -20
  33. package/dist/collection/components/salon-booking/index.js +126 -0
  34. package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
  35. package/dist/collection/components/salon-gift-card/index.css +30 -0
  36. package/dist/collection/components/salon-gift-card/index.js +126 -0
  37. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
  38. package/dist/collection/components/salon-info/index.js +77 -0
  39. package/dist/collection/components/salon-latest-reviews/index.js +163 -0
  40. package/dist/collection/components/salon-latest-styles/index.css +12 -0
  41. package/dist/collection/components/salon-latest-styles/index.js +183 -0
  42. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +7 -4
  43. package/dist/collection/components/salon-locations/index.js +143 -0
  44. package/dist/collection/components/salon-lookbook/index.css +15 -0
  45. package/dist/collection/components/salon-lookbook/index.js +368 -0
  46. package/dist/collection/components/salon-ranking/index.js +117 -0
  47. package/dist/collection/components/salon-reviews/index.css +18 -0
  48. package/dist/collection/components/salon-reviews/index.js +249 -0
  49. package/dist/collection/components/salon-schedules/index.css +18 -0
  50. package/dist/collection/components/salon-schedules/index.js +167 -0
  51. package/dist/collection/components/salon-services/index.css +1 -0
  52. package/dist/collection/components/salon-services/index.js +146 -0
  53. package/dist/collection/components/salon-stylists/index.js +184 -0
  54. package/dist/collection/components/style-detail/index.css +76 -0
  55. package/dist/collection/components/style-detail/index.js +386 -0
  56. package/dist/collection/components/user-avatar/index.js +134 -0
  57. package/dist/collection/constants/colors.js +65 -0
  58. package/dist/collection/mocks/users.js +10 -0
  59. package/dist/collection/services/services.js +295 -0
  60. package/dist/collection/types/chat.js +23 -0
  61. package/dist/collection/types/common.js +11 -0
  62. package/{collection → dist/collection}/types/review.js +9 -5
  63. package/dist/collection/types/salon.js +58 -0
  64. package/dist/collection/types/style.js +128 -0
  65. package/dist/collection/types/stylist.js +30 -0
  66. package/dist/collection/types/user.js +10 -0
  67. package/{custom-elements → dist/custom-elements}/index.d.ts +18 -12
  68. package/dist/custom-elements/index.js +28340 -0
  69. package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
  70. package/dist/esm/chat-button.entry.js +114 -0
  71. package/dist/esm/colors-ea36347a.js +67 -0
  72. package/dist/esm/favesalon-embed.js +19 -0
  73. package/dist/esm/google-map_5.entry.js +302 -0
  74. package/{esm/index-2160b80b.js → dist/esm/index-3fae868e.js} +586 -200
  75. package/dist/esm/index-80523fec.js +4393 -0
  76. package/dist/esm/index.js +1 -0
  77. package/dist/esm/loader.js +19 -0
  78. package/dist/esm/polyfills/css-shim.js +1 -0
  79. package/dist/esm/relativeTime-cd452e6d.js +7 -0
  80. package/dist/esm/salon-booking-modal.entry.js +26 -0
  81. package/dist/esm/salon-booking.entry.js +47 -0
  82. package/dist/esm/salon-gift-card-modal.entry.js +25 -0
  83. package/dist/esm/salon-gift-card.entry.js +47 -0
  84. package/dist/esm/salon-latest-reviews.entry.js +93 -0
  85. package/dist/esm/salon-lookbook.entry.js +218 -0
  86. package/dist/esm/salon-ranking.entry.js +56 -0
  87. package/dist/esm/salon-reviews.entry.js +189 -0
  88. package/dist/esm/salon-services.entry.js +77 -0
  89. package/dist/esm/salon-stylists.entry.js +114 -0
  90. package/dist/esm/services-40a3e622.js +21485 -0
  91. package/dist/esm/style-detail.entry.js +308 -0
  92. package/dist/esm/user-avatar.entry.js +41 -0
  93. package/dist/esm/utils-e97485e0.js +19 -0
  94. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  95. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  96. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  97. package/dist/favesalon-embed/p-019c5ccd.entry.js +1 -0
  98. package/dist/favesalon-embed/p-083a8821.entry.js +1 -0
  99. package/dist/favesalon-embed/p-0d0ed9ea.entry.js +1 -0
  100. package/dist/favesalon-embed/p-119db8de.entry.js +1 -0
  101. package/dist/favesalon-embed/p-1432c51b.entry.js +1 -0
  102. package/dist/favesalon-embed/p-22093506.entry.js +1 -0
  103. package/dist/favesalon-embed/p-32b314e9.js +2 -0
  104. package/dist/favesalon-embed/p-47e646f8.js +1 -0
  105. package/dist/favesalon-embed/p-4a5eca9a.js +6 -0
  106. package/dist/favesalon-embed/p-58d2e9be.js +1 -0
  107. package/dist/favesalon-embed/p-71404b6a.entry.js +1 -0
  108. package/dist/favesalon-embed/p-857c3a61.entry.js +1 -0
  109. package/dist/favesalon-embed/p-99ec77f7.entry.js +1 -0
  110. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  111. package/dist/favesalon-embed/p-b0c3673a.entry.js +1 -0
  112. package/dist/favesalon-embed/p-b287b1ea.entry.js +1 -0
  113. package/dist/favesalon-embed/p-b3af7842.entry.js +1 -0
  114. package/dist/favesalon-embed/p-b630ae68.js +1580 -0
  115. package/dist/favesalon-embed/p-ce2c1c9a.entry.js +1 -0
  116. package/dist/favesalon-embed/p-d6083940.js +1 -0
  117. package/dist/favesalon-embed/p-d9b7ad58.entry.js +1 -0
  118. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  119. package/dist/types/components/chat-button/index.d.ts +24 -0
  120. package/dist/types/components/google-map/index.d.ts +5 -0
  121. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
  122. package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
  123. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
  124. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  125. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  126. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  127. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  128. package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
  129. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  130. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  131. package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
  132. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  133. package/dist/types/components/style-detail/index.d.ts +24 -0
  134. package/{types → dist/types}/components.d.ts +82 -41
  135. package/dist/types/constants/colors.d.ts +65 -0
  136. package/dist/types/mocks/users.d.ts +10 -0
  137. package/dist/types/services/services.d.ts +75 -0
  138. package/{types → dist/types}/stencil-public-runtime.d.ts +85 -11
  139. package/dist/types/types/chat.d.ts +17 -0
  140. package/dist/types/types/common.d.ts +11 -0
  141. package/{types → dist/types}/types/review.d.ts +4 -0
  142. package/{types → dist/types}/types/salon.d.ts +3 -1
  143. package/dist/types/types/style.d.ts +88 -0
  144. package/{types → dist/types}/types/stylist.d.ts +2 -1
  145. package/{types → dist/types}/types/user.d.ts +2 -2
  146. package/loader/cdn.js +3 -0
  147. package/loader/index.cjs.js +3 -0
  148. package/loader/index.d.ts +21 -0
  149. package/loader/index.es2017.js +3 -0
  150. package/loader/index.js +4 -0
  151. package/loader/package.json +11 -0
  152. package/package.json +19 -14
  153. package/readme.md +25 -2
  154. package/cjs/favesalon-embed.cjs.js +0 -20
  155. package/cjs/google-map_15.cjs.entry.js +0 -6632
  156. package/cjs/loader.cjs.js +0 -22
  157. package/cjs/salon-booking-modal.cjs.entry.js +0 -23
  158. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
  159. package/collection/components/google-map/index.js +0 -97
  160. package/collection/components/salon-booking/index.js +0 -103
  161. package/collection/components/salon-booking/salon-booking-modal.js +0 -82
  162. package/collection/components/salon-contact/index.js +0 -88
  163. package/collection/components/salon-gift-card/index.css +0 -25
  164. package/collection/components/salon-gift-card/index.js +0 -83
  165. package/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -43
  166. package/collection/components/salon-info/index.css +0 -3
  167. package/collection/components/salon-info/index.js +0 -97
  168. package/collection/components/salon-latest-reviews/index.js +0 -108
  169. package/collection/components/salon-locations/index.js +0 -80
  170. package/collection/components/salon-lookbook/index.css +0 -12
  171. package/collection/components/salon-lookbook/index.js +0 -303
  172. package/collection/components/salon-ranking/index.js +0 -114
  173. package/collection/components/salon-reviews/index.js +0 -291
  174. package/collection/components/salon-schedules/index.css +0 -14
  175. package/collection/components/salon-schedules/index.js +0 -103
  176. package/collection/components/salon-services/index.css +0 -0
  177. package/collection/components/salon-services/index.js +0 -113
  178. package/collection/components/salon-styles/index.css +0 -23
  179. package/collection/components/salon-styles/index.js +0 -100
  180. package/collection/components/salon-stylists/index.js +0 -96
  181. package/collection/components/user-avatar/index.css +0 -0
  182. package/collection/components/user-avatar/index.js +0 -127
  183. package/collection/constants/colors.js +0 -91
  184. package/collection/services/services.js +0 -203
  185. package/collection/types/common.js +0 -2
  186. package/collection/types/salon.js +0 -52
  187. package/collection/types/style.js +0 -28
  188. package/collection/types/stylist.js +0 -13
  189. package/collection/types/user.js +0 -10
  190. package/custom-elements/index.js +0 -7410
  191. package/esm/favesalon-embed.js +0 -18
  192. package/esm/google-map_15.entry.js +0 -6614
  193. package/esm/loader.js +0 -18
  194. package/esm/polyfills/css-shim.js +0 -1
  195. package/esm/salon-booking-modal.entry.js +0 -19
  196. package/esm/salon-gift-card-modal.entry.js +0 -16
  197. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  198. package/favesalon-embed/p-1432ab16.entry.js +0 -1
  199. package/favesalon-embed/p-2da2ed75.js +0 -1
  200. package/favesalon-embed/p-4a5eca9a.js +0 -6
  201. package/favesalon-embed/p-94a0991e.entry.js +0 -1
  202. package/favesalon-embed/p-f15bcb43.entry.js +0 -1
  203. package/types/components/google-map/index.d.ts +0 -10
  204. package/types/components/salon-contact/index.d.ts +0 -9
  205. package/types/components/salon-reviews/index.d.ts +0 -23
  206. package/types/components/salon-styles/index.d.ts +0 -9
  207. package/types/constants/colors.d.ts +0 -88
  208. package/types/services/services.d.ts +0 -24
  209. package/types/types/common.d.ts +0 -2
  210. package/types/types/style.d.ts +0 -49
  211. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  212. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  213. package/{esm/index.js → dist/collection/components/salon-info/index.css} +0 -0
  214. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -0
  215. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  216. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -0
  217. package/{collection/components/salon-locations → dist/collection/components/user-avatar}/index.css +0 -0
  218. package/{collection → dist/collection}/global/global.js +0 -0
  219. package/{collection → dist/collection}/index.js +0 -0
  220. package/{collection → dist/collection}/types/service.js +0 -0
  221. package/{collection → dist/collection}/utils/utils.js +0 -0
  222. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  223. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  224. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  225. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  226. package/{esm → dist/esm}/polyfills/index.js +0 -0
  227. package/{esm → dist/esm}/polyfills/system.js +0 -0
  228. package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  229. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  230. package/{index.js → dist/index.js} +0 -0
  231. package/{collection/components/salon-reviews/index.css → dist/types/components/chat-conversation/index.d.ts} +0 -0
  232. package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
  233. /package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  234. /package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  235. /package/{types → dist/types}/index.d.ts +0 -0
  236. /package/{types → dist/types}/types/service.d.ts +0 -0
  237. /package/{types → dist/types}/utils/utils.d.ts +0 -0
@@ -0,0 +1,193 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-47c2a5f6.js');
6
+ const services = require('./services-125c82d8.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
+ const SalonReviews = class {
27
+ constructor(hostRef) {
28
+ index.registerInstance(this, hostRef);
29
+ this.salonId = undefined;
30
+ this.primaryColor = colors.Colors.Primary;
31
+ this.salonInfo = undefined;
32
+ this.stats = {};
33
+ this.totalReviews = 0;
34
+ this.allReviews = [];
35
+ this.isLoading = undefined;
36
+ this.isSorting = undefined;
37
+ this.isFiltering = undefined;
38
+ this.isLoadingMore = undefined;
39
+ this.canLoadMore = undefined;
40
+ this.page = 1;
41
+ this.filterBy = [];
42
+ this.sortBy = sortOptions[0].value;
43
+ }
44
+ componentWillLoad() {
45
+ this.fetchData();
46
+ }
47
+ fetchData() {
48
+ this.isLoading = true;
49
+ try {
50
+ services.HttpService().fetchSalonReviews(this.salonId, {
51
+ page: 1,
52
+ sort: this.sortBy,
53
+ limit: pageLimited,
54
+ }).then(response => {
55
+ const { total, stats, data: allReviews } = response;
56
+ this.stats = stats;
57
+ this.totalReviews = total;
58
+ this.allReviews = allReviews;
59
+ this.canLoadMore = total > pageLimited;
60
+ });
61
+ }
62
+ catch (e) { }
63
+ this.isLoading = false;
64
+ }
65
+ onLoadMore() {
66
+ this.isLoadingMore = true;
67
+ try {
68
+ services.HttpService().fetchSalonReviews(this.salonId, {
69
+ page: this.page + 1,
70
+ sort: this.sortBy,
71
+ limit: pageLimited,
72
+ }).then(response => {
73
+ const { total, data: allReviews } = response;
74
+ this.page = this.page + 1;
75
+ this.totalReviews = total;
76
+ this.allReviews = this.allReviews.concat(allReviews);
77
+ this.canLoadMore = (allReviews || []).length === pageLimited;
78
+ });
79
+ }
80
+ catch (e) { }
81
+ this.isLoadingMore = false;
82
+ }
83
+ onChangeFilter(filterBy) {
84
+ this.isFiltering = true;
85
+ try {
86
+ services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: this.sortBy, limit: pageLimited }, filterBy.length > 0 ? { avg_point: filterBy } : {})).then(response => {
87
+ const { total, data: allReviews } = response;
88
+ this.page = 1;
89
+ this.totalReviews = total;
90
+ this.allReviews = allReviews;
91
+ this.canLoadMore = (allReviews || []).length === pageLimited;
92
+ });
93
+ }
94
+ catch (e) { }
95
+ this.isFiltering = false;
96
+ }
97
+ onChangeSorting(sortBy) {
98
+ this.isSorting = true;
99
+ try {
100
+ services.HttpService().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: sortBy, limit: pageLimited }, this.filterBy.length > 0 ? { avg_point: this.filterBy } : {})).then(response => {
101
+ const { total, data: allReviews } = response;
102
+ this.page = 1;
103
+ this.totalReviews = total;
104
+ this.allReviews = allReviews;
105
+ this.canLoadMore = (allReviews || []).length === pageLimited;
106
+ });
107
+ }
108
+ catch (e) { }
109
+ this.isSorting = false;
110
+ }
111
+ render() {
112
+ const ratingTexts = ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
113
+ 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 => {
114
+ 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 }) }));
115
+ })), index.h("div", { class: "salon-review--rating--date", style: {
116
+ display: 'flex',
117
+ flexDirection: 'row',
118
+ alignItems: 'center',
119
+ marginTop: '-8px',
120
+ } }, 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: {
121
+ background: colors.Colors.Gray01,
122
+ display: 'flex',
123
+ alignItems: 'center',
124
+ borderRadius: '4px',
125
+ padding: '16px',
126
+ } }, index.h("div", null, index.h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
127
+ this.filterBy = [];
128
+ this.onChangeFilter([]);
129
+ } }), " ", index.h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
130
+ const isChecked = this.filterBy.indexOf(score) > -1;
131
+ 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: () => {
132
+ const newFilter = isChecked ? this.filterBy.filter(fs => fs !== score) : this.filterBy.concat([score]);
133
+ this.filterBy = newFilter;
134
+ this.onChangeFilter(newFilter);
135
+ } }), " ", index.h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", index.h("i", { class: "ri-heart-line", style: {
136
+ fontSize: '16px',
137
+ marginLeft: '4px',
138
+ marginRight: '4px',
139
+ lineHeight: '1',
140
+ } }), " ", index.h("span", { style: { color: colors.Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
141
+ })))), index.h("div", { class: "salon-reviews--list-header", style: {
142
+ display: 'flex',
143
+ flexDirection: 'row',
144
+ justifyContent: 'space-between',
145
+ alignItems: 'center',
146
+ marginTop: '24px',
147
+ } }, 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) => {
148
+ this.sortBy = evt.target.value;
149
+ this.onChangeSorting(evt.target.value);
150
+ }, style: {
151
+ display: 'flex',
152
+ alignItems: 'center',
153
+ backgroundColor: colors.Colors.Gray01,
154
+ borderColor: colors.Colors.Gray01,
155
+ borderRadius: '4px',
156
+ height: '40px',
157
+ width: '130px',
158
+ } }, 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) => {
159
+ const user = review.user || {};
160
+ return (index.h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
161
+ borderBottom: `1px solid ${colors.Colors.Gray02}`,
162
+ marginBottom: '24px',
163
+ paddingBottom: '24px',
164
+ } }, 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: {
165
+ color: score <= review.point ? this.primaryColor : colors.Colors.Gray04,
166
+ fontSize: '16px',
167
+ marginRight: '4px',
168
+ } }))), 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: {
169
+ display: 'flex',
170
+ flexDirection: 'row',
171
+ overflowX: 'auto',
172
+ } }, review.photos.map(fileObj => (index.h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
173
+ position: 'relative',
174
+ cursor: 'pointer',
175
+ marginTop: '16px',
176
+ marginRight: '12px',
177
+ } }, index.h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
178
+ })), index.h("div", { class: "salon-reviews--list-footer", style: {
179
+ textAlign: 'center',
180
+ paddingTop: '16px',
181
+ paddingBottom: '16px',
182
+ } }, index.h("button", { class: "btn btn-light btn-lg", style: {
183
+ background: colors.Colors.White,
184
+ border: `1px solid ${colors.Colors.Gray02}`,
185
+ borderRadius: '4px',
186
+ paddingLeft: '24px',
187
+ paddingRight: '24px',
188
+ }, onClick: () => this.onLoadMore() }, "Load more"))));
189
+ }
190
+ };
191
+ SalonReviews.style = indexCss;
192
+
193
+ exports.salon_reviews = SalonReviews;
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-47c2a5f6.js');
6
+ const services = require('./services-125c82d8.js');
7
+ const colors = require('./colors-38421769.js');
8
+ require('./_commonjsHelpers-5cfcba41.js');
9
+
10
+ const indexCss = "";
11
+
12
+ const SalonServices = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.salonId = undefined;
16
+ this.buttonClass = 'btn btn-light';
17
+ this.salonServices = undefined;
18
+ this.isLoading = undefined;
19
+ }
20
+ componentWillLoad() {
21
+ this.fetchData();
22
+ }
23
+ async fetchData() {
24
+ this.isLoading = true;
25
+ try {
26
+ this.salonServices = await services.HttpService().fetchSalonServices(this.salonId);
27
+ }
28
+ catch (e) {
29
+ this.salonServices = [];
30
+ }
31
+ this.isLoading = false;
32
+ }
33
+ render() {
34
+ if (this.isLoading) {
35
+ 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: {
36
+ backgroundColor: colors.Colors.Gray02,
37
+ float: 'left',
38
+ marginRight: '12px',
39
+ height: '30px',
40
+ width: '120px',
41
+ } })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index$1) => {
42
+ return (index.h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
43
+ backgroundColor: colors.Colors.Gray03,
44
+ height: '20px',
45
+ width: '120px',
46
+ } }), 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 ? {
47
+ marginTop: '12px',
48
+ paddingTop: '12px',
49
+ borderTop: `1px solid ${colors.Colors.Gray01}`,
50
+ } : {}) }, index.h("div", { key: `service-group--${fakeId}--${index$1}`, style: {
51
+ backgroundColor: colors.Colors.Gray01,
52
+ height: '16px',
53
+ width: '120px',
54
+ } })), index.h("div", { style: { marginTop: '4px' } }, index.h("div", { style: {
55
+ backgroundColor: colors.Colors.Gray01,
56
+ height: '16px',
57
+ width: '240px',
58
+ } })))))))));
59
+ })));
60
+ }
61
+ 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 => {
62
+ const hasMultipleCates = (serviceGroup.data || []).length > 1;
63
+ 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 ? {
64
+ marginTop: '12px',
65
+ paddingTop: '12px',
66
+ borderTop: `1px solid ${colors.Colors.Gray01}`,
67
+ } : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (index.h("div", { style: {
68
+ display: 'block',
69
+ marginTop: '4px',
70
+ fontSize: '90%',
71
+ color: colors.Colors.Gray05,
72
+ } }, [
73
+ !service.hideDuration ? `${service.duration} mins` : '',
74
+ !service.hidePrice ? `$${service.price}` : '',
75
+ ].filter(field => !!field).join(' · ')))))))))))));
76
+ })));
77
+ }
78
+ };
79
+ SalonServices.style = indexCss;
80
+
81
+ exports.salon_services = SalonServices;
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-47c2a5f6.js');
6
+ const colors = require('./colors-38421769.js');
7
+ const services = require('./services-125c82d8.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
+ const SalonStylists = class {
14
+ constructor(hostRef) {
15
+ index.registerInstance(this, hostRef);
16
+ this.salonId = undefined;
17
+ this.salonStylists = undefined;
18
+ this.totalStylists = undefined;
19
+ this.page = 1;
20
+ this.isLoading = undefined;
21
+ this.isLoadingMore = undefined;
22
+ this.canLoadMore = undefined;
23
+ }
24
+ componentWillLoad() {
25
+ this.fetchData();
26
+ }
27
+ async fetchData() {
28
+ this.isLoading = true;
29
+ try {
30
+ const { total, data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
31
+ this.totalStylists = total;
32
+ this.salonStylists = data;
33
+ this.canLoadMore = data.length === pageLimit;
34
+ }
35
+ catch (e) {
36
+ this.totalStylists = 0;
37
+ this.salonStylists = [];
38
+ this.canLoadMore = false;
39
+ }
40
+ this.isLoading = false;
41
+ }
42
+ async onLoadMore() {
43
+ this.isLoadingMore = true;
44
+ try {
45
+ const { data } = await services.HttpService().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
46
+ this.salonStylists = this.salonStylists.concat(data || []);
47
+ this.canLoadMore = data.length === pageLimit;
48
+ this.page += 1;
49
+ }
50
+ catch (e) { }
51
+ this.isLoadingMore = false;
52
+ }
53
+ render() {
54
+ if (this.isLoading) {
55
+ 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: {
56
+ background: 'none',
57
+ border: 'none',
58
+ overflow: 'hidden',
59
+ } }, index.h("div", { class: "salon-stylist--avatar", style: {
60
+ backgroundColor: colors.Colors.Gray01,
61
+ backgroundRepeat: 'no-repeat',
62
+ backgroundPosition: 'center top',
63
+ backgroundSize: 'cover',
64
+ border: `1px solid ${colors.Colors.Gray01}`,
65
+ borderRadius: '8px',
66
+ position: 'relative',
67
+ display: 'flex',
68
+ width: '100%',
69
+ alignItems: 'center',
70
+ justifyContent: 'center',
71
+ } }), index.h("div", { class: "card-body" }, index.h("div", { key: `stylist--${fakeId}--${index$1}`, style: {
72
+ backgroundColor: colors.Colors.Gray01,
73
+ height: '16px',
74
+ width: '120px',
75
+ margin: 'auto',
76
+ } })))))))));
77
+ }
78
+ 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: {
79
+ background: 'none',
80
+ border: 'none',
81
+ overflow: 'hidden',
82
+ } }, index.h("div", { class: "salon-stylist--avatar", style: {
83
+ backgroundImage: `url("${stylist.avatar}")`,
84
+ backgroundColor: colors.Colors.Gray01,
85
+ backgroundRepeat: 'no-repeat',
86
+ backgroundPosition: 'center top',
87
+ backgroundSize: 'cover',
88
+ border: `1px solid ${colors.Colors.Gray01}`,
89
+ borderRadius: '8px',
90
+ position: 'relative',
91
+ display: 'flex',
92
+ width: '100%',
93
+ alignItems: 'center',
94
+ justifyContent: 'center',
95
+ } }, !stylist.avatar && (index.h("span", { style: {
96
+ fontSize: '32px',
97
+ fontWeight: 'bold',
98
+ textTransform: 'uppercase',
99
+ } }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), index.h("div", { class: "card-body" }, index.h("div", { style: {
100
+ fontSize: '18px',
101
+ fontWeight: '600',
102
+ textAlign: 'center',
103
+ } }, stylist.fullName))))))), this.canLoadMore && (index.h("div", { class: "view-footer", style: {
104
+ textAlign: 'center',
105
+ paddingTop: '32px',
106
+ paddingBottom: '16px',
107
+ } }, index.h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
108
+ background: colors.Colors.White,
109
+ border: `1px solid ${colors.Colors.Gray02}`,
110
+ borderRadius: '4px',
111
+ paddingLeft: '24px',
112
+ paddingRight: '24px',
113
+ }, onClick: () => this.onLoadMore() }, "Load more")))));
114
+ }
115
+ };
116
+ SalonStylists.style = indexCss;
117
+
118
+ exports.salon_stylists = SalonStylists;