@bonlineza/luxity-lib 2.34.1 → 2.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +76 -116
- package/AddInterest.js +434 -768
- package/BrandSelector.js +176 -336
- package/Checkbox.js +68 -101
- package/CheckboxButton.js +79 -124
- package/CommunicationPreferenceOptionsRenderer.js +107 -125
- package/CommunicationPreferenceSection.js +114 -134
- package/CommunicationPreferences.js +443 -339
- package/CountryCodeSelect.js +7 -10
- package/CurrencyInputFormatter.js +29 -56
- package/CurrencySelect.js +188 -19
- package/GALink.js +6 -16
- package/GenderSelector.js +88 -142
- package/GraphQLDropdownSelector.js +505 -939
- package/GraphQLMultiSelector.js +141 -274
- package/IconHeader.js +11 -25
- package/IconWrapper.js +3 -7
- package/InterestCatSelector.js +34 -74
- package/InterestItem.js +103 -187
- package/Interests.js +485 -890
- package/InterestsSubheading.js +5 -10
- package/InvertedTextButton.js +27 -63
- package/LuxityAppSideNav.js +18 -21
- package/LuxityDesktopHeader.js +360 -211
- package/LuxityFooter.js +464 -260
- package/LuxityGraphQLDropdownSelector.js +519 -969
- package/LuxityGraphQLMultiselector.js +167 -321
- package/LuxityMobileHeader.js +221 -278
- package/LuxityPageReady.js +74 -136
- package/LuxitySideNav.js +134 -155
- package/MaterialSelector.js +525 -976
- package/ModelSelector.js +525 -976
- package/NotificationDropDown.js +111 -209
- package/Notify.js +0 -1
- package/OutlinePrimaryButton.js +26 -58
- package/PriceRangeSelector.js +168 -281
- package/PrimaryButton.js +26 -58
- package/RadioButtons.js +114 -140
- package/RangeSlider.js +152 -242
- package/RareStepFooter.js +27 -41
- package/RareStepHeader.js +139 -190
- package/ReactSelectWrapper.js +0 -1
- package/SecondaryButton.js +26 -58
- package/ShoeSizeRangeSelector.js +162 -260
- package/ShoeSizeSelector.js +158 -263
- package/SimpleErrorBoundary.js +59 -106
- package/StyleSelector.js +176 -336
- package/TextButton.js +26 -58
- package/Tooltip.js +17 -39
- package/Tracking.js +0 -1
- package/WrapperButton.js +20 -43
- package/build/bundle.css +1 -1
- package/build/bundle.js +1298 -1695
- package/package.json +1 -1
- package/svg/Accessories.js +6 -13
- package/svg/Account.js +6 -13
- package/svg/Add.js +6 -13
- package/svg/ArrowRight.js +6 -13
- package/svg/Bags.js +6 -13
- package/svg/BurgerMenu.js +6 -13
- package/svg/Calendar.js +6 -13
- package/svg/CalendarCircled.js +6 -13
- package/svg/CheckCircled.js +6 -13
- package/svg/Close.js +6 -13
- package/svg/Clothing.js +6 -13
- package/svg/Dot.js +6 -13
- package/svg/Edit.js +6 -13
- package/svg/Eye.js +6 -13
- package/svg/FileAttach.js +6 -13
- package/svg/FileAttachCircled.js +6 -13
- package/svg/LightBulb.js +6 -13
- package/svg/Logo.js +6 -13
- package/svg/LuxityMenu.js +6 -13
- package/svg/Minus.js +6 -13
- package/svg/MobileAvatar.js +6 -13
- package/svg/MyOrder.js +6 -13
- package/svg/MyPayment.js +6 -13
- package/svg/MyProfile.js +8 -14
- package/svg/MySale.js +6 -13
- package/svg/Notification.js +6 -13
- package/svg/PointerDown.js +6 -13
- package/svg/Search.js +6 -13
- package/svg/Shoes.js +6 -13
- package/svg/SvgWrapper.js +3 -7
- package/svg/Trash.js +6 -13
- package/svg/Watches.js +6 -13
package/StyleSelector.js
CHANGED
|
@@ -9,225 +9,143 @@
|
|
|
9
9
|
EllipsisLoader = EllipsisLoader && Object.prototype.hasOwnProperty.call(EllipsisLoader, 'default') ? EllipsisLoader['default'] : EllipsisLoader;
|
|
10
10
|
PageReady = PageReady && Object.prototype.hasOwnProperty.call(PageReady, 'default') ? PageReady['default'] : PageReady;
|
|
11
11
|
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
function _arrayLikeToArray(r, a) {
|
|
13
|
+
(null == a || a > r.length) && (a = r.length);
|
|
14
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
15
|
+
return n;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (var i = 0; i < props.length; i++) {
|
|
20
|
-
var descriptor = props[i];
|
|
21
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
22
|
-
descriptor.configurable = true;
|
|
23
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
24
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
25
|
-
}
|
|
17
|
+
function _arrayWithoutHoles(r) {
|
|
18
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
26
19
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
31
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
32
|
-
writable: false
|
|
33
|
-
});
|
|
34
|
-
return Constructor;
|
|
20
|
+
function _assertThisInitialized(e) {
|
|
21
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
22
|
+
return e;
|
|
35
23
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
obj[key] = value;
|
|
24
|
+
function _callSuper(t, o, e) {
|
|
25
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
26
|
+
}
|
|
27
|
+
function _classCallCheck(a, n) {
|
|
28
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
29
|
+
}
|
|
30
|
+
function _defineProperties(e, r) {
|
|
31
|
+
for (var t = 0; t < r.length; t++) {
|
|
32
|
+
var o = r[t];
|
|
33
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
47
34
|
}
|
|
48
|
-
|
|
49
|
-
return obj;
|
|
50
35
|
}
|
|
51
|
-
|
|
36
|
+
function _createClass(e, r, t) {
|
|
37
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
38
|
+
writable: !1
|
|
39
|
+
}), e;
|
|
40
|
+
}
|
|
41
|
+
function _defineProperty(e, r, t) {
|
|
42
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
43
|
+
value: t,
|
|
44
|
+
enumerable: !0,
|
|
45
|
+
configurable: !0,
|
|
46
|
+
writable: !0
|
|
47
|
+
}) : e[r] = t, e;
|
|
48
|
+
}
|
|
52
49
|
function _extends() {
|
|
53
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
54
|
-
for (var
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
for (var key in source) {
|
|
58
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
59
|
-
target[key] = source[key];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
50
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
51
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
52
|
+
var t = arguments[e];
|
|
53
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
62
54
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
return _extends.apply(this, arguments);
|
|
55
|
+
return n;
|
|
56
|
+
}, _extends.apply(null, arguments);
|
|
67
57
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
function _getPrototypeOf(t) {
|
|
59
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
60
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
61
|
+
}, _getPrototypeOf(t);
|
|
62
|
+
}
|
|
63
|
+
function _inherits(t, e) {
|
|
64
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
65
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
75
66
|
constructor: {
|
|
76
|
-
value:
|
|
77
|
-
writable:
|
|
78
|
-
configurable:
|
|
67
|
+
value: t,
|
|
68
|
+
writable: !0,
|
|
69
|
+
configurable: !0
|
|
79
70
|
}
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
});
|
|
84
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function _getPrototypeOf(o) {
|
|
88
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
89
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
90
|
-
};
|
|
91
|
-
return _getPrototypeOf(o);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function _setPrototypeOf(o, p) {
|
|
95
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
96
|
-
o.__proto__ = p;
|
|
97
|
-
return o;
|
|
98
|
-
};
|
|
99
|
-
return _setPrototypeOf(o, p);
|
|
71
|
+
}), Object.defineProperty(t, "prototype", {
|
|
72
|
+
writable: !1
|
|
73
|
+
}), e && _setPrototypeOf(t, e);
|
|
100
74
|
}
|
|
101
|
-
|
|
102
75
|
function _isNativeReflectConstruct() {
|
|
103
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
104
|
-
if (Reflect.construct.sham) return false;
|
|
105
|
-
if (typeof Proxy === "function") return true;
|
|
106
|
-
|
|
107
76
|
try {
|
|
108
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return
|
|
112
|
-
}
|
|
77
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
78
|
+
} catch (t) {}
|
|
79
|
+
return (_isNativeReflectConstruct = function () {
|
|
80
|
+
return !!t;
|
|
81
|
+
})();
|
|
113
82
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (source == null) return {};
|
|
117
|
-
var target = {};
|
|
118
|
-
var sourceKeys = Object.keys(source);
|
|
119
|
-
var key, i;
|
|
120
|
-
|
|
121
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
122
|
-
key = sourceKeys[i];
|
|
123
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
124
|
-
target[key] = source[key];
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return target;
|
|
83
|
+
function _iterableToArray(r) {
|
|
84
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
128
85
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
86
|
+
function _nonIterableSpread() {
|
|
87
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
88
|
+
}
|
|
89
|
+
function _objectWithoutProperties(e, t) {
|
|
90
|
+
if (null == e) return {};
|
|
91
|
+
var o,
|
|
92
|
+
r,
|
|
93
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
137
94
|
if (Object.getOwnPropertySymbols) {
|
|
138
|
-
var
|
|
139
|
-
|
|
140
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
141
|
-
key = sourceSymbolKeys[i];
|
|
142
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
143
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
144
|
-
target[key] = source[key];
|
|
145
|
-
}
|
|
95
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
96
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
146
97
|
}
|
|
147
|
-
|
|
148
|
-
return target;
|
|
98
|
+
return i;
|
|
149
99
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
100
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
101
|
+
if (null == r) return {};
|
|
102
|
+
var t = {};
|
|
103
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
104
|
+
if (e.includes(n)) continue;
|
|
105
|
+
t[n] = r[n];
|
|
154
106
|
}
|
|
155
|
-
|
|
156
|
-
return self;
|
|
107
|
+
return t;
|
|
157
108
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
|
|
162
|
-
} else if (call !== void 0) {
|
|
163
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return _assertThisInitialized(self);
|
|
109
|
+
function _possibleConstructorReturn(t, e) {
|
|
110
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
111
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
112
|
+
return _assertThisInitialized(t);
|
|
167
113
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return function _createSuperInternal() {
|
|
173
|
-
var Super = _getPrototypeOf(Derived),
|
|
174
|
-
result;
|
|
175
|
-
|
|
176
|
-
if (hasNativeReflectConstruct) {
|
|
177
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
178
|
-
|
|
179
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
180
|
-
} else {
|
|
181
|
-
result = Super.apply(this, arguments);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return _possibleConstructorReturn(this, result);
|
|
185
|
-
};
|
|
114
|
+
function _setPrototypeOf(t, e) {
|
|
115
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
116
|
+
return t.__proto__ = e, t;
|
|
117
|
+
}, _setPrototypeOf(t, e);
|
|
186
118
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (!raw) {
|
|
190
|
-
raw = strings.slice(0);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
119
|
+
function _taggedTemplateLiteral(e, t) {
|
|
120
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
194
121
|
raw: {
|
|
195
|
-
value: Object.freeze(
|
|
122
|
+
value: Object.freeze(t)
|
|
196
123
|
}
|
|
197
124
|
}));
|
|
198
125
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function _arrayWithoutHoles(arr) {
|
|
205
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function _iterableToArray(iter) {
|
|
209
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
126
|
+
function _toConsumableArray(r) {
|
|
127
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
210
128
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
129
|
+
function _toPrimitive(t, r) {
|
|
130
|
+
if ("object" != typeof t || !t) return t;
|
|
131
|
+
var e = t[Symbol.toPrimitive];
|
|
132
|
+
if (void 0 !== e) {
|
|
133
|
+
var i = e.call(t, r || "default");
|
|
134
|
+
if ("object" != typeof i) return i;
|
|
135
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
136
|
+
}
|
|
137
|
+
return ("string" === r ? String : Number)(t);
|
|
219
138
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
225
|
-
|
|
226
|
-
return arr2;
|
|
139
|
+
function _toPropertyKey(t) {
|
|
140
|
+
var i = _toPrimitive(t, "string");
|
|
141
|
+
return "symbol" == typeof i ? i : i + "";
|
|
227
142
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
143
|
+
function _unsupportedIterableToArray(r, a) {
|
|
144
|
+
if (r) {
|
|
145
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
146
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
147
|
+
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;
|
|
148
|
+
}
|
|
231
149
|
}
|
|
232
150
|
|
|
233
151
|
var interpretErrorMessage = function interpretErrorMessage(error) {
|
|
@@ -239,50 +157,39 @@
|
|
|
239
157
|
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
240
158
|
data: null
|
|
241
159
|
});
|
|
160
|
+
|
|
242
161
|
/**
|
|
243
162
|
* A flavour of PageReady with Luxity customisations
|
|
244
163
|
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
245
164
|
* 2. an error message interpreter is supplied from the local helper library
|
|
246
165
|
*/
|
|
247
|
-
|
|
248
166
|
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
249
|
-
_inherits(LuxityPageReady, _React$Component);
|
|
250
|
-
|
|
251
|
-
var _super = _createSuper(LuxityPageReady);
|
|
252
|
-
|
|
253
167
|
function LuxityPageReady() {
|
|
254
168
|
var _this;
|
|
255
|
-
|
|
256
169
|
_classCallCheck(this, LuxityPageReady);
|
|
257
|
-
|
|
258
170
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
259
171
|
args[_key] = arguments[_key];
|
|
260
172
|
}
|
|
261
|
-
|
|
262
|
-
_this
|
|
263
|
-
|
|
264
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
173
|
+
_this = _callSuper(this, LuxityPageReady, [].concat(args));
|
|
174
|
+
_defineProperty(_this, "state", {
|
|
265
175
|
data: null
|
|
266
176
|
});
|
|
267
|
-
|
|
268
|
-
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
177
|
+
_defineProperty(_this, "refreshPage", function () {
|
|
269
178
|
return _this.pageReadyInstance.initRequest();
|
|
270
179
|
});
|
|
271
|
-
|
|
272
180
|
return _this;
|
|
273
181
|
}
|
|
274
|
-
|
|
275
|
-
_createClass(LuxityPageReady, [{
|
|
182
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
183
|
+
return _createClass(LuxityPageReady, [{
|
|
276
184
|
key: "render",
|
|
277
185
|
value: function render() {
|
|
278
186
|
var _this2 = this;
|
|
279
|
-
|
|
280
187
|
var _this$props = this.props,
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
188
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
189
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
190
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
191
|
+
_onData = _this$props.onData,
|
|
192
|
+
children = _this$props.children;
|
|
286
193
|
var data = this.state.data;
|
|
287
194
|
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
288
195
|
ref: function ref(inst) {
|
|
@@ -292,19 +199,15 @@
|
|
|
292
199
|
_this2.setState({
|
|
293
200
|
data: res.data
|
|
294
201
|
});
|
|
295
|
-
|
|
296
202
|
_onData(res);
|
|
297
203
|
},
|
|
298
204
|
getRequestInstance: function getRequestInstance() {
|
|
299
205
|
_this2.props.onIsLoading(true);
|
|
300
|
-
|
|
301
206
|
return getRequestPromise().then(function (out) {
|
|
302
207
|
_this2.props.onIsLoading(false);
|
|
303
|
-
|
|
304
208
|
return out;
|
|
305
209
|
}).catch(function (oops) {
|
|
306
210
|
_this2.props.onIsLoading(false);
|
|
307
|
-
|
|
308
211
|
return oops;
|
|
309
212
|
});
|
|
310
213
|
},
|
|
@@ -321,10 +224,7 @@
|
|
|
321
224
|
}, children));
|
|
322
225
|
}
|
|
323
226
|
}]);
|
|
324
|
-
|
|
325
|
-
return LuxityPageReady;
|
|
326
227
|
}(React__default.Component);
|
|
327
|
-
|
|
328
228
|
LuxityPageReady.defaultProps = {
|
|
329
229
|
onIsLoading: function onIsLoading() {
|
|
330
230
|
return null;
|
|
@@ -407,7 +307,6 @@
|
|
|
407
307
|
});
|
|
408
308
|
|
|
409
309
|
var _excluded = ["children"];
|
|
410
|
-
|
|
411
310
|
var _templateObject$1;
|
|
412
311
|
var Button = styled__default.button(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n ", ";\n background-color: transparent;\n color: ", ";\n &:hover {\n color: ", ";\n }\n &:disabled {\n ", ";\n color: ", ";\n }\n"])), baseButtonStyle, function (props) {
|
|
413
312
|
return props.theme.colors.base;
|
|
@@ -416,21 +315,17 @@
|
|
|
416
315
|
}, disabledButtonStyle, function (props) {
|
|
417
316
|
return props.theme.colors.base;
|
|
418
317
|
});
|
|
419
|
-
|
|
420
318
|
var TextButton = function TextButton(_ref) {
|
|
421
319
|
var children = _ref.children,
|
|
422
|
-
|
|
423
|
-
|
|
320
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
424
321
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
425
322
|
};
|
|
426
|
-
|
|
427
323
|
TextButton.defaultProps = {
|
|
428
324
|
type: 'button'
|
|
429
325
|
};
|
|
430
326
|
var TextButton$1 = themed(TextButton);
|
|
431
327
|
|
|
432
328
|
var _excluded$1 = ["children"];
|
|
433
|
-
|
|
434
329
|
var _templateObject$2;
|
|
435
330
|
var Button$1 = styled__default(TextButton$1)(_templateObject$2 || (_templateObject$2 = _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) {
|
|
436
331
|
return props.theme.colors.ntrlMin;
|
|
@@ -445,14 +340,11 @@
|
|
|
445
340
|
}, function (props) {
|
|
446
341
|
return props.theme.colors.primary;
|
|
447
342
|
});
|
|
448
|
-
|
|
449
343
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
450
344
|
var children = _ref.children,
|
|
451
|
-
|
|
452
|
-
|
|
345
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
453
346
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
454
347
|
};
|
|
455
|
-
|
|
456
348
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
457
349
|
|
|
458
350
|
var media = {
|
|
@@ -501,65 +393,49 @@
|
|
|
501
393
|
}, function (props) {
|
|
502
394
|
return props.theme.colors.ntrlMin;
|
|
503
395
|
});
|
|
396
|
+
|
|
504
397
|
/**
|
|
505
398
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
506
399
|
*/
|
|
507
|
-
|
|
508
400
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
509
|
-
_inherits(GraphQLMultiSelector, _React$Component);
|
|
510
|
-
|
|
511
|
-
var _super = _createSuper(GraphQLMultiSelector);
|
|
512
|
-
|
|
513
401
|
function GraphQLMultiSelector(props) {
|
|
514
402
|
var _this;
|
|
515
|
-
|
|
516
403
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
517
|
-
|
|
518
|
-
_this
|
|
519
|
-
|
|
520
|
-
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
404
|
+
_this = _callSuper(this, GraphQLMultiSelector, [props]);
|
|
405
|
+
_defineProperty(_this, "componentDidUpdate", function (prevProps) {
|
|
521
406
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
522
407
|
_this.makeRequest();
|
|
523
408
|
}
|
|
524
409
|
});
|
|
525
|
-
|
|
526
|
-
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
410
|
+
_defineProperty(_this, "makeRequest", function () {
|
|
527
411
|
_this.pageReady.refreshPage();
|
|
528
412
|
});
|
|
529
|
-
|
|
530
|
-
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
413
|
+
_defineProperty(_this, "emptySelected", function () {
|
|
531
414
|
return _this.setState({
|
|
532
415
|
selected: [ALL_ITEM]
|
|
533
416
|
});
|
|
534
417
|
});
|
|
535
|
-
|
|
536
|
-
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
418
|
+
_defineProperty(_this, "setNewResults", function (res) {
|
|
537
419
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
538
420
|
return sel.id;
|
|
539
421
|
});
|
|
540
|
-
|
|
541
422
|
var pagination = _this.props.resultProcessor(res);
|
|
542
|
-
|
|
543
423
|
var allSelected = _this.state.selected.some(function (item) {
|
|
544
424
|
return item.id === ALL_ITEM.id;
|
|
545
425
|
});
|
|
546
|
-
|
|
547
426
|
var newList = pagination.data.filter(function (newItem) {
|
|
548
427
|
return !selectedIds.includes(newItem.id);
|
|
549
428
|
});
|
|
550
429
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
551
|
-
|
|
552
430
|
_this.setState({
|
|
553
431
|
list: newList,
|
|
554
432
|
pagination: pagination
|
|
555
433
|
});
|
|
556
434
|
});
|
|
557
|
-
|
|
558
|
-
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
435
|
+
_defineProperty(_this, "onAddItem", function (addSelectedItem) {
|
|
559
436
|
_this.setState(function (prevState) {
|
|
560
437
|
var newSelectedList;
|
|
561
438
|
var newList;
|
|
562
|
-
|
|
563
439
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
564
440
|
// Clear Selected List
|
|
565
441
|
// and move previous Selected items to list
|
|
@@ -579,7 +455,6 @@
|
|
|
579
455
|
return item.id !== addSelectedItem.id;
|
|
580
456
|
})));
|
|
581
457
|
}
|
|
582
|
-
|
|
583
458
|
return {
|
|
584
459
|
selected: newSelectedList,
|
|
585
460
|
list: newList
|
|
@@ -590,24 +465,20 @@
|
|
|
590
465
|
}));
|
|
591
466
|
});
|
|
592
467
|
});
|
|
593
|
-
|
|
594
|
-
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
468
|
+
_defineProperty(_this, "onRemoveItem", function (removeSelectedItem) {
|
|
595
469
|
_this.setState(function (prevState) {
|
|
596
470
|
// Cannot remove ALL from selection by unselecting it
|
|
597
471
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
598
472
|
return {};
|
|
599
473
|
}
|
|
600
|
-
|
|
601
474
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
602
475
|
return item.id !== removeSelectedItem.id;
|
|
603
476
|
});
|
|
604
|
-
|
|
605
477
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
606
478
|
return item.id !== ALL_ITEM.id;
|
|
607
479
|
}).sort(function (a, b) {
|
|
608
480
|
return a.id - b.id;
|
|
609
481
|
});
|
|
610
|
-
|
|
611
482
|
return {
|
|
612
483
|
list: newList,
|
|
613
484
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -618,25 +489,23 @@
|
|
|
618
489
|
}));
|
|
619
490
|
});
|
|
620
491
|
});
|
|
621
|
-
|
|
622
|
-
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
492
|
+
_defineProperty(_this, "onIsLoading", function (flag) {
|
|
623
493
|
_this.setState({
|
|
624
494
|
isLoading: flag
|
|
625
495
|
});
|
|
626
496
|
});
|
|
627
|
-
|
|
628
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
497
|
+
_defineProperty(_this, "render", function () {
|
|
629
498
|
var _this$props = _this.props,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
499
|
+
baseClass = _this$props.baseClass,
|
|
500
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
501
|
+
identifier = _this$props.identifier,
|
|
502
|
+
triggerRequest = _this$props.triggerRequest,
|
|
503
|
+
className = _this$props.className;
|
|
635
504
|
var _this$state = _this.state,
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
505
|
+
list = _this$state.list,
|
|
506
|
+
selected = _this$state.selected,
|
|
507
|
+
pagination = _this$state.pagination,
|
|
508
|
+
isLoading = _this$state.isLoading;
|
|
640
509
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
641
510
|
"data-qe-id": identifier,
|
|
642
511
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -675,7 +544,6 @@
|
|
|
675
544
|
type: "button"
|
|
676
545
|
}, "SHOW MORE"))));
|
|
677
546
|
});
|
|
678
|
-
|
|
679
547
|
_this.state = {
|
|
680
548
|
selected: [ALL_ITEM],
|
|
681
549
|
list: [],
|
|
@@ -684,10 +552,9 @@
|
|
|
684
552
|
};
|
|
685
553
|
return _this;
|
|
686
554
|
}
|
|
687
|
-
|
|
555
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
688
556
|
return _createClass(GraphQLMultiSelector);
|
|
689
557
|
}(React__default.Component);
|
|
690
|
-
|
|
691
558
|
GraphQLMultiSelector.defaultProps = {
|
|
692
559
|
baseClass: 'multiselector'
|
|
693
560
|
};
|
|
@@ -720,24 +587,22 @@
|
|
|
720
587
|
}, function (props) {
|
|
721
588
|
return props.theme.marginPaddings[3];
|
|
722
589
|
});
|
|
723
|
-
|
|
724
590
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
725
591
|
var title = _ref.title,
|
|
726
|
-
|
|
727
|
-
|
|
592
|
+
children = _ref.children,
|
|
593
|
+
className = _ref.className;
|
|
728
594
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
729
595
|
className: className
|
|
730
596
|
}, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
731
597
|
};
|
|
732
598
|
|
|
733
599
|
var _templateObject$5;
|
|
734
|
-
|
|
735
600
|
var Title$1 = function Title(_ref) {
|
|
736
601
|
var baseClass = _ref.baseClass,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
602
|
+
className = _ref.className,
|
|
603
|
+
title = _ref.title,
|
|
604
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
605
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
741
606
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
742
607
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
743
608
|
title: title
|
|
@@ -750,7 +615,6 @@
|
|
|
750
615
|
onChange: onSearchChanged
|
|
751
616
|
})));
|
|
752
617
|
};
|
|
753
|
-
|
|
754
618
|
var StyledTitle = styled__default(Title$1)(_templateObject$5 || (_templateObject$5 = _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) {
|
|
755
619
|
return props.theme.marginPaddings[2];
|
|
756
620
|
}, function (props) {
|
|
@@ -773,37 +637,26 @@
|
|
|
773
637
|
var Title$2 = themed(StyledTitle);
|
|
774
638
|
|
|
775
639
|
var debounceBuilder = functions.debounced(200);
|
|
776
|
-
|
|
777
640
|
/**
|
|
778
641
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
779
642
|
*/
|
|
780
643
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
781
|
-
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
782
|
-
|
|
783
|
-
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
784
|
-
|
|
785
644
|
function LuxityGraphQLMultiselector(props) {
|
|
786
645
|
var _this;
|
|
787
|
-
|
|
788
646
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
789
|
-
|
|
790
|
-
_this
|
|
791
|
-
|
|
792
|
-
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
793
|
-
|
|
794
|
-
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
647
|
+
_this = _callSuper(this, LuxityGraphQLMultiselector, [props]);
|
|
648
|
+
_defineProperty(_this, "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
649
|
+
_defineProperty(_this, "increaseLimit", function () {
|
|
795
650
|
_this.setState(function (prevState) {
|
|
796
651
|
return {
|
|
797
652
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
798
653
|
};
|
|
799
654
|
});
|
|
800
655
|
});
|
|
801
|
-
|
|
802
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
656
|
+
_defineProperty(_this, "onChange", function (selection) {
|
|
803
657
|
_this.props.onChange(selection);
|
|
804
658
|
});
|
|
805
|
-
|
|
806
|
-
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
659
|
+
_defineProperty(_this, "onSearchChanged", function (event) {
|
|
807
660
|
event.preventDefault();
|
|
808
661
|
var searchText = event.target.value;
|
|
809
662
|
debounceBuilder(function () {
|
|
@@ -812,22 +665,21 @@
|
|
|
812
665
|
});
|
|
813
666
|
});
|
|
814
667
|
});
|
|
815
|
-
|
|
816
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
668
|
+
_defineProperty(_this, "render", function () {
|
|
817
669
|
var _this$state = _this.state,
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
670
|
+
limit = _this$state.limit,
|
|
671
|
+
category = _this$state.category,
|
|
672
|
+
nameFilter = _this$state.nameFilter;
|
|
821
673
|
var _this$props = _this.props,
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
674
|
+
title = _this$props.title,
|
|
675
|
+
baseClass = _this$props.baseClass,
|
|
676
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
677
|
+
resultProcessor = _this$props.resultProcessor,
|
|
678
|
+
itemRenderer = _this$props.itemRenderer,
|
|
679
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
680
|
+
graphApi = _this$props.graphApi,
|
|
681
|
+
identifier = _this$props.identifier,
|
|
682
|
+
requestInstance = _this$props.requestInstance;
|
|
831
683
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
832
684
|
className: baseClass
|
|
833
685
|
}, /*#__PURE__*/React__default.createElement(Title$2, {
|
|
@@ -850,7 +702,6 @@
|
|
|
850
702
|
itemRenderer: itemRenderer
|
|
851
703
|
})));
|
|
852
704
|
});
|
|
853
|
-
|
|
854
705
|
_this.state = {
|
|
855
706
|
limit: props.baseQueryLimit,
|
|
856
707
|
category: props.category,
|
|
@@ -858,12 +709,11 @@
|
|
|
858
709
|
};
|
|
859
710
|
return _this;
|
|
860
711
|
}
|
|
861
|
-
|
|
862
|
-
_createClass(LuxityGraphQLMultiselector, [{
|
|
712
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
713
|
+
return _createClass(LuxityGraphQLMultiselector, [{
|
|
863
714
|
key: "componentDidUpdate",
|
|
864
715
|
value: function componentDidUpdate(prevProps) {
|
|
865
716
|
var _this$multiSelectorRe;
|
|
866
|
-
|
|
867
717
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
868
718
|
this.multiSelectorRef.current.emptySelected();
|
|
869
719
|
}
|
|
@@ -876,14 +726,10 @@
|
|
|
876
726
|
category: props.category
|
|
877
727
|
};
|
|
878
728
|
}
|
|
879
|
-
|
|
880
729
|
return null;
|
|
881
730
|
}
|
|
882
731
|
}]);
|
|
883
|
-
|
|
884
|
-
return LuxityGraphQLMultiselector;
|
|
885
732
|
}(React__default.Component);
|
|
886
|
-
|
|
887
733
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
888
734
|
baseClass: '',
|
|
889
735
|
searchPlaceHolder: '',
|
|
@@ -892,21 +738,17 @@
|
|
|
892
738
|
};
|
|
893
739
|
|
|
894
740
|
var _excluded$2 = ["children"];
|
|
895
|
-
|
|
896
741
|
var _templateObject$6;
|
|
897
742
|
var Button$2 = styled__default.button(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n ", ";\n background-color: #fff;\n color: ", ";\n border: 1px solid ", ";\n\n &:disabled {\n ", "\n }\n"])), baseButtonStyle, function (props) {
|
|
898
743
|
return props.theme.colors.primary;
|
|
899
744
|
}, function (props) {
|
|
900
745
|
return props.theme.colors.primary;
|
|
901
746
|
}, disabledButtonStyle);
|
|
902
|
-
|
|
903
747
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
904
748
|
var children = _ref.children,
|
|
905
|
-
|
|
906
|
-
|
|
749
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
907
750
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
908
751
|
};
|
|
909
|
-
|
|
910
752
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
911
753
|
|
|
912
754
|
var _templateObject$7;
|
|
@@ -922,11 +764,10 @@
|
|
|
922
764
|
return props.theme.colors.ntrlMin;
|
|
923
765
|
});
|
|
924
766
|
var UnselectedButton = themed(BaseButton);
|
|
925
|
-
|
|
926
767
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
927
768
|
var item = _ref.item,
|
|
928
|
-
|
|
929
|
-
|
|
769
|
+
onSelect = _ref.onSelect,
|
|
770
|
+
selected = _ref.selected;
|
|
930
771
|
var props = {
|
|
931
772
|
onClick: function onClick(e) {
|
|
932
773
|
e.preventDefault();
|
|
@@ -938,12 +779,12 @@
|
|
|
938
779
|
|
|
939
780
|
var StyleSelector = function StyleSelector(_ref) {
|
|
940
781
|
var onChange = _ref.onChange,
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
782
|
+
category = _ref.category,
|
|
783
|
+
graphApi = _ref.graphApi,
|
|
784
|
+
itemRenderer = _ref.itemRenderer,
|
|
785
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
786
|
+
resultProcessor = _ref.resultProcessor,
|
|
787
|
+
requestInstance = _ref.requestInstance;
|
|
947
788
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
948
789
|
title: "Styles",
|
|
949
790
|
queryId: "getStyles",
|
|
@@ -960,7 +801,6 @@
|
|
|
960
801
|
requestInstance: requestInstance
|
|
961
802
|
});
|
|
962
803
|
};
|
|
963
|
-
|
|
964
804
|
StyleSelector.defaultProps = {
|
|
965
805
|
itemRenderer: ItemRenderer,
|
|
966
806
|
resultProcessor: function resultProcessor(result) {
|