favesalon-embed 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +20 -0
  5. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +291 -0
  7. package/dist/cjs/index-7f190886.js +4396 -0
  8. package/{cjs/index-7d179a70.js → dist/cjs/index-e6bea8f5.js} +87 -3
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/dist/cjs/salon-booking-modal.cjs.entry.js +29 -0
  12. package/dist/cjs/salon-booking.cjs.entry.js +50 -0
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/dist/cjs/salon-gift-card.cjs.entry.js +50 -0
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/dist/cjs/salon-lookbook.cjs.entry.js +218 -0
  17. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
  18. package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +78 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
  21. package/{cjs/services-d6f8214c.js → dist/cjs/services-eee8f251.js} +317 -361
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/{cjs → dist/cjs}/user-avatar.cjs.entry.js +4 -4
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -2
  26. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  27. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  28. package/dist/collection/components/google-map/index.js +86 -0
  29. package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
  30. package/{collection → dist/collection}/components/salon-booking/index.js +29 -11
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +12 -6
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +44 -6
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +30 -4
  35. package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
  36. package/{collection → dist/collection}/components/salon-info/index.js +6 -32
  37. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
  38. package/dist/collection/components/salon-latest-reviews/index.js +176 -0
  39. package/dist/collection/components/salon-latest-styles/index.css +10 -0
  40. package/dist/collection/components/salon-latest-styles/index.js +178 -0
  41. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
  42. package/dist/collection/components/salon-locations/index.js +151 -0
  43. package/dist/collection/components/salon-lookbook/index.css +12 -0
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +122 -49
  45. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  46. package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
  47. package/dist/collection/components/salon-reviews/index.css +15 -0
  48. package/dist/collection/components/salon-reviews/index.js +286 -0
  49. package/dist/collection/components/salon-schedules/index.css +15 -0
  50. package/dist/collection/components/salon-schedules/index.js +189 -0
  51. package/{collection/components/salon-reviews → dist/collection/components/salon-services}/index.css +0 -0
  52. package/dist/collection/components/salon-services/index.js +156 -0
  53. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
  54. package/dist/collection/components/salon-stylists/index.js +183 -0
  55. package/dist/collection/components/style-detail/index.css +62 -0
  56. package/dist/collection/components/style-detail/index.js +461 -0
  57. package/{collection/components/salon-services → dist/collection/components/user-avatar}/index.css +0 -0
  58. package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
  59. package/dist/collection/constants/colors.js +65 -0
  60. package/{collection → dist/collection}/global/global.js +0 -0
  61. package/{collection → dist/collection}/index.js +0 -0
  62. package/dist/collection/services/services.js +174 -0
  63. package/dist/collection/types/common.js +11 -0
  64. package/{collection → dist/collection}/types/review.js +9 -5
  65. package/dist/collection/types/salon.js +58 -0
  66. package/{collection → dist/collection}/types/service.js +0 -0
  67. package/dist/collection/types/style.js +128 -0
  68. package/dist/collection/types/stylist.js +30 -0
  69. package/{collection/components/user-avatar/index.css → dist/collection/types/tmp.js} +0 -0
  70. package/{collection → dist/collection}/types/user.js +2 -2
  71. package/{collection → dist/collection}/utils/utils.js +0 -0
  72. package/{custom-elements → dist/custom-elements}/index.d.ts +12 -12
  73. package/{custom-elements → dist/custom-elements}/index.js +5783 -870
  74. package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
  75. package/dist/esm/colors-ea36347a.js +67 -0
  76. package/dist/esm/favesalon-embed.js +18 -0
  77. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  78. package/dist/esm/google-map_5.entry.js +283 -0
  79. package/{esm/index-2160b80b.js → dist/esm/index-6af0a03d.js} +87 -4
  80. package/dist/esm/index-80523fec.js +4393 -0
  81. package/{esm → dist/esm}/index.js +0 -0
  82. package/dist/esm/loader.js +18 -0
  83. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  84. package/{esm → dist/esm}/polyfills/css-shim.js +0 -0
  85. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  86. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  87. package/{esm → dist/esm}/polyfills/index.js +0 -0
  88. package/{esm → dist/esm}/polyfills/system.js +0 -0
  89. package/dist/esm/salon-booking-modal.entry.js +25 -0
  90. package/dist/esm/salon-booking.entry.js +46 -0
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/dist/esm/salon-gift-card.entry.js +46 -0
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/dist/esm/salon-lookbook.entry.js +214 -0
  95. package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
  96. package/dist/esm/salon-reviews.entry.js +182 -0
  97. package/dist/esm/salon-services.entry.js +74 -0
  98. package/dist/esm/salon-stylists.entry.js +108 -0
  99. package/{esm/services-57fadd0a.js → dist/esm/services-295247b1.js} +310 -355
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/{esm → dist/esm}/user-avatar.entry.js +4 -4
  102. package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  103. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  104. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  105. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  106. package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  107. package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
  108. package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  109. package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
  110. package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
  111. package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
  112. package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
  113. package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
  114. package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
  115. package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
  116. package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
  117. package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
  118. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  119. package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
  120. package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
  121. package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
  122. package/dist/favesalon-embed/p-c2ecb365.js +1 -0
  123. package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
  124. package/dist/favesalon-embed/p-d6083940.js +1 -0
  125. package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
  126. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  127. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  128. package/{index.js → dist/index.js} +0 -0
  129. package/dist/types/components/google-map/index.d.ts +5 -0
  130. package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
  134. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  135. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  136. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  137. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  138. package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
  139. package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  140. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  141. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  142. package/{types → dist/types}/components/salon-services/index.d.ts +2 -0
  143. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  144. package/dist/types/components/style-detail/index.d.ts +24 -0
  145. package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  146. package/{types → dist/types}/components.d.ts +62 -41
  147. package/dist/types/constants/colors.d.ts +65 -0
  148. package/{types → dist/types}/index.d.ts +0 -0
  149. package/dist/types/services/services.d.ts +60 -0
  150. package/{types → dist/types}/stencil-public-runtime.d.ts +0 -0
  151. package/dist/types/types/common.d.ts +11 -0
  152. package/{types → dist/types}/types/review.d.ts +4 -0
  153. package/{types → dist/types}/types/salon.d.ts +3 -1
  154. package/{types → dist/types}/types/service.d.ts +0 -0
  155. package/dist/types/types/style.d.ts +88 -0
  156. package/{types → dist/types}/types/stylist.d.ts +2 -1
  157. package/dist/types/types/tmp.d.ts +0 -0
  158. package/{types → dist/types}/types/user.d.ts +2 -2
  159. package/{types → dist/types}/utils/utils.d.ts +0 -0
  160. package/loader/cdn.js +3 -0
  161. package/loader/index.cjs.js +3 -0
  162. package/loader/index.d.ts +12 -0
  163. package/loader/index.es2017.js +3 -0
  164. package/loader/index.js +4 -0
  165. package/loader/package.json +10 -0
  166. package/package.json +18 -13
  167. package/readme.md +23 -2
  168. package/cjs/colors-7f354880.js +0 -95
  169. package/cjs/favesalon-embed.cjs.js +0 -20
  170. package/cjs/google-map.cjs.entry.js +0 -47
  171. package/cjs/loader.cjs.js +0 -22
  172. package/cjs/salon-booking-modal.cjs.entry.js +0 -23
  173. package/cjs/salon-booking_2.cjs.entry.js +0 -56
  174. package/cjs/salon-contact_4.cjs.entry.js +0 -154
  175. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
  176. package/cjs/salon-info.cjs.entry.js +0 -34
  177. package/cjs/salon-latest-reviews.cjs.entry.js +0 -57
  178. package/cjs/salon-lookbook.cjs.entry.js +0 -187
  179. package/cjs/salon-reviews.cjs.entry.js +0 -196
  180. package/cjs/salon-services.cjs.entry.js +0 -40
  181. package/cjs/salon-stylists.cjs.entry.js +0 -53
  182. package/collection/components/google-map/index.js +0 -97
  183. package/collection/components/salon-contact/index.js +0 -88
  184. package/collection/components/salon-gift-card/index.css +0 -25
  185. package/collection/components/salon-info/index.css +0 -3
  186. package/collection/components/salon-latest-reviews/index.js +0 -108
  187. package/collection/components/salon-locations/index.js +0 -80
  188. package/collection/components/salon-lookbook/index.css +0 -12
  189. package/collection/components/salon-reviews/index.js +0 -291
  190. package/collection/components/salon-schedules/index.css +0 -14
  191. package/collection/components/salon-schedules/index.js +0 -103
  192. package/collection/components/salon-services/index.js +0 -86
  193. package/collection/components/salon-styles/index.css +0 -23
  194. package/collection/components/salon-styles/index.js +0 -100
  195. package/collection/components/salon-stylists/index.js +0 -96
  196. package/collection/constants/colors.js +0 -91
  197. package/collection/services/services.js +0 -203
  198. package/collection/types/common.js +0 -2
  199. package/collection/types/salon.js +0 -52
  200. package/collection/types/style.js +0 -28
  201. package/collection/types/stylist.js +0 -13
  202. package/esm/colors-1ec90c5f.js +0 -93
  203. package/esm/favesalon-embed.js +0 -18
  204. package/esm/google-map.entry.js +0 -43
  205. package/esm/loader.js +0 -18
  206. package/esm/salon-booking-modal.entry.js +0 -19
  207. package/esm/salon-booking_2.entry.js +0 -51
  208. package/esm/salon-contact_4.entry.js +0 -147
  209. package/esm/salon-gift-card-modal.entry.js +0 -16
  210. package/esm/salon-info.entry.js +0 -30
  211. package/esm/salon-latest-reviews.entry.js +0 -53
  212. package/esm/salon-lookbook.entry.js +0 -183
  213. package/esm/salon-reviews.entry.js +0 -192
  214. package/esm/salon-services.entry.js +0 -36
  215. package/esm/salon-stylists.entry.js +0 -49
  216. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  217. package/favesalon-embed/p-14a46adf.entry.js +0 -1
  218. package/favesalon-embed/p-2da2ed75.js +0 -1
  219. package/favesalon-embed/p-3712d9ab.entry.js +0 -1
  220. package/favesalon-embed/p-38066f9f.entry.js +0 -1
  221. package/favesalon-embed/p-4e2d7b29.js +0 -1
  222. package/favesalon-embed/p-520c8ffb.entry.js +0 -1
  223. package/favesalon-embed/p-54a1c294.entry.js +0 -1
  224. package/favesalon-embed/p-762520f2.js +0 -1
  225. package/favesalon-embed/p-94a0991e.entry.js +0 -1
  226. package/favesalon-embed/p-94b179eb.entry.js +0 -1
  227. package/favesalon-embed/p-977bd8bc.entry.js +0 -1
  228. package/favesalon-embed/p-bc363938.entry.js +0 -1
  229. package/favesalon-embed/p-bf9c83a3.entry.js +0 -1
  230. package/favesalon-embed/p-c5ebd3c9.entry.js +0 -1
  231. package/favesalon-embed/p-d84b61b0.entry.js +0 -1
  232. package/favesalon-embed/p-f15bcb43.entry.js +0 -1
  233. package/types/components/google-map/index.d.ts +0 -10
  234. package/types/components/salon-contact/index.d.ts +0 -9
  235. package/types/components/salon-reviews/index.d.ts +0 -23
  236. package/types/components/salon-styles/index.d.ts +0 -9
  237. package/types/constants/colors.d.ts +0 -88
  238. package/types/services/services.d.ts +0 -24
  239. package/types/types/common.d.ts +0 -2
  240. package/types/types/style.d.ts +0 -49
@@ -0,0 +1,151 @@
1
+ import { Component, Prop, h, State } from '@stencil/core';
2
+ import { formatFullAddress, formatWebsiteUrl } from '../../utils/utils';
3
+ import { Colors } from '../../constants/colors';
4
+ import HttpService from '../../services/services';
5
+ export class SalonLocations {
6
+ componentWillLoad() {
7
+ if (this.salonInfo) {
8
+ this.salonInfoState = JSON.parse(this.salonInfo);
9
+ }
10
+ else {
11
+ this.fetchData();
12
+ }
13
+ }
14
+ fetchData() {
15
+ try {
16
+ HttpService().fetchSalonInfo(this.salonId)
17
+ .then(salonInfo => this.salonInfoState = salonInfo);
18
+ }
19
+ catch (e) { }
20
+ }
21
+ render() {
22
+ if (this.isLoading) {
23
+ return (h("div", { class: "view view--salon-locations" },
24
+ h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } },
25
+ h("div", { style: {
26
+ backgroundColor: Colors.Gray02,
27
+ height: '20px',
28
+ width: '120px',
29
+ } }),
30
+ h("div", { style: { marginTop: '24px' } },
31
+ h("div", { style: {
32
+ backgroundColor: Colors.Gray01,
33
+ height: '16px',
34
+ width: '50%',
35
+ } }),
36
+ h("div", { style: {
37
+ backgroundColor: Colors.Gray01,
38
+ height: '16px',
39
+ width: '50%',
40
+ marginTop: '8px',
41
+ } }),
42
+ h("div", { style: {
43
+ backgroundColor: Colors.Gray01,
44
+ height: '192px',
45
+ width: '100%',
46
+ marginTop: '24px',
47
+ } })))));
48
+ }
49
+ const { businessPhone, businessName, website, email, } = this.salonInfoState || {};
50
+ const websiteUrl = formatWebsiteUrl(website);
51
+ const fullAddress = formatFullAddress(this.salonInfoState);
52
+ return (h("div", { class: "view view--salon-locations" },
53
+ h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } },
54
+ h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Contact"),
55
+ h("div", { class: "salon-contact--links", style: { marginTop: '16px' } },
56
+ businessPhone && (h("div", { class: "salon-contact--links-item" },
57
+ h("i", { class: "ri-phone-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }),
58
+ " ",
59
+ h("a", { href: `tel:${businessPhone}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, businessPhone))),
60
+ websiteUrl && (h("div", { class: "salon-contact--links-item" },
61
+ h("i", { class: "ri-links-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }),
62
+ " ",
63
+ h("a", { target: websiteUrl && websiteUrl.indexOf(window.location.hostname) === -1 ? '_blank' : undefined, href: websiteUrl, style: { color: Colors.TextColor, textDecoration: 'none' } }, websiteUrl))),
64
+ email && (h("div", { class: "salon-contact--links-item" },
65
+ h("i", { class: "ri-mail-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }),
66
+ " ",
67
+ h("a", { href: `mailto:${email}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, email)))),
68
+ h("div", { class: "view--salon-info--map", style: { marginTop: '24px' } },
69
+ h("google-map", { "location-name": businessName, "location-address": fullAddress })))));
70
+ }
71
+ static get is() { return "salon-locations"; }
72
+ static get originalStyleUrls() { return {
73
+ "$": ["index.less"]
74
+ }; }
75
+ static get styleUrls() { return {
76
+ "$": ["index.css"]
77
+ }; }
78
+ static get properties() { return {
79
+ "salonId": {
80
+ "type": "number",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "number",
84
+ "resolved": "number",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": ""
92
+ },
93
+ "attribute": "salon-id",
94
+ "reflect": false
95
+ },
96
+ "salonInfo": {
97
+ "type": "string",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "string",
101
+ "resolved": "string",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": true,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": ""
109
+ },
110
+ "attribute": "salon-info",
111
+ "reflect": false
112
+ },
113
+ "isLoading": {
114
+ "type": "boolean",
115
+ "mutable": false,
116
+ "complexType": {
117
+ "original": "boolean",
118
+ "resolved": "boolean",
119
+ "references": {}
120
+ },
121
+ "required": false,
122
+ "optional": true,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": ""
126
+ },
127
+ "attribute": "is-loading",
128
+ "reflect": false
129
+ },
130
+ "withBorder": {
131
+ "type": "boolean",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "boolean",
135
+ "resolved": "boolean",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": true,
140
+ "docs": {
141
+ "tags": [],
142
+ "text": ""
143
+ },
144
+ "attribute": "with-border",
145
+ "reflect": false
146
+ }
147
+ }; }
148
+ static get states() { return {
149
+ "salonInfoState": {}
150
+ }; }
151
+ }
@@ -0,0 +1,12 @@
1
+ @media (max-width: 768px) {
2
+ salon-lookbook .view-header {
3
+ display: block !important;
4
+ }
5
+ salon-lookbook .salon-loobook--serch-result {
6
+ margin-bottom: 16px;
7
+ }
8
+ salon-lookbook .salon-loobook--filter-wrapper > label,
9
+ salon-lookbook .salon-loobook--sort-wrapper > label {
10
+ display: none !important;
11
+ }
12
+ }
@@ -22,6 +22,8 @@ export class SalonLookbook {
22
22
  this.totalLookbooks = 0;
23
23
  this.salonCategories = [];
24
24
  this.salonLookbooks = [];
25
+ this.sortBy = lookbookSortOptions[1].value;
26
+ this.filterBy = lookbookFilterOptions[0].value;
25
27
  }
26
28
  componentWillLoad() {
27
29
  this.fetchData();
@@ -47,19 +49,13 @@ export class SalonLookbook {
47
49
  var masonry = new Macy({
48
50
  container: '#salon-loobooks--grid',
49
51
  useContainerForBreakpoints: true,
50
- margin: 12,
51
- columns: 7,
52
+ margin: 16,
53
+ columns: 5,
52
54
  breakAt: {
53
- 1200: {
54
- margin: 16,
55
- columns: 6,
56
- },
57
- 992: {
58
- margin: 16,
59
- columns: 5,
55
+ 1024: {
56
+ columns: 4,
60
57
  },
61
58
  768: {
62
- margin: 16,
63
59
  columns: 3,
64
60
  },
65
61
  576: {
@@ -76,7 +72,7 @@ export class SalonLookbook {
76
72
  async fetchData() {
77
73
  try {
78
74
  const promises = [
79
- this.fetchLookbooks({ page: 1 }),
75
+ this.fetchLookbooks(Object.assign({ page: 1, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {})),
80
76
  this.fetchCategories(),
81
77
  ];
82
78
  return Promise.all(promises);
@@ -104,6 +100,34 @@ export class SalonLookbook {
104
100
  this.isLoading = false;
105
101
  }
106
102
  }
103
+ async onChangeFiltering(filterBy) {
104
+ try {
105
+ this.currentPage = 1;
106
+ this.totalLookbooks = 0;
107
+ this.salonLookbooks = [];
108
+ this.hideLoadMore = true;
109
+ this.filterBy = filterBy;
110
+ await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [Number(this.filterBy)] } : {}));
111
+ if (window.masonry) {
112
+ this.isLayoutSetup = false;
113
+ }
114
+ }
115
+ catch (error) { }
116
+ }
117
+ async onChangeSorting(sortBy) {
118
+ try {
119
+ this.currentPage = 1;
120
+ this.totalLookbooks = 0;
121
+ this.salonLookbooks = [];
122
+ this.hideLoadMore = true;
123
+ this.sortBy = sortBy;
124
+ await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {}));
125
+ if (window.masonry) {
126
+ this.isLayoutSetup = false;
127
+ }
128
+ }
129
+ catch (error) { }
130
+ }
107
131
  async onLoadMore() {
108
132
  try {
109
133
  this.currentPage += 1;
@@ -120,6 +144,16 @@ export class SalonLookbook {
120
144
  }
121
145
  catch (error) { }
122
146
  }
147
+ onClickLookbook(style) {
148
+ const elLookbookModal = document.createElement('div');
149
+ elLookbookModal.innerHTML = `
150
+ <style-detail
151
+ salon-id=${this.salonId}
152
+ salon-lookbook='${JSON.stringify(style)}'
153
+ ></style-detail>
154
+ `;
155
+ document.body.appendChild(elLookbookModal);
156
+ }
123
157
  renderHeader() {
124
158
  const allFilterOptions = lookbookFilterOptions.concat(([...this.salonCategories]).map(category => {
125
159
  return {
@@ -134,7 +168,7 @@ export class SalonLookbook {
134
168
  alignItems: 'center',
135
169
  marginBottom: '24px',
136
170
  } },
137
- h("div", null,
171
+ h("div", { class: "salon-loobook--serch-result" },
138
172
  this.totalLookbooks,
139
173
  " ",
140
174
  this.totalLookbooks === 1 ? 'result' : 'results'),
@@ -143,58 +177,57 @@ export class SalonLookbook {
143
177
  flexDirection: 'row',
144
178
  alignItems: 'center',
145
179
  } },
146
- h("div", { style: {
180
+ h("div", { class: "salon-loobook--filter-wrapper", style: {
147
181
  display: 'flex',
148
182
  flexDirection: 'row',
149
183
  alignItems: 'center',
150
184
  marginRight: '16px',
151
185
  } },
152
- h("label", { style: { marginRight: '8px' } }, "Filter by"),
153
- h("select", {
154
- // placeholder="Filter by"
155
- // value={filterBy}
156
- // onChange={onChangeCategory}
157
- class: "form-select", style: { width: '160px' } }, allFilterOptions.map(filterOption => (h("option", { value: filterOption.value }, filterOption.label))))),
158
- h("div", { class: "search--header--sort-wrapper", style: {
186
+ h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Filter by"),
187
+ h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeFiltering(evt.target.value) }, allFilterOptions.map(filterOption => (h("option", { value: filterOption.value, selected: String(filterOption.value) === String(this.filterBy) }, filterOption.label))))),
188
+ h("div", { class: "salon-loobook--sort-wrapper", style: {
159
189
  display: 'flex',
160
190
  flexDirection: 'row',
161
191
  alignItems: 'center',
162
192
  } },
163
- h("label", { style: { marginRight: '8px' } }, "Sort by"),
164
- h("select", {
165
- // placeholder="Sort by"
166
- // value={sortBy}
167
- // onChange={onChangeSorting}
168
- class: "form-select", style: { width: '160px' } }, lookbookSortOptions.map(sortOption => (h("option", { value: sortOption.value }, sortOption.label))))))));
193
+ h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Sort by"),
194
+ h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeSorting(evt.target.value) }, lookbookSortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy }, sortOption.label))))))));
169
195
  }
170
196
  render() {
171
- return (h("div", { class: "salon-loobooks" }, this.salonLookbooks.length > 0 && (h("div", null,
172
- h("div", { class: "view-content" },
173
- this.renderHeader(),
174
- h("div", { class: "salon-loobooks--grid", id: "salon-loobooks--grid" }, this.salonLookbooks.map(style => {
175
- const { caption, fullImageUrlThumb, owner } = style;
176
- return (h("div", { class: "salon-lookbook salon-loobooks--grid-item" },
177
- h("div", { class: "card", style: {
178
- background: 'none',
179
- border: 'none',
180
- maxWidth: '200px',
181
- } },
182
- h("div", { class: "salon-lookbook--image", style: {
183
- borderRadius: '8px',
184
- overflow: 'hidden',
185
- minHeight: '80px',
186
- background: Colors.Gray06,
197
+ return (h("div", { class: "salon-loobooks" },
198
+ h("div", null,
199
+ h("div", { class: "view-content" },
200
+ this.renderHeader(),
201
+ this.salonLookbooks.length > 0 && (h("div", { class: "salon-loobooks--grid", id: "salon-loobooks--grid" }, this.salonLookbooks.map(style => {
202
+ const { caption, imageThumbMedium, owner } = style;
203
+ return (h("div", { class: "salon-lookbook salon-loobooks--grid-item", onClick: () => this.onClickLookbook(style) },
204
+ h("div", { class: "card", style: {
205
+ background: 'none',
206
+ border: 'none',
207
+ // maxWidth: '200px',
187
208
  } },
188
- h("img", { src: fullImageUrlThumb, alt: caption })),
189
- owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } },
190
- h("user-avatar", { name: owner.name, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
191
- }))),
192
- !this.hideLoadMore && (h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } },
193
- h("button", { type: "button", class: "btn btn-light", onClick: () => this.onLoadMore() }, this.isLoadingMore ? 'Loading' : 'Load more')))))));
209
+ h("div", { class: "salon-lookbook--image", style: {
210
+ borderRadius: '8px',
211
+ overflow: 'hidden',
212
+ minHeight: '80px',
213
+ background: Colors.Gray01,
214
+ } },
215
+ h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })),
216
+ owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } },
217
+ h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
218
+ })))),
219
+ this.salonLookbooks.length > 0 && !this.hideLoadMore && (h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } },
220
+ h("button", { type: "button", class: "btn btn-light btn-lg", onClick: () => this.onLoadMore(), style: {
221
+ background: Colors.White,
222
+ border: `1px solid ${Colors.Gray02}`,
223
+ borderRadius: '4px',
224
+ paddingLeft: '24px',
225
+ paddingRight: '24px',
226
+ } }, this.isLoadingMore ? 'Loading' : 'Load more'))))));
194
227
  }
195
228
  static get is() { return "salon-lookbook"; }
196
229
  static get originalStyleUrls() { return {
197
- "$": ["index.css"]
230
+ "$": ["index.less"]
198
231
  }; }
199
232
  static get styleUrls() { return {
200
233
  "$": ["index.css"]
@@ -226,6 +259,8 @@ export class SalonLookbook {
226
259
  "totalLookbooks": {},
227
260
  "salonCategories": {},
228
261
  "salonLookbooks": {},
262
+ "sortBy": {},
263
+ "filterBy": {},
229
264
  "isLayoutSetup": {}
230
265
  }; }
231
266
  static get methods() { return {
@@ -267,6 +302,44 @@ export class SalonLookbook {
267
302
  "tags": []
268
303
  }
269
304
  },
305
+ "onChangeFiltering": {
306
+ "complexType": {
307
+ "signature": "(filterBy: string) => Promise<void>",
308
+ "parameters": [{
309
+ "tags": [],
310
+ "text": ""
311
+ }],
312
+ "references": {
313
+ "Promise": {
314
+ "location": "global"
315
+ }
316
+ },
317
+ "return": "Promise<void>"
318
+ },
319
+ "docs": {
320
+ "text": "",
321
+ "tags": []
322
+ }
323
+ },
324
+ "onChangeSorting": {
325
+ "complexType": {
326
+ "signature": "(sortBy: string) => Promise<void>",
327
+ "parameters": [{
328
+ "tags": [],
329
+ "text": ""
330
+ }],
331
+ "references": {
332
+ "Promise": {
333
+ "location": "global"
334
+ }
335
+ },
336
+ "return": "Promise<void>"
337
+ },
338
+ "docs": {
339
+ "text": "",
340
+ "tags": []
341
+ }
342
+ },
270
343
  "onLoadMore": {
271
344
  "complexType": {
272
345
  "signature": "() => Promise<void>",
@@ -8,30 +8,30 @@ export class SalonRanking {
8
8
  getRankingData(ranking) {
9
9
  if (ranking === 5) {
10
10
  return {
11
- color: Colors.Danger,
11
+ color: Colors.Primary,
12
12
  text: 'Viral',
13
13
  };
14
14
  }
15
15
  if (ranking === 4) {
16
16
  return {
17
- color: Colors.Pink03,
17
+ color: Colors.Orange03,
18
18
  text: 'Advancing',
19
19
  };
20
20
  }
21
21
  if (ranking === 3) {
22
22
  return {
23
- color: Colors.Orange03,
23
+ color: Colors.Lilac03,
24
24
  text: 'Progressing',
25
25
  };
26
26
  }
27
27
  if (ranking === 2) {
28
28
  return {
29
- color: Colors.DarkBlue03,
29
+ color: Colors.Blue03,
30
30
  text: 'Building',
31
31
  };
32
32
  }
33
33
  return {
34
- color: Colors.Gray01,
34
+ color: Colors.Gray05,
35
35
  text: 'Starting',
36
36
  };
37
37
  }
@@ -0,0 +1,15 @@
1
+ @media (max-width: 768px) {
2
+ salon-reviews .salon-reviews {
3
+ flex-direction: column !important;
4
+ }
5
+ salon-reviews .salon-reviews--filters--options {
6
+ display: none !important;
7
+ }
8
+ salon-reviews .salon-reviews--list {
9
+ padding-top: 32px !important;
10
+ padding-left: 0px !important;
11
+ }
12
+ salon-reviews .reviews-list--sorting > label {
13
+ display: none !important;
14
+ }
15
+ }