@bonlineza/luxity-lib 2.34.3 → 2.34.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +116 -76
- package/AddInterest.js +768 -434
- package/BrandSelector.js +336 -176
- package/Checkbox.js +101 -68
- package/CheckboxButton.js +124 -79
- package/CommunicationPreferenceOptionsRenderer.js +125 -107
- package/CommunicationPreferenceSection.js +134 -114
- package/CommunicationPreferences.js +339 -443
- package/CountryCodeSelect.js +10 -7
- package/CurrencyInputFormatter.js +56 -29
- package/CurrencySelect.js +49 -23
- package/GALink.js +16 -6
- package/GenderSelector.js +142 -88
- package/GraphQLDropdownSelector.js +937 -503
- package/GraphQLMultiSelector.js +274 -141
- package/IconHeader.js +25 -11
- package/IconWrapper.js +7 -3
- package/InterestCatSelector.js +74 -34
- package/InterestItem.js +187 -103
- package/Interests.js +890 -485
- package/InterestsSubheading.js +10 -5
- package/InvertedTextButton.js +63 -27
- package/LuxityAppSideNav.js +21 -18
- package/LuxityDesktopHeader.js +258 -191
- package/LuxityFooter.js +276 -374
- package/LuxityGraphQLDropdownSelector.js +969 -519
- package/LuxityGraphQLMultiselector.js +321 -167
- package/LuxityMobileHeader.js +351 -253
- package/LuxityPageReady.js +136 -74
- package/LuxitySideNav.js +213 -165
- package/MaterialSelector.js +976 -525
- package/ModelSelector.js +976 -525
- package/NotificationDropDown.js +209 -111
- package/Notify.js +1 -0
- package/OutlinePrimaryButton.js +58 -26
- package/PriceRangeSelector.js +281 -168
- package/PrimaryButton.js +58 -26
- package/RadioButtons.js +140 -114
- package/RangeSlider.js +242 -152
- package/RareStepFooter.js +41 -27
- package/RareStepHeader.js +190 -139
- package/ReactSelectWrapper.js +1 -0
- package/SecondaryButton.js +58 -26
- package/ShoeSizeRangeSelector.js +260 -162
- package/ShoeSizeSelector.js +263 -158
- package/SimpleErrorBoundary.js +106 -59
- package/StyleSelector.js +336 -176
- package/TestComponent.js +15 -0
- package/TextButton.js +58 -26
- package/Tooltip.js +39 -17
- package/Tracking.js +1 -0
- package/WrapperButton.js +43 -20
- package/build/bundle.css +1 -1
- package/build/bundle.js +1711 -1265
- package/package.json +1 -1
- package/svg/Accessories.js +13 -6
- package/svg/Account.js +13 -6
- package/svg/Add.js +13 -6
- package/svg/ArrowRight.js +13 -6
- package/svg/Bags.js +13 -6
- package/svg/BurgerMenu.js +13 -6
- package/svg/Calendar.js +13 -6
- package/svg/CalendarCircled.js +13 -6
- package/svg/CheckCircled.js +13 -6
- package/svg/Close.js +13 -6
- package/svg/Clothing.js +13 -6
- package/svg/Dot.js +13 -6
- package/svg/Edit.js +13 -6
- package/svg/Eye.js +13 -6
- package/svg/FileAttach.js +13 -6
- package/svg/FileAttachCircled.js +13 -6
- package/svg/LightBulb.js +13 -6
- package/svg/Logo.js +13 -6
- package/svg/LuxityMenu.js +13 -6
- package/svg/Minus.js +13 -6
- package/svg/MobileAvatar.js +13 -6
- package/svg/MyOrder.js +13 -6
- package/svg/MyPayment.js +13 -6
- package/svg/MyProfile.js +14 -8
- package/svg/MySale.js +13 -6
- package/svg/Notification.js +13 -6
- package/svg/PointerDown.js +13 -6
- package/svg/Search.js +13 -6
- package/svg/Shoes.js +13 -6
- package/svg/SvgWrapper.js +7 -3
- package/svg/Trash.js +13 -6
- package/svg/Watches.js +13 -6
|
@@ -17,200 +17,293 @@
|
|
|
17
17
|
var Notifications__default = 'default' in Notifications ? Notifications['default'] : Notifications;
|
|
18
18
|
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function _assertThisInitialized(e) {
|
|
32
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
33
|
-
return e;
|
|
20
|
+
function ownKeys(object, enumerableOnly) {
|
|
21
|
+
var keys = Object.keys(object);
|
|
22
|
+
|
|
23
|
+
if (Object.getOwnPropertySymbols) {
|
|
24
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
25
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
26
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
27
|
+
})), keys.push.apply(keys, symbols);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return keys;
|
|
34
31
|
}
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
|
|
33
|
+
function _objectSpread2(target) {
|
|
34
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
35
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
36
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
37
|
+
_defineProperty(target, key, source[key]);
|
|
38
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
39
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return target;
|
|
37
44
|
}
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
|
|
46
|
+
function _classCallCheck(instance, Constructor) {
|
|
47
|
+
if (!(instance instanceof Constructor)) {
|
|
48
|
+
throw new TypeError("Cannot call a class as a function");
|
|
49
|
+
}
|
|
40
50
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
|
|
52
|
+
function _defineProperties(target, props) {
|
|
53
|
+
for (var i = 0; i < props.length; i++) {
|
|
54
|
+
var descriptor = props[i];
|
|
55
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
56
|
+
descriptor.configurable = true;
|
|
57
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
58
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
45
59
|
}
|
|
46
60
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
|
|
62
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
63
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
64
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
65
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
66
|
+
writable: false
|
|
67
|
+
});
|
|
68
|
+
return Constructor;
|
|
51
69
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
70
|
+
|
|
71
|
+
function _defineProperty(obj, key, value) {
|
|
72
|
+
if (key in obj) {
|
|
73
|
+
Object.defineProperty(obj, key, {
|
|
74
|
+
value: value,
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true
|
|
78
|
+
});
|
|
79
|
+
} else {
|
|
80
|
+
obj[key] = value;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return obj;
|
|
59
84
|
}
|
|
85
|
+
|
|
60
86
|
function _extends() {
|
|
61
|
-
|
|
62
|
-
for (var
|
|
63
|
-
var
|
|
64
|
-
|
|
87
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
88
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
89
|
+
var source = arguments[i];
|
|
90
|
+
|
|
91
|
+
for (var key in source) {
|
|
92
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
93
|
+
target[key] = source[key];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
65
96
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
71
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
72
|
-
}, _getPrototypeOf(t);
|
|
97
|
+
|
|
98
|
+
return target;
|
|
99
|
+
};
|
|
100
|
+
return _extends.apply(this, arguments);
|
|
73
101
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
102
|
+
|
|
103
|
+
function _inherits(subClass, superClass) {
|
|
104
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
105
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
77
109
|
constructor: {
|
|
78
|
-
value:
|
|
79
|
-
writable:
|
|
80
|
-
configurable:
|
|
110
|
+
value: subClass,
|
|
111
|
+
writable: true,
|
|
112
|
+
configurable: true
|
|
81
113
|
}
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(subClass, "prototype", {
|
|
116
|
+
writable: false
|
|
117
|
+
});
|
|
118
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function _getPrototypeOf(o) {
|
|
122
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
123
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
124
|
+
};
|
|
125
|
+
return _getPrototypeOf(o);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function _setPrototypeOf(o, p) {
|
|
129
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
130
|
+
o.__proto__ = p;
|
|
131
|
+
return o;
|
|
132
|
+
};
|
|
133
|
+
return _setPrototypeOf(o, p);
|
|
85
134
|
}
|
|
135
|
+
|
|
86
136
|
function _isNativeReflectConstruct() {
|
|
137
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
138
|
+
if (Reflect.construct.sham) return false;
|
|
139
|
+
if (typeof Proxy === "function") return true;
|
|
140
|
+
|
|
87
141
|
try {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return
|
|
92
|
-
}
|
|
142
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
143
|
+
return true;
|
|
144
|
+
} catch (e) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
93
147
|
}
|
|
94
|
-
|
|
95
|
-
|
|
148
|
+
|
|
149
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
150
|
+
if (source == null) return {};
|
|
151
|
+
var target = {};
|
|
152
|
+
var sourceKeys = Object.keys(source);
|
|
153
|
+
var key, i;
|
|
154
|
+
|
|
155
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
156
|
+
key = sourceKeys[i];
|
|
157
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
158
|
+
target[key] = source[key];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return target;
|
|
96
162
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
o = !0, n = r;
|
|
114
|
-
} finally {
|
|
115
|
-
try {
|
|
116
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
117
|
-
} finally {
|
|
118
|
-
if (o) throw n;
|
|
119
|
-
}
|
|
163
|
+
|
|
164
|
+
function _objectWithoutProperties(source, excluded) {
|
|
165
|
+
if (source == null) return {};
|
|
166
|
+
|
|
167
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
168
|
+
|
|
169
|
+
var key, i;
|
|
170
|
+
|
|
171
|
+
if (Object.getOwnPropertySymbols) {
|
|
172
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
173
|
+
|
|
174
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
175
|
+
key = sourceSymbolKeys[i];
|
|
176
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
177
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
178
|
+
target[key] = source[key];
|
|
120
179
|
}
|
|
121
|
-
return a;
|
|
122
180
|
}
|
|
181
|
+
|
|
182
|
+
return target;
|
|
123
183
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
129
|
-
}
|
|
130
|
-
function ownKeys(e, r) {
|
|
131
|
-
var t = Object.keys(e);
|
|
132
|
-
if (Object.getOwnPropertySymbols) {
|
|
133
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
134
|
-
r && (o = o.filter(function (r) {
|
|
135
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
136
|
-
})), t.push.apply(t, o);
|
|
184
|
+
|
|
185
|
+
function _assertThisInitialized(self) {
|
|
186
|
+
if (self === void 0) {
|
|
187
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
137
188
|
}
|
|
138
|
-
|
|
189
|
+
|
|
190
|
+
return self;
|
|
139
191
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
147
|
-
});
|
|
192
|
+
|
|
193
|
+
function _possibleConstructorReturn(self, call) {
|
|
194
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
195
|
+
return call;
|
|
196
|
+
} else if (call !== void 0) {
|
|
197
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
148
198
|
}
|
|
149
|
-
|
|
199
|
+
|
|
200
|
+
return _assertThisInitialized(self);
|
|
150
201
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
var
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
202
|
+
|
|
203
|
+
function _createSuper(Derived) {
|
|
204
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
205
|
+
|
|
206
|
+
return function _createSuperInternal() {
|
|
207
|
+
var Super = _getPrototypeOf(Derived),
|
|
208
|
+
result;
|
|
209
|
+
|
|
210
|
+
if (hasNativeReflectConstruct) {
|
|
211
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
212
|
+
|
|
213
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
214
|
+
} else {
|
|
215
|
+
result = Super.apply(this, arguments);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return _possibleConstructorReturn(this, result);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
223
|
+
if (!raw) {
|
|
224
|
+
raw = strings.slice(0);
|
|
159
225
|
}
|
|
160
|
-
|
|
226
|
+
|
|
227
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
228
|
+
raw: {
|
|
229
|
+
value: Object.freeze(raw)
|
|
230
|
+
}
|
|
231
|
+
}));
|
|
161
232
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
166
|
-
if (e.includes(n)) continue;
|
|
167
|
-
t[n] = r[n];
|
|
168
|
-
}
|
|
169
|
-
return t;
|
|
233
|
+
|
|
234
|
+
function _slicedToArray(arr, i) {
|
|
235
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
170
236
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
237
|
+
|
|
238
|
+
function _toConsumableArray(arr) {
|
|
239
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function _arrayWithoutHoles(arr) {
|
|
243
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
175
244
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}, _setPrototypeOf(t, e);
|
|
245
|
+
|
|
246
|
+
function _arrayWithHoles(arr) {
|
|
247
|
+
if (Array.isArray(arr)) return arr;
|
|
180
248
|
}
|
|
181
|
-
|
|
182
|
-
|
|
249
|
+
|
|
250
|
+
function _iterableToArray(iter) {
|
|
251
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
183
252
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
253
|
+
|
|
254
|
+
function _iterableToArrayLimit(arr, i) {
|
|
255
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
256
|
+
|
|
257
|
+
if (_i == null) return;
|
|
258
|
+
var _arr = [];
|
|
259
|
+
var _n = true;
|
|
260
|
+
var _d = false;
|
|
261
|
+
|
|
262
|
+
var _s, _e;
|
|
263
|
+
|
|
264
|
+
try {
|
|
265
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
266
|
+
_arr.push(_s.value);
|
|
267
|
+
|
|
268
|
+
if (i && _arr.length === i) break;
|
|
188
269
|
}
|
|
189
|
-
})
|
|
270
|
+
} catch (err) {
|
|
271
|
+
_d = true;
|
|
272
|
+
_e = err;
|
|
273
|
+
} finally {
|
|
274
|
+
try {
|
|
275
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
276
|
+
} finally {
|
|
277
|
+
if (_d) throw _e;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return _arr;
|
|
190
282
|
}
|
|
191
|
-
|
|
192
|
-
|
|
283
|
+
|
|
284
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
285
|
+
if (!o) return;
|
|
286
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
287
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
288
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
289
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
290
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
193
291
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
return ("string" === r ? String : Number)(t);
|
|
292
|
+
|
|
293
|
+
function _arrayLikeToArray(arr, len) {
|
|
294
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
295
|
+
|
|
296
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
297
|
+
|
|
298
|
+
return arr2;
|
|
203
299
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
300
|
+
|
|
301
|
+
function _nonIterableSpread() {
|
|
302
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
207
303
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
212
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
213
|
-
}
|
|
304
|
+
|
|
305
|
+
function _nonIterableRest() {
|
|
306
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
214
307
|
}
|
|
215
308
|
|
|
216
309
|
var interpretErrorMessage = function interpretErrorMessage(error) {
|
|
@@ -222,39 +315,50 @@
|
|
|
222
315
|
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
223
316
|
data: null
|
|
224
317
|
});
|
|
225
|
-
|
|
226
318
|
/**
|
|
227
319
|
* A flavour of PageReady with Luxity customisations
|
|
228
320
|
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
229
321
|
* 2. an error message interpreter is supplied from the local helper library
|
|
230
322
|
*/
|
|
323
|
+
|
|
231
324
|
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
325
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
326
|
+
|
|
327
|
+
var _super = _createSuper(LuxityPageReady);
|
|
328
|
+
|
|
232
329
|
function LuxityPageReady() {
|
|
233
330
|
var _this;
|
|
331
|
+
|
|
234
332
|
_classCallCheck(this, LuxityPageReady);
|
|
333
|
+
|
|
235
334
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
236
335
|
args[_key] = arguments[_key];
|
|
237
336
|
}
|
|
238
|
-
|
|
239
|
-
|
|
337
|
+
|
|
338
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
339
|
+
|
|
340
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
240
341
|
data: null
|
|
241
342
|
});
|
|
242
|
-
|
|
343
|
+
|
|
344
|
+
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
243
345
|
return _this.pageReadyInstance.initRequest();
|
|
244
346
|
});
|
|
347
|
+
|
|
245
348
|
return _this;
|
|
246
349
|
}
|
|
247
|
-
|
|
248
|
-
|
|
350
|
+
|
|
351
|
+
_createClass(LuxityPageReady, [{
|
|
249
352
|
key: "render",
|
|
250
353
|
value: function render() {
|
|
251
354
|
var _this2 = this;
|
|
355
|
+
|
|
252
356
|
var _this$props = this.props,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
357
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
358
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
359
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
360
|
+
_onData = _this$props.onData,
|
|
361
|
+
children = _this$props.children;
|
|
258
362
|
var data = this.state.data;
|
|
259
363
|
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
260
364
|
ref: function ref(inst) {
|
|
@@ -264,15 +368,19 @@
|
|
|
264
368
|
_this2.setState({
|
|
265
369
|
data: res.data
|
|
266
370
|
});
|
|
371
|
+
|
|
267
372
|
_onData(res);
|
|
268
373
|
},
|
|
269
374
|
getRequestInstance: function getRequestInstance() {
|
|
270
375
|
_this2.props.onIsLoading(true);
|
|
376
|
+
|
|
271
377
|
return getRequestPromise().then(function (out) {
|
|
272
378
|
_this2.props.onIsLoading(false);
|
|
379
|
+
|
|
273
380
|
return out;
|
|
274
381
|
}).catch(function (oops) {
|
|
275
382
|
_this2.props.onIsLoading(false);
|
|
383
|
+
|
|
276
384
|
return oops;
|
|
277
385
|
});
|
|
278
386
|
},
|
|
@@ -289,7 +397,10 @@
|
|
|
289
397
|
}, children));
|
|
290
398
|
}
|
|
291
399
|
}]);
|
|
400
|
+
|
|
401
|
+
return LuxityPageReady;
|
|
292
402
|
}(React__default.Component);
|
|
403
|
+
|
|
293
404
|
LuxityPageReady.defaultProps = {
|
|
294
405
|
onIsLoading: function onIsLoading() {
|
|
295
406
|
return null;
|
|
@@ -405,6 +516,7 @@
|
|
|
405
516
|
var inputMarginRight = '0.2em';
|
|
406
517
|
var CheckboxLabel = styled__default.label(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"], ["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"])), function (props) {
|
|
407
518
|
var _props$theme;
|
|
519
|
+
|
|
408
520
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
|
|
409
521
|
}, function (props) {
|
|
410
522
|
return props.theme.fontSizes[4];
|
|
@@ -423,7 +535,8 @@
|
|
|
423
535
|
}
|
|
424
536
|
});
|
|
425
537
|
|
|
426
|
-
|
|
538
|
+
/** @format */
|
|
539
|
+
|
|
427
540
|
numeral.register('locale', 'en-ZA', {
|
|
428
541
|
delimiters: {
|
|
429
542
|
thousands: ',',
|
|
@@ -444,12 +557,12 @@
|
|
|
444
557
|
});
|
|
445
558
|
numeral.locale('en-ZA');
|
|
446
559
|
String.locale = numeral.locale;
|
|
447
|
-
|
|
448
560
|
/**
|
|
449
561
|
* Curreny Formatter
|
|
450
562
|
* @param {number} number - the number to be formatted
|
|
451
563
|
* @param {boolean} round - flag to indicate if the number needs to be rounded off
|
|
452
564
|
*/
|
|
565
|
+
|
|
453
566
|
function fC(number) {
|
|
454
567
|
var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
455
568
|
var parsedNumber = parseFloat(number);
|
|
@@ -457,7 +570,6 @@
|
|
|
457
570
|
}
|
|
458
571
|
|
|
459
572
|
/** @format */
|
|
460
|
-
|
|
461
573
|
var request = {
|
|
462
574
|
fetching: false,
|
|
463
575
|
failed: false,
|
|
@@ -564,35 +676,48 @@
|
|
|
564
676
|
|
|
565
677
|
var _templateObject$9, _templateObject2, _templateObject3, _templateObject4;
|
|
566
678
|
var MALE = genders.MALE,
|
|
567
|
-
|
|
568
|
-
|
|
679
|
+
FEMALE = genders.FEMALE,
|
|
680
|
+
UNISEX = genders.UNISEX;
|
|
681
|
+
|
|
569
682
|
var TrashIcon = function TrashIcon(_ref) {
|
|
570
683
|
var onClick = _ref.onClick,
|
|
571
|
-
|
|
684
|
+
id = _ref.id;
|
|
572
685
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
573
686
|
onClick: onClick,
|
|
574
687
|
id: id
|
|
575
688
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
576
689
|
};
|
|
690
|
+
|
|
577
691
|
var InterestItem = /*#__PURE__*/function (_React$Component) {
|
|
692
|
+
_inherits(InterestItem, _React$Component);
|
|
693
|
+
|
|
694
|
+
var _super = _createSuper(InterestItem);
|
|
695
|
+
|
|
578
696
|
function InterestItem(props) {
|
|
579
697
|
var _this;
|
|
698
|
+
|
|
580
699
|
_classCallCheck(this, InterestItem);
|
|
581
|
-
|
|
582
|
-
|
|
700
|
+
|
|
701
|
+
_this = _super.call(this, props);
|
|
702
|
+
|
|
703
|
+
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
583
704
|
var id = _this.props.data.id;
|
|
705
|
+
|
|
584
706
|
_this.setState({
|
|
585
707
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
586
708
|
fetching: true
|
|
587
709
|
})
|
|
588
710
|
});
|
|
711
|
+
|
|
589
712
|
var url = _this.props.deleteInterestApi(id);
|
|
713
|
+
|
|
590
714
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
591
715
|
_this.setState({
|
|
592
716
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
593
717
|
success: true
|
|
594
718
|
})
|
|
595
719
|
});
|
|
720
|
+
|
|
596
721
|
_this.props.onDeleted(_this.props.data);
|
|
597
722
|
}, function () {
|
|
598
723
|
return _this.setState({
|
|
@@ -600,25 +725,32 @@
|
|
|
600
725
|
});
|
|
601
726
|
});
|
|
602
727
|
});
|
|
603
|
-
|
|
728
|
+
|
|
729
|
+
_defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
|
|
604
730
|
switch (gender) {
|
|
605
731
|
case MALE:
|
|
606
732
|
return 'Male';
|
|
733
|
+
|
|
607
734
|
case FEMALE:
|
|
608
735
|
return 'Female';
|
|
736
|
+
|
|
609
737
|
case UNISEX:
|
|
610
738
|
default:
|
|
611
739
|
return 'Unisex';
|
|
612
740
|
}
|
|
613
741
|
});
|
|
614
|
-
|
|
742
|
+
|
|
743
|
+
_defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
|
|
615
744
|
if (category === interestCategories.APPAREL) {
|
|
616
745
|
return 'CLOTHING';
|
|
617
746
|
}
|
|
747
|
+
|
|
618
748
|
return category;
|
|
619
749
|
});
|
|
620
|
-
|
|
750
|
+
|
|
751
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
621
752
|
var _data$min_shoe_size, _data$max_shoe_size;
|
|
753
|
+
|
|
622
754
|
var data = _this.props.data;
|
|
623
755
|
var success = _this.state.delete.success;
|
|
624
756
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
|
|
@@ -668,14 +800,16 @@
|
|
|
668
800
|
}
|
|
669
801
|
}));
|
|
670
802
|
});
|
|
803
|
+
|
|
671
804
|
_this.state = {
|
|
672
805
|
delete: _objectSpread2({}, request)
|
|
673
806
|
};
|
|
674
807
|
return _this;
|
|
675
808
|
}
|
|
676
|
-
|
|
809
|
+
|
|
677
810
|
return _createClass(InterestItem);
|
|
678
811
|
}(React__default.Component);
|
|
812
|
+
|
|
679
813
|
var SheoSizeContentDiv = styled__default.div(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
|
|
680
814
|
var InterestItemTitle = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
681
815
|
var InterestItemContainer = styled__default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
@@ -691,11 +825,11 @@
|
|
|
691
825
|
return props.theme.marginPaddings[0];
|
|
692
826
|
}, media.xs);
|
|
693
827
|
var ThemedInterestItem = themed(InterestItem);
|
|
694
|
-
|
|
695
828
|
/**
|
|
696
829
|
* The Interest Item view shows the selected interest configuration,
|
|
697
830
|
* and gives user control to delete it.
|
|
698
831
|
*/
|
|
832
|
+
|
|
699
833
|
var InterestItem$1 = (function (props) {
|
|
700
834
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
|
|
701
835
|
});
|
|
@@ -742,14 +876,16 @@
|
|
|
742
876
|
*/
|
|
743
877
|
var RadioButtons = function RadioButtons(_ref) {
|
|
744
878
|
var options = _ref.options,
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
879
|
+
name = _ref.name,
|
|
880
|
+
noWrap = _ref.noWrap,
|
|
881
|
+
title = _ref.title,
|
|
882
|
+
errors = _ref.errors;
|
|
883
|
+
|
|
749
884
|
var _useState = React.useState(errors[name]),
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
885
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
886
|
+
errMsg = _useState2[0],
|
|
887
|
+
setErrMsg = _useState2[1];
|
|
888
|
+
|
|
753
889
|
React.useEffect(function () {
|
|
754
890
|
setErrMsg(errors[name]);
|
|
755
891
|
}, [errors, name]);
|
|
@@ -757,15 +893,15 @@
|
|
|
757
893
|
noWrap: noWrap
|
|
758
894
|
}, options.map(function (_ref2, index) {
|
|
759
895
|
var _ref2$actionCallback = _ref2.actionCallback,
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
896
|
+
actionCallback = _ref2$actionCallback === void 0 ? function () {
|
|
897
|
+
return null;
|
|
898
|
+
} : _ref2$actionCallback,
|
|
899
|
+
_ref2$value = _ref2.value,
|
|
900
|
+
value = _ref2$value === void 0 ? '' : _ref2$value,
|
|
901
|
+
_ref2$innerText = _ref2.innerText,
|
|
902
|
+
innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
|
|
903
|
+
_ref2$checked = _ref2.checked,
|
|
904
|
+
checked = _ref2$checked === void 0 ? false : _ref2$checked;
|
|
769
905
|
return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
|
|
770
906
|
key: "".concat(name, "-").concat(index),
|
|
771
907
|
htmlFor: "".concat(name, "_").concat(index)
|
|
@@ -782,6 +918,7 @@
|
|
|
782
918
|
}), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
|
|
783
919
|
}))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errMsg));
|
|
784
920
|
};
|
|
921
|
+
|
|
785
922
|
RadioButtons.defaultProps = {
|
|
786
923
|
noWrap: false,
|
|
787
924
|
title: '',
|
|
@@ -790,8 +927,8 @@
|
|
|
790
927
|
var RadioButtons$1 = themed(RadioButtons);
|
|
791
928
|
|
|
792
929
|
var _templateObject$i, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5;
|
|
793
|
-
|
|
794
930
|
/* position relative is required for the Body element to be positioned correctly */
|
|
931
|
+
|
|
795
932
|
var relativeInlineStyle = styled.css(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
796
933
|
var topMiddleBodyStyle = styled.css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
797
934
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
@@ -805,31 +942,40 @@
|
|
|
805
942
|
};
|
|
806
943
|
|
|
807
944
|
var _templateObject$j;
|
|
945
|
+
|
|
808
946
|
var getBodyStyle = function getBodyStyle() {
|
|
809
947
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
810
948
|
var _props$toolTipPositio = props.toolTipPosition,
|
|
811
|
-
|
|
949
|
+
toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
|
|
950
|
+
|
|
812
951
|
switch (toolTipPosition) {
|
|
813
952
|
case 'top':
|
|
814
953
|
return topMiddleBodyStyle;
|
|
954
|
+
|
|
815
955
|
case 'bottom':
|
|
816
956
|
return getBottomMiddleBodyStyle(props);
|
|
957
|
+
|
|
817
958
|
default:
|
|
818
959
|
return null;
|
|
819
960
|
}
|
|
820
961
|
};
|
|
962
|
+
|
|
821
963
|
var getAfterStyling = function getAfterStyling() {
|
|
822
964
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
823
965
|
var toolTipPosition = props.toolTipPosition;
|
|
966
|
+
|
|
824
967
|
switch (toolTipPosition) {
|
|
825
968
|
case 'top':
|
|
826
969
|
return getTopMiddleArrowAfterStyle(props);
|
|
970
|
+
|
|
827
971
|
case 'bottom':
|
|
828
972
|
return getBottomMiddleArrowAfterStyle(props);
|
|
973
|
+
|
|
829
974
|
default:
|
|
830
975
|
return '';
|
|
831
976
|
}
|
|
832
977
|
};
|
|
978
|
+
|
|
833
979
|
var Body$1 = styled__default.span(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
834
980
|
return props.bodyWidth;
|
|
835
981
|
}, function (props) {
|
|
@@ -848,20 +994,25 @@
|
|
|
848
994
|
var baseButtonStyle = styled.css(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n padding: 1rem 2rem;\n cursor: pointer;\n letter-spacing: 1.3px;\n border-style: none;\n text-transform: uppercase;\n font-size: 12px;\n color: #fff;\n transition: 0.2s ease-in-out;\n outline: none;\n"])));
|
|
849
995
|
|
|
850
996
|
var _excluded = ["children"];
|
|
997
|
+
|
|
851
998
|
var _templateObject$m;
|
|
852
999
|
var Button = styled__default.button(_templateObject$m || (_templateObject$m = _taggedTemplateLiteral(["\n ", ";\n background-color: #fff;\n color: ", ";\n border: 1px solid ", ";\n\n &:disabled {\n ", "\n }\n"])), baseButtonStyle, function (props) {
|
|
853
1000
|
return props.theme.colors.primary;
|
|
854
1001
|
}, function (props) {
|
|
855
1002
|
return props.theme.colors.primary;
|
|
856
1003
|
}, disabledButtonStyle);
|
|
1004
|
+
|
|
857
1005
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
858
1006
|
var children = _ref.children,
|
|
859
|
-
|
|
1007
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
1008
|
+
|
|
860
1009
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
861
1010
|
};
|
|
1011
|
+
|
|
862
1012
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
863
1013
|
|
|
864
1014
|
var _excluded$1 = ["children"];
|
|
1015
|
+
|
|
865
1016
|
var _templateObject$n;
|
|
866
1017
|
var Button$1 = styled__default.button(_templateObject$n || (_templateObject$n = _taggedTemplateLiteral(["\n ", ";\n background-color: ", ";\n color: ", ";\n border: 1px solid ", ";\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n &:disabled {\n ", "\n &:hover {\n background-color: ", ";\n }\n }\n"])), baseButtonStyle, function (props) {
|
|
867
1018
|
return props.theme.colors.ntrlMin;
|
|
@@ -876,14 +1027,18 @@
|
|
|
876
1027
|
}, disabledButtonStyle, function (props) {
|
|
877
1028
|
return props.theme.colors.base;
|
|
878
1029
|
});
|
|
1030
|
+
|
|
879
1031
|
var SecondaryButton = function SecondaryButton(_ref) {
|
|
880
1032
|
var children = _ref.children,
|
|
881
|
-
|
|
1033
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
1034
|
+
|
|
882
1035
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
883
1036
|
};
|
|
1037
|
+
|
|
884
1038
|
var SecondaryButton$1 = themed(SecondaryButton);
|
|
885
1039
|
|
|
886
1040
|
var _excluded$2 = ["children"];
|
|
1041
|
+
|
|
887
1042
|
var _templateObject$o;
|
|
888
1043
|
var Button$2 = styled__default.button(_templateObject$o || (_templateObject$o = _taggedTemplateLiteral(["\n ", ";\n background-color: transparent;\n color: ", ";\n &:hover {\n color: ", ";\n }\n &:disabled {\n ", ";\n color: ", ";\n }\n"])), baseButtonStyle, function (props) {
|
|
889
1044
|
return props.theme.colors.base;
|
|
@@ -892,17 +1047,21 @@
|
|
|
892
1047
|
}, disabledButtonStyle, function (props) {
|
|
893
1048
|
return props.theme.colors.base;
|
|
894
1049
|
});
|
|
1050
|
+
|
|
895
1051
|
var TextButton = function TextButton(_ref) {
|
|
896
1052
|
var children = _ref.children,
|
|
897
|
-
|
|
1053
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
1054
|
+
|
|
898
1055
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
899
1056
|
};
|
|
1057
|
+
|
|
900
1058
|
TextButton.defaultProps = {
|
|
901
1059
|
type: 'button'
|
|
902
1060
|
};
|
|
903
1061
|
var TextButton$1 = themed(TextButton);
|
|
904
1062
|
|
|
905
1063
|
var _excluded$3 = ["children"];
|
|
1064
|
+
|
|
906
1065
|
var _templateObject$p;
|
|
907
1066
|
var Button$3 = styled__default(TextButton$1)(_templateObject$p || (_templateObject$p = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n &:disabled {\n background-color: ", ";\n color: ", ";\n }\n"])), function (props) {
|
|
908
1067
|
return props.theme.colors.ntrlMin;
|
|
@@ -917,19 +1076,25 @@
|
|
|
917
1076
|
}, function (props) {
|
|
918
1077
|
return props.theme.colors.primary;
|
|
919
1078
|
});
|
|
1079
|
+
|
|
920
1080
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
921
1081
|
var children = _ref.children,
|
|
922
|
-
|
|
1082
|
+
restProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
1083
|
+
|
|
923
1084
|
return /*#__PURE__*/React__default.createElement(Button$3, restProps, children);
|
|
924
1085
|
};
|
|
1086
|
+
|
|
925
1087
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
926
1088
|
|
|
927
1089
|
var _excluded$4 = ["children"];
|
|
1090
|
+
|
|
928
1091
|
var _templateObject$q;
|
|
929
1092
|
var Button$4 = styled__default.button(_templateObject$q || (_templateObject$q = _taggedTemplateLiteral(["\n outline: none;\n cursor: pointer;\n background-color: transparent;\n border: none;\n &:disabled {\n ", ";\n }\n"])), disabledButtonStyle);
|
|
1093
|
+
|
|
930
1094
|
var WrapperButton = function WrapperButton(_ref) {
|
|
931
1095
|
var children = _ref.children,
|
|
932
|
-
|
|
1096
|
+
restProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
1097
|
+
|
|
933
1098
|
return /*#__PURE__*/React__default.createElement(Button$4, restProps, children);
|
|
934
1099
|
};
|
|
935
1100
|
|
|
@@ -938,28 +1103,31 @@
|
|
|
938
1103
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
939
1104
|
return value.replace(/\D/g, '');
|
|
940
1105
|
};
|
|
941
|
-
|
|
942
1106
|
/**
|
|
943
1107
|
* Currency Input which formats the value to a specific format
|
|
944
1108
|
*/
|
|
1109
|
+
|
|
945
1110
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
946
1111
|
var value = _ref.value,
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1112
|
+
onChange = _ref.onChange,
|
|
1113
|
+
prefix = _ref.prefix,
|
|
1114
|
+
allowNegativeValue = _ref.allowNegativeValue,
|
|
1115
|
+
groupSeparator = _ref.groupSeparator,
|
|
1116
|
+
decimalSeparator = _ref.decimalSeparator,
|
|
1117
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
1118
|
+
|
|
953
1119
|
var handleValueChange = function handleValueChange(event) {
|
|
954
1120
|
var inputValue = event.target.value;
|
|
955
1121
|
var unmaskedValue = unMask(inputValue);
|
|
956
1122
|
onChange(unmaskedValue);
|
|
957
1123
|
};
|
|
1124
|
+
|
|
958
1125
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
959
1126
|
var numericValue = Number(originalValue);
|
|
960
1127
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
961
1128
|
return prefix + formattedValue;
|
|
962
1129
|
};
|
|
1130
|
+
|
|
963
1131
|
var formattedValue = formatCurrency(value);
|
|
964
1132
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
965
1133
|
type: "text",
|
|
@@ -967,6 +1135,7 @@
|
|
|
967
1135
|
onChange: handleValueChange
|
|
968
1136
|
}));
|
|
969
1137
|
};
|
|
1138
|
+
|
|
970
1139
|
CurrencyInputFormatter.defaultProps = {
|
|
971
1140
|
value: '',
|
|
972
1141
|
prefix: 'R',
|
|
@@ -7544,6 +7713,7 @@
|
|
|
7544
7713
|
var ReactSelectWrapper = function ReactSelectWrapper(props) {
|
|
7545
7714
|
return /*#__PURE__*/React__default.createElement(index$1, props);
|
|
7546
7715
|
};
|
|
7716
|
+
|
|
7547
7717
|
ReactSelectWrapper.defaultProps = {
|
|
7548
7718
|
isMulti: false,
|
|
7549
7719
|
isSearchable: false,
|
|
@@ -7571,23 +7741,23 @@
|
|
|
7571
7741
|
return props.hasBorder ? props.theme.colors.borderColor : props.theme.colors.ntrlMin;
|
|
7572
7742
|
}, function (_ref) {
|
|
7573
7743
|
var isChecked = _ref.isChecked,
|
|
7574
|
-
|
|
7744
|
+
theme = _ref.theme;
|
|
7575
7745
|
return isChecked ? theme.colors.primary : theme.colors.gray;
|
|
7576
7746
|
}, function (_ref2) {
|
|
7577
7747
|
var isChecked = _ref2.isChecked,
|
|
7578
|
-
|
|
7748
|
+
theme = _ref2.theme;
|
|
7579
7749
|
return isChecked ? 'white' : theme.colors.base;
|
|
7580
7750
|
}, function (_ref3) {
|
|
7581
7751
|
var isChecked = _ref3.isChecked,
|
|
7582
|
-
|
|
7752
|
+
theme = _ref3.theme;
|
|
7583
7753
|
return isChecked ? theme.colors.ntrlMin : theme.colors.primary;
|
|
7584
7754
|
}, function (_ref4) {
|
|
7585
7755
|
var isChecked = _ref4.isChecked,
|
|
7586
|
-
|
|
7756
|
+
theme = _ref4.theme;
|
|
7587
7757
|
return isChecked ? 'white' : theme.colors.base;
|
|
7588
7758
|
}, function (_ref5) {
|
|
7589
7759
|
var isChecked = _ref5.isChecked,
|
|
7590
|
-
|
|
7760
|
+
theme = _ref5.theme;
|
|
7591
7761
|
return isChecked ? theme.colors.primary : 'white';
|
|
7592
7762
|
}, media.sm, function (props) {
|
|
7593
7763
|
return props.theme.marginPaddings[2];
|
|
@@ -7739,35 +7909,43 @@
|
|
|
7739
7909
|
|
|
7740
7910
|
var _templateObject$u, _templateObject2$3;
|
|
7741
7911
|
var categories = catArray;
|
|
7912
|
+
|
|
7742
7913
|
var getSvg = function getSvg() {
|
|
7743
7914
|
var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
7915
|
+
|
|
7744
7916
|
switch (category) {
|
|
7745
7917
|
case interestCategories.BAGS:
|
|
7746
7918
|
return /*#__PURE__*/React__default.createElement(Bags, null);
|
|
7919
|
+
|
|
7747
7920
|
case interestCategories.SHOES:
|
|
7748
7921
|
return /*#__PURE__*/React__default.createElement(Shoes, null);
|
|
7922
|
+
|
|
7749
7923
|
case interestCategories.APPAREL:
|
|
7750
7924
|
return /*#__PURE__*/React__default.createElement(Clothing, null);
|
|
7925
|
+
|
|
7751
7926
|
case interestCategories.ACCESSORIES:
|
|
7752
7927
|
return /*#__PURE__*/React__default.createElement(Accessories, null);
|
|
7928
|
+
|
|
7753
7929
|
case interestCategories.WATCHES:
|
|
7754
7930
|
return /*#__PURE__*/React__default.createElement(Watches, null);
|
|
7931
|
+
|
|
7755
7932
|
default:
|
|
7756
7933
|
return null;
|
|
7757
7934
|
}
|
|
7758
7935
|
};
|
|
7936
|
+
|
|
7759
7937
|
var Container$1 = styled__default.div(_templateObject$u || (_templateObject$u = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
7760
7938
|
return props.theme.marginPaddings[5];
|
|
7761
7939
|
});
|
|
7762
7940
|
var CategoryTitle = styled__default.h1(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n margin-top: 10px;\n font-size: 14px;\n text-transform: uppercase;\n"])));
|
|
7763
|
-
|
|
7764
7941
|
/**
|
|
7765
7942
|
* InterestCatSelector is a specialized selector for select luxity specific interest categories
|
|
7766
7943
|
*/
|
|
7944
|
+
|
|
7767
7945
|
var InterestCatSelector = function InterestCatSelector(_ref) {
|
|
7768
7946
|
var onCategoryChange = _ref.onCategoryChange,
|
|
7769
|
-
|
|
7770
|
-
|
|
7947
|
+
errorMessage = _ref.errorMessage,
|
|
7948
|
+
category = _ref.category;
|
|
7771
7949
|
return /*#__PURE__*/React__default.createElement(Container$1, null, /*#__PURE__*/React__default.createElement(Body$2, null, categories.map(function (cat, index) {
|
|
7772
7950
|
return /*#__PURE__*/React__default.createElement(WrapperButton, {
|
|
7773
7951
|
key: "cat-".concat(index),
|
|
@@ -7782,6 +7960,7 @@
|
|
|
7782
7960
|
}, getSvg(cat.value), /*#__PURE__*/React__default.createElement(CategoryTitle, null, cat.categoryTitle)));
|
|
7783
7961
|
})), errorMessage && /*#__PURE__*/React__default.createElement(ErrorMessage$1, null, errorMessage));
|
|
7784
7962
|
};
|
|
7963
|
+
|
|
7785
7964
|
InterestCatSelector.defaultProps = {
|
|
7786
7965
|
errorMessage: '',
|
|
7787
7966
|
category: null,
|
|
@@ -7792,82 +7971,117 @@
|
|
|
7792
7971
|
var CategoryInterestSelector = themed(InterestCatSelector);
|
|
7793
7972
|
|
|
7794
7973
|
function _extends$2() {
|
|
7795
|
-
|
|
7796
|
-
for (var
|
|
7797
|
-
var
|
|
7798
|
-
|
|
7974
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
7975
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
7976
|
+
var source = arguments[i];
|
|
7977
|
+
|
|
7978
|
+
for (var key in source) {
|
|
7979
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7980
|
+
target[key] = source[key];
|
|
7981
|
+
}
|
|
7982
|
+
}
|
|
7799
7983
|
}
|
|
7800
|
-
|
|
7801
|
-
|
|
7984
|
+
|
|
7985
|
+
return target;
|
|
7986
|
+
};
|
|
7987
|
+
return _extends$2.apply(this, arguments);
|
|
7802
7988
|
}
|
|
7803
7989
|
|
|
7804
|
-
function _assertThisInitialized$2(
|
|
7805
|
-
if (
|
|
7806
|
-
|
|
7990
|
+
function _assertThisInitialized$2(self) {
|
|
7991
|
+
if (self === void 0) {
|
|
7992
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7993
|
+
}
|
|
7994
|
+
|
|
7995
|
+
return self;
|
|
7807
7996
|
}
|
|
7808
7997
|
|
|
7809
|
-
function _setPrototypeOf$2(
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7998
|
+
function _setPrototypeOf$2(o, p) {
|
|
7999
|
+
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
8000
|
+
o.__proto__ = p;
|
|
8001
|
+
return o;
|
|
8002
|
+
};
|
|
8003
|
+
return _setPrototypeOf$2(o, p);
|
|
7813
8004
|
}
|
|
7814
8005
|
|
|
7815
|
-
function _inheritsLoose(
|
|
7816
|
-
|
|
8006
|
+
function _inheritsLoose(subClass, superClass) {
|
|
8007
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
8008
|
+
subClass.prototype.constructor = subClass;
|
|
8009
|
+
_setPrototypeOf$2(subClass, superClass);
|
|
7817
8010
|
}
|
|
7818
8011
|
|
|
7819
|
-
function _getPrototypeOf$2(
|
|
7820
|
-
|
|
7821
|
-
return
|
|
7822
|
-
}
|
|
8012
|
+
function _getPrototypeOf$2(o) {
|
|
8013
|
+
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
8014
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
8015
|
+
};
|
|
8016
|
+
return _getPrototypeOf$2(o);
|
|
7823
8017
|
}
|
|
7824
8018
|
|
|
7825
|
-
function _isNativeFunction(
|
|
7826
|
-
|
|
7827
|
-
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
7828
|
-
} catch (n) {
|
|
7829
|
-
return "function" == typeof t;
|
|
7830
|
-
}
|
|
8019
|
+
function _isNativeFunction(fn) {
|
|
8020
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
7831
8021
|
}
|
|
7832
8022
|
|
|
7833
8023
|
function _isNativeReflectConstruct$1() {
|
|
8024
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
8025
|
+
if (Reflect.construct.sham) return false;
|
|
8026
|
+
if (typeof Proxy === "function") return true;
|
|
8027
|
+
|
|
7834
8028
|
try {
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
return
|
|
7839
|
-
}
|
|
8029
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8030
|
+
return true;
|
|
8031
|
+
} catch (e) {
|
|
8032
|
+
return false;
|
|
8033
|
+
}
|
|
7840
8034
|
}
|
|
7841
8035
|
|
|
7842
|
-
function _construct(
|
|
7843
|
-
if (_isNativeReflectConstruct$1())
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
8036
|
+
function _construct(Parent, args, Class) {
|
|
8037
|
+
if (_isNativeReflectConstruct$1()) {
|
|
8038
|
+
_construct = Reflect.construct.bind();
|
|
8039
|
+
} else {
|
|
8040
|
+
_construct = function _construct(Parent, args, Class) {
|
|
8041
|
+
var a = [null];
|
|
8042
|
+
a.push.apply(a, args);
|
|
8043
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
8044
|
+
var instance = new Constructor();
|
|
8045
|
+
if (Class) _setPrototypeOf$2(instance, Class.prototype);
|
|
8046
|
+
return instance;
|
|
8047
|
+
};
|
|
8048
|
+
}
|
|
8049
|
+
|
|
8050
|
+
return _construct.apply(null, arguments);
|
|
7848
8051
|
}
|
|
7849
8052
|
|
|
7850
|
-
function _wrapNativeSuper(
|
|
7851
|
-
var
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
if (
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
8053
|
+
function _wrapNativeSuper(Class) {
|
|
8054
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
8055
|
+
|
|
8056
|
+
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
8057
|
+
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
8058
|
+
|
|
8059
|
+
if (typeof Class !== "function") {
|
|
8060
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
7858
8061
|
}
|
|
8062
|
+
|
|
8063
|
+
if (typeof _cache !== "undefined") {
|
|
8064
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
8065
|
+
|
|
8066
|
+
_cache.set(Class, Wrapper);
|
|
8067
|
+
}
|
|
8068
|
+
|
|
7859
8069
|
function Wrapper() {
|
|
7860
|
-
return _construct(
|
|
8070
|
+
return _construct(Class, arguments, _getPrototypeOf$2(this).constructor);
|
|
7861
8071
|
}
|
|
7862
|
-
|
|
8072
|
+
|
|
8073
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
7863
8074
|
constructor: {
|
|
7864
8075
|
value: Wrapper,
|
|
7865
|
-
enumerable:
|
|
7866
|
-
writable:
|
|
7867
|
-
configurable:
|
|
8076
|
+
enumerable: false,
|
|
8077
|
+
writable: true,
|
|
8078
|
+
configurable: true
|
|
7868
8079
|
}
|
|
7869
|
-
})
|
|
7870
|
-
|
|
8080
|
+
});
|
|
8081
|
+
return _setPrototypeOf$2(Wrapper, Class);
|
|
8082
|
+
};
|
|
8083
|
+
|
|
8084
|
+
return _wrapNativeSuper(Class);
|
|
7871
8085
|
}
|
|
7872
8086
|
|
|
7873
8087
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
@@ -8536,9 +8750,10 @@
|
|
|
8536
8750
|
}, function (props) {
|
|
8537
8751
|
return getSliderMarkStyle(props);
|
|
8538
8752
|
});
|
|
8753
|
+
|
|
8539
8754
|
var getSliderMarkStyle = function getSliderMarkStyle(_ref) {
|
|
8540
8755
|
var showMarks = _ref.showMarks,
|
|
8541
|
-
|
|
8756
|
+
primary = _ref.theme.colors.primary;
|
|
8542
8757
|
var visiblityStyle = showMarks ? styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral([""]))) : styled.css(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n .rc-slider-mark-text,\n .rc-slider-dot {\n visibility: hidden;\n }\n "])));
|
|
8543
8758
|
return styled.css(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteral(["\n .rc-slider-mark-text {\n color: ", ";\n }\n\n .rc-slider-dot {\n border-color: ", ";\n background-color: white;\n }\n ", "\n "])), primary, primary, visiblityStyle);
|
|
8544
8759
|
};
|
|
@@ -8550,24 +8765,28 @@
|
|
|
8550
8765
|
var Footer = styled__default.div(_templateObject$y || (_templateObject$y = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-end;\n"])));
|
|
8551
8766
|
|
|
8552
8767
|
var _excluded$6 = ["dragging", "value", "offset", "index"],
|
|
8553
|
-
|
|
8768
|
+
_excluded2 = ["renderTitleSection", "marks", "defaultMinValue", "defaultMaxValue", "min", "max", "toolTipComponent", "renderFooterSection", "onChange", "children", "identifier", "showMarks"];
|
|
8769
|
+
|
|
8554
8770
|
var _templateObject$z;
|
|
8555
8771
|
var debounceBuilder = functions.debounced(100);
|
|
8556
8772
|
var ChildrenWrapper = styled__default.div(_templateObject$z || (_templateObject$z = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
8557
8773
|
return props.theme.marginPaddings[3];
|
|
8558
8774
|
});
|
|
8775
|
+
|
|
8559
8776
|
var renderCustomHandle = function renderCustomHandle() {
|
|
8560
8777
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8561
8778
|
var toolTipComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
8562
8779
|
var handleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
8780
|
+
|
|
8563
8781
|
var dragging = handleProps.dragging,
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8782
|
+
value = handleProps.value,
|
|
8783
|
+
offset = handleProps.offset,
|
|
8784
|
+
index = handleProps.index,
|
|
8785
|
+
restHandleProps = _objectWithoutProperties(handleProps, _excluded$6);
|
|
8786
|
+
|
|
8568
8787
|
var getToolTipProps = function getToolTipProps() {
|
|
8569
|
-
var newProps = {};
|
|
8570
|
-
|
|
8788
|
+
var newProps = {}; // Ensures that Tooltip component does not get ref prop
|
|
8789
|
+
|
|
8571
8790
|
Object.keys(handleProps).forEach(function (propName) {
|
|
8572
8791
|
if (propName !== 'ref') {
|
|
8573
8792
|
newProps[propName] = handleProps[propName];
|
|
@@ -8575,6 +8794,7 @@
|
|
|
8575
8794
|
});
|
|
8576
8795
|
return newProps;
|
|
8577
8796
|
};
|
|
8797
|
+
|
|
8578
8798
|
var Tooltip = toolTipComponent;
|
|
8579
8799
|
return /*#__PURE__*/React__default.createElement(React.Fragment, {
|
|
8580
8800
|
key: index
|
|
@@ -8591,47 +8811,55 @@
|
|
|
8591
8811
|
marks: marks
|
|
8592
8812
|
}, getToolTipProps()))));
|
|
8593
8813
|
};
|
|
8594
|
-
|
|
8595
8814
|
/** slider ui component for react */
|
|
8815
|
+
|
|
8816
|
+
|
|
8596
8817
|
var RangeSlider = function RangeSlider(_ref) {
|
|
8597
8818
|
var renderTitleSection = _ref.renderTitleSection,
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8819
|
+
marks = _ref.marks,
|
|
8820
|
+
defaultMinValue = _ref.defaultMinValue,
|
|
8821
|
+
defaultMaxValue = _ref.defaultMaxValue,
|
|
8822
|
+
min = _ref.min,
|
|
8823
|
+
max = _ref.max,
|
|
8824
|
+
toolTipComponent = _ref.toolTipComponent,
|
|
8825
|
+
renderFooterSection = _ref.renderFooterSection,
|
|
8826
|
+
onChange = _ref.onChange,
|
|
8827
|
+
childRenderer = _ref.children,
|
|
8828
|
+
identifier = _ref.identifier,
|
|
8829
|
+
showMarks = _ref.showMarks,
|
|
8830
|
+
restProps = _objectWithoutProperties(_ref, _excluded2);
|
|
8831
|
+
|
|
8610
8832
|
var _useState = React.useState(defaultMinValue),
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8833
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
8834
|
+
currMinVal = _useState2[0],
|
|
8835
|
+
setMinVal = _useState2[1];
|
|
8836
|
+
|
|
8614
8837
|
var _useState3 = React.useState(defaultMaxValue),
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8838
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
8839
|
+
currMaxVal = _useState4[0],
|
|
8840
|
+
setMaxVal = _useState4[1];
|
|
8618
8841
|
/*
|
|
8619
8842
|
*Description variable stores the time that the component renders
|
|
8620
8843
|
* the state is used to enforce reenders for the component since the date now
|
|
8621
8844
|
* is always changing
|
|
8622
8845
|
* */
|
|
8846
|
+
|
|
8847
|
+
|
|
8623
8848
|
var _useState5 = React.useState(0),
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8849
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
8850
|
+
seed = _useState6[0],
|
|
8851
|
+
setSeed = _useState6[1];
|
|
8852
|
+
|
|
8627
8853
|
var manuallyChangeMinValue = function manuallyChangeMinValue(val) {
|
|
8628
8854
|
setMinVal(val);
|
|
8629
8855
|
setSeed(Date.now());
|
|
8630
8856
|
};
|
|
8857
|
+
|
|
8631
8858
|
var manuallyChangeMaxValue = function manuallyChangeMaxValue(val) {
|
|
8632
8859
|
setMaxVal(val);
|
|
8633
8860
|
setSeed(Date.now());
|
|
8634
8861
|
};
|
|
8862
|
+
|
|
8635
8863
|
var prevMinVal = functions.usePrevious(currMinVal);
|
|
8636
8864
|
var prevMaxVal = functions.usePrevious(currMaxVal);
|
|
8637
8865
|
React.useEffect(function () {
|
|
@@ -8667,8 +8895,9 @@
|
|
|
8667
8895
|
defaultValue: [defaultMinValue, defaultMaxValue],
|
|
8668
8896
|
onChange: function onChange(_ref2) {
|
|
8669
8897
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
8670
|
-
|
|
8671
|
-
|
|
8898
|
+
nextMin = _ref3[0],
|
|
8899
|
+
nextMax = _ref3[1];
|
|
8900
|
+
|
|
8672
8901
|
setMinVal(nextMin);
|
|
8673
8902
|
setMaxVal(nextMax);
|
|
8674
8903
|
},
|
|
@@ -8681,6 +8910,7 @@
|
|
|
8681
8910
|
allowCross: false
|
|
8682
8911
|
}, restProps)), /*#__PURE__*/React__default.createElement(Footer, null, renderFooterSection(actionsObj)));
|
|
8683
8912
|
};
|
|
8913
|
+
|
|
8684
8914
|
RangeSlider.defaultProps = {
|
|
8685
8915
|
renderTitleSection: function renderTitleSection() {
|
|
8686
8916
|
return false;
|
|
@@ -8711,10 +8941,11 @@
|
|
|
8711
8941
|
}, function (props) {
|
|
8712
8942
|
return props.theme.marginPaddings[3];
|
|
8713
8943
|
});
|
|
8944
|
+
|
|
8714
8945
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
8715
8946
|
var title = _ref.title,
|
|
8716
|
-
|
|
8717
|
-
|
|
8947
|
+
children = _ref.children,
|
|
8948
|
+
className = _ref.className;
|
|
8718
8949
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
8719
8950
|
className: className
|
|
8720
8951
|
}, /*#__PURE__*/React__default.createElement(Title$2, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
@@ -8726,23 +8957,31 @@
|
|
|
8726
8957
|
});
|
|
8727
8958
|
|
|
8728
8959
|
var debounceBuilder$1 = functions.debounced(50);
|
|
8960
|
+
|
|
8729
8961
|
var getMaxPrice = function getMaxPrice() {
|
|
8730
8962
|
var interestCategory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
8963
|
+
|
|
8731
8964
|
switch (interestCategory) {
|
|
8732
8965
|
case interestCategories.ACCESSORIES:
|
|
8733
8966
|
return interestCategoryMaxPrices.ACCESSORIES;
|
|
8967
|
+
|
|
8734
8968
|
case interestCategories.BAGS:
|
|
8735
8969
|
return interestCategoryMaxPrices.BAGS;
|
|
8970
|
+
|
|
8736
8971
|
case interestCategories.SHOES:
|
|
8737
8972
|
return interestCategoryMaxPrices.SHOES;
|
|
8973
|
+
|
|
8738
8974
|
case interestCategories.WATCHES:
|
|
8739
8975
|
return interestCategoryMaxPrices.WATCHES;
|
|
8976
|
+
|
|
8740
8977
|
case interestCategories.APPAREL:
|
|
8741
8978
|
return interestCategoryMaxPrices.APPAREL;
|
|
8979
|
+
|
|
8742
8980
|
default:
|
|
8743
8981
|
return 0;
|
|
8744
8982
|
}
|
|
8745
8983
|
};
|
|
8984
|
+
|
|
8746
8985
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
8747
8986
|
var giveFullRange = actionObj.giveFullRange;
|
|
8748
8987
|
return /*#__PURE__*/React__default.createElement(SecondaryButton$1, {
|
|
@@ -8750,21 +8989,24 @@
|
|
|
8750
8989
|
onClick: giveFullRange
|
|
8751
8990
|
}, "Full Price Range");
|
|
8752
8991
|
};
|
|
8753
|
-
|
|
8754
8992
|
/** UI Slider with minimum and max input fields give the ability to
|
|
8755
8993
|
* select a price range */
|
|
8994
|
+
|
|
8995
|
+
|
|
8756
8996
|
var PriceRangeSelector = function PriceRangeSelector(_ref) {
|
|
8757
8997
|
var onChange = _ref.onChange,
|
|
8758
|
-
|
|
8998
|
+
category = _ref.category;
|
|
8759
8999
|
var maxPrice = getMaxPrice(category);
|
|
9000
|
+
|
|
8760
9001
|
var handleSlideChange = function handleSlideChange(value) {
|
|
8761
9002
|
var min_price = value.min,
|
|
8762
|
-
|
|
9003
|
+
max_price = value.max;
|
|
8763
9004
|
onChange({
|
|
8764
9005
|
min_price: min_price,
|
|
8765
9006
|
max_price: max_price
|
|
8766
9007
|
});
|
|
8767
9008
|
};
|
|
9009
|
+
|
|
8768
9010
|
var handleMinCurrencyChange = function handleMinCurrencyChange(targetValue, currMaxVal, manuallyChangeMinValue) {
|
|
8769
9011
|
var value = parseInt(unMask(targetValue), 10);
|
|
8770
9012
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -8777,6 +9019,7 @@
|
|
|
8777
9019
|
});
|
|
8778
9020
|
});
|
|
8779
9021
|
};
|
|
9022
|
+
|
|
8780
9023
|
var handleMaxCurrencyChange = function handleMaxCurrencyChange(targetValue, currMinVal, manuallyChangeMaxValue) {
|
|
8781
9024
|
var value = parseInt(unMask(targetValue), 10);
|
|
8782
9025
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -8789,6 +9032,7 @@
|
|
|
8789
9032
|
});
|
|
8790
9033
|
});
|
|
8791
9034
|
};
|
|
9035
|
+
|
|
8792
9036
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8793
9037
|
className: "price-ranges"
|
|
8794
9038
|
}, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
@@ -8807,9 +9051,9 @@
|
|
|
8807
9051
|
title: "Price Ranges"
|
|
8808
9052
|
}, function (_ref2) {
|
|
8809
9053
|
var manuallyChangeMinValue = _ref2.manuallyChangeMinValue,
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
9054
|
+
manuallyChangeMaxValue = _ref2.manuallyChangeMaxValue,
|
|
9055
|
+
currMinVal = _ref2.currMinVal,
|
|
9056
|
+
currMaxVal = _ref2.currMaxVal;
|
|
8813
9057
|
return /*#__PURE__*/React__default.createElement(CurrencyInputWrapper, null, /*#__PURE__*/React__default.createElement(CurrencyInputFormatter, {
|
|
8814
9058
|
"data-qe-id": "masked-input-min",
|
|
8815
9059
|
value: currMinVal,
|
|
@@ -8825,6 +9069,7 @@
|
|
|
8825
9069
|
}));
|
|
8826
9070
|
}));
|
|
8827
9071
|
};
|
|
9072
|
+
|
|
8828
9073
|
PriceRangeSelector.defaultProps = {
|
|
8829
9074
|
onChange: function onChange() {
|
|
8830
9075
|
return false;
|
|
@@ -8845,6 +9090,7 @@
|
|
|
8845
9090
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
8846
9091
|
return shoe_sizes.length - 1;
|
|
8847
9092
|
};
|
|
9093
|
+
|
|
8848
9094
|
var formatResultsForRangeSlider = function formatResultsForRangeSlider() {
|
|
8849
9095
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
8850
9096
|
var newDataShape = {};
|
|
@@ -8854,24 +9100,28 @@
|
|
|
8854
9100
|
});
|
|
8855
9101
|
return newDataShape;
|
|
8856
9102
|
};
|
|
9103
|
+
|
|
8857
9104
|
var ToolTipComponent = function ToolTipComponent(props) {
|
|
8858
9105
|
var marks = props.marks,
|
|
8859
|
-
|
|
9106
|
+
value = props.value;
|
|
8860
9107
|
return /*#__PURE__*/React__default.createElement("div", null, marks[value]);
|
|
8861
9108
|
};
|
|
8862
|
-
|
|
8863
9109
|
/** slider ui component for shoe size selection interests */
|
|
9110
|
+
|
|
9111
|
+
|
|
8864
9112
|
var ShoeSizeSelector = function ShoeSizeSelector(_ref2) {
|
|
8865
9113
|
var onChange = _ref2.onChange,
|
|
8866
|
-
|
|
9114
|
+
shoeSizes = _ref2.shoeSizes;
|
|
9115
|
+
|
|
8867
9116
|
var handleShoeSizeChange = function handleShoeSizeChange(value) {
|
|
8868
9117
|
var min_shoe_key = value.min,
|
|
8869
|
-
|
|
9118
|
+
max_shoe_key = value.max;
|
|
8870
9119
|
onChange({
|
|
8871
9120
|
min_shoe_size_id: shoeSizes[min_shoe_key].id,
|
|
8872
9121
|
max_shoe_size_id: shoeSizes[max_shoe_key].id
|
|
8873
9122
|
});
|
|
8874
9123
|
};
|
|
9124
|
+
|
|
8875
9125
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
8876
9126
|
var giveFullRange = actionObj.giveFullRange;
|
|
8877
9127
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
@@ -8880,6 +9130,7 @@
|
|
|
8880
9130
|
onClick: giveFullRange
|
|
8881
9131
|
}, "Full Shoe Size Range"));
|
|
8882
9132
|
};
|
|
9133
|
+
|
|
8883
9134
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
8884
9135
|
identifier: "shoe-size-range-slider",
|
|
8885
9136
|
marks: formatResultsForRangeSlider(shoeSizes),
|
|
@@ -8892,6 +9143,7 @@
|
|
|
8892
9143
|
onChange: handleShoeSizeChange
|
|
8893
9144
|
}));
|
|
8894
9145
|
};
|
|
9146
|
+
|
|
8895
9147
|
ShoeSizeSelector.defaultProps = {
|
|
8896
9148
|
onChange: function onChange() {
|
|
8897
9149
|
return false;
|
|
@@ -8900,17 +9152,23 @@
|
|
|
8900
9152
|
};
|
|
8901
9153
|
|
|
8902
9154
|
var SimpleErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
9155
|
+
_inherits(SimpleErrorBoundary, _React$Component);
|
|
9156
|
+
|
|
9157
|
+
var _super = _createSuper(SimpleErrorBoundary);
|
|
9158
|
+
|
|
8903
9159
|
function SimpleErrorBoundary(props) {
|
|
8904
9160
|
var _this;
|
|
9161
|
+
|
|
8905
9162
|
_classCallCheck(this, SimpleErrorBoundary);
|
|
8906
|
-
|
|
9163
|
+
|
|
9164
|
+
_this = _super.call(this, props);
|
|
8907
9165
|
_this.state = {
|
|
8908
9166
|
hasError: false
|
|
8909
9167
|
};
|
|
8910
9168
|
return _this;
|
|
8911
9169
|
}
|
|
8912
|
-
|
|
8913
|
-
|
|
9170
|
+
|
|
9171
|
+
_createClass(SimpleErrorBoundary, [{
|
|
8914
9172
|
key: "componentDidCatch",
|
|
8915
9173
|
value: function componentDidCatch(error, errorInfo) {
|
|
8916
9174
|
// You can also log the error to an error reporting service
|
|
@@ -8923,6 +9181,7 @@
|
|
|
8923
9181
|
// You can render any custom fallback UI
|
|
8924
9182
|
return this.props.showMessageOnError ? /*#__PURE__*/React__default.createElement("h1", null, this.props.errorMessage) : null;
|
|
8925
9183
|
}
|
|
9184
|
+
|
|
8926
9185
|
return this.props.children;
|
|
8927
9186
|
}
|
|
8928
9187
|
}], [{
|
|
@@ -8934,7 +9193,10 @@
|
|
|
8934
9193
|
};
|
|
8935
9194
|
}
|
|
8936
9195
|
}]);
|
|
9196
|
+
|
|
9197
|
+
return SimpleErrorBoundary;
|
|
8937
9198
|
}(React__default.Component);
|
|
9199
|
+
|
|
8938
9200
|
SimpleErrorBoundary.defaultProps = {
|
|
8939
9201
|
errorMessage: 'Something went wrong',
|
|
8940
9202
|
errorLogger: null,
|
|
@@ -8945,19 +9207,21 @@
|
|
|
8945
9207
|
var StyledHeader = styled__default.h5(_templateObject$D || (_templateObject$D = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n display: block;\n }\n\n .icon-header__left {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n align-self: flex-start;\n }\n\n svg {\n height: 1.5em;\n width: 1.5em;\n margin-right: ", ";\n }\n }\n\n .icon-header__right {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n }\n"])), media.sm, media.sm, function (props) {
|
|
8946
9208
|
return props.theme.marginPaddings[1];
|
|
8947
9209
|
});
|
|
9210
|
+
|
|
8948
9211
|
/**
|
|
8949
9212
|
* IconHeader can render the standard Luxity Page/Section Header nodes with SVG
|
|
8950
9213
|
*/
|
|
8951
9214
|
var IconHeader = function IconHeader(_ref) {
|
|
8952
9215
|
var title = _ref.title,
|
|
8953
|
-
|
|
8954
|
-
|
|
9216
|
+
SvgComponent = _ref.svgComponent,
|
|
9217
|
+
renderAppendage = _ref.renderAppendage;
|
|
8955
9218
|
return /*#__PURE__*/React__default.createElement(StyledHeader, null, /*#__PURE__*/React__default.createElement("div", {
|
|
8956
9219
|
className: "icon-header__left"
|
|
8957
9220
|
}, /*#__PURE__*/React__default.createElement(SvgComponent, null), title), /*#__PURE__*/React__default.createElement("div", {
|
|
8958
9221
|
className: "icon-header__right"
|
|
8959
9222
|
}, renderAppendage && renderAppendage()));
|
|
8960
9223
|
};
|
|
9224
|
+
|
|
8961
9225
|
IconHeader.defaultProps = {
|
|
8962
9226
|
title: '',
|
|
8963
9227
|
svgComponent: function svgComponent() {
|
|
@@ -9011,21 +9275,30 @@
|
|
|
9011
9275
|
/**
|
|
9012
9276
|
* It represents the React Component that contains the notifications.
|
|
9013
9277
|
* */
|
|
9278
|
+
|
|
9014
9279
|
var LuxityNotifications = function LuxityNotifications(props) {
|
|
9015
9280
|
return /*#__PURE__*/React__default.createElement(Notifications__default, props);
|
|
9016
9281
|
};
|
|
9017
9282
|
|
|
9018
9283
|
var NotificationDropDown = /*#__PURE__*/function (_React$Component) {
|
|
9284
|
+
_inherits(NotificationDropDown, _React$Component);
|
|
9285
|
+
|
|
9286
|
+
var _super = _createSuper(NotificationDropDown);
|
|
9287
|
+
|
|
9019
9288
|
function NotificationDropDown(props) {
|
|
9020
9289
|
var _this;
|
|
9290
|
+
|
|
9021
9291
|
_classCallCheck(this, NotificationDropDown);
|
|
9022
|
-
|
|
9023
|
-
|
|
9292
|
+
|
|
9293
|
+
_this = _super.call(this, props);
|
|
9294
|
+
|
|
9295
|
+
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption) {
|
|
9024
9296
|
_this.setState({
|
|
9025
9297
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9026
9298
|
fetching: true
|
|
9027
9299
|
})
|
|
9028
9300
|
});
|
|
9301
|
+
|
|
9029
9302
|
_this.props.setSchedule(selectedOption.value).then(function () {
|
|
9030
9303
|
_this.setState({
|
|
9031
9304
|
selectedOption: selectedOption,
|
|
@@ -9033,6 +9306,7 @@
|
|
|
9033
9306
|
success: true
|
|
9034
9307
|
})
|
|
9035
9308
|
});
|
|
9309
|
+
|
|
9036
9310
|
success('Notification Frequency Updated');
|
|
9037
9311
|
}).catch(function () {
|
|
9038
9312
|
_this.setState({
|
|
@@ -9040,10 +9314,12 @@
|
|
|
9040
9314
|
failed: true
|
|
9041
9315
|
})
|
|
9042
9316
|
});
|
|
9317
|
+
|
|
9043
9318
|
error('Error Ocurred');
|
|
9044
9319
|
});
|
|
9045
9320
|
});
|
|
9046
|
-
|
|
9321
|
+
|
|
9322
|
+
_defineProperty(_assertThisInitialized(_this), "getOptionsFromEnumResult", function (enumResult) {
|
|
9047
9323
|
var enumValues = enumResult.data.__type.enumValues;
|
|
9048
9324
|
return enumValues.map(function (enumItem) {
|
|
9049
9325
|
return {
|
|
@@ -9052,10 +9328,14 @@
|
|
|
9052
9328
|
};
|
|
9053
9329
|
});
|
|
9054
9330
|
});
|
|
9055
|
-
|
|
9331
|
+
|
|
9332
|
+
_defineProperty(_assertThisInitialized(_this), "onData", function (_ref) {
|
|
9056
9333
|
var data = _ref.data;
|
|
9334
|
+
|
|
9057
9335
|
var options = _this.getOptionsFromEnumResult(data);
|
|
9336
|
+
|
|
9058
9337
|
var currentValue = data.data.user.email_interest_send_schedule;
|
|
9338
|
+
|
|
9059
9339
|
_this.setState(function (prevState) {
|
|
9060
9340
|
return {
|
|
9061
9341
|
options: options,
|
|
@@ -9067,11 +9347,12 @@
|
|
|
9067
9347
|
};
|
|
9068
9348
|
});
|
|
9069
9349
|
});
|
|
9070
|
-
|
|
9350
|
+
|
|
9351
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9071
9352
|
var _this$state = _this.state,
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9353
|
+
options = _this$state.options,
|
|
9354
|
+
selectedOption = _this$state.selectedOption,
|
|
9355
|
+
updating = _this$state.request.fetching;
|
|
9075
9356
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9076
9357
|
getRequestPromise: _this.props.getSchedule,
|
|
9077
9358
|
onData: function onData(data) {
|
|
@@ -9094,6 +9375,7 @@
|
|
|
9094
9375
|
value: selectedOption
|
|
9095
9376
|
}))));
|
|
9096
9377
|
});
|
|
9378
|
+
|
|
9097
9379
|
_this.state = {
|
|
9098
9380
|
options: [],
|
|
9099
9381
|
selectedOption: null,
|
|
@@ -9101,9 +9383,10 @@
|
|
|
9101
9383
|
};
|
|
9102
9384
|
return _this;
|
|
9103
9385
|
}
|
|
9104
|
-
|
|
9386
|
+
|
|
9105
9387
|
return _createClass(NotificationDropDown);
|
|
9106
9388
|
}(React__default.Component);
|
|
9389
|
+
|
|
9107
9390
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
9108
9391
|
|
|
9109
9392
|
var _templateObject$F, _templateObject2$6;
|
|
@@ -9145,49 +9428,65 @@
|
|
|
9145
9428
|
}, function (props) {
|
|
9146
9429
|
return props.theme.colors.ntrlMin;
|
|
9147
9430
|
});
|
|
9148
|
-
|
|
9149
9431
|
/**
|
|
9150
9432
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
9151
9433
|
*/
|
|
9434
|
+
|
|
9152
9435
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
9436
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
9437
|
+
|
|
9438
|
+
var _super = _createSuper(GraphQLMultiSelector);
|
|
9439
|
+
|
|
9153
9440
|
function GraphQLMultiSelector(props) {
|
|
9154
9441
|
var _this;
|
|
9442
|
+
|
|
9155
9443
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
9156
|
-
|
|
9157
|
-
|
|
9444
|
+
|
|
9445
|
+
_this = _super.call(this, props);
|
|
9446
|
+
|
|
9447
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
9158
9448
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
9159
9449
|
_this.makeRequest();
|
|
9160
9450
|
}
|
|
9161
9451
|
});
|
|
9162
|
-
|
|
9452
|
+
|
|
9453
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
9163
9454
|
_this.pageReady.refreshPage();
|
|
9164
9455
|
});
|
|
9165
|
-
|
|
9456
|
+
|
|
9457
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
9166
9458
|
return _this.setState({
|
|
9167
9459
|
selected: [ALL_ITEM]
|
|
9168
9460
|
});
|
|
9169
9461
|
});
|
|
9170
|
-
|
|
9462
|
+
|
|
9463
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
9171
9464
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
9172
9465
|
return sel.id;
|
|
9173
9466
|
});
|
|
9467
|
+
|
|
9174
9468
|
var pagination = _this.props.resultProcessor(res);
|
|
9469
|
+
|
|
9175
9470
|
var allSelected = _this.state.selected.some(function (item) {
|
|
9176
9471
|
return item.id === ALL_ITEM.id;
|
|
9177
9472
|
});
|
|
9473
|
+
|
|
9178
9474
|
var newList = pagination.data.filter(function (newItem) {
|
|
9179
9475
|
return !selectedIds.includes(newItem.id);
|
|
9180
9476
|
});
|
|
9181
9477
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
9478
|
+
|
|
9182
9479
|
_this.setState({
|
|
9183
9480
|
list: newList,
|
|
9184
9481
|
pagination: pagination
|
|
9185
9482
|
});
|
|
9186
9483
|
});
|
|
9187
|
-
|
|
9484
|
+
|
|
9485
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
9188
9486
|
_this.setState(function (prevState) {
|
|
9189
9487
|
var newSelectedList;
|
|
9190
9488
|
var newList;
|
|
9489
|
+
|
|
9191
9490
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
9192
9491
|
// Clear Selected List
|
|
9193
9492
|
// and move previous Selected items to list
|
|
@@ -9207,6 +9506,7 @@
|
|
|
9207
9506
|
return item.id !== addSelectedItem.id;
|
|
9208
9507
|
})));
|
|
9209
9508
|
}
|
|
9509
|
+
|
|
9210
9510
|
return {
|
|
9211
9511
|
selected: newSelectedList,
|
|
9212
9512
|
list: newList
|
|
@@ -9217,20 +9517,24 @@
|
|
|
9217
9517
|
}));
|
|
9218
9518
|
});
|
|
9219
9519
|
});
|
|
9220
|
-
|
|
9520
|
+
|
|
9521
|
+
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
9221
9522
|
_this.setState(function (prevState) {
|
|
9222
9523
|
// Cannot remove ALL from selection by unselecting it
|
|
9223
9524
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
9224
9525
|
return {};
|
|
9225
9526
|
}
|
|
9527
|
+
|
|
9226
9528
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
9227
9529
|
return item.id !== removeSelectedItem.id;
|
|
9228
9530
|
});
|
|
9531
|
+
|
|
9229
9532
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
9230
9533
|
return item.id !== ALL_ITEM.id;
|
|
9231
9534
|
}).sort(function (a, b) {
|
|
9232
9535
|
return a.id - b.id;
|
|
9233
9536
|
});
|
|
9537
|
+
|
|
9234
9538
|
return {
|
|
9235
9539
|
list: newList,
|
|
9236
9540
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -9241,23 +9545,25 @@
|
|
|
9241
9545
|
}));
|
|
9242
9546
|
});
|
|
9243
9547
|
});
|
|
9244
|
-
|
|
9548
|
+
|
|
9549
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
9245
9550
|
_this.setState({
|
|
9246
9551
|
isLoading: flag
|
|
9247
9552
|
});
|
|
9248
9553
|
});
|
|
9249
|
-
|
|
9554
|
+
|
|
9555
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9250
9556
|
var _this$props = _this.props,
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9557
|
+
baseClass = _this$props.baseClass,
|
|
9558
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
9559
|
+
identifier = _this$props.identifier,
|
|
9560
|
+
triggerRequest = _this$props.triggerRequest,
|
|
9561
|
+
className = _this$props.className;
|
|
9256
9562
|
var _this$state = _this.state,
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9563
|
+
list = _this$state.list,
|
|
9564
|
+
selected = _this$state.selected,
|
|
9565
|
+
pagination = _this$state.pagination,
|
|
9566
|
+
isLoading = _this$state.isLoading;
|
|
9261
9567
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9262
9568
|
"data-qe-id": identifier,
|
|
9263
9569
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -9296,6 +9602,7 @@
|
|
|
9296
9602
|
type: "button"
|
|
9297
9603
|
}, "SHOW MORE"))));
|
|
9298
9604
|
});
|
|
9605
|
+
|
|
9299
9606
|
_this.state = {
|
|
9300
9607
|
selected: [ALL_ITEM],
|
|
9301
9608
|
list: [],
|
|
@@ -9304,9 +9611,10 @@
|
|
|
9304
9611
|
};
|
|
9305
9612
|
return _this;
|
|
9306
9613
|
}
|
|
9307
|
-
|
|
9614
|
+
|
|
9308
9615
|
return _createClass(GraphQLMultiSelector);
|
|
9309
9616
|
}(React__default.Component);
|
|
9617
|
+
|
|
9310
9618
|
GraphQLMultiSelector.defaultProps = {
|
|
9311
9619
|
baseClass: 'multiselector'
|
|
9312
9620
|
};
|
|
@@ -9327,12 +9635,13 @@
|
|
|
9327
9635
|
});
|
|
9328
9636
|
|
|
9329
9637
|
var _templateObject$G;
|
|
9638
|
+
|
|
9330
9639
|
var Title$3 = function Title(_ref) {
|
|
9331
9640
|
var baseClass = _ref.baseClass,
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9641
|
+
className = _ref.className,
|
|
9642
|
+
title = _ref.title,
|
|
9643
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
9644
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
9336
9645
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9337
9646
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
9338
9647
|
title: title
|
|
@@ -9345,6 +9654,7 @@
|
|
|
9345
9654
|
onChange: onSearchChanged
|
|
9346
9655
|
})));
|
|
9347
9656
|
};
|
|
9657
|
+
|
|
9348
9658
|
var StyledTitle = styled__default(Title$3)(_templateObject$G || (_templateObject$G = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-weight: bold;\n display: flex;\n align-items: center;\n font-size: ", ";\n\n .title__search,\n .title__search {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 30px;\n margin-bottom: ", ";\n\n svg {\n margin-left: ", ";\n fill: ", ";\n stroke: ", ";\n }\n\n input {\n width: 140px;\n border: none;\n font-size: ", ";\n transition: 0.2s border-color ease-in-out;\n margin-left: ", ";\n padding: 0;\n\n :focus {\n border-color: ", ";\n border-bottom: none;\n }\n }\n }\n"])), function (props) {
|
|
9349
9659
|
return props.theme.marginPaddings[2];
|
|
9350
9660
|
}, function (props) {
|
|
@@ -9367,26 +9677,37 @@
|
|
|
9367
9677
|
var Title$4 = themed(StyledTitle);
|
|
9368
9678
|
|
|
9369
9679
|
var debounceBuilder$3 = functions.debounced(200);
|
|
9680
|
+
|
|
9370
9681
|
/**
|
|
9371
9682
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
9372
9683
|
*/
|
|
9373
9684
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
9685
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
9686
|
+
|
|
9687
|
+
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
9688
|
+
|
|
9374
9689
|
function LuxityGraphQLMultiselector(props) {
|
|
9375
9690
|
var _this;
|
|
9691
|
+
|
|
9376
9692
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9693
|
+
|
|
9694
|
+
_this = _super.call(this, props);
|
|
9695
|
+
|
|
9696
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
9697
|
+
|
|
9698
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
9380
9699
|
_this.setState(function (prevState) {
|
|
9381
9700
|
return {
|
|
9382
9701
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
9383
9702
|
};
|
|
9384
9703
|
});
|
|
9385
9704
|
});
|
|
9386
|
-
|
|
9705
|
+
|
|
9706
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
9387
9707
|
_this.props.onChange(selection);
|
|
9388
9708
|
});
|
|
9389
|
-
|
|
9709
|
+
|
|
9710
|
+
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
9390
9711
|
event.preventDefault();
|
|
9391
9712
|
var searchText = event.target.value;
|
|
9392
9713
|
debounceBuilder$3(function () {
|
|
@@ -9395,21 +9716,22 @@
|
|
|
9395
9716
|
});
|
|
9396
9717
|
});
|
|
9397
9718
|
});
|
|
9398
|
-
|
|
9719
|
+
|
|
9720
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9399
9721
|
var _this$state = _this.state,
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9722
|
+
limit = _this$state.limit,
|
|
9723
|
+
category = _this$state.category,
|
|
9724
|
+
nameFilter = _this$state.nameFilter;
|
|
9403
9725
|
var _this$props = _this.props,
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9726
|
+
title = _this$props.title,
|
|
9727
|
+
baseClass = _this$props.baseClass,
|
|
9728
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
9729
|
+
resultProcessor = _this$props.resultProcessor,
|
|
9730
|
+
itemRenderer = _this$props.itemRenderer,
|
|
9731
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
9732
|
+
graphApi = _this$props.graphApi,
|
|
9733
|
+
identifier = _this$props.identifier,
|
|
9734
|
+
requestInstance = _this$props.requestInstance;
|
|
9413
9735
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9414
9736
|
className: baseClass
|
|
9415
9737
|
}, /*#__PURE__*/React__default.createElement(Title$4, {
|
|
@@ -9432,6 +9754,7 @@
|
|
|
9432
9754
|
itemRenderer: itemRenderer
|
|
9433
9755
|
})));
|
|
9434
9756
|
});
|
|
9757
|
+
|
|
9435
9758
|
_this.state = {
|
|
9436
9759
|
limit: props.baseQueryLimit,
|
|
9437
9760
|
category: props.category,
|
|
@@ -9439,11 +9762,12 @@
|
|
|
9439
9762
|
};
|
|
9440
9763
|
return _this;
|
|
9441
9764
|
}
|
|
9442
|
-
|
|
9443
|
-
|
|
9765
|
+
|
|
9766
|
+
_createClass(LuxityGraphQLMultiselector, [{
|
|
9444
9767
|
key: "componentDidUpdate",
|
|
9445
9768
|
value: function componentDidUpdate(prevProps) {
|
|
9446
9769
|
var _this$multiSelectorRe;
|
|
9770
|
+
|
|
9447
9771
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
9448
9772
|
this.multiSelectorRef.current.emptySelected();
|
|
9449
9773
|
}
|
|
@@ -9456,10 +9780,14 @@
|
|
|
9456
9780
|
category: props.category
|
|
9457
9781
|
};
|
|
9458
9782
|
}
|
|
9783
|
+
|
|
9459
9784
|
return null;
|
|
9460
9785
|
}
|
|
9461
9786
|
}]);
|
|
9787
|
+
|
|
9788
|
+
return LuxityGraphQLMultiselector;
|
|
9462
9789
|
}(React__default.Component);
|
|
9790
|
+
|
|
9463
9791
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
9464
9792
|
baseClass: '',
|
|
9465
9793
|
searchPlaceHolder: '',
|
|
@@ -9480,10 +9808,11 @@
|
|
|
9480
9808
|
return props.theme.colors.ntrlMin;
|
|
9481
9809
|
});
|
|
9482
9810
|
var UnselectedButton = themed(BaseButton);
|
|
9811
|
+
|
|
9483
9812
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
9484
9813
|
var item = _ref.item,
|
|
9485
|
-
|
|
9486
|
-
|
|
9814
|
+
onSelect = _ref.onSelect,
|
|
9815
|
+
selected = _ref.selected;
|
|
9487
9816
|
var props = {
|
|
9488
9817
|
onClick: function onClick(e) {
|
|
9489
9818
|
e.preventDefault();
|
|
@@ -9495,12 +9824,12 @@
|
|
|
9495
9824
|
|
|
9496
9825
|
var BrandSelector = function BrandSelector(_ref) {
|
|
9497
9826
|
var onChange = _ref.onChange,
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9827
|
+
category = _ref.category,
|
|
9828
|
+
graphApi = _ref.graphApi,
|
|
9829
|
+
itemRenderer = _ref.itemRenderer,
|
|
9830
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
9831
|
+
resultProcessor = _ref.resultProcessor,
|
|
9832
|
+
requestInstance = _ref.requestInstance;
|
|
9504
9833
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
9505
9834
|
baseQueryLimit: 16,
|
|
9506
9835
|
title: "Brands",
|
|
@@ -9517,6 +9846,7 @@
|
|
|
9517
9846
|
requestInstance: requestInstance
|
|
9518
9847
|
});
|
|
9519
9848
|
};
|
|
9849
|
+
|
|
9520
9850
|
BrandSelector.defaultProps = {
|
|
9521
9851
|
itemRenderer: ItemRenderer,
|
|
9522
9852
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -9526,12 +9856,12 @@
|
|
|
9526
9856
|
|
|
9527
9857
|
var StyleSelector = function StyleSelector(_ref) {
|
|
9528
9858
|
var onChange = _ref.onChange,
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9859
|
+
category = _ref.category,
|
|
9860
|
+
graphApi = _ref.graphApi,
|
|
9861
|
+
itemRenderer = _ref.itemRenderer,
|
|
9862
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
9863
|
+
resultProcessor = _ref.resultProcessor,
|
|
9864
|
+
requestInstance = _ref.requestInstance;
|
|
9535
9865
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
9536
9866
|
title: "Styles",
|
|
9537
9867
|
queryId: "getStyles",
|
|
@@ -9548,6 +9878,7 @@
|
|
|
9548
9878
|
requestInstance: requestInstance
|
|
9549
9879
|
});
|
|
9550
9880
|
};
|
|
9881
|
+
|
|
9551
9882
|
StyleSelector.defaultProps = {
|
|
9552
9883
|
itemRenderer: ItemRenderer,
|
|
9553
9884
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -9579,14 +9910,17 @@
|
|
|
9579
9910
|
ShoeSizeFadeContainer.defaultProps = {
|
|
9580
9911
|
childVisible: false
|
|
9581
9912
|
};
|
|
9913
|
+
|
|
9582
9914
|
var OpacityTransitionRender = function OpacityTransitionRender(_ref) {
|
|
9583
9915
|
var shoeSizeType = _ref.shoeSizeType,
|
|
9584
|
-
|
|
9916
|
+
children = _ref.children;
|
|
9585
9917
|
var prevShoeSizeType = functions.usePrevious(shoeSizeType);
|
|
9918
|
+
|
|
9586
9919
|
var _React$useState = React__default.useState(false),
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9920
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9921
|
+
childVisible = _React$useState2[0],
|
|
9922
|
+
setChildVisible = _React$useState2[1];
|
|
9923
|
+
|
|
9590
9924
|
React__default.useEffect(function () {
|
|
9591
9925
|
if (prevShoeSizeType !== shoeSizeType) {
|
|
9592
9926
|
setChildVisible(false);
|
|
@@ -9599,25 +9933,30 @@
|
|
|
9599
9933
|
childVisible: childVisible
|
|
9600
9934
|
}, children);
|
|
9601
9935
|
};
|
|
9936
|
+
|
|
9602
9937
|
var WrappedShoeSizeSelector = function WrappedShoeSizeSelector(_ref2) {
|
|
9603
9938
|
var onChange = _ref2.onChange,
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9939
|
+
requestInstance = _ref2.requestInstance,
|
|
9940
|
+
graphApi = _ref2.graphApi,
|
|
9941
|
+
defaultShoeSizeType = _ref2.defaultShoeSizeType,
|
|
9942
|
+
getGraphQuery = _ref2.getGraphQuery;
|
|
9943
|
+
|
|
9608
9944
|
var _useState = React.useState(defaultShoeSizeType),
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9945
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9946
|
+
shoeSizeType = _useState2[0],
|
|
9947
|
+
setShoeSizeType = _useState2[1];
|
|
9948
|
+
|
|
9612
9949
|
var _useState3 = React.useState(defaultShoeSizeType),
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9950
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9951
|
+
transitionedTo = _useState4[0],
|
|
9952
|
+
setTransitionedTo = _useState4[1];
|
|
9953
|
+
|
|
9616
9954
|
var triggerRequest = function triggerRequest() {
|
|
9617
9955
|
return requestInstance.post(graphApi, {
|
|
9618
9956
|
query: getGraphQuery()
|
|
9619
9957
|
});
|
|
9620
9958
|
};
|
|
9959
|
+
|
|
9621
9960
|
var shoeSizeTypeProps = {
|
|
9622
9961
|
name: 'shoe_size_type',
|
|
9623
9962
|
noWrap: true,
|
|
@@ -9641,12 +9980,15 @@
|
|
|
9641
9980
|
checked: shoeSizeType === shoeSizeTypes.eu.value
|
|
9642
9981
|
}]
|
|
9643
9982
|
};
|
|
9983
|
+
|
|
9644
9984
|
var handlePropOnChange = function handlePropOnChange(value) {
|
|
9645
9985
|
var payload = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
9646
9986
|
shoe_size_type: shoeSizeType
|
|
9647
9987
|
});
|
|
9988
|
+
|
|
9648
9989
|
onChange(payload);
|
|
9649
9990
|
};
|
|
9991
|
+
|
|
9650
9992
|
var renderShoeSizeSelector = function renderShoeSizeSelector() {
|
|
9651
9993
|
var passedShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9652
9994
|
return /*#__PURE__*/React__default.createElement(ShoeSizeSelector, {
|
|
@@ -9656,32 +9998,38 @@
|
|
|
9656
9998
|
}
|
|
9657
9999
|
});
|
|
9658
10000
|
};
|
|
10001
|
+
|
|
9659
10002
|
var getShoeSizeSelector = function getShoeSizeSelector() {
|
|
9660
10003
|
var euShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9661
10004
|
var ukShoeShoes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
10005
|
+
|
|
9662
10006
|
if (shoeSizeType === shoeSizeTypes.eu.value) {
|
|
9663
10007
|
return renderShoeSizeSelector(euShoeSizes);
|
|
9664
10008
|
}
|
|
10009
|
+
|
|
9665
10010
|
if (shoeSizeType === shoeSizeTypes.uk.value) {
|
|
9666
10011
|
return renderShoeSizeSelector(ukShoeShoes);
|
|
9667
10012
|
}
|
|
10013
|
+
|
|
9668
10014
|
return null;
|
|
9669
10015
|
};
|
|
10016
|
+
|
|
9670
10017
|
return /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9671
10018
|
getRequestPromise: triggerRequest
|
|
9672
10019
|
}, /*#__PURE__*/React__default.createElement(TitleWrapper, null, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9673
10020
|
title: "Shoe Size Range"
|
|
9674
10021
|
}, /*#__PURE__*/React__default.createElement(RadioButtons$1, shoeSizeTypeProps))), /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Consumer, null, function (_ref3) {
|
|
9675
10022
|
var _ref3$data$data = _ref3.data.data,
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
10023
|
+
_ref3$data$data$luxit = _ref3$data$data.luxity_eu_shoe_sizes,
|
|
10024
|
+
luxity_eu_shoe_sizes = _ref3$data$data$luxit === void 0 ? [] : _ref3$data$data$luxit,
|
|
10025
|
+
_ref3$data$data$luxit2 = _ref3$data$data.luxity_uk_shoe_sizes,
|
|
10026
|
+
luxity_uk_shoe_sizes = _ref3$data$data$luxit2 === void 0 ? [] : _ref3$data$data$luxit2;
|
|
9680
10027
|
return /*#__PURE__*/React__default.createElement(OpacityTransitionRender, {
|
|
9681
10028
|
shoeSizeType: transitionedTo
|
|
9682
10029
|
}, getShoeSizeSelector(luxity_eu_shoe_sizes, luxity_uk_shoe_sizes));
|
|
9683
10030
|
}));
|
|
9684
10031
|
};
|
|
10032
|
+
|
|
9685
10033
|
WrappedShoeSizeSelector.defaultProps = {
|
|
9686
10034
|
onChange: function onChange() {
|
|
9687
10035
|
return false;
|
|
@@ -9704,6 +10052,7 @@
|
|
|
9704
10052
|
});
|
|
9705
10053
|
|
|
9706
10054
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10055
|
+
|
|
9707
10056
|
var _templateObject$K, _templateObject2$8, _templateObject3$3;
|
|
9708
10057
|
var Content = styled__default.div(_templateObject$K || (_templateObject$K = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 1px solid ", ";\n transition: 200ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n cursor: pointer;\n"])), function (props) {
|
|
9709
10058
|
return props.theme.colors.primary;
|
|
@@ -9722,32 +10071,36 @@
|
|
|
9722
10071
|
}, Content, InputText, function (props) {
|
|
9723
10072
|
return props.theme.colors.ntrlMin;
|
|
9724
10073
|
}, Content);
|
|
9725
|
-
|
|
9726
10074
|
/**
|
|
9727
10075
|
* CheckButton: Styled checkbox that resembles a button
|
|
9728
10076
|
* */
|
|
10077
|
+
|
|
9729
10078
|
var CheckButton = function CheckButton(props) {
|
|
9730
10079
|
var title = props.title,
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
10080
|
+
checked = props.checked,
|
|
10081
|
+
renderIcon = props.renderIcon,
|
|
10082
|
+
onChange = props.onChange,
|
|
10083
|
+
checkedValue = props.checkedValue,
|
|
10084
|
+
unCheckedValue = props.unCheckedValue,
|
|
10085
|
+
restProps = _objectWithoutProperties(props, _excluded$7);
|
|
10086
|
+
|
|
9737
10087
|
var _React$useState = React__default.useState(checked),
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
10088
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10089
|
+
checkedState = _React$useState2[0],
|
|
10090
|
+
setCheck = _React$useState2[1];
|
|
10091
|
+
|
|
9741
10092
|
var prevCheckState = functions.usePrevious(checkedState);
|
|
9742
10093
|
React__default.useEffect(function () {
|
|
9743
10094
|
if (prevCheckState !== checkedState) {
|
|
9744
10095
|
onChange(checkedState);
|
|
9745
10096
|
}
|
|
9746
10097
|
}, [checkedState, onChange, prevCheckState]);
|
|
10098
|
+
|
|
9747
10099
|
var handleInputChange = function handleInputChange(e) {
|
|
9748
10100
|
var targetChecked = e.target.checked;
|
|
9749
10101
|
setCheck(targetChecked);
|
|
9750
10102
|
};
|
|
10103
|
+
|
|
9751
10104
|
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
9752
10105
|
defaultChecked: checked
|
|
9753
10106
|
}, restProps, {
|
|
@@ -9755,6 +10108,7 @@
|
|
|
9755
10108
|
onChange: handleInputChange
|
|
9756
10109
|
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
9757
10110
|
};
|
|
10111
|
+
|
|
9758
10112
|
CheckButton.defaultProps = {
|
|
9759
10113
|
title: '',
|
|
9760
10114
|
checked: false,
|
|
@@ -9768,24 +10122,29 @@
|
|
|
9768
10122
|
var CheckButton$1 = themed(CheckButton);
|
|
9769
10123
|
|
|
9770
10124
|
var MALE$1 = genders.MALE,
|
|
9771
|
-
|
|
10125
|
+
FEMALE$1 = genders.FEMALE;
|
|
10126
|
+
|
|
9772
10127
|
/**
|
|
9773
10128
|
* Stylized CheckboxButton for selecting gender
|
|
9774
10129
|
* */
|
|
9775
10130
|
var GenderCheckbox = function GenderCheckbox(_ref) {
|
|
9776
10131
|
var gender = _ref.gender,
|
|
9777
|
-
|
|
9778
|
-
|
|
10132
|
+
checked = _ref.checked,
|
|
10133
|
+
onInputChange = _ref.onInputChange;
|
|
10134
|
+
|
|
9779
10135
|
var getTitle = function getTitle() {
|
|
9780
10136
|
switch (gender) {
|
|
9781
10137
|
case MALE$1:
|
|
9782
10138
|
return 'Male';
|
|
10139
|
+
|
|
9783
10140
|
case FEMALE$1:
|
|
9784
10141
|
return 'Female';
|
|
10142
|
+
|
|
9785
10143
|
default:
|
|
9786
10144
|
return '';
|
|
9787
10145
|
}
|
|
9788
10146
|
};
|
|
10147
|
+
|
|
9789
10148
|
return /*#__PURE__*/React__default.createElement(CheckButton$1, {
|
|
9790
10149
|
onChange: onInputChange,
|
|
9791
10150
|
checked: checked,
|
|
@@ -9793,20 +10152,22 @@
|
|
|
9793
10152
|
title: getTitle()
|
|
9794
10153
|
});
|
|
9795
10154
|
};
|
|
10155
|
+
|
|
9796
10156
|
GenderCheckbox.defaultProps = {
|
|
9797
10157
|
name: ''
|
|
9798
10158
|
};
|
|
9799
10159
|
|
|
9800
10160
|
var MALE$2 = genders.MALE,
|
|
9801
|
-
|
|
10161
|
+
FEMALE$2 = genders.FEMALE;
|
|
10162
|
+
|
|
9802
10163
|
/**
|
|
9803
10164
|
* GenderSelector: specialized selector to pick genders for the Interest Component
|
|
9804
10165
|
* */
|
|
9805
10166
|
var GenderSelector = function GenderSelector(_ref) {
|
|
9806
10167
|
var gender = _ref.gender,
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
10168
|
+
onChange = _ref.onChange,
|
|
10169
|
+
maleInputRef = _ref.maleInputRef,
|
|
10170
|
+
femaleInputRef = _ref.femaleInputRef;
|
|
9810
10171
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9811
10172
|
className: "gender-selector"
|
|
9812
10173
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -9831,6 +10192,7 @@
|
|
|
9831
10192
|
checkBoxButtonRef: femaleInputRef
|
|
9832
10193
|
})));
|
|
9833
10194
|
};
|
|
10195
|
+
|
|
9834
10196
|
GenderSelector.defaultProps = {
|
|
9835
10197
|
gender: null,
|
|
9836
10198
|
onChange: function onChange() {
|
|
@@ -9888,14 +10250,16 @@
|
|
|
9888
10250
|
return props.theme.marginPaddings[2];
|
|
9889
10251
|
});
|
|
9890
10252
|
var AddInterestButtonContainer = styled__default.div(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteral(["\n display: flex;\n\n #add-icon {\n margin-bottom: 1.5rem;\n\n svg {\n width: 15px;\n }\n }\n"])));
|
|
10253
|
+
|
|
9891
10254
|
var AddIcon = function AddIcon(_ref) {
|
|
9892
10255
|
var onClick = _ref.onClick,
|
|
9893
|
-
|
|
10256
|
+
id = _ref.id;
|
|
9894
10257
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
9895
10258
|
id: id,
|
|
9896
10259
|
onClick: onClick
|
|
9897
10260
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Add, null)));
|
|
9898
10261
|
};
|
|
10262
|
+
|
|
9899
10263
|
var defaultState = {
|
|
9900
10264
|
category_type: null,
|
|
9901
10265
|
brands: [],
|
|
@@ -9908,30 +10272,41 @@
|
|
|
9908
10272
|
request: _objectSpread2({}, request),
|
|
9909
10273
|
isCategoriesShown: false
|
|
9910
10274
|
};
|
|
9911
|
-
|
|
9912
10275
|
/**
|
|
9913
10276
|
* Generates Interest UI and submits graph payloads as a highly specialised component
|
|
9914
10277
|
*/
|
|
10278
|
+
|
|
9915
10279
|
var AddInterest = /*#__PURE__*/function (_React$Component) {
|
|
10280
|
+
_inherits(AddInterest, _React$Component);
|
|
10281
|
+
|
|
10282
|
+
var _super = _createSuper(AddInterest);
|
|
10283
|
+
|
|
9916
10284
|
function AddInterest(props) {
|
|
9917
10285
|
var _this;
|
|
10286
|
+
|
|
9918
10287
|
_classCallCheck(this, AddInterest);
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
_defineProperty(_this, "
|
|
10288
|
+
|
|
10289
|
+
_this = _super.call(this, props);
|
|
10290
|
+
|
|
10291
|
+
_defineProperty(_assertThisInitialized(_this), "maleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10292
|
+
|
|
10293
|
+
_defineProperty(_assertThisInitialized(_this), "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10294
|
+
|
|
10295
|
+
_defineProperty(_assertThisInitialized(_this), "onCategoryChanged", function (categoryType) {
|
|
9923
10296
|
_this.setState({
|
|
9924
10297
|
category_type: categoryType,
|
|
9925
10298
|
brands: [],
|
|
9926
10299
|
styles: []
|
|
9927
10300
|
});
|
|
9928
10301
|
});
|
|
9929
|
-
|
|
10302
|
+
|
|
10303
|
+
_defineProperty(_assertThisInitialized(_this), "onGenderChanged", function (isChecked, gender) {
|
|
9930
10304
|
return _this.setState(function (prevState) {
|
|
9931
10305
|
// current array of options
|
|
9932
10306
|
var gendersSelected = _toConsumableArray(prevState.gender);
|
|
9933
|
-
|
|
9934
|
-
// check if the check box is checked or unchecked
|
|
10307
|
+
|
|
10308
|
+
var index; // check if the check box is checked or unchecked
|
|
10309
|
+
|
|
9935
10310
|
if (isChecked) {
|
|
9936
10311
|
gendersSelected.push(gender);
|
|
9937
10312
|
} else {
|
|
@@ -9939,57 +10314,67 @@
|
|
|
9939
10314
|
index = gendersSelected.indexOf(gender);
|
|
9940
10315
|
gendersSelected.splice(index, 1);
|
|
9941
10316
|
}
|
|
10317
|
+
|
|
9942
10318
|
return {
|
|
9943
10319
|
gender: gendersSelected
|
|
9944
10320
|
};
|
|
9945
10321
|
});
|
|
9946
10322
|
});
|
|
9947
|
-
|
|
10323
|
+
|
|
10324
|
+
_defineProperty(_assertThisInitialized(_this), "onBrandsChanged", function (brandsArray) {
|
|
9948
10325
|
_this.setState({
|
|
9949
10326
|
brands: brandsArray.map(function (brand) {
|
|
9950
10327
|
return brand.id;
|
|
9951
10328
|
})
|
|
9952
10329
|
});
|
|
9953
10330
|
});
|
|
9954
|
-
|
|
10331
|
+
|
|
10332
|
+
_defineProperty(_assertThisInitialized(_this), "onShoeSizesChanged", function (shoeSizes) {
|
|
9955
10333
|
_this.setState(_objectSpread2({}, shoeSizes));
|
|
9956
10334
|
});
|
|
9957
|
-
|
|
10335
|
+
|
|
10336
|
+
_defineProperty(_assertThisInitialized(_this), "onPriceRangesChanged", function (priceRange) {
|
|
9958
10337
|
_this.setState(_objectSpread2({}, priceRange));
|
|
9959
10338
|
});
|
|
9960
|
-
|
|
10339
|
+
|
|
10340
|
+
_defineProperty(_assertThisInitialized(_this), "onStylesChanged", function (stylesArray) {
|
|
9961
10341
|
_this.setState({
|
|
9962
10342
|
styles: stylesArray.map(function (style) {
|
|
9963
10343
|
return style.id;
|
|
9964
10344
|
})
|
|
9965
10345
|
});
|
|
9966
10346
|
});
|
|
9967
|
-
|
|
10347
|
+
|
|
10348
|
+
_defineProperty(_assertThisInitialized(_this), "payloadIsValid", function () {
|
|
9968
10349
|
// price/shoe-size always have initial values as soon as category is set
|
|
9969
10350
|
var category_type = _this.state.category_type;
|
|
9970
10351
|
return category_type !== null;
|
|
9971
10352
|
});
|
|
9972
|
-
|
|
10353
|
+
|
|
10354
|
+
_defineProperty(_assertThisInitialized(_this), "submitInterest", function () {
|
|
9973
10355
|
_this.setState({
|
|
9974
10356
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9975
10357
|
fetching: true
|
|
9976
10358
|
})
|
|
9977
10359
|
});
|
|
10360
|
+
|
|
9978
10361
|
var _this$state = _this.state,
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
10362
|
+
brands = _this$state.brands,
|
|
10363
|
+
min_shoe_size_id = _this$state.min_shoe_size_id,
|
|
10364
|
+
max_shoe_size_id = _this$state.max_shoe_size_id,
|
|
10365
|
+
shoe_size_type = _this$state.shoe_size_type,
|
|
10366
|
+
min_price = _this$state.min_price,
|
|
10367
|
+
max_price = _this$state.max_price,
|
|
10368
|
+
styles = _this$state.styles,
|
|
10369
|
+
category_type = _this$state.category_type,
|
|
10370
|
+
requestState = _this$state.request,
|
|
10371
|
+
gender = _this$state.gender;
|
|
9989
10372
|
var payloadGender = gender[0];
|
|
10373
|
+
|
|
9990
10374
|
if (gender.length > 1 || !gender.length) {
|
|
9991
10375
|
payloadGender = UNISEX$1;
|
|
9992
10376
|
}
|
|
10377
|
+
|
|
9993
10378
|
var basePayload = {
|
|
9994
10379
|
category_type: category_type,
|
|
9995
10380
|
brands: brands,
|
|
@@ -10004,21 +10389,27 @@
|
|
|
10004
10389
|
max_shoe_size_id: max_shoe_size_id,
|
|
10005
10390
|
shoe_size_type: shoe_size_type
|
|
10006
10391
|
} : {};
|
|
10392
|
+
|
|
10007
10393
|
var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
|
|
10394
|
+
|
|
10008
10395
|
simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
|
|
10009
10396
|
_this.setState({
|
|
10010
10397
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10011
10398
|
success: true
|
|
10012
10399
|
})
|
|
10013
10400
|
});
|
|
10401
|
+
|
|
10014
10402
|
_this.props.onSubmitSuccess(_objectSpread2({}, payload));
|
|
10015
10403
|
}, _this.handleRequestError);
|
|
10016
10404
|
});
|
|
10017
|
-
|
|
10405
|
+
|
|
10406
|
+
_defineProperty(_assertThisInitialized(_this), "handleRequestError", function (_ref2) {
|
|
10018
10407
|
var data = _ref2.data;
|
|
10408
|
+
|
|
10019
10409
|
_this.setState({
|
|
10020
10410
|
request: _objectSpread2({}, request)
|
|
10021
10411
|
});
|
|
10412
|
+
|
|
10022
10413
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
10023
10414
|
return data[key];
|
|
10024
10415
|
}).flat();
|
|
@@ -10028,30 +10419,34 @@
|
|
|
10028
10419
|
}, message);
|
|
10029
10420
|
}));
|
|
10030
10421
|
});
|
|
10031
|
-
|
|
10422
|
+
|
|
10423
|
+
_defineProperty(_assertThisInitialized(_this), "resetState", function () {
|
|
10032
10424
|
_this.setState(_objectSpread2({}, defaultState));
|
|
10033
10425
|
});
|
|
10034
|
-
|
|
10426
|
+
|
|
10427
|
+
_defineProperty(_assertThisInitialized(_this), "handleGenderChange", function (isChecked, gender) {
|
|
10035
10428
|
return _this.onGenderChanged(isChecked, gender);
|
|
10036
10429
|
});
|
|
10037
|
-
|
|
10430
|
+
|
|
10431
|
+
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function () {
|
|
10038
10432
|
_this.setState(function (prevState) {
|
|
10039
10433
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10040
10434
|
isCategoriesShown: true
|
|
10041
10435
|
});
|
|
10042
10436
|
});
|
|
10043
10437
|
});
|
|
10044
|
-
|
|
10438
|
+
|
|
10439
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10045
10440
|
var _this$state2 = _this.state,
|
|
10046
|
-
|
|
10047
|
-
|
|
10441
|
+
category_type = _this$state2.category_type,
|
|
10442
|
+
fetching = _this$state2.request.fetching;
|
|
10048
10443
|
var _this$props = _this.props,
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10444
|
+
requestInstance = _this$props.requestInstance,
|
|
10445
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
10446
|
+
getBrandsGraphQuery = _this$props.getBrandsGraphQuery,
|
|
10447
|
+
getStylesGraphQuery = _this$props.getStylesGraphQuery,
|
|
10448
|
+
getShoesGraphQuery = _this$props.getShoesGraphQuery,
|
|
10449
|
+
defaultShoeSizeType = _this$props.defaultShoeSizeType;
|
|
10055
10450
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, !_this.state.isCategoriesShown && /*#__PURE__*/React__default.createElement(AddInterestButtonContainer, {
|
|
10056
10451
|
onClick: _this.onAddInterestClick
|
|
10057
10452
|
}, /*#__PURE__*/React__default.createElement(AddInterestButton, null, "Add Interest"), /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
@@ -10099,16 +10494,19 @@
|
|
|
10099
10494
|
type: "button",
|
|
10100
10495
|
onClick: function onClick() {
|
|
10101
10496
|
_this.submitInterest();
|
|
10497
|
+
|
|
10102
10498
|
_this.resetState();
|
|
10103
10499
|
}
|
|
10104
10500
|
}, fetching ? 'SAVING' : 'SAVE')))))));
|
|
10105
10501
|
});
|
|
10502
|
+
|
|
10106
10503
|
_this.state = _objectSpread2({}, defaultState);
|
|
10107
10504
|
return _this;
|
|
10108
10505
|
}
|
|
10109
|
-
|
|
10506
|
+
|
|
10110
10507
|
return _createClass(AddInterest);
|
|
10111
10508
|
}(React__default.Component);
|
|
10509
|
+
|
|
10112
10510
|
var AddInterest$1 = themed(AddInterest);
|
|
10113
10511
|
|
|
10114
10512
|
var _templateObject$M;
|
|
@@ -10119,6 +10517,7 @@
|
|
|
10119
10517
|
}, function (props) {
|
|
10120
10518
|
return props.theme.marginPaddings[1];
|
|
10121
10519
|
}, media.xs);
|
|
10520
|
+
|
|
10122
10521
|
var MyInterestTitleHeading = function MyInterestTitleHeading() {
|
|
10123
10522
|
return /*#__PURE__*/React__default.createElement(MyInterestTitleHeadingContainer, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10124
10523
|
className: "heading-title-section"
|
|
@@ -10138,6 +10537,7 @@
|
|
|
10138
10537
|
className: "heading-title-empty"
|
|
10139
10538
|
}));
|
|
10140
10539
|
};
|
|
10540
|
+
|
|
10141
10541
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
10142
10542
|
|
|
10143
10543
|
var _templateObject$N;
|
|
@@ -10147,34 +10547,43 @@
|
|
|
10147
10547
|
var AccountIcon = themed(function () {
|
|
10148
10548
|
return /*#__PURE__*/React__default.createElement(SvgWrapper$2, null, /*#__PURE__*/React__default.createElement(Account, null));
|
|
10149
10549
|
});
|
|
10550
|
+
|
|
10150
10551
|
/**
|
|
10151
10552
|
* Page/View that controls the viewing and Adding of Luxity Interests
|
|
10152
10553
|
*/
|
|
10153
10554
|
var Interests = /*#__PURE__*/function (_React$Component) {
|
|
10555
|
+
_inherits(Interests, _React$Component);
|
|
10556
|
+
|
|
10557
|
+
var _super = _createSuper(Interests);
|
|
10558
|
+
|
|
10154
10559
|
function Interests(props) {
|
|
10155
10560
|
var _this;
|
|
10561
|
+
|
|
10156
10562
|
_classCallCheck(this, Interests);
|
|
10157
|
-
|
|
10158
|
-
|
|
10563
|
+
|
|
10564
|
+
_this = _super.call(this, props);
|
|
10565
|
+
|
|
10566
|
+
_defineProperty(_assertThisInitialized(_this), "setInterests", function (data) {
|
|
10159
10567
|
var interests = data.data.data.interests.data;
|
|
10568
|
+
|
|
10160
10569
|
_this.setState({
|
|
10161
10570
|
interests: interests
|
|
10162
10571
|
});
|
|
10163
10572
|
});
|
|
10164
|
-
|
|
10165
|
-
_defineProperty(_this, "onInterestSubmitSuccess", function (interestItem) {
|
|
10573
|
+
|
|
10574
|
+
_defineProperty(_assertThisInitialized(_this), "onInterestSubmitSuccess", function (interestItem) {
|
|
10166
10575
|
// due to the fact that we dont get the Interest payload back - we have to re-request the list
|
|
10167
10576
|
_this.triggerInterestRequest().then(function (res) {
|
|
10168
10577
|
return _this.setInterests(res);
|
|
10169
|
-
});
|
|
10170
|
-
|
|
10171
|
-
// UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
10578
|
+
}); // UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
10172
10579
|
// this.setState(prevState => {
|
|
10173
10580
|
// const newInterests = [interestItem].concat(prevState.interests);
|
|
10174
10581
|
// return { ...prevState, interests: newInterests };
|
|
10175
10582
|
// });
|
|
10583
|
+
|
|
10176
10584
|
});
|
|
10177
|
-
|
|
10585
|
+
|
|
10586
|
+
_defineProperty(_assertThisInitialized(_this), "onDeleteInterest", function (deletedItem) {
|
|
10178
10587
|
_this.setState(function (prevState) {
|
|
10179
10588
|
var newInterests = prevState.interests.filter(function (item) {
|
|
10180
10589
|
return item.id !== deletedItem.id;
|
|
@@ -10184,38 +10593,41 @@
|
|
|
10184
10593
|
});
|
|
10185
10594
|
});
|
|
10186
10595
|
});
|
|
10187
|
-
|
|
10596
|
+
|
|
10597
|
+
_defineProperty(_assertThisInitialized(_this), "triggerInterestRequest", function () {
|
|
10188
10598
|
var _this$props = _this.props,
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10599
|
+
requestInstance = _this$props.requestInstance,
|
|
10600
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
10601
|
+
interestQuery = _this$props.interestQuery;
|
|
10192
10602
|
return requestInstance.post("".concat(baseGraphApi, "?id=getInterests"), {
|
|
10193
10603
|
query: interestQuery
|
|
10194
10604
|
});
|
|
10195
10605
|
});
|
|
10606
|
+
|
|
10196
10607
|
_this.state = {
|
|
10197
10608
|
interests: []
|
|
10198
10609
|
};
|
|
10199
10610
|
return _this;
|
|
10200
10611
|
}
|
|
10201
|
-
|
|
10202
|
-
|
|
10612
|
+
|
|
10613
|
+
_createClass(Interests, [{
|
|
10203
10614
|
key: "render",
|
|
10204
10615
|
value: function render() {
|
|
10205
10616
|
var _this2 = this;
|
|
10617
|
+
|
|
10206
10618
|
var interests = this.state.interests;
|
|
10207
10619
|
var _this$props2 = this.props,
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10620
|
+
addInterestApi = _this$props2.addInterestApi,
|
|
10621
|
+
requestInstance = _this$props2.requestInstance,
|
|
10622
|
+
baseGraphApi = _this$props2.baseGraphApi,
|
|
10623
|
+
getBrandsGraphQuery = _this$props2.getBrandsGraphQuery,
|
|
10624
|
+
getStylesGraphQuery = _this$props2.getStylesGraphQuery,
|
|
10625
|
+
getShoesGraphQuery = _this$props2.getShoesGraphQuery,
|
|
10626
|
+
deleteInterestApi = _this$props2.deleteInterestApi,
|
|
10627
|
+
setSchedule = _this$props2.setSchedule,
|
|
10628
|
+
getSchedule = _this$props2.getSchedule,
|
|
10629
|
+
interestsTitle = _this$props2.interestsTitle,
|
|
10630
|
+
defaultShoeSizeType = _this$props2.defaultShoeSizeType;
|
|
10219
10631
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10220
10632
|
className: "interests"
|
|
10221
10633
|
}, /*#__PURE__*/React__default.createElement(Notifications__default, {
|
|
@@ -10266,7 +10678,10 @@
|
|
|
10266
10678
|
}))));
|
|
10267
10679
|
}
|
|
10268
10680
|
}]);
|
|
10681
|
+
|
|
10682
|
+
return Interests;
|
|
10269
10683
|
}(React__default.Component);
|
|
10684
|
+
|
|
10270
10685
|
Interests.defaultProps = {
|
|
10271
10686
|
interestsTitle: 'Interests',
|
|
10272
10687
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|
|
@@ -10587,49 +11002,63 @@
|
|
|
10587
11002
|
}, function (props) {
|
|
10588
11003
|
return props.theme.colors.ntrlMin;
|
|
10589
11004
|
});
|
|
10590
|
-
|
|
10591
11005
|
/**
|
|
10592
11006
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
10593
11007
|
*/
|
|
11008
|
+
|
|
10594
11009
|
var GraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
11010
|
+
_inherits(GraphQLDropdownSelector, _React$Component);
|
|
11011
|
+
|
|
11012
|
+
var _super = _createSuper(GraphQLDropdownSelector);
|
|
11013
|
+
|
|
10595
11014
|
function GraphQLDropdownSelector(props) {
|
|
10596
11015
|
var _this;
|
|
11016
|
+
|
|
10597
11017
|
_classCallCheck(this, GraphQLDropdownSelector);
|
|
10598
|
-
|
|
10599
|
-
|
|
11018
|
+
|
|
11019
|
+
_this = _super.call(this, props);
|
|
11020
|
+
|
|
11021
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
10600
11022
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
10601
11023
|
_this.makeRequest();
|
|
10602
11024
|
}
|
|
10603
11025
|
});
|
|
10604
|
-
|
|
11026
|
+
|
|
11027
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
10605
11028
|
_this.pageReady.refreshPage();
|
|
10606
11029
|
});
|
|
10607
|
-
|
|
11030
|
+
|
|
11031
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
10608
11032
|
return _this.setState({
|
|
10609
11033
|
selected: [ALL_ITEM$1]
|
|
10610
11034
|
});
|
|
10611
11035
|
});
|
|
10612
|
-
|
|
11036
|
+
|
|
11037
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
10613
11038
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
10614
11039
|
return sel.value;
|
|
10615
11040
|
});
|
|
11041
|
+
|
|
10616
11042
|
var pagination = _this.props.resultProcessor(res);
|
|
11043
|
+
|
|
10617
11044
|
var allSelected = _this.state.selected.some(function (item) {
|
|
10618
11045
|
return item.value === ALL_ITEM$1.value;
|
|
10619
11046
|
});
|
|
11047
|
+
|
|
10620
11048
|
var newList = pagination.filter(function (newItem) {
|
|
10621
11049
|
return !selectedIds.includes(newItem.value);
|
|
10622
11050
|
});
|
|
10623
|
-
newList = allSelected ? newList : [ALL_ITEM$1].concat(_toConsumableArray(newList));
|
|
11051
|
+
newList = allSelected ? newList : [ALL_ITEM$1].concat(_toConsumableArray(newList)); // eslint-disable-next-line react/no-unused-state
|
|
10624
11052
|
|
|
10625
|
-
// eslint-disable-next-line react/no-unused-state
|
|
10626
11053
|
_this.setState({
|
|
10627
11054
|
list: newList,
|
|
10628
11055
|
pagination: pagination
|
|
10629
11056
|
});
|
|
10630
11057
|
});
|
|
10631
|
-
|
|
11058
|
+
|
|
11059
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
10632
11060
|
var newSelectedList;
|
|
11061
|
+
|
|
10633
11062
|
if (addSelectedItem.includes(ALL_ITEM$1)) {
|
|
10634
11063
|
newSelectedList = [ALL_ITEM$1];
|
|
10635
11064
|
} else {
|
|
@@ -10637,6 +11066,7 @@
|
|
|
10637
11066
|
return item.value !== ALL_ITEM$1.value;
|
|
10638
11067
|
});
|
|
10639
11068
|
}
|
|
11069
|
+
|
|
10640
11070
|
_this.setState(function (prevState) {
|
|
10641
11071
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10642
11072
|
selected: newSelectedList
|
|
@@ -10647,17 +11077,19 @@
|
|
|
10647
11077
|
}));
|
|
10648
11078
|
});
|
|
10649
11079
|
});
|
|
10650
|
-
|
|
11080
|
+
|
|
11081
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
10651
11082
|
_this.setState({
|
|
10652
11083
|
isLoading: flag
|
|
10653
11084
|
});
|
|
10654
11085
|
});
|
|
10655
|
-
|
|
11086
|
+
|
|
11087
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10656
11088
|
var _this$props = _this.props,
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
11089
|
+
baseClass = _this$props.baseClass,
|
|
11090
|
+
identifier = _this$props.identifier,
|
|
11091
|
+
triggerRequest = _this$props.triggerRequest,
|
|
11092
|
+
className = _this$props.className;
|
|
10661
11093
|
var list = _this.state.list;
|
|
10662
11094
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector$1, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10663
11095
|
"data-qe-id": identifier,
|
|
@@ -10682,6 +11114,7 @@
|
|
|
10682
11114
|
isSearchable: true
|
|
10683
11115
|
}))));
|
|
10684
11116
|
});
|
|
11117
|
+
|
|
10685
11118
|
_this.state = {
|
|
10686
11119
|
selected: [ALL_ITEM$1],
|
|
10687
11120
|
list: [],
|
|
@@ -10690,9 +11123,10 @@
|
|
|
10690
11123
|
};
|
|
10691
11124
|
return _this;
|
|
10692
11125
|
}
|
|
10693
|
-
|
|
11126
|
+
|
|
10694
11127
|
return _createClass(GraphQLDropdownSelector);
|
|
10695
11128
|
}(React__default.Component);
|
|
11129
|
+
|
|
10696
11130
|
GraphQLDropdownSelector.defaultProps = {
|
|
10697
11131
|
baseClass: 'multiselector'
|
|
10698
11132
|
};
|
|
@@ -10702,33 +11136,43 @@
|
|
|
10702
11136
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
10703
11137
|
*/
|
|
10704
11138
|
var LuxityGraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
11139
|
+
_inherits(LuxityGraphQLDropdownSelector, _React$Component);
|
|
11140
|
+
|
|
11141
|
+
var _super = _createSuper(LuxityGraphQLDropdownSelector);
|
|
11142
|
+
|
|
10705
11143
|
function LuxityGraphQLDropdownSelector(props) {
|
|
10706
11144
|
var _this;
|
|
11145
|
+
|
|
10707
11146
|
_classCallCheck(this, LuxityGraphQLDropdownSelector);
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
11147
|
+
|
|
11148
|
+
_this = _super.call(this, props);
|
|
11149
|
+
|
|
11150
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
11151
|
+
|
|
11152
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
10711
11153
|
_this.setState(function (prevState) {
|
|
10712
11154
|
return {
|
|
10713
11155
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
10714
11156
|
};
|
|
10715
11157
|
});
|
|
10716
11158
|
});
|
|
10717
|
-
|
|
11159
|
+
|
|
11160
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
10718
11161
|
_this.props.onChange(selection);
|
|
10719
11162
|
});
|
|
10720
|
-
|
|
11163
|
+
|
|
11164
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10721
11165
|
var _this$state = _this.state,
|
|
10722
|
-
|
|
10723
|
-
|
|
11166
|
+
limit = _this$state.limit,
|
|
11167
|
+
query_arguments = _this$state.query_arguments;
|
|
10724
11168
|
var _this$props = _this.props,
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
11169
|
+
title = _this$props.title,
|
|
11170
|
+
baseClass = _this$props.baseClass,
|
|
11171
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
11172
|
+
resultProcessor = _this$props.resultProcessor,
|
|
11173
|
+
graphApi = _this$props.graphApi,
|
|
11174
|
+
identifier = _this$props.identifier,
|
|
11175
|
+
requestInstance = _this$props.requestInstance;
|
|
10732
11176
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10733
11177
|
className: baseClass
|
|
10734
11178
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -10747,17 +11191,19 @@
|
|
|
10747
11191
|
resultProcessor: resultProcessor
|
|
10748
11192
|
})));
|
|
10749
11193
|
});
|
|
11194
|
+
|
|
10750
11195
|
_this.state = {
|
|
10751
11196
|
limit: props.baseQueryLimit,
|
|
10752
11197
|
query_arguments: props.query_arguments
|
|
10753
11198
|
};
|
|
10754
11199
|
return _this;
|
|
10755
11200
|
}
|
|
10756
|
-
|
|
10757
|
-
|
|
11201
|
+
|
|
11202
|
+
_createClass(LuxityGraphQLDropdownSelector, [{
|
|
10758
11203
|
key: "componentDidUpdate",
|
|
10759
11204
|
value: function componentDidUpdate(prevProps) {
|
|
10760
11205
|
var _this$multiSelectorRe;
|
|
11206
|
+
|
|
10761
11207
|
if (prevProps.query_arguments !== this.props.query_arguments && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
10762
11208
|
this.multiSelectorRef.current.emptySelected();
|
|
10763
11209
|
}
|
|
@@ -10770,10 +11216,14 @@
|
|
|
10770
11216
|
query_arguments: props.query_arguments
|
|
10771
11217
|
};
|
|
10772
11218
|
}
|
|
11219
|
+
|
|
10773
11220
|
return null;
|
|
10774
11221
|
}
|
|
10775
11222
|
}]);
|
|
11223
|
+
|
|
11224
|
+
return LuxityGraphQLDropdownSelector;
|
|
10776
11225
|
}(React__default.Component);
|
|
11226
|
+
|
|
10777
11227
|
LuxityGraphQLDropdownSelector.defaultProps = {
|
|
10778
11228
|
baseClass: '',
|
|
10779
11229
|
searchPlaceHolder: '',
|