favesalon-embed 1.0.4 → 1.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 (177) hide show
  1. package/dist/custom-elements/index.d.ts +6 -0
  2. package/dist/{cjs/_commonjsHelpers-5cfcba41.js → favesalon-embed/_commonjsHelpers-a4f66ccd.js} +14 -6
  3. package/dist/favesalon-embed/app-globals-74127f4b.js +7 -0
  4. package/dist/favesalon-embed/chat-box.entry.js +55 -0
  5. package/dist/{esm → favesalon-embed}/chat-button.entry.js +4 -4
  6. package/dist/favesalon-embed/chat-form.entry.js +39 -0
  7. package/dist/favesalon-embed/chat-messages.entry.js +71 -0
  8. package/dist/favesalon-embed/chat-rooms.entry.js +111 -0
  9. package/dist/favesalon-embed/css-shim-b7d3d95f.js +4 -0
  10. package/dist/favesalon-embed/dom-64053c71.js +73 -0
  11. package/dist/favesalon-embed/favesalon-embed.css +114 -1
  12. package/dist/favesalon-embed/favesalon-embed.esm.js +148 -1
  13. package/dist/{esm → favesalon-embed}/google-map.entry.js +1 -1
  14. package/dist/{esm/index-a1c7583c.js → favesalon-embed/index-00b83e1c.js} +425 -15
  15. package/dist/favesalon-embed/index-888e99e3.js +3371 -0
  16. package/dist/favesalon-embed/index.esm.js +1 -0
  17. package/dist/{esm/chat-box_5.entry.js → favesalon-embed/lodash-d5526b38.js} +27 -243
  18. package/dist/{cjs/chat-button.cjs.entry.js → favesalon-embed/notify-sounds.entry.js} +20 -44
  19. package/dist/favesalon-embed/relativeTime-268e64b0.js +7 -0
  20. package/dist/{esm → favesalon-embed}/salon-booking-modal.entry.js +1 -1
  21. package/dist/{esm → favesalon-embed}/salon-booking.entry.js +3 -3
  22. package/dist/{esm → favesalon-embed}/salon-gift-card-modal.entry.js +1 -1
  23. package/dist/{esm → favesalon-embed}/salon-gift-card.entry.js +3 -3
  24. package/dist/{esm → favesalon-embed}/salon-info.entry.js +3 -3
  25. package/dist/{esm → favesalon-embed}/salon-latest-reviews.entry.js +4 -4
  26. package/dist/{collection/components/salon-latest-styles/index.js → favesalon-embed/salon-latest-styles.entry.js} +14 -99
  27. package/dist/{collection/components/salon-locations/index.js → favesalon-embed/salon-locations.entry.js} +15 -95
  28. package/dist/{esm → favesalon-embed}/salon-lookbook.entry.js +3 -3
  29. package/dist/{esm → favesalon-embed}/salon-ranking.entry.js +1 -1
  30. package/dist/{esm → favesalon-embed}/salon-reviews.entry.js +3 -3
  31. package/dist/{collection/components/salon-schedules/index.js → favesalon-embed/salon-schedules.entry.js} +14 -95
  32. package/dist/{esm → favesalon-embed}/salon-services.entry.js +3 -3
  33. package/dist/{esm → favesalon-embed}/salon-stylists.entry.js +3 -3
  34. package/dist/favesalon-embed/services-122dcf73.js +23886 -0
  35. package/dist/{cjs/services-d1bdf299.js → favesalon-embed/services-23eda072.js} +2487 -104
  36. package/dist/favesalon-embed/services-243eef47.js +23880 -0
  37. package/dist/favesalon-embed/services-260ea6eb.js +23883 -0
  38. package/dist/favesalon-embed/services-27607998.js +23886 -0
  39. package/dist/{esm/services-257442e2.js → favesalon-embed/services-46b2f0aa.js} +2482 -101
  40. package/dist/favesalon-embed/services-65a8cf4a.js +23887 -0
  41. package/dist/favesalon-embed/services-8f52210f.js +23880 -0
  42. package/dist/favesalon-embed/services-de32365e.js +23880 -0
  43. package/dist/favesalon-embed/services-e9cfcd2b.js +23885 -0
  44. package/dist/favesalon-embed/services-f7278483.js +23880 -0
  45. package/dist/favesalon-embed/services-f9872bea.js +23880 -0
  46. package/dist/favesalon-embed/shadow-css-98135883.js +387 -0
  47. package/dist/{esm → favesalon-embed}/style-detail.entry.js +4 -4
  48. package/dist/favesalon-embed/user-avatar.entry.js +50 -0
  49. package/dist/{esm/utils-e97485e0.js → favesalon-embed/utils-2c19db45.js} +6 -0
  50. package/dist/{collection/utils/utils.js → favesalon-embed/utils-89c2cff2.js} +14 -5
  51. package/dist/{cjs/utils-c5a33b3c.js → favesalon-embed/utils-e226fa04.js} +14 -5
  52. package/dist/favesalon-embed/utils-fd30fb29.js +32 -0
  53. package/dist/types/components/chat-box/index.d.ts +1 -0
  54. package/dist/types/components/chat-button/notify-sounds.d.ts +5 -0
  55. package/dist/types/components/chat-rooms/index.d.ts +6 -0
  56. package/dist/types/components.d.ts +21 -0
  57. package/dist/types/services/services.d.ts +1 -0
  58. package/dist/types/types/chat.d.ts +1 -0
  59. package/dist/types/types/user.d.ts +10 -0
  60. package/dist/types/utils/utils.d.ts +1 -0
  61. package/package.json +1 -1
  62. package/dist/cjs/chat-box_5.cjs.entry.js +0 -17439
  63. package/dist/cjs/colors-38421769.js +0 -69
  64. package/dist/cjs/favesalon-embed.cjs.js +0 -23
  65. package/dist/cjs/google-map.cjs.entry.js +0 -52
  66. package/dist/cjs/index-7f190886.js +0 -4396
  67. package/dist/cjs/index-dd8176c4.js +0 -1531
  68. package/dist/cjs/index.cjs.js +0 -2
  69. package/dist/cjs/loader.cjs.js +0 -22
  70. package/dist/cjs/relativeTime-3721080d.js +0 -9
  71. package/dist/cjs/salon-booking-modal.cjs.entry.js +0 -30
  72. package/dist/cjs/salon-booking.cjs.entry.js +0 -51
  73. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +0 -29
  74. package/dist/cjs/salon-gift-card.cjs.entry.js +0 -51
  75. package/dist/cjs/salon-info.cjs.entry.js +0 -33
  76. package/dist/cjs/salon-latest-reviews.cjs.entry.js +0 -97
  77. package/dist/cjs/salon-latest-styles_3.cjs.entry.js +0 -241
  78. package/dist/cjs/salon-lookbook.cjs.entry.js +0 -222
  79. package/dist/cjs/salon-ranking.cjs.entry.js +0 -60
  80. package/dist/cjs/salon-reviews.cjs.entry.js +0 -193
  81. package/dist/cjs/salon-services.cjs.entry.js +0 -81
  82. package/dist/cjs/salon-stylists.cjs.entry.js +0 -118
  83. package/dist/cjs/style-detail.cjs.entry.js +0 -312
  84. package/dist/collection/collection-manifest.json +0 -33
  85. package/dist/collection/components/chat-box/index.css +0 -105
  86. package/dist/collection/components/chat-box/index.js +0 -138
  87. package/dist/collection/components/chat-button/index.css +0 -101
  88. package/dist/collection/components/chat-button/index.js +0 -155
  89. package/dist/collection/components/chat-form/index.css +0 -40
  90. package/dist/collection/components/chat-form/index.js +0 -79
  91. package/dist/collection/components/chat-messages/index.css +0 -48
  92. package/dist/collection/components/chat-messages/index.js +0 -142
  93. package/dist/collection/components/chat-rooms/index.css +0 -102
  94. package/dist/collection/components/chat-rooms/index.js +0 -157
  95. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  96. package/dist/collection/components/google-map/index.css +0 -5
  97. package/dist/collection/components/google-map/index.js +0 -90
  98. package/dist/collection/components/salon-booking/index.css +0 -30
  99. package/dist/collection/components/salon-booking/index.js +0 -126
  100. package/dist/collection/components/salon-booking/salon-booking-modal.js +0 -92
  101. package/dist/collection/components/salon-gift-card/index.css +0 -30
  102. package/dist/collection/components/salon-gift-card/index.js +0 -126
  103. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -73
  104. package/dist/collection/components/salon-info/index.css +0 -1
  105. package/dist/collection/components/salon-info/index.js +0 -77
  106. package/dist/collection/components/salon-latest-reviews/index.css +0 -11
  107. package/dist/collection/components/salon-latest-reviews/index.js +0 -163
  108. package/dist/collection/components/salon-latest-styles/index.css +0 -12
  109. package/dist/collection/components/salon-locations/index.css +0 -24
  110. package/dist/collection/components/salon-lookbook/index.css +0 -15
  111. package/dist/collection/components/salon-lookbook/index.js +0 -368
  112. package/dist/collection/components/salon-ranking/index.css +0 -3
  113. package/dist/collection/components/salon-ranking/index.js +0 -117
  114. package/dist/collection/components/salon-reviews/index.css +0 -18
  115. package/dist/collection/components/salon-reviews/index.js +0 -249
  116. package/dist/collection/components/salon-schedules/index.css +0 -18
  117. package/dist/collection/components/salon-services/index.css +0 -1
  118. package/dist/collection/components/salon-services/index.js +0 -146
  119. package/dist/collection/components/salon-stylists/index.css +0 -43
  120. package/dist/collection/components/salon-stylists/index.js +0 -184
  121. package/dist/collection/components/style-detail/index.css +0 -76
  122. package/dist/collection/components/style-detail/index.js +0 -386
  123. package/dist/collection/components/user-avatar/index.css +0 -0
  124. package/dist/collection/components/user-avatar/index.js +0 -159
  125. package/dist/collection/constants/colors.js +0 -65
  126. package/dist/collection/global/global.js +0 -0
  127. package/dist/collection/index.js +0 -1
  128. package/dist/collection/mocks/users.js +0 -10
  129. package/dist/collection/services/services.js +0 -295
  130. package/dist/collection/types/chat.js +0 -23
  131. package/dist/collection/types/common.js +0 -11
  132. package/dist/collection/types/review.js +0 -39
  133. package/dist/collection/types/salon.js +0 -58
  134. package/dist/collection/types/service.js +0 -24
  135. package/dist/collection/types/style.js +0 -128
  136. package/dist/collection/types/stylist.js +0 -30
  137. package/dist/collection/types/user.js +0 -10
  138. package/dist/custom-elements/index.js +0 -44974
  139. package/dist/esm/_commonjsHelpers-66ac50f5.js +0 -32
  140. package/dist/esm/favesalon-embed.js +0 -18
  141. package/dist/esm/index-0494771f.js +0 -1504
  142. package/dist/esm/index.js +0 -1
  143. package/dist/esm/loader.js +0 -18
  144. package/dist/esm/polyfills/core-js.js +0 -11
  145. package/dist/esm/polyfills/css-shim.js +0 -1
  146. package/dist/esm/polyfills/dom.js +0 -79
  147. package/dist/esm/polyfills/es5-html-element.js +0 -1
  148. package/dist/esm/polyfills/index.js +0 -34
  149. package/dist/esm/polyfills/system.js +0 -6
  150. package/dist/esm/relativeTime-baa50aa2.js +0 -7
  151. package/dist/esm/salon-latest-styles_3.entry.js +0 -235
  152. package/dist/favesalon-embed/p-05a1c88a.entry.js +0 -1
  153. package/dist/favesalon-embed/p-0acf0447.entry.js +0 -1
  154. package/dist/favesalon-embed/p-0bc4f624.js +0 -1
  155. package/dist/favesalon-embed/p-1af1515f.entry.js +0 -1
  156. package/dist/favesalon-embed/p-1cba5fc9.entry.js +0 -1
  157. package/dist/favesalon-embed/p-39a4ef15.entry.js +0 -1
  158. package/dist/favesalon-embed/p-3e2cb05b.entry.js +0 -1
  159. package/dist/favesalon-embed/p-47e646f8.js +0 -1
  160. package/dist/favesalon-embed/p-487b311f.entry.js +0 -1
  161. package/dist/favesalon-embed/p-55387c2f.entry.js +0 -1
  162. package/dist/favesalon-embed/p-566f05b4.entry.js +0 -1
  163. package/dist/favesalon-embed/p-862a0de0.entry.js +0 -1
  164. package/dist/favesalon-embed/p-9fe0cbeb.js +0 -2
  165. package/dist/favesalon-embed/p-a33331cc.js +0 -1
  166. package/dist/favesalon-embed/p-aeeb7b5f.entry.js +0 -1
  167. package/dist/favesalon-embed/p-b08e5b54.js +0 -6
  168. package/dist/favesalon-embed/p-b5cca5fc.entry.js +0 -1
  169. package/dist/favesalon-embed/p-c7fb7af5.js +0 -1580
  170. package/dist/favesalon-embed/p-ccab56d8.js +0 -1
  171. package/dist/favesalon-embed/p-d6e13053.entry.js +0 -1
  172. package/dist/favesalon-embed/p-dee42d34.entry.js +0 -1
  173. package/dist/favesalon-embed/p-e661ca1d.entry.js +0 -1
  174. package/dist/favesalon-embed/p-eeceab9c.entry.js +0 -1
  175. package/dist/index.cjs.js +0 -1
  176. package/dist/index.js +0 -1
  177. /package/dist/{esm → favesalon-embed}/colors-ea36347a.js +0 -0
@@ -1,222 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-dd8176c4.js');
6
- const colors = require('./colors-38421769.js');
7
- const services = require('./services-d1bdf299.js');
8
- require('./_commonjsHelpers-5cfcba41.js');
9
-
10
- const indexCss = "@media (max-width: 768px){salon-lookbook .view-header{display:block !important}salon-lookbook .salon-loobook--serch-result{margin-bottom:16px}salon-lookbook .salon-loobook--filter-wrapper>label,salon-lookbook .salon-loobook--sort-wrapper>label{display:none !important}}";
11
-
12
- const lookbookSortOptions = [{
13
- value: 'like',
14
- label: 'Most popular',
15
- }, {
16
- value: 'newest',
17
- label: 'Newest first',
18
- }, {
19
- value: 'oldest',
20
- label: 'Oldest first',
21
- }];
22
- const lookbookFilterOptions = [{
23
- value: 'all',
24
- label: 'All Category',
25
- }];
26
- const SalonLookbook = class {
27
- constructor(hostRef) {
28
- index.registerInstance(this, hostRef);
29
- this.salonId = undefined;
30
- this.isLoading = true;
31
- this.isLoadingMore = undefined;
32
- this.hideLoadMore = undefined;
33
- this.currentPage = 1;
34
- this.totalLookbooks = 0;
35
- this.salonCategories = [];
36
- this.salonLookbooks = [];
37
- this.sortBy = lookbookSortOptions[1].value;
38
- this.filterBy = lookbookFilterOptions[0].value;
39
- this.isLayoutSetup = undefined;
40
- }
41
- componentWillLoad() {
42
- this.fetchData();
43
- this.injectSDK();
44
- }
45
- componentDidRender() {
46
- this.setupGridLayout();
47
- }
48
- injectSDK() {
49
- return new Promise((resolve) => {
50
- const script = document.createElement('script');
51
- script.type = 'text/javascript';
52
- script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
53
- document.body.appendChild(script);
54
- return resolve(true);
55
- });
56
- }
57
- setupGridLayout() {
58
- if (!this.isLayoutSetup && document.querySelector('#salon-loobooks--grid')) {
59
- const script = document.createElement('script');
60
- script.type = 'text/javascript';
61
- script.innerHTML = `
62
- var masonry = new Macy({
63
- container: '#salon-loobooks--grid',
64
- useContainerForBreakpoints: true,
65
- margin: 16,
66
- columns: 5,
67
- breakAt: {
68
- 1024: {
69
- columns: 4,
70
- },
71
- 768: {
72
- columns: 3,
73
- },
74
- 576: {
75
- margin: 16,
76
- columns: 2,
77
- },
78
- },
79
- });
80
- `;
81
- document.body.appendChild(script);
82
- this.isLayoutSetup = true;
83
- }
84
- }
85
- async fetchData() {
86
- try {
87
- const promises = [
88
- this.fetchLookbooks(Object.assign({ page: 1, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {})),
89
- this.fetchCategories(),
90
- ];
91
- return Promise.all(promises);
92
- }
93
- catch (e) { }
94
- }
95
- async fetchLookbooks(options, isLoadingMore) {
96
- if (isLoadingMore) {
97
- this.isLoadingMore = true;
98
- }
99
- else {
100
- this.isLoading = true;
101
- }
102
- try {
103
- const { total, allLookbooks } = await services.HttpService().fetchSalonLookbooks(this.salonId, options);
104
- this.totalLookbooks = total;
105
- this.salonLookbooks = this.salonLookbooks.concat(allLookbooks);
106
- this.hideLoadMore = allLookbooks.length < 20;
107
- }
108
- catch (error) { }
109
- if (isLoadingMore) {
110
- this.isLoadingMore = false;
111
- }
112
- else {
113
- this.isLoading = false;
114
- }
115
- }
116
- async onChangeFiltering(filterBy) {
117
- try {
118
- this.currentPage = 1;
119
- this.totalLookbooks = 0;
120
- this.salonLookbooks = [];
121
- this.hideLoadMore = true;
122
- this.filterBy = filterBy;
123
- await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [Number(this.filterBy)] } : {}));
124
- if (window.masonry) {
125
- this.isLayoutSetup = false;
126
- }
127
- }
128
- catch (error) { }
129
- }
130
- async onChangeSorting(sortBy) {
131
- try {
132
- this.currentPage = 1;
133
- this.totalLookbooks = 0;
134
- this.salonLookbooks = [];
135
- this.hideLoadMore = true;
136
- this.sortBy = sortBy;
137
- await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {}));
138
- if (window.masonry) {
139
- this.isLayoutSetup = false;
140
- }
141
- }
142
- catch (error) { }
143
- }
144
- async onLoadMore() {
145
- try {
146
- this.currentPage += 1;
147
- await this.fetchLookbooks({ page: this.currentPage }, true);
148
- if (window.masonry) {
149
- this.isLayoutSetup = false;
150
- }
151
- }
152
- catch (error) { }
153
- }
154
- async fetchCategories() {
155
- try {
156
- this.salonCategories = await services.HttpService().fetchSalonCategories();
157
- }
158
- catch (error) { }
159
- }
160
- onClickLookbook(style) {
161
- const elLookbookModal = document.createElement('div');
162
- elLookbookModal.innerHTML = `
163
- <style-detail
164
- salon-id=${this.salonId}
165
- salon-lookbook='${JSON.stringify(style)}'
166
- ></style-detail>
167
- `;
168
- document.body.appendChild(elLookbookModal);
169
- }
170
- renderHeader() {
171
- const allFilterOptions = lookbookFilterOptions.concat(([...this.salonCategories]).map(category => {
172
- return {
173
- value: category.id,
174
- label: category.name,
175
- };
176
- }));
177
- return (index.h("div", { class: "view-header", style: {
178
- display: 'flex',
179
- flexDirection: 'row',
180
- justifyContent: 'space-between',
181
- alignItems: 'center',
182
- marginBottom: '24px',
183
- } }, index.h("div", { class: "salon-loobook--serch-result" }, this.totalLookbooks, " ", this.totalLookbooks === 1 ? 'result' : 'results'), index.h("div", { style: {
184
- display: 'flex',
185
- flexDirection: 'row',
186
- alignItems: 'center',
187
- } }, index.h("div", { class: "salon-loobook--filter-wrapper", style: {
188
- display: 'flex',
189
- flexDirection: 'row',
190
- alignItems: 'center',
191
- marginRight: '16px',
192
- } }, index.h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Filter by"), index.h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeFiltering(evt.target.value) }, allFilterOptions.map(filterOption => (index.h("option", { value: filterOption.value, selected: String(filterOption.value) === String(this.filterBy) }, filterOption.label))))), index.h("div", { class: "salon-loobook--sort-wrapper", style: {
193
- display: 'flex',
194
- flexDirection: 'row',
195
- alignItems: 'center',
196
- } }, index.h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Sort by"), index.h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeSorting(evt.target.value) }, lookbookSortOptions.map(sortOption => (index.h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy }, sortOption.label))))))));
197
- }
198
- render() {
199
- return (index.h("div", { class: "salon-loobooks" }, index.h("div", null, index.h("div", { class: "view-content" }, this.renderHeader(), this.salonLookbooks.length > 0 && (index.h("div", { class: "salon-loobooks--grid", id: "salon-loobooks--grid" }, this.salonLookbooks.map(style => {
200
- const { caption, imageThumbMedium, owner } = style;
201
- return (index.h("div", { class: "salon-lookbook salon-loobooks--grid-item", onClick: () => this.onClickLookbook(style) }, index.h("div", { class: "card", style: {
202
- background: 'none',
203
- border: 'none',
204
- // maxWidth: '200px',
205
- } }, index.h("div", { class: "salon-lookbook--image", style: {
206
- borderRadius: '8px',
207
- overflow: 'hidden',
208
- minHeight: '80px',
209
- background: colors.Colors.Gray01,
210
- } }, index.h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })), owner && (index.h("div", { class: "card-body", style: { paddingLeft: '0' } }, index.h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
211
- })))), this.salonLookbooks.length > 0 && !this.hideLoadMore && (index.h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } }, index.h("button", { type: "button", class: "btn btn-light btn-lg", onClick: () => this.onLoadMore(), style: {
212
- background: colors.Colors.White,
213
- border: `1px solid ${colors.Colors.Gray02}`,
214
- borderRadius: '4px',
215
- paddingLeft: '24px',
216
- paddingRight: '24px',
217
- } }, this.isLoadingMore ? 'Loading' : 'Load more'))))));
218
- }
219
- };
220
- SalonLookbook.style = indexCss;
221
-
222
- exports.salon_lookbook = SalonLookbook;
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-dd8176c4.js');
6
- const colors = require('./colors-38421769.js');
7
-
8
- const indexCss = "salon-ranking{display:block}";
9
-
10
- const SalonRanking = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.ranking = undefined;
14
- this.height = 16;
15
- this.width = 16;
16
- }
17
- getRankingData(ranking) {
18
- if (ranking === 5) {
19
- return {
20
- color: colors.Colors.Primary,
21
- text: 'Viral',
22
- };
23
- }
24
- if (ranking === 4) {
25
- return {
26
- color: colors.Colors.Orange03,
27
- text: 'Advancing',
28
- };
29
- }
30
- if (ranking === 3) {
31
- return {
32
- color: colors.Colors.Lilac03,
33
- text: 'Progressing',
34
- };
35
- }
36
- if (ranking === 2) {
37
- return {
38
- color: colors.Colors.Blue03,
39
- text: 'Building',
40
- };
41
- }
42
- return {
43
- color: colors.Colors.Gray05,
44
- text: 'Starting',
45
- };
46
- }
47
- render() {
48
- const rankingData = this.getRankingData(this.ranking);
49
- return (index.h("div", { style: {
50
- display: 'flex',
51
- alignItems: 'center',
52
- justifyContent: 'center',
53
- width: '100%',
54
- color: rankingData.color,
55
- } }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", width: this.width, height: this.height, viewBox: `0 0 ${this.width} ${this.height}`, style: { maxWidth: `${this.width}px`, height: 'auto', marginRight: '8px' } }, index.h("path", { d: "M14.9984 14.1273C15.0188 14.2658 14.8369 14.3204 14.7415 14.2251L8.11345 7.6028C6.41272 5.90355 6.42184 3.19468 8.23887 1.76037C9.63972 0.678363 11.7259 0.753791 13.1793 1.96961C14.1899 2.80207 14.706 3.93808 14.7471 5.07223L14.9984 14.1273Z", fill: "currentColor" }), index.h("path", { d: "M1.74847 8.24513C3.18403 6.42967 5.91004 6.40579 7.61078 8.10504L14.2548 14.7432C14.3501 14.8385 14.2795 15.0043 14.1568 14.9999L5.078 14.7329C3.94287 14.6918 2.78997 14.1604 1.97268 13.1665C0.755801 11.7144 0.680308 9.62998 1.74847 8.24513Z", fill: "currentColor" })), rankingData.text));
56
- }
57
- };
58
- SalonRanking.style = indexCss;
59
-
60
- exports.salon_ranking = SalonRanking;
@@ -1,193 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-dd8176c4.js');
6
- const services = require('./services-d1bdf299.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;
@@ -1,81 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-dd8176c4.js');
6
- const services = require('./services-d1bdf299.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;