favesalon-embed 1.0.3 → 1.0.4

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 (161) hide show
  1. package/dist/{favesalon-embed/_commonjsHelpers-9bc404fc.js → cjs/_commonjsHelpers-5cfcba41.js} +6 -14
  2. package/dist/cjs/chat-box_5.cjs.entry.js +17439 -0
  3. package/dist/cjs/chat-button.cjs.entry.js +55 -0
  4. package/dist/cjs/colors-38421769.js +69 -0
  5. package/dist/cjs/favesalon-embed.cjs.js +23 -0
  6. package/dist/cjs/google-map.cjs.entry.js +52 -0
  7. package/dist/{favesalon-embed/index-ac52896a.js → cjs/index-7f190886.js} +47 -454
  8. package/dist/cjs/index-dd8176c4.js +1531 -0
  9. package/dist/cjs/index.cjs.js +2 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/dist/cjs/relativeTime-3721080d.js +9 -0
  12. package/dist/cjs/salon-booking-modal.cjs.entry.js +30 -0
  13. package/dist/cjs/salon-booking.cjs.entry.js +51 -0
  14. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
  15. package/dist/cjs/salon-gift-card.cjs.entry.js +51 -0
  16. package/dist/cjs/salon-info.cjs.entry.js +33 -0
  17. package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
  18. package/dist/cjs/salon-latest-styles_3.cjs.entry.js +241 -0
  19. package/dist/cjs/salon-lookbook.cjs.entry.js +222 -0
  20. package/dist/cjs/salon-ranking.cjs.entry.js +60 -0
  21. package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
  22. package/dist/cjs/salon-services.cjs.entry.js +81 -0
  23. package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
  24. package/dist/{favesalon-embed/services-7cb8f2a6.js → cjs/services-d1bdf299.js} +55 -2415
  25. package/dist/cjs/style-detail.cjs.entry.js +312 -0
  26. package/dist/cjs/utils-c5a33b3c.js +23 -0
  27. package/dist/collection/collection-manifest.json +33 -0
  28. package/dist/collection/components/chat-box/index.css +105 -0
  29. package/dist/collection/components/chat-box/index.js +138 -0
  30. package/dist/collection/components/chat-button/index.css +101 -0
  31. package/dist/collection/components/chat-button/index.js +155 -0
  32. package/dist/collection/components/chat-form/index.css +40 -0
  33. package/dist/collection/components/chat-form/index.js +79 -0
  34. package/dist/collection/components/chat-messages/index.css +48 -0
  35. package/dist/collection/components/chat-messages/index.js +142 -0
  36. package/dist/collection/components/chat-rooms/index.css +102 -0
  37. package/dist/collection/components/chat-rooms/index.js +157 -0
  38. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  39. package/dist/collection/components/google-map/index.css +5 -0
  40. package/dist/collection/components/google-map/index.js +90 -0
  41. package/dist/collection/components/salon-booking/index.css +30 -0
  42. package/dist/collection/components/salon-booking/index.js +126 -0
  43. package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
  44. package/dist/collection/components/salon-gift-card/index.css +30 -0
  45. package/dist/collection/components/salon-gift-card/index.js +126 -0
  46. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
  47. package/dist/collection/components/salon-info/index.css +1 -0
  48. package/dist/collection/components/salon-info/index.js +77 -0
  49. package/dist/collection/components/salon-latest-reviews/index.css +11 -0
  50. package/dist/collection/components/salon-latest-reviews/index.js +163 -0
  51. package/dist/collection/components/salon-latest-styles/index.css +12 -0
  52. package/dist/{favesalon-embed/salon-latest-styles.entry.js → collection/components/salon-latest-styles/index.js} +99 -14
  53. package/dist/collection/components/salon-locations/index.css +24 -0
  54. package/dist/{favesalon-embed/salon-locations.entry.js → collection/components/salon-locations/index.js} +95 -15
  55. package/dist/collection/components/salon-lookbook/index.css +15 -0
  56. package/dist/collection/components/salon-lookbook/index.js +368 -0
  57. package/dist/collection/components/salon-ranking/index.css +3 -0
  58. package/dist/collection/components/salon-ranking/index.js +117 -0
  59. package/dist/collection/components/salon-reviews/index.css +18 -0
  60. package/dist/collection/components/salon-reviews/index.js +249 -0
  61. package/dist/collection/components/salon-schedules/index.css +18 -0
  62. package/dist/{favesalon-embed/salon-schedules.entry.js → collection/components/salon-schedules/index.js} +95 -14
  63. package/dist/collection/components/salon-services/index.css +1 -0
  64. package/dist/collection/components/salon-services/index.js +146 -0
  65. package/dist/collection/components/salon-stylists/index.css +43 -0
  66. package/dist/collection/components/salon-stylists/index.js +184 -0
  67. package/dist/collection/components/style-detail/index.css +76 -0
  68. package/dist/collection/components/style-detail/index.js +386 -0
  69. package/dist/collection/components/user-avatar/index.css +0 -0
  70. package/dist/collection/components/user-avatar/index.js +159 -0
  71. package/dist/collection/constants/colors.js +65 -0
  72. package/dist/collection/global/global.js +0 -0
  73. package/dist/collection/index.js +1 -0
  74. package/dist/collection/mocks/users.js +10 -0
  75. package/dist/collection/services/services.js +295 -0
  76. package/dist/collection/types/chat.js +23 -0
  77. package/dist/collection/types/common.js +11 -0
  78. package/dist/collection/types/review.js +39 -0
  79. package/dist/collection/types/salon.js +58 -0
  80. package/dist/collection/types/service.js +24 -0
  81. package/dist/collection/types/style.js +128 -0
  82. package/dist/collection/types/stylist.js +30 -0
  83. package/dist/collection/types/user.js +10 -0
  84. package/dist/collection/utils/utils.js +23 -0
  85. package/dist/custom-elements/index.js +44974 -0
  86. package/dist/{favesalon-embed/_commonjsHelpers-a4f66ccd.js → esm/_commonjsHelpers-66ac50f5.js} +2 -14
  87. package/dist/{favesalon-embed/chat-rooms.entry.js → esm/chat-box_5.entry.js} +182 -30
  88. package/dist/{favesalon-embed → esm}/chat-button.entry.js +3 -3
  89. package/dist/esm/favesalon-embed.js +18 -0
  90. package/dist/{favesalon-embed → esm}/google-map.entry.js +1 -1
  91. package/dist/esm/index-0494771f.js +1504 -0
  92. package/dist/{favesalon-embed/index-00b83e1c.js → esm/index-a1c7583c.js} +15 -425
  93. package/dist/esm/index.js +1 -0
  94. package/dist/esm/loader.js +18 -0
  95. package/dist/esm/polyfills/core-js.js +11 -0
  96. package/dist/esm/polyfills/css-shim.js +1 -0
  97. package/dist/esm/polyfills/dom.js +79 -0
  98. package/dist/esm/polyfills/es5-html-element.js +1 -0
  99. package/dist/esm/polyfills/index.js +34 -0
  100. package/dist/esm/polyfills/system.js +6 -0
  101. package/dist/esm/relativeTime-baa50aa2.js +7 -0
  102. package/dist/{favesalon-embed → esm}/salon-booking-modal.entry.js +1 -1
  103. package/dist/{favesalon-embed → esm}/salon-booking.entry.js +3 -3
  104. package/dist/{favesalon-embed → esm}/salon-gift-card-modal.entry.js +1 -1
  105. package/dist/{favesalon-embed → esm}/salon-gift-card.entry.js +3 -3
  106. package/dist/{favesalon-embed → esm}/salon-info.entry.js +3 -3
  107. package/dist/{favesalon-embed → esm}/salon-latest-reviews.entry.js +4 -4
  108. package/dist/esm/salon-latest-styles_3.entry.js +235 -0
  109. package/dist/{favesalon-embed → esm}/salon-lookbook.entry.js +3 -3
  110. package/dist/{favesalon-embed → esm}/salon-ranking.entry.js +1 -1
  111. package/dist/{favesalon-embed → esm}/salon-reviews.entry.js +3 -3
  112. package/dist/{favesalon-embed → esm}/salon-services.entry.js +3 -3
  113. package/dist/{favesalon-embed → esm}/salon-stylists.entry.js +3 -3
  114. package/dist/{favesalon-embed/services-7c46a2fd.js → esm/services-257442e2.js} +99 -2467
  115. package/dist/{favesalon-embed → esm}/style-detail.entry.js +4 -4
  116. package/dist/{favesalon-embed/utils-2c19db45.js → esm/utils-e97485e0.js} +0 -6
  117. package/dist/favesalon-embed/favesalon-embed.css +1 -2439
  118. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -148
  119. package/dist/favesalon-embed/index.esm.js +0 -1
  120. package/dist/favesalon-embed/p-05a1c88a.entry.js +1 -0
  121. package/dist/favesalon-embed/p-0acf0447.entry.js +1 -0
  122. package/dist/favesalon-embed/p-0bc4f624.js +1 -0
  123. package/dist/favesalon-embed/p-1af1515f.entry.js +1 -0
  124. package/dist/favesalon-embed/p-1cba5fc9.entry.js +1 -0
  125. package/dist/favesalon-embed/p-39a4ef15.entry.js +1 -0
  126. package/dist/favesalon-embed/p-3e2cb05b.entry.js +1 -0
  127. package/dist/favesalon-embed/p-47e646f8.js +1 -0
  128. package/dist/favesalon-embed/p-487b311f.entry.js +1 -0
  129. package/dist/favesalon-embed/p-55387c2f.entry.js +1 -0
  130. package/dist/favesalon-embed/p-566f05b4.entry.js +1 -0
  131. package/dist/favesalon-embed/p-862a0de0.entry.js +1 -0
  132. package/dist/favesalon-embed/p-9fe0cbeb.js +2 -0
  133. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  134. package/dist/favesalon-embed/p-aeeb7b5f.entry.js +1 -0
  135. package/dist/favesalon-embed/p-b08e5b54.js +6 -0
  136. package/dist/favesalon-embed/p-b5cca5fc.entry.js +1 -0
  137. package/dist/favesalon-embed/p-c7fb7af5.js +1580 -0
  138. package/dist/favesalon-embed/p-ccab56d8.js +1 -0
  139. package/dist/favesalon-embed/p-d6e13053.entry.js +1 -0
  140. package/dist/favesalon-embed/p-dee42d34.entry.js +1 -0
  141. package/dist/favesalon-embed/p-e661ca1d.entry.js +1 -0
  142. package/dist/favesalon-embed/p-eeceab9c.entry.js +1 -0
  143. package/dist/index.cjs.js +1 -0
  144. package/dist/index.js +1 -0
  145. package/package.json +1 -1
  146. package/dist/favesalon-embed/app-globals-437cc3f3.js +0 -712
  147. package/dist/favesalon-embed/app-globals-60769a2c.js +0 -712
  148. package/dist/favesalon-embed/chat-box.entry.js +0 -54
  149. package/dist/favesalon-embed/chat-form.entry.js +0 -39
  150. package/dist/favesalon-embed/chat-messages.entry.js +0 -53
  151. package/dist/favesalon-embed/css-shim-b7d3d95f.js +0 -4
  152. package/dist/favesalon-embed/dom-64053c71.js +0 -73
  153. package/dist/favesalon-embed/index-04c09911.js +0 -3371
  154. package/dist/favesalon-embed/index-888e99e3.js +0 -3371
  155. package/dist/favesalon-embed/isObject-13b86c17.js +0 -203
  156. package/dist/favesalon-embed/relativeTime-15477f02.js +0 -7
  157. package/dist/favesalon-embed/relativeTime-268e64b0.js +0 -7
  158. package/dist/favesalon-embed/services-55a87166.js +0 -23655
  159. package/dist/favesalon-embed/shadow-css-98135883.js +0 -387
  160. package/dist/favesalon-embed/user-avatar.entry.js +0 -50
  161. /package/dist/{favesalon-embed → esm}/colors-ea36347a.js +0 -0
@@ -0,0 +1,249 @@
1
+ import { h } from '@stencil/core';
2
+ import dayjs from 'dayjs';
3
+ import { Colors } from '../../constants/colors';
4
+ import { shortDateYearFormat } from '../../types/common';
5
+ import HttpService from '../../services/services';
6
+ const pageLimited = 10;
7
+ const sortOptions = [{
8
+ value: 'newest',
9
+ label: 'Newest first',
10
+ }, {
11
+ value: 'oldest',
12
+ label: 'Oldest first',
13
+ }, {
14
+ value: 'rating_desc',
15
+ label: 'High rating first',
16
+ }, {
17
+ value: 'rating_asc',
18
+ label: 'Low rating first',
19
+ }];
20
+ export class SalonReviews {
21
+ constructor() {
22
+ this.salonId = undefined;
23
+ this.primaryColor = Colors.Primary;
24
+ this.salonInfo = undefined;
25
+ this.stats = {};
26
+ this.totalReviews = 0;
27
+ this.allReviews = [];
28
+ this.isLoading = undefined;
29
+ this.isSorting = undefined;
30
+ this.isFiltering = undefined;
31
+ this.isLoadingMore = undefined;
32
+ this.canLoadMore = undefined;
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
+ 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
+ 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
+ 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
+ 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 (h("div", { class: "view view--salon-reviews" }, h("div", { class: "salon-reviews--filters" }, h("div", { class: "salon-reviews--score" }, h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => {
107
+ return (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.Gray04 }) }));
108
+ })), h("div", { class: "salon-review--rating--date", style: {
109
+ display: 'flex',
110
+ flexDirection: 'row',
111
+ alignItems: 'center',
112
+ marginTop: '-8px',
113
+ } }, h("span", { style: { fontSize: '24px' } }, this.stats.reviewPoint, "/5"), " ", h("span", { style: { color: Colors.Gray04, marginLeft: '8px' } }, "(", this.stats.totalReviews, " reviews)"))), h("div", { class: "salon-reviews--filters--options", style: { marginTop: '24px' } }, h("div", { style: {
114
+ background: Colors.Gray01,
115
+ display: 'flex',
116
+ alignItems: 'center',
117
+ borderRadius: '4px',
118
+ padding: '16px',
119
+ } }, h("div", null, h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
120
+ this.filterBy = [];
121
+ this.onChangeFilter([]);
122
+ } }), " ", h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
123
+ const isChecked = this.filterBy.indexOf(score) > -1;
124
+ return (h("div", { key: `salon-reviews--filters-score--${score}`, style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, 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
+ } }), " ", h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", h("i", { class: "ri-heart-line", style: {
129
+ fontSize: '16px',
130
+ marginLeft: '4px',
131
+ marginRight: '4px',
132
+ lineHeight: '1',
133
+ } }), " ", h("span", { style: { color: Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
134
+ })))), 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
+ } }, h("div", { class: "view--salon-reviews--counter" }, this.totalReviews, " ", this.totalReviews === 1 ? `review` : `reviews`), h("div", { style: { display: 'flex', alignItems: 'center' } }, h("label", { style: { marginRight: '8px', color: Colors.Gray04 } }, "Sort by"), 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.Gray01,
147
+ borderColor: Colors.Gray01,
148
+ borderRadius: '4px',
149
+ height: '40px',
150
+ width: '130px',
151
+ } }, sortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy, key: `search-filter--select-option--${sortOption.value}` }, sortOption.label)))))), h("div", { class: "salon-reviews--list-content", style: { marginTop: '24px' } }, this.allReviews.map((review, idx) => {
152
+ const user = review.user || {};
153
+ return (h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
154
+ borderBottom: `1px solid ${Colors.Gray02}`,
155
+ marginBottom: '24px',
156
+ paddingBottom: '24px',
157
+ } }, h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: h("span", { style: { fontSize: '18px', fontWeight: '600', color: Colors.TextColor } }, (user.firstName || user.lastName) ? `${user.firstName || ''} ${user.lastName || ''}` : ''), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (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.Gray04,
159
+ fontSize: '16px',
160
+ marginRight: '4px',
161
+ } }))), review.createdDate && (h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, dayjs(review.createdDate).format(shortDateYearFormat)))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: '600' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (h("div", { style: {
162
+ display: 'flex',
163
+ flexDirection: 'row',
164
+ overflowX: 'auto',
165
+ } }, review.photos.map(fileObj => (h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
166
+ position: 'relative',
167
+ cursor: 'pointer',
168
+ marginTop: '16px',
169
+ marginRight: '12px',
170
+ } }, h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
171
+ })), h("div", { class: "salon-reviews--list-footer", style: {
172
+ textAlign: 'center',
173
+ paddingTop: '16px',
174
+ paddingBottom: '16px',
175
+ } }, h("button", { class: "btn btn-light btn-lg", style: {
176
+ background: Colors.White,
177
+ border: `1px solid ${Colors.Gray02}`,
178
+ borderRadius: '4px',
179
+ paddingLeft: '24px',
180
+ paddingRight: '24px',
181
+ }, onClick: () => this.onLoadMore() }, "Load more"))));
182
+ }
183
+ static get is() { return "salon-reviews"; }
184
+ static get originalStyleUrls() {
185
+ return {
186
+ "$": ["index.css"]
187
+ };
188
+ }
189
+ static get styleUrls() {
190
+ return {
191
+ "$": ["index.css"]
192
+ };
193
+ }
194
+ static get properties() {
195
+ return {
196
+ "salonId": {
197
+ "type": "number",
198
+ "mutable": false,
199
+ "complexType": {
200
+ "original": "number",
201
+ "resolved": "number",
202
+ "references": {}
203
+ },
204
+ "required": false,
205
+ "optional": false,
206
+ "docs": {
207
+ "tags": [],
208
+ "text": ""
209
+ },
210
+ "attribute": "salon-id",
211
+ "reflect": false
212
+ },
213
+ "primaryColor": {
214
+ "type": "string",
215
+ "mutable": false,
216
+ "complexType": {
217
+ "original": "string",
218
+ "resolved": "string",
219
+ "references": {}
220
+ },
221
+ "required": false,
222
+ "optional": false,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": ""
226
+ },
227
+ "attribute": "primary-color",
228
+ "reflect": false,
229
+ "defaultValue": "Colors.Primary"
230
+ }
231
+ };
232
+ }
233
+ static get states() {
234
+ return {
235
+ "salonInfo": {},
236
+ "stats": {},
237
+ "totalReviews": {},
238
+ "allReviews": {},
239
+ "isLoading": {},
240
+ "isSorting": {},
241
+ "isFiltering": {},
242
+ "isLoadingMore": {},
243
+ "canLoadMore": {},
244
+ "page": {},
245
+ "filterBy": {},
246
+ "sortBy": {}
247
+ };
248
+ }
249
+ }
@@ -0,0 +1,18 @@
1
+ salon-schedules .salon-schedules--day {
2
+ display: flex;
3
+ flex-direction: row;
4
+ min-width: 240px;
5
+ }
6
+
7
+
8
+ @media (min-width: 768px) {
9
+ salon-schedules .salon-schedules--dates {
10
+ overflow: hidden;
11
+ margin-left: -32px;
12
+ }
13
+
14
+ salon-schedules .salon-schedules--day {
15
+ float: left;
16
+ padding-left: 32px;
17
+ }
18
+ }
@@ -1,13 +1,9 @@
1
- import { r as registerInstance, h } from './index-888e99e3.js';
2
- import { H as HttpService, B as BusinessHourStatus } from './services-7c46a2fd.js';
3
- import { C as Colors } from './colors-ea36347a.js';
4
- import './_commonjsHelpers-a4f66ccd.js';
5
-
6
- const indexCss = "salon-schedules .salon-schedules--day{display:flex;flex-direction:row;min-width:240px}@media (min-width: 768px){salon-schedules .salon-schedules--dates{overflow:hidden;margin-left:-32px}salon-schedules .salon-schedules--day{float:left;padding-left:32px}}";
7
-
8
- const SalonSchedules = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
1
+ import { h } from '@stencil/core';
2
+ import { BusinessHourStatus } from '../../types/salon';
3
+ import HttpService from '../../services/services';
4
+ import { Colors } from '../../constants/colors';
5
+ export class SalonSchedules {
6
+ constructor() {
11
7
  this.salonId = undefined;
12
8
  this.salonInfo = undefined;
13
9
  this.isLoading = undefined;
@@ -80,7 +76,92 @@ const SalonSchedules = class {
80
76
  const { about, businessHours, } = (this.salonInfoState || {});
81
77
  return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "About"), about && (h("div", { class: "salon-contact--info--desc", style: { fontSize: '16px', marginTop: '16px' }, innerHTML: about })), businessHours && businessHours.length > 0 && (h("div", { class: "salon-schedules", style: { marginTop: '24px' } }, h("div", { class: "salon-schedules--title", style: { fontSize: '16px', fontWeight: 'bold' } }, "Working hours"), h("div", { class: "salon-schedules--dates" }, h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Mon"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[0]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Tue"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[1]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Wed"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[2]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Thur"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[3]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Fri"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[4]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sat"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[5]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sun"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[6])))))))));
82
78
  }
83
- };
84
- SalonSchedules.style = indexCss;
85
-
86
- export { SalonSchedules as salon_schedules };
79
+ static get is() { return "salon-schedules"; }
80
+ static get originalStyleUrls() {
81
+ return {
82
+ "$": ["index.css"]
83
+ };
84
+ }
85
+ static get styleUrls() {
86
+ return {
87
+ "$": ["index.css"]
88
+ };
89
+ }
90
+ static get properties() {
91
+ return {
92
+ "salonId": {
93
+ "type": "number",
94
+ "mutable": false,
95
+ "complexType": {
96
+ "original": "number",
97
+ "resolved": "number",
98
+ "references": {}
99
+ },
100
+ "required": false,
101
+ "optional": false,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": ""
105
+ },
106
+ "attribute": "salon-id",
107
+ "reflect": false
108
+ },
109
+ "salonInfo": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "string",
114
+ "resolved": "string",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": true,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": ""
122
+ },
123
+ "attribute": "salon-info",
124
+ "reflect": false
125
+ },
126
+ "isLoading": {
127
+ "type": "boolean",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "boolean",
131
+ "resolved": "boolean",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": true,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": ""
139
+ },
140
+ "attribute": "is-loading",
141
+ "reflect": false
142
+ },
143
+ "withBorder": {
144
+ "type": "boolean",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "boolean",
148
+ "resolved": "boolean",
149
+ "references": {}
150
+ },
151
+ "required": false,
152
+ "optional": true,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": ""
156
+ },
157
+ "attribute": "with-border",
158
+ "reflect": false
159
+ }
160
+ };
161
+ }
162
+ static get states() {
163
+ return {
164
+ "salonInfoState": {}
165
+ };
166
+ }
167
+ }
@@ -0,0 +1,146 @@
1
+ import { h } from '@stencil/core';
2
+ import sortBy from 'lodash/sortBy';
3
+ import { Colors } from '../../constants/colors';
4
+ import HttpService from '../../services/services';
5
+ export class SalonServices {
6
+ constructor() {
7
+ this.salonId = undefined;
8
+ this.buttonClass = 'btn btn-light';
9
+ this.salonServices = undefined;
10
+ this.isLoading = undefined;
11
+ }
12
+ componentWillLoad() {
13
+ this.fetchData();
14
+ }
15
+ async fetchData() {
16
+ this.isLoading = true;
17
+ try {
18
+ this.salonServices = await HttpService().fetchSalonServices(this.salonId);
19
+ }
20
+ catch (e) {
21
+ this.salonServices = [];
22
+ }
23
+ this.isLoading = false;
24
+ }
25
+ render() {
26
+ if (this.isLoading) {
27
+ return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray01}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden' } }, [1, 2, 3, 4, 5, 6].map((fakeId, index) => (h("div", { key: `service-group--${fakeId}--${index}`, style: {
28
+ backgroundColor: Colors.Gray02,
29
+ float: 'left',
30
+ marginRight: '12px',
31
+ height: '30px',
32
+ width: '120px',
33
+ } })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index) => {
34
+ return (h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
35
+ backgroundColor: Colors.Gray03,
36
+ height: '20px',
37
+ width: '120px',
38
+ } }), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray01}`, marginTop: '12px' } }, h("div", { class: "view-content" }, [1, 2, 3].map((fakeGroupId, fakeGroupIndex) => (h("div", { key: `service-group--${fakeId}--service-${fakeGroupId}--${fakeGroupIndex}`, class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({}, fakeGroupIndex > 0 ? {
39
+ marginTop: '12px',
40
+ paddingTop: '12px',
41
+ borderTop: `1px solid ${Colors.Gray01}`,
42
+ } : {}) }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
43
+ backgroundColor: Colors.Gray01,
44
+ height: '16px',
45
+ width: '120px',
46
+ } })), h("div", { style: { marginTop: '4px' } }, h("div", { style: {
47
+ backgroundColor: Colors.Gray01,
48
+ height: '16px',
49
+ width: '240px',
50
+ } })))))))));
51
+ })));
52
+ }
53
+ return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap' } }, sortBy(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index) => (h("a", { href: `#service-group--${serviceGroup.id}` }, h("button", { type: "button", class: this.buttonClass, style: index > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), sortBy(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
54
+ const hasMultipleCates = (serviceGroup.data || []).length > 1;
55
+ return (h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (h("div", { class: "salon-service-category" }, hasMultipleCates && (h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${Colors.Gray02}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
56
+ marginTop: '12px',
57
+ paddingTop: '12px',
58
+ borderTop: `1px solid ${Colors.Gray01}`,
59
+ } : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (h("div", { style: {
60
+ display: 'block',
61
+ marginTop: '4px',
62
+ fontSize: '90%',
63
+ color: Colors.Gray05,
64
+ } }, [
65
+ !service.hideDuration ? `${service.duration} mins` : '',
66
+ !service.hidePrice ? `$${service.price}` : '',
67
+ ].filter(field => !!field).join(' · ')))))))))))));
68
+ })));
69
+ }
70
+ static get is() { return "salon-services"; }
71
+ static get originalStyleUrls() {
72
+ return {
73
+ "$": ["index.css"]
74
+ };
75
+ }
76
+ static get styleUrls() {
77
+ return {
78
+ "$": ["index.css"]
79
+ };
80
+ }
81
+ static get properties() {
82
+ return {
83
+ "salonId": {
84
+ "type": "number",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "number",
88
+ "resolved": "number",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": ""
96
+ },
97
+ "attribute": "salon-id",
98
+ "reflect": false
99
+ },
100
+ "buttonClass": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "string",
105
+ "resolved": "string",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": ""
113
+ },
114
+ "attribute": "button-class",
115
+ "reflect": false,
116
+ "defaultValue": "'btn btn-light'"
117
+ }
118
+ };
119
+ }
120
+ static get states() {
121
+ return {
122
+ "salonServices": {},
123
+ "isLoading": {}
124
+ };
125
+ }
126
+ static get methods() {
127
+ return {
128
+ "fetchData": {
129
+ "complexType": {
130
+ "signature": "() => Promise<void>",
131
+ "parameters": [],
132
+ "references": {
133
+ "Promise": {
134
+ "location": "global"
135
+ }
136
+ },
137
+ "return": "Promise<void>"
138
+ },
139
+ "docs": {
140
+ "text": "",
141
+ "tags": []
142
+ }
143
+ }
144
+ };
145
+ }
146
+ }
@@ -0,0 +1,43 @@
1
+ .view--salon-stylists {
2
+ overflow: hidden;
3
+ margin-left: -12px;
4
+ margin-top: -12px;
5
+ }
6
+
7
+ .view--salon-stylists .salon-stylist {
8
+ float: left;
9
+ padding-left: 12px;
10
+ padding-top: 12px;
11
+ width: 50%;
12
+ }
13
+
14
+ .view--salon-stylists .salon-stylist--avatar {
15
+ height: 180px;
16
+ }
17
+
18
+
19
+ @media (min-width: 576px) {
20
+ .view--salon-stylists .salon-stylist {
21
+ width: 33.33%;
22
+ max-width: 240px;
23
+ }
24
+ }
25
+
26
+
27
+ @media (min-width: 768px) {
28
+ .view--salon-stylists {
29
+ margin-left: -24px;
30
+ margin-top: -24px;
31
+ }
32
+
33
+ .view--salon-stylists .salon-stylist {
34
+ padding-left: 24px;
35
+ padding-top: 24px;
36
+ width: 264px;
37
+ max-width: none;
38
+ }
39
+
40
+ .view--salon-stylists .salon-stylist--avatar {
41
+ height: 240px;
42
+ }
43
+ }