favesalon-embed 1.0.0 → 1.0.2

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 (156) hide show
  1. package/dist/custom-elements/index.d.ts +12 -0
  2. package/dist/{cjs/_commonjsHelpers-5cfcba41.js → favesalon-embed/_commonjsHelpers-a4f66ccd.js} +14 -6
  3. package/dist/{cjs/global-9073d10e.js → favesalon-embed/app-globals-15861a7f.js} +15 -8
  4. package/dist/{esm/global-e1089ffd.js → favesalon-embed/app-globals-270fe240.js} +16 -7
  5. package/dist/favesalon-embed/app-globals-437cc3f3.js +712 -0
  6. package/dist/favesalon-embed/app-globals-b8b0fc7a.js +712 -0
  7. package/dist/favesalon-embed/chat-button.entry.js +56 -0
  8. package/dist/favesalon-embed/chat-form.entry.js +39 -0
  9. package/dist/favesalon-embed/chat-messages.entry.js +51 -0
  10. package/dist/favesalon-embed/css-shim-b7d3d95f.js +4 -0
  11. package/dist/favesalon-embed/dom-64053c71.js +73 -0
  12. package/dist/favesalon-embed/favesalon-embed.css +2433 -4
  13. package/dist/favesalon-embed/favesalon-embed.esm.js +148 -1
  14. package/dist/{collection/components/google-map/index.js → favesalon-embed/google-map.entry.js} +12 -54
  15. package/dist/{esm/index-80523fec.js → favesalon-embed/index-00b83e1c.js} +425 -15
  16. package/dist/favesalon-embed/index-888e99e3.js +3371 -0
  17. package/dist/favesalon-embed/index-9ad82b12.js +3371 -0
  18. package/dist/favesalon-embed/index-aa906326.js +3371 -0
  19. package/dist/favesalon-embed/index-b97af793.js +3371 -0
  20. package/dist/favesalon-embed/index.esm.js +1 -0
  21. package/dist/favesalon-embed/relativeTime-268e64b0.js +7 -0
  22. package/dist/{esm → favesalon-embed}/salon-booking-modal.entry.js +1 -1
  23. package/dist/{esm → favesalon-embed}/salon-booking.entry.js +3 -3
  24. package/dist/{esm → favesalon-embed}/salon-gift-card-modal.entry.js +1 -1
  25. package/dist/{esm → favesalon-embed}/salon-gift-card.entry.js +3 -3
  26. package/dist/favesalon-embed/salon-info.entry.js +29 -0
  27. package/dist/{esm → favesalon-embed}/salon-latest-reviews.entry.js +4 -4
  28. package/dist/{collection/components/salon-latest-styles/index.js → favesalon-embed/salon-latest-styles.entry.js} +14 -99
  29. package/dist/{collection/components/salon-locations/index.js → favesalon-embed/salon-locations.entry.js} +15 -95
  30. package/dist/{esm → favesalon-embed}/salon-lookbook.entry.js +3 -3
  31. package/dist/{esm → favesalon-embed}/salon-ranking.entry.js +1 -1
  32. package/dist/{esm → favesalon-embed}/salon-reviews.entry.js +3 -3
  33. package/dist/{collection/components/salon-schedules/index.js → favesalon-embed/salon-schedules.entry.js} +14 -95
  34. package/dist/{esm → favesalon-embed}/salon-services.entry.js +3 -3
  35. package/dist/{esm → favesalon-embed}/salon-stylists.entry.js +3 -3
  36. package/dist/{esm/services-40a3e622.js → favesalon-embed/services-7cb8f2a6.js} +2469 -100
  37. package/dist/favesalon-embed/shadow-css-98135883.js +387 -0
  38. package/dist/{esm → favesalon-embed}/style-detail.entry.js +4 -4
  39. package/dist/{esm → favesalon-embed}/user-avatar.entry.js +2 -1
  40. package/dist/{esm/utils-e97485e0.js → favesalon-embed/utils-7de9628a.js} +3 -0
  41. package/dist/types/components/chat-button/index.d.ts +0 -8
  42. package/dist/types/components/chat-form/index.d.ts +6 -0
  43. package/dist/types/components/chat-messages/index.d.ts +14 -0
  44. package/dist/types/components.d.ts +40 -0
  45. package/package.json +1 -1
  46. package/dist/cjs/chat-button.cjs.entry.js +0 -118
  47. package/dist/cjs/colors-38421769.js +0 -69
  48. package/dist/cjs/favesalon-embed.cjs.js +0 -24
  49. package/dist/cjs/google-map_5.cjs.entry.js +0 -310
  50. package/dist/cjs/index-47c2a5f6.js +0 -1533
  51. package/dist/cjs/index-7f190886.js +0 -4396
  52. package/dist/cjs/index.cjs.js +0 -2
  53. package/dist/cjs/loader.cjs.js +0 -23
  54. package/dist/cjs/relativeTime-3721080d.js +0 -9
  55. package/dist/cjs/salon-booking-modal.cjs.entry.js +0 -30
  56. package/dist/cjs/salon-booking.cjs.entry.js +0 -51
  57. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +0 -29
  58. package/dist/cjs/salon-gift-card.cjs.entry.js +0 -51
  59. package/dist/cjs/salon-latest-reviews.cjs.entry.js +0 -97
  60. package/dist/cjs/salon-lookbook.cjs.entry.js +0 -222
  61. package/dist/cjs/salon-ranking.cjs.entry.js +0 -60
  62. package/dist/cjs/salon-reviews.cjs.entry.js +0 -193
  63. package/dist/cjs/salon-services.cjs.entry.js +0 -81
  64. package/dist/cjs/salon-stylists.cjs.entry.js +0 -118
  65. package/dist/cjs/services-125c82d8.js +0 -21492
  66. package/dist/cjs/style-detail.cjs.entry.js +0 -312
  67. package/dist/cjs/user-avatar.cjs.entry.js +0 -45
  68. package/dist/cjs/utils-c5a33b3c.js +0 -23
  69. package/dist/collection/collection-manifest.json +0 -29
  70. package/dist/collection/components/chat-button/index.css +0 -122
  71. package/dist/collection/components/chat-button/index.js +0 -218
  72. package/dist/collection/components/chat-conversation/index.js +0 -103
  73. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  74. package/dist/collection/components/google-map/index.css +0 -5
  75. package/dist/collection/components/salon-booking/index.css +0 -30
  76. package/dist/collection/components/salon-booking/index.js +0 -126
  77. package/dist/collection/components/salon-booking/salon-booking-modal.js +0 -92
  78. package/dist/collection/components/salon-gift-card/index.css +0 -30
  79. package/dist/collection/components/salon-gift-card/index.js +0 -126
  80. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -73
  81. package/dist/collection/components/salon-info/index.css +0 -1
  82. package/dist/collection/components/salon-info/index.js +0 -77
  83. package/dist/collection/components/salon-latest-reviews/index.css +0 -11
  84. package/dist/collection/components/salon-latest-reviews/index.js +0 -163
  85. package/dist/collection/components/salon-latest-styles/index.css +0 -12
  86. package/dist/collection/components/salon-locations/index.css +0 -24
  87. package/dist/collection/components/salon-lookbook/index.css +0 -15
  88. package/dist/collection/components/salon-lookbook/index.js +0 -368
  89. package/dist/collection/components/salon-ranking/index.css +0 -3
  90. package/dist/collection/components/salon-ranking/index.js +0 -117
  91. package/dist/collection/components/salon-reviews/index.css +0 -18
  92. package/dist/collection/components/salon-reviews/index.js +0 -249
  93. package/dist/collection/components/salon-schedules/index.css +0 -18
  94. package/dist/collection/components/salon-services/index.css +0 -1
  95. package/dist/collection/components/salon-services/index.js +0 -146
  96. package/dist/collection/components/salon-stylists/index.css +0 -43
  97. package/dist/collection/components/salon-stylists/index.js +0 -184
  98. package/dist/collection/components/style-detail/index.css +0 -76
  99. package/dist/collection/components/style-detail/index.js +0 -386
  100. package/dist/collection/components/user-avatar/index.css +0 -0
  101. package/dist/collection/components/user-avatar/index.js +0 -134
  102. package/dist/collection/constants/colors.js +0 -65
  103. package/dist/collection/global/global.js +0 -8
  104. package/dist/collection/index.js +0 -1
  105. package/dist/collection/mocks/users.js +0 -10
  106. package/dist/collection/services/services.js +0 -295
  107. package/dist/collection/types/chat.js +0 -23
  108. package/dist/collection/types/common.js +0 -11
  109. package/dist/collection/types/review.js +0 -39
  110. package/dist/collection/types/salon.js +0 -58
  111. package/dist/collection/types/service.js +0 -24
  112. package/dist/collection/types/style.js +0 -128
  113. package/dist/collection/types/stylist.js +0 -30
  114. package/dist/collection/types/user.js +0 -10
  115. package/dist/collection/utils/utils.js +0 -20
  116. package/dist/custom-elements/index.js +0 -28340
  117. package/dist/esm/_commonjsHelpers-098d5b27.js +0 -32
  118. package/dist/esm/chat-button.entry.js +0 -114
  119. package/dist/esm/favesalon-embed.js +0 -19
  120. package/dist/esm/google-map_5.entry.js +0 -302
  121. package/dist/esm/index-3fae868e.js +0 -1506
  122. package/dist/esm/index.js +0 -1
  123. package/dist/esm/loader.js +0 -19
  124. package/dist/esm/polyfills/core-js.js +0 -11
  125. package/dist/esm/polyfills/css-shim.js +0 -1
  126. package/dist/esm/polyfills/dom.js +0 -79
  127. package/dist/esm/polyfills/es5-html-element.js +0 -1
  128. package/dist/esm/polyfills/index.js +0 -34
  129. package/dist/esm/polyfills/system.js +0 -6
  130. package/dist/esm/relativeTime-cd452e6d.js +0 -7
  131. package/dist/favesalon-embed/p-019c5ccd.entry.js +0 -1
  132. package/dist/favesalon-embed/p-083a8821.entry.js +0 -1
  133. package/dist/favesalon-embed/p-0d0ed9ea.entry.js +0 -1
  134. package/dist/favesalon-embed/p-119db8de.entry.js +0 -1
  135. package/dist/favesalon-embed/p-1432c51b.entry.js +0 -1
  136. package/dist/favesalon-embed/p-22093506.entry.js +0 -1
  137. package/dist/favesalon-embed/p-32b314e9.js +0 -2
  138. package/dist/favesalon-embed/p-47e646f8.js +0 -1
  139. package/dist/favesalon-embed/p-4a5eca9a.js +0 -6
  140. package/dist/favesalon-embed/p-58d2e9be.js +0 -1
  141. package/dist/favesalon-embed/p-71404b6a.entry.js +0 -1
  142. package/dist/favesalon-embed/p-857c3a61.entry.js +0 -1
  143. package/dist/favesalon-embed/p-99ec77f7.entry.js +0 -1
  144. package/dist/favesalon-embed/p-a33331cc.js +0 -1
  145. package/dist/favesalon-embed/p-b0c3673a.entry.js +0 -1
  146. package/dist/favesalon-embed/p-b287b1ea.entry.js +0 -1
  147. package/dist/favesalon-embed/p-b3af7842.entry.js +0 -1
  148. package/dist/favesalon-embed/p-b630ae68.js +0 -1580
  149. package/dist/favesalon-embed/p-ce2c1c9a.entry.js +0 -1
  150. package/dist/favesalon-embed/p-d6083940.js +0 -1
  151. package/dist/favesalon-embed/p-d9b7ad58.entry.js +0 -1
  152. package/dist/favesalon-embed/p-fc9a5551.js +0 -6
  153. package/dist/index.cjs.js +0 -1
  154. package/dist/index.js +0 -1
  155. package/dist/types/components/chat-conversation/index.d.ts +0 -0
  156. /package/dist/{esm → favesalon-embed}/colors-ea36347a.js +0 -0
@@ -1,193 +0,0 @@
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;
@@ -1,81 +0,0 @@
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;
@@ -1,118 +0,0 @@
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;