@bonlineza/luxity-lib 2.36.1-beta.1 → 2.36.1-beta.3
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 +76 -116
- package/AddInterest.js +440 -777
- package/AddProductInterest.js +485 -644
- package/BrandSelector.js +176 -336
- package/Checkbox.js +68 -101
- package/CheckboxButton.js +79 -124
- package/CommunicationPreferenceOptionsRenderer.js +159 -169
- package/CommunicationPreferenceSection.js +166 -178
- package/CommunicationPreferences.js +549 -427
- package/ConditionSelector.js +174 -336
- package/CountryCodeSelect.js +7 -10
- package/CurrencyInputFormatter.js +29 -56
- package/CurrencySelect.js +23 -49
- package/DropdownSelector.js +68 -92
- package/GALink.js +6 -16
- package/GenderSelector.js +88 -142
- package/GraphQLDropdownSelector.js +933 -1511
- package/GraphQLMultiSelector.js +141 -274
- package/IconHeader.js +11 -25
- package/IconWrapper.js +3 -7
- package/InterestCatSelector.js +34 -74
- package/InterestItem.js +103 -187
- package/Interests.js +922 -1471
- package/InterestsSubheading.js +5 -10
- package/InvertedTextButton.js +27 -63
- package/LuxityAppSideNav.js +18 -21
- package/LuxityDesktopHeader.js +219 -274
- package/LuxityFooter.js +430 -321
- package/LuxityGraphQLDropdownSelector.js +949 -1543
- package/LuxityGraphQLMultiselector.js +167 -321
- package/LuxityMobileHeader.js +251 -342
- package/LuxityPageReady.js +74 -136
- package/LuxityProductInterestItem.js +97 -175
- package/LuxitySideNav.js +165 -215
- package/MaterialSelector.js +956 -1551
- package/ModelSelector.js +956 -1551
- package/NotificationDropDown.js +122 -221
- package/Notify.js +0 -1
- package/OutlinePrimaryButton.js +26 -58
- package/PriceRangeSelector.js +168 -281
- package/PrimaryButton.js +26 -58
- package/RadioButtons.js +114 -140
- package/RangeSlider.js +152 -242
- package/RareStepFooter.js +27 -41
- package/RareStepHeader.js +139 -190
- package/ReactSelectWrapper.js +0 -1
- package/SecondaryButton.js +26 -58
- package/ShoeSizeRangeSelector.js +162 -260
- package/ShoeSizeSelector.js +158 -263
- package/SimpleErrorBoundary.js +59 -106
- package/StyleSelector.js +176 -336
- package/TextButton.js +26 -58
- package/Tooltip.js +17 -39
- package/Tracking.js +0 -1
- package/WrapperButton.js +20 -43
- package/build/bundle.css +1 -1
- package/build/bundle.js +1834 -2387
- package/package.json +3 -2
- package/svg/Accessories.js +6 -13
- package/svg/Account.js +6 -13
- package/svg/Add.js +6 -13
- package/svg/ArrowRight.js +6 -13
- package/svg/Bags.js +6 -13
- package/svg/BurgerMenu.js +6 -13
- package/svg/Calendar.js +6 -13
- package/svg/CalendarCircled.js +6 -13
- package/svg/CheckCircled.js +6 -13
- package/svg/Close.js +6 -13
- package/svg/Clothing.js +6 -13
- package/svg/Dot.js +6 -13
- package/svg/Edit.js +6 -13
- package/svg/Eye.js +6 -13
- package/svg/FileAttach.js +6 -13
- package/svg/FileAttachCircled.js +6 -13
- package/svg/LightBulb.js +6 -13
- package/svg/Logo.js +6 -13
- package/svg/LuxityMenu.js +6 -13
- package/svg/Minus.js +6 -13
- package/svg/MobileAvatar.js +6 -13
- package/svg/MyOrder.js +6 -13
- package/svg/MyPayment.js +6 -13
- package/svg/MyProfile.js +8 -14
- package/svg/MySale.js +6 -13
- package/svg/Notification.js +6 -13
- package/svg/PointerDown.js +6 -13
- package/svg/Search.js +6 -13
- package/svg/Shoes.js +6 -13
- package/svg/SvgWrapper.js +3 -7
- package/svg/Trash.js +6 -13
- package/svg/Watches.js +6 -13
package/MaterialSelector.js
CHANGED
|
@@ -18,674 +18,526 @@
|
|
|
18
18
|
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
19
19
|
Cookies = Cookies && Object.prototype.hasOwnProperty.call(Cookies, 'default') ? Cookies['default'] : Cookies;
|
|
20
20
|
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
function _arrayLikeToArray(r, a) {
|
|
22
|
+
(null == a || a > r.length) && (a = r.length);
|
|
23
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
function _arrayWithHoles(r) {
|
|
27
|
+
if (Array.isArray(r)) return r;
|
|
28
|
+
}
|
|
29
|
+
function _arrayWithoutHoles(r) {
|
|
30
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
31
|
+
}
|
|
32
|
+
function _assertThisInitialized(e) {
|
|
33
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
34
|
+
return e;
|
|
35
|
+
}
|
|
36
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
37
|
+
try {
|
|
38
|
+
var i = n[a](c),
|
|
39
|
+
u = i.value;
|
|
40
|
+
} catch (n) {
|
|
41
|
+
return void e(n);
|
|
42
|
+
}
|
|
43
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
44
|
+
}
|
|
45
|
+
function _asyncToGenerator(n) {
|
|
46
|
+
return function () {
|
|
47
|
+
var t = this,
|
|
48
|
+
e = arguments;
|
|
49
|
+
return new Promise(function (r, o) {
|
|
50
|
+
var a = n.apply(t, e);
|
|
51
|
+
function _next(n) {
|
|
52
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
53
|
+
}
|
|
54
|
+
function _throw(n) {
|
|
55
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
56
|
+
}
|
|
57
|
+
_next(void 0);
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function _callSuper(t, o, e) {
|
|
62
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
63
|
+
}
|
|
64
|
+
function _classCallCheck(a, n) {
|
|
65
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
66
|
+
}
|
|
67
|
+
function _defineProperties(e, r) {
|
|
68
|
+
for (var t = 0; t < r.length; t++) {
|
|
69
|
+
var o = r[t];
|
|
70
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function _createClass(e, r, t) {
|
|
74
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
75
|
+
writable: !1
|
|
76
|
+
}), e;
|
|
77
|
+
}
|
|
78
|
+
function _defineProperty(e, r, t) {
|
|
79
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
80
|
+
value: t,
|
|
81
|
+
enumerable: !0,
|
|
82
|
+
configurable: !0,
|
|
83
|
+
writable: !0
|
|
84
|
+
}) : e[r] = t, e;
|
|
85
|
+
}
|
|
86
|
+
function _extends() {
|
|
87
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
88
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
89
|
+
var t = arguments[e];
|
|
90
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
91
|
+
}
|
|
92
|
+
return n;
|
|
93
|
+
}, _extends.apply(null, arguments);
|
|
94
|
+
}
|
|
95
|
+
function _getPrototypeOf(t) {
|
|
96
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
97
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
98
|
+
}, _getPrototypeOf(t);
|
|
99
|
+
}
|
|
100
|
+
function _inherits(t, e) {
|
|
101
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
102
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
103
|
+
constructor: {
|
|
104
|
+
value: t,
|
|
105
|
+
writable: !0,
|
|
106
|
+
configurable: !0
|
|
107
|
+
}
|
|
108
|
+
}), Object.defineProperty(t, "prototype", {
|
|
109
|
+
writable: !1
|
|
110
|
+
}), e && _setPrototypeOf(t, e);
|
|
111
|
+
}
|
|
112
|
+
function _isNativeReflectConstruct() {
|
|
113
|
+
try {
|
|
114
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
115
|
+
} catch (t) {}
|
|
116
|
+
return (_isNativeReflectConstruct = function () {
|
|
117
|
+
return !!t;
|
|
118
|
+
})();
|
|
119
|
+
}
|
|
120
|
+
function _iterableToArray(r) {
|
|
121
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
122
|
+
}
|
|
123
|
+
function _iterableToArrayLimit(r, l) {
|
|
124
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
125
|
+
if (null != t) {
|
|
126
|
+
var e,
|
|
127
|
+
n,
|
|
128
|
+
i,
|
|
129
|
+
u,
|
|
130
|
+
a = [],
|
|
131
|
+
f = !0,
|
|
132
|
+
o = !1;
|
|
133
|
+
try {
|
|
134
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
135
|
+
if (Object(t) !== t) return;
|
|
136
|
+
f = !1;
|
|
137
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
138
|
+
} catch (r) {
|
|
139
|
+
o = !0, n = r;
|
|
140
|
+
} finally {
|
|
141
|
+
try {
|
|
142
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
143
|
+
} finally {
|
|
144
|
+
if (o) throw n;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return a;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function _nonIterableRest() {
|
|
151
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
152
|
+
}
|
|
153
|
+
function _nonIterableSpread() {
|
|
154
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
155
|
+
}
|
|
156
|
+
function ownKeys(e, r) {
|
|
157
|
+
var t = Object.keys(e);
|
|
24
158
|
if (Object.getOwnPropertySymbols) {
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
return Object.getOwnPropertyDescriptor(
|
|
28
|
-
})),
|
|
159
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
160
|
+
r && (o = o.filter(function (r) {
|
|
161
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
162
|
+
})), t.push.apply(t, o);
|
|
29
163
|
}
|
|
30
|
-
|
|
31
|
-
return keys;
|
|
164
|
+
return t;
|
|
32
165
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
166
|
+
function _objectSpread2(e) {
|
|
167
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
168
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
169
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
170
|
+
_defineProperty(e, r, t[r]);
|
|
171
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
172
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
41
173
|
});
|
|
42
174
|
}
|
|
43
|
-
|
|
44
|
-
|
|
175
|
+
return e;
|
|
176
|
+
}
|
|
177
|
+
function _objectWithoutProperties(e, t) {
|
|
178
|
+
if (null == e) return {};
|
|
179
|
+
var o,
|
|
180
|
+
r,
|
|
181
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
182
|
+
if (Object.getOwnPropertySymbols) {
|
|
183
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
184
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
185
|
+
}
|
|
186
|
+
return i;
|
|
187
|
+
}
|
|
188
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
189
|
+
if (null == r) return {};
|
|
190
|
+
var t = {};
|
|
191
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
192
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
193
|
+
t[n] = r[n];
|
|
194
|
+
}
|
|
195
|
+
return t;
|
|
196
|
+
}
|
|
197
|
+
function _possibleConstructorReturn(t, e) {
|
|
198
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
199
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
200
|
+
return _assertThisInitialized(t);
|
|
45
201
|
}
|
|
46
|
-
|
|
47
202
|
function _regeneratorRuntime() {
|
|
48
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
49
|
-
|
|
50
203
|
_regeneratorRuntime = function () {
|
|
51
|
-
return
|
|
204
|
+
return e;
|
|
52
205
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
206
|
+
var t,
|
|
207
|
+
e = {},
|
|
208
|
+
r = Object.prototype,
|
|
209
|
+
n = r.hasOwnProperty,
|
|
210
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
211
|
+
t[e] = r.value;
|
|
212
|
+
},
|
|
213
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
214
|
+
a = i.iterator || "@@iterator",
|
|
215
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
216
|
+
u = i.toStringTag || "@@toStringTag";
|
|
217
|
+
function define(t, e, r) {
|
|
218
|
+
return Object.defineProperty(t, e, {
|
|
219
|
+
value: r,
|
|
65
220
|
enumerable: !0,
|
|
66
221
|
configurable: !0,
|
|
67
222
|
writable: !0
|
|
68
|
-
}),
|
|
223
|
+
}), t[e];
|
|
69
224
|
}
|
|
70
|
-
|
|
71
225
|
try {
|
|
72
226
|
define({}, "");
|
|
73
|
-
} catch (
|
|
74
|
-
define = function (
|
|
75
|
-
return
|
|
227
|
+
} catch (t) {
|
|
228
|
+
define = function (t, e, r) {
|
|
229
|
+
return t[e] = r;
|
|
76
230
|
};
|
|
77
231
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return function (method, arg) {
|
|
86
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
87
|
-
|
|
88
|
-
if ("completed" === state) {
|
|
89
|
-
if ("throw" === method) throw arg;
|
|
90
|
-
return doneResult();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
for (context.method = method, context.arg = arg;;) {
|
|
94
|
-
var delegate = context.delegate;
|
|
95
|
-
|
|
96
|
-
if (delegate) {
|
|
97
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
98
|
-
|
|
99
|
-
if (delegateResult) {
|
|
100
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
101
|
-
return delegateResult;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
106
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
107
|
-
context.dispatchException(context.arg);
|
|
108
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
109
|
-
state = "executing";
|
|
110
|
-
var record = tryCatch(innerFn, self, context);
|
|
111
|
-
|
|
112
|
-
if ("normal" === record.type) {
|
|
113
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
114
|
-
return {
|
|
115
|
-
value: record.arg,
|
|
116
|
-
done: context.done
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}(innerFn, self, context), generator;
|
|
232
|
+
function wrap(t, e, r, n) {
|
|
233
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
234
|
+
a = Object.create(i.prototype),
|
|
235
|
+
c = new Context(n || []);
|
|
236
|
+
return o(a, "_invoke", {
|
|
237
|
+
value: makeInvokeMethod(t, r, c)
|
|
238
|
+
}), a;
|
|
124
239
|
}
|
|
125
|
-
|
|
126
|
-
function tryCatch(fn, obj, arg) {
|
|
240
|
+
function tryCatch(t, e, r) {
|
|
127
241
|
try {
|
|
128
242
|
return {
|
|
129
243
|
type: "normal",
|
|
130
|
-
arg:
|
|
244
|
+
arg: t.call(e, r)
|
|
131
245
|
};
|
|
132
|
-
} catch (
|
|
246
|
+
} catch (t) {
|
|
133
247
|
return {
|
|
134
248
|
type: "throw",
|
|
135
|
-
arg:
|
|
249
|
+
arg: t
|
|
136
250
|
};
|
|
137
251
|
}
|
|
138
252
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
253
|
+
e.wrap = wrap;
|
|
254
|
+
var h = "suspendedStart",
|
|
255
|
+
l = "suspendedYield",
|
|
256
|
+
f = "executing",
|
|
257
|
+
s = "completed",
|
|
258
|
+
y = {};
|
|
143
259
|
function Generator() {}
|
|
144
|
-
|
|
145
260
|
function GeneratorFunction() {}
|
|
146
|
-
|
|
147
261
|
function GeneratorFunctionPrototype() {}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
262
|
+
var p = {};
|
|
263
|
+
define(p, a, function () {
|
|
151
264
|
return this;
|
|
152
265
|
});
|
|
153
|
-
var
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return this._invoke(method, arg);
|
|
266
|
+
var d = Object.getPrototypeOf,
|
|
267
|
+
v = d && d(d(values([])));
|
|
268
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
269
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
270
|
+
function defineIteratorMethods(t) {
|
|
271
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
272
|
+
define(t, e, function (t) {
|
|
273
|
+
return this._invoke(e, t);
|
|
162
274
|
});
|
|
163
275
|
});
|
|
164
276
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
invoke("
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
}, function (error) {
|
|
180
|
-
return invoke("throw", error, resolve, reject);
|
|
277
|
+
function AsyncIterator(t, e) {
|
|
278
|
+
function invoke(r, o, i, a) {
|
|
279
|
+
var c = tryCatch(t[r], t, o);
|
|
280
|
+
if ("throw" !== c.type) {
|
|
281
|
+
var u = c.arg,
|
|
282
|
+
h = u.value;
|
|
283
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
284
|
+
invoke("next", t, i, a);
|
|
285
|
+
}, function (t) {
|
|
286
|
+
invoke("throw", t, i, a);
|
|
287
|
+
}) : e.resolve(h).then(function (t) {
|
|
288
|
+
u.value = t, i(u);
|
|
289
|
+
}, function (t) {
|
|
290
|
+
return invoke("throw", t, i, a);
|
|
181
291
|
});
|
|
182
292
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
293
|
+
a(c.arg);
|
|
294
|
+
}
|
|
295
|
+
var r;
|
|
296
|
+
o(this, "_invoke", {
|
|
297
|
+
value: function (t, n) {
|
|
298
|
+
function callInvokeWithMethodAndArg() {
|
|
299
|
+
return new e(function (e, r) {
|
|
300
|
+
invoke(t, n, e, r);
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
194
304
|
}
|
|
195
|
-
|
|
196
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
197
|
-
};
|
|
305
|
+
});
|
|
198
306
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
307
|
+
function makeInvokeMethod(e, r, n) {
|
|
308
|
+
var o = h;
|
|
309
|
+
return function (i, a) {
|
|
310
|
+
if (o === f) throw Error("Generator is already running");
|
|
311
|
+
if (o === s) {
|
|
312
|
+
if ("throw" === i) throw a;
|
|
313
|
+
return {
|
|
314
|
+
value: t,
|
|
315
|
+
done: !0
|
|
316
|
+
};
|
|
207
317
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
318
|
+
for (n.method = i, n.arg = a;;) {
|
|
319
|
+
var c = n.delegate;
|
|
320
|
+
if (c) {
|
|
321
|
+
var u = maybeInvokeDelegate(c, n);
|
|
322
|
+
if (u) {
|
|
323
|
+
if (u === y) continue;
|
|
324
|
+
return u;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
328
|
+
if (o === h) throw o = s, n.arg;
|
|
329
|
+
n.dispatchException(n.arg);
|
|
330
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
331
|
+
o = f;
|
|
332
|
+
var p = tryCatch(e, r, n);
|
|
333
|
+
if ("normal" === p.type) {
|
|
334
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
335
|
+
return {
|
|
336
|
+
value: p.arg,
|
|
337
|
+
done: n.done
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
216
343
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
344
|
+
function maybeInvokeDelegate(e, r) {
|
|
345
|
+
var n = r.method,
|
|
346
|
+
o = e.iterator[n];
|
|
347
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
348
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
349
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
350
|
+
var a = i.arg;
|
|
351
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
352
|
+
}
|
|
353
|
+
function pushTryEntry(t) {
|
|
354
|
+
var e = {
|
|
355
|
+
tryLoc: t[0]
|
|
221
356
|
};
|
|
222
|
-
1 in
|
|
357
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
223
358
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
359
|
+
function resetTryEntry(t) {
|
|
360
|
+
var e = t.completion || {};
|
|
361
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
228
362
|
}
|
|
229
|
-
|
|
230
|
-
function Context(tryLocsList) {
|
|
363
|
+
function Context(t) {
|
|
231
364
|
this.tryEntries = [{
|
|
232
365
|
tryLoc: "root"
|
|
233
|
-
}],
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
if (
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
next =
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
return next.value = undefined, next.done = !0, next;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
return next.next = next;
|
|
366
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
367
|
+
}
|
|
368
|
+
function values(e) {
|
|
369
|
+
if (e || "" === e) {
|
|
370
|
+
var r = e[a];
|
|
371
|
+
if (r) return r.call(e);
|
|
372
|
+
if ("function" == typeof e.next) return e;
|
|
373
|
+
if (!isNaN(e.length)) {
|
|
374
|
+
var o = -1,
|
|
375
|
+
i = function next() {
|
|
376
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
377
|
+
return next.value = t, next.done = !0, next;
|
|
378
|
+
};
|
|
379
|
+
return i.next = i;
|
|
251
380
|
}
|
|
252
381
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
268
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
269
|
-
}, exports.mark = function (genFun) {
|
|
270
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
271
|
-
}, exports.awrap = function (arg) {
|
|
382
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
383
|
+
}
|
|
384
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
385
|
+
value: GeneratorFunctionPrototype,
|
|
386
|
+
configurable: !0
|
|
387
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
388
|
+
value: GeneratorFunction,
|
|
389
|
+
configurable: !0
|
|
390
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
391
|
+
var e = "function" == typeof t && t.constructor;
|
|
392
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
393
|
+
}, e.mark = function (t) {
|
|
394
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
395
|
+
}, e.awrap = function (t) {
|
|
272
396
|
return {
|
|
273
|
-
__await:
|
|
397
|
+
__await: t
|
|
274
398
|
};
|
|
275
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
399
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
276
400
|
return this;
|
|
277
|
-
}),
|
|
278
|
-
void 0 ===
|
|
279
|
-
var
|
|
280
|
-
return
|
|
281
|
-
return
|
|
401
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
402
|
+
void 0 === i && (i = Promise);
|
|
403
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
404
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
405
|
+
return t.done ? t.value : a.next();
|
|
282
406
|
});
|
|
283
|
-
}, defineIteratorMethods(
|
|
407
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
284
408
|
return this;
|
|
285
|
-
}), define(
|
|
409
|
+
}), define(g, "toString", function () {
|
|
286
410
|
return "[object Generator]";
|
|
287
|
-
}),
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
for (var
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
411
|
+
}), e.keys = function (t) {
|
|
412
|
+
var e = Object(t),
|
|
413
|
+
r = [];
|
|
414
|
+
for (var n in e) r.push(n);
|
|
415
|
+
return r.reverse(), function next() {
|
|
416
|
+
for (; r.length;) {
|
|
417
|
+
var t = r.pop();
|
|
418
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
296
419
|
}
|
|
297
|
-
|
|
298
420
|
return next.done = !0, next;
|
|
299
421
|
};
|
|
300
|
-
},
|
|
422
|
+
}, e.values = values, Context.prototype = {
|
|
301
423
|
constructor: Context,
|
|
302
|
-
reset: function (
|
|
303
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
424
|
+
reset: function (e) {
|
|
425
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
304
426
|
},
|
|
305
427
|
stop: function () {
|
|
306
428
|
this.done = !0;
|
|
307
|
-
var
|
|
308
|
-
if ("throw" ===
|
|
429
|
+
var t = this.tryEntries[0].completion;
|
|
430
|
+
if ("throw" === t.type) throw t.arg;
|
|
309
431
|
return this.rval;
|
|
310
432
|
},
|
|
311
|
-
dispatchException: function (
|
|
312
|
-
if (this.done) throw
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
433
|
+
dispatchException: function (e) {
|
|
434
|
+
if (this.done) throw e;
|
|
435
|
+
var r = this;
|
|
436
|
+
function handle(n, o) {
|
|
437
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
317
438
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
if (
|
|
329
|
-
if (this.prev <
|
|
330
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
331
|
-
} else if (hasCatch) {
|
|
332
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
439
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
440
|
+
var i = this.tryEntries[o],
|
|
441
|
+
a = i.completion;
|
|
442
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
443
|
+
if (i.tryLoc <= this.prev) {
|
|
444
|
+
var c = n.call(i, "catchLoc"),
|
|
445
|
+
u = n.call(i, "finallyLoc");
|
|
446
|
+
if (c && u) {
|
|
447
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
448
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
449
|
+
} else if (c) {
|
|
450
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
333
451
|
} else {
|
|
334
|
-
if (!
|
|
335
|
-
if (this.prev <
|
|
452
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
453
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
336
454
|
}
|
|
337
455
|
}
|
|
338
456
|
}
|
|
339
457
|
},
|
|
340
|
-
abrupt: function (
|
|
341
|
-
for (var
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
var finallyEntry = entry;
|
|
458
|
+
abrupt: function (t, e) {
|
|
459
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
460
|
+
var o = this.tryEntries[r];
|
|
461
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
462
|
+
var i = o;
|
|
346
463
|
break;
|
|
347
464
|
}
|
|
348
465
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
466
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
467
|
+
var a = i ? i.completion : {};
|
|
468
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
353
469
|
},
|
|
354
|
-
complete: function (
|
|
355
|
-
if ("throw" ===
|
|
356
|
-
return "break" ===
|
|
470
|
+
complete: function (t, e) {
|
|
471
|
+
if ("throw" === t.type) throw t.arg;
|
|
472
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
357
473
|
},
|
|
358
|
-
finish: function (
|
|
359
|
-
for (var
|
|
360
|
-
var
|
|
361
|
-
if (
|
|
474
|
+
finish: function (t) {
|
|
475
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
476
|
+
var r = this.tryEntries[e];
|
|
477
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
362
478
|
}
|
|
363
479
|
},
|
|
364
|
-
catch: function (
|
|
365
|
-
for (var
|
|
366
|
-
var
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
var thrown = record.arg;
|
|
373
|
-
resetTryEntry(entry);
|
|
480
|
+
catch: function (t) {
|
|
481
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
482
|
+
var r = this.tryEntries[e];
|
|
483
|
+
if (r.tryLoc === t) {
|
|
484
|
+
var n = r.completion;
|
|
485
|
+
if ("throw" === n.type) {
|
|
486
|
+
var o = n.arg;
|
|
487
|
+
resetTryEntry(r);
|
|
374
488
|
}
|
|
375
|
-
|
|
376
|
-
return thrown;
|
|
489
|
+
return o;
|
|
377
490
|
}
|
|
378
491
|
}
|
|
379
|
-
|
|
380
|
-
throw new Error("illegal catch attempt");
|
|
492
|
+
throw Error("illegal catch attempt");
|
|
381
493
|
},
|
|
382
|
-
delegateYield: function (
|
|
494
|
+
delegateYield: function (e, r, n) {
|
|
383
495
|
return this.delegate = {
|
|
384
|
-
iterator: values(
|
|
385
|
-
resultName:
|
|
386
|
-
nextLoc:
|
|
387
|
-
}, "next" === this.method && (this.arg =
|
|
388
|
-
}
|
|
389
|
-
}, exports;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
393
|
-
try {
|
|
394
|
-
var info = gen[key](arg);
|
|
395
|
-
var value = info.value;
|
|
396
|
-
} catch (error) {
|
|
397
|
-
reject(error);
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
if (info.done) {
|
|
402
|
-
resolve(value);
|
|
403
|
-
} else {
|
|
404
|
-
Promise.resolve(value).then(_next, _throw);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
function _asyncToGenerator(fn) {
|
|
409
|
-
return function () {
|
|
410
|
-
var self = this,
|
|
411
|
-
args = arguments;
|
|
412
|
-
return new Promise(function (resolve, reject) {
|
|
413
|
-
var gen = fn.apply(self, args);
|
|
414
|
-
|
|
415
|
-
function _next(value) {
|
|
416
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
function _throw(err) {
|
|
420
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
_next(undefined);
|
|
424
|
-
});
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
function _classCallCheck(instance, Constructor) {
|
|
429
|
-
if (!(instance instanceof Constructor)) {
|
|
430
|
-
throw new TypeError("Cannot call a class as a function");
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
function _defineProperties(target, props) {
|
|
435
|
-
for (var i = 0; i < props.length; i++) {
|
|
436
|
-
var descriptor = props[i];
|
|
437
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
438
|
-
descriptor.configurable = true;
|
|
439
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
440
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
445
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
446
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
447
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
448
|
-
writable: false
|
|
449
|
-
});
|
|
450
|
-
return Constructor;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
function _defineProperty(obj, key, value) {
|
|
454
|
-
if (key in obj) {
|
|
455
|
-
Object.defineProperty(obj, key, {
|
|
456
|
-
value: value,
|
|
457
|
-
enumerable: true,
|
|
458
|
-
configurable: true,
|
|
459
|
-
writable: true
|
|
460
|
-
});
|
|
461
|
-
} else {
|
|
462
|
-
obj[key] = value;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
return obj;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
function _extends() {
|
|
469
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
470
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
471
|
-
var source = arguments[i];
|
|
472
|
-
|
|
473
|
-
for (var key in source) {
|
|
474
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
475
|
-
target[key] = source[key];
|
|
476
|
-
}
|
|
477
|
-
}
|
|
496
|
+
iterator: values(e),
|
|
497
|
+
resultName: r,
|
|
498
|
+
nextLoc: n
|
|
499
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
478
500
|
}
|
|
479
|
-
|
|
480
|
-
return target;
|
|
481
|
-
};
|
|
482
|
-
return _extends.apply(this, arguments);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
function _inherits(subClass, superClass) {
|
|
486
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
487
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
491
|
-
constructor: {
|
|
492
|
-
value: subClass,
|
|
493
|
-
writable: true,
|
|
494
|
-
configurable: true
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
Object.defineProperty(subClass, "prototype", {
|
|
498
|
-
writable: false
|
|
499
|
-
});
|
|
500
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
function _getPrototypeOf(o) {
|
|
504
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
505
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
506
|
-
};
|
|
507
|
-
return _getPrototypeOf(o);
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
function _setPrototypeOf(o, p) {
|
|
511
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
512
|
-
o.__proto__ = p;
|
|
513
|
-
return o;
|
|
514
|
-
};
|
|
515
|
-
return _setPrototypeOf(o, p);
|
|
501
|
+
}, e;
|
|
516
502
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
if (typeof Proxy === "function") return true;
|
|
522
|
-
|
|
523
|
-
try {
|
|
524
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
525
|
-
return true;
|
|
526
|
-
} catch (e) {
|
|
527
|
-
return false;
|
|
528
|
-
}
|
|
503
|
+
function _setPrototypeOf(t, e) {
|
|
504
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
505
|
+
return t.__proto__ = e, t;
|
|
506
|
+
}, _setPrototypeOf(t, e);
|
|
529
507
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
if (source == null) return {};
|
|
533
|
-
var target = {};
|
|
534
|
-
var sourceKeys = Object.keys(source);
|
|
535
|
-
var key, i;
|
|
536
|
-
|
|
537
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
538
|
-
key = sourceKeys[i];
|
|
539
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
540
|
-
target[key] = source[key];
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
return target;
|
|
508
|
+
function _slicedToArray(r, e) {
|
|
509
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
544
510
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
if (source == null) return {};
|
|
548
|
-
|
|
549
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
550
|
-
|
|
551
|
-
var key, i;
|
|
552
|
-
|
|
553
|
-
if (Object.getOwnPropertySymbols) {
|
|
554
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
555
|
-
|
|
556
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
557
|
-
key = sourceSymbolKeys[i];
|
|
558
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
559
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
560
|
-
target[key] = source[key];
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
return target;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
function _assertThisInitialized(self) {
|
|
568
|
-
if (self === void 0) {
|
|
569
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
return self;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
function _possibleConstructorReturn(self, call) {
|
|
576
|
-
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
577
|
-
return call;
|
|
578
|
-
} else if (call !== void 0) {
|
|
579
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
return _assertThisInitialized(self);
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
function _createSuper(Derived) {
|
|
586
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
587
|
-
|
|
588
|
-
return function _createSuperInternal() {
|
|
589
|
-
var Super = _getPrototypeOf(Derived),
|
|
590
|
-
result;
|
|
591
|
-
|
|
592
|
-
if (hasNativeReflectConstruct) {
|
|
593
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
594
|
-
|
|
595
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
596
|
-
} else {
|
|
597
|
-
result = Super.apply(this, arguments);
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
return _possibleConstructorReturn(this, result);
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
function _taggedTemplateLiteral(strings, raw) {
|
|
605
|
-
if (!raw) {
|
|
606
|
-
raw = strings.slice(0);
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
511
|
+
function _taggedTemplateLiteral(e, t) {
|
|
512
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
610
513
|
raw: {
|
|
611
|
-
value: Object.freeze(
|
|
514
|
+
value: Object.freeze(t)
|
|
612
515
|
}
|
|
613
516
|
}));
|
|
614
517
|
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
518
|
+
function _toConsumableArray(r) {
|
|
519
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
618
520
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
521
|
+
function _toPrimitive(t, r) {
|
|
522
|
+
if ("object" != typeof t || !t) return t;
|
|
523
|
+
var e = t[Symbol.toPrimitive];
|
|
524
|
+
if (void 0 !== e) {
|
|
525
|
+
var i = e.call(t, r || "default");
|
|
526
|
+
if ("object" != typeof i) return i;
|
|
527
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
528
|
+
}
|
|
529
|
+
return ("string" === r ? String : Number)(t);
|
|
626
530
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
function _iterableToArray(iter) {
|
|
633
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
531
|
+
function _toPropertyKey(t) {
|
|
532
|
+
var i = _toPrimitive(t, "string");
|
|
533
|
+
return "symbol" == typeof i ? i : i + "";
|
|
634
534
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
var _arr = [];
|
|
641
|
-
var _n = true;
|
|
642
|
-
var _d = false;
|
|
643
|
-
|
|
644
|
-
var _s, _e;
|
|
645
|
-
|
|
646
|
-
try {
|
|
647
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
648
|
-
_arr.push(_s.value);
|
|
649
|
-
|
|
650
|
-
if (i && _arr.length === i) break;
|
|
651
|
-
}
|
|
652
|
-
} catch (err) {
|
|
653
|
-
_d = true;
|
|
654
|
-
_e = err;
|
|
655
|
-
} finally {
|
|
656
|
-
try {
|
|
657
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
658
|
-
} finally {
|
|
659
|
-
if (_d) throw _e;
|
|
660
|
-
}
|
|
535
|
+
function _unsupportedIterableToArray(r, a) {
|
|
536
|
+
if (r) {
|
|
537
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
538
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
539
|
+
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;
|
|
661
540
|
}
|
|
662
|
-
|
|
663
|
-
return _arr;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
667
|
-
if (!o) return;
|
|
668
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
669
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
670
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
671
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
672
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
function _arrayLikeToArray(arr, len) {
|
|
676
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
677
|
-
|
|
678
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
679
|
-
|
|
680
|
-
return arr2;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
function _nonIterableSpread() {
|
|
684
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
function _nonIterableRest() {
|
|
688
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
689
541
|
}
|
|
690
542
|
|
|
691
543
|
var interpretErrorMessage = function interpretErrorMessage(error) {
|
|
@@ -697,50 +549,39 @@
|
|
|
697
549
|
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
698
550
|
data: null
|
|
699
551
|
});
|
|
552
|
+
|
|
700
553
|
/**
|
|
701
554
|
* A flavour of PageReady with Luxity customisations
|
|
702
555
|
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
703
556
|
* 2. an error message interpreter is supplied from the local helper library
|
|
704
557
|
*/
|
|
705
|
-
|
|
706
558
|
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
707
|
-
_inherits(LuxityPageReady, _React$Component);
|
|
708
|
-
|
|
709
|
-
var _super = _createSuper(LuxityPageReady);
|
|
710
|
-
|
|
711
559
|
function LuxityPageReady() {
|
|
712
560
|
var _this;
|
|
713
|
-
|
|
714
561
|
_classCallCheck(this, LuxityPageReady);
|
|
715
|
-
|
|
716
562
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
717
563
|
args[_key] = arguments[_key];
|
|
718
564
|
}
|
|
719
|
-
|
|
720
|
-
_this
|
|
721
|
-
|
|
722
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
565
|
+
_this = _callSuper(this, LuxityPageReady, [].concat(args));
|
|
566
|
+
_defineProperty(_this, "state", {
|
|
723
567
|
data: null
|
|
724
568
|
});
|
|
725
|
-
|
|
726
|
-
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
569
|
+
_defineProperty(_this, "refreshPage", function () {
|
|
727
570
|
return _this.pageReadyInstance.initRequest();
|
|
728
571
|
});
|
|
729
|
-
|
|
730
572
|
return _this;
|
|
731
573
|
}
|
|
732
|
-
|
|
733
|
-
_createClass(LuxityPageReady, [{
|
|
574
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
575
|
+
return _createClass(LuxityPageReady, [{
|
|
734
576
|
key: "render",
|
|
735
577
|
value: function render() {
|
|
736
578
|
var _this2 = this;
|
|
737
|
-
|
|
738
579
|
var _this$props = this.props,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
580
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
581
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
582
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
583
|
+
_onData = _this$props.onData,
|
|
584
|
+
children = _this$props.children;
|
|
744
585
|
var data = this.state.data;
|
|
745
586
|
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
746
587
|
ref: function ref(inst) {
|
|
@@ -750,19 +591,15 @@
|
|
|
750
591
|
_this2.setState({
|
|
751
592
|
data: res.data
|
|
752
593
|
});
|
|
753
|
-
|
|
754
594
|
_onData(res);
|
|
755
595
|
},
|
|
756
596
|
getRequestInstance: function getRequestInstance() {
|
|
757
597
|
_this2.props.onIsLoading(true);
|
|
758
|
-
|
|
759
598
|
return getRequestPromise().then(function (out) {
|
|
760
599
|
_this2.props.onIsLoading(false);
|
|
761
|
-
|
|
762
600
|
return out;
|
|
763
601
|
}).catch(function (oops) {
|
|
764
602
|
_this2.props.onIsLoading(false);
|
|
765
|
-
|
|
766
603
|
return oops;
|
|
767
604
|
});
|
|
768
605
|
},
|
|
@@ -779,10 +616,7 @@
|
|
|
779
616
|
}, children));
|
|
780
617
|
}
|
|
781
618
|
}]);
|
|
782
|
-
|
|
783
|
-
return LuxityPageReady;
|
|
784
619
|
}(React__default.Component);
|
|
785
|
-
|
|
786
620
|
LuxityPageReady.defaultProps = {
|
|
787
621
|
onIsLoading: function onIsLoading() {
|
|
788
622
|
return null;
|
|
@@ -898,7 +732,6 @@
|
|
|
898
732
|
var inputMarginRight = '0.2em';
|
|
899
733
|
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) {
|
|
900
734
|
var _props$theme;
|
|
901
|
-
|
|
902
735
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
|
|
903
736
|
}, function (props) {
|
|
904
737
|
return props.theme.fontSizes[4];
|
|
@@ -917,8 +750,7 @@
|
|
|
917
750
|
}
|
|
918
751
|
});
|
|
919
752
|
|
|
920
|
-
|
|
921
|
-
|
|
753
|
+
// Register a locale for South African currency confiuguration
|
|
922
754
|
numeral.register('locale', 'en-ZA', {
|
|
923
755
|
delimiters: {
|
|
924
756
|
thousands: ',',
|
|
@@ -939,12 +771,12 @@
|
|
|
939
771
|
});
|
|
940
772
|
numeral.locale('en-ZA');
|
|
941
773
|
String.locale = numeral.locale;
|
|
774
|
+
|
|
942
775
|
/**
|
|
943
776
|
* Curreny Formatter
|
|
944
777
|
* @param {number} number - the number to be formatted
|
|
945
778
|
* @param {boolean} round - flag to indicate if the number needs to be rounded off
|
|
946
779
|
*/
|
|
947
|
-
|
|
948
780
|
function fC(number) {
|
|
949
781
|
var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
950
782
|
var parsedNumber = parseFloat(number);
|
|
@@ -952,6 +784,7 @@
|
|
|
952
784
|
}
|
|
953
785
|
|
|
954
786
|
/** @format */
|
|
787
|
+
|
|
955
788
|
var request = {
|
|
956
789
|
fetching: false,
|
|
957
790
|
failed: false,
|
|
@@ -1058,48 +891,35 @@
|
|
|
1058
891
|
|
|
1059
892
|
var _templateObject$9, _templateObject2, _templateObject3, _templateObject4;
|
|
1060
893
|
var MALE = genders.MALE,
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
894
|
+
FEMALE = genders.FEMALE,
|
|
895
|
+
UNISEX = genders.UNISEX;
|
|
1064
896
|
var TrashIcon = function TrashIcon(_ref) {
|
|
1065
897
|
var onClick = _ref.onClick,
|
|
1066
|
-
|
|
898
|
+
id = _ref.id;
|
|
1067
899
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
1068
900
|
onClick: onClick,
|
|
1069
901
|
id: id
|
|
1070
902
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
1071
903
|
};
|
|
1072
|
-
|
|
1073
904
|
var InterestItem = /*#__PURE__*/function (_React$Component) {
|
|
1074
|
-
_inherits(InterestItem, _React$Component);
|
|
1075
|
-
|
|
1076
|
-
var _super = _createSuper(InterestItem);
|
|
1077
|
-
|
|
1078
905
|
function InterestItem(props) {
|
|
1079
906
|
var _this;
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
_this = _super.call(this, props);
|
|
1084
|
-
|
|
1085
|
-
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
907
|
+
_classCallCheck(this, InterestItem);
|
|
908
|
+
_this = _callSuper(this, InterestItem, [props]);
|
|
909
|
+
_defineProperty(_this, "deleteInterestItem", function () {
|
|
1086
910
|
var id = _this.props.data.id;
|
|
1087
|
-
|
|
1088
911
|
_this.setState({
|
|
1089
912
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
1090
913
|
fetching: true
|
|
1091
914
|
})
|
|
1092
915
|
});
|
|
1093
|
-
|
|
1094
916
|
var url = _this.props.deleteInterestApi(id);
|
|
1095
|
-
|
|
1096
917
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
1097
918
|
_this.setState({
|
|
1098
919
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
1099
920
|
success: true
|
|
1100
921
|
})
|
|
1101
922
|
});
|
|
1102
|
-
|
|
1103
923
|
_this.props.onDeleted(_this.props.data);
|
|
1104
924
|
}, function () {
|
|
1105
925
|
return _this.setState({
|
|
@@ -1107,32 +927,25 @@
|
|
|
1107
927
|
});
|
|
1108
928
|
});
|
|
1109
929
|
});
|
|
1110
|
-
|
|
1111
|
-
_defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
|
|
930
|
+
_defineProperty(_this, "getGender", function (gender) {
|
|
1112
931
|
switch (gender) {
|
|
1113
932
|
case MALE:
|
|
1114
933
|
return 'Male';
|
|
1115
|
-
|
|
1116
934
|
case FEMALE:
|
|
1117
935
|
return 'Female';
|
|
1118
|
-
|
|
1119
936
|
case UNISEX:
|
|
1120
937
|
default:
|
|
1121
938
|
return 'Unisex';
|
|
1122
939
|
}
|
|
1123
940
|
});
|
|
1124
|
-
|
|
1125
|
-
_defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
|
|
941
|
+
_defineProperty(_this, "getCategory", function (category) {
|
|
1126
942
|
if (category === interestCategories.APPAREL) {
|
|
1127
943
|
return 'CLOTHING';
|
|
1128
944
|
}
|
|
1129
|
-
|
|
1130
945
|
return category;
|
|
1131
946
|
});
|
|
1132
|
-
|
|
1133
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
947
|
+
_defineProperty(_this, "render", function () {
|
|
1134
948
|
var _data$min_shoe_size, _data$max_shoe_size;
|
|
1135
|
-
|
|
1136
949
|
var data = _this.props.data;
|
|
1137
950
|
var success = _this.state.delete.success;
|
|
1138
951
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
|
|
@@ -1182,16 +995,14 @@
|
|
|
1182
995
|
}
|
|
1183
996
|
}));
|
|
1184
997
|
});
|
|
1185
|
-
|
|
1186
998
|
_this.state = {
|
|
1187
999
|
delete: _objectSpread2({}, request)
|
|
1188
1000
|
};
|
|
1189
1001
|
return _this;
|
|
1190
1002
|
}
|
|
1191
|
-
|
|
1003
|
+
_inherits(InterestItem, _React$Component);
|
|
1192
1004
|
return _createClass(InterestItem);
|
|
1193
1005
|
}(React__default.Component);
|
|
1194
|
-
|
|
1195
1006
|
var SheoSizeContentDiv = styled__default.div(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
|
|
1196
1007
|
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);
|
|
1197
1008
|
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);
|
|
@@ -1207,11 +1018,11 @@
|
|
|
1207
1018
|
return props.theme.marginPaddings[0];
|
|
1208
1019
|
}, media.xs);
|
|
1209
1020
|
var ThemedInterestItem = themed(InterestItem);
|
|
1021
|
+
|
|
1210
1022
|
/**
|
|
1211
1023
|
* The Interest Item view shows the selected interest configuration,
|
|
1212
1024
|
* and gives user control to delete it.
|
|
1213
1025
|
*/
|
|
1214
|
-
|
|
1215
1026
|
var InterestItem$1 = (function (props) {
|
|
1216
1027
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
|
|
1217
1028
|
});
|
|
@@ -1258,16 +1069,14 @@
|
|
|
1258
1069
|
*/
|
|
1259
1070
|
var RadioButtons = function RadioButtons(_ref) {
|
|
1260
1071
|
var options = _ref.options,
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1072
|
+
name = _ref.name,
|
|
1073
|
+
noWrap = _ref.noWrap,
|
|
1074
|
+
title = _ref.title,
|
|
1075
|
+
errors = _ref.errors;
|
|
1266
1076
|
var _useState = React.useState(errors[name]),
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1077
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1078
|
+
errMsg = _useState2[0],
|
|
1079
|
+
setErrMsg = _useState2[1];
|
|
1271
1080
|
React.useEffect(function () {
|
|
1272
1081
|
setErrMsg(errors[name]);
|
|
1273
1082
|
}, [errors, name]);
|
|
@@ -1275,15 +1084,15 @@
|
|
|
1275
1084
|
noWrap: noWrap
|
|
1276
1085
|
}, options.map(function (_ref2, index) {
|
|
1277
1086
|
var _ref2$actionCallback = _ref2.actionCallback,
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1087
|
+
actionCallback = _ref2$actionCallback === void 0 ? function () {
|
|
1088
|
+
return null;
|
|
1089
|
+
} : _ref2$actionCallback,
|
|
1090
|
+
_ref2$value = _ref2.value,
|
|
1091
|
+
value = _ref2$value === void 0 ? '' : _ref2$value,
|
|
1092
|
+
_ref2$innerText = _ref2.innerText,
|
|
1093
|
+
innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
|
|
1094
|
+
_ref2$checked = _ref2.checked,
|
|
1095
|
+
checked = _ref2$checked === void 0 ? false : _ref2$checked;
|
|
1287
1096
|
return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
|
|
1288
1097
|
key: "".concat(name, "-").concat(index),
|
|
1289
1098
|
htmlFor: "".concat(name, "_").concat(index)
|
|
@@ -1300,7 +1109,6 @@
|
|
|
1300
1109
|
}), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
|
|
1301
1110
|
}))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errMsg));
|
|
1302
1111
|
};
|
|
1303
|
-
|
|
1304
1112
|
RadioButtons.defaultProps = {
|
|
1305
1113
|
noWrap: false,
|
|
1306
1114
|
title: '',
|
|
@@ -1309,8 +1117,8 @@
|
|
|
1309
1117
|
var RadioButtons$1 = themed(RadioButtons);
|
|
1310
1118
|
|
|
1311
1119
|
var _templateObject$i, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5;
|
|
1312
|
-
/* position relative is required for the Body element to be positioned correctly */
|
|
1313
1120
|
|
|
1121
|
+
/* position relative is required for the Body element to be positioned correctly */
|
|
1314
1122
|
var relativeInlineStyle = styled.css(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
1315
1123
|
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"])));
|
|
1316
1124
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
@@ -1324,40 +1132,31 @@
|
|
|
1324
1132
|
};
|
|
1325
1133
|
|
|
1326
1134
|
var _templateObject$j;
|
|
1327
|
-
|
|
1328
1135
|
var getBodyStyle = function getBodyStyle() {
|
|
1329
1136
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1330
1137
|
var _props$toolTipPositio = props.toolTipPosition,
|
|
1331
|
-
|
|
1332
|
-
|
|
1138
|
+
toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
|
|
1333
1139
|
switch (toolTipPosition) {
|
|
1334
1140
|
case 'top':
|
|
1335
1141
|
return topMiddleBodyStyle;
|
|
1336
|
-
|
|
1337
1142
|
case 'bottom':
|
|
1338
1143
|
return getBottomMiddleBodyStyle(props);
|
|
1339
|
-
|
|
1340
1144
|
default:
|
|
1341
1145
|
return null;
|
|
1342
1146
|
}
|
|
1343
1147
|
};
|
|
1344
|
-
|
|
1345
1148
|
var getAfterStyling = function getAfterStyling() {
|
|
1346
1149
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1347
1150
|
var toolTipPosition = props.toolTipPosition;
|
|
1348
|
-
|
|
1349
1151
|
switch (toolTipPosition) {
|
|
1350
1152
|
case 'top':
|
|
1351
1153
|
return getTopMiddleArrowAfterStyle(props);
|
|
1352
|
-
|
|
1353
1154
|
case 'bottom':
|
|
1354
1155
|
return getBottomMiddleArrowAfterStyle(props);
|
|
1355
|
-
|
|
1356
1156
|
default:
|
|
1357
1157
|
return '';
|
|
1358
1158
|
}
|
|
1359
1159
|
};
|
|
1360
|
-
|
|
1361
1160
|
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) {
|
|
1362
1161
|
return props.bodyWidth;
|
|
1363
1162
|
}, function (props) {
|
|
@@ -1376,25 +1175,20 @@
|
|
|
1376
1175
|
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"])));
|
|
1377
1176
|
|
|
1378
1177
|
var _excluded = ["children"];
|
|
1379
|
-
|
|
1380
1178
|
var _templateObject$m;
|
|
1381
1179
|
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) {
|
|
1382
1180
|
return props.theme.colors.primary;
|
|
1383
1181
|
}, function (props) {
|
|
1384
1182
|
return props.theme.colors.primary;
|
|
1385
1183
|
}, disabledButtonStyle);
|
|
1386
|
-
|
|
1387
1184
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
1388
1185
|
var children = _ref.children,
|
|
1389
|
-
|
|
1390
|
-
|
|
1186
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
1391
1187
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
1392
1188
|
};
|
|
1393
|
-
|
|
1394
1189
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
1395
1190
|
|
|
1396
1191
|
var _excluded$1 = ["children"];
|
|
1397
|
-
|
|
1398
1192
|
var _templateObject$n;
|
|
1399
1193
|
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) {
|
|
1400
1194
|
return props.theme.colors.ntrlMin;
|
|
@@ -1409,18 +1203,14 @@
|
|
|
1409
1203
|
}, disabledButtonStyle, function (props) {
|
|
1410
1204
|
return props.theme.colors.base;
|
|
1411
1205
|
});
|
|
1412
|
-
|
|
1413
1206
|
var SecondaryButton = function SecondaryButton(_ref) {
|
|
1414
1207
|
var children = _ref.children,
|
|
1415
|
-
|
|
1416
|
-
|
|
1208
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
1417
1209
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
1418
1210
|
};
|
|
1419
|
-
|
|
1420
1211
|
var SecondaryButton$1 = themed(SecondaryButton);
|
|
1421
1212
|
|
|
1422
1213
|
var _excluded$2 = ["children"];
|
|
1423
|
-
|
|
1424
1214
|
var _templateObject$o;
|
|
1425
1215
|
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) {
|
|
1426
1216
|
return props.theme.colors.base;
|
|
@@ -1429,21 +1219,17 @@
|
|
|
1429
1219
|
}, disabledButtonStyle, function (props) {
|
|
1430
1220
|
return props.theme.colors.base;
|
|
1431
1221
|
});
|
|
1432
|
-
|
|
1433
1222
|
var TextButton = function TextButton(_ref) {
|
|
1434
1223
|
var children = _ref.children,
|
|
1435
|
-
|
|
1436
|
-
|
|
1224
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
1437
1225
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
1438
1226
|
};
|
|
1439
|
-
|
|
1440
1227
|
TextButton.defaultProps = {
|
|
1441
1228
|
type: 'button'
|
|
1442
1229
|
};
|
|
1443
1230
|
var TextButton$1 = themed(TextButton);
|
|
1444
1231
|
|
|
1445
1232
|
var _excluded$3 = ["children"];
|
|
1446
|
-
|
|
1447
1233
|
var _templateObject$p;
|
|
1448
1234
|
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) {
|
|
1449
1235
|
return props.theme.colors.ntrlMin;
|
|
@@ -1458,25 +1244,19 @@
|
|
|
1458
1244
|
}, function (props) {
|
|
1459
1245
|
return props.theme.colors.primary;
|
|
1460
1246
|
});
|
|
1461
|
-
|
|
1462
1247
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
1463
1248
|
var children = _ref.children,
|
|
1464
|
-
|
|
1465
|
-
|
|
1249
|
+
restProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
1466
1250
|
return /*#__PURE__*/React__default.createElement(Button$3, restProps, children);
|
|
1467
1251
|
};
|
|
1468
|
-
|
|
1469
1252
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
1470
1253
|
|
|
1471
1254
|
var _excluded$4 = ["children"];
|
|
1472
|
-
|
|
1473
1255
|
var _templateObject$q;
|
|
1474
1256
|
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);
|
|
1475
|
-
|
|
1476
1257
|
var WrapperButton = function WrapperButton(_ref) {
|
|
1477
1258
|
var children = _ref.children,
|
|
1478
|
-
|
|
1479
|
-
|
|
1259
|
+
restProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
1480
1260
|
return /*#__PURE__*/React__default.createElement(Button$4, restProps, children);
|
|
1481
1261
|
};
|
|
1482
1262
|
|
|
@@ -1485,31 +1265,28 @@
|
|
|
1485
1265
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1486
1266
|
return value.replace(/\D/g, '');
|
|
1487
1267
|
};
|
|
1268
|
+
|
|
1488
1269
|
/**
|
|
1489
1270
|
* Currency Input which formats the value to a specific format
|
|
1490
1271
|
*/
|
|
1491
|
-
|
|
1492
1272
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
1493
1273
|
var value = _ref.value,
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1274
|
+
onChange = _ref.onChange,
|
|
1275
|
+
prefix = _ref.prefix,
|
|
1276
|
+
allowNegativeValue = _ref.allowNegativeValue,
|
|
1277
|
+
groupSeparator = _ref.groupSeparator,
|
|
1278
|
+
decimalSeparator = _ref.decimalSeparator,
|
|
1279
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
1501
1280
|
var handleValueChange = function handleValueChange(event) {
|
|
1502
1281
|
var inputValue = event.target.value;
|
|
1503
1282
|
var unmaskedValue = unMask(inputValue);
|
|
1504
1283
|
onChange(unmaskedValue);
|
|
1505
1284
|
};
|
|
1506
|
-
|
|
1507
1285
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
1508
1286
|
var numericValue = Number(originalValue);
|
|
1509
1287
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
1510
1288
|
return prefix + formattedValue;
|
|
1511
1289
|
};
|
|
1512
|
-
|
|
1513
1290
|
var formattedValue = formatCurrency(value);
|
|
1514
1291
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
1515
1292
|
type: "text",
|
|
@@ -1517,7 +1294,6 @@
|
|
|
1517
1294
|
onChange: handleValueChange
|
|
1518
1295
|
}));
|
|
1519
1296
|
};
|
|
1520
|
-
|
|
1521
1297
|
CurrencyInputFormatter.defaultProps = {
|
|
1522
1298
|
value: '',
|
|
1523
1299
|
prefix: 'R',
|
|
@@ -8095,7 +7871,6 @@
|
|
|
8095
7871
|
var ReactSelectWrapper = function ReactSelectWrapper(props) {
|
|
8096
7872
|
return /*#__PURE__*/React__default.createElement(index$1, props);
|
|
8097
7873
|
};
|
|
8098
|
-
|
|
8099
7874
|
ReactSelectWrapper.defaultProps = {
|
|
8100
7875
|
isMulti: false,
|
|
8101
7876
|
isSearchable: false,
|
|
@@ -8123,23 +7898,23 @@
|
|
|
8123
7898
|
return props.hasBorder ? props.theme.colors.borderColor : props.theme.colors.ntrlMin;
|
|
8124
7899
|
}, function (_ref) {
|
|
8125
7900
|
var isChecked = _ref.isChecked,
|
|
8126
|
-
|
|
7901
|
+
theme = _ref.theme;
|
|
8127
7902
|
return isChecked ? theme.colors.primary : theme.colors.gray;
|
|
8128
7903
|
}, function (_ref2) {
|
|
8129
7904
|
var isChecked = _ref2.isChecked,
|
|
8130
|
-
|
|
7905
|
+
theme = _ref2.theme;
|
|
8131
7906
|
return isChecked ? 'white' : theme.colors.base;
|
|
8132
7907
|
}, function (_ref3) {
|
|
8133
7908
|
var isChecked = _ref3.isChecked,
|
|
8134
|
-
|
|
7909
|
+
theme = _ref3.theme;
|
|
8135
7910
|
return isChecked ? theme.colors.ntrlMin : theme.colors.primary;
|
|
8136
7911
|
}, function (_ref4) {
|
|
8137
7912
|
var isChecked = _ref4.isChecked,
|
|
8138
|
-
|
|
7913
|
+
theme = _ref4.theme;
|
|
8139
7914
|
return isChecked ? 'white' : theme.colors.base;
|
|
8140
7915
|
}, function (_ref5) {
|
|
8141
7916
|
var isChecked = _ref5.isChecked,
|
|
8142
|
-
|
|
7917
|
+
theme = _ref5.theme;
|
|
8143
7918
|
return isChecked ? theme.colors.primary : 'white';
|
|
8144
7919
|
}, media.sm, function (props) {
|
|
8145
7920
|
return props.theme.marginPaddings[2];
|
|
@@ -8291,43 +8066,35 @@
|
|
|
8291
8066
|
|
|
8292
8067
|
var _templateObject$u, _templateObject2$3;
|
|
8293
8068
|
var categories = catArray;
|
|
8294
|
-
|
|
8295
8069
|
var getSvg = function getSvg() {
|
|
8296
8070
|
var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
8297
|
-
|
|
8298
8071
|
switch (category) {
|
|
8299
8072
|
case interestCategories.BAGS:
|
|
8300
8073
|
return /*#__PURE__*/React__default.createElement(Bags, null);
|
|
8301
|
-
|
|
8302
8074
|
case interestCategories.SHOES:
|
|
8303
8075
|
return /*#__PURE__*/React__default.createElement(Shoes, null);
|
|
8304
|
-
|
|
8305
8076
|
case interestCategories.APPAREL:
|
|
8306
8077
|
return /*#__PURE__*/React__default.createElement(Clothing, null);
|
|
8307
|
-
|
|
8308
8078
|
case interestCategories.ACCESSORIES:
|
|
8309
8079
|
return /*#__PURE__*/React__default.createElement(Accessories, null);
|
|
8310
|
-
|
|
8311
8080
|
case interestCategories.WATCHES:
|
|
8312
8081
|
return /*#__PURE__*/React__default.createElement(Watches, null);
|
|
8313
|
-
|
|
8314
8082
|
default:
|
|
8315
8083
|
return null;
|
|
8316
8084
|
}
|
|
8317
8085
|
};
|
|
8318
|
-
|
|
8319
8086
|
var Container$1 = styled__default.div(_templateObject$u || (_templateObject$u = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
8320
8087
|
return props.theme.marginPaddings[5];
|
|
8321
8088
|
});
|
|
8322
8089
|
var CategoryTitle = styled__default.h1(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n margin-top: 10px;\n font-size: 14px;\n text-transform: uppercase;\n"])));
|
|
8090
|
+
|
|
8323
8091
|
/**
|
|
8324
8092
|
* InterestCatSelector is a specialized selector for select luxity specific interest categories
|
|
8325
8093
|
*/
|
|
8326
|
-
|
|
8327
8094
|
var InterestCatSelector = function InterestCatSelector(_ref) {
|
|
8328
8095
|
var onCategoryChange = _ref.onCategoryChange,
|
|
8329
|
-
|
|
8330
|
-
|
|
8096
|
+
errorMessage = _ref.errorMessage,
|
|
8097
|
+
category = _ref.category;
|
|
8331
8098
|
return /*#__PURE__*/React__default.createElement(Container$1, null, /*#__PURE__*/React__default.createElement(Body$2, null, categories.map(function (cat, index) {
|
|
8332
8099
|
return /*#__PURE__*/React__default.createElement(WrapperButton, {
|
|
8333
8100
|
key: "cat-".concat(index),
|
|
@@ -8342,7 +8109,6 @@
|
|
|
8342
8109
|
}, getSvg(cat.value), /*#__PURE__*/React__default.createElement(CategoryTitle, null, cat.categoryTitle)));
|
|
8343
8110
|
})), errorMessage && /*#__PURE__*/React__default.createElement(ErrorMessage$1, null, errorMessage));
|
|
8344
8111
|
};
|
|
8345
|
-
|
|
8346
8112
|
InterestCatSelector.defaultProps = {
|
|
8347
8113
|
errorMessage: '',
|
|
8348
8114
|
category: null,
|
|
@@ -8353,117 +8119,82 @@
|
|
|
8353
8119
|
var CategoryInterestSelector = themed(InterestCatSelector);
|
|
8354
8120
|
|
|
8355
8121
|
function _extends$2() {
|
|
8356
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
8357
|
-
for (var
|
|
8358
|
-
var
|
|
8359
|
-
|
|
8360
|
-
for (var key in source) {
|
|
8361
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8362
|
-
target[key] = source[key];
|
|
8363
|
-
}
|
|
8364
|
-
}
|
|
8122
|
+
return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
|
|
8123
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
8124
|
+
var t = arguments[e];
|
|
8125
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
8365
8126
|
}
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
};
|
|
8369
|
-
return _extends$2.apply(this, arguments);
|
|
8127
|
+
return n;
|
|
8128
|
+
}, _extends$2.apply(null, arguments);
|
|
8370
8129
|
}
|
|
8371
8130
|
|
|
8372
|
-
function _assertThisInitialized$2(
|
|
8373
|
-
if (
|
|
8374
|
-
|
|
8375
|
-
}
|
|
8376
|
-
|
|
8377
|
-
return self;
|
|
8131
|
+
function _assertThisInitialized$2(e) {
|
|
8132
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8133
|
+
return e;
|
|
8378
8134
|
}
|
|
8379
8135
|
|
|
8380
|
-
function _setPrototypeOf$2(
|
|
8381
|
-
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
};
|
|
8385
|
-
return _setPrototypeOf$2(o, p);
|
|
8136
|
+
function _setPrototypeOf$2(t, e) {
|
|
8137
|
+
return _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
8138
|
+
return t.__proto__ = e, t;
|
|
8139
|
+
}, _setPrototypeOf$2(t, e);
|
|
8386
8140
|
}
|
|
8387
8141
|
|
|
8388
|
-
function _inheritsLoose(
|
|
8389
|
-
|
|
8390
|
-
subClass.prototype.constructor = subClass;
|
|
8391
|
-
_setPrototypeOf$2(subClass, superClass);
|
|
8142
|
+
function _inheritsLoose(t, o) {
|
|
8143
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf$2(t, o);
|
|
8392
8144
|
}
|
|
8393
8145
|
|
|
8394
|
-
function _getPrototypeOf$2(
|
|
8395
|
-
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function
|
|
8396
|
-
return
|
|
8397
|
-
};
|
|
8398
|
-
return _getPrototypeOf$2(o);
|
|
8146
|
+
function _getPrototypeOf$2(t) {
|
|
8147
|
+
return _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
8148
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
8149
|
+
}, _getPrototypeOf$2(t);
|
|
8399
8150
|
}
|
|
8400
8151
|
|
|
8401
|
-
function _isNativeFunction(
|
|
8402
|
-
|
|
8152
|
+
function _isNativeFunction(t) {
|
|
8153
|
+
try {
|
|
8154
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
8155
|
+
} catch (n) {
|
|
8156
|
+
return "function" == typeof t;
|
|
8157
|
+
}
|
|
8403
8158
|
}
|
|
8404
8159
|
|
|
8405
8160
|
function _isNativeReflectConstruct$1() {
|
|
8406
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
8407
|
-
if (Reflect.construct.sham) return false;
|
|
8408
|
-
if (typeof Proxy === "function") return true;
|
|
8409
|
-
|
|
8410
8161
|
try {
|
|
8411
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
return
|
|
8415
|
-
}
|
|
8162
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8163
|
+
} catch (t) {}
|
|
8164
|
+
return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
|
|
8165
|
+
return !!t;
|
|
8166
|
+
})();
|
|
8416
8167
|
}
|
|
8417
8168
|
|
|
8418
|
-
function _construct(
|
|
8419
|
-
if (_isNativeReflectConstruct$1())
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
a.push.apply(a, args);
|
|
8425
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
8426
|
-
var instance = new Constructor();
|
|
8427
|
-
if (Class) _setPrototypeOf$2(instance, Class.prototype);
|
|
8428
|
-
return instance;
|
|
8429
|
-
};
|
|
8430
|
-
}
|
|
8431
|
-
|
|
8432
|
-
return _construct.apply(null, arguments);
|
|
8169
|
+
function _construct(t, e, r) {
|
|
8170
|
+
if (_isNativeReflectConstruct$1()) return Reflect.construct.apply(null, arguments);
|
|
8171
|
+
var o = [null];
|
|
8172
|
+
o.push.apply(o, e);
|
|
8173
|
+
var p = new (t.bind.apply(t, o))();
|
|
8174
|
+
return r && _setPrototypeOf$2(p, r.prototype), p;
|
|
8433
8175
|
}
|
|
8434
8176
|
|
|
8435
|
-
function _wrapNativeSuper(
|
|
8436
|
-
var
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
if (
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
}
|
|
8444
|
-
|
|
8445
|
-
if (typeof _cache !== "undefined") {
|
|
8446
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
8447
|
-
|
|
8448
|
-
_cache.set(Class, Wrapper);
|
|
8177
|
+
function _wrapNativeSuper(t) {
|
|
8178
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
8179
|
+
return _wrapNativeSuper = function _wrapNativeSuper(t) {
|
|
8180
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
8181
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
8182
|
+
if (void 0 !== r) {
|
|
8183
|
+
if (r.has(t)) return r.get(t);
|
|
8184
|
+
r.set(t, Wrapper);
|
|
8449
8185
|
}
|
|
8450
|
-
|
|
8451
8186
|
function Wrapper() {
|
|
8452
|
-
return _construct(
|
|
8187
|
+
return _construct(t, arguments, _getPrototypeOf$2(this).constructor);
|
|
8453
8188
|
}
|
|
8454
|
-
|
|
8455
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
8189
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
8456
8190
|
constructor: {
|
|
8457
8191
|
value: Wrapper,
|
|
8458
|
-
enumerable:
|
|
8459
|
-
writable:
|
|
8460
|
-
configurable:
|
|
8192
|
+
enumerable: !1,
|
|
8193
|
+
writable: !0,
|
|
8194
|
+
configurable: !0
|
|
8461
8195
|
}
|
|
8462
|
-
});
|
|
8463
|
-
|
|
8464
|
-
};
|
|
8465
|
-
|
|
8466
|
-
return _wrapNativeSuper(Class);
|
|
8196
|
+
}), _setPrototypeOf$2(Wrapper, t);
|
|
8197
|
+
}, _wrapNativeSuper(t);
|
|
8467
8198
|
}
|
|
8468
8199
|
|
|
8469
8200
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
@@ -9132,10 +8863,9 @@
|
|
|
9132
8863
|
}, function (props) {
|
|
9133
8864
|
return getSliderMarkStyle(props);
|
|
9134
8865
|
});
|
|
9135
|
-
|
|
9136
8866
|
var getSliderMarkStyle = function getSliderMarkStyle(_ref) {
|
|
9137
8867
|
var showMarks = _ref.showMarks,
|
|
9138
|
-
|
|
8868
|
+
primary = _ref.theme.colors.primary;
|
|
9139
8869
|
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 "])));
|
|
9140
8870
|
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);
|
|
9141
8871
|
};
|
|
@@ -9147,28 +8877,24 @@
|
|
|
9147
8877
|
var Footer = styled__default.div(_templateObject$y || (_templateObject$y = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-end;\n"])));
|
|
9148
8878
|
|
|
9149
8879
|
var _excluded$6 = ["dragging", "value", "offset", "index"],
|
|
9150
|
-
|
|
9151
|
-
|
|
8880
|
+
_excluded2 = ["renderTitleSection", "marks", "defaultMinValue", "defaultMaxValue", "min", "max", "toolTipComponent", "renderFooterSection", "onChange", "children", "identifier", "showMarks"];
|
|
9152
8881
|
var _templateObject$z;
|
|
9153
8882
|
var debounceBuilder = functions.debounced(100);
|
|
9154
8883
|
var ChildrenWrapper = styled__default.div(_templateObject$z || (_templateObject$z = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
9155
8884
|
return props.theme.marginPaddings[3];
|
|
9156
8885
|
});
|
|
9157
|
-
|
|
9158
8886
|
var renderCustomHandle = function renderCustomHandle() {
|
|
9159
8887
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9160
8888
|
var toolTipComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
9161
8889
|
var handleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
9162
|
-
|
|
9163
8890
|
var dragging = handleProps.dragging,
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
8891
|
+
value = handleProps.value,
|
|
8892
|
+
offset = handleProps.offset,
|
|
8893
|
+
index = handleProps.index,
|
|
8894
|
+
restHandleProps = _objectWithoutProperties(handleProps, _excluded$6);
|
|
9169
8895
|
var getToolTipProps = function getToolTipProps() {
|
|
9170
|
-
var newProps = {};
|
|
9171
|
-
|
|
8896
|
+
var newProps = {};
|
|
8897
|
+
// Ensures that Tooltip component does not get ref prop
|
|
9172
8898
|
Object.keys(handleProps).forEach(function (propName) {
|
|
9173
8899
|
if (propName !== 'ref') {
|
|
9174
8900
|
newProps[propName] = handleProps[propName];
|
|
@@ -9176,7 +8902,6 @@
|
|
|
9176
8902
|
});
|
|
9177
8903
|
return newProps;
|
|
9178
8904
|
};
|
|
9179
|
-
|
|
9180
8905
|
var Tooltip = toolTipComponent;
|
|
9181
8906
|
return /*#__PURE__*/React__default.createElement(React.Fragment, {
|
|
9182
8907
|
key: index
|
|
@@ -9193,55 +8918,47 @@
|
|
|
9193
8918
|
marks: marks
|
|
9194
8919
|
}, getToolTipProps()))));
|
|
9195
8920
|
};
|
|
9196
|
-
/** slider ui component for react */
|
|
9197
|
-
|
|
9198
8921
|
|
|
8922
|
+
/** slider ui component for react */
|
|
9199
8923
|
var RangeSlider = function RangeSlider(_ref) {
|
|
9200
8924
|
var renderTitleSection = _ref.renderTitleSection,
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
8925
|
+
marks = _ref.marks,
|
|
8926
|
+
defaultMinValue = _ref.defaultMinValue,
|
|
8927
|
+
defaultMaxValue = _ref.defaultMaxValue,
|
|
8928
|
+
min = _ref.min,
|
|
8929
|
+
max = _ref.max,
|
|
8930
|
+
toolTipComponent = _ref.toolTipComponent,
|
|
8931
|
+
renderFooterSection = _ref.renderFooterSection,
|
|
8932
|
+
onChange = _ref.onChange,
|
|
8933
|
+
childRenderer = _ref.children,
|
|
8934
|
+
identifier = _ref.identifier,
|
|
8935
|
+
showMarks = _ref.showMarks,
|
|
8936
|
+
restProps = _objectWithoutProperties(_ref, _excluded2);
|
|
9214
8937
|
var _useState = React.useState(defaultMinValue),
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
8938
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
8939
|
+
currMinVal = _useState2[0],
|
|
8940
|
+
setMinVal = _useState2[1];
|
|
9219
8941
|
var _useState3 = React.useState(defaultMaxValue),
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
8942
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
8943
|
+
currMaxVal = _useState4[0],
|
|
8944
|
+
setMaxVal = _useState4[1];
|
|
9223
8945
|
/*
|
|
9224
8946
|
*Description variable stores the time that the component renders
|
|
9225
8947
|
* the state is used to enforce reenders for the component since the date now
|
|
9226
8948
|
* is always changing
|
|
9227
8949
|
* */
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
8950
|
var _useState5 = React.useState(0),
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
8951
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
8952
|
+
seed = _useState6[0],
|
|
8953
|
+
setSeed = _useState6[1];
|
|
9235
8954
|
var manuallyChangeMinValue = function manuallyChangeMinValue(val) {
|
|
9236
8955
|
setMinVal(val);
|
|
9237
8956
|
setSeed(Date.now());
|
|
9238
8957
|
};
|
|
9239
|
-
|
|
9240
8958
|
var manuallyChangeMaxValue = function manuallyChangeMaxValue(val) {
|
|
9241
8959
|
setMaxVal(val);
|
|
9242
8960
|
setSeed(Date.now());
|
|
9243
8961
|
};
|
|
9244
|
-
|
|
9245
8962
|
var prevMinVal = functions.usePrevious(currMinVal);
|
|
9246
8963
|
var prevMaxVal = functions.usePrevious(currMaxVal);
|
|
9247
8964
|
React.useEffect(function () {
|
|
@@ -9277,9 +8994,8 @@
|
|
|
9277
8994
|
defaultValue: [defaultMinValue, defaultMaxValue],
|
|
9278
8995
|
onChange: function onChange(_ref2) {
|
|
9279
8996
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
8997
|
+
nextMin = _ref3[0],
|
|
8998
|
+
nextMax = _ref3[1];
|
|
9283
8999
|
setMinVal(nextMin);
|
|
9284
9000
|
setMaxVal(nextMax);
|
|
9285
9001
|
},
|
|
@@ -9292,7 +9008,6 @@
|
|
|
9292
9008
|
allowCross: false
|
|
9293
9009
|
}, restProps)), /*#__PURE__*/React__default.createElement(Footer, null, renderFooterSection(actionsObj)));
|
|
9294
9010
|
};
|
|
9295
|
-
|
|
9296
9011
|
RangeSlider.defaultProps = {
|
|
9297
9012
|
renderTitleSection: function renderTitleSection() {
|
|
9298
9013
|
return false;
|
|
@@ -9323,11 +9038,10 @@
|
|
|
9323
9038
|
}, function (props) {
|
|
9324
9039
|
return props.theme.marginPaddings[3];
|
|
9325
9040
|
});
|
|
9326
|
-
|
|
9327
9041
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
9328
9042
|
var title = _ref.title,
|
|
9329
|
-
|
|
9330
|
-
|
|
9043
|
+
children = _ref.children,
|
|
9044
|
+
className = _ref.className;
|
|
9331
9045
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
9332
9046
|
className: className
|
|
9333
9047
|
}, /*#__PURE__*/React__default.createElement(Title$2, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
@@ -9339,31 +9053,23 @@
|
|
|
9339
9053
|
});
|
|
9340
9054
|
|
|
9341
9055
|
var debounceBuilder$1 = functions.debounced(50);
|
|
9342
|
-
|
|
9343
9056
|
var getMaxPrice = function getMaxPrice() {
|
|
9344
9057
|
var interestCategory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9345
|
-
|
|
9346
9058
|
switch (interestCategory) {
|
|
9347
9059
|
case interestCategories.ACCESSORIES:
|
|
9348
9060
|
return interestCategoryMaxPrices.ACCESSORIES;
|
|
9349
|
-
|
|
9350
9061
|
case interestCategories.BAGS:
|
|
9351
9062
|
return interestCategoryMaxPrices.BAGS;
|
|
9352
|
-
|
|
9353
9063
|
case interestCategories.SHOES:
|
|
9354
9064
|
return interestCategoryMaxPrices.SHOES;
|
|
9355
|
-
|
|
9356
9065
|
case interestCategories.WATCHES:
|
|
9357
9066
|
return interestCategoryMaxPrices.WATCHES;
|
|
9358
|
-
|
|
9359
9067
|
case interestCategories.APPAREL:
|
|
9360
9068
|
return interestCategoryMaxPrices.APPAREL;
|
|
9361
|
-
|
|
9362
9069
|
default:
|
|
9363
9070
|
return 0;
|
|
9364
9071
|
}
|
|
9365
9072
|
};
|
|
9366
|
-
|
|
9367
9073
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9368
9074
|
var giveFullRange = actionObj.giveFullRange;
|
|
9369
9075
|
return /*#__PURE__*/React__default.createElement(SecondaryButton$1, {
|
|
@@ -9371,24 +9077,21 @@
|
|
|
9371
9077
|
onClick: giveFullRange
|
|
9372
9078
|
}, "Full Price Range");
|
|
9373
9079
|
};
|
|
9080
|
+
|
|
9374
9081
|
/** UI Slider with minimum and max input fields give the ability to
|
|
9375
9082
|
* select a price range */
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
9083
|
var PriceRangeSelector = function PriceRangeSelector(_ref) {
|
|
9379
9084
|
var onChange = _ref.onChange,
|
|
9380
|
-
|
|
9085
|
+
category = _ref.category;
|
|
9381
9086
|
var maxPrice = getMaxPrice(category);
|
|
9382
|
-
|
|
9383
9087
|
var handleSlideChange = function handleSlideChange(value) {
|
|
9384
9088
|
var min_price = value.min,
|
|
9385
|
-
|
|
9089
|
+
max_price = value.max;
|
|
9386
9090
|
onChange({
|
|
9387
9091
|
min_price: min_price,
|
|
9388
9092
|
max_price: max_price
|
|
9389
9093
|
});
|
|
9390
9094
|
};
|
|
9391
|
-
|
|
9392
9095
|
var handleMinCurrencyChange = function handleMinCurrencyChange(targetValue, currMaxVal, manuallyChangeMinValue) {
|
|
9393
9096
|
var value = parseInt(unMask(targetValue), 10);
|
|
9394
9097
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9401,7 +9104,6 @@
|
|
|
9401
9104
|
});
|
|
9402
9105
|
});
|
|
9403
9106
|
};
|
|
9404
|
-
|
|
9405
9107
|
var handleMaxCurrencyChange = function handleMaxCurrencyChange(targetValue, currMinVal, manuallyChangeMaxValue) {
|
|
9406
9108
|
var value = parseInt(unMask(targetValue), 10);
|
|
9407
9109
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9414,7 +9116,6 @@
|
|
|
9414
9116
|
});
|
|
9415
9117
|
});
|
|
9416
9118
|
};
|
|
9417
|
-
|
|
9418
9119
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9419
9120
|
className: "price-ranges"
|
|
9420
9121
|
}, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
@@ -9433,9 +9134,9 @@
|
|
|
9433
9134
|
title: "Price Ranges"
|
|
9434
9135
|
}, function (_ref2) {
|
|
9435
9136
|
var manuallyChangeMinValue = _ref2.manuallyChangeMinValue,
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9137
|
+
manuallyChangeMaxValue = _ref2.manuallyChangeMaxValue,
|
|
9138
|
+
currMinVal = _ref2.currMinVal,
|
|
9139
|
+
currMaxVal = _ref2.currMaxVal;
|
|
9439
9140
|
return /*#__PURE__*/React__default.createElement(CurrencyInputWrapper, null, /*#__PURE__*/React__default.createElement(CurrencyInputFormatter, {
|
|
9440
9141
|
"data-qe-id": "masked-input-min",
|
|
9441
9142
|
value: currMinVal,
|
|
@@ -9451,7 +9152,6 @@
|
|
|
9451
9152
|
}));
|
|
9452
9153
|
}));
|
|
9453
9154
|
};
|
|
9454
|
-
|
|
9455
9155
|
PriceRangeSelector.defaultProps = {
|
|
9456
9156
|
onChange: function onChange() {
|
|
9457
9157
|
return false;
|
|
@@ -9472,7 +9172,6 @@
|
|
|
9472
9172
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9473
9173
|
return shoe_sizes.length - 1;
|
|
9474
9174
|
};
|
|
9475
|
-
|
|
9476
9175
|
var formatResultsForRangeSlider = function formatResultsForRangeSlider() {
|
|
9477
9176
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9478
9177
|
var newDataShape = {};
|
|
@@ -9482,28 +9181,24 @@
|
|
|
9482
9181
|
});
|
|
9483
9182
|
return newDataShape;
|
|
9484
9183
|
};
|
|
9485
|
-
|
|
9486
9184
|
var ToolTipComponent = function ToolTipComponent(props) {
|
|
9487
9185
|
var marks = props.marks,
|
|
9488
|
-
|
|
9186
|
+
value = props.value;
|
|
9489
9187
|
return /*#__PURE__*/React__default.createElement("div", null, marks[value]);
|
|
9490
9188
|
};
|
|
9491
|
-
/** slider ui component for shoe size selection interests */
|
|
9492
|
-
|
|
9493
9189
|
|
|
9190
|
+
/** slider ui component for shoe size selection interests */
|
|
9494
9191
|
var ShoeSizeSelector = function ShoeSizeSelector(_ref2) {
|
|
9495
9192
|
var onChange = _ref2.onChange,
|
|
9496
|
-
|
|
9497
|
-
|
|
9193
|
+
shoeSizes = _ref2.shoeSizes;
|
|
9498
9194
|
var handleShoeSizeChange = function handleShoeSizeChange(value) {
|
|
9499
9195
|
var min_shoe_key = value.min,
|
|
9500
|
-
|
|
9196
|
+
max_shoe_key = value.max;
|
|
9501
9197
|
onChange({
|
|
9502
9198
|
min_shoe_size_id: shoeSizes[min_shoe_key].id,
|
|
9503
9199
|
max_shoe_size_id: shoeSizes[max_shoe_key].id
|
|
9504
9200
|
});
|
|
9505
9201
|
};
|
|
9506
|
-
|
|
9507
9202
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9508
9203
|
var giveFullRange = actionObj.giveFullRange;
|
|
9509
9204
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
@@ -9512,7 +9207,6 @@
|
|
|
9512
9207
|
onClick: giveFullRange
|
|
9513
9208
|
}, "Full Shoe Size Range"));
|
|
9514
9209
|
};
|
|
9515
|
-
|
|
9516
9210
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
9517
9211
|
identifier: "shoe-size-range-slider",
|
|
9518
9212
|
marks: formatResultsForRangeSlider(shoeSizes),
|
|
@@ -9525,7 +9219,6 @@
|
|
|
9525
9219
|
onChange: handleShoeSizeChange
|
|
9526
9220
|
}));
|
|
9527
9221
|
};
|
|
9528
|
-
|
|
9529
9222
|
ShoeSizeSelector.defaultProps = {
|
|
9530
9223
|
onChange: function onChange() {
|
|
9531
9224
|
return false;
|
|
@@ -9534,23 +9227,17 @@
|
|
|
9534
9227
|
};
|
|
9535
9228
|
|
|
9536
9229
|
var SimpleErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
9537
|
-
_inherits(SimpleErrorBoundary, _React$Component);
|
|
9538
|
-
|
|
9539
|
-
var _super = _createSuper(SimpleErrorBoundary);
|
|
9540
|
-
|
|
9541
9230
|
function SimpleErrorBoundary(props) {
|
|
9542
9231
|
var _this;
|
|
9543
|
-
|
|
9544
9232
|
_classCallCheck(this, SimpleErrorBoundary);
|
|
9545
|
-
|
|
9546
|
-
_this = _super.call(this, props);
|
|
9233
|
+
_this = _callSuper(this, SimpleErrorBoundary, [props]);
|
|
9547
9234
|
_this.state = {
|
|
9548
9235
|
hasError: false
|
|
9549
9236
|
};
|
|
9550
9237
|
return _this;
|
|
9551
9238
|
}
|
|
9552
|
-
|
|
9553
|
-
_createClass(SimpleErrorBoundary, [{
|
|
9239
|
+
_inherits(SimpleErrorBoundary, _React$Component);
|
|
9240
|
+
return _createClass(SimpleErrorBoundary, [{
|
|
9554
9241
|
key: "componentDidCatch",
|
|
9555
9242
|
value: function componentDidCatch(error, errorInfo) {
|
|
9556
9243
|
// You can also log the error to an error reporting service
|
|
@@ -9563,7 +9250,6 @@
|
|
|
9563
9250
|
// You can render any custom fallback UI
|
|
9564
9251
|
return this.props.showMessageOnError ? /*#__PURE__*/React__default.createElement("h1", null, this.props.errorMessage) : null;
|
|
9565
9252
|
}
|
|
9566
|
-
|
|
9567
9253
|
return this.props.children;
|
|
9568
9254
|
}
|
|
9569
9255
|
}], [{
|
|
@@ -9575,10 +9261,7 @@
|
|
|
9575
9261
|
};
|
|
9576
9262
|
}
|
|
9577
9263
|
}]);
|
|
9578
|
-
|
|
9579
|
-
return SimpleErrorBoundary;
|
|
9580
9264
|
}(React__default.Component);
|
|
9581
|
-
|
|
9582
9265
|
SimpleErrorBoundary.defaultProps = {
|
|
9583
9266
|
errorMessage: 'Something went wrong',
|
|
9584
9267
|
errorLogger: null,
|
|
@@ -9589,21 +9272,19 @@
|
|
|
9589
9272
|
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 (max-width: ", ") {\n justify-content: flex-start;\n }\n }\n"])), media.sm, media.sm, function (props) {
|
|
9590
9273
|
return props.theme.marginPaddings[1];
|
|
9591
9274
|
}, media.sm);
|
|
9592
|
-
|
|
9593
9275
|
/**
|
|
9594
9276
|
* IconHeader can render the standard Luxity Page/Section Header nodes with SVG
|
|
9595
9277
|
*/
|
|
9596
9278
|
var IconHeader = function IconHeader(_ref) {
|
|
9597
9279
|
var title = _ref.title,
|
|
9598
|
-
|
|
9599
|
-
|
|
9280
|
+
SvgComponent = _ref.svgComponent,
|
|
9281
|
+
renderAppendage = _ref.renderAppendage;
|
|
9600
9282
|
return /*#__PURE__*/React__default.createElement(StyledHeader, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9601
9283
|
className: "icon-header__left"
|
|
9602
9284
|
}, /*#__PURE__*/React__default.createElement(SvgComponent, null), title), /*#__PURE__*/React__default.createElement("div", {
|
|
9603
9285
|
className: "icon-header__right"
|
|
9604
9286
|
}, renderAppendage && renderAppendage()));
|
|
9605
9287
|
};
|
|
9606
|
-
|
|
9607
9288
|
IconHeader.defaultProps = {
|
|
9608
9289
|
title: '',
|
|
9609
9290
|
svgComponent: function svgComponent() {
|
|
@@ -9657,37 +9338,25 @@
|
|
|
9657
9338
|
/**
|
|
9658
9339
|
* It represents the React Component that contains the notifications.
|
|
9659
9340
|
* */
|
|
9660
|
-
|
|
9661
9341
|
var LuxityNotifications = function LuxityNotifications(props) {
|
|
9662
9342
|
return /*#__PURE__*/React__default.createElement(Notifications__default, props);
|
|
9663
9343
|
};
|
|
9664
9344
|
|
|
9665
9345
|
var NotificationDropDown = /*#__PURE__*/function (_React$Component) {
|
|
9666
|
-
_inherits(NotificationDropDown, _React$Component);
|
|
9667
|
-
|
|
9668
|
-
var _super = _createSuper(NotificationDropDown);
|
|
9669
|
-
|
|
9670
9346
|
function NotificationDropDown(props) {
|
|
9671
9347
|
var _this;
|
|
9672
|
-
|
|
9673
9348
|
_classCallCheck(this, NotificationDropDown);
|
|
9674
|
-
|
|
9675
|
-
_this
|
|
9676
|
-
|
|
9677
|
-
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
9349
|
+
_this = _callSuper(this, NotificationDropDown, [props]);
|
|
9350
|
+
_defineProperty(_this, "postUpdate", function (selectedOption, type) {
|
|
9678
9351
|
_this.setState({
|
|
9679
9352
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9680
9353
|
fetching: true
|
|
9681
9354
|
})
|
|
9682
9355
|
});
|
|
9683
|
-
|
|
9684
9356
|
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9357
|
+
_this.setState(_defineProperty(_defineProperty({}, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9688
9358
|
success: true
|
|
9689
|
-
}))
|
|
9690
|
-
|
|
9359
|
+
})));
|
|
9691
9360
|
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
9692
9361
|
}).catch(function () {
|
|
9693
9362
|
_this.setState({
|
|
@@ -9695,12 +9364,10 @@
|
|
|
9695
9364
|
failed: true
|
|
9696
9365
|
})
|
|
9697
9366
|
});
|
|
9698
|
-
|
|
9699
9367
|
error('Error Occurred');
|
|
9700
9368
|
});
|
|
9701
9369
|
});
|
|
9702
|
-
|
|
9703
|
-
_defineProperty(_assertThisInitialized(_this), "getOptionsFromEnumResult", function (enumResult) {
|
|
9370
|
+
_defineProperty(_this, "getOptionsFromEnumResult", function (enumResult) {
|
|
9704
9371
|
var enumValues = enumResult.data.__type.enumValues;
|
|
9705
9372
|
return enumValues.map(function (enumItem) {
|
|
9706
9373
|
return {
|
|
@@ -9709,20 +9376,17 @@
|
|
|
9709
9376
|
};
|
|
9710
9377
|
});
|
|
9711
9378
|
});
|
|
9712
|
-
|
|
9713
|
-
_defineProperty(_assertThisInitialized(_this), "onData", function (_ref) {
|
|
9379
|
+
_defineProperty(_this, "onData", function (_ref) {
|
|
9714
9380
|
var data = _ref.data;
|
|
9715
|
-
|
|
9716
9381
|
var options = _this.getOptionsFromEnumResult(data);
|
|
9717
|
-
|
|
9718
9382
|
var _data$data$user = data.data.user,
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9383
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
9384
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
9385
|
+
is_early_access = _data$data$user.is_early_access,
|
|
9386
|
+
is_exclusive = _data$data$user.is_exclusive;
|
|
9723
9387
|
_this.setState({
|
|
9724
9388
|
options: options,
|
|
9725
|
-
|
|
9389
|
+
canReceiveWhatsAppNotifications: is_early_access || is_exclusive,
|
|
9726
9390
|
emailSelectedOption: options.find(function (item) {
|
|
9727
9391
|
return item.value === email_interest_send_schedule;
|
|
9728
9392
|
}),
|
|
@@ -9731,14 +9395,13 @@
|
|
|
9731
9395
|
})
|
|
9732
9396
|
});
|
|
9733
9397
|
});
|
|
9734
|
-
|
|
9735
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9398
|
+
_defineProperty(_this, "render", function () {
|
|
9736
9399
|
var _this$state = _this.state,
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9400
|
+
options = _this$state.options,
|
|
9401
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
9402
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
9403
|
+
canReceiveWhatsAppNotifications = _this$state.canReceiveWhatsAppNotifications,
|
|
9404
|
+
updating = _this$state.request.fetching;
|
|
9742
9405
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9743
9406
|
getRequestPromise: _this.props.getSchedule,
|
|
9744
9407
|
onData: function onData(data) {
|
|
@@ -9746,7 +9409,7 @@
|
|
|
9746
9409
|
}
|
|
9747
9410
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9748
9411
|
className: "notification-settings"
|
|
9749
|
-
},
|
|
9412
|
+
}, canReceiveWhatsAppNotifications && /*#__PURE__*/React__default.createElement("div", {
|
|
9750
9413
|
className: "notification-row-wrapper"
|
|
9751
9414
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9752
9415
|
className: "notification-dropdown-label"
|
|
@@ -9786,20 +9449,18 @@
|
|
|
9786
9449
|
value: emailSelectedOption
|
|
9787
9450
|
}))))));
|
|
9788
9451
|
});
|
|
9789
|
-
|
|
9790
9452
|
_this.state = {
|
|
9791
9453
|
options: [],
|
|
9792
9454
|
emailSelectedOption: null,
|
|
9793
9455
|
whatsappSelectedOption: null,
|
|
9794
|
-
|
|
9456
|
+
canReceiveWhatsAppNotifications: false,
|
|
9795
9457
|
request: _objectSpread2({}, request)
|
|
9796
9458
|
};
|
|
9797
9459
|
return _this;
|
|
9798
9460
|
}
|
|
9799
|
-
|
|
9461
|
+
_inherits(NotificationDropDown, _React$Component);
|
|
9800
9462
|
return _createClass(NotificationDropDown);
|
|
9801
9463
|
}(React__default.Component);
|
|
9802
|
-
|
|
9803
9464
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
9804
9465
|
|
|
9805
9466
|
var _templateObject$F, _templateObject2$6;
|
|
@@ -9841,65 +9502,49 @@
|
|
|
9841
9502
|
}, function (props) {
|
|
9842
9503
|
return props.theme.colors.ntrlMin;
|
|
9843
9504
|
});
|
|
9505
|
+
|
|
9844
9506
|
/**
|
|
9845
9507
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
9846
9508
|
*/
|
|
9847
|
-
|
|
9848
9509
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
9849
|
-
_inherits(GraphQLMultiSelector, _React$Component);
|
|
9850
|
-
|
|
9851
|
-
var _super = _createSuper(GraphQLMultiSelector);
|
|
9852
|
-
|
|
9853
9510
|
function GraphQLMultiSelector(props) {
|
|
9854
9511
|
var _this;
|
|
9855
|
-
|
|
9856
9512
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
9857
|
-
|
|
9858
|
-
_this
|
|
9859
|
-
|
|
9860
|
-
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
9513
|
+
_this = _callSuper(this, GraphQLMultiSelector, [props]);
|
|
9514
|
+
_defineProperty(_this, "componentDidUpdate", function (prevProps) {
|
|
9861
9515
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
9862
9516
|
_this.makeRequest();
|
|
9863
9517
|
}
|
|
9864
9518
|
});
|
|
9865
|
-
|
|
9866
|
-
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
9519
|
+
_defineProperty(_this, "makeRequest", function () {
|
|
9867
9520
|
_this.pageReady.refreshPage();
|
|
9868
9521
|
});
|
|
9869
|
-
|
|
9870
|
-
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
9522
|
+
_defineProperty(_this, "emptySelected", function () {
|
|
9871
9523
|
return _this.setState({
|
|
9872
9524
|
selected: [ALL_ITEM]
|
|
9873
9525
|
});
|
|
9874
9526
|
});
|
|
9875
|
-
|
|
9876
|
-
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
9527
|
+
_defineProperty(_this, "setNewResults", function (res) {
|
|
9877
9528
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
9878
9529
|
return sel.id;
|
|
9879
9530
|
});
|
|
9880
|
-
|
|
9881
9531
|
var pagination = _this.props.resultProcessor(res);
|
|
9882
|
-
|
|
9883
9532
|
var allSelected = _this.state.selected.some(function (item) {
|
|
9884
9533
|
return item.id === ALL_ITEM.id;
|
|
9885
9534
|
});
|
|
9886
|
-
|
|
9887
9535
|
var newList = pagination.data.filter(function (newItem) {
|
|
9888
9536
|
return !selectedIds.includes(newItem.id);
|
|
9889
9537
|
});
|
|
9890
9538
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
9891
|
-
|
|
9892
9539
|
_this.setState({
|
|
9893
9540
|
list: newList,
|
|
9894
9541
|
pagination: pagination
|
|
9895
9542
|
});
|
|
9896
9543
|
});
|
|
9897
|
-
|
|
9898
|
-
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
9544
|
+
_defineProperty(_this, "onAddItem", function (addSelectedItem) {
|
|
9899
9545
|
_this.setState(function (prevState) {
|
|
9900
9546
|
var newSelectedList;
|
|
9901
9547
|
var newList;
|
|
9902
|
-
|
|
9903
9548
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
9904
9549
|
// Clear Selected List
|
|
9905
9550
|
// and move previous Selected items to list
|
|
@@ -9919,7 +9564,6 @@
|
|
|
9919
9564
|
return item.id !== addSelectedItem.id;
|
|
9920
9565
|
})));
|
|
9921
9566
|
}
|
|
9922
|
-
|
|
9923
9567
|
return {
|
|
9924
9568
|
selected: newSelectedList,
|
|
9925
9569
|
list: newList
|
|
@@ -9930,24 +9574,20 @@
|
|
|
9930
9574
|
}));
|
|
9931
9575
|
});
|
|
9932
9576
|
});
|
|
9933
|
-
|
|
9934
|
-
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
9577
|
+
_defineProperty(_this, "onRemoveItem", function (removeSelectedItem) {
|
|
9935
9578
|
_this.setState(function (prevState) {
|
|
9936
9579
|
// Cannot remove ALL from selection by unselecting it
|
|
9937
9580
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
9938
9581
|
return {};
|
|
9939
9582
|
}
|
|
9940
|
-
|
|
9941
9583
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
9942
9584
|
return item.id !== removeSelectedItem.id;
|
|
9943
9585
|
});
|
|
9944
|
-
|
|
9945
9586
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
9946
9587
|
return item.id !== ALL_ITEM.id;
|
|
9947
9588
|
}).sort(function (a, b) {
|
|
9948
9589
|
return a.id - b.id;
|
|
9949
9590
|
});
|
|
9950
|
-
|
|
9951
9591
|
return {
|
|
9952
9592
|
list: newList,
|
|
9953
9593
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -9958,25 +9598,23 @@
|
|
|
9958
9598
|
}));
|
|
9959
9599
|
});
|
|
9960
9600
|
});
|
|
9961
|
-
|
|
9962
|
-
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
9601
|
+
_defineProperty(_this, "onIsLoading", function (flag) {
|
|
9963
9602
|
_this.setState({
|
|
9964
9603
|
isLoading: flag
|
|
9965
9604
|
});
|
|
9966
9605
|
});
|
|
9967
|
-
|
|
9968
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9606
|
+
_defineProperty(_this, "render", function () {
|
|
9969
9607
|
var _this$props = _this.props,
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9608
|
+
baseClass = _this$props.baseClass,
|
|
9609
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
9610
|
+
identifier = _this$props.identifier,
|
|
9611
|
+
triggerRequest = _this$props.triggerRequest,
|
|
9612
|
+
className = _this$props.className;
|
|
9975
9613
|
var _this$state = _this.state,
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9614
|
+
list = _this$state.list,
|
|
9615
|
+
selected = _this$state.selected,
|
|
9616
|
+
pagination = _this$state.pagination,
|
|
9617
|
+
isLoading = _this$state.isLoading;
|
|
9980
9618
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9981
9619
|
"data-qe-id": identifier,
|
|
9982
9620
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -10015,7 +9653,6 @@
|
|
|
10015
9653
|
type: "button"
|
|
10016
9654
|
}, "SHOW MORE"))));
|
|
10017
9655
|
});
|
|
10018
|
-
|
|
10019
9656
|
_this.state = {
|
|
10020
9657
|
selected: [ALL_ITEM],
|
|
10021
9658
|
list: [],
|
|
@@ -10024,10 +9661,9 @@
|
|
|
10024
9661
|
};
|
|
10025
9662
|
return _this;
|
|
10026
9663
|
}
|
|
10027
|
-
|
|
9664
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
10028
9665
|
return _createClass(GraphQLMultiSelector);
|
|
10029
9666
|
}(React__default.Component);
|
|
10030
|
-
|
|
10031
9667
|
GraphQLMultiSelector.defaultProps = {
|
|
10032
9668
|
baseClass: 'multiselector'
|
|
10033
9669
|
};
|
|
@@ -10048,13 +9684,12 @@
|
|
|
10048
9684
|
});
|
|
10049
9685
|
|
|
10050
9686
|
var _templateObject$G;
|
|
10051
|
-
|
|
10052
9687
|
var Title$3 = function Title(_ref) {
|
|
10053
9688
|
var baseClass = _ref.baseClass,
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
9689
|
+
className = _ref.className,
|
|
9690
|
+
title = _ref.title,
|
|
9691
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
9692
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
10058
9693
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
10059
9694
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
10060
9695
|
title: title
|
|
@@ -10067,7 +9702,6 @@
|
|
|
10067
9702
|
onChange: onSearchChanged
|
|
10068
9703
|
})));
|
|
10069
9704
|
};
|
|
10070
|
-
|
|
10071
9705
|
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) {
|
|
10072
9706
|
return props.theme.marginPaddings[2];
|
|
10073
9707
|
}, function (props) {
|
|
@@ -10090,37 +9724,26 @@
|
|
|
10090
9724
|
var Title$4 = themed(StyledTitle);
|
|
10091
9725
|
|
|
10092
9726
|
var debounceBuilder$3 = functions.debounced(200);
|
|
10093
|
-
|
|
10094
9727
|
/**
|
|
10095
9728
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
10096
9729
|
*/
|
|
10097
9730
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
10098
|
-
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
10099
|
-
|
|
10100
|
-
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
10101
|
-
|
|
10102
9731
|
function LuxityGraphQLMultiselector(props) {
|
|
10103
9732
|
var _this;
|
|
10104
|
-
|
|
10105
9733
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
10106
|
-
|
|
10107
|
-
_this
|
|
10108
|
-
|
|
10109
|
-
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
10110
|
-
|
|
10111
|
-
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
9734
|
+
_this = _callSuper(this, LuxityGraphQLMultiselector, [props]);
|
|
9735
|
+
_defineProperty(_this, "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
9736
|
+
_defineProperty(_this, "increaseLimit", function () {
|
|
10112
9737
|
_this.setState(function (prevState) {
|
|
10113
9738
|
return {
|
|
10114
9739
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
10115
9740
|
};
|
|
10116
9741
|
});
|
|
10117
9742
|
});
|
|
10118
|
-
|
|
10119
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
9743
|
+
_defineProperty(_this, "onChange", function (selection) {
|
|
10120
9744
|
_this.props.onChange(selection);
|
|
10121
9745
|
});
|
|
10122
|
-
|
|
10123
|
-
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
9746
|
+
_defineProperty(_this, "onSearchChanged", function (event) {
|
|
10124
9747
|
event.preventDefault();
|
|
10125
9748
|
var searchText = event.target.value;
|
|
10126
9749
|
debounceBuilder$3(function () {
|
|
@@ -10129,22 +9752,21 @@
|
|
|
10129
9752
|
});
|
|
10130
9753
|
});
|
|
10131
9754
|
});
|
|
10132
|
-
|
|
10133
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9755
|
+
_defineProperty(_this, "render", function () {
|
|
10134
9756
|
var _this$state = _this.state,
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
9757
|
+
limit = _this$state.limit,
|
|
9758
|
+
category = _this$state.category,
|
|
9759
|
+
nameFilter = _this$state.nameFilter;
|
|
10138
9760
|
var _this$props = _this.props,
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
9761
|
+
title = _this$props.title,
|
|
9762
|
+
baseClass = _this$props.baseClass,
|
|
9763
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
9764
|
+
resultProcessor = _this$props.resultProcessor,
|
|
9765
|
+
itemRenderer = _this$props.itemRenderer,
|
|
9766
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
9767
|
+
graphApi = _this$props.graphApi,
|
|
9768
|
+
identifier = _this$props.identifier,
|
|
9769
|
+
requestInstance = _this$props.requestInstance;
|
|
10148
9770
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10149
9771
|
className: baseClass
|
|
10150
9772
|
}, /*#__PURE__*/React__default.createElement(Title$4, {
|
|
@@ -10167,7 +9789,6 @@
|
|
|
10167
9789
|
itemRenderer: itemRenderer
|
|
10168
9790
|
})));
|
|
10169
9791
|
});
|
|
10170
|
-
|
|
10171
9792
|
_this.state = {
|
|
10172
9793
|
limit: props.baseQueryLimit,
|
|
10173
9794
|
category: props.category,
|
|
@@ -10175,12 +9796,11 @@
|
|
|
10175
9796
|
};
|
|
10176
9797
|
return _this;
|
|
10177
9798
|
}
|
|
10178
|
-
|
|
10179
|
-
_createClass(LuxityGraphQLMultiselector, [{
|
|
9799
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
9800
|
+
return _createClass(LuxityGraphQLMultiselector, [{
|
|
10180
9801
|
key: "componentDidUpdate",
|
|
10181
9802
|
value: function componentDidUpdate(prevProps) {
|
|
10182
9803
|
var _this$multiSelectorRe;
|
|
10183
|
-
|
|
10184
9804
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
10185
9805
|
this.multiSelectorRef.current.emptySelected();
|
|
10186
9806
|
}
|
|
@@ -10193,14 +9813,10 @@
|
|
|
10193
9813
|
category: props.category
|
|
10194
9814
|
};
|
|
10195
9815
|
}
|
|
10196
|
-
|
|
10197
9816
|
return null;
|
|
10198
9817
|
}
|
|
10199
9818
|
}]);
|
|
10200
|
-
|
|
10201
|
-
return LuxityGraphQLMultiselector;
|
|
10202
9819
|
}(React__default.Component);
|
|
10203
|
-
|
|
10204
9820
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
10205
9821
|
baseClass: '',
|
|
10206
9822
|
searchPlaceHolder: '',
|
|
@@ -10221,11 +9837,10 @@
|
|
|
10221
9837
|
return props.theme.colors.ntrlMin;
|
|
10222
9838
|
});
|
|
10223
9839
|
var UnselectedButton = themed(BaseButton);
|
|
10224
|
-
|
|
10225
9840
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
10226
9841
|
var item = _ref.item,
|
|
10227
|
-
|
|
10228
|
-
|
|
9842
|
+
onSelect = _ref.onSelect,
|
|
9843
|
+
selected = _ref.selected;
|
|
10229
9844
|
var props = {
|
|
10230
9845
|
onClick: function onClick(e) {
|
|
10231
9846
|
e.preventDefault();
|
|
@@ -10237,12 +9852,12 @@
|
|
|
10237
9852
|
|
|
10238
9853
|
var BrandSelector = function BrandSelector(_ref) {
|
|
10239
9854
|
var onChange = _ref.onChange,
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
9855
|
+
category = _ref.category,
|
|
9856
|
+
graphApi = _ref.graphApi,
|
|
9857
|
+
itemRenderer = _ref.itemRenderer,
|
|
9858
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
9859
|
+
resultProcessor = _ref.resultProcessor,
|
|
9860
|
+
requestInstance = _ref.requestInstance;
|
|
10246
9861
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10247
9862
|
baseQueryLimit: 16,
|
|
10248
9863
|
title: "Brands",
|
|
@@ -10259,7 +9874,6 @@
|
|
|
10259
9874
|
requestInstance: requestInstance
|
|
10260
9875
|
});
|
|
10261
9876
|
};
|
|
10262
|
-
|
|
10263
9877
|
BrandSelector.defaultProps = {
|
|
10264
9878
|
itemRenderer: ItemRenderer,
|
|
10265
9879
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -10269,12 +9883,12 @@
|
|
|
10269
9883
|
|
|
10270
9884
|
var StyleSelector = function StyleSelector(_ref) {
|
|
10271
9885
|
var onChange = _ref.onChange,
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
9886
|
+
category = _ref.category,
|
|
9887
|
+
graphApi = _ref.graphApi,
|
|
9888
|
+
itemRenderer = _ref.itemRenderer,
|
|
9889
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
9890
|
+
resultProcessor = _ref.resultProcessor,
|
|
9891
|
+
requestInstance = _ref.requestInstance;
|
|
10278
9892
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10279
9893
|
title: "Styles",
|
|
10280
9894
|
queryId: "getStyles",
|
|
@@ -10291,7 +9905,6 @@
|
|
|
10291
9905
|
requestInstance: requestInstance
|
|
10292
9906
|
});
|
|
10293
9907
|
};
|
|
10294
|
-
|
|
10295
9908
|
StyleSelector.defaultProps = {
|
|
10296
9909
|
itemRenderer: ItemRenderer,
|
|
10297
9910
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -10323,17 +9936,14 @@
|
|
|
10323
9936
|
ShoeSizeFadeContainer.defaultProps = {
|
|
10324
9937
|
childVisible: false
|
|
10325
9938
|
};
|
|
10326
|
-
|
|
10327
9939
|
var OpacityTransitionRender = function OpacityTransitionRender(_ref) {
|
|
10328
9940
|
var shoeSizeType = _ref.shoeSizeType,
|
|
10329
|
-
|
|
9941
|
+
children = _ref.children;
|
|
10330
9942
|
var prevShoeSizeType = functions.usePrevious(shoeSizeType);
|
|
10331
|
-
|
|
10332
9943
|
var _React$useState = React__default.useState(false),
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
9944
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9945
|
+
childVisible = _React$useState2[0],
|
|
9946
|
+
setChildVisible = _React$useState2[1];
|
|
10337
9947
|
React__default.useEffect(function () {
|
|
10338
9948
|
if (prevShoeSizeType !== shoeSizeType) {
|
|
10339
9949
|
setChildVisible(false);
|
|
@@ -10346,30 +9956,25 @@
|
|
|
10346
9956
|
childVisible: childVisible
|
|
10347
9957
|
}, children);
|
|
10348
9958
|
};
|
|
10349
|
-
|
|
10350
9959
|
var WrappedShoeSizeSelector = function WrappedShoeSizeSelector(_ref2) {
|
|
10351
9960
|
var onChange = _ref2.onChange,
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
9961
|
+
requestInstance = _ref2.requestInstance,
|
|
9962
|
+
graphApi = _ref2.graphApi,
|
|
9963
|
+
defaultShoeSizeType = _ref2.defaultShoeSizeType,
|
|
9964
|
+
getGraphQuery = _ref2.getGraphQuery;
|
|
10357
9965
|
var _useState = React.useState(defaultShoeSizeType),
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
9966
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9967
|
+
shoeSizeType = _useState2[0],
|
|
9968
|
+
setShoeSizeType = _useState2[1];
|
|
10362
9969
|
var _useState3 = React.useState(defaultShoeSizeType),
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
9970
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9971
|
+
transitionedTo = _useState4[0],
|
|
9972
|
+
setTransitionedTo = _useState4[1];
|
|
10367
9973
|
var triggerRequest = function triggerRequest() {
|
|
10368
9974
|
return requestInstance.post(graphApi, {
|
|
10369
9975
|
query: getGraphQuery()
|
|
10370
9976
|
});
|
|
10371
9977
|
};
|
|
10372
|
-
|
|
10373
9978
|
var shoeSizeTypeProps = {
|
|
10374
9979
|
name: 'shoe_size_type',
|
|
10375
9980
|
noWrap: true,
|
|
@@ -10393,15 +9998,12 @@
|
|
|
10393
9998
|
checked: shoeSizeType === shoeSizeTypes.eu.value
|
|
10394
9999
|
}]
|
|
10395
10000
|
};
|
|
10396
|
-
|
|
10397
10001
|
var handlePropOnChange = function handlePropOnChange(value) {
|
|
10398
10002
|
var payload = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
10399
10003
|
shoe_size_type: shoeSizeType
|
|
10400
10004
|
});
|
|
10401
|
-
|
|
10402
10005
|
onChange(payload);
|
|
10403
10006
|
};
|
|
10404
|
-
|
|
10405
10007
|
var renderShoeSizeSelector = function renderShoeSizeSelector() {
|
|
10406
10008
|
var passedShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
10407
10009
|
return /*#__PURE__*/React__default.createElement(ShoeSizeSelector, {
|
|
@@ -10411,38 +10013,32 @@
|
|
|
10411
10013
|
}
|
|
10412
10014
|
});
|
|
10413
10015
|
};
|
|
10414
|
-
|
|
10415
10016
|
var getShoeSizeSelector = function getShoeSizeSelector() {
|
|
10416
10017
|
var euShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
10417
10018
|
var ukShoeShoes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
10418
|
-
|
|
10419
10019
|
if (shoeSizeType === shoeSizeTypes.eu.value) {
|
|
10420
10020
|
return renderShoeSizeSelector(euShoeSizes);
|
|
10421
10021
|
}
|
|
10422
|
-
|
|
10423
10022
|
if (shoeSizeType === shoeSizeTypes.uk.value) {
|
|
10424
10023
|
return renderShoeSizeSelector(ukShoeShoes);
|
|
10425
10024
|
}
|
|
10426
|
-
|
|
10427
10025
|
return null;
|
|
10428
10026
|
};
|
|
10429
|
-
|
|
10430
10027
|
return /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
10431
10028
|
getRequestPromise: triggerRequest
|
|
10432
10029
|
}, /*#__PURE__*/React__default.createElement(TitleWrapper, null, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
10433
10030
|
title: "Shoe Size Range"
|
|
10434
10031
|
}, /*#__PURE__*/React__default.createElement(RadioButtons$1, shoeSizeTypeProps))), /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Consumer, null, function (_ref3) {
|
|
10435
10032
|
var _ref3$data$data = _ref3.data.data,
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10033
|
+
_ref3$data$data$luxit = _ref3$data$data.luxity_eu_shoe_sizes,
|
|
10034
|
+
luxity_eu_shoe_sizes = _ref3$data$data$luxit === void 0 ? [] : _ref3$data$data$luxit,
|
|
10035
|
+
_ref3$data$data$luxit2 = _ref3$data$data.luxity_uk_shoe_sizes,
|
|
10036
|
+
luxity_uk_shoe_sizes = _ref3$data$data$luxit2 === void 0 ? [] : _ref3$data$data$luxit2;
|
|
10440
10037
|
return /*#__PURE__*/React__default.createElement(OpacityTransitionRender, {
|
|
10441
10038
|
shoeSizeType: transitionedTo
|
|
10442
10039
|
}, getShoeSizeSelector(luxity_eu_shoe_sizes, luxity_uk_shoe_sizes));
|
|
10443
10040
|
}));
|
|
10444
10041
|
};
|
|
10445
|
-
|
|
10446
10042
|
WrappedShoeSizeSelector.defaultProps = {
|
|
10447
10043
|
onChange: function onChange() {
|
|
10448
10044
|
return false;
|
|
@@ -10465,7 +10061,6 @@
|
|
|
10465
10061
|
});
|
|
10466
10062
|
|
|
10467
10063
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10468
|
-
|
|
10469
10064
|
var _templateObject$K, _templateObject2$8, _templateObject3$3;
|
|
10470
10065
|
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) {
|
|
10471
10066
|
return props.theme.colors.primary;
|
|
@@ -10484,36 +10079,32 @@
|
|
|
10484
10079
|
}, Content, InputText, function (props) {
|
|
10485
10080
|
return props.theme.colors.ntrlMin;
|
|
10486
10081
|
}, Content);
|
|
10082
|
+
|
|
10487
10083
|
/**
|
|
10488
10084
|
* CheckButton: Styled checkbox that resembles a button
|
|
10489
10085
|
* */
|
|
10490
|
-
|
|
10491
10086
|
var CheckButton = function CheckButton(props) {
|
|
10492
10087
|
var title = props.title,
|
|
10493
|
-
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10088
|
+
checked = props.checked,
|
|
10089
|
+
renderIcon = props.renderIcon,
|
|
10090
|
+
onChange = props.onChange,
|
|
10091
|
+
checkedValue = props.checkedValue,
|
|
10092
|
+
unCheckedValue = props.unCheckedValue,
|
|
10093
|
+
restProps = _objectWithoutProperties(props, _excluded$7);
|
|
10500
10094
|
var _React$useState = React__default.useState(checked),
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10095
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10096
|
+
checkedState = _React$useState2[0],
|
|
10097
|
+
setCheck = _React$useState2[1];
|
|
10505
10098
|
var prevCheckState = functions.usePrevious(checkedState);
|
|
10506
10099
|
React__default.useEffect(function () {
|
|
10507
10100
|
if (prevCheckState !== checkedState) {
|
|
10508
10101
|
onChange(checkedState);
|
|
10509
10102
|
}
|
|
10510
10103
|
}, [checkedState, onChange, prevCheckState]);
|
|
10511
|
-
|
|
10512
10104
|
var handleInputChange = function handleInputChange(e) {
|
|
10513
10105
|
var targetChecked = e.target.checked;
|
|
10514
10106
|
setCheck(targetChecked);
|
|
10515
10107
|
};
|
|
10516
|
-
|
|
10517
10108
|
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
10518
10109
|
defaultChecked: checked
|
|
10519
10110
|
}, restProps, {
|
|
@@ -10521,7 +10112,6 @@
|
|
|
10521
10112
|
onChange: handleInputChange
|
|
10522
10113
|
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
10523
10114
|
};
|
|
10524
|
-
|
|
10525
10115
|
CheckButton.defaultProps = {
|
|
10526
10116
|
title: '',
|
|
10527
10117
|
checked: false,
|
|
@@ -10535,29 +10125,24 @@
|
|
|
10535
10125
|
var CheckButton$1 = themed(CheckButton);
|
|
10536
10126
|
|
|
10537
10127
|
var MALE$1 = genders.MALE,
|
|
10538
|
-
|
|
10539
|
-
|
|
10128
|
+
FEMALE$1 = genders.FEMALE;
|
|
10540
10129
|
/**
|
|
10541
10130
|
* Stylized CheckboxButton for selecting gender
|
|
10542
10131
|
* */
|
|
10543
10132
|
var GenderCheckbox = function GenderCheckbox(_ref) {
|
|
10544
10133
|
var gender = _ref.gender,
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10134
|
+
checked = _ref.checked,
|
|
10135
|
+
onInputChange = _ref.onInputChange;
|
|
10548
10136
|
var getTitle = function getTitle() {
|
|
10549
10137
|
switch (gender) {
|
|
10550
10138
|
case MALE$1:
|
|
10551
10139
|
return 'Male';
|
|
10552
|
-
|
|
10553
10140
|
case FEMALE$1:
|
|
10554
10141
|
return 'Female';
|
|
10555
|
-
|
|
10556
10142
|
default:
|
|
10557
10143
|
return '';
|
|
10558
10144
|
}
|
|
10559
10145
|
};
|
|
10560
|
-
|
|
10561
10146
|
return /*#__PURE__*/React__default.createElement(CheckButton$1, {
|
|
10562
10147
|
onChange: onInputChange,
|
|
10563
10148
|
checked: checked,
|
|
@@ -10565,22 +10150,20 @@
|
|
|
10565
10150
|
title: getTitle()
|
|
10566
10151
|
});
|
|
10567
10152
|
};
|
|
10568
|
-
|
|
10569
10153
|
GenderCheckbox.defaultProps = {
|
|
10570
10154
|
name: ''
|
|
10571
10155
|
};
|
|
10572
10156
|
|
|
10573
10157
|
var MALE$2 = genders.MALE,
|
|
10574
|
-
|
|
10575
|
-
|
|
10158
|
+
FEMALE$2 = genders.FEMALE;
|
|
10576
10159
|
/**
|
|
10577
10160
|
* GenderSelector: specialized selector to pick genders for the Interest Component
|
|
10578
10161
|
* */
|
|
10579
10162
|
var GenderSelector = function GenderSelector(_ref) {
|
|
10580
10163
|
var gender = _ref.gender,
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10164
|
+
onChange = _ref.onChange,
|
|
10165
|
+
maleInputRef = _ref.maleInputRef,
|
|
10166
|
+
femaleInputRef = _ref.femaleInputRef;
|
|
10584
10167
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10585
10168
|
className: "gender-selector"
|
|
10586
10169
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -10605,7 +10188,6 @@
|
|
|
10605
10188
|
checkBoxButtonRef: femaleInputRef
|
|
10606
10189
|
})));
|
|
10607
10190
|
};
|
|
10608
|
-
|
|
10609
10191
|
GenderSelector.defaultProps = {
|
|
10610
10192
|
gender: null,
|
|
10611
10193
|
onChange: function onChange() {
|
|
@@ -10616,15 +10198,13 @@
|
|
|
10616
10198
|
|
|
10617
10199
|
var ConditionSelector = function ConditionSelector(_ref) {
|
|
10618
10200
|
var onChange = _ref.onChange,
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10201
|
+
graphApi = _ref.graphApi,
|
|
10202
|
+
itemRenderer = _ref.itemRenderer,
|
|
10203
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
10204
|
+
requestInstance = _ref.requestInstance;
|
|
10624
10205
|
var resultProcessor = function resultProcessor(result) {
|
|
10625
10206
|
return result.data.data.conditions_list;
|
|
10626
10207
|
};
|
|
10627
|
-
|
|
10628
10208
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10629
10209
|
title: "Condition",
|
|
10630
10210
|
queryId: "getCondition",
|
|
@@ -10641,7 +10221,6 @@
|
|
|
10641
10221
|
requestInstance: requestInstance
|
|
10642
10222
|
});
|
|
10643
10223
|
};
|
|
10644
|
-
|
|
10645
10224
|
ConditionSelector.defaultProps = {
|
|
10646
10225
|
itemRenderer: ItemRenderer
|
|
10647
10226
|
};
|
|
@@ -10680,41 +10259,30 @@
|
|
|
10680
10259
|
request: _objectSpread2({}, request),
|
|
10681
10260
|
isCategoriesShown: false
|
|
10682
10261
|
};
|
|
10262
|
+
|
|
10683
10263
|
/**
|
|
10684
10264
|
* Generates Interest UI and submits graph payloads as a highly specialised component
|
|
10685
10265
|
*/
|
|
10686
|
-
|
|
10687
10266
|
var AddInterest = /*#__PURE__*/function (_React$Component) {
|
|
10688
|
-
_inherits(AddInterest, _React$Component);
|
|
10689
|
-
|
|
10690
|
-
var _super = _createSuper(AddInterest);
|
|
10691
|
-
|
|
10692
10267
|
function AddInterest(props) {
|
|
10693
10268
|
var _this;
|
|
10694
|
-
|
|
10695
10269
|
_classCallCheck(this, AddInterest);
|
|
10696
|
-
|
|
10697
|
-
_this
|
|
10698
|
-
|
|
10699
|
-
_defineProperty(
|
|
10700
|
-
|
|
10701
|
-
_defineProperty(_assertThisInitialized(_this), "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10702
|
-
|
|
10703
|
-
_defineProperty(_assertThisInitialized(_this), "onCategoryChanged", function (categoryType) {
|
|
10270
|
+
_this = _callSuper(this, AddInterest, [props]);
|
|
10271
|
+
_defineProperty(_this, "maleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10272
|
+
_defineProperty(_this, "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10273
|
+
_defineProperty(_this, "onCategoryChanged", function (categoryType) {
|
|
10704
10274
|
_this.setState({
|
|
10705
10275
|
category_type: categoryType,
|
|
10706
10276
|
brands: [],
|
|
10707
10277
|
styles: []
|
|
10708
10278
|
});
|
|
10709
10279
|
});
|
|
10710
|
-
|
|
10711
|
-
_defineProperty(_assertThisInitialized(_this), "onGenderChanged", function (isChecked, gender) {
|
|
10280
|
+
_defineProperty(_this, "onGenderChanged", function (isChecked, gender) {
|
|
10712
10281
|
return _this.setState(function (prevState) {
|
|
10713
10282
|
// current array of options
|
|
10714
10283
|
var gendersSelected = _toConsumableArray(prevState.gender);
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10284
|
+
var index;
|
|
10285
|
+
// check if the check box is checked or unchecked
|
|
10718
10286
|
if (isChecked) {
|
|
10719
10287
|
gendersSelected.push(gender);
|
|
10720
10288
|
} else {
|
|
@@ -10722,76 +10290,65 @@
|
|
|
10722
10290
|
index = gendersSelected.indexOf(gender);
|
|
10723
10291
|
gendersSelected.splice(index, 1);
|
|
10724
10292
|
}
|
|
10725
|
-
|
|
10726
10293
|
return {
|
|
10727
10294
|
gender: gendersSelected
|
|
10728
10295
|
};
|
|
10729
10296
|
});
|
|
10730
10297
|
});
|
|
10731
|
-
|
|
10732
|
-
_defineProperty(_assertThisInitialized(_this), "onBrandsChanged", function (brandsArray) {
|
|
10298
|
+
_defineProperty(_this, "onBrandsChanged", function (brandsArray) {
|
|
10733
10299
|
_this.setState({
|
|
10734
10300
|
brands: brandsArray.map(function (brand) {
|
|
10735
10301
|
return brand.id;
|
|
10736
10302
|
})
|
|
10737
10303
|
});
|
|
10738
10304
|
});
|
|
10739
|
-
|
|
10740
|
-
_defineProperty(_assertThisInitialized(_this), "onShoeSizesChanged", function (shoeSizes) {
|
|
10305
|
+
_defineProperty(_this, "onShoeSizesChanged", function (shoeSizes) {
|
|
10741
10306
|
_this.setState(_objectSpread2({}, shoeSizes));
|
|
10742
10307
|
});
|
|
10743
|
-
|
|
10744
|
-
_defineProperty(_assertThisInitialized(_this), "onPriceRangesChanged", function (priceRange) {
|
|
10308
|
+
_defineProperty(_this, "onPriceRangesChanged", function (priceRange) {
|
|
10745
10309
|
_this.setState(_objectSpread2({}, priceRange));
|
|
10746
10310
|
});
|
|
10747
|
-
|
|
10748
|
-
_defineProperty(_assertThisInitialized(_this), "onStylesChanged", function (stylesArray) {
|
|
10311
|
+
_defineProperty(_this, "onStylesChanged", function (stylesArray) {
|
|
10749
10312
|
_this.setState({
|
|
10750
10313
|
styles: stylesArray.map(function (style) {
|
|
10751
10314
|
return style.id;
|
|
10752
10315
|
})
|
|
10753
10316
|
});
|
|
10754
10317
|
});
|
|
10755
|
-
|
|
10756
|
-
_defineProperty(_assertThisInitialized(_this), "onConditionChanged", function (conditions) {
|
|
10318
|
+
_defineProperty(_this, "onConditionChanged", function (conditions) {
|
|
10757
10319
|
_this.setState({
|
|
10758
10320
|
condition: conditions.map(function (condition) {
|
|
10759
10321
|
return condition.id;
|
|
10760
10322
|
})
|
|
10761
10323
|
});
|
|
10762
10324
|
});
|
|
10763
|
-
|
|
10764
|
-
_defineProperty(_assertThisInitialized(_this), "payloadIsValid", function () {
|
|
10325
|
+
_defineProperty(_this, "payloadIsValid", function () {
|
|
10765
10326
|
// price/shoe-size always have initial values as soon as category is set
|
|
10766
10327
|
var category_type = _this.state.category_type;
|
|
10767
10328
|
return category_type !== null;
|
|
10768
10329
|
});
|
|
10769
|
-
|
|
10770
|
-
_defineProperty(_assertThisInitialized(_this), "submitInterest", function () {
|
|
10330
|
+
_defineProperty(_this, "submitInterest", function () {
|
|
10771
10331
|
_this.setState({
|
|
10772
10332
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10773
10333
|
fetching: true
|
|
10774
10334
|
})
|
|
10775
10335
|
});
|
|
10776
|
-
|
|
10777
10336
|
var _this$state = _this.state,
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10337
|
+
brands = _this$state.brands,
|
|
10338
|
+
min_shoe_size_id = _this$state.min_shoe_size_id,
|
|
10339
|
+
max_shoe_size_id = _this$state.max_shoe_size_id,
|
|
10340
|
+
shoe_size_type = _this$state.shoe_size_type,
|
|
10341
|
+
min_price = _this$state.min_price,
|
|
10342
|
+
max_price = _this$state.max_price,
|
|
10343
|
+
styles = _this$state.styles,
|
|
10344
|
+
category_type = _this$state.category_type,
|
|
10345
|
+
requestState = _this$state.request,
|
|
10346
|
+
gender = _this$state.gender,
|
|
10347
|
+
condition = _this$state.condition;
|
|
10789
10348
|
var payloadGender = gender[0];
|
|
10790
|
-
|
|
10791
10349
|
if (gender.length > 1 || !gender.length) {
|
|
10792
10350
|
payloadGender = UNISEX$1;
|
|
10793
10351
|
}
|
|
10794
|
-
|
|
10795
10352
|
var basePayload = {
|
|
10796
10353
|
category_type: category_type,
|
|
10797
10354
|
brands: brands,
|
|
@@ -10807,27 +10364,21 @@
|
|
|
10807
10364
|
max_shoe_size_id: max_shoe_size_id,
|
|
10808
10365
|
shoe_size_type: shoe_size_type
|
|
10809
10366
|
} : {};
|
|
10810
|
-
|
|
10811
10367
|
var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
|
|
10812
|
-
|
|
10813
10368
|
simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
|
|
10814
10369
|
_this.setState({
|
|
10815
10370
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10816
10371
|
success: true
|
|
10817
10372
|
})
|
|
10818
10373
|
});
|
|
10819
|
-
|
|
10820
10374
|
_this.props.onSubmitSuccess(_objectSpread2({}, payload));
|
|
10821
10375
|
}, _this.handleRequestError);
|
|
10822
10376
|
});
|
|
10823
|
-
|
|
10824
|
-
_defineProperty(_assertThisInitialized(_this), "handleRequestError", function (_ref) {
|
|
10377
|
+
_defineProperty(_this, "handleRequestError", function (_ref) {
|
|
10825
10378
|
var data = _ref.data;
|
|
10826
|
-
|
|
10827
10379
|
_this.setState({
|
|
10828
10380
|
request: _objectSpread2({}, request)
|
|
10829
10381
|
});
|
|
10830
|
-
|
|
10831
10382
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
10832
10383
|
return data[key];
|
|
10833
10384
|
}).flat();
|
|
@@ -10837,37 +10388,32 @@
|
|
|
10837
10388
|
}, message);
|
|
10838
10389
|
}));
|
|
10839
10390
|
});
|
|
10840
|
-
|
|
10841
|
-
_defineProperty(_assertThisInitialized(_this), "resetState", function () {
|
|
10391
|
+
_defineProperty(_this, "resetState", function () {
|
|
10842
10392
|
_this.setState(_objectSpread2({}, defaultState));
|
|
10843
|
-
|
|
10844
10393
|
_this.props.onCancel();
|
|
10845
10394
|
});
|
|
10846
|
-
|
|
10847
|
-
_defineProperty(_assertThisInitialized(_this), "handleGenderChange", function (isChecked, gender) {
|
|
10395
|
+
_defineProperty(_this, "handleGenderChange", function (isChecked, gender) {
|
|
10848
10396
|
return _this.onGenderChanged(isChecked, gender);
|
|
10849
10397
|
});
|
|
10850
|
-
|
|
10851
|
-
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function () {
|
|
10398
|
+
_defineProperty(_this, "onAddInterestClick", function () {
|
|
10852
10399
|
_this.setState(function (prevState) {
|
|
10853
10400
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10854
10401
|
isCategoriesShown: true
|
|
10855
10402
|
});
|
|
10856
10403
|
});
|
|
10857
10404
|
});
|
|
10858
|
-
|
|
10859
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10405
|
+
_defineProperty(_this, "render", function () {
|
|
10860
10406
|
var _this$state2 = _this.state,
|
|
10861
|
-
|
|
10862
|
-
|
|
10407
|
+
category_type = _this$state2.category_type,
|
|
10408
|
+
fetching = _this$state2.request.fetching;
|
|
10863
10409
|
var _this$props = _this.props,
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10410
|
+
requestInstance = _this$props.requestInstance,
|
|
10411
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
10412
|
+
getBrandsGraphQuery = _this$props.getBrandsGraphQuery,
|
|
10413
|
+
getStylesGraphQuery = _this$props.getStylesGraphQuery,
|
|
10414
|
+
getShoesGraphQuery = _this$props.getShoesGraphQuery,
|
|
10415
|
+
defaultShoeSizeType = _this$props.defaultShoeSizeType,
|
|
10416
|
+
getConditionsGraphQuery = _this$props.getConditionsGraphQuery;
|
|
10871
10417
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10872
10418
|
className: "interests__section-wrapper"
|
|
10873
10419
|
}, /*#__PURE__*/React__default.createElement(AddInterestContainer, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(CatSelectorParagraph, null, "Select the category that interests you"), /*#__PURE__*/React__default.createElement(CategoryInterestSelector, {
|
|
@@ -10918,19 +10464,16 @@
|
|
|
10918
10464
|
type: "button",
|
|
10919
10465
|
onClick: function onClick() {
|
|
10920
10466
|
_this.submitInterest();
|
|
10921
|
-
|
|
10922
10467
|
_this.resetState();
|
|
10923
10468
|
}
|
|
10924
10469
|
}, fetching ? 'SAVING' : 'SAVE'))))))));
|
|
10925
10470
|
});
|
|
10926
|
-
|
|
10927
10471
|
_this.state = _objectSpread2({}, defaultState);
|
|
10928
10472
|
return _this;
|
|
10929
10473
|
}
|
|
10930
|
-
|
|
10474
|
+
_inherits(AddInterest, _React$Component);
|
|
10931
10475
|
return _createClass(AddInterest);
|
|
10932
10476
|
}(React__default.Component);
|
|
10933
|
-
|
|
10934
10477
|
var AddInterest$1 = themed(AddInterest);
|
|
10935
10478
|
|
|
10936
10479
|
var _templateObject$M;
|
|
@@ -10941,7 +10484,6 @@
|
|
|
10941
10484
|
}, function (props) {
|
|
10942
10485
|
return props.theme.marginPaddings[1];
|
|
10943
10486
|
}, media.xs);
|
|
10944
|
-
|
|
10945
10487
|
var MyInterestTitleHeading = function MyInterestTitleHeading() {
|
|
10946
10488
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10947
10489
|
className: "interests__title"
|
|
@@ -10963,7 +10505,6 @@
|
|
|
10963
10505
|
className: "heading-title-empty"
|
|
10964
10506
|
})));
|
|
10965
10507
|
};
|
|
10966
|
-
|
|
10967
10508
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
10968
10509
|
|
|
10969
10510
|
var _templateObject$N;
|
|
@@ -10972,7 +10513,6 @@
|
|
|
10972
10513
|
}, function (props) {
|
|
10973
10514
|
return props.theme.marginPaddings[1];
|
|
10974
10515
|
}, media.xs);
|
|
10975
|
-
|
|
10976
10516
|
var MyProductInterestTitleHeading = function MyProductInterestTitleHeading() {
|
|
10977
10517
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10978
10518
|
className: "interests__title"
|
|
@@ -10988,7 +10528,6 @@
|
|
|
10988
10528
|
className: "heading-title-empty"
|
|
10989
10529
|
})));
|
|
10990
10530
|
};
|
|
10991
|
-
|
|
10992
10531
|
var MyProductInterestTitleHeading$1 = themed(MyProductInterestTitleHeading);
|
|
10993
10532
|
|
|
10994
10533
|
var Add = (function (props) {
|
|
@@ -11011,7 +10550,6 @@
|
|
|
11011
10550
|
|
|
11012
10551
|
function getToken() {
|
|
11013
10552
|
var _Cookies$get;
|
|
11014
|
-
|
|
11015
10553
|
return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
|
|
11016
10554
|
}
|
|
11017
10555
|
function setToken(value) {
|
|
@@ -11019,35 +10557,29 @@
|
|
|
11019
10557
|
}
|
|
11020
10558
|
|
|
11021
10559
|
/** @format */
|
|
11022
|
-
|
|
11023
10560
|
function getEncodedSearch(currentUrl) {
|
|
11024
10561
|
var splitUrl = currentUrl.split('?');
|
|
11025
10562
|
var baseUrl = splitUrl[0];
|
|
11026
10563
|
var nextUrlSegments = splitUrl[1].split('&');
|
|
11027
10564
|
var nextQueryString = splitUrl[1];
|
|
11028
|
-
|
|
11029
10565
|
if (nextUrlSegments.length > 0) {
|
|
11030
10566
|
nextQueryString = nextUrlSegments.map(function (v) {
|
|
11031
10567
|
var nextValue = v;
|
|
11032
|
-
|
|
11033
10568
|
if (v.includes('search=')) {
|
|
11034
10569
|
var temp = v.split('=');
|
|
11035
10570
|
nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
|
|
11036
10571
|
}
|
|
11037
|
-
|
|
11038
10572
|
return nextValue;
|
|
11039
10573
|
}).join('&');
|
|
11040
10574
|
}
|
|
11041
|
-
|
|
11042
10575
|
return "".concat(baseUrl, "?").concat(nextQueryString);
|
|
11043
10576
|
}
|
|
10577
|
+
|
|
11044
10578
|
/**
|
|
11045
10579
|
* Gets an instance of Axios that is configured with the custom failure handlers
|
|
11046
10580
|
* @param {Function} onAuthFailed - callback triggers when auth fails - ie, server error is one of ['token_invalid', 'token_not_provided', 'user_not_found', 'token_expired'] or http status is one of [401, 503, 400]
|
|
11047
10581
|
* @param {Function} onForbidden - callback triggers when http status = 403
|
|
11048
10582
|
*/
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
10583
|
var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
|
|
11052
10584
|
var instance = axios.create({
|
|
11053
10585
|
validateStatus: function validateStatus(status) {
|
|
@@ -11055,60 +10587,56 @@
|
|
|
11055
10587
|
}
|
|
11056
10588
|
});
|
|
11057
10589
|
var token = getToken();
|
|
11058
|
-
|
|
11059
10590
|
if (token !== '') {
|
|
11060
10591
|
instance.defaults.headers.common.Authorization = token;
|
|
11061
10592
|
}
|
|
10593
|
+
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
|
|
11062
10594
|
|
|
11063
|
-
|
|
11064
|
-
|
|
10595
|
+
// Add a request interceptor
|
|
11065
10596
|
instance.interceptors.request.use(function (request, error) {
|
|
11066
10597
|
if (error) {
|
|
11067
10598
|
return Promise.reject(error.response);
|
|
11068
10599
|
}
|
|
11069
|
-
|
|
11070
10600
|
if (request.url.includes('search') && request.url.includes('?')) {
|
|
11071
10601
|
// do some uri manipulation for ie
|
|
11072
10602
|
// https://stackoverflow.com/questions/18220057
|
|
10603
|
+
|
|
11073
10604
|
// eslint-disable-next-line no-param-reassign
|
|
11074
10605
|
request.url = getEncodedSearch(request.url);
|
|
11075
|
-
}
|
|
11076
|
-
|
|
10606
|
+
}
|
|
11077
10607
|
|
|
10608
|
+
// eslint-disable-next-line no-param-reassign
|
|
11078
10609
|
request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
|
|
11079
|
-
|
|
11080
10610
|
if (typeof request.body === 'undefined') {
|
|
11081
10611
|
request.body = {};
|
|
11082
10612
|
}
|
|
11083
|
-
|
|
11084
10613
|
token = getToken();
|
|
11085
|
-
|
|
11086
10614
|
if (token !== '') {
|
|
11087
10615
|
// eslint-disable-next-line no-param-reassign
|
|
11088
10616
|
request.headers.common.Authorization = token;
|
|
11089
10617
|
}
|
|
11090
|
-
|
|
11091
10618
|
return request;
|
|
11092
10619
|
}, function (error) {
|
|
11093
10620
|
return Promise.reject(error.message);
|
|
11094
|
-
});
|
|
10621
|
+
});
|
|
11095
10622
|
|
|
10623
|
+
// Add a response interceptor
|
|
11096
10624
|
instance.interceptors.response.use(function (response, error) {
|
|
11097
10625
|
if (error) {
|
|
11098
10626
|
return Promise.reject(error.response);
|
|
11099
10627
|
}
|
|
11100
|
-
|
|
11101
10628
|
if (response.headers.authorization) {
|
|
11102
10629
|
setToken(response.headers.authorization);
|
|
11103
10630
|
}
|
|
11104
|
-
|
|
11105
10631
|
return response;
|
|
11106
10632
|
}, function (error) {
|
|
11107
10633
|
if (error.response) {
|
|
11108
10634
|
// network error
|
|
11109
10635
|
if (error.response.data && error.response.data.error && (error.response.data.error === 'token_invalid' || error.response.data.error === 'token_not_provided' || error.response.data.error === 'user_not_found' || error.response.data.error === 'token_expired') || error.response.status === 401 || error.response.status === 503 || error.response.status === 400) {
|
|
11110
10636
|
onAuthFailed();
|
|
11111
|
-
}
|
|
10637
|
+
}
|
|
10638
|
+
|
|
10639
|
+
// if (error.response.status === 500) {
|
|
11112
10640
|
// // INTERNAL SERVER ERROR
|
|
11113
10641
|
// store.dispatch({
|
|
11114
10642
|
// type: AppConstants.OVERLAY.SERVER_ERROR,
|
|
@@ -11116,39 +10644,34 @@
|
|
|
11116
10644
|
// return Promise.reject(error.response);
|
|
11117
10645
|
// }
|
|
11118
10646
|
|
|
11119
|
-
|
|
11120
10647
|
if (error.response.status === 403) {
|
|
11121
10648
|
// FORBIDDEN
|
|
11122
10649
|
onForbidden();
|
|
11123
10650
|
}
|
|
11124
|
-
|
|
11125
10651
|
return Promise.reject(error.response);
|
|
11126
10652
|
}
|
|
11127
|
-
|
|
11128
10653
|
return Promise.reject(error);
|
|
11129
10654
|
});
|
|
11130
10655
|
return instance;
|
|
11131
|
-
};
|
|
10656
|
+
};
|
|
11132
10657
|
|
|
11133
10658
|
var _excluded$8 = ["children"];
|
|
11134
|
-
|
|
11135
10659
|
var DropdownSelector = function DropdownSelector(_ref) {
|
|
11136
10660
|
var selectedOption = _ref.selectedOption,
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
10661
|
+
onOptionChange = _ref.onOptionChange,
|
|
10662
|
+
options = _ref.options,
|
|
10663
|
+
isSearchable = _ref.isSearchable,
|
|
10664
|
+
placeholder = _ref.placeholder,
|
|
10665
|
+
name = _ref.name,
|
|
10666
|
+
showSearchIcon = _ref.showSearchIcon,
|
|
10667
|
+
isDisabled = _ref.isDisabled;
|
|
11144
10668
|
var customComponents = {
|
|
11145
10669
|
DropdownIndicator: function DropdownIndicator() {
|
|
11146
10670
|
return null;
|
|
11147
10671
|
},
|
|
11148
10672
|
ValueContainer: function ValueContainer(_ref2) {
|
|
11149
10673
|
var children = _ref2.children,
|
|
11150
|
-
|
|
11151
|
-
|
|
10674
|
+
props = _objectWithoutProperties(_ref2, _excluded$8);
|
|
11152
10675
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
11153
10676
|
style: {
|
|
11154
10677
|
position: 'relative'
|
|
@@ -11276,7 +10799,6 @@
|
|
|
11276
10799
|
isDisabled: isDisabled
|
|
11277
10800
|
}));
|
|
11278
10801
|
};
|
|
11279
|
-
|
|
11280
10802
|
DropdownSelector.defaultProps = {
|
|
11281
10803
|
isSearchable: false,
|
|
11282
10804
|
selectedOption: null,
|
|
@@ -11301,178 +10823,144 @@
|
|
|
11301
10823
|
}, function (props) {
|
|
11302
10824
|
return props.theme.marginPaddings[1];
|
|
11303
10825
|
});
|
|
11304
|
-
|
|
11305
10826
|
var AddProductInterest = function AddProductInterest(_ref) {
|
|
11306
10827
|
var baseGraphApi = _ref.baseGraphApi,
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
10828
|
+
getBrandsGraphQuery = _ref.getBrandsGraphQuery,
|
|
10829
|
+
getModelsGraphQuery = _ref.getModelsGraphQuery,
|
|
10830
|
+
getMaterialsGraphQuery = _ref.getMaterialsGraphQuery,
|
|
10831
|
+
onCancel = _ref.onCancel,
|
|
10832
|
+
requestInstance = _ref.requestInstance,
|
|
10833
|
+
addLuxityProductInterestApi = _ref.addLuxityProductInterestApi,
|
|
10834
|
+
onSubmitSuccess = _ref.onSubmitSuccess;
|
|
11315
10835
|
var _useState = React.useState([]),
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
10836
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10837
|
+
brands = _useState2[0],
|
|
10838
|
+
setBrands = _useState2[1];
|
|
11320
10839
|
var _useState3 = React.useState([]),
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
10840
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
10841
|
+
models = _useState4[0],
|
|
10842
|
+
setModels = _useState4[1];
|
|
11325
10843
|
var _useState5 = React.useState([]),
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
10844
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
10845
|
+
materials = _useState6[0],
|
|
10846
|
+
setMaterials = _useState6[1];
|
|
11330
10847
|
var _useState7 = React.useState(null),
|
|
11331
|
-
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
10848
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
10849
|
+
selectedBrand = _useState8[0],
|
|
10850
|
+
setSelectedBrand = _useState8[1];
|
|
11335
10851
|
var _useState9 = React.useState(null),
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
10852
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
10853
|
+
selectedModel = _useState10[0],
|
|
10854
|
+
setSelectedModel = _useState10[1];
|
|
11340
10855
|
var _useState11 = React.useState(null),
|
|
11341
|
-
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
var fetchBrands = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
10856
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
10857
|
+
selectedMaterial = _useState12[0],
|
|
10858
|
+
setSelectedMaterial = _useState12[1];
|
|
10859
|
+
var fetchBrands = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
11346
10860
|
var _response$data, _response$data$data, _response$data$data$l, response, formattedBrands;
|
|
11347
|
-
|
|
11348
10861
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11349
|
-
while (1) {
|
|
11350
|
-
|
|
10862
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10863
|
+
case 0:
|
|
10864
|
+
_context.prev = 0;
|
|
10865
|
+
_context.next = 3;
|
|
10866
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
10867
|
+
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10868
|
+
});
|
|
10869
|
+
case 3:
|
|
10870
|
+
response = _context.sent;
|
|
10871
|
+
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data$data = _response$data.data) !== null && _response$data$data !== void 0 && (_response$data$data$l = _response$data$data.luxity_brands) !== null && _response$data$data$l !== void 0 && _response$data$data$l.data) {
|
|
10872
|
+
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10873
|
+
return {
|
|
10874
|
+
value: brand.id,
|
|
10875
|
+
label: brand.name
|
|
10876
|
+
};
|
|
10877
|
+
});
|
|
10878
|
+
setBrands(formattedBrands);
|
|
10879
|
+
}
|
|
10880
|
+
_context.next = 10;
|
|
10881
|
+
break;
|
|
10882
|
+
case 7:
|
|
10883
|
+
_context.prev = 7;
|
|
10884
|
+
_context.t0 = _context["catch"](0);
|
|
10885
|
+
error(_context.t0.message);
|
|
10886
|
+
case 10:
|
|
10887
|
+
case "end":
|
|
10888
|
+
return _context.stop();
|
|
10889
|
+
}
|
|
10890
|
+
}, _callee, null, [[0, 7]]);
|
|
10891
|
+
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
10892
|
+
var fetchModels = React.useCallback(/*#__PURE__*/function () {
|
|
10893
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
10894
|
+
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
10895
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10896
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
11351
10897
|
case 0:
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=
|
|
11355
|
-
query:
|
|
10898
|
+
_context2.prev = 0;
|
|
10899
|
+
_context2.next = 3;
|
|
10900
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
10901
|
+
query: getModelsGraphQuery(brandId)
|
|
11356
10902
|
});
|
|
11357
|
-
|
|
11358
10903
|
case 3:
|
|
11359
|
-
response =
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10904
|
+
response = _context2.sent;
|
|
10905
|
+
if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && (_response$data2$data = _response$data2.data) !== null && _response$data2$data !== void 0 && (_response$data2$data$ = _response$data2$data.luxity_models) !== null && _response$data2$data$ !== void 0 && _response$data2$data$.data) {
|
|
10906
|
+
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11363
10907
|
return {
|
|
11364
|
-
value:
|
|
11365
|
-
label:
|
|
10908
|
+
value: model.id,
|
|
10909
|
+
label: model.name
|
|
11366
10910
|
};
|
|
11367
10911
|
});
|
|
11368
|
-
|
|
10912
|
+
setModels(formattedModels);
|
|
11369
10913
|
}
|
|
11370
|
-
|
|
11371
|
-
_context.next = 10;
|
|
10914
|
+
_context2.next = 10;
|
|
11372
10915
|
break;
|
|
11373
|
-
|
|
11374
10916
|
case 7:
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
error(
|
|
11378
|
-
|
|
10917
|
+
_context2.prev = 7;
|
|
10918
|
+
_context2.t0 = _context2["catch"](0);
|
|
10919
|
+
error(_context2.t0.message);
|
|
11379
10920
|
case 10:
|
|
11380
10921
|
case "end":
|
|
11381
|
-
return
|
|
11382
|
-
}
|
|
11383
|
-
}
|
|
11384
|
-
}, _callee, null, [[0, 7]]);
|
|
11385
|
-
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
11386
|
-
var fetchModels = React.useCallback( /*#__PURE__*/function () {
|
|
11387
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
11388
|
-
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
11389
|
-
|
|
11390
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11391
|
-
while (1) {
|
|
11392
|
-
switch (_context2.prev = _context2.next) {
|
|
11393
|
-
case 0:
|
|
11394
|
-
_context2.prev = 0;
|
|
11395
|
-
_context2.next = 3;
|
|
11396
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
11397
|
-
query: getModelsGraphQuery(brandId)
|
|
11398
|
-
});
|
|
11399
|
-
|
|
11400
|
-
case 3:
|
|
11401
|
-
response = _context2.sent;
|
|
11402
|
-
|
|
11403
|
-
if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && (_response$data2$data = _response$data2.data) !== null && _response$data2$data !== void 0 && (_response$data2$data$ = _response$data2$data.luxity_models) !== null && _response$data2$data$ !== void 0 && _response$data2$data$.data) {
|
|
11404
|
-
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11405
|
-
return {
|
|
11406
|
-
value: model.id,
|
|
11407
|
-
label: model.name
|
|
11408
|
-
};
|
|
11409
|
-
});
|
|
11410
|
-
setModels(formattedModels);
|
|
11411
|
-
}
|
|
11412
|
-
|
|
11413
|
-
_context2.next = 10;
|
|
11414
|
-
break;
|
|
11415
|
-
|
|
11416
|
-
case 7:
|
|
11417
|
-
_context2.prev = 7;
|
|
11418
|
-
_context2.t0 = _context2["catch"](0);
|
|
11419
|
-
error(_context2.t0.message);
|
|
11420
|
-
|
|
11421
|
-
case 10:
|
|
11422
|
-
case "end":
|
|
11423
|
-
return _context2.stop();
|
|
11424
|
-
}
|
|
10922
|
+
return _context2.stop();
|
|
11425
10923
|
}
|
|
11426
10924
|
}, _callee2, null, [[0, 7]]);
|
|
11427
10925
|
}));
|
|
11428
|
-
|
|
11429
10926
|
return function (_x) {
|
|
11430
10927
|
return _ref3.apply(this, arguments);
|
|
11431
10928
|
};
|
|
11432
10929
|
}(), [baseGraphApi, getModelsGraphQuery]);
|
|
11433
|
-
var fetchMaterials = React.useCallback(
|
|
11434
|
-
var _ref4 = _asyncToGenerator(
|
|
10930
|
+
var fetchMaterials = React.useCallback(/*#__PURE__*/function () {
|
|
10931
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
11435
10932
|
var _response$data3, _response$data3$data, _response$data3$data$, response, formattedMaterials;
|
|
11436
|
-
|
|
11437
10933
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11438
|
-
while (1) {
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
10934
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
10935
|
+
case 0:
|
|
10936
|
+
_context3.prev = 0;
|
|
10937
|
+
_context3.next = 3;
|
|
10938
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getMaterials"), {
|
|
10939
|
+
query: getMaterialsGraphQuery(brandId)
|
|
10940
|
+
});
|
|
10941
|
+
case 3:
|
|
10942
|
+
response = _context3.sent;
|
|
10943
|
+
if (response !== null && response !== void 0 && (_response$data3 = response.data) !== null && _response$data3 !== void 0 && (_response$data3$data = _response$data3.data) !== null && _response$data3$data !== void 0 && (_response$data3$data$ = _response$data3$data.luxity_materials) !== null && _response$data3$data$ !== void 0 && _response$data3$data$.data) {
|
|
10944
|
+
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
10945
|
+
return {
|
|
10946
|
+
value: material.id,
|
|
10947
|
+
label: material.name
|
|
10948
|
+
};
|
|
11445
10949
|
});
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
setMaterials(formattedMaterials);
|
|
11458
|
-
}
|
|
11459
|
-
|
|
11460
|
-
_context3.next = 10;
|
|
11461
|
-
break;
|
|
11462
|
-
|
|
11463
|
-
case 7:
|
|
11464
|
-
_context3.prev = 7;
|
|
11465
|
-
_context3.t0 = _context3["catch"](0);
|
|
11466
|
-
error(_context3.t0.message);
|
|
11467
|
-
|
|
11468
|
-
case 10:
|
|
11469
|
-
case "end":
|
|
11470
|
-
return _context3.stop();
|
|
11471
|
-
}
|
|
10950
|
+
setMaterials(formattedMaterials);
|
|
10951
|
+
}
|
|
10952
|
+
_context3.next = 10;
|
|
10953
|
+
break;
|
|
10954
|
+
case 7:
|
|
10955
|
+
_context3.prev = 7;
|
|
10956
|
+
_context3.t0 = _context3["catch"](0);
|
|
10957
|
+
error(_context3.t0.message);
|
|
10958
|
+
case 10:
|
|
10959
|
+
case "end":
|
|
10960
|
+
return _context3.stop();
|
|
11472
10961
|
}
|
|
11473
10962
|
}, _callee3, null, [[0, 7]]);
|
|
11474
10963
|
}));
|
|
11475
|
-
|
|
11476
10964
|
return function (_x2) {
|
|
11477
10965
|
return _ref4.apply(this, arguments);
|
|
11478
10966
|
};
|
|
@@ -11493,19 +10981,15 @@
|
|
|
11493
10981
|
setSelectedMaterial(null);
|
|
11494
10982
|
}
|
|
11495
10983
|
}, [selectedBrand, fetchModels, fetchMaterials]);
|
|
11496
|
-
|
|
11497
10984
|
var onBrandChange = function onBrandChange(selectedOption) {
|
|
11498
10985
|
setSelectedBrand(selectedOption);
|
|
11499
10986
|
};
|
|
11500
|
-
|
|
11501
10987
|
var onModelChange = function onModelChange(selectedOption) {
|
|
11502
10988
|
setSelectedModel(selectedOption);
|
|
11503
10989
|
};
|
|
11504
|
-
|
|
11505
10990
|
var onMaterialChange = function onMaterialChange(selectedOption) {
|
|
11506
10991
|
setSelectedMaterial(selectedOption);
|
|
11507
10992
|
};
|
|
11508
|
-
|
|
11509
10993
|
var submitInterest = function submitInterest() {
|
|
11510
10994
|
var payload = {
|
|
11511
10995
|
luxity_brand_id: selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.value,
|
|
@@ -11517,7 +11001,6 @@
|
|
|
11517
11001
|
onCancel();
|
|
11518
11002
|
}, handleRequestError);
|
|
11519
11003
|
};
|
|
11520
|
-
|
|
11521
11004
|
var handleRequestError = function handleRequestError(_ref5) {
|
|
11522
11005
|
var data = _ref5.data;
|
|
11523
11006
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
@@ -11529,7 +11012,6 @@
|
|
|
11529
11012
|
}, message);
|
|
11530
11013
|
}));
|
|
11531
11014
|
};
|
|
11532
|
-
|
|
11533
11015
|
var onReset = function onReset() {
|
|
11534
11016
|
onCancel();
|
|
11535
11017
|
setSelectedModel(null);
|
|
@@ -11539,7 +11021,6 @@
|
|
|
11539
11021
|
setMaterials([]);
|
|
11540
11022
|
setModels([]);
|
|
11541
11023
|
};
|
|
11542
|
-
|
|
11543
11024
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
11544
11025
|
className: "interests__section-wrapper"
|
|
11545
11026
|
}, /*#__PURE__*/React__default.createElement(AddInterestContainer$1, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -11587,50 +11068,36 @@
|
|
|
11587
11068
|
onClick: submitInterest
|
|
11588
11069
|
}, "SAVE"))))))));
|
|
11589
11070
|
};
|
|
11590
|
-
|
|
11591
11071
|
var AddProductInterest$1 = themed(AddProductInterest);
|
|
11592
11072
|
|
|
11593
11073
|
var _templateObject$P, _templateObject2$b, _templateObject3$5;
|
|
11594
|
-
|
|
11595
11074
|
var TrashIcon$1 = function TrashIcon(_ref) {
|
|
11596
11075
|
var onClick = _ref.onClick,
|
|
11597
|
-
|
|
11076
|
+
id = _ref.id;
|
|
11598
11077
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11599
11078
|
onClick: onClick,
|
|
11600
11079
|
id: id
|
|
11601
11080
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
11602
11081
|
};
|
|
11603
|
-
|
|
11604
11082
|
var LuxityProductInterestItem = /*#__PURE__*/function (_React$Component) {
|
|
11605
|
-
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11606
|
-
|
|
11607
|
-
var _super = _createSuper(LuxityProductInterestItem);
|
|
11608
|
-
|
|
11609
11083
|
function LuxityProductInterestItem(props) {
|
|
11610
11084
|
var _this;
|
|
11611
|
-
|
|
11612
11085
|
_classCallCheck(this, LuxityProductInterestItem);
|
|
11613
|
-
|
|
11614
|
-
_this
|
|
11615
|
-
|
|
11616
|
-
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
11086
|
+
_this = _callSuper(this, LuxityProductInterestItem, [props]);
|
|
11087
|
+
_defineProperty(_this, "deleteInterestItem", function () {
|
|
11617
11088
|
var id = _this.props.data.id;
|
|
11618
|
-
|
|
11619
11089
|
_this.setState({
|
|
11620
11090
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11621
11091
|
fetching: true
|
|
11622
11092
|
})
|
|
11623
11093
|
});
|
|
11624
|
-
|
|
11625
11094
|
var url = _this.props.deleteInterestApi(id);
|
|
11626
|
-
|
|
11627
11095
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
11628
11096
|
_this.setState({
|
|
11629
11097
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11630
11098
|
success: true
|
|
11631
11099
|
})
|
|
11632
11100
|
});
|
|
11633
|
-
|
|
11634
11101
|
_this.props.onDeleted(_this.props.data);
|
|
11635
11102
|
}, function () {
|
|
11636
11103
|
return _this.setState({
|
|
@@ -11638,10 +11105,8 @@
|
|
|
11638
11105
|
});
|
|
11639
11106
|
});
|
|
11640
11107
|
});
|
|
11641
|
-
|
|
11642
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
11108
|
+
_defineProperty(_this, "render", function () {
|
|
11643
11109
|
var _data$luxity_model, _data$luxity_material;
|
|
11644
|
-
|
|
11645
11110
|
var data = _this.props.data;
|
|
11646
11111
|
var success = _this.state.delete.success;
|
|
11647
11112
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer$1, {
|
|
@@ -11671,16 +11136,14 @@
|
|
|
11671
11136
|
}
|
|
11672
11137
|
}));
|
|
11673
11138
|
});
|
|
11674
|
-
|
|
11675
11139
|
_this.state = {
|
|
11676
11140
|
delete: _objectSpread2({}, request)
|
|
11677
11141
|
};
|
|
11678
11142
|
return _this;
|
|
11679
11143
|
}
|
|
11680
|
-
|
|
11144
|
+
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11681
11145
|
return _createClass(LuxityProductInterestItem);
|
|
11682
11146
|
}(React__default.Component);
|
|
11683
|
-
|
|
11684
11147
|
var InterestItemTitle$1 = styled__default.div(_templateObject$P || (_templateObject$P = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
11685
11148
|
var InterestItemContainer$1 = styled__default.div(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
11686
11149
|
var InterestItemContent$1 = styled__default.div(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n width: 95%;\n height: 100%;\n border: 1px solid ", ";\n padding: 1rem;\n margin-bottom: ", ";\n\n .interest-item__container_heading {\n color: ", ";\n flex-basis: calc(100% / 6);\n margin-top: 0.3rem;\n\n @media (max-width: ", ") {\n display: inline;\n }\n }\n\n .list-items {\n display: inline-flex;\n flex-direction: column;\n\n @media (max-width: ", ") {\n margin-left: ", ";\n }\n }\n\n @media (max-width: ", ") {\n flex-direction: column;\n }\n"])), function (props) {
|
|
@@ -11693,27 +11156,25 @@
|
|
|
11693
11156
|
return props.theme.marginPaddings[0];
|
|
11694
11157
|
}, media.xs);
|
|
11695
11158
|
var ThemedInterestItem$1 = themed(LuxityProductInterestItem);
|
|
11159
|
+
|
|
11696
11160
|
/**
|
|
11697
11161
|
* The Interest Item view shows the selected interest configuration,
|
|
11698
11162
|
* and gives user control to delete it.
|
|
11699
11163
|
*/
|
|
11700
|
-
|
|
11701
11164
|
var LuxityProductInterestItem$1 = (function (props) {
|
|
11702
11165
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem$1, props);
|
|
11703
11166
|
});
|
|
11704
11167
|
|
|
11705
11168
|
var _templateObject$Q, _templateObject2$c;
|
|
11706
11169
|
var AddInterestButtonContainer = styled__default.div(_templateObject$Q || (_templateObject$Q = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n\n #add-icon {\n margin-bottom: 1.5rem;\n\n svg {\n width: 15px;\n }\n }\n"])));
|
|
11707
|
-
|
|
11708
11170
|
var AddIcon = function AddIcon(_ref) {
|
|
11709
11171
|
var onClick = _ref.onClick,
|
|
11710
|
-
|
|
11172
|
+
id = _ref.id;
|
|
11711
11173
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11712
11174
|
id: id,
|
|
11713
11175
|
onClick: onClick
|
|
11714
11176
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Add, null)));
|
|
11715
11177
|
};
|
|
11716
|
-
|
|
11717
11178
|
var AccountIcon = themed(function () {
|
|
11718
11179
|
return /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Account, null));
|
|
11719
11180
|
});
|
|
@@ -11726,50 +11187,39 @@
|
|
|
11726
11187
|
}, function (props) {
|
|
11727
11188
|
return props.theme.marginPaddings[2];
|
|
11728
11189
|
}));
|
|
11729
|
-
|
|
11730
11190
|
/**
|
|
11731
11191
|
* Page/View that controls the viewing and Adding of Luxity Interests
|
|
11732
11192
|
*/
|
|
11733
11193
|
var Interests = /*#__PURE__*/function (_React$Component) {
|
|
11734
|
-
_inherits(Interests, _React$Component);
|
|
11735
|
-
|
|
11736
|
-
var _super = _createSuper(Interests);
|
|
11737
|
-
|
|
11738
11194
|
function Interests(props) {
|
|
11739
11195
|
var _this;
|
|
11740
|
-
|
|
11741
11196
|
_classCallCheck(this, Interests);
|
|
11742
|
-
|
|
11743
|
-
_this
|
|
11744
|
-
|
|
11745
|
-
_defineProperty(
|
|
11746
|
-
|
|
11747
|
-
_defineProperty(_assertThisInitialized(_this), "productInterestType", 'PRODUCT');
|
|
11748
|
-
|
|
11749
|
-
_defineProperty(_assertThisInitialized(_this), "setInterests", function (data) {
|
|
11197
|
+
_this = _callSuper(this, Interests, [props]);
|
|
11198
|
+
_defineProperty(_this, "categoryInterestType", 'CATEGORY');
|
|
11199
|
+
_defineProperty(_this, "productInterestType", 'PRODUCT');
|
|
11200
|
+
_defineProperty(_this, "setInterests", function (data) {
|
|
11750
11201
|
var _data$data$data = data.data.data,
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11202
|
+
interests = _data$data$data.interests.data,
|
|
11203
|
+
luxity_product_interests = _data$data$data.luxity_product_interests.data;
|
|
11754
11204
|
_this.setState({
|
|
11755
11205
|
interests: interests,
|
|
11756
11206
|
luxity_product_interests: luxity_product_interests
|
|
11757
11207
|
});
|
|
11758
11208
|
});
|
|
11759
|
-
|
|
11760
|
-
_defineProperty(
|
|
11209
|
+
// eslint-disable-next-line
|
|
11210
|
+
_defineProperty(_this, "onInterestSubmitSuccess", function (interestItem) {
|
|
11761
11211
|
// due to the fact that we dont get the Interest payload back - we have to re-request the list
|
|
11762
11212
|
_this.triggerInterestRequest().then(function (res) {
|
|
11763
11213
|
return _this.setInterests(res);
|
|
11764
|
-
});
|
|
11214
|
+
});
|
|
11215
|
+
|
|
11216
|
+
// UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11765
11217
|
// this.setState(prevState => {
|
|
11766
11218
|
// const newInterests = [interestItem].concat(prevState.interests);
|
|
11767
11219
|
// return { ...prevState, interests: newInterests };
|
|
11768
11220
|
// });
|
|
11769
|
-
|
|
11770
11221
|
});
|
|
11771
|
-
|
|
11772
|
-
_defineProperty(_assertThisInitialized(_this), "onDeleteInterest", function (deletedItem) {
|
|
11222
|
+
_defineProperty(_this, "onDeleteInterest", function (deletedItem) {
|
|
11773
11223
|
_this.setState(function (prevState) {
|
|
11774
11224
|
var newInterests = prevState.interests.filter(function (item) {
|
|
11775
11225
|
return item.id !== deletedItem.id;
|
|
@@ -11779,8 +11229,7 @@
|
|
|
11779
11229
|
});
|
|
11780
11230
|
});
|
|
11781
11231
|
});
|
|
11782
|
-
|
|
11783
|
-
_defineProperty(_assertThisInitialized(_this), "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11232
|
+
_defineProperty(_this, "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11784
11233
|
_this.setState(function (prevState) {
|
|
11785
11234
|
var newLuxityProductInterests = prevState.luxity_product_interests.filter(function (item) {
|
|
11786
11235
|
return item.id !== deleteItem.id;
|
|
@@ -11790,29 +11239,25 @@
|
|
|
11790
11239
|
});
|
|
11791
11240
|
});
|
|
11792
11241
|
});
|
|
11793
|
-
|
|
11794
|
-
_defineProperty(_assertThisInitialized(_this), "triggerInterestRequest", function () {
|
|
11242
|
+
_defineProperty(_this, "triggerInterestRequest", function () {
|
|
11795
11243
|
var _this$props = _this.props,
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11244
|
+
requestInstance = _this$props.requestInstance,
|
|
11245
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
11246
|
+
interestQuery = _this$props.interestQuery;
|
|
11799
11247
|
return requestInstance.post("".concat(baseGraphApi, "?id=getInterests"), {
|
|
11800
11248
|
query: interestQuery
|
|
11801
11249
|
});
|
|
11802
11250
|
});
|
|
11803
|
-
|
|
11804
|
-
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function (interestType) {
|
|
11251
|
+
_defineProperty(_this, "onAddInterestClick", function (interestType) {
|
|
11805
11252
|
_this.setState({
|
|
11806
11253
|
interestType: interestType
|
|
11807
11254
|
});
|
|
11808
11255
|
});
|
|
11809
|
-
|
|
11810
|
-
_defineProperty(_assertThisInitialized(_this), "onCancel", function () {
|
|
11256
|
+
_defineProperty(_this, "onCancel", function () {
|
|
11811
11257
|
_this.setState({
|
|
11812
11258
|
interestType: null
|
|
11813
11259
|
});
|
|
11814
11260
|
});
|
|
11815
|
-
|
|
11816
11261
|
_this.state = {
|
|
11817
11262
|
interests: [],
|
|
11818
11263
|
luxity_product_interests: [],
|
|
@@ -11820,32 +11265,31 @@
|
|
|
11820
11265
|
};
|
|
11821
11266
|
return _this;
|
|
11822
11267
|
}
|
|
11823
|
-
|
|
11824
|
-
_createClass(Interests, [{
|
|
11268
|
+
_inherits(Interests, _React$Component);
|
|
11269
|
+
return _createClass(Interests, [{
|
|
11825
11270
|
key: "render",
|
|
11826
11271
|
value: function render() {
|
|
11827
11272
|
var _this2 = this;
|
|
11828
|
-
|
|
11829
11273
|
var _this$state = this.state,
|
|
11830
|
-
|
|
11831
|
-
|
|
11274
|
+
interests = _this$state.interests,
|
|
11275
|
+
luxity_product_interests = _this$state.luxity_product_interests;
|
|
11832
11276
|
var _this$props2 = this.props,
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11277
|
+
addInterestApi = _this$props2.addInterestApi,
|
|
11278
|
+
requestInstance = _this$props2.requestInstance,
|
|
11279
|
+
baseGraphApi = _this$props2.baseGraphApi,
|
|
11280
|
+
getBrandsGraphQuery = _this$props2.getBrandsGraphQuery,
|
|
11281
|
+
getStylesGraphQuery = _this$props2.getStylesGraphQuery,
|
|
11282
|
+
getShoesGraphQuery = _this$props2.getShoesGraphQuery,
|
|
11283
|
+
deleteInterestApi = _this$props2.deleteInterestApi,
|
|
11284
|
+
setSchedule = _this$props2.setSchedule,
|
|
11285
|
+
getSchedule = _this$props2.getSchedule,
|
|
11286
|
+
interestsTitle = _this$props2.interestsTitle,
|
|
11287
|
+
defaultShoeSizeType = _this$props2.defaultShoeSizeType,
|
|
11288
|
+
getMaterialsGraphQuery = _this$props2.getMaterialsGraphQuery,
|
|
11289
|
+
getModelsGraphQuery = _this$props2.getModelsGraphQuery,
|
|
11290
|
+
addLuxityProductInterestApi = _this$props2.addLuxityProductInterestApi,
|
|
11291
|
+
deleteLuxityProductInterestApi = _this$props2.deleteLuxityProductInterestApi,
|
|
11292
|
+
getConditionsGraphQuery = _this$props2.getConditionsGraphQuery;
|
|
11849
11293
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
11850
11294
|
className: "interests"
|
|
11851
11295
|
}, /*#__PURE__*/React__default.createElement(Notifications__default, {
|
|
@@ -11934,10 +11378,7 @@
|
|
|
11934
11378
|
}))));
|
|
11935
11379
|
}
|
|
11936
11380
|
}]);
|
|
11937
|
-
|
|
11938
|
-
return Interests;
|
|
11939
11381
|
}(React__default.Component);
|
|
11940
|
-
|
|
11941
11382
|
Interests.defaultProps = {
|
|
11942
11383
|
interestsTitle: 'Interests',
|
|
11943
11384
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|
|
@@ -12258,63 +11699,49 @@
|
|
|
12258
11699
|
}, function (props) {
|
|
12259
11700
|
return props.theme.colors.ntrlMin;
|
|
12260
11701
|
});
|
|
11702
|
+
|
|
12261
11703
|
/**
|
|
12262
11704
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
12263
11705
|
*/
|
|
12264
|
-
|
|
12265
11706
|
var GraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
12266
|
-
_inherits(GraphQLDropdownSelector, _React$Component);
|
|
12267
|
-
|
|
12268
|
-
var _super = _createSuper(GraphQLDropdownSelector);
|
|
12269
|
-
|
|
12270
11707
|
function GraphQLDropdownSelector(props) {
|
|
12271
11708
|
var _this;
|
|
12272
|
-
|
|
12273
11709
|
_classCallCheck(this, GraphQLDropdownSelector);
|
|
12274
|
-
|
|
12275
|
-
_this
|
|
12276
|
-
|
|
12277
|
-
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
11710
|
+
_this = _callSuper(this, GraphQLDropdownSelector, [props]);
|
|
11711
|
+
_defineProperty(_this, "componentDidUpdate", function (prevProps) {
|
|
12278
11712
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
12279
11713
|
_this.makeRequest();
|
|
12280
11714
|
}
|
|
12281
11715
|
});
|
|
12282
|
-
|
|
12283
|
-
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
11716
|
+
_defineProperty(_this, "makeRequest", function () {
|
|
12284
11717
|
_this.pageReady.refreshPage();
|
|
12285
11718
|
});
|
|
12286
|
-
|
|
12287
|
-
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
11719
|
+
_defineProperty(_this, "emptySelected", function () {
|
|
12288
11720
|
return _this.setState({
|
|
12289
11721
|
selected: [ALL_ITEM$1]
|
|
12290
11722
|
});
|
|
12291
11723
|
});
|
|
12292
|
-
|
|
12293
|
-
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
11724
|
+
_defineProperty(_this, "setNewResults", function (res) {
|
|
12294
11725
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
12295
11726
|
return sel.value;
|
|
12296
11727
|
});
|
|
12297
|
-
|
|
12298
11728
|
var pagination = _this.props.resultProcessor(res);
|
|
12299
|
-
|
|
12300
11729
|
var allSelected = _this.state.selected.some(function (item) {
|
|
12301
11730
|
return item.value === ALL_ITEM$1.value;
|
|
12302
11731
|
});
|
|
12303
|
-
|
|
12304
11732
|
var newList = pagination.filter(function (newItem) {
|
|
12305
11733
|
return !selectedIds.includes(newItem.value);
|
|
12306
11734
|
});
|
|
12307
|
-
newList = allSelected ? newList : [ALL_ITEM$1].concat(_toConsumableArray(newList));
|
|
11735
|
+
newList = allSelected ? newList : [ALL_ITEM$1].concat(_toConsumableArray(newList));
|
|
12308
11736
|
|
|
11737
|
+
// eslint-disable-next-line react/no-unused-state
|
|
12309
11738
|
_this.setState({
|
|
12310
11739
|
list: newList,
|
|
12311
11740
|
pagination: pagination
|
|
12312
11741
|
});
|
|
12313
11742
|
});
|
|
12314
|
-
|
|
12315
|
-
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
11743
|
+
_defineProperty(_this, "onAddItem", function (addSelectedItem) {
|
|
12316
11744
|
var newSelectedList;
|
|
12317
|
-
|
|
12318
11745
|
if (addSelectedItem.includes(ALL_ITEM$1)) {
|
|
12319
11746
|
newSelectedList = [ALL_ITEM$1];
|
|
12320
11747
|
} else {
|
|
@@ -12322,7 +11749,6 @@
|
|
|
12322
11749
|
return item.value !== ALL_ITEM$1.value;
|
|
12323
11750
|
});
|
|
12324
11751
|
}
|
|
12325
|
-
|
|
12326
11752
|
_this.setState(function (prevState) {
|
|
12327
11753
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
12328
11754
|
selected: newSelectedList
|
|
@@ -12333,19 +11759,17 @@
|
|
|
12333
11759
|
}));
|
|
12334
11760
|
});
|
|
12335
11761
|
});
|
|
12336
|
-
|
|
12337
|
-
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
11762
|
+
_defineProperty(_this, "onIsLoading", function (flag) {
|
|
12338
11763
|
_this.setState({
|
|
12339
11764
|
isLoading: flag
|
|
12340
11765
|
});
|
|
12341
11766
|
});
|
|
12342
|
-
|
|
12343
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
11767
|
+
_defineProperty(_this, "render", function () {
|
|
12344
11768
|
var _this$props = _this.props,
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
11769
|
+
baseClass = _this$props.baseClass,
|
|
11770
|
+
identifier = _this$props.identifier,
|
|
11771
|
+
triggerRequest = _this$props.triggerRequest,
|
|
11772
|
+
className = _this$props.className;
|
|
12349
11773
|
var list = _this.state.list;
|
|
12350
11774
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector$1, null, /*#__PURE__*/React__default.createElement("div", {
|
|
12351
11775
|
"data-qe-id": identifier,
|
|
@@ -12370,7 +11794,6 @@
|
|
|
12370
11794
|
isSearchable: true
|
|
12371
11795
|
}))));
|
|
12372
11796
|
});
|
|
12373
|
-
|
|
12374
11797
|
_this.state = {
|
|
12375
11798
|
selected: [ALL_ITEM$1],
|
|
12376
11799
|
list: [],
|
|
@@ -12379,10 +11802,9 @@
|
|
|
12379
11802
|
};
|
|
12380
11803
|
return _this;
|
|
12381
11804
|
}
|
|
12382
|
-
|
|
11805
|
+
_inherits(GraphQLDropdownSelector, _React$Component);
|
|
12383
11806
|
return _createClass(GraphQLDropdownSelector);
|
|
12384
11807
|
}(React__default.Component);
|
|
12385
|
-
|
|
12386
11808
|
GraphQLDropdownSelector.defaultProps = {
|
|
12387
11809
|
baseClass: 'multiselector'
|
|
12388
11810
|
};
|
|
@@ -12392,43 +11814,33 @@
|
|
|
12392
11814
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
12393
11815
|
*/
|
|
12394
11816
|
var LuxityGraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
12395
|
-
_inherits(LuxityGraphQLDropdownSelector, _React$Component);
|
|
12396
|
-
|
|
12397
|
-
var _super = _createSuper(LuxityGraphQLDropdownSelector);
|
|
12398
|
-
|
|
12399
11817
|
function LuxityGraphQLDropdownSelector(props) {
|
|
12400
11818
|
var _this;
|
|
12401
|
-
|
|
12402
11819
|
_classCallCheck(this, LuxityGraphQLDropdownSelector);
|
|
12403
|
-
|
|
12404
|
-
_this
|
|
12405
|
-
|
|
12406
|
-
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
12407
|
-
|
|
12408
|
-
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
11820
|
+
_this = _callSuper(this, LuxityGraphQLDropdownSelector, [props]);
|
|
11821
|
+
_defineProperty(_this, "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
11822
|
+
_defineProperty(_this, "increaseLimit", function () {
|
|
12409
11823
|
_this.setState(function (prevState) {
|
|
12410
11824
|
return {
|
|
12411
11825
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
12412
11826
|
};
|
|
12413
11827
|
});
|
|
12414
11828
|
});
|
|
12415
|
-
|
|
12416
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
11829
|
+
_defineProperty(_this, "onChange", function (selection) {
|
|
12417
11830
|
_this.props.onChange(selection);
|
|
12418
11831
|
});
|
|
12419
|
-
|
|
12420
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
11832
|
+
_defineProperty(_this, "render", function () {
|
|
12421
11833
|
var _this$state = _this.state,
|
|
12422
|
-
|
|
12423
|
-
|
|
11834
|
+
limit = _this$state.limit,
|
|
11835
|
+
query_arguments = _this$state.query_arguments;
|
|
12424
11836
|
var _this$props = _this.props,
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
|
|
12428
|
-
|
|
12429
|
-
|
|
12430
|
-
|
|
12431
|
-
|
|
11837
|
+
title = _this$props.title,
|
|
11838
|
+
baseClass = _this$props.baseClass,
|
|
11839
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
11840
|
+
resultProcessor = _this$props.resultProcessor,
|
|
11841
|
+
graphApi = _this$props.graphApi,
|
|
11842
|
+
identifier = _this$props.identifier,
|
|
11843
|
+
requestInstance = _this$props.requestInstance;
|
|
12432
11844
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
12433
11845
|
className: baseClass
|
|
12434
11846
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -12447,19 +11859,17 @@
|
|
|
12447
11859
|
resultProcessor: resultProcessor
|
|
12448
11860
|
})));
|
|
12449
11861
|
});
|
|
12450
|
-
|
|
12451
11862
|
_this.state = {
|
|
12452
11863
|
limit: props.baseQueryLimit,
|
|
12453
11864
|
query_arguments: props.query_arguments
|
|
12454
11865
|
};
|
|
12455
11866
|
return _this;
|
|
12456
11867
|
}
|
|
12457
|
-
|
|
12458
|
-
_createClass(LuxityGraphQLDropdownSelector, [{
|
|
11868
|
+
_inherits(LuxityGraphQLDropdownSelector, _React$Component);
|
|
11869
|
+
return _createClass(LuxityGraphQLDropdownSelector, [{
|
|
12459
11870
|
key: "componentDidUpdate",
|
|
12460
11871
|
value: function componentDidUpdate(prevProps) {
|
|
12461
11872
|
var _this$multiSelectorRe;
|
|
12462
|
-
|
|
12463
11873
|
if (prevProps.query_arguments !== this.props.query_arguments && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
12464
11874
|
this.multiSelectorRef.current.emptySelected();
|
|
12465
11875
|
}
|
|
@@ -12472,14 +11882,10 @@
|
|
|
12472
11882
|
query_arguments: props.query_arguments
|
|
12473
11883
|
};
|
|
12474
11884
|
}
|
|
12475
|
-
|
|
12476
11885
|
return null;
|
|
12477
11886
|
}
|
|
12478
11887
|
}]);
|
|
12479
|
-
|
|
12480
|
-
return LuxityGraphQLDropdownSelector;
|
|
12481
11888
|
}(React__default.Component);
|
|
12482
|
-
|
|
12483
11889
|
LuxityGraphQLDropdownSelector.defaultProps = {
|
|
12484
11890
|
baseClass: '',
|
|
12485
11891
|
searchPlaceHolder: '',
|
|
@@ -12489,11 +11895,11 @@
|
|
|
12489
11895
|
|
|
12490
11896
|
var MaterialSelector = function MaterialSelector(_ref) {
|
|
12491
11897
|
var onChange = _ref.onChange,
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12495
|
-
|
|
12496
|
-
|
|
11898
|
+
brands = _ref.brands,
|
|
11899
|
+
graphApi = _ref.graphApi,
|
|
11900
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
11901
|
+
resultProcessor = _ref.resultProcessor,
|
|
11902
|
+
requestInstance = _ref.requestInstance;
|
|
12497
11903
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLDropdownSelector, {
|
|
12498
11904
|
baseQueryLimit: 1000,
|
|
12499
11905
|
title: "Materials",
|
|
@@ -12508,12 +11914,11 @@
|
|
|
12508
11914
|
requestInstance: requestInstance
|
|
12509
11915
|
});
|
|
12510
11916
|
};
|
|
12511
|
-
|
|
12512
11917
|
MaterialSelector.defaultProps = {
|
|
12513
11918
|
resultProcessor: function resultProcessor(result) {
|
|
12514
11919
|
return result.data.data.luxity_materials.data.map(function (_ref2) {
|
|
12515
11920
|
var id = _ref2.id,
|
|
12516
|
-
|
|
11921
|
+
name = _ref2.name;
|
|
12517
11922
|
return {
|
|
12518
11923
|
label: name,
|
|
12519
11924
|
value: id
|