@bonlineza/luxity-lib 2.36.1-beta.4 → 2.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +116 -76
- package/AddInterest.js +777 -440
- package/AddProductInterest.js +644 -485
- package/BrandSelector.js +336 -176
- package/Checkbox.js +101 -68
- package/CheckboxButton.js +124 -79
- package/CommunicationPreferenceOptionsRenderer.js +169 -159
- package/CommunicationPreferenceSection.js +178 -166
- package/CommunicationPreferences.js +427 -549
- package/ConditionSelector.js +336 -174
- package/CountryCodeSelect.js +10 -7
- package/CurrencyInputFormatter.js +56 -29
- package/CurrencySelect.js +49 -23
- package/DropdownSelector.js +92 -68
- package/GALink.js +16 -6
- package/GenderSelector.js +142 -88
- package/GraphQLDropdownSelector.js +1511 -933
- package/GraphQLMultiSelector.js +274 -141
- package/IconHeader.js +25 -11
- package/IconWrapper.js +7 -3
- package/InterestCatSelector.js +74 -34
- package/InterestItem.js +187 -103
- package/Interests.js +1466 -917
- package/InterestsSubheading.js +10 -5
- package/InvertedTextButton.js +63 -27
- package/LuxityAppSideNav.js +22 -19
- package/LuxityDesktopHeader.js +663 -549
- package/LuxityFooter.js +325 -434
- package/LuxityGraphQLDropdownSelector.js +1543 -949
- package/LuxityGraphQLMultiselector.js +321 -167
- package/LuxityMobileHeader.js +807 -681
- package/LuxityPageReady.js +136 -74
- package/LuxityProductInterestItem.js +175 -97
- package/LuxitySideNav.js +310 -382
- package/MaterialSelector.js +1550 -955
- package/ModelSelector.js +1550 -955
- package/NotificationDropDown.js +221 -122
- package/Notify.js +1 -0
- package/OutlinePrimaryButton.js +58 -26
- package/PriceRangeSelector.js +281 -168
- package/PrimaryButton.js +58 -26
- package/RadioButtons.js +140 -114
- package/RangeSlider.js +242 -152
- package/RareStepFooter.js +41 -27
- package/RareStepHeader.js +190 -139
- package/ReactSelectWrapper.js +1 -0
- package/SecondaryButton.js +58 -26
- package/ShoeSizeRangeSelector.js +260 -162
- package/ShoeSizeSelector.js +263 -158
- package/SimpleErrorBoundary.js +106 -59
- package/StyleSelector.js +336 -176
- package/TextButton.js +58 -26
- package/Tooltip.js +39 -17
- package/Tracking.js +1 -0
- package/WrapperButton.js +43 -20
- package/build/bundle.css +1 -1
- package/build/bundle.js +2973 -2457
- package/package.json +2 -3
- package/svg/Accessories.js +13 -6
- package/svg/Account.js +13 -6
- package/svg/Add.js +13 -6
- package/svg/ArrowRight.js +13 -6
- package/svg/Bags.js +13 -6
- package/svg/BurgerMenu.js +13 -6
- package/svg/Calendar.js +13 -6
- package/svg/CalendarCircled.js +13 -6
- package/svg/CheckCircled.js +13 -6
- package/svg/Close.js +13 -6
- package/svg/Clothing.js +13 -6
- package/svg/Dot.js +13 -6
- package/svg/Edit.js +13 -6
- package/svg/Eye.js +13 -6
- package/svg/FileAttach.js +13 -6
- package/svg/FileAttachCircled.js +13 -6
- package/svg/LightBulb.js +13 -6
- package/svg/Logo.js +13 -6
- package/svg/LuxityMenu.js +13 -6
- package/svg/Minus.js +13 -6
- package/svg/MobileAvatar.js +13 -6
- package/svg/MyOrder.js +13 -6
- package/svg/MyPayment.js +13 -6
- package/svg/MyProfile.js +14 -8
- package/svg/MySale.js +13 -6
- package/svg/Notification.js +13 -6
- package/svg/PointerDown.js +13 -6
- package/svg/Search.js +13 -6
- package/svg/Shoes.js +13 -6
- package/svg/SvgWrapper.js +7 -3
- package/svg/Trash.js +13 -6
- package/svg/Watches.js +13 -6
package/Interests.js
CHANGED
|
@@ -17,540 +17,694 @@
|
|
|
17
17
|
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
18
18
|
Cookies = Cookies && Object.prototype.hasOwnProperty.call(Cookies, 'default') ? Cookies['default'] : Cookies;
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return n;
|
|
24
|
-
}
|
|
25
|
-
function _arrayWithHoles(r) {
|
|
26
|
-
if (Array.isArray(r)) return r;
|
|
27
|
-
}
|
|
28
|
-
function _arrayWithoutHoles(r) {
|
|
29
|
-
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
30
|
-
}
|
|
31
|
-
function _assertThisInitialized(e) {
|
|
32
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
33
|
-
return e;
|
|
34
|
-
}
|
|
35
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
36
|
-
try {
|
|
37
|
-
var i = n[a](c),
|
|
38
|
-
u = i.value;
|
|
39
|
-
} catch (n) {
|
|
40
|
-
return void e(n);
|
|
41
|
-
}
|
|
42
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
43
|
-
}
|
|
44
|
-
function _asyncToGenerator(n) {
|
|
45
|
-
return function () {
|
|
46
|
-
var t = this,
|
|
47
|
-
e = arguments;
|
|
48
|
-
return new Promise(function (r, o) {
|
|
49
|
-
var a = n.apply(t, e);
|
|
50
|
-
function _next(n) {
|
|
51
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
52
|
-
}
|
|
53
|
-
function _throw(n) {
|
|
54
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
55
|
-
}
|
|
56
|
-
_next(void 0);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function _callSuper(t, o, e) {
|
|
61
|
-
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
62
|
-
}
|
|
63
|
-
function _classCallCheck(a, n) {
|
|
64
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
65
|
-
}
|
|
66
|
-
function _defineProperties(e, r) {
|
|
67
|
-
for (var t = 0; t < r.length; t++) {
|
|
68
|
-
var o = r[t];
|
|
69
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function _createClass(e, r, t) {
|
|
73
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
74
|
-
writable: !1
|
|
75
|
-
}), e;
|
|
76
|
-
}
|
|
77
|
-
function _defineProperty(e, r, t) {
|
|
78
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
79
|
-
value: t,
|
|
80
|
-
enumerable: !0,
|
|
81
|
-
configurable: !0,
|
|
82
|
-
writable: !0
|
|
83
|
-
}) : e[r] = t, e;
|
|
84
|
-
}
|
|
85
|
-
function _extends() {
|
|
86
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
87
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
88
|
-
var t = arguments[e];
|
|
89
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
90
|
-
}
|
|
91
|
-
return n;
|
|
92
|
-
}, _extends.apply(null, arguments);
|
|
93
|
-
}
|
|
94
|
-
function _getPrototypeOf(t) {
|
|
95
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
96
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
97
|
-
}, _getPrototypeOf(t);
|
|
98
|
-
}
|
|
99
|
-
function _inherits(t, e) {
|
|
100
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
101
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
102
|
-
constructor: {
|
|
103
|
-
value: t,
|
|
104
|
-
writable: !0,
|
|
105
|
-
configurable: !0
|
|
106
|
-
}
|
|
107
|
-
}), Object.defineProperty(t, "prototype", {
|
|
108
|
-
writable: !1
|
|
109
|
-
}), e && _setPrototypeOf(t, e);
|
|
110
|
-
}
|
|
111
|
-
function _isNativeReflectConstruct() {
|
|
112
|
-
try {
|
|
113
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
114
|
-
} catch (t) {}
|
|
115
|
-
return (_isNativeReflectConstruct = function () {
|
|
116
|
-
return !!t;
|
|
117
|
-
})();
|
|
118
|
-
}
|
|
119
|
-
function _iterableToArray(r) {
|
|
120
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
121
|
-
}
|
|
122
|
-
function _iterableToArrayLimit(r, l) {
|
|
123
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
124
|
-
if (null != t) {
|
|
125
|
-
var e,
|
|
126
|
-
n,
|
|
127
|
-
i,
|
|
128
|
-
u,
|
|
129
|
-
a = [],
|
|
130
|
-
f = !0,
|
|
131
|
-
o = !1;
|
|
132
|
-
try {
|
|
133
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
134
|
-
if (Object(t) !== t) return;
|
|
135
|
-
f = !1;
|
|
136
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
137
|
-
} catch (r) {
|
|
138
|
-
o = !0, n = r;
|
|
139
|
-
} finally {
|
|
140
|
-
try {
|
|
141
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
142
|
-
} finally {
|
|
143
|
-
if (o) throw n;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return a;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function _nonIterableRest() {
|
|
150
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
151
|
-
}
|
|
152
|
-
function _nonIterableSpread() {
|
|
153
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
154
|
-
}
|
|
155
|
-
function ownKeys(e, r) {
|
|
156
|
-
var t = Object.keys(e);
|
|
20
|
+
function ownKeys(object, enumerableOnly) {
|
|
21
|
+
var keys = Object.keys(object);
|
|
22
|
+
|
|
157
23
|
if (Object.getOwnPropertySymbols) {
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
return Object.getOwnPropertyDescriptor(
|
|
161
|
-
})),
|
|
24
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
25
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
26
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
27
|
+
})), keys.push.apply(keys, symbols);
|
|
162
28
|
}
|
|
163
|
-
|
|
29
|
+
|
|
30
|
+
return keys;
|
|
164
31
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
32
|
+
|
|
33
|
+
function _objectSpread2(target) {
|
|
34
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
35
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
36
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
37
|
+
_defineProperty(target, key, source[key]);
|
|
38
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
39
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
172
40
|
});
|
|
173
41
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
function _objectWithoutProperties(e, t) {
|
|
177
|
-
if (null == e) return {};
|
|
178
|
-
var o,
|
|
179
|
-
r,
|
|
180
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
181
|
-
if (Object.getOwnPropertySymbols) {
|
|
182
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
183
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
184
|
-
}
|
|
185
|
-
return i;
|
|
186
|
-
}
|
|
187
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
188
|
-
if (null == r) return {};
|
|
189
|
-
var t = {};
|
|
190
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
191
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
192
|
-
t[n] = r[n];
|
|
193
|
-
}
|
|
194
|
-
return t;
|
|
195
|
-
}
|
|
196
|
-
function _possibleConstructorReturn(t, e) {
|
|
197
|
-
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
198
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
199
|
-
return _assertThisInitialized(t);
|
|
42
|
+
|
|
43
|
+
return target;
|
|
200
44
|
}
|
|
45
|
+
|
|
201
46
|
function _regeneratorRuntime() {
|
|
47
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
48
|
+
|
|
202
49
|
_regeneratorRuntime = function () {
|
|
203
|
-
return
|
|
50
|
+
return exports;
|
|
204
51
|
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return Object.defineProperty(t, e, {
|
|
218
|
-
value: r,
|
|
52
|
+
|
|
53
|
+
var exports = {},
|
|
54
|
+
Op = Object.prototype,
|
|
55
|
+
hasOwn = Op.hasOwnProperty,
|
|
56
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
57
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
58
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
59
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
60
|
+
|
|
61
|
+
function define(obj, key, value) {
|
|
62
|
+
return Object.defineProperty(obj, key, {
|
|
63
|
+
value: value,
|
|
219
64
|
enumerable: !0,
|
|
220
65
|
configurable: !0,
|
|
221
66
|
writable: !0
|
|
222
|
-
}),
|
|
67
|
+
}), obj[key];
|
|
223
68
|
}
|
|
69
|
+
|
|
224
70
|
try {
|
|
225
71
|
define({}, "");
|
|
226
|
-
} catch (
|
|
227
|
-
define = function (
|
|
228
|
-
return
|
|
72
|
+
} catch (err) {
|
|
73
|
+
define = function (obj, key, value) {
|
|
74
|
+
return obj[key] = value;
|
|
229
75
|
};
|
|
230
76
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
77
|
+
|
|
78
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
79
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
80
|
+
generator = Object.create(protoGenerator.prototype),
|
|
81
|
+
context = new Context(tryLocsList || []);
|
|
82
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
83
|
+
var state = "suspendedStart";
|
|
84
|
+
return function (method, arg) {
|
|
85
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
86
|
+
|
|
87
|
+
if ("completed" === state) {
|
|
88
|
+
if ("throw" === method) throw arg;
|
|
89
|
+
return doneResult();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
for (context.method = method, context.arg = arg;;) {
|
|
93
|
+
var delegate = context.delegate;
|
|
94
|
+
|
|
95
|
+
if (delegate) {
|
|
96
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
97
|
+
|
|
98
|
+
if (delegateResult) {
|
|
99
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
100
|
+
return delegateResult;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
105
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
106
|
+
context.dispatchException(context.arg);
|
|
107
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
108
|
+
state = "executing";
|
|
109
|
+
var record = tryCatch(innerFn, self, context);
|
|
110
|
+
|
|
111
|
+
if ("normal" === record.type) {
|
|
112
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
113
|
+
return {
|
|
114
|
+
value: record.arg,
|
|
115
|
+
done: context.done
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}(innerFn, self, context), generator;
|
|
238
123
|
}
|
|
239
|
-
|
|
124
|
+
|
|
125
|
+
function tryCatch(fn, obj, arg) {
|
|
240
126
|
try {
|
|
241
127
|
return {
|
|
242
128
|
type: "normal",
|
|
243
|
-
arg:
|
|
129
|
+
arg: fn.call(obj, arg)
|
|
244
130
|
};
|
|
245
|
-
} catch (
|
|
131
|
+
} catch (err) {
|
|
246
132
|
return {
|
|
247
133
|
type: "throw",
|
|
248
|
-
arg:
|
|
134
|
+
arg: err
|
|
249
135
|
};
|
|
250
136
|
}
|
|
251
137
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
s = "completed",
|
|
257
|
-
y = {};
|
|
138
|
+
|
|
139
|
+
exports.wrap = wrap;
|
|
140
|
+
var ContinueSentinel = {};
|
|
141
|
+
|
|
258
142
|
function Generator() {}
|
|
143
|
+
|
|
259
144
|
function GeneratorFunction() {}
|
|
145
|
+
|
|
260
146
|
function GeneratorFunctionPrototype() {}
|
|
261
|
-
|
|
262
|
-
|
|
147
|
+
|
|
148
|
+
var IteratorPrototype = {};
|
|
149
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
263
150
|
return this;
|
|
264
151
|
});
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
var
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
152
|
+
var getProto = Object.getPrototypeOf,
|
|
153
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
154
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
155
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
156
|
+
|
|
157
|
+
function defineIteratorMethods(prototype) {
|
|
158
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
159
|
+
define(prototype, method, function (arg) {
|
|
160
|
+
return this._invoke(method, arg);
|
|
273
161
|
});
|
|
274
162
|
});
|
|
275
163
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
invoke("
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
164
|
+
|
|
165
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
166
|
+
function invoke(method, arg, resolve, reject) {
|
|
167
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
168
|
+
|
|
169
|
+
if ("throw" !== record.type) {
|
|
170
|
+
var result = record.arg,
|
|
171
|
+
value = result.value;
|
|
172
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
173
|
+
invoke("next", value, resolve, reject);
|
|
174
|
+
}, function (err) {
|
|
175
|
+
invoke("throw", err, resolve, reject);
|
|
176
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
177
|
+
result.value = unwrapped, resolve(result);
|
|
178
|
+
}, function (error) {
|
|
179
|
+
return invoke("throw", error, resolve, reject);
|
|
290
180
|
});
|
|
291
181
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
182
|
+
|
|
183
|
+
reject(record.arg);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
var previousPromise;
|
|
187
|
+
|
|
188
|
+
this._invoke = function (method, arg) {
|
|
189
|
+
function callInvokeWithMethodAndArg() {
|
|
190
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
191
|
+
invoke(method, arg, resolve, reject);
|
|
192
|
+
});
|
|
303
193
|
}
|
|
304
|
-
|
|
194
|
+
|
|
195
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
196
|
+
};
|
|
305
197
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return
|
|
313
|
-
|
|
314
|
-
done: !0
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
for (n.method = i, n.arg = a;;) {
|
|
318
|
-
var c = n.delegate;
|
|
319
|
-
if (c) {
|
|
320
|
-
var u = maybeInvokeDelegate(c, n);
|
|
321
|
-
if (u) {
|
|
322
|
-
if (u === y) continue;
|
|
323
|
-
return u;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
327
|
-
if (o === h) throw o = s, n.arg;
|
|
328
|
-
n.dispatchException(n.arg);
|
|
329
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
330
|
-
o = f;
|
|
331
|
-
var p = tryCatch(e, r, n);
|
|
332
|
-
if ("normal" === p.type) {
|
|
333
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
334
|
-
return {
|
|
335
|
-
value: p.arg,
|
|
336
|
-
done: n.done
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
198
|
+
|
|
199
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
200
|
+
var method = delegate.iterator[context.method];
|
|
201
|
+
|
|
202
|
+
if (undefined === method) {
|
|
203
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
204
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
205
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
340
206
|
}
|
|
341
|
-
|
|
207
|
+
|
|
208
|
+
return ContinueSentinel;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
212
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
213
|
+
var info = record.arg;
|
|
214
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
342
215
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
348
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
349
|
-
var a = i.arg;
|
|
350
|
-
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);
|
|
351
|
-
}
|
|
352
|
-
function pushTryEntry(t) {
|
|
353
|
-
var e = {
|
|
354
|
-
tryLoc: t[0]
|
|
216
|
+
|
|
217
|
+
function pushTryEntry(locs) {
|
|
218
|
+
var entry = {
|
|
219
|
+
tryLoc: locs[0]
|
|
355
220
|
};
|
|
356
|
-
1 in
|
|
221
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
357
222
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
223
|
+
|
|
224
|
+
function resetTryEntry(entry) {
|
|
225
|
+
var record = entry.completion || {};
|
|
226
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
361
227
|
}
|
|
362
|
-
|
|
228
|
+
|
|
229
|
+
function Context(tryLocsList) {
|
|
363
230
|
this.tryEntries = [{
|
|
364
231
|
tryLoc: "root"
|
|
365
|
-
}],
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
if (
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
232
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function values(iterable) {
|
|
236
|
+
if (iterable) {
|
|
237
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
238
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
239
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
240
|
+
|
|
241
|
+
if (!isNaN(iterable.length)) {
|
|
242
|
+
var i = -1,
|
|
243
|
+
next = function next() {
|
|
244
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
245
|
+
|
|
246
|
+
return next.value = undefined, next.done = !0, next;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
return next.next = next;
|
|
379
250
|
}
|
|
380
251
|
}
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
384
|
-
value: GeneratorFunctionPrototype,
|
|
385
|
-
configurable: !0
|
|
386
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
387
|
-
value: GeneratorFunction,
|
|
388
|
-
configurable: !0
|
|
389
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
390
|
-
var e = "function" == typeof t && t.constructor;
|
|
391
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
392
|
-
}, e.mark = function (t) {
|
|
393
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
394
|
-
}, e.awrap = function (t) {
|
|
252
|
+
|
|
395
253
|
return {
|
|
396
|
-
|
|
254
|
+
next: doneResult
|
|
397
255
|
};
|
|
398
|
-
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function doneResult() {
|
|
259
|
+
return {
|
|
260
|
+
value: undefined,
|
|
261
|
+
done: !0
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
266
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
267
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
268
|
+
}, exports.mark = function (genFun) {
|
|
269
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
270
|
+
}, exports.awrap = function (arg) {
|
|
271
|
+
return {
|
|
272
|
+
__await: arg
|
|
273
|
+
};
|
|
274
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
399
275
|
return this;
|
|
400
|
-
}),
|
|
401
|
-
void 0 ===
|
|
402
|
-
var
|
|
403
|
-
return
|
|
404
|
-
return
|
|
276
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
277
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
278
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
279
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
280
|
+
return result.done ? result.value : iter.next();
|
|
405
281
|
});
|
|
406
|
-
}, defineIteratorMethods(
|
|
282
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
407
283
|
return this;
|
|
408
|
-
}), define(
|
|
284
|
+
}), define(Gp, "toString", function () {
|
|
409
285
|
return "[object Generator]";
|
|
410
|
-
}),
|
|
411
|
-
var
|
|
412
|
-
|
|
413
|
-
for (var
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
286
|
+
}), exports.keys = function (object) {
|
|
287
|
+
var keys = [];
|
|
288
|
+
|
|
289
|
+
for (var key in object) keys.push(key);
|
|
290
|
+
|
|
291
|
+
return keys.reverse(), function next() {
|
|
292
|
+
for (; keys.length;) {
|
|
293
|
+
var key = keys.pop();
|
|
294
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
418
295
|
}
|
|
296
|
+
|
|
419
297
|
return next.done = !0, next;
|
|
420
298
|
};
|
|
421
|
-
},
|
|
299
|
+
}, exports.values = values, Context.prototype = {
|
|
422
300
|
constructor: Context,
|
|
423
|
-
reset: function (
|
|
424
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
301
|
+
reset: function (skipTempReset) {
|
|
302
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
425
303
|
},
|
|
426
304
|
stop: function () {
|
|
427
305
|
this.done = !0;
|
|
428
|
-
var
|
|
429
|
-
if ("throw" ===
|
|
306
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
307
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
430
308
|
return this.rval;
|
|
431
309
|
},
|
|
432
|
-
dispatchException: function (
|
|
433
|
-
if (this.done) throw
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
|
|
310
|
+
dispatchException: function (exception) {
|
|
311
|
+
if (this.done) throw exception;
|
|
312
|
+
var context = this;
|
|
313
|
+
|
|
314
|
+
function handle(loc, caught) {
|
|
315
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
437
316
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
if (
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
if (this.prev <
|
|
317
|
+
|
|
318
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
319
|
+
var entry = this.tryEntries[i],
|
|
320
|
+
record = entry.completion;
|
|
321
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
322
|
+
|
|
323
|
+
if (entry.tryLoc <= this.prev) {
|
|
324
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
325
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
326
|
+
|
|
327
|
+
if (hasCatch && hasFinally) {
|
|
328
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
329
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
330
|
+
} else if (hasCatch) {
|
|
331
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
450
332
|
} else {
|
|
451
|
-
if (!
|
|
452
|
-
if (this.prev <
|
|
333
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
334
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
453
335
|
}
|
|
454
336
|
}
|
|
455
337
|
}
|
|
456
338
|
},
|
|
457
|
-
abrupt: function (
|
|
458
|
-
for (var
|
|
459
|
-
var
|
|
460
|
-
|
|
461
|
-
|
|
339
|
+
abrupt: function (type, arg) {
|
|
340
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
341
|
+
var entry = this.tryEntries[i];
|
|
342
|
+
|
|
343
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
344
|
+
var finallyEntry = entry;
|
|
462
345
|
break;
|
|
463
346
|
}
|
|
464
347
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
348
|
+
|
|
349
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
350
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
351
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
468
352
|
},
|
|
469
|
-
complete: function (
|
|
470
|
-
if ("throw" ===
|
|
471
|
-
return "break" ===
|
|
353
|
+
complete: function (record, afterLoc) {
|
|
354
|
+
if ("throw" === record.type) throw record.arg;
|
|
355
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
472
356
|
},
|
|
473
|
-
finish: function (
|
|
474
|
-
for (var
|
|
475
|
-
var
|
|
476
|
-
if (
|
|
357
|
+
finish: function (finallyLoc) {
|
|
358
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
359
|
+
var entry = this.tryEntries[i];
|
|
360
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
477
361
|
}
|
|
478
362
|
},
|
|
479
|
-
catch: function (
|
|
480
|
-
for (var
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
363
|
+
catch: function (tryLoc) {
|
|
364
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
365
|
+
var entry = this.tryEntries[i];
|
|
366
|
+
|
|
367
|
+
if (entry.tryLoc === tryLoc) {
|
|
368
|
+
var record = entry.completion;
|
|
369
|
+
|
|
370
|
+
if ("throw" === record.type) {
|
|
371
|
+
var thrown = record.arg;
|
|
372
|
+
resetTryEntry(entry);
|
|
487
373
|
}
|
|
488
|
-
|
|
374
|
+
|
|
375
|
+
return thrown;
|
|
489
376
|
}
|
|
490
377
|
}
|
|
491
|
-
|
|
378
|
+
|
|
379
|
+
throw new Error("illegal catch attempt");
|
|
492
380
|
},
|
|
493
|
-
delegateYield: function (
|
|
381
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
494
382
|
return this.delegate = {
|
|
495
|
-
iterator: values(
|
|
496
|
-
resultName:
|
|
497
|
-
nextLoc:
|
|
498
|
-
}, "next" === this.method && (this.arg =
|
|
383
|
+
iterator: values(iterable),
|
|
384
|
+
resultName: resultName,
|
|
385
|
+
nextLoc: nextLoc
|
|
386
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
499
387
|
}
|
|
500
|
-
},
|
|
388
|
+
}, exports;
|
|
501
389
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
390
|
+
|
|
391
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
392
|
+
try {
|
|
393
|
+
var info = gen[key](arg);
|
|
394
|
+
var value = info.value;
|
|
395
|
+
} catch (error) {
|
|
396
|
+
reject(error);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (info.done) {
|
|
401
|
+
resolve(value);
|
|
402
|
+
} else {
|
|
403
|
+
Promise.resolve(value).then(_next, _throw);
|
|
404
|
+
}
|
|
506
405
|
}
|
|
507
|
-
|
|
508
|
-
|
|
406
|
+
|
|
407
|
+
function _asyncToGenerator(fn) {
|
|
408
|
+
return function () {
|
|
409
|
+
var self = this,
|
|
410
|
+
args = arguments;
|
|
411
|
+
return new Promise(function (resolve, reject) {
|
|
412
|
+
var gen = fn.apply(self, args);
|
|
413
|
+
|
|
414
|
+
function _next(value) {
|
|
415
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function _throw(err) {
|
|
419
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
_next(undefined);
|
|
423
|
+
});
|
|
424
|
+
};
|
|
509
425
|
}
|
|
510
|
-
|
|
511
|
-
|
|
426
|
+
|
|
427
|
+
function _classCallCheck(instance, Constructor) {
|
|
428
|
+
if (!(instance instanceof Constructor)) {
|
|
429
|
+
throw new TypeError("Cannot call a class as a function");
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function _defineProperties(target, props) {
|
|
434
|
+
for (var i = 0; i < props.length; i++) {
|
|
435
|
+
var descriptor = props[i];
|
|
436
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
437
|
+
descriptor.configurable = true;
|
|
438
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
439
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
444
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
445
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
446
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
447
|
+
writable: false
|
|
448
|
+
});
|
|
449
|
+
return Constructor;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function _defineProperty(obj, key, value) {
|
|
453
|
+
if (key in obj) {
|
|
454
|
+
Object.defineProperty(obj, key, {
|
|
455
|
+
value: value,
|
|
456
|
+
enumerable: true,
|
|
457
|
+
configurable: true,
|
|
458
|
+
writable: true
|
|
459
|
+
});
|
|
460
|
+
} else {
|
|
461
|
+
obj[key] = value;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return obj;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function _extends() {
|
|
468
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
469
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
470
|
+
var source = arguments[i];
|
|
471
|
+
|
|
472
|
+
for (var key in source) {
|
|
473
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
474
|
+
target[key] = source[key];
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
return target;
|
|
480
|
+
};
|
|
481
|
+
return _extends.apply(this, arguments);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function _inherits(subClass, superClass) {
|
|
485
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
486
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
490
|
+
constructor: {
|
|
491
|
+
value: subClass,
|
|
492
|
+
writable: true,
|
|
493
|
+
configurable: true
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
Object.defineProperty(subClass, "prototype", {
|
|
497
|
+
writable: false
|
|
498
|
+
});
|
|
499
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function _getPrototypeOf(o) {
|
|
503
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
504
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
505
|
+
};
|
|
506
|
+
return _getPrototypeOf(o);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function _setPrototypeOf(o, p) {
|
|
510
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
511
|
+
o.__proto__ = p;
|
|
512
|
+
return o;
|
|
513
|
+
};
|
|
514
|
+
return _setPrototypeOf(o, p);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function _isNativeReflectConstruct() {
|
|
518
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
519
|
+
if (Reflect.construct.sham) return false;
|
|
520
|
+
if (typeof Proxy === "function") return true;
|
|
521
|
+
|
|
522
|
+
try {
|
|
523
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
524
|
+
return true;
|
|
525
|
+
} catch (e) {
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
531
|
+
if (source == null) return {};
|
|
532
|
+
var target = {};
|
|
533
|
+
var sourceKeys = Object.keys(source);
|
|
534
|
+
var key, i;
|
|
535
|
+
|
|
536
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
537
|
+
key = sourceKeys[i];
|
|
538
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
539
|
+
target[key] = source[key];
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
return target;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function _objectWithoutProperties(source, excluded) {
|
|
546
|
+
if (source == null) return {};
|
|
547
|
+
|
|
548
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
549
|
+
|
|
550
|
+
var key, i;
|
|
551
|
+
|
|
552
|
+
if (Object.getOwnPropertySymbols) {
|
|
553
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
554
|
+
|
|
555
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
556
|
+
key = sourceSymbolKeys[i];
|
|
557
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
558
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
559
|
+
target[key] = source[key];
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return target;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
function _assertThisInitialized(self) {
|
|
567
|
+
if (self === void 0) {
|
|
568
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return self;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function _possibleConstructorReturn(self, call) {
|
|
575
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
576
|
+
return call;
|
|
577
|
+
} else if (call !== void 0) {
|
|
578
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
return _assertThisInitialized(self);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function _createSuper(Derived) {
|
|
585
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
586
|
+
|
|
587
|
+
return function _createSuperInternal() {
|
|
588
|
+
var Super = _getPrototypeOf(Derived),
|
|
589
|
+
result;
|
|
590
|
+
|
|
591
|
+
if (hasNativeReflectConstruct) {
|
|
592
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
593
|
+
|
|
594
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
595
|
+
} else {
|
|
596
|
+
result = Super.apply(this, arguments);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
return _possibleConstructorReturn(this, result);
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
604
|
+
if (!raw) {
|
|
605
|
+
raw = strings.slice(0);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
512
609
|
raw: {
|
|
513
|
-
value: Object.freeze(
|
|
610
|
+
value: Object.freeze(raw)
|
|
611
|
+
}
|
|
612
|
+
}));
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
function _slicedToArray(arr, i) {
|
|
616
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
function _toConsumableArray(arr) {
|
|
620
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function _arrayWithoutHoles(arr) {
|
|
624
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function _arrayWithHoles(arr) {
|
|
628
|
+
if (Array.isArray(arr)) return arr;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
function _iterableToArray(iter) {
|
|
632
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
function _iterableToArrayLimit(arr, i) {
|
|
636
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
637
|
+
|
|
638
|
+
if (_i == null) return;
|
|
639
|
+
var _arr = [];
|
|
640
|
+
var _n = true;
|
|
641
|
+
var _d = false;
|
|
642
|
+
|
|
643
|
+
var _s, _e;
|
|
644
|
+
|
|
645
|
+
try {
|
|
646
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
647
|
+
_arr.push(_s.value);
|
|
648
|
+
|
|
649
|
+
if (i && _arr.length === i) break;
|
|
514
650
|
}
|
|
515
|
-
})
|
|
651
|
+
} catch (err) {
|
|
652
|
+
_d = true;
|
|
653
|
+
_e = err;
|
|
654
|
+
} finally {
|
|
655
|
+
try {
|
|
656
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
657
|
+
} finally {
|
|
658
|
+
if (_d) throw _e;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return _arr;
|
|
516
663
|
}
|
|
517
|
-
|
|
518
|
-
|
|
664
|
+
|
|
665
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
666
|
+
if (!o) return;
|
|
667
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
668
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
669
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
670
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
671
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
519
672
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
return ("string" === r ? String : Number)(t);
|
|
673
|
+
|
|
674
|
+
function _arrayLikeToArray(arr, len) {
|
|
675
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
676
|
+
|
|
677
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
678
|
+
|
|
679
|
+
return arr2;
|
|
529
680
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
681
|
+
|
|
682
|
+
function _nonIterableSpread() {
|
|
683
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
533
684
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
538
|
-
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;
|
|
539
|
-
}
|
|
685
|
+
|
|
686
|
+
function _nonIterableRest() {
|
|
687
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
540
688
|
}
|
|
541
689
|
|
|
542
690
|
var SimpleErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
691
|
+
_inherits(SimpleErrorBoundary, _React$Component);
|
|
692
|
+
|
|
693
|
+
var _super = _createSuper(SimpleErrorBoundary);
|
|
694
|
+
|
|
543
695
|
function SimpleErrorBoundary(props) {
|
|
544
696
|
var _this;
|
|
697
|
+
|
|
545
698
|
_classCallCheck(this, SimpleErrorBoundary);
|
|
546
|
-
|
|
699
|
+
|
|
700
|
+
_this = _super.call(this, props);
|
|
547
701
|
_this.state = {
|
|
548
702
|
hasError: false
|
|
549
703
|
};
|
|
550
704
|
return _this;
|
|
551
705
|
}
|
|
552
|
-
|
|
553
|
-
|
|
706
|
+
|
|
707
|
+
_createClass(SimpleErrorBoundary, [{
|
|
554
708
|
key: "componentDidCatch",
|
|
555
709
|
value: function componentDidCatch(error, errorInfo) {
|
|
556
710
|
// You can also log the error to an error reporting service
|
|
@@ -563,6 +717,7 @@
|
|
|
563
717
|
// You can render any custom fallback UI
|
|
564
718
|
return this.props.showMessageOnError ? /*#__PURE__*/React__default.createElement("h1", null, this.props.errorMessage) : null;
|
|
565
719
|
}
|
|
720
|
+
|
|
566
721
|
return this.props.children;
|
|
567
722
|
}
|
|
568
723
|
}], [{
|
|
@@ -574,7 +729,10 @@
|
|
|
574
729
|
};
|
|
575
730
|
}
|
|
576
731
|
}]);
|
|
732
|
+
|
|
733
|
+
return SimpleErrorBoundary;
|
|
577
734
|
}(React__default.Component);
|
|
735
|
+
|
|
578
736
|
SimpleErrorBoundary.defaultProps = {
|
|
579
737
|
errorMessage: 'Something went wrong',
|
|
580
738
|
errorLogger: null,
|
|
@@ -656,19 +814,21 @@
|
|
|
656
814
|
var StyledHeader = styled__default.h5(_templateObject || (_templateObject = _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) {
|
|
657
815
|
return props.theme.marginPaddings[1];
|
|
658
816
|
}, media.sm);
|
|
817
|
+
|
|
659
818
|
/**
|
|
660
819
|
* IconHeader can render the standard Luxity Page/Section Header nodes with SVG
|
|
661
820
|
*/
|
|
662
821
|
var IconHeader = function IconHeader(_ref) {
|
|
663
822
|
var title = _ref.title,
|
|
664
|
-
|
|
665
|
-
|
|
823
|
+
SvgComponent = _ref.svgComponent,
|
|
824
|
+
renderAppendage = _ref.renderAppendage;
|
|
666
825
|
return /*#__PURE__*/React__default.createElement(StyledHeader, null, /*#__PURE__*/React__default.createElement("div", {
|
|
667
826
|
className: "icon-header__left"
|
|
668
827
|
}, /*#__PURE__*/React__default.createElement(SvgComponent, null), title), /*#__PURE__*/React__default.createElement("div", {
|
|
669
828
|
className: "icon-header__right"
|
|
670
829
|
}, renderAppendage && renderAppendage()));
|
|
671
830
|
};
|
|
831
|
+
|
|
672
832
|
IconHeader.defaultProps = {
|
|
673
833
|
title: '',
|
|
674
834
|
svgComponent: function svgComponent() {
|
|
@@ -706,39 +866,50 @@
|
|
|
706
866
|
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
707
867
|
data: null
|
|
708
868
|
});
|
|
709
|
-
|
|
710
869
|
/**
|
|
711
870
|
* A flavour of PageReady with Luxity customisations
|
|
712
871
|
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
713
872
|
* 2. an error message interpreter is supplied from the local helper library
|
|
714
873
|
*/
|
|
874
|
+
|
|
715
875
|
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
876
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
877
|
+
|
|
878
|
+
var _super = _createSuper(LuxityPageReady);
|
|
879
|
+
|
|
716
880
|
function LuxityPageReady() {
|
|
717
881
|
var _this;
|
|
882
|
+
|
|
718
883
|
_classCallCheck(this, LuxityPageReady);
|
|
884
|
+
|
|
719
885
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
720
886
|
args[_key] = arguments[_key];
|
|
721
887
|
}
|
|
722
|
-
|
|
723
|
-
|
|
888
|
+
|
|
889
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
890
|
+
|
|
891
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
724
892
|
data: null
|
|
725
893
|
});
|
|
726
|
-
|
|
894
|
+
|
|
895
|
+
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
727
896
|
return _this.pageReadyInstance.initRequest();
|
|
728
897
|
});
|
|
898
|
+
|
|
729
899
|
return _this;
|
|
730
900
|
}
|
|
731
|
-
|
|
732
|
-
|
|
901
|
+
|
|
902
|
+
_createClass(LuxityPageReady, [{
|
|
733
903
|
key: "render",
|
|
734
904
|
value: function render() {
|
|
735
905
|
var _this2 = this;
|
|
906
|
+
|
|
736
907
|
var _this$props = this.props,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
908
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
909
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
910
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
911
|
+
_onData = _this$props.onData,
|
|
912
|
+
children = _this$props.children;
|
|
742
913
|
var data = this.state.data;
|
|
743
914
|
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
744
915
|
ref: function ref(inst) {
|
|
@@ -748,15 +919,19 @@
|
|
|
748
919
|
_this2.setState({
|
|
749
920
|
data: res.data
|
|
750
921
|
});
|
|
922
|
+
|
|
751
923
|
_onData(res);
|
|
752
924
|
},
|
|
753
925
|
getRequestInstance: function getRequestInstance() {
|
|
754
926
|
_this2.props.onIsLoading(true);
|
|
927
|
+
|
|
755
928
|
return getRequestPromise().then(function (out) {
|
|
756
929
|
_this2.props.onIsLoading(false);
|
|
930
|
+
|
|
757
931
|
return out;
|
|
758
932
|
}).catch(function (oops) {
|
|
759
933
|
_this2.props.onIsLoading(false);
|
|
934
|
+
|
|
760
935
|
return oops;
|
|
761
936
|
});
|
|
762
937
|
},
|
|
@@ -773,7 +948,10 @@
|
|
|
773
948
|
}, children));
|
|
774
949
|
}
|
|
775
950
|
}]);
|
|
951
|
+
|
|
952
|
+
return LuxityPageReady;
|
|
776
953
|
}(React__default.Component);
|
|
954
|
+
|
|
777
955
|
LuxityPageReady.defaultProps = {
|
|
778
956
|
onIsLoading: function onIsLoading() {
|
|
779
957
|
return null;
|
|
@@ -7372,12 +7550,12 @@
|
|
|
7372
7550
|
/**
|
|
7373
7551
|
* It represents the React Component that contains the notifications.
|
|
7374
7552
|
* */
|
|
7553
|
+
|
|
7375
7554
|
var LuxityNotifications = function LuxityNotifications(props) {
|
|
7376
7555
|
return /*#__PURE__*/React__default.createElement(Notifications__default, props);
|
|
7377
7556
|
};
|
|
7378
7557
|
|
|
7379
7558
|
/** @format */
|
|
7380
|
-
|
|
7381
7559
|
var request = {
|
|
7382
7560
|
fetching: false,
|
|
7383
7561
|
failed: false,
|
|
@@ -7391,20 +7569,31 @@
|
|
|
7391
7569
|
};
|
|
7392
7570
|
|
|
7393
7571
|
var NotificationDropDown = /*#__PURE__*/function (_React$Component) {
|
|
7572
|
+
_inherits(NotificationDropDown, _React$Component);
|
|
7573
|
+
|
|
7574
|
+
var _super = _createSuper(NotificationDropDown);
|
|
7575
|
+
|
|
7394
7576
|
function NotificationDropDown(props) {
|
|
7395
7577
|
var _this;
|
|
7578
|
+
|
|
7396
7579
|
_classCallCheck(this, NotificationDropDown);
|
|
7397
|
-
|
|
7398
|
-
|
|
7580
|
+
|
|
7581
|
+
_this = _super.call(this, props);
|
|
7582
|
+
|
|
7583
|
+
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
7399
7584
|
_this.setState({
|
|
7400
7585
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7401
7586
|
fetching: true
|
|
7402
7587
|
})
|
|
7403
7588
|
});
|
|
7589
|
+
|
|
7404
7590
|
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
7405
|
-
_this
|
|
7591
|
+
var _this$setState;
|
|
7592
|
+
|
|
7593
|
+
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7406
7594
|
success: true
|
|
7407
|
-
})));
|
|
7595
|
+
})), _this$setState));
|
|
7596
|
+
|
|
7408
7597
|
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
7409
7598
|
}).catch(function () {
|
|
7410
7599
|
_this.setState({
|
|
@@ -7412,10 +7601,12 @@
|
|
|
7412
7601
|
failed: true
|
|
7413
7602
|
})
|
|
7414
7603
|
});
|
|
7604
|
+
|
|
7415
7605
|
error('Error Occurred');
|
|
7416
7606
|
});
|
|
7417
7607
|
});
|
|
7418
|
-
|
|
7608
|
+
|
|
7609
|
+
_defineProperty(_assertThisInitialized(_this), "getOptionsFromEnumResult", function (enumResult) {
|
|
7419
7610
|
var enumValues = enumResult.data.__type.enumValues;
|
|
7420
7611
|
return enumValues.map(function (enumItem) {
|
|
7421
7612
|
return {
|
|
@@ -7424,17 +7615,20 @@
|
|
|
7424
7615
|
};
|
|
7425
7616
|
});
|
|
7426
7617
|
});
|
|
7427
|
-
|
|
7618
|
+
|
|
7619
|
+
_defineProperty(_assertThisInitialized(_this), "onData", function (_ref) {
|
|
7428
7620
|
var data = _ref.data;
|
|
7621
|
+
|
|
7429
7622
|
var options = _this.getOptionsFromEnumResult(data);
|
|
7623
|
+
|
|
7430
7624
|
var _data$data$user = data.data.user,
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7625
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
7626
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
7627
|
+
vip = _data$data$user.vip;
|
|
7628
|
+
|
|
7435
7629
|
_this.setState({
|
|
7436
7630
|
options: options,
|
|
7437
|
-
|
|
7631
|
+
isVip: vip,
|
|
7438
7632
|
emailSelectedOption: options.find(function (item) {
|
|
7439
7633
|
return item.value === email_interest_send_schedule;
|
|
7440
7634
|
}),
|
|
@@ -7443,13 +7637,14 @@
|
|
|
7443
7637
|
})
|
|
7444
7638
|
});
|
|
7445
7639
|
});
|
|
7446
|
-
|
|
7640
|
+
|
|
7641
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7447
7642
|
var _this$state = _this.state,
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7643
|
+
options = _this$state.options,
|
|
7644
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
7645
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
7646
|
+
isVip = _this$state.isVip,
|
|
7647
|
+
updating = _this$state.request.fetching;
|
|
7453
7648
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
7454
7649
|
getRequestPromise: _this.props.getSchedule,
|
|
7455
7650
|
onData: function onData(data) {
|
|
@@ -7457,7 +7652,7 @@
|
|
|
7457
7652
|
}
|
|
7458
7653
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
7459
7654
|
className: "notification-settings"
|
|
7460
|
-
},
|
|
7655
|
+
}, isVip && /*#__PURE__*/React__default.createElement("div", {
|
|
7461
7656
|
className: "notification-row-wrapper"
|
|
7462
7657
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
7463
7658
|
className: "notification-dropdown-label"
|
|
@@ -7497,18 +7692,20 @@
|
|
|
7497
7692
|
value: emailSelectedOption
|
|
7498
7693
|
}))))));
|
|
7499
7694
|
});
|
|
7695
|
+
|
|
7500
7696
|
_this.state = {
|
|
7501
7697
|
options: [],
|
|
7502
7698
|
emailSelectedOption: null,
|
|
7503
7699
|
whatsappSelectedOption: null,
|
|
7504
|
-
|
|
7700
|
+
isVip: false,
|
|
7505
7701
|
request: _objectSpread2({}, request)
|
|
7506
7702
|
};
|
|
7507
7703
|
return _this;
|
|
7508
7704
|
}
|
|
7509
|
-
|
|
7705
|
+
|
|
7510
7706
|
return _createClass(NotificationDropDown);
|
|
7511
7707
|
}(React__default.Component);
|
|
7708
|
+
|
|
7512
7709
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
7513
7710
|
|
|
7514
7711
|
var simpleRequest = (function (axiosInstance, url) {
|
|
@@ -7568,23 +7765,23 @@
|
|
|
7568
7765
|
return props.hasBorder ? props.theme.colors.borderColor : props.theme.colors.ntrlMin;
|
|
7569
7766
|
}, function (_ref) {
|
|
7570
7767
|
var isChecked = _ref.isChecked,
|
|
7571
|
-
|
|
7768
|
+
theme = _ref.theme;
|
|
7572
7769
|
return isChecked ? theme.colors.primary : theme.colors.gray;
|
|
7573
7770
|
}, function (_ref2) {
|
|
7574
7771
|
var isChecked = _ref2.isChecked,
|
|
7575
|
-
|
|
7772
|
+
theme = _ref2.theme;
|
|
7576
7773
|
return isChecked ? 'white' : theme.colors.base;
|
|
7577
7774
|
}, function (_ref3) {
|
|
7578
7775
|
var isChecked = _ref3.isChecked,
|
|
7579
|
-
|
|
7776
|
+
theme = _ref3.theme;
|
|
7580
7777
|
return isChecked ? theme.colors.ntrlMin : theme.colors.primary;
|
|
7581
7778
|
}, function (_ref4) {
|
|
7582
7779
|
var isChecked = _ref4.isChecked,
|
|
7583
|
-
|
|
7780
|
+
theme = _ref4.theme;
|
|
7584
7781
|
return isChecked ? 'white' : theme.colors.base;
|
|
7585
7782
|
}, function (_ref5) {
|
|
7586
7783
|
var isChecked = _ref5.isChecked,
|
|
7587
|
-
|
|
7784
|
+
theme = _ref5.theme;
|
|
7588
7785
|
return isChecked ? theme.colors.primary : 'white';
|
|
7589
7786
|
}, media.sm, function (props) {
|
|
7590
7787
|
return props.theme.marginPaddings[2];
|
|
@@ -7739,45 +7936,56 @@
|
|
|
7739
7936
|
var baseButtonStyle = styled.css(_templateObject2 || (_templateObject2 = _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"])));
|
|
7740
7937
|
|
|
7741
7938
|
var _excluded = ["children"];
|
|
7939
|
+
|
|
7742
7940
|
var _templateObject$6;
|
|
7743
7941
|
var Button = styled__default.button(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n outline: none;\n cursor: pointer;\n background-color: transparent;\n border: none;\n &:disabled {\n ", ";\n }\n"])), disabledButtonStyle);
|
|
7942
|
+
|
|
7744
7943
|
var WrapperButton = function WrapperButton(_ref) {
|
|
7745
7944
|
var children = _ref.children,
|
|
7746
|
-
|
|
7945
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
7946
|
+
|
|
7747
7947
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
7748
7948
|
};
|
|
7749
7949
|
|
|
7750
7950
|
var _templateObject$7, _templateObject2$1;
|
|
7751
7951
|
var categories = catArray;
|
|
7952
|
+
|
|
7752
7953
|
var getSvg = function getSvg() {
|
|
7753
7954
|
var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
7955
|
+
|
|
7754
7956
|
switch (category) {
|
|
7755
7957
|
case interestCategories.BAGS:
|
|
7756
7958
|
return /*#__PURE__*/React__default.createElement(Bags, null);
|
|
7959
|
+
|
|
7757
7960
|
case interestCategories.SHOES:
|
|
7758
7961
|
return /*#__PURE__*/React__default.createElement(Shoes, null);
|
|
7962
|
+
|
|
7759
7963
|
case interestCategories.APPAREL:
|
|
7760
7964
|
return /*#__PURE__*/React__default.createElement(Clothing, null);
|
|
7965
|
+
|
|
7761
7966
|
case interestCategories.ACCESSORIES:
|
|
7762
7967
|
return /*#__PURE__*/React__default.createElement(Accessories, null);
|
|
7968
|
+
|
|
7763
7969
|
case interestCategories.WATCHES:
|
|
7764
7970
|
return /*#__PURE__*/React__default.createElement(Watches, null);
|
|
7971
|
+
|
|
7765
7972
|
default:
|
|
7766
7973
|
return null;
|
|
7767
7974
|
}
|
|
7768
7975
|
};
|
|
7976
|
+
|
|
7769
7977
|
var Container = styled__default.div(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
7770
7978
|
return props.theme.marginPaddings[5];
|
|
7771
7979
|
});
|
|
7772
7980
|
var CategoryTitle = styled__default.h1(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n margin-top: 10px;\n font-size: 14px;\n text-transform: uppercase;\n"])));
|
|
7773
|
-
|
|
7774
7981
|
/**
|
|
7775
7982
|
* InterestCatSelector is a specialized selector for select luxity specific interest categories
|
|
7776
7983
|
*/
|
|
7984
|
+
|
|
7777
7985
|
var InterestCatSelector = function InterestCatSelector(_ref) {
|
|
7778
7986
|
var onCategoryChange = _ref.onCategoryChange,
|
|
7779
|
-
|
|
7780
|
-
|
|
7987
|
+
errorMessage = _ref.errorMessage,
|
|
7988
|
+
category = _ref.category;
|
|
7781
7989
|
return /*#__PURE__*/React__default.createElement(Container, null, /*#__PURE__*/React__default.createElement(Body, null, categories.map(function (cat, index) {
|
|
7782
7990
|
return /*#__PURE__*/React__default.createElement(WrapperButton, {
|
|
7783
7991
|
key: "cat-".concat(index),
|
|
@@ -7792,6 +8000,7 @@
|
|
|
7792
8000
|
}, getSvg(cat.value), /*#__PURE__*/React__default.createElement(CategoryTitle, null, cat.categoryTitle)));
|
|
7793
8001
|
})), errorMessage && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errorMessage));
|
|
7794
8002
|
};
|
|
8003
|
+
|
|
7795
8004
|
InterestCatSelector.defaultProps = {
|
|
7796
8005
|
errorMessage: '',
|
|
7797
8006
|
category: null,
|
|
@@ -7802,6 +8011,7 @@
|
|
|
7802
8011
|
var CategoryInterestSelector = themed(InterestCatSelector);
|
|
7803
8012
|
|
|
7804
8013
|
var _excluded$1 = ["children"];
|
|
8014
|
+
|
|
7805
8015
|
var _templateObject$8;
|
|
7806
8016
|
var Button$1 = styled__default.button(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n ", ";\n background-color: transparent;\n color: ", ";\n &:hover {\n color: ", ";\n }\n &:disabled {\n ", ";\n color: ", ";\n }\n"])), baseButtonStyle, function (props) {
|
|
7807
8017
|
return props.theme.colors.base;
|
|
@@ -7810,17 +8020,21 @@
|
|
|
7810
8020
|
}, disabledButtonStyle, function (props) {
|
|
7811
8021
|
return props.theme.colors.base;
|
|
7812
8022
|
});
|
|
8023
|
+
|
|
7813
8024
|
var TextButton = function TextButton(_ref) {
|
|
7814
8025
|
var children = _ref.children,
|
|
7815
|
-
|
|
8026
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
8027
|
+
|
|
7816
8028
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
7817
8029
|
};
|
|
8030
|
+
|
|
7818
8031
|
TextButton.defaultProps = {
|
|
7819
8032
|
type: 'button'
|
|
7820
8033
|
};
|
|
7821
8034
|
var TextButton$1 = themed(TextButton);
|
|
7822
8035
|
|
|
7823
8036
|
var _excluded$2 = ["children"];
|
|
8037
|
+
|
|
7824
8038
|
var _templateObject$9;
|
|
7825
8039
|
var Button$2 = styled__default(TextButton$1)(_templateObject$9 || (_templateObject$9 = _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) {
|
|
7826
8040
|
return props.theme.colors.ntrlMin;
|
|
@@ -7835,11 +8049,14 @@
|
|
|
7835
8049
|
}, function (props) {
|
|
7836
8050
|
return props.theme.colors.primary;
|
|
7837
8051
|
});
|
|
8052
|
+
|
|
7838
8053
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
7839
8054
|
var children = _ref.children,
|
|
7840
|
-
|
|
8055
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
8056
|
+
|
|
7841
8057
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
7842
8058
|
};
|
|
8059
|
+
|
|
7843
8060
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
7844
8061
|
|
|
7845
8062
|
var _templateObject$a, _templateObject2$2;
|
|
@@ -7881,49 +8098,65 @@
|
|
|
7881
8098
|
}, function (props) {
|
|
7882
8099
|
return props.theme.colors.ntrlMin;
|
|
7883
8100
|
});
|
|
7884
|
-
|
|
7885
8101
|
/**
|
|
7886
8102
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
7887
8103
|
*/
|
|
8104
|
+
|
|
7888
8105
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
8106
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
8107
|
+
|
|
8108
|
+
var _super = _createSuper(GraphQLMultiSelector);
|
|
8109
|
+
|
|
7889
8110
|
function GraphQLMultiSelector(props) {
|
|
7890
8111
|
var _this;
|
|
8112
|
+
|
|
7891
8113
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
7892
|
-
|
|
7893
|
-
|
|
8114
|
+
|
|
8115
|
+
_this = _super.call(this, props);
|
|
8116
|
+
|
|
8117
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
7894
8118
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
7895
8119
|
_this.makeRequest();
|
|
7896
8120
|
}
|
|
7897
8121
|
});
|
|
7898
|
-
|
|
8122
|
+
|
|
8123
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
7899
8124
|
_this.pageReady.refreshPage();
|
|
7900
8125
|
});
|
|
7901
|
-
|
|
8126
|
+
|
|
8127
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
7902
8128
|
return _this.setState({
|
|
7903
8129
|
selected: [ALL_ITEM]
|
|
7904
8130
|
});
|
|
7905
8131
|
});
|
|
7906
|
-
|
|
8132
|
+
|
|
8133
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
7907
8134
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
7908
8135
|
return sel.id;
|
|
7909
8136
|
});
|
|
8137
|
+
|
|
7910
8138
|
var pagination = _this.props.resultProcessor(res);
|
|
8139
|
+
|
|
7911
8140
|
var allSelected = _this.state.selected.some(function (item) {
|
|
7912
8141
|
return item.id === ALL_ITEM.id;
|
|
7913
8142
|
});
|
|
8143
|
+
|
|
7914
8144
|
var newList = pagination.data.filter(function (newItem) {
|
|
7915
8145
|
return !selectedIds.includes(newItem.id);
|
|
7916
8146
|
});
|
|
7917
8147
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
8148
|
+
|
|
7918
8149
|
_this.setState({
|
|
7919
8150
|
list: newList,
|
|
7920
8151
|
pagination: pagination
|
|
7921
8152
|
});
|
|
7922
8153
|
});
|
|
7923
|
-
|
|
8154
|
+
|
|
8155
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
7924
8156
|
_this.setState(function (prevState) {
|
|
7925
8157
|
var newSelectedList;
|
|
7926
8158
|
var newList;
|
|
8159
|
+
|
|
7927
8160
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
7928
8161
|
// Clear Selected List
|
|
7929
8162
|
// and move previous Selected items to list
|
|
@@ -7943,6 +8176,7 @@
|
|
|
7943
8176
|
return item.id !== addSelectedItem.id;
|
|
7944
8177
|
})));
|
|
7945
8178
|
}
|
|
8179
|
+
|
|
7946
8180
|
return {
|
|
7947
8181
|
selected: newSelectedList,
|
|
7948
8182
|
list: newList
|
|
@@ -7953,20 +8187,24 @@
|
|
|
7953
8187
|
}));
|
|
7954
8188
|
});
|
|
7955
8189
|
});
|
|
7956
|
-
|
|
8190
|
+
|
|
8191
|
+
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
7957
8192
|
_this.setState(function (prevState) {
|
|
7958
8193
|
// Cannot remove ALL from selection by unselecting it
|
|
7959
8194
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
7960
8195
|
return {};
|
|
7961
8196
|
}
|
|
8197
|
+
|
|
7962
8198
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
7963
8199
|
return item.id !== removeSelectedItem.id;
|
|
7964
8200
|
});
|
|
8201
|
+
|
|
7965
8202
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
7966
8203
|
return item.id !== ALL_ITEM.id;
|
|
7967
8204
|
}).sort(function (a, b) {
|
|
7968
8205
|
return a.id - b.id;
|
|
7969
8206
|
});
|
|
8207
|
+
|
|
7970
8208
|
return {
|
|
7971
8209
|
list: newList,
|
|
7972
8210
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -7977,23 +8215,25 @@
|
|
|
7977
8215
|
}));
|
|
7978
8216
|
});
|
|
7979
8217
|
});
|
|
7980
|
-
|
|
8218
|
+
|
|
8219
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
7981
8220
|
_this.setState({
|
|
7982
8221
|
isLoading: flag
|
|
7983
8222
|
});
|
|
7984
8223
|
});
|
|
7985
|
-
|
|
8224
|
+
|
|
8225
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7986
8226
|
var _this$props = _this.props,
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
8227
|
+
baseClass = _this$props.baseClass,
|
|
8228
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
8229
|
+
identifier = _this$props.identifier,
|
|
8230
|
+
triggerRequest = _this$props.triggerRequest,
|
|
8231
|
+
className = _this$props.className;
|
|
7992
8232
|
var _this$state = _this.state,
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
8233
|
+
list = _this$state.list,
|
|
8234
|
+
selected = _this$state.selected,
|
|
8235
|
+
pagination = _this$state.pagination,
|
|
8236
|
+
isLoading = _this$state.isLoading;
|
|
7997
8237
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
7998
8238
|
"data-qe-id": identifier,
|
|
7999
8239
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -8032,6 +8272,7 @@
|
|
|
8032
8272
|
type: "button"
|
|
8033
8273
|
}, "SHOW MORE"))));
|
|
8034
8274
|
});
|
|
8275
|
+
|
|
8035
8276
|
_this.state = {
|
|
8036
8277
|
selected: [ALL_ITEM],
|
|
8037
8278
|
list: [],
|
|
@@ -8040,9 +8281,10 @@
|
|
|
8040
8281
|
};
|
|
8041
8282
|
return _this;
|
|
8042
8283
|
}
|
|
8043
|
-
|
|
8284
|
+
|
|
8044
8285
|
return _createClass(GraphQLMultiSelector);
|
|
8045
8286
|
}(React__default.Component);
|
|
8287
|
+
|
|
8046
8288
|
GraphQLMultiSelector.defaultProps = {
|
|
8047
8289
|
baseClass: 'multiselector'
|
|
8048
8290
|
};
|
|
@@ -8075,22 +8317,24 @@
|
|
|
8075
8317
|
}, function (props) {
|
|
8076
8318
|
return props.theme.marginPaddings[3];
|
|
8077
8319
|
});
|
|
8320
|
+
|
|
8078
8321
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
8079
8322
|
var title = _ref.title,
|
|
8080
|
-
|
|
8081
|
-
|
|
8323
|
+
children = _ref.children,
|
|
8324
|
+
className = _ref.className;
|
|
8082
8325
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
8083
8326
|
className: className
|
|
8084
8327
|
}, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
8085
8328
|
};
|
|
8086
8329
|
|
|
8087
8330
|
var _templateObject$c;
|
|
8331
|
+
|
|
8088
8332
|
var Title$1 = function Title(_ref) {
|
|
8089
8333
|
var baseClass = _ref.baseClass,
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8334
|
+
className = _ref.className,
|
|
8335
|
+
title = _ref.title,
|
|
8336
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
8337
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
8094
8338
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
8095
8339
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
8096
8340
|
title: title
|
|
@@ -8103,6 +8347,7 @@
|
|
|
8103
8347
|
onChange: onSearchChanged
|
|
8104
8348
|
})));
|
|
8105
8349
|
};
|
|
8350
|
+
|
|
8106
8351
|
var StyledTitle = styled__default(Title$1)(_templateObject$c || (_templateObject$c = _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) {
|
|
8107
8352
|
return props.theme.marginPaddings[2];
|
|
8108
8353
|
}, function (props) {
|
|
@@ -8125,26 +8370,37 @@
|
|
|
8125
8370
|
var Title$2 = themed(StyledTitle);
|
|
8126
8371
|
|
|
8127
8372
|
var debounceBuilder = functions.debounced(200);
|
|
8373
|
+
|
|
8128
8374
|
/**
|
|
8129
8375
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
8130
8376
|
*/
|
|
8131
8377
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
8378
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
8379
|
+
|
|
8380
|
+
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
8381
|
+
|
|
8132
8382
|
function LuxityGraphQLMultiselector(props) {
|
|
8133
8383
|
var _this;
|
|
8384
|
+
|
|
8134
8385
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8386
|
+
|
|
8387
|
+
_this = _super.call(this, props);
|
|
8388
|
+
|
|
8389
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
8390
|
+
|
|
8391
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
8138
8392
|
_this.setState(function (prevState) {
|
|
8139
8393
|
return {
|
|
8140
8394
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
8141
8395
|
};
|
|
8142
8396
|
});
|
|
8143
8397
|
});
|
|
8144
|
-
|
|
8398
|
+
|
|
8399
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
8145
8400
|
_this.props.onChange(selection);
|
|
8146
8401
|
});
|
|
8147
|
-
|
|
8402
|
+
|
|
8403
|
+
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
8148
8404
|
event.preventDefault();
|
|
8149
8405
|
var searchText = event.target.value;
|
|
8150
8406
|
debounceBuilder(function () {
|
|
@@ -8153,21 +8409,22 @@
|
|
|
8153
8409
|
});
|
|
8154
8410
|
});
|
|
8155
8411
|
});
|
|
8156
|
-
|
|
8412
|
+
|
|
8413
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
8157
8414
|
var _this$state = _this.state,
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8415
|
+
limit = _this$state.limit,
|
|
8416
|
+
category = _this$state.category,
|
|
8417
|
+
nameFilter = _this$state.nameFilter;
|
|
8161
8418
|
var _this$props = _this.props,
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8419
|
+
title = _this$props.title,
|
|
8420
|
+
baseClass = _this$props.baseClass,
|
|
8421
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
8422
|
+
resultProcessor = _this$props.resultProcessor,
|
|
8423
|
+
itemRenderer = _this$props.itemRenderer,
|
|
8424
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
8425
|
+
graphApi = _this$props.graphApi,
|
|
8426
|
+
identifier = _this$props.identifier,
|
|
8427
|
+
requestInstance = _this$props.requestInstance;
|
|
8171
8428
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8172
8429
|
className: baseClass
|
|
8173
8430
|
}, /*#__PURE__*/React__default.createElement(Title$2, {
|
|
@@ -8190,6 +8447,7 @@
|
|
|
8190
8447
|
itemRenderer: itemRenderer
|
|
8191
8448
|
})));
|
|
8192
8449
|
});
|
|
8450
|
+
|
|
8193
8451
|
_this.state = {
|
|
8194
8452
|
limit: props.baseQueryLimit,
|
|
8195
8453
|
category: props.category,
|
|
@@ -8197,11 +8455,12 @@
|
|
|
8197
8455
|
};
|
|
8198
8456
|
return _this;
|
|
8199
8457
|
}
|
|
8200
|
-
|
|
8201
|
-
|
|
8458
|
+
|
|
8459
|
+
_createClass(LuxityGraphQLMultiselector, [{
|
|
8202
8460
|
key: "componentDidUpdate",
|
|
8203
8461
|
value: function componentDidUpdate(prevProps) {
|
|
8204
8462
|
var _this$multiSelectorRe;
|
|
8463
|
+
|
|
8205
8464
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
8206
8465
|
this.multiSelectorRef.current.emptySelected();
|
|
8207
8466
|
}
|
|
@@ -8214,10 +8473,14 @@
|
|
|
8214
8473
|
category: props.category
|
|
8215
8474
|
};
|
|
8216
8475
|
}
|
|
8476
|
+
|
|
8217
8477
|
return null;
|
|
8218
8478
|
}
|
|
8219
8479
|
}]);
|
|
8480
|
+
|
|
8481
|
+
return LuxityGraphQLMultiselector;
|
|
8220
8482
|
}(React__default.Component);
|
|
8483
|
+
|
|
8221
8484
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
8222
8485
|
baseClass: '',
|
|
8223
8486
|
searchPlaceHolder: '',
|
|
@@ -8226,17 +8489,21 @@
|
|
|
8226
8489
|
};
|
|
8227
8490
|
|
|
8228
8491
|
var _excluded$3 = ["children"];
|
|
8492
|
+
|
|
8229
8493
|
var _templateObject$d;
|
|
8230
8494
|
var Button$3 = styled__default.button(_templateObject$d || (_templateObject$d = _taggedTemplateLiteral(["\n ", ";\n background-color: #fff;\n color: ", ";\n border: 1px solid ", ";\n\n &:disabled {\n ", "\n }\n"])), baseButtonStyle, function (props) {
|
|
8231
8495
|
return props.theme.colors.primary;
|
|
8232
8496
|
}, function (props) {
|
|
8233
8497
|
return props.theme.colors.primary;
|
|
8234
8498
|
}, disabledButtonStyle);
|
|
8499
|
+
|
|
8235
8500
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
8236
8501
|
var children = _ref.children,
|
|
8237
|
-
|
|
8502
|
+
restProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
8503
|
+
|
|
8238
8504
|
return /*#__PURE__*/React__default.createElement(Button$3, restProps, children);
|
|
8239
8505
|
};
|
|
8506
|
+
|
|
8240
8507
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
8241
8508
|
|
|
8242
8509
|
var _templateObject$e;
|
|
@@ -8252,10 +8519,11 @@
|
|
|
8252
8519
|
return props.theme.colors.ntrlMin;
|
|
8253
8520
|
});
|
|
8254
8521
|
var UnselectedButton = themed(BaseButton);
|
|
8522
|
+
|
|
8255
8523
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
8256
8524
|
var item = _ref.item,
|
|
8257
|
-
|
|
8258
|
-
|
|
8525
|
+
onSelect = _ref.onSelect,
|
|
8526
|
+
selected = _ref.selected;
|
|
8259
8527
|
var props = {
|
|
8260
8528
|
onClick: function onClick(e) {
|
|
8261
8529
|
e.preventDefault();
|
|
@@ -8267,12 +8535,12 @@
|
|
|
8267
8535
|
|
|
8268
8536
|
var BrandSelector = function BrandSelector(_ref) {
|
|
8269
8537
|
var onChange = _ref.onChange,
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8538
|
+
category = _ref.category,
|
|
8539
|
+
graphApi = _ref.graphApi,
|
|
8540
|
+
itemRenderer = _ref.itemRenderer,
|
|
8541
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8542
|
+
resultProcessor = _ref.resultProcessor,
|
|
8543
|
+
requestInstance = _ref.requestInstance;
|
|
8276
8544
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8277
8545
|
baseQueryLimit: 16,
|
|
8278
8546
|
title: "Brands",
|
|
@@ -8289,6 +8557,7 @@
|
|
|
8289
8557
|
requestInstance: requestInstance
|
|
8290
8558
|
});
|
|
8291
8559
|
};
|
|
8560
|
+
|
|
8292
8561
|
BrandSelector.defaultProps = {
|
|
8293
8562
|
itemRenderer: ItemRenderer,
|
|
8294
8563
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8298,12 +8567,12 @@
|
|
|
8298
8567
|
|
|
8299
8568
|
var StyleSelector = function StyleSelector(_ref) {
|
|
8300
8569
|
var onChange = _ref.onChange,
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8570
|
+
category = _ref.category,
|
|
8571
|
+
graphApi = _ref.graphApi,
|
|
8572
|
+
itemRenderer = _ref.itemRenderer,
|
|
8573
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8574
|
+
resultProcessor = _ref.resultProcessor,
|
|
8575
|
+
requestInstance = _ref.requestInstance;
|
|
8307
8576
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8308
8577
|
title: "Styles",
|
|
8309
8578
|
queryId: "getStyles",
|
|
@@ -8320,6 +8589,7 @@
|
|
|
8320
8589
|
requestInstance: requestInstance
|
|
8321
8590
|
});
|
|
8322
8591
|
};
|
|
8592
|
+
|
|
8323
8593
|
StyleSelector.defaultProps = {
|
|
8324
8594
|
itemRenderer: ItemRenderer,
|
|
8325
8595
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8334,82 +8604,117 @@
|
|
|
8334
8604
|
};
|
|
8335
8605
|
|
|
8336
8606
|
function _extends$2() {
|
|
8337
|
-
|
|
8338
|
-
for (var
|
|
8339
|
-
var
|
|
8340
|
-
|
|
8607
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
8608
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8609
|
+
var source = arguments[i];
|
|
8610
|
+
|
|
8611
|
+
for (var key in source) {
|
|
8612
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8613
|
+
target[key] = source[key];
|
|
8614
|
+
}
|
|
8615
|
+
}
|
|
8341
8616
|
}
|
|
8342
|
-
|
|
8343
|
-
|
|
8617
|
+
|
|
8618
|
+
return target;
|
|
8619
|
+
};
|
|
8620
|
+
return _extends$2.apply(this, arguments);
|
|
8344
8621
|
}
|
|
8345
8622
|
|
|
8346
|
-
function _assertThisInitialized$2(
|
|
8347
|
-
if (
|
|
8348
|
-
|
|
8623
|
+
function _assertThisInitialized$2(self) {
|
|
8624
|
+
if (self === void 0) {
|
|
8625
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8626
|
+
}
|
|
8627
|
+
|
|
8628
|
+
return self;
|
|
8349
8629
|
}
|
|
8350
8630
|
|
|
8351
|
-
function _setPrototypeOf$2(
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8631
|
+
function _setPrototypeOf$2(o, p) {
|
|
8632
|
+
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
8633
|
+
o.__proto__ = p;
|
|
8634
|
+
return o;
|
|
8635
|
+
};
|
|
8636
|
+
return _setPrototypeOf$2(o, p);
|
|
8355
8637
|
}
|
|
8356
8638
|
|
|
8357
|
-
function _inheritsLoose(
|
|
8358
|
-
|
|
8639
|
+
function _inheritsLoose(subClass, superClass) {
|
|
8640
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
8641
|
+
subClass.prototype.constructor = subClass;
|
|
8642
|
+
_setPrototypeOf$2(subClass, superClass);
|
|
8359
8643
|
}
|
|
8360
8644
|
|
|
8361
|
-
function _getPrototypeOf$2(
|
|
8362
|
-
|
|
8363
|
-
return
|
|
8364
|
-
}
|
|
8645
|
+
function _getPrototypeOf$2(o) {
|
|
8646
|
+
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
8647
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
8648
|
+
};
|
|
8649
|
+
return _getPrototypeOf$2(o);
|
|
8365
8650
|
}
|
|
8366
8651
|
|
|
8367
|
-
function _isNativeFunction(
|
|
8368
|
-
|
|
8369
|
-
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
8370
|
-
} catch (n) {
|
|
8371
|
-
return "function" == typeof t;
|
|
8372
|
-
}
|
|
8652
|
+
function _isNativeFunction(fn) {
|
|
8653
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
8373
8654
|
}
|
|
8374
8655
|
|
|
8375
8656
|
function _isNativeReflectConstruct$1() {
|
|
8657
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
8658
|
+
if (Reflect.construct.sham) return false;
|
|
8659
|
+
if (typeof Proxy === "function") return true;
|
|
8660
|
+
|
|
8376
8661
|
try {
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
return
|
|
8381
|
-
}
|
|
8662
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8663
|
+
return true;
|
|
8664
|
+
} catch (e) {
|
|
8665
|
+
return false;
|
|
8666
|
+
}
|
|
8382
8667
|
}
|
|
8383
8668
|
|
|
8384
|
-
function _construct(
|
|
8385
|
-
if (_isNativeReflectConstruct$1())
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8669
|
+
function _construct(Parent, args, Class) {
|
|
8670
|
+
if (_isNativeReflectConstruct$1()) {
|
|
8671
|
+
_construct = Reflect.construct.bind();
|
|
8672
|
+
} else {
|
|
8673
|
+
_construct = function _construct(Parent, args, Class) {
|
|
8674
|
+
var a = [null];
|
|
8675
|
+
a.push.apply(a, args);
|
|
8676
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
8677
|
+
var instance = new Constructor();
|
|
8678
|
+
if (Class) _setPrototypeOf$2(instance, Class.prototype);
|
|
8679
|
+
return instance;
|
|
8680
|
+
};
|
|
8681
|
+
}
|
|
8682
|
+
|
|
8683
|
+
return _construct.apply(null, arguments);
|
|
8390
8684
|
}
|
|
8391
8685
|
|
|
8392
|
-
function _wrapNativeSuper(
|
|
8393
|
-
var
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
if (
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8686
|
+
function _wrapNativeSuper(Class) {
|
|
8687
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
8688
|
+
|
|
8689
|
+
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
8690
|
+
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
8691
|
+
|
|
8692
|
+
if (typeof Class !== "function") {
|
|
8693
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
8694
|
+
}
|
|
8695
|
+
|
|
8696
|
+
if (typeof _cache !== "undefined") {
|
|
8697
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
8698
|
+
|
|
8699
|
+
_cache.set(Class, Wrapper);
|
|
8400
8700
|
}
|
|
8701
|
+
|
|
8401
8702
|
function Wrapper() {
|
|
8402
|
-
return _construct(
|
|
8703
|
+
return _construct(Class, arguments, _getPrototypeOf$2(this).constructor);
|
|
8403
8704
|
}
|
|
8404
|
-
|
|
8705
|
+
|
|
8706
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
8405
8707
|
constructor: {
|
|
8406
8708
|
value: Wrapper,
|
|
8407
|
-
enumerable:
|
|
8408
|
-
writable:
|
|
8409
|
-
configurable:
|
|
8709
|
+
enumerable: false,
|
|
8710
|
+
writable: true,
|
|
8711
|
+
configurable: true
|
|
8410
8712
|
}
|
|
8411
|
-
})
|
|
8412
|
-
|
|
8713
|
+
});
|
|
8714
|
+
return _setPrototypeOf$2(Wrapper, Class);
|
|
8715
|
+
};
|
|
8716
|
+
|
|
8717
|
+
return _wrapNativeSuper(Class);
|
|
8413
8718
|
}
|
|
8414
8719
|
|
|
8415
8720
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
@@ -9078,9 +9383,10 @@
|
|
|
9078
9383
|
}, function (props) {
|
|
9079
9384
|
return getSliderMarkStyle(props);
|
|
9080
9385
|
});
|
|
9386
|
+
|
|
9081
9387
|
var getSliderMarkStyle = function getSliderMarkStyle(_ref) {
|
|
9082
9388
|
var showMarks = _ref.showMarks,
|
|
9083
|
-
|
|
9389
|
+
primary = _ref.theme.colors.primary;
|
|
9084
9390
|
var visiblityStyle = showMarks ? styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral([""]))) : styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .rc-slider-mark-text,\n .rc-slider-dot {\n visibility: hidden;\n }\n "])));
|
|
9085
9391
|
return styled.css(_templateObject4 || (_templateObject4 = _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);
|
|
9086
9392
|
};
|
|
@@ -9092,24 +9398,28 @@
|
|
|
9092
9398
|
var Footer = styled__default.div(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-end;\n"])));
|
|
9093
9399
|
|
|
9094
9400
|
var _excluded$4 = ["dragging", "value", "offset", "index"],
|
|
9095
|
-
|
|
9401
|
+
_excluded2 = ["renderTitleSection", "marks", "defaultMinValue", "defaultMaxValue", "min", "max", "toolTipComponent", "renderFooterSection", "onChange", "children", "identifier", "showMarks"];
|
|
9402
|
+
|
|
9096
9403
|
var _templateObject$j;
|
|
9097
9404
|
var debounceBuilder$1 = functions.debounced(100);
|
|
9098
9405
|
var ChildrenWrapper = styled__default.div(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
9099
9406
|
return props.theme.marginPaddings[3];
|
|
9100
9407
|
});
|
|
9408
|
+
|
|
9101
9409
|
var renderCustomHandle = function renderCustomHandle() {
|
|
9102
9410
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9103
9411
|
var toolTipComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
9104
9412
|
var handleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
9413
|
+
|
|
9105
9414
|
var dragging = handleProps.dragging,
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9415
|
+
value = handleProps.value,
|
|
9416
|
+
offset = handleProps.offset,
|
|
9417
|
+
index = handleProps.index,
|
|
9418
|
+
restHandleProps = _objectWithoutProperties(handleProps, _excluded$4);
|
|
9419
|
+
|
|
9110
9420
|
var getToolTipProps = function getToolTipProps() {
|
|
9111
|
-
var newProps = {};
|
|
9112
|
-
|
|
9421
|
+
var newProps = {}; // Ensures that Tooltip component does not get ref prop
|
|
9422
|
+
|
|
9113
9423
|
Object.keys(handleProps).forEach(function (propName) {
|
|
9114
9424
|
if (propName !== 'ref') {
|
|
9115
9425
|
newProps[propName] = handleProps[propName];
|
|
@@ -9117,6 +9427,7 @@
|
|
|
9117
9427
|
});
|
|
9118
9428
|
return newProps;
|
|
9119
9429
|
};
|
|
9430
|
+
|
|
9120
9431
|
var Tooltip = toolTipComponent;
|
|
9121
9432
|
return /*#__PURE__*/React__default.createElement(React.Fragment, {
|
|
9122
9433
|
key: index
|
|
@@ -9133,47 +9444,55 @@
|
|
|
9133
9444
|
marks: marks
|
|
9134
9445
|
}, getToolTipProps()))));
|
|
9135
9446
|
};
|
|
9136
|
-
|
|
9137
9447
|
/** slider ui component for react */
|
|
9448
|
+
|
|
9449
|
+
|
|
9138
9450
|
var RangeSlider = function RangeSlider(_ref) {
|
|
9139
9451
|
var renderTitleSection = _ref.renderTitleSection,
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9452
|
+
marks = _ref.marks,
|
|
9453
|
+
defaultMinValue = _ref.defaultMinValue,
|
|
9454
|
+
defaultMaxValue = _ref.defaultMaxValue,
|
|
9455
|
+
min = _ref.min,
|
|
9456
|
+
max = _ref.max,
|
|
9457
|
+
toolTipComponent = _ref.toolTipComponent,
|
|
9458
|
+
renderFooterSection = _ref.renderFooterSection,
|
|
9459
|
+
onChange = _ref.onChange,
|
|
9460
|
+
childRenderer = _ref.children,
|
|
9461
|
+
identifier = _ref.identifier,
|
|
9462
|
+
showMarks = _ref.showMarks,
|
|
9463
|
+
restProps = _objectWithoutProperties(_ref, _excluded2);
|
|
9464
|
+
|
|
9152
9465
|
var _useState = React.useState(defaultMinValue),
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9466
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9467
|
+
currMinVal = _useState2[0],
|
|
9468
|
+
setMinVal = _useState2[1];
|
|
9469
|
+
|
|
9156
9470
|
var _useState3 = React.useState(defaultMaxValue),
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9471
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9472
|
+
currMaxVal = _useState4[0],
|
|
9473
|
+
setMaxVal = _useState4[1];
|
|
9160
9474
|
/*
|
|
9161
9475
|
*Description variable stores the time that the component renders
|
|
9162
9476
|
* the state is used to enforce reenders for the component since the date now
|
|
9163
9477
|
* is always changing
|
|
9164
9478
|
* */
|
|
9479
|
+
|
|
9480
|
+
|
|
9165
9481
|
var _useState5 = React.useState(0),
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9482
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9483
|
+
seed = _useState6[0],
|
|
9484
|
+
setSeed = _useState6[1];
|
|
9485
|
+
|
|
9169
9486
|
var manuallyChangeMinValue = function manuallyChangeMinValue(val) {
|
|
9170
9487
|
setMinVal(val);
|
|
9171
9488
|
setSeed(Date.now());
|
|
9172
9489
|
};
|
|
9490
|
+
|
|
9173
9491
|
var manuallyChangeMaxValue = function manuallyChangeMaxValue(val) {
|
|
9174
9492
|
setMaxVal(val);
|
|
9175
9493
|
setSeed(Date.now());
|
|
9176
9494
|
};
|
|
9495
|
+
|
|
9177
9496
|
var prevMinVal = functions.usePrevious(currMinVal);
|
|
9178
9497
|
var prevMaxVal = functions.usePrevious(currMaxVal);
|
|
9179
9498
|
React.useEffect(function () {
|
|
@@ -9209,8 +9528,9 @@
|
|
|
9209
9528
|
defaultValue: [defaultMinValue, defaultMaxValue],
|
|
9210
9529
|
onChange: function onChange(_ref2) {
|
|
9211
9530
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
9212
|
-
|
|
9213
|
-
|
|
9531
|
+
nextMin = _ref3[0],
|
|
9532
|
+
nextMax = _ref3[1];
|
|
9533
|
+
|
|
9214
9534
|
setMinVal(nextMin);
|
|
9215
9535
|
setMaxVal(nextMax);
|
|
9216
9536
|
},
|
|
@@ -9223,6 +9543,7 @@
|
|
|
9223
9543
|
allowCross: false
|
|
9224
9544
|
}, restProps)), /*#__PURE__*/React__default.createElement(Footer, null, renderFooterSection(actionsObj)));
|
|
9225
9545
|
};
|
|
9546
|
+
|
|
9226
9547
|
RangeSlider.defaultProps = {
|
|
9227
9548
|
renderTitleSection: function renderTitleSection() {
|
|
9228
9549
|
return false;
|
|
@@ -9244,6 +9565,7 @@
|
|
|
9244
9565
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9245
9566
|
return shoe_sizes.length - 1;
|
|
9246
9567
|
};
|
|
9568
|
+
|
|
9247
9569
|
var formatResultsForRangeSlider = function formatResultsForRangeSlider() {
|
|
9248
9570
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9249
9571
|
var newDataShape = {};
|
|
@@ -9253,24 +9575,28 @@
|
|
|
9253
9575
|
});
|
|
9254
9576
|
return newDataShape;
|
|
9255
9577
|
};
|
|
9578
|
+
|
|
9256
9579
|
var ToolTipComponent = function ToolTipComponent(props) {
|
|
9257
9580
|
var marks = props.marks,
|
|
9258
|
-
|
|
9581
|
+
value = props.value;
|
|
9259
9582
|
return /*#__PURE__*/React__default.createElement("div", null, marks[value]);
|
|
9260
9583
|
};
|
|
9261
|
-
|
|
9262
9584
|
/** slider ui component for shoe size selection interests */
|
|
9585
|
+
|
|
9586
|
+
|
|
9263
9587
|
var ShoeSizeSelector = function ShoeSizeSelector(_ref2) {
|
|
9264
9588
|
var onChange = _ref2.onChange,
|
|
9265
|
-
|
|
9589
|
+
shoeSizes = _ref2.shoeSizes;
|
|
9590
|
+
|
|
9266
9591
|
var handleShoeSizeChange = function handleShoeSizeChange(value) {
|
|
9267
9592
|
var min_shoe_key = value.min,
|
|
9268
|
-
|
|
9593
|
+
max_shoe_key = value.max;
|
|
9269
9594
|
onChange({
|
|
9270
9595
|
min_shoe_size_id: shoeSizes[min_shoe_key].id,
|
|
9271
9596
|
max_shoe_size_id: shoeSizes[max_shoe_key].id
|
|
9272
9597
|
});
|
|
9273
9598
|
};
|
|
9599
|
+
|
|
9274
9600
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9275
9601
|
var giveFullRange = actionObj.giveFullRange;
|
|
9276
9602
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
@@ -9279,6 +9605,7 @@
|
|
|
9279
9605
|
onClick: giveFullRange
|
|
9280
9606
|
}, "Full Shoe Size Range"));
|
|
9281
9607
|
};
|
|
9608
|
+
|
|
9282
9609
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
9283
9610
|
identifier: "shoe-size-range-slider",
|
|
9284
9611
|
marks: formatResultsForRangeSlider(shoeSizes),
|
|
@@ -9291,6 +9618,7 @@
|
|
|
9291
9618
|
onChange: handleShoeSizeChange
|
|
9292
9619
|
}));
|
|
9293
9620
|
};
|
|
9621
|
+
|
|
9294
9622
|
ShoeSizeSelector.defaultProps = {
|
|
9295
9623
|
onChange: function onChange() {
|
|
9296
9624
|
return false;
|
|
@@ -9339,6 +9667,7 @@
|
|
|
9339
9667
|
var inputMarginRight = '0.2em';
|
|
9340
9668
|
var CheckboxLabel = styled__default.label(_templateObject$s || (_templateObject$s = _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) {
|
|
9341
9669
|
var _props$theme;
|
|
9670
|
+
|
|
9342
9671
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
|
|
9343
9672
|
}, function (props) {
|
|
9344
9673
|
return props.theme.fontSizes[4];
|
|
@@ -9362,14 +9691,16 @@
|
|
|
9362
9691
|
*/
|
|
9363
9692
|
var RadioButtons = function RadioButtons(_ref) {
|
|
9364
9693
|
var options = _ref.options,
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9694
|
+
name = _ref.name,
|
|
9695
|
+
noWrap = _ref.noWrap,
|
|
9696
|
+
title = _ref.title,
|
|
9697
|
+
errors = _ref.errors;
|
|
9698
|
+
|
|
9369
9699
|
var _useState = React.useState(errors[name]),
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9700
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9701
|
+
errMsg = _useState2[0],
|
|
9702
|
+
setErrMsg = _useState2[1];
|
|
9703
|
+
|
|
9373
9704
|
React.useEffect(function () {
|
|
9374
9705
|
setErrMsg(errors[name]);
|
|
9375
9706
|
}, [errors, name]);
|
|
@@ -9377,15 +9708,15 @@
|
|
|
9377
9708
|
noWrap: noWrap
|
|
9378
9709
|
}, options.map(function (_ref2, index) {
|
|
9379
9710
|
var _ref2$actionCallback = _ref2.actionCallback,
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9711
|
+
actionCallback = _ref2$actionCallback === void 0 ? function () {
|
|
9712
|
+
return null;
|
|
9713
|
+
} : _ref2$actionCallback,
|
|
9714
|
+
_ref2$value = _ref2.value,
|
|
9715
|
+
value = _ref2$value === void 0 ? '' : _ref2$value,
|
|
9716
|
+
_ref2$innerText = _ref2.innerText,
|
|
9717
|
+
innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
|
|
9718
|
+
_ref2$checked = _ref2.checked,
|
|
9719
|
+
checked = _ref2$checked === void 0 ? false : _ref2$checked;
|
|
9389
9720
|
return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
|
|
9390
9721
|
key: "".concat(name, "-").concat(index),
|
|
9391
9722
|
htmlFor: "".concat(name, "_").concat(index)
|
|
@@ -9402,6 +9733,7 @@
|
|
|
9402
9733
|
}), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
|
|
9403
9734
|
}))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage$1, null, errMsg));
|
|
9404
9735
|
};
|
|
9736
|
+
|
|
9405
9737
|
RadioButtons.defaultProps = {
|
|
9406
9738
|
noWrap: false,
|
|
9407
9739
|
title: '',
|
|
@@ -9433,14 +9765,17 @@
|
|
|
9433
9765
|
ShoeSizeFadeContainer.defaultProps = {
|
|
9434
9766
|
childVisible: false
|
|
9435
9767
|
};
|
|
9768
|
+
|
|
9436
9769
|
var OpacityTransitionRender = function OpacityTransitionRender(_ref) {
|
|
9437
9770
|
var shoeSizeType = _ref.shoeSizeType,
|
|
9438
|
-
|
|
9771
|
+
children = _ref.children;
|
|
9439
9772
|
var prevShoeSizeType = functions.usePrevious(shoeSizeType);
|
|
9773
|
+
|
|
9440
9774
|
var _React$useState = React__default.useState(false),
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9775
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9776
|
+
childVisible = _React$useState2[0],
|
|
9777
|
+
setChildVisible = _React$useState2[1];
|
|
9778
|
+
|
|
9444
9779
|
React__default.useEffect(function () {
|
|
9445
9780
|
if (prevShoeSizeType !== shoeSizeType) {
|
|
9446
9781
|
setChildVisible(false);
|
|
@@ -9453,25 +9788,30 @@
|
|
|
9453
9788
|
childVisible: childVisible
|
|
9454
9789
|
}, children);
|
|
9455
9790
|
};
|
|
9791
|
+
|
|
9456
9792
|
var WrappedShoeSizeSelector = function WrappedShoeSizeSelector(_ref2) {
|
|
9457
9793
|
var onChange = _ref2.onChange,
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9794
|
+
requestInstance = _ref2.requestInstance,
|
|
9795
|
+
graphApi = _ref2.graphApi,
|
|
9796
|
+
defaultShoeSizeType = _ref2.defaultShoeSizeType,
|
|
9797
|
+
getGraphQuery = _ref2.getGraphQuery;
|
|
9798
|
+
|
|
9462
9799
|
var _useState = React.useState(defaultShoeSizeType),
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9800
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9801
|
+
shoeSizeType = _useState2[0],
|
|
9802
|
+
setShoeSizeType = _useState2[1];
|
|
9803
|
+
|
|
9466
9804
|
var _useState3 = React.useState(defaultShoeSizeType),
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9805
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9806
|
+
transitionedTo = _useState4[0],
|
|
9807
|
+
setTransitionedTo = _useState4[1];
|
|
9808
|
+
|
|
9470
9809
|
var triggerRequest = function triggerRequest() {
|
|
9471
9810
|
return requestInstance.post(graphApi, {
|
|
9472
9811
|
query: getGraphQuery()
|
|
9473
9812
|
});
|
|
9474
9813
|
};
|
|
9814
|
+
|
|
9475
9815
|
var shoeSizeTypeProps = {
|
|
9476
9816
|
name: 'shoe_size_type',
|
|
9477
9817
|
noWrap: true,
|
|
@@ -9495,12 +9835,15 @@
|
|
|
9495
9835
|
checked: shoeSizeType === shoeSizeTypes.eu.value
|
|
9496
9836
|
}]
|
|
9497
9837
|
};
|
|
9838
|
+
|
|
9498
9839
|
var handlePropOnChange = function handlePropOnChange(value) {
|
|
9499
9840
|
var payload = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
9500
9841
|
shoe_size_type: shoeSizeType
|
|
9501
9842
|
});
|
|
9843
|
+
|
|
9502
9844
|
onChange(payload);
|
|
9503
9845
|
};
|
|
9846
|
+
|
|
9504
9847
|
var renderShoeSizeSelector = function renderShoeSizeSelector() {
|
|
9505
9848
|
var passedShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9506
9849
|
return /*#__PURE__*/React__default.createElement(ShoeSizeSelector, {
|
|
@@ -9510,32 +9853,38 @@
|
|
|
9510
9853
|
}
|
|
9511
9854
|
});
|
|
9512
9855
|
};
|
|
9856
|
+
|
|
9513
9857
|
var getShoeSizeSelector = function getShoeSizeSelector() {
|
|
9514
9858
|
var euShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9515
9859
|
var ukShoeShoes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
9860
|
+
|
|
9516
9861
|
if (shoeSizeType === shoeSizeTypes.eu.value) {
|
|
9517
9862
|
return renderShoeSizeSelector(euShoeSizes);
|
|
9518
9863
|
}
|
|
9864
|
+
|
|
9519
9865
|
if (shoeSizeType === shoeSizeTypes.uk.value) {
|
|
9520
9866
|
return renderShoeSizeSelector(ukShoeShoes);
|
|
9521
9867
|
}
|
|
9868
|
+
|
|
9522
9869
|
return null;
|
|
9523
9870
|
};
|
|
9871
|
+
|
|
9524
9872
|
return /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9525
9873
|
getRequestPromise: triggerRequest
|
|
9526
9874
|
}, /*#__PURE__*/React__default.createElement(TitleWrapper, null, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9527
9875
|
title: "Shoe Size Range"
|
|
9528
9876
|
}, /*#__PURE__*/React__default.createElement(RadioButtons$1, shoeSizeTypeProps))), /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Consumer, null, function (_ref3) {
|
|
9529
9877
|
var _ref3$data$data = _ref3.data.data,
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9878
|
+
_ref3$data$data$luxit = _ref3$data$data.luxity_eu_shoe_sizes,
|
|
9879
|
+
luxity_eu_shoe_sizes = _ref3$data$data$luxit === void 0 ? [] : _ref3$data$data$luxit,
|
|
9880
|
+
_ref3$data$data$luxit2 = _ref3$data$data.luxity_uk_shoe_sizes,
|
|
9881
|
+
luxity_uk_shoe_sizes = _ref3$data$data$luxit2 === void 0 ? [] : _ref3$data$data$luxit2;
|
|
9534
9882
|
return /*#__PURE__*/React__default.createElement(OpacityTransitionRender, {
|
|
9535
9883
|
shoeSizeType: transitionedTo
|
|
9536
9884
|
}, getShoeSizeSelector(luxity_eu_shoe_sizes, luxity_uk_shoe_sizes));
|
|
9537
9885
|
}));
|
|
9538
9886
|
};
|
|
9887
|
+
|
|
9539
9888
|
WrappedShoeSizeSelector.defaultProps = {
|
|
9540
9889
|
onChange: function onChange() {
|
|
9541
9890
|
return false;
|
|
@@ -9547,28 +9896,31 @@
|
|
|
9547
9896
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9548
9897
|
return value.replace(/\D/g, '');
|
|
9549
9898
|
};
|
|
9550
|
-
|
|
9551
9899
|
/**
|
|
9552
9900
|
* Currency Input which formats the value to a specific format
|
|
9553
9901
|
*/
|
|
9902
|
+
|
|
9554
9903
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
9555
9904
|
var value = _ref.value,
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9905
|
+
onChange = _ref.onChange,
|
|
9906
|
+
prefix = _ref.prefix,
|
|
9907
|
+
allowNegativeValue = _ref.allowNegativeValue,
|
|
9908
|
+
groupSeparator = _ref.groupSeparator,
|
|
9909
|
+
decimalSeparator = _ref.decimalSeparator,
|
|
9910
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
9911
|
+
|
|
9562
9912
|
var handleValueChange = function handleValueChange(event) {
|
|
9563
9913
|
var inputValue = event.target.value;
|
|
9564
9914
|
var unmaskedValue = unMask(inputValue);
|
|
9565
9915
|
onChange(unmaskedValue);
|
|
9566
9916
|
};
|
|
9917
|
+
|
|
9567
9918
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
9568
9919
|
var numericValue = Number(originalValue);
|
|
9569
9920
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
9570
9921
|
return prefix + formattedValue;
|
|
9571
9922
|
};
|
|
9923
|
+
|
|
9572
9924
|
var formattedValue = formatCurrency(value);
|
|
9573
9925
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
9574
9926
|
type: "text",
|
|
@@ -9576,6 +9928,7 @@
|
|
|
9576
9928
|
onChange: handleValueChange
|
|
9577
9929
|
}));
|
|
9578
9930
|
};
|
|
9931
|
+
|
|
9579
9932
|
CurrencyInputFormatter.defaultProps = {
|
|
9580
9933
|
value: '',
|
|
9581
9934
|
prefix: 'R',
|
|
@@ -9586,6 +9939,7 @@
|
|
|
9586
9939
|
};
|
|
9587
9940
|
|
|
9588
9941
|
var _excluded$6 = ["children"];
|
|
9942
|
+
|
|
9589
9943
|
var _templateObject$u;
|
|
9590
9944
|
var Button$4 = styled__default.button(_templateObject$u || (_templateObject$u = _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) {
|
|
9591
9945
|
return props.theme.colors.ntrlMin;
|
|
@@ -9600,11 +9954,14 @@
|
|
|
9600
9954
|
}, disabledButtonStyle, function (props) {
|
|
9601
9955
|
return props.theme.colors.base;
|
|
9602
9956
|
});
|
|
9957
|
+
|
|
9603
9958
|
var SecondaryButton = function SecondaryButton(_ref) {
|
|
9604
9959
|
var children = _ref.children,
|
|
9605
|
-
|
|
9960
|
+
restProps = _objectWithoutProperties(_ref, _excluded$6);
|
|
9961
|
+
|
|
9606
9962
|
return /*#__PURE__*/React__default.createElement(Button$4, restProps, children);
|
|
9607
9963
|
};
|
|
9964
|
+
|
|
9608
9965
|
var SecondaryButton$1 = themed(SecondaryButton);
|
|
9609
9966
|
|
|
9610
9967
|
var _templateObject$v;
|
|
@@ -9613,23 +9970,31 @@
|
|
|
9613
9970
|
});
|
|
9614
9971
|
|
|
9615
9972
|
var debounceBuilder$2 = functions.debounced(50);
|
|
9973
|
+
|
|
9616
9974
|
var getMaxPrice = function getMaxPrice() {
|
|
9617
9975
|
var interestCategory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9976
|
+
|
|
9618
9977
|
switch (interestCategory) {
|
|
9619
9978
|
case interestCategories.ACCESSORIES:
|
|
9620
9979
|
return interestCategoryMaxPrices.ACCESSORIES;
|
|
9980
|
+
|
|
9621
9981
|
case interestCategories.BAGS:
|
|
9622
9982
|
return interestCategoryMaxPrices.BAGS;
|
|
9983
|
+
|
|
9623
9984
|
case interestCategories.SHOES:
|
|
9624
9985
|
return interestCategoryMaxPrices.SHOES;
|
|
9986
|
+
|
|
9625
9987
|
case interestCategories.WATCHES:
|
|
9626
9988
|
return interestCategoryMaxPrices.WATCHES;
|
|
9989
|
+
|
|
9627
9990
|
case interestCategories.APPAREL:
|
|
9628
9991
|
return interestCategoryMaxPrices.APPAREL;
|
|
9992
|
+
|
|
9629
9993
|
default:
|
|
9630
9994
|
return 0;
|
|
9631
9995
|
}
|
|
9632
9996
|
};
|
|
9997
|
+
|
|
9633
9998
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9634
9999
|
var giveFullRange = actionObj.giveFullRange;
|
|
9635
10000
|
return /*#__PURE__*/React__default.createElement(SecondaryButton$1, {
|
|
@@ -9637,21 +10002,24 @@
|
|
|
9637
10002
|
onClick: giveFullRange
|
|
9638
10003
|
}, "Full Price Range");
|
|
9639
10004
|
};
|
|
9640
|
-
|
|
9641
10005
|
/** UI Slider with minimum and max input fields give the ability to
|
|
9642
10006
|
* select a price range */
|
|
10007
|
+
|
|
10008
|
+
|
|
9643
10009
|
var PriceRangeSelector = function PriceRangeSelector(_ref) {
|
|
9644
10010
|
var onChange = _ref.onChange,
|
|
9645
|
-
|
|
10011
|
+
category = _ref.category;
|
|
9646
10012
|
var maxPrice = getMaxPrice(category);
|
|
10013
|
+
|
|
9647
10014
|
var handleSlideChange = function handleSlideChange(value) {
|
|
9648
10015
|
var min_price = value.min,
|
|
9649
|
-
|
|
10016
|
+
max_price = value.max;
|
|
9650
10017
|
onChange({
|
|
9651
10018
|
min_price: min_price,
|
|
9652
10019
|
max_price: max_price
|
|
9653
10020
|
});
|
|
9654
10021
|
};
|
|
10022
|
+
|
|
9655
10023
|
var handleMinCurrencyChange = function handleMinCurrencyChange(targetValue, currMaxVal, manuallyChangeMinValue) {
|
|
9656
10024
|
var value = parseInt(unMask(targetValue), 10);
|
|
9657
10025
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9664,6 +10032,7 @@
|
|
|
9664
10032
|
});
|
|
9665
10033
|
});
|
|
9666
10034
|
};
|
|
10035
|
+
|
|
9667
10036
|
var handleMaxCurrencyChange = function handleMaxCurrencyChange(targetValue, currMinVal, manuallyChangeMaxValue) {
|
|
9668
10037
|
var value = parseInt(unMask(targetValue), 10);
|
|
9669
10038
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9676,6 +10045,7 @@
|
|
|
9676
10045
|
});
|
|
9677
10046
|
});
|
|
9678
10047
|
};
|
|
10048
|
+
|
|
9679
10049
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9680
10050
|
className: "price-ranges"
|
|
9681
10051
|
}, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
@@ -9694,9 +10064,9 @@
|
|
|
9694
10064
|
title: "Price Ranges"
|
|
9695
10065
|
}, function (_ref2) {
|
|
9696
10066
|
var manuallyChangeMinValue = _ref2.manuallyChangeMinValue,
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
10067
|
+
manuallyChangeMaxValue = _ref2.manuallyChangeMaxValue,
|
|
10068
|
+
currMinVal = _ref2.currMinVal,
|
|
10069
|
+
currMaxVal = _ref2.currMaxVal;
|
|
9700
10070
|
return /*#__PURE__*/React__default.createElement(CurrencyInputWrapper, null, /*#__PURE__*/React__default.createElement(CurrencyInputFormatter, {
|
|
9701
10071
|
"data-qe-id": "masked-input-min",
|
|
9702
10072
|
value: currMinVal,
|
|
@@ -9712,6 +10082,7 @@
|
|
|
9712
10082
|
}));
|
|
9713
10083
|
}));
|
|
9714
10084
|
};
|
|
10085
|
+
|
|
9715
10086
|
PriceRangeSelector.defaultProps = {
|
|
9716
10087
|
onChange: function onChange() {
|
|
9717
10088
|
return false;
|
|
@@ -9735,6 +10106,7 @@
|
|
|
9735
10106
|
});
|
|
9736
10107
|
|
|
9737
10108
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10109
|
+
|
|
9738
10110
|
var _templateObject$x, _templateObject2$6, _templateObject3$1;
|
|
9739
10111
|
var Content = styled__default.div(_templateObject$x || (_templateObject$x = _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) {
|
|
9740
10112
|
return props.theme.colors.primary;
|
|
@@ -9753,32 +10125,36 @@
|
|
|
9753
10125
|
}, Content, InputText, function (props) {
|
|
9754
10126
|
return props.theme.colors.ntrlMin;
|
|
9755
10127
|
}, Content);
|
|
9756
|
-
|
|
9757
10128
|
/**
|
|
9758
10129
|
* CheckButton: Styled checkbox that resembles a button
|
|
9759
10130
|
* */
|
|
10131
|
+
|
|
9760
10132
|
var CheckButton = function CheckButton(props) {
|
|
9761
10133
|
var title = props.title,
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
10134
|
+
checked = props.checked,
|
|
10135
|
+
renderIcon = props.renderIcon,
|
|
10136
|
+
onChange = props.onChange,
|
|
10137
|
+
checkedValue = props.checkedValue,
|
|
10138
|
+
unCheckedValue = props.unCheckedValue,
|
|
10139
|
+
restProps = _objectWithoutProperties(props, _excluded$7);
|
|
10140
|
+
|
|
9768
10141
|
var _React$useState = React__default.useState(checked),
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
10142
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10143
|
+
checkedState = _React$useState2[0],
|
|
10144
|
+
setCheck = _React$useState2[1];
|
|
10145
|
+
|
|
9772
10146
|
var prevCheckState = functions.usePrevious(checkedState);
|
|
9773
10147
|
React__default.useEffect(function () {
|
|
9774
10148
|
if (prevCheckState !== checkedState) {
|
|
9775
10149
|
onChange(checkedState);
|
|
9776
10150
|
}
|
|
9777
10151
|
}, [checkedState, onChange, prevCheckState]);
|
|
10152
|
+
|
|
9778
10153
|
var handleInputChange = function handleInputChange(e) {
|
|
9779
10154
|
var targetChecked = e.target.checked;
|
|
9780
10155
|
setCheck(targetChecked);
|
|
9781
10156
|
};
|
|
10157
|
+
|
|
9782
10158
|
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
9783
10159
|
defaultChecked: checked
|
|
9784
10160
|
}, restProps, {
|
|
@@ -9786,6 +10162,7 @@
|
|
|
9786
10162
|
onChange: handleInputChange
|
|
9787
10163
|
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
9788
10164
|
};
|
|
10165
|
+
|
|
9789
10166
|
CheckButton.defaultProps = {
|
|
9790
10167
|
title: '',
|
|
9791
10168
|
checked: false,
|
|
@@ -9799,24 +10176,29 @@
|
|
|
9799
10176
|
var CheckButton$1 = themed(CheckButton);
|
|
9800
10177
|
|
|
9801
10178
|
var MALE = genders.MALE,
|
|
9802
|
-
|
|
10179
|
+
FEMALE = genders.FEMALE;
|
|
10180
|
+
|
|
9803
10181
|
/**
|
|
9804
10182
|
* Stylized CheckboxButton for selecting gender
|
|
9805
10183
|
* */
|
|
9806
10184
|
var GenderCheckbox = function GenderCheckbox(_ref) {
|
|
9807
10185
|
var gender = _ref.gender,
|
|
9808
|
-
|
|
9809
|
-
|
|
10186
|
+
checked = _ref.checked,
|
|
10187
|
+
onInputChange = _ref.onInputChange;
|
|
10188
|
+
|
|
9810
10189
|
var getTitle = function getTitle() {
|
|
9811
10190
|
switch (gender) {
|
|
9812
10191
|
case MALE:
|
|
9813
10192
|
return 'Male';
|
|
10193
|
+
|
|
9814
10194
|
case FEMALE:
|
|
9815
10195
|
return 'Female';
|
|
10196
|
+
|
|
9816
10197
|
default:
|
|
9817
10198
|
return '';
|
|
9818
10199
|
}
|
|
9819
10200
|
};
|
|
10201
|
+
|
|
9820
10202
|
return /*#__PURE__*/React__default.createElement(CheckButton$1, {
|
|
9821
10203
|
onChange: onInputChange,
|
|
9822
10204
|
checked: checked,
|
|
@@ -9824,20 +10206,22 @@
|
|
|
9824
10206
|
title: getTitle()
|
|
9825
10207
|
});
|
|
9826
10208
|
};
|
|
10209
|
+
|
|
9827
10210
|
GenderCheckbox.defaultProps = {
|
|
9828
10211
|
name: ''
|
|
9829
10212
|
};
|
|
9830
10213
|
|
|
9831
10214
|
var MALE$1 = genders.MALE,
|
|
9832
|
-
|
|
10215
|
+
FEMALE$1 = genders.FEMALE;
|
|
10216
|
+
|
|
9833
10217
|
/**
|
|
9834
10218
|
* GenderSelector: specialized selector to pick genders for the Interest Component
|
|
9835
10219
|
* */
|
|
9836
10220
|
var GenderSelector = function GenderSelector(_ref) {
|
|
9837
10221
|
var gender = _ref.gender,
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
10222
|
+
onChange = _ref.onChange,
|
|
10223
|
+
maleInputRef = _ref.maleInputRef,
|
|
10224
|
+
femaleInputRef = _ref.femaleInputRef;
|
|
9841
10225
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9842
10226
|
className: "gender-selector"
|
|
9843
10227
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -9862,6 +10246,7 @@
|
|
|
9862
10246
|
checkBoxButtonRef: femaleInputRef
|
|
9863
10247
|
})));
|
|
9864
10248
|
};
|
|
10249
|
+
|
|
9865
10250
|
GenderSelector.defaultProps = {
|
|
9866
10251
|
gender: null,
|
|
9867
10252
|
onChange: function onChange() {
|
|
@@ -9872,13 +10257,15 @@
|
|
|
9872
10257
|
|
|
9873
10258
|
var ConditionSelector = function ConditionSelector(_ref) {
|
|
9874
10259
|
var onChange = _ref.onChange,
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
10260
|
+
graphApi = _ref.graphApi,
|
|
10261
|
+
itemRenderer = _ref.itemRenderer,
|
|
10262
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
10263
|
+
requestInstance = _ref.requestInstance;
|
|
10264
|
+
|
|
9879
10265
|
var resultProcessor = function resultProcessor(result) {
|
|
9880
10266
|
return result.data.data.conditions_list;
|
|
9881
10267
|
};
|
|
10268
|
+
|
|
9882
10269
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
9883
10270
|
title: "Condition",
|
|
9884
10271
|
queryId: "getCondition",
|
|
@@ -9895,6 +10282,7 @@
|
|
|
9895
10282
|
requestInstance: requestInstance
|
|
9896
10283
|
});
|
|
9897
10284
|
};
|
|
10285
|
+
|
|
9898
10286
|
ConditionSelector.defaultProps = {
|
|
9899
10287
|
itemRenderer: ItemRenderer
|
|
9900
10288
|
};
|
|
@@ -9933,30 +10321,41 @@
|
|
|
9933
10321
|
request: _objectSpread2({}, request),
|
|
9934
10322
|
isCategoriesShown: false
|
|
9935
10323
|
};
|
|
9936
|
-
|
|
9937
10324
|
/**
|
|
9938
10325
|
* Generates Interest UI and submits graph payloads as a highly specialised component
|
|
9939
10326
|
*/
|
|
10327
|
+
|
|
9940
10328
|
var AddInterest = /*#__PURE__*/function (_React$Component) {
|
|
10329
|
+
_inherits(AddInterest, _React$Component);
|
|
10330
|
+
|
|
10331
|
+
var _super = _createSuper(AddInterest);
|
|
10332
|
+
|
|
9941
10333
|
function AddInterest(props) {
|
|
9942
10334
|
var _this;
|
|
10335
|
+
|
|
9943
10336
|
_classCallCheck(this, AddInterest);
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
_defineProperty(_this, "
|
|
10337
|
+
|
|
10338
|
+
_this = _super.call(this, props);
|
|
10339
|
+
|
|
10340
|
+
_defineProperty(_assertThisInitialized(_this), "maleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10341
|
+
|
|
10342
|
+
_defineProperty(_assertThisInitialized(_this), "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10343
|
+
|
|
10344
|
+
_defineProperty(_assertThisInitialized(_this), "onCategoryChanged", function (categoryType) {
|
|
9948
10345
|
_this.setState({
|
|
9949
10346
|
category_type: categoryType,
|
|
9950
10347
|
brands: [],
|
|
9951
10348
|
styles: []
|
|
9952
10349
|
});
|
|
9953
10350
|
});
|
|
9954
|
-
|
|
10351
|
+
|
|
10352
|
+
_defineProperty(_assertThisInitialized(_this), "onGenderChanged", function (isChecked, gender) {
|
|
9955
10353
|
return _this.setState(function (prevState) {
|
|
9956
10354
|
// current array of options
|
|
9957
10355
|
var gendersSelected = _toConsumableArray(prevState.gender);
|
|
9958
|
-
|
|
9959
|
-
// check if the check box is checked or unchecked
|
|
10356
|
+
|
|
10357
|
+
var index; // check if the check box is checked or unchecked
|
|
10358
|
+
|
|
9960
10359
|
if (isChecked) {
|
|
9961
10360
|
gendersSelected.push(gender);
|
|
9962
10361
|
} else {
|
|
@@ -9964,65 +10363,76 @@
|
|
|
9964
10363
|
index = gendersSelected.indexOf(gender);
|
|
9965
10364
|
gendersSelected.splice(index, 1);
|
|
9966
10365
|
}
|
|
10366
|
+
|
|
9967
10367
|
return {
|
|
9968
10368
|
gender: gendersSelected
|
|
9969
10369
|
};
|
|
9970
10370
|
});
|
|
9971
10371
|
});
|
|
9972
|
-
|
|
10372
|
+
|
|
10373
|
+
_defineProperty(_assertThisInitialized(_this), "onBrandsChanged", function (brandsArray) {
|
|
9973
10374
|
_this.setState({
|
|
9974
10375
|
brands: brandsArray.map(function (brand) {
|
|
9975
10376
|
return brand.id;
|
|
9976
10377
|
})
|
|
9977
10378
|
});
|
|
9978
10379
|
});
|
|
9979
|
-
|
|
10380
|
+
|
|
10381
|
+
_defineProperty(_assertThisInitialized(_this), "onShoeSizesChanged", function (shoeSizes) {
|
|
9980
10382
|
_this.setState(_objectSpread2({}, shoeSizes));
|
|
9981
10383
|
});
|
|
9982
|
-
|
|
10384
|
+
|
|
10385
|
+
_defineProperty(_assertThisInitialized(_this), "onPriceRangesChanged", function (priceRange) {
|
|
9983
10386
|
_this.setState(_objectSpread2({}, priceRange));
|
|
9984
10387
|
});
|
|
9985
|
-
|
|
10388
|
+
|
|
10389
|
+
_defineProperty(_assertThisInitialized(_this), "onStylesChanged", function (stylesArray) {
|
|
9986
10390
|
_this.setState({
|
|
9987
10391
|
styles: stylesArray.map(function (style) {
|
|
9988
10392
|
return style.id;
|
|
9989
10393
|
})
|
|
9990
10394
|
});
|
|
9991
10395
|
});
|
|
9992
|
-
|
|
10396
|
+
|
|
10397
|
+
_defineProperty(_assertThisInitialized(_this), "onConditionChanged", function (conditions) {
|
|
9993
10398
|
_this.setState({
|
|
9994
10399
|
condition: conditions.map(function (condition) {
|
|
9995
10400
|
return condition.id;
|
|
9996
10401
|
})
|
|
9997
10402
|
});
|
|
9998
10403
|
});
|
|
9999
|
-
|
|
10404
|
+
|
|
10405
|
+
_defineProperty(_assertThisInitialized(_this), "payloadIsValid", function () {
|
|
10000
10406
|
// price/shoe-size always have initial values as soon as category is set
|
|
10001
10407
|
var category_type = _this.state.category_type;
|
|
10002
10408
|
return category_type !== null;
|
|
10003
10409
|
});
|
|
10004
|
-
|
|
10410
|
+
|
|
10411
|
+
_defineProperty(_assertThisInitialized(_this), "submitInterest", function () {
|
|
10005
10412
|
_this.setState({
|
|
10006
10413
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10007
10414
|
fetching: true
|
|
10008
10415
|
})
|
|
10009
10416
|
});
|
|
10417
|
+
|
|
10010
10418
|
var _this$state = _this.state,
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10419
|
+
brands = _this$state.brands,
|
|
10420
|
+
min_shoe_size_id = _this$state.min_shoe_size_id,
|
|
10421
|
+
max_shoe_size_id = _this$state.max_shoe_size_id,
|
|
10422
|
+
shoe_size_type = _this$state.shoe_size_type,
|
|
10423
|
+
min_price = _this$state.min_price,
|
|
10424
|
+
max_price = _this$state.max_price,
|
|
10425
|
+
styles = _this$state.styles,
|
|
10426
|
+
category_type = _this$state.category_type,
|
|
10427
|
+
requestState = _this$state.request,
|
|
10428
|
+
gender = _this$state.gender,
|
|
10429
|
+
condition = _this$state.condition;
|
|
10022
10430
|
var payloadGender = gender[0];
|
|
10431
|
+
|
|
10023
10432
|
if (gender.length > 1 || !gender.length) {
|
|
10024
10433
|
payloadGender = UNISEX;
|
|
10025
10434
|
}
|
|
10435
|
+
|
|
10026
10436
|
var basePayload = {
|
|
10027
10437
|
category_type: category_type,
|
|
10028
10438
|
brands: brands,
|
|
@@ -10038,21 +10448,27 @@
|
|
|
10038
10448
|
max_shoe_size_id: max_shoe_size_id,
|
|
10039
10449
|
shoe_size_type: shoe_size_type
|
|
10040
10450
|
} : {};
|
|
10451
|
+
|
|
10041
10452
|
var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
|
|
10453
|
+
|
|
10042
10454
|
simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
|
|
10043
10455
|
_this.setState({
|
|
10044
10456
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10045
10457
|
success: true
|
|
10046
10458
|
})
|
|
10047
10459
|
});
|
|
10460
|
+
|
|
10048
10461
|
_this.props.onSubmitSuccess(_objectSpread2({}, payload));
|
|
10049
10462
|
}, _this.handleRequestError);
|
|
10050
10463
|
});
|
|
10051
|
-
|
|
10464
|
+
|
|
10465
|
+
_defineProperty(_assertThisInitialized(_this), "handleRequestError", function (_ref) {
|
|
10052
10466
|
var data = _ref.data;
|
|
10467
|
+
|
|
10053
10468
|
_this.setState({
|
|
10054
10469
|
request: _objectSpread2({}, request)
|
|
10055
10470
|
});
|
|
10471
|
+
|
|
10056
10472
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
10057
10473
|
return data[key];
|
|
10058
10474
|
}).flat();
|
|
@@ -10062,32 +10478,37 @@
|
|
|
10062
10478
|
}, message);
|
|
10063
10479
|
}));
|
|
10064
10480
|
});
|
|
10065
|
-
|
|
10481
|
+
|
|
10482
|
+
_defineProperty(_assertThisInitialized(_this), "resetState", function () {
|
|
10066
10483
|
_this.setState(_objectSpread2({}, defaultState));
|
|
10484
|
+
|
|
10067
10485
|
_this.props.onCancel();
|
|
10068
10486
|
});
|
|
10069
|
-
|
|
10487
|
+
|
|
10488
|
+
_defineProperty(_assertThisInitialized(_this), "handleGenderChange", function (isChecked, gender) {
|
|
10070
10489
|
return _this.onGenderChanged(isChecked, gender);
|
|
10071
10490
|
});
|
|
10072
|
-
|
|
10491
|
+
|
|
10492
|
+
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function () {
|
|
10073
10493
|
_this.setState(function (prevState) {
|
|
10074
10494
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10075
10495
|
isCategoriesShown: true
|
|
10076
10496
|
});
|
|
10077
10497
|
});
|
|
10078
10498
|
});
|
|
10079
|
-
|
|
10499
|
+
|
|
10500
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10080
10501
|
var _this$state2 = _this.state,
|
|
10081
|
-
|
|
10082
|
-
|
|
10502
|
+
category_type = _this$state2.category_type,
|
|
10503
|
+
fetching = _this$state2.request.fetching;
|
|
10083
10504
|
var _this$props = _this.props,
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10505
|
+
requestInstance = _this$props.requestInstance,
|
|
10506
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
10507
|
+
getBrandsGraphQuery = _this$props.getBrandsGraphQuery,
|
|
10508
|
+
getStylesGraphQuery = _this$props.getStylesGraphQuery,
|
|
10509
|
+
getShoesGraphQuery = _this$props.getShoesGraphQuery,
|
|
10510
|
+
defaultShoeSizeType = _this$props.defaultShoeSizeType,
|
|
10511
|
+
getConditionsGraphQuery = _this$props.getConditionsGraphQuery;
|
|
10091
10512
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10092
10513
|
className: "interests__section-wrapper"
|
|
10093
10514
|
}, /*#__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, {
|
|
@@ -10138,19 +10559,23 @@
|
|
|
10138
10559
|
type: "button",
|
|
10139
10560
|
onClick: function onClick() {
|
|
10140
10561
|
_this.submitInterest();
|
|
10562
|
+
|
|
10141
10563
|
_this.resetState();
|
|
10142
10564
|
}
|
|
10143
10565
|
}, fetching ? 'SAVING' : 'SAVE'))))))));
|
|
10144
10566
|
});
|
|
10567
|
+
|
|
10145
10568
|
_this.state = _objectSpread2({}, defaultState);
|
|
10146
10569
|
return _this;
|
|
10147
10570
|
}
|
|
10148
|
-
|
|
10571
|
+
|
|
10149
10572
|
return _createClass(AddInterest);
|
|
10150
10573
|
}(React__default.Component);
|
|
10574
|
+
|
|
10151
10575
|
var AddInterest$1 = themed(AddInterest);
|
|
10152
10576
|
|
|
10153
|
-
|
|
10577
|
+
/** @format */
|
|
10578
|
+
|
|
10154
10579
|
numeral.register('locale', 'en-ZA', {
|
|
10155
10580
|
delimiters: {
|
|
10156
10581
|
thousands: ',',
|
|
@@ -10171,12 +10596,12 @@
|
|
|
10171
10596
|
});
|
|
10172
10597
|
numeral.locale('en-ZA');
|
|
10173
10598
|
String.locale = numeral.locale;
|
|
10174
|
-
|
|
10175
10599
|
/**
|
|
10176
10600
|
* Curreny Formatter
|
|
10177
10601
|
* @param {number} number - the number to be formatted
|
|
10178
10602
|
* @param {boolean} round - flag to indicate if the number needs to be rounded off
|
|
10179
10603
|
*/
|
|
10604
|
+
|
|
10180
10605
|
function fC(number) {
|
|
10181
10606
|
var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
10182
10607
|
var parsedNumber = parseFloat(number);
|
|
@@ -10214,35 +10639,48 @@
|
|
|
10214
10639
|
|
|
10215
10640
|
var _templateObject$B, _templateObject2$8, _templateObject3$3, _templateObject4$1;
|
|
10216
10641
|
var MALE$2 = genders.MALE,
|
|
10217
|
-
|
|
10218
|
-
|
|
10642
|
+
FEMALE$2 = genders.FEMALE,
|
|
10643
|
+
UNISEX$1 = genders.UNISEX;
|
|
10644
|
+
|
|
10219
10645
|
var TrashIcon = function TrashIcon(_ref) {
|
|
10220
10646
|
var onClick = _ref.onClick,
|
|
10221
|
-
|
|
10647
|
+
id = _ref.id;
|
|
10222
10648
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
10223
10649
|
onClick: onClick,
|
|
10224
10650
|
id: id
|
|
10225
10651
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
10226
10652
|
};
|
|
10653
|
+
|
|
10227
10654
|
var InterestItem = /*#__PURE__*/function (_React$Component) {
|
|
10655
|
+
_inherits(InterestItem, _React$Component);
|
|
10656
|
+
|
|
10657
|
+
var _super = _createSuper(InterestItem);
|
|
10658
|
+
|
|
10228
10659
|
function InterestItem(props) {
|
|
10229
10660
|
var _this;
|
|
10661
|
+
|
|
10230
10662
|
_classCallCheck(this, InterestItem);
|
|
10231
|
-
|
|
10232
|
-
|
|
10663
|
+
|
|
10664
|
+
_this = _super.call(this, props);
|
|
10665
|
+
|
|
10666
|
+
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10233
10667
|
var id = _this.props.data.id;
|
|
10668
|
+
|
|
10234
10669
|
_this.setState({
|
|
10235
10670
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10236
10671
|
fetching: true
|
|
10237
10672
|
})
|
|
10238
10673
|
});
|
|
10674
|
+
|
|
10239
10675
|
var url = _this.props.deleteInterestApi(id);
|
|
10676
|
+
|
|
10240
10677
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
10241
10678
|
_this.setState({
|
|
10242
10679
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10243
10680
|
success: true
|
|
10244
10681
|
})
|
|
10245
10682
|
});
|
|
10683
|
+
|
|
10246
10684
|
_this.props.onDeleted(_this.props.data);
|
|
10247
10685
|
}, function () {
|
|
10248
10686
|
return _this.setState({
|
|
@@ -10250,25 +10688,32 @@
|
|
|
10250
10688
|
});
|
|
10251
10689
|
});
|
|
10252
10690
|
});
|
|
10253
|
-
|
|
10691
|
+
|
|
10692
|
+
_defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
|
|
10254
10693
|
switch (gender) {
|
|
10255
10694
|
case MALE$2:
|
|
10256
10695
|
return 'Male';
|
|
10696
|
+
|
|
10257
10697
|
case FEMALE$2:
|
|
10258
10698
|
return 'Female';
|
|
10699
|
+
|
|
10259
10700
|
case UNISEX$1:
|
|
10260
10701
|
default:
|
|
10261
10702
|
return 'Unisex';
|
|
10262
10703
|
}
|
|
10263
10704
|
});
|
|
10264
|
-
|
|
10705
|
+
|
|
10706
|
+
_defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
|
|
10265
10707
|
if (category === interestCategories.APPAREL) {
|
|
10266
10708
|
return 'CLOTHING';
|
|
10267
10709
|
}
|
|
10710
|
+
|
|
10268
10711
|
return category;
|
|
10269
10712
|
});
|
|
10270
|
-
|
|
10713
|
+
|
|
10714
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10271
10715
|
var _data$min_shoe_size, _data$max_shoe_size;
|
|
10716
|
+
|
|
10272
10717
|
var data = _this.props.data;
|
|
10273
10718
|
var success = _this.state.delete.success;
|
|
10274
10719
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
|
|
@@ -10318,14 +10763,16 @@
|
|
|
10318
10763
|
}
|
|
10319
10764
|
}));
|
|
10320
10765
|
});
|
|
10766
|
+
|
|
10321
10767
|
_this.state = {
|
|
10322
10768
|
delete: _objectSpread2({}, request)
|
|
10323
10769
|
};
|
|
10324
10770
|
return _this;
|
|
10325
10771
|
}
|
|
10326
|
-
|
|
10772
|
+
|
|
10327
10773
|
return _createClass(InterestItem);
|
|
10328
10774
|
}(React__default.Component);
|
|
10775
|
+
|
|
10329
10776
|
var SheoSizeContentDiv = styled__default.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
|
|
10330
10777
|
var InterestItemTitle = styled__default.div(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
10331
10778
|
var InterestItemContainer = styled__default.div(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
@@ -10341,11 +10788,11 @@
|
|
|
10341
10788
|
return props.theme.marginPaddings[0];
|
|
10342
10789
|
}, media.xs);
|
|
10343
10790
|
var ThemedInterestItem = themed(InterestItem);
|
|
10344
|
-
|
|
10345
10791
|
/**
|
|
10346
10792
|
* The Interest Item view shows the selected interest configuration,
|
|
10347
10793
|
* and gives user control to delete it.
|
|
10348
10794
|
*/
|
|
10795
|
+
|
|
10349
10796
|
var InterestItem$1 = (function (props) {
|
|
10350
10797
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
|
|
10351
10798
|
});
|
|
@@ -10358,6 +10805,7 @@
|
|
|
10358
10805
|
}, function (props) {
|
|
10359
10806
|
return props.theme.marginPaddings[1];
|
|
10360
10807
|
}, media.xs);
|
|
10808
|
+
|
|
10361
10809
|
var MyInterestTitleHeading = function MyInterestTitleHeading() {
|
|
10362
10810
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10363
10811
|
className: "interests__title"
|
|
@@ -10379,6 +10827,7 @@
|
|
|
10379
10827
|
className: "heading-title-empty"
|
|
10380
10828
|
})));
|
|
10381
10829
|
};
|
|
10830
|
+
|
|
10382
10831
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
10383
10832
|
|
|
10384
10833
|
var _templateObject$D;
|
|
@@ -10387,6 +10836,7 @@
|
|
|
10387
10836
|
}, function (props) {
|
|
10388
10837
|
return props.theme.marginPaddings[1];
|
|
10389
10838
|
}, media.xs);
|
|
10839
|
+
|
|
10390
10840
|
var MyProductInterestTitleHeading = function MyProductInterestTitleHeading() {
|
|
10391
10841
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10392
10842
|
className: "interests__title"
|
|
@@ -10402,6 +10852,7 @@
|
|
|
10402
10852
|
className: "heading-title-empty"
|
|
10403
10853
|
})));
|
|
10404
10854
|
};
|
|
10855
|
+
|
|
10405
10856
|
var MyProductInterestTitleHeading$1 = themed(MyProductInterestTitleHeading);
|
|
10406
10857
|
|
|
10407
10858
|
var Add = (function (props) {
|
|
@@ -10424,6 +10875,7 @@
|
|
|
10424
10875
|
|
|
10425
10876
|
function getToken() {
|
|
10426
10877
|
var _Cookies$get;
|
|
10878
|
+
|
|
10427
10879
|
return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
|
|
10428
10880
|
}
|
|
10429
10881
|
function setToken(value) {
|
|
@@ -10431,29 +10883,35 @@
|
|
|
10431
10883
|
}
|
|
10432
10884
|
|
|
10433
10885
|
/** @format */
|
|
10886
|
+
|
|
10434
10887
|
function getEncodedSearch(currentUrl) {
|
|
10435
10888
|
var splitUrl = currentUrl.split('?');
|
|
10436
10889
|
var baseUrl = splitUrl[0];
|
|
10437
10890
|
var nextUrlSegments = splitUrl[1].split('&');
|
|
10438
10891
|
var nextQueryString = splitUrl[1];
|
|
10892
|
+
|
|
10439
10893
|
if (nextUrlSegments.length > 0) {
|
|
10440
10894
|
nextQueryString = nextUrlSegments.map(function (v) {
|
|
10441
10895
|
var nextValue = v;
|
|
10896
|
+
|
|
10442
10897
|
if (v.includes('search=')) {
|
|
10443
10898
|
var temp = v.split('=');
|
|
10444
10899
|
nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
|
|
10445
10900
|
}
|
|
10901
|
+
|
|
10446
10902
|
return nextValue;
|
|
10447
10903
|
}).join('&');
|
|
10448
10904
|
}
|
|
10905
|
+
|
|
10449
10906
|
return "".concat(baseUrl, "?").concat(nextQueryString);
|
|
10450
10907
|
}
|
|
10451
|
-
|
|
10452
10908
|
/**
|
|
10453
10909
|
* Gets an instance of Axios that is configured with the custom failure handlers
|
|
10454
10910
|
* @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]
|
|
10455
10911
|
* @param {Function} onForbidden - callback triggers when http status = 403
|
|
10456
10912
|
*/
|
|
10913
|
+
|
|
10914
|
+
|
|
10457
10915
|
var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
|
|
10458
10916
|
var instance = axios.create({
|
|
10459
10917
|
validateStatus: function validateStatus(status) {
|
|
@@ -10461,56 +10919,60 @@
|
|
|
10461
10919
|
}
|
|
10462
10920
|
});
|
|
10463
10921
|
var token = getToken();
|
|
10922
|
+
|
|
10464
10923
|
if (token !== '') {
|
|
10465
10924
|
instance.defaults.headers.common.Authorization = token;
|
|
10466
10925
|
}
|
|
10467
|
-
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
|
|
10468
10926
|
|
|
10469
|
-
// Add a request interceptor
|
|
10927
|
+
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8'; // Add a request interceptor
|
|
10928
|
+
|
|
10470
10929
|
instance.interceptors.request.use(function (request, error) {
|
|
10471
10930
|
if (error) {
|
|
10472
10931
|
return Promise.reject(error.response);
|
|
10473
10932
|
}
|
|
10933
|
+
|
|
10474
10934
|
if (request.url.includes('search') && request.url.includes('?')) {
|
|
10475
10935
|
// do some uri manipulation for ie
|
|
10476
10936
|
// https://stackoverflow.com/questions/18220057
|
|
10477
|
-
|
|
10478
10937
|
// eslint-disable-next-line no-param-reassign
|
|
10479
10938
|
request.url = getEncodedSearch(request.url);
|
|
10480
|
-
}
|
|
10939
|
+
} // eslint-disable-next-line no-param-reassign
|
|
10940
|
+
|
|
10481
10941
|
|
|
10482
|
-
// eslint-disable-next-line no-param-reassign
|
|
10483
10942
|
request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
|
|
10943
|
+
|
|
10484
10944
|
if (typeof request.body === 'undefined') {
|
|
10485
10945
|
request.body = {};
|
|
10486
10946
|
}
|
|
10947
|
+
|
|
10487
10948
|
token = getToken();
|
|
10949
|
+
|
|
10488
10950
|
if (token !== '') {
|
|
10489
10951
|
// eslint-disable-next-line no-param-reassign
|
|
10490
10952
|
request.headers.common.Authorization = token;
|
|
10491
10953
|
}
|
|
10954
|
+
|
|
10492
10955
|
return request;
|
|
10493
10956
|
}, function (error) {
|
|
10494
10957
|
return Promise.reject(error.message);
|
|
10495
|
-
});
|
|
10958
|
+
}); // Add a response interceptor
|
|
10496
10959
|
|
|
10497
|
-
// Add a response interceptor
|
|
10498
10960
|
instance.interceptors.response.use(function (response, error) {
|
|
10499
10961
|
if (error) {
|
|
10500
10962
|
return Promise.reject(error.response);
|
|
10501
10963
|
}
|
|
10964
|
+
|
|
10502
10965
|
if (response.headers.authorization) {
|
|
10503
10966
|
setToken(response.headers.authorization);
|
|
10504
10967
|
}
|
|
10968
|
+
|
|
10505
10969
|
return response;
|
|
10506
10970
|
}, function (error) {
|
|
10507
10971
|
if (error.response) {
|
|
10508
10972
|
// network error
|
|
10509
10973
|
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) {
|
|
10510
10974
|
onAuthFailed();
|
|
10511
|
-
}
|
|
10512
|
-
|
|
10513
|
-
// if (error.response.status === 500) {
|
|
10975
|
+
} // if (error.response.status === 500) {
|
|
10514
10976
|
// // INTERNAL SERVER ERROR
|
|
10515
10977
|
// store.dispatch({
|
|
10516
10978
|
// type: AppConstants.OVERLAY.SERVER_ERROR,
|
|
@@ -10518,34 +10980,39 @@
|
|
|
10518
10980
|
// return Promise.reject(error.response);
|
|
10519
10981
|
// }
|
|
10520
10982
|
|
|
10983
|
+
|
|
10521
10984
|
if (error.response.status === 403) {
|
|
10522
10985
|
// FORBIDDEN
|
|
10523
10986
|
onForbidden();
|
|
10524
10987
|
}
|
|
10988
|
+
|
|
10525
10989
|
return Promise.reject(error.response);
|
|
10526
10990
|
}
|
|
10991
|
+
|
|
10527
10992
|
return Promise.reject(error);
|
|
10528
10993
|
});
|
|
10529
10994
|
return instance;
|
|
10530
|
-
};
|
|
10995
|
+
}; // NOTE: this to be instanciated with params: onAuthFailed, onForbidden
|
|
10531
10996
|
|
|
10532
10997
|
var _excluded$8 = ["children"];
|
|
10998
|
+
|
|
10533
10999
|
var DropdownSelector = function DropdownSelector(_ref) {
|
|
10534
11000
|
var selectedOption = _ref.selectedOption,
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
11001
|
+
onOptionChange = _ref.onOptionChange,
|
|
11002
|
+
options = _ref.options,
|
|
11003
|
+
isSearchable = _ref.isSearchable,
|
|
11004
|
+
placeholder = _ref.placeholder,
|
|
11005
|
+
name = _ref.name,
|
|
11006
|
+
showSearchIcon = _ref.showSearchIcon,
|
|
11007
|
+
isDisabled = _ref.isDisabled;
|
|
10542
11008
|
var customComponents = {
|
|
10543
11009
|
DropdownIndicator: function DropdownIndicator() {
|
|
10544
11010
|
return null;
|
|
10545
11011
|
},
|
|
10546
11012
|
ValueContainer: function ValueContainer(_ref2) {
|
|
10547
11013
|
var children = _ref2.children,
|
|
10548
|
-
|
|
11014
|
+
props = _objectWithoutProperties(_ref2, _excluded$8);
|
|
11015
|
+
|
|
10549
11016
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
10550
11017
|
style: {
|
|
10551
11018
|
position: 'relative'
|
|
@@ -10673,6 +11140,7 @@
|
|
|
10673
11140
|
isDisabled: isDisabled
|
|
10674
11141
|
}));
|
|
10675
11142
|
};
|
|
11143
|
+
|
|
10676
11144
|
DropdownSelector.defaultProps = {
|
|
10677
11145
|
isSearchable: false,
|
|
10678
11146
|
selectedOption: null,
|
|
@@ -10697,144 +11165,178 @@
|
|
|
10697
11165
|
}, function (props) {
|
|
10698
11166
|
return props.theme.marginPaddings[1];
|
|
10699
11167
|
});
|
|
11168
|
+
|
|
10700
11169
|
var AddProductInterest = function AddProductInterest(_ref) {
|
|
10701
11170
|
var baseGraphApi = _ref.baseGraphApi,
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
11171
|
+
getBrandsGraphQuery = _ref.getBrandsGraphQuery,
|
|
11172
|
+
getModelsGraphQuery = _ref.getModelsGraphQuery,
|
|
11173
|
+
getMaterialsGraphQuery = _ref.getMaterialsGraphQuery,
|
|
11174
|
+
onCancel = _ref.onCancel,
|
|
11175
|
+
requestInstance = _ref.requestInstance,
|
|
11176
|
+
addLuxityProductInterestApi = _ref.addLuxityProductInterestApi,
|
|
11177
|
+
onSubmitSuccess = _ref.onSubmitSuccess;
|
|
11178
|
+
|
|
10709
11179
|
var _useState = React.useState([]),
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
11180
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11181
|
+
brands = _useState2[0],
|
|
11182
|
+
setBrands = _useState2[1];
|
|
11183
|
+
|
|
10713
11184
|
var _useState3 = React.useState([]),
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
11185
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
11186
|
+
models = _useState4[0],
|
|
11187
|
+
setModels = _useState4[1];
|
|
11188
|
+
|
|
10717
11189
|
var _useState5 = React.useState([]),
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
11190
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
11191
|
+
materials = _useState6[0],
|
|
11192
|
+
setMaterials = _useState6[1];
|
|
11193
|
+
|
|
10721
11194
|
var _useState7 = React.useState(null),
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
11195
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
11196
|
+
selectedBrand = _useState8[0],
|
|
11197
|
+
setSelectedBrand = _useState8[1];
|
|
11198
|
+
|
|
10725
11199
|
var _useState9 = React.useState(null),
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
11200
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
11201
|
+
selectedModel = _useState10[0],
|
|
11202
|
+
setSelectedModel = _useState10[1];
|
|
11203
|
+
|
|
10729
11204
|
var _useState11 = React.useState(null),
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
11205
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
11206
|
+
selectedMaterial = _useState12[0],
|
|
11207
|
+
setSelectedMaterial = _useState12[1];
|
|
11208
|
+
|
|
11209
|
+
var fetchBrands = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
10734
11210
|
var _response$data, _response$data$data, _response$data$data$l, response, formattedBrands;
|
|
11211
|
+
|
|
10735
11212
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10736
|
-
while (1)
|
|
10737
|
-
|
|
10738
|
-
_context.prev = 0;
|
|
10739
|
-
_context.next = 3;
|
|
10740
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
10741
|
-
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10742
|
-
});
|
|
10743
|
-
case 3:
|
|
10744
|
-
response = _context.sent;
|
|
10745
|
-
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) {
|
|
10746
|
-
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10747
|
-
return {
|
|
10748
|
-
value: brand.id,
|
|
10749
|
-
label: brand.name
|
|
10750
|
-
};
|
|
10751
|
-
});
|
|
10752
|
-
setBrands(formattedBrands);
|
|
10753
|
-
}
|
|
10754
|
-
_context.next = 10;
|
|
10755
|
-
break;
|
|
10756
|
-
case 7:
|
|
10757
|
-
_context.prev = 7;
|
|
10758
|
-
_context.t0 = _context["catch"](0);
|
|
10759
|
-
error(_context.t0.message);
|
|
10760
|
-
case 10:
|
|
10761
|
-
case "end":
|
|
10762
|
-
return _context.stop();
|
|
10763
|
-
}
|
|
10764
|
-
}, _callee, null, [[0, 7]]);
|
|
10765
|
-
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
10766
|
-
var fetchModels = React.useCallback(/*#__PURE__*/function () {
|
|
10767
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
10768
|
-
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
10769
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10770
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
11213
|
+
while (1) {
|
|
11214
|
+
switch (_context.prev = _context.next) {
|
|
10771
11215
|
case 0:
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=
|
|
10775
|
-
query:
|
|
11216
|
+
_context.prev = 0;
|
|
11217
|
+
_context.next = 3;
|
|
11218
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
11219
|
+
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10776
11220
|
});
|
|
11221
|
+
|
|
10777
11222
|
case 3:
|
|
10778
|
-
response =
|
|
10779
|
-
|
|
10780
|
-
|
|
11223
|
+
response = _context.sent;
|
|
11224
|
+
|
|
11225
|
+
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) {
|
|
11226
|
+
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10781
11227
|
return {
|
|
10782
|
-
value:
|
|
10783
|
-
label:
|
|
11228
|
+
value: brand.id,
|
|
11229
|
+
label: brand.name
|
|
10784
11230
|
};
|
|
10785
11231
|
});
|
|
10786
|
-
|
|
11232
|
+
setBrands(formattedBrands);
|
|
10787
11233
|
}
|
|
10788
|
-
|
|
11234
|
+
|
|
11235
|
+
_context.next = 10;
|
|
10789
11236
|
break;
|
|
11237
|
+
|
|
10790
11238
|
case 7:
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
error(
|
|
11239
|
+
_context.prev = 7;
|
|
11240
|
+
_context.t0 = _context["catch"](0);
|
|
11241
|
+
error(_context.t0.message);
|
|
11242
|
+
|
|
10794
11243
|
case 10:
|
|
10795
11244
|
case "end":
|
|
10796
|
-
return
|
|
11245
|
+
return _context.stop();
|
|
11246
|
+
}
|
|
11247
|
+
}
|
|
11248
|
+
}, _callee, null, [[0, 7]]);
|
|
11249
|
+
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
11250
|
+
var fetchModels = React.useCallback( /*#__PURE__*/function () {
|
|
11251
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
11252
|
+
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
11253
|
+
|
|
11254
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11255
|
+
while (1) {
|
|
11256
|
+
switch (_context2.prev = _context2.next) {
|
|
11257
|
+
case 0:
|
|
11258
|
+
_context2.prev = 0;
|
|
11259
|
+
_context2.next = 3;
|
|
11260
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
11261
|
+
query: getModelsGraphQuery(brandId)
|
|
11262
|
+
});
|
|
11263
|
+
|
|
11264
|
+
case 3:
|
|
11265
|
+
response = _context2.sent;
|
|
11266
|
+
|
|
11267
|
+
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) {
|
|
11268
|
+
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11269
|
+
return {
|
|
11270
|
+
value: model.id,
|
|
11271
|
+
label: model.name
|
|
11272
|
+
};
|
|
11273
|
+
});
|
|
11274
|
+
setModels(formattedModels);
|
|
11275
|
+
}
|
|
11276
|
+
|
|
11277
|
+
_context2.next = 10;
|
|
11278
|
+
break;
|
|
11279
|
+
|
|
11280
|
+
case 7:
|
|
11281
|
+
_context2.prev = 7;
|
|
11282
|
+
_context2.t0 = _context2["catch"](0);
|
|
11283
|
+
error(_context2.t0.message);
|
|
11284
|
+
|
|
11285
|
+
case 10:
|
|
11286
|
+
case "end":
|
|
11287
|
+
return _context2.stop();
|
|
11288
|
+
}
|
|
10797
11289
|
}
|
|
10798
11290
|
}, _callee2, null, [[0, 7]]);
|
|
10799
11291
|
}));
|
|
11292
|
+
|
|
10800
11293
|
return function (_x) {
|
|
10801
11294
|
return _ref3.apply(this, arguments);
|
|
10802
11295
|
};
|
|
10803
11296
|
}(), [baseGraphApi, getModelsGraphQuery]);
|
|
10804
|
-
var fetchMaterials = React.useCallback(/*#__PURE__*/function () {
|
|
10805
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
11297
|
+
var fetchMaterials = React.useCallback( /*#__PURE__*/function () {
|
|
11298
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
10806
11299
|
var _response$data3, _response$data3$data, _response$data3$data$, response, formattedMaterials;
|
|
11300
|
+
|
|
10807
11301
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10808
|
-
while (1)
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
case 3:
|
|
10816
|
-
response = _context3.sent;
|
|
10817
|
-
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) {
|
|
10818
|
-
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
10819
|
-
return {
|
|
10820
|
-
value: material.id,
|
|
10821
|
-
label: material.name
|
|
10822
|
-
};
|
|
11302
|
+
while (1) {
|
|
11303
|
+
switch (_context3.prev = _context3.next) {
|
|
11304
|
+
case 0:
|
|
11305
|
+
_context3.prev = 0;
|
|
11306
|
+
_context3.next = 3;
|
|
11307
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getMaterials"), {
|
|
11308
|
+
query: getMaterialsGraphQuery(brandId)
|
|
10823
11309
|
});
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
11310
|
+
|
|
11311
|
+
case 3:
|
|
11312
|
+
response = _context3.sent;
|
|
11313
|
+
|
|
11314
|
+
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) {
|
|
11315
|
+
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
11316
|
+
return {
|
|
11317
|
+
value: material.id,
|
|
11318
|
+
label: material.name
|
|
11319
|
+
};
|
|
11320
|
+
});
|
|
11321
|
+
setMaterials(formattedMaterials);
|
|
11322
|
+
}
|
|
11323
|
+
|
|
11324
|
+
_context3.next = 10;
|
|
11325
|
+
break;
|
|
11326
|
+
|
|
11327
|
+
case 7:
|
|
11328
|
+
_context3.prev = 7;
|
|
11329
|
+
_context3.t0 = _context3["catch"](0);
|
|
11330
|
+
error(_context3.t0.message);
|
|
11331
|
+
|
|
11332
|
+
case 10:
|
|
11333
|
+
case "end":
|
|
11334
|
+
return _context3.stop();
|
|
11335
|
+
}
|
|
10835
11336
|
}
|
|
10836
11337
|
}, _callee3, null, [[0, 7]]);
|
|
10837
11338
|
}));
|
|
11339
|
+
|
|
10838
11340
|
return function (_x2) {
|
|
10839
11341
|
return _ref4.apply(this, arguments);
|
|
10840
11342
|
};
|
|
@@ -10855,15 +11357,19 @@
|
|
|
10855
11357
|
setSelectedMaterial(null);
|
|
10856
11358
|
}
|
|
10857
11359
|
}, [selectedBrand, fetchModels, fetchMaterials]);
|
|
11360
|
+
|
|
10858
11361
|
var onBrandChange = function onBrandChange(selectedOption) {
|
|
10859
11362
|
setSelectedBrand(selectedOption);
|
|
10860
11363
|
};
|
|
11364
|
+
|
|
10861
11365
|
var onModelChange = function onModelChange(selectedOption) {
|
|
10862
11366
|
setSelectedModel(selectedOption);
|
|
10863
11367
|
};
|
|
11368
|
+
|
|
10864
11369
|
var onMaterialChange = function onMaterialChange(selectedOption) {
|
|
10865
11370
|
setSelectedMaterial(selectedOption);
|
|
10866
11371
|
};
|
|
11372
|
+
|
|
10867
11373
|
var submitInterest = function submitInterest() {
|
|
10868
11374
|
var payload = {
|
|
10869
11375
|
luxity_brand_id: selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.value,
|
|
@@ -10875,6 +11381,7 @@
|
|
|
10875
11381
|
onCancel();
|
|
10876
11382
|
}, handleRequestError);
|
|
10877
11383
|
};
|
|
11384
|
+
|
|
10878
11385
|
var handleRequestError = function handleRequestError(_ref5) {
|
|
10879
11386
|
var data = _ref5.data;
|
|
10880
11387
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
@@ -10886,6 +11393,7 @@
|
|
|
10886
11393
|
}, message);
|
|
10887
11394
|
}));
|
|
10888
11395
|
};
|
|
11396
|
+
|
|
10889
11397
|
var onReset = function onReset() {
|
|
10890
11398
|
onCancel();
|
|
10891
11399
|
setSelectedModel(null);
|
|
@@ -10895,6 +11403,7 @@
|
|
|
10895
11403
|
setMaterials([]);
|
|
10896
11404
|
setModels([]);
|
|
10897
11405
|
};
|
|
11406
|
+
|
|
10898
11407
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10899
11408
|
className: "interests__section-wrapper"
|
|
10900
11409
|
}, /*#__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", {
|
|
@@ -10942,36 +11451,50 @@
|
|
|
10942
11451
|
onClick: submitInterest
|
|
10943
11452
|
}, "SAVE"))))))));
|
|
10944
11453
|
};
|
|
11454
|
+
|
|
10945
11455
|
var AddProductInterest$1 = themed(AddProductInterest);
|
|
10946
11456
|
|
|
10947
11457
|
var _templateObject$F, _templateObject2$a, _templateObject3$4;
|
|
11458
|
+
|
|
10948
11459
|
var TrashIcon$1 = function TrashIcon(_ref) {
|
|
10949
11460
|
var onClick = _ref.onClick,
|
|
10950
|
-
|
|
11461
|
+
id = _ref.id;
|
|
10951
11462
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
10952
11463
|
onClick: onClick,
|
|
10953
11464
|
id: id
|
|
10954
11465
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
10955
11466
|
};
|
|
11467
|
+
|
|
10956
11468
|
var LuxityProductInterestItem = /*#__PURE__*/function (_React$Component) {
|
|
11469
|
+
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11470
|
+
|
|
11471
|
+
var _super = _createSuper(LuxityProductInterestItem);
|
|
11472
|
+
|
|
10957
11473
|
function LuxityProductInterestItem(props) {
|
|
10958
11474
|
var _this;
|
|
11475
|
+
|
|
10959
11476
|
_classCallCheck(this, LuxityProductInterestItem);
|
|
10960
|
-
|
|
10961
|
-
|
|
11477
|
+
|
|
11478
|
+
_this = _super.call(this, props);
|
|
11479
|
+
|
|
11480
|
+
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10962
11481
|
var id = _this.props.data.id;
|
|
11482
|
+
|
|
10963
11483
|
_this.setState({
|
|
10964
11484
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10965
11485
|
fetching: true
|
|
10966
11486
|
})
|
|
10967
11487
|
});
|
|
11488
|
+
|
|
10968
11489
|
var url = _this.props.deleteInterestApi(id);
|
|
11490
|
+
|
|
10969
11491
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
10970
11492
|
_this.setState({
|
|
10971
11493
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10972
11494
|
success: true
|
|
10973
11495
|
})
|
|
10974
11496
|
});
|
|
11497
|
+
|
|
10975
11498
|
_this.props.onDeleted(_this.props.data);
|
|
10976
11499
|
}, function () {
|
|
10977
11500
|
return _this.setState({
|
|
@@ -10979,8 +11502,10 @@
|
|
|
10979
11502
|
});
|
|
10980
11503
|
});
|
|
10981
11504
|
});
|
|
10982
|
-
|
|
11505
|
+
|
|
11506
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10983
11507
|
var _data$luxity_model, _data$luxity_material;
|
|
11508
|
+
|
|
10984
11509
|
var data = _this.props.data;
|
|
10985
11510
|
var success = _this.state.delete.success;
|
|
10986
11511
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer$1, {
|
|
@@ -11010,14 +11535,16 @@
|
|
|
11010
11535
|
}
|
|
11011
11536
|
}));
|
|
11012
11537
|
});
|
|
11538
|
+
|
|
11013
11539
|
_this.state = {
|
|
11014
11540
|
delete: _objectSpread2({}, request)
|
|
11015
11541
|
};
|
|
11016
11542
|
return _this;
|
|
11017
11543
|
}
|
|
11018
|
-
|
|
11544
|
+
|
|
11019
11545
|
return _createClass(LuxityProductInterestItem);
|
|
11020
11546
|
}(React__default.Component);
|
|
11547
|
+
|
|
11021
11548
|
var InterestItemTitle$1 = styled__default.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
11022
11549
|
var InterestItemContainer$1 = styled__default.div(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
11023
11550
|
var InterestItemContent$1 = styled__default.div(_templateObject3$4 || (_templateObject3$4 = _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) {
|
|
@@ -11030,25 +11557,27 @@
|
|
|
11030
11557
|
return props.theme.marginPaddings[0];
|
|
11031
11558
|
}, media.xs);
|
|
11032
11559
|
var ThemedInterestItem$1 = themed(LuxityProductInterestItem);
|
|
11033
|
-
|
|
11034
11560
|
/**
|
|
11035
11561
|
* The Interest Item view shows the selected interest configuration,
|
|
11036
11562
|
* and gives user control to delete it.
|
|
11037
11563
|
*/
|
|
11564
|
+
|
|
11038
11565
|
var LuxityProductInterestItem$1 = (function (props) {
|
|
11039
11566
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem$1, props);
|
|
11040
11567
|
});
|
|
11041
11568
|
|
|
11042
11569
|
var _templateObject$G, _templateObject2$b;
|
|
11043
11570
|
var AddInterestButtonContainer = styled__default.div(_templateObject$G || (_templateObject$G = _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"])));
|
|
11571
|
+
|
|
11044
11572
|
var AddIcon = function AddIcon(_ref) {
|
|
11045
11573
|
var onClick = _ref.onClick,
|
|
11046
|
-
|
|
11574
|
+
id = _ref.id;
|
|
11047
11575
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11048
11576
|
id: id,
|
|
11049
11577
|
onClick: onClick
|
|
11050
11578
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Add, null)));
|
|
11051
11579
|
};
|
|
11580
|
+
|
|
11052
11581
|
var AccountIcon = themed(function () {
|
|
11053
11582
|
return /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Account, null));
|
|
11054
11583
|
});
|
|
@@ -11061,39 +11590,50 @@
|
|
|
11061
11590
|
}, function (props) {
|
|
11062
11591
|
return props.theme.marginPaddings[2];
|
|
11063
11592
|
}));
|
|
11593
|
+
|
|
11064
11594
|
/**
|
|
11065
11595
|
* Page/View that controls the viewing and Adding of Luxity Interests
|
|
11066
11596
|
*/
|
|
11067
11597
|
var Interests = /*#__PURE__*/function (_React$Component) {
|
|
11598
|
+
_inherits(Interests, _React$Component);
|
|
11599
|
+
|
|
11600
|
+
var _super = _createSuper(Interests);
|
|
11601
|
+
|
|
11068
11602
|
function Interests(props) {
|
|
11069
11603
|
var _this;
|
|
11604
|
+
|
|
11070
11605
|
_classCallCheck(this, Interests);
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
_defineProperty(_this, "
|
|
11606
|
+
|
|
11607
|
+
_this = _super.call(this, props);
|
|
11608
|
+
|
|
11609
|
+
_defineProperty(_assertThisInitialized(_this), "categoryInterestType", 'CATEGORY');
|
|
11610
|
+
|
|
11611
|
+
_defineProperty(_assertThisInitialized(_this), "productInterestType", 'PRODUCT');
|
|
11612
|
+
|
|
11613
|
+
_defineProperty(_assertThisInitialized(_this), "setInterests", function (data) {
|
|
11075
11614
|
var _data$data$data = data.data.data,
|
|
11076
|
-
|
|
11077
|
-
|
|
11615
|
+
interests = _data$data$data.interests.data,
|
|
11616
|
+
luxity_product_interests = _data$data$data.luxity_product_interests.data;
|
|
11617
|
+
|
|
11078
11618
|
_this.setState({
|
|
11079
11619
|
interests: interests,
|
|
11080
11620
|
luxity_product_interests: luxity_product_interests
|
|
11081
11621
|
});
|
|
11082
11622
|
});
|
|
11083
|
-
|
|
11084
|
-
_defineProperty(_this, "onInterestSubmitSuccess", function (interestItem) {
|
|
11623
|
+
|
|
11624
|
+
_defineProperty(_assertThisInitialized(_this), "onInterestSubmitSuccess", function (interestItem) {
|
|
11085
11625
|
// due to the fact that we dont get the Interest payload back - we have to re-request the list
|
|
11086
11626
|
_this.triggerInterestRequest().then(function (res) {
|
|
11087
11627
|
return _this.setInterests(res);
|
|
11088
|
-
});
|
|
11089
|
-
|
|
11090
|
-
// UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11628
|
+
}); // UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11091
11629
|
// this.setState(prevState => {
|
|
11092
11630
|
// const newInterests = [interestItem].concat(prevState.interests);
|
|
11093
11631
|
// return { ...prevState, interests: newInterests };
|
|
11094
11632
|
// });
|
|
11633
|
+
|
|
11095
11634
|
});
|
|
11096
|
-
|
|
11635
|
+
|
|
11636
|
+
_defineProperty(_assertThisInitialized(_this), "onDeleteInterest", function (deletedItem) {
|
|
11097
11637
|
_this.setState(function (prevState) {
|
|
11098
11638
|
var newInterests = prevState.interests.filter(function (item) {
|
|
11099
11639
|
return item.id !== deletedItem.id;
|
|
@@ -11103,7 +11643,8 @@
|
|
|
11103
11643
|
});
|
|
11104
11644
|
});
|
|
11105
11645
|
});
|
|
11106
|
-
|
|
11646
|
+
|
|
11647
|
+
_defineProperty(_assertThisInitialized(_this), "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11107
11648
|
_this.setState(function (prevState) {
|
|
11108
11649
|
var newLuxityProductInterests = prevState.luxity_product_interests.filter(function (item) {
|
|
11109
11650
|
return item.id !== deleteItem.id;
|
|
@@ -11113,25 +11654,29 @@
|
|
|
11113
11654
|
});
|
|
11114
11655
|
});
|
|
11115
11656
|
});
|
|
11116
|
-
|
|
11657
|
+
|
|
11658
|
+
_defineProperty(_assertThisInitialized(_this), "triggerInterestRequest", function () {
|
|
11117
11659
|
var _this$props = _this.props,
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11660
|
+
requestInstance = _this$props.requestInstance,
|
|
11661
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
11662
|
+
interestQuery = _this$props.interestQuery;
|
|
11121
11663
|
return requestInstance.post("".concat(baseGraphApi, "?id=getInterests"), {
|
|
11122
11664
|
query: interestQuery
|
|
11123
11665
|
});
|
|
11124
11666
|
});
|
|
11125
|
-
|
|
11667
|
+
|
|
11668
|
+
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function (interestType) {
|
|
11126
11669
|
_this.setState({
|
|
11127
11670
|
interestType: interestType
|
|
11128
11671
|
});
|
|
11129
11672
|
});
|
|
11130
|
-
|
|
11673
|
+
|
|
11674
|
+
_defineProperty(_assertThisInitialized(_this), "onCancel", function () {
|
|
11131
11675
|
_this.setState({
|
|
11132
11676
|
interestType: null
|
|
11133
11677
|
});
|
|
11134
11678
|
});
|
|
11679
|
+
|
|
11135
11680
|
_this.state = {
|
|
11136
11681
|
interests: [],
|
|
11137
11682
|
luxity_product_interests: [],
|
|
@@ -11139,31 +11684,32 @@
|
|
|
11139
11684
|
};
|
|
11140
11685
|
return _this;
|
|
11141
11686
|
}
|
|
11142
|
-
|
|
11143
|
-
|
|
11687
|
+
|
|
11688
|
+
_createClass(Interests, [{
|
|
11144
11689
|
key: "render",
|
|
11145
11690
|
value: function render() {
|
|
11146
11691
|
var _this2 = this;
|
|
11692
|
+
|
|
11147
11693
|
var _this$state = this.state,
|
|
11148
|
-
|
|
11149
|
-
|
|
11694
|
+
interests = _this$state.interests,
|
|
11695
|
+
luxity_product_interests = _this$state.luxity_product_interests;
|
|
11150
11696
|
var _this$props2 = this.props,
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11697
|
+
addInterestApi = _this$props2.addInterestApi,
|
|
11698
|
+
requestInstance = _this$props2.requestInstance,
|
|
11699
|
+
baseGraphApi = _this$props2.baseGraphApi,
|
|
11700
|
+
getBrandsGraphQuery = _this$props2.getBrandsGraphQuery,
|
|
11701
|
+
getStylesGraphQuery = _this$props2.getStylesGraphQuery,
|
|
11702
|
+
getShoesGraphQuery = _this$props2.getShoesGraphQuery,
|
|
11703
|
+
deleteInterestApi = _this$props2.deleteInterestApi,
|
|
11704
|
+
setSchedule = _this$props2.setSchedule,
|
|
11705
|
+
getSchedule = _this$props2.getSchedule,
|
|
11706
|
+
interestsTitle = _this$props2.interestsTitle,
|
|
11707
|
+
defaultShoeSizeType = _this$props2.defaultShoeSizeType,
|
|
11708
|
+
getMaterialsGraphQuery = _this$props2.getMaterialsGraphQuery,
|
|
11709
|
+
getModelsGraphQuery = _this$props2.getModelsGraphQuery,
|
|
11710
|
+
addLuxityProductInterestApi = _this$props2.addLuxityProductInterestApi,
|
|
11711
|
+
deleteLuxityProductInterestApi = _this$props2.deleteLuxityProductInterestApi,
|
|
11712
|
+
getConditionsGraphQuery = _this$props2.getConditionsGraphQuery;
|
|
11167
11713
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
11168
11714
|
className: "interests"
|
|
11169
11715
|
}, /*#__PURE__*/React__default.createElement(Notifications__default, {
|
|
@@ -11252,7 +11798,10 @@
|
|
|
11252
11798
|
}))));
|
|
11253
11799
|
}
|
|
11254
11800
|
}]);
|
|
11801
|
+
|
|
11802
|
+
return Interests;
|
|
11255
11803
|
}(React__default.Component);
|
|
11804
|
+
|
|
11256
11805
|
Interests.defaultProps = {
|
|
11257
11806
|
interestsTitle: 'Interests',
|
|
11258
11807
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|