@bonlineza/luxity-lib 2.39.5 → 2.39.6
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 +342 -352
- package/AddInterest.js +3136 -3142
- package/AddProductInterest.js +999 -7572
- package/BrandSelector.js +854 -861
- package/Checkbox.js +240 -250
- package/CheckboxButton.js +229 -236
- package/CommunicationPreferenceOptionsRenderer.js +560 -568
- package/CommunicationPreferenceSection.js +651 -659
- package/CommunicationPreferences.js +2394 -2402
- package/ConditionSelector.js +852 -859
- package/CountryCodeSelect.js +79 -6650
- package/CurrencyInputFormatter.js +86 -96
- package/CurrencySelect.js +219 -227
- package/DropdownSelector.js +212 -6821
- package/GALink.js +43 -51
- package/GenderSelector.js +355 -362
- package/GraphQLDropdownSelector.js +5308 -11879
- package/GraphQLMultiSelector.js +593 -601
- package/IconHeader.js +118 -126
- package/IconWrapper.js +17 -25
- package/InterestCatSelector.js +424 -432
- package/InterestItem.js +462 -470
- package/Interests.js +4718 -11289
- package/InterestsSubheading.js +33 -41
- package/InvertedTextButton.js +167 -175
- package/LuxityAppSideNav.js +181 -189
- package/LuxityDesktopHeader.js +1355 -1363
- package/LuxityFooter.js +2228 -2236
- package/LuxityGraphQLDropdownSelector.js +5393 -11964
- package/LuxityGraphQLMultiselector.js +778 -785
- package/LuxityMobileHeader.js +1786 -1794
- package/LuxityPageReady.js +199 -209
- package/LuxityProductInterestItem.js +359 -367
- package/LuxitySideNav.js +665 -673
- package/MaterialSelector.js +5428 -11999
- package/ModelSelector.js +5428 -11999
- package/NotificationDropDown.js +459 -7030
- package/Notify.js +20 -32
- package/OutlinePrimaryButton.js +134 -142
- package/PriceRangeSelector.js +1264 -1270
- package/PrimaryButton.js +129 -137
- package/RadioButtons.js +308 -318
- package/RangeSlider.js +1033 -1039
- package/RareStepFooter.js +257 -264
- package/RareStepHeader.js +801 -808
- package/ReactSelectWrapper.js +33 -6604
- package/SecondaryButton.js +144 -152
- package/ShoeSizeRangeSelector.js +1147 -1153
- package/ShoeSizeSelector.js +1146 -1154
- package/SimpleErrorBoundary.js +130 -138
- package/StyleSelector.js +854 -861
- package/TestComponent.js +15 -0
- package/TextButton.js +135 -143
- package/Tooltip.js +176 -184
- package/Tracking.js +15 -25
- package/WrapperButton.js +50 -58
- package/build/CountryCodeSelect/index.js +18 -0
- package/build/ReactSelectWrapper/index.js +34 -0
- package/build/bundle.css +1 -1
- package/build/bundle.js +10634 -17239
- package/build/constants.js +32 -45
- package/package.json +2 -2
- package/postcss.config.js +6 -0
- package/svg/Accessories.js +34 -42
- package/svg/Account.js +30 -38
- package/svg/Add.js +31 -39
- package/svg/ArrowRight.js +28 -36
- package/svg/Bags.js +40 -48
- package/svg/BurgerMenu.js +24 -32
- package/svg/Calendar.js +98 -106
- package/svg/CalendarCircled.js +100 -108
- package/svg/CheckCircled.js +32 -40
- package/svg/Close.js +29 -37
- package/svg/Clothing.js +36 -44
- package/svg/Dot.js +32 -40
- package/svg/Edit.js +27 -35
- package/svg/Eye.js +28 -36
- package/svg/FileAttach.js +28 -36
- package/svg/FileAttachCircled.js +30 -38
- package/svg/Jewellery.js +49 -57
- package/svg/LightBulb.js +58 -66
- package/svg/Logo.js +132 -140
- package/svg/LuxityMenu.js +28 -36
- package/svg/Minus.js +29 -37
- package/svg/MobileAvatar.js +28 -36
- package/svg/MyOrder.js +36 -44
- package/svg/MyPayment.js +36 -44
- package/svg/MyProfile.js +44 -52
- package/svg/MySale.js +31 -39
- package/svg/Notification.js +30 -38
- package/svg/PointerDown.js +28 -36
- package/svg/Search.js +27 -35
- package/svg/Shoes.js +37 -45
- package/svg/SvgWrapper.js +13 -21
- package/svg/Trash.js +32 -40
- package/svg/Watches.js +47 -55
|
@@ -1,896 +1,889 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
PageReady = PageReady && Object.prototype.hasOwnProperty.call(PageReady, 'default') ? PageReady['default'] : PageReady;
|
|
11
|
-
|
|
12
|
-
function _classCallCheck(instance, Constructor) {
|
|
13
|
-
if (!(instance instanceof Constructor)) {
|
|
14
|
-
throw new TypeError("Cannot call a class as a function");
|
|
15
|
-
}
|
|
1
|
+
import React, { forwardRef, Fragment } from 'react';
|
|
2
|
+
import { debounced } from '@bonlineza/b-lib/functions';
|
|
3
|
+
import styled, { css, ThemeProvider, keyframes } from 'styled-components';
|
|
4
|
+
import EllipsisLoader from '@bonlineza/b-lib/EllipsisLoader';
|
|
5
|
+
import PageReady from '@bonlineza/b-lib/PageReady';
|
|
6
|
+
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function _defineProperties(target, props) {
|
|
14
|
+
for (var i = 0; i < props.length; i++) {
|
|
15
|
+
var descriptor = props[i];
|
|
16
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
17
|
+
descriptor.configurable = true;
|
|
18
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
19
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
26
20
|
}
|
|
21
|
+
}
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
24
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
25
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
26
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
27
|
+
writable: false
|
|
28
|
+
});
|
|
29
|
+
return Constructor;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _defineProperty(obj, key, value) {
|
|
33
|
+
if (key in obj) {
|
|
34
|
+
Object.defineProperty(obj, key, {
|
|
35
|
+
value: value,
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true
|
|
33
39
|
});
|
|
34
|
-
|
|
40
|
+
} else {
|
|
41
|
+
obj[key] = value;
|
|
35
42
|
}
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Object.defineProperty(obj, key, {
|
|
40
|
-
value: value,
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true
|
|
44
|
-
});
|
|
45
|
-
} else {
|
|
46
|
-
obj[key] = value;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
function _extends() {
|
|
48
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
49
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
+
var source = arguments[i];
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
52
|
+
for (var key in source) {
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
54
|
+
target[key] = source[key];
|
|
61
55
|
}
|
|
62
56
|
}
|
|
63
|
-
|
|
64
|
-
return target;
|
|
65
|
-
};
|
|
66
|
-
return _extends.apply(this, arguments);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _inherits(subClass, superClass) {
|
|
70
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
71
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
72
57
|
}
|
|
73
58
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
configurable: true
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
Object.defineProperty(subClass, "prototype", {
|
|
82
|
-
writable: false
|
|
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
|
-
}
|
|
59
|
+
return target;
|
|
60
|
+
};
|
|
61
|
+
return _extends.apply(this, arguments);
|
|
62
|
+
}
|
|
93
63
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return o;
|
|
98
|
-
};
|
|
99
|
-
return _setPrototypeOf(o, p);
|
|
64
|
+
function _inherits(subClass, superClass) {
|
|
65
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
66
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
100
67
|
}
|
|
101
68
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
109
|
-
return true;
|
|
110
|
-
} catch (e) {
|
|
111
|
-
return false;
|
|
69
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
70
|
+
constructor: {
|
|
71
|
+
value: subClass,
|
|
72
|
+
writable: true,
|
|
73
|
+
configurable: true
|
|
112
74
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
var key, i;
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(subClass, "prototype", {
|
|
77
|
+
writable: false
|
|
78
|
+
});
|
|
79
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
80
|
+
}
|
|
120
81
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
82
|
+
function _getPrototypeOf(o) {
|
|
83
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
84
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
85
|
+
};
|
|
86
|
+
return _getPrototypeOf(o);
|
|
87
|
+
}
|
|
126
88
|
|
|
127
|
-
|
|
89
|
+
function _setPrototypeOf(o, p) {
|
|
90
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
91
|
+
o.__proto__ = p;
|
|
92
|
+
return o;
|
|
93
|
+
};
|
|
94
|
+
return _setPrototypeOf(o, p);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function _isNativeReflectConstruct() {
|
|
98
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
99
|
+
if (Reflect.construct.sham) return false;
|
|
100
|
+
if (typeof Proxy === "function") return true;
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
104
|
+
return true;
|
|
105
|
+
} catch (e) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
111
|
+
if (source == null) return {};
|
|
112
|
+
var target = {};
|
|
113
|
+
var sourceKeys = Object.keys(source);
|
|
114
|
+
var key, i;
|
|
115
|
+
|
|
116
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
117
|
+
key = sourceKeys[i];
|
|
118
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
119
|
+
target[key] = source[key];
|
|
128
120
|
}
|
|
129
121
|
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
return target;
|
|
123
|
+
}
|
|
132
124
|
|
|
133
|
-
|
|
125
|
+
function _objectWithoutProperties(source, excluded) {
|
|
126
|
+
if (source == null) return {};
|
|
134
127
|
|
|
135
|
-
|
|
128
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
136
129
|
|
|
137
|
-
|
|
138
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
130
|
+
var key, i;
|
|
139
131
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
143
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
144
|
-
target[key] = source[key];
|
|
145
|
-
}
|
|
146
|
-
}
|
|
132
|
+
if (Object.getOwnPropertySymbols) {
|
|
133
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
147
134
|
|
|
148
|
-
|
|
135
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
136
|
+
key = sourceSymbolKeys[i];
|
|
137
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
138
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
139
|
+
target[key] = source[key];
|
|
140
|
+
}
|
|
149
141
|
}
|
|
150
142
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
154
|
-
}
|
|
143
|
+
return target;
|
|
144
|
+
}
|
|
155
145
|
|
|
156
|
-
|
|
146
|
+
function _assertThisInitialized(self) {
|
|
147
|
+
if (self === void 0) {
|
|
148
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
157
149
|
}
|
|
158
150
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return call;
|
|
162
|
-
} else if (call !== void 0) {
|
|
163
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
164
|
-
}
|
|
151
|
+
return self;
|
|
152
|
+
}
|
|
165
153
|
|
|
166
|
-
|
|
154
|
+
function _possibleConstructorReturn(self, call) {
|
|
155
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
156
|
+
return call;
|
|
157
|
+
} else if (call !== void 0) {
|
|
158
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
167
159
|
}
|
|
168
160
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return function _createSuperInternal() {
|
|
173
|
-
var Super = _getPrototypeOf(Derived),
|
|
174
|
-
result;
|
|
161
|
+
return _assertThisInitialized(self);
|
|
162
|
+
}
|
|
175
163
|
|
|
176
|
-
|
|
177
|
-
|
|
164
|
+
function _createSuper(Derived) {
|
|
165
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
178
166
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
result
|
|
182
|
-
}
|
|
167
|
+
return function _createSuperInternal() {
|
|
168
|
+
var Super = _getPrototypeOf(Derived),
|
|
169
|
+
result;
|
|
183
170
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
171
|
+
if (hasNativeReflectConstruct) {
|
|
172
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
187
173
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
174
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
175
|
+
} else {
|
|
176
|
+
result = Super.apply(this, arguments);
|
|
191
177
|
}
|
|
192
178
|
|
|
193
|
-
return
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function _toConsumableArray(arr) {
|
|
201
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function _arrayWithoutHoles(arr) {
|
|
205
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
206
|
-
}
|
|
179
|
+
return _possibleConstructorReturn(this, result);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
207
182
|
|
|
208
|
-
|
|
209
|
-
|
|
183
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
184
|
+
if (!raw) {
|
|
185
|
+
raw = strings.slice(0);
|
|
210
186
|
}
|
|
211
187
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
219
|
-
}
|
|
188
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
189
|
+
raw: {
|
|
190
|
+
value: Object.freeze(raw)
|
|
191
|
+
}
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
220
194
|
|
|
221
|
-
|
|
222
|
-
|
|
195
|
+
function _toConsumableArray(arr) {
|
|
196
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
197
|
+
}
|
|
223
198
|
|
|
224
|
-
|
|
199
|
+
function _arrayWithoutHoles(arr) {
|
|
200
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
201
|
+
}
|
|
225
202
|
|
|
226
|
-
|
|
227
|
-
|
|
203
|
+
function _iterableToArray(iter) {
|
|
204
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
205
|
+
}
|
|
228
206
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
207
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
208
|
+
if (!o) return;
|
|
209
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
210
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
211
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
212
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
213
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
214
|
+
}
|
|
232
215
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
var message = customMessage || 'Network Error';
|
|
236
|
-
return message.replace(':error_code', error.status || 'Network Down');
|
|
237
|
-
};
|
|
216
|
+
function _arrayLikeToArray(arr, len) {
|
|
217
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
238
218
|
|
|
239
|
-
var
|
|
240
|
-
data: null
|
|
241
|
-
});
|
|
242
|
-
/**
|
|
243
|
-
* A flavour of PageReady with Luxity customisations
|
|
244
|
-
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
245
|
-
* 2. an error message interpreter is supplied from the local helper library
|
|
246
|
-
*/
|
|
219
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
247
220
|
|
|
248
|
-
|
|
249
|
-
|
|
221
|
+
return arr2;
|
|
222
|
+
}
|
|
250
223
|
|
|
251
|
-
|
|
224
|
+
function _nonIterableSpread() {
|
|
225
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
226
|
+
}
|
|
252
227
|
|
|
253
|
-
|
|
254
|
-
|
|
228
|
+
var interpretErrorMessage = function interpretErrorMessage(error) {
|
|
229
|
+
var customMessage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Failed: :error_code';
|
|
230
|
+
var message = customMessage || 'Network Error';
|
|
231
|
+
return message.replace(':error_code', error.status || 'Network Down');
|
|
232
|
+
};
|
|
255
233
|
|
|
256
|
-
|
|
234
|
+
var LuxityPageReadyContext = /*#__PURE__*/React.createContext({
|
|
235
|
+
data: null
|
|
236
|
+
});
|
|
237
|
+
/**
|
|
238
|
+
* A flavour of PageReady with Luxity customisations
|
|
239
|
+
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
240
|
+
* 2. an error message interpreter is supplied from the local helper library
|
|
241
|
+
*/
|
|
257
242
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
243
|
+
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
244
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
261
245
|
|
|
262
|
-
|
|
246
|
+
var _super = _createSuper(LuxityPageReady);
|
|
263
247
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
});
|
|
248
|
+
function LuxityPageReady() {
|
|
249
|
+
var _this;
|
|
267
250
|
|
|
268
|
-
|
|
269
|
-
return _this.pageReadyInstance.initRequest();
|
|
270
|
-
});
|
|
251
|
+
_classCallCheck(this, LuxityPageReady);
|
|
271
252
|
|
|
272
|
-
|
|
253
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
254
|
+
args[_key] = arguments[_key];
|
|
273
255
|
}
|
|
274
256
|
|
|
275
|
-
|
|
276
|
-
key: "render",
|
|
277
|
-
value: function render() {
|
|
278
|
-
var _this2 = this;
|
|
279
|
-
|
|
280
|
-
var _this$props = this.props,
|
|
281
|
-
customErrorMessage = _this$props.customErrorMessage,
|
|
282
|
-
customErrorHandler = _this$props.customErrorHandler,
|
|
283
|
-
getRequestPromise = _this$props.getRequestPromise,
|
|
284
|
-
_onData = _this$props.onData,
|
|
285
|
-
children = _this$props.children;
|
|
286
|
-
var data = this.state.data;
|
|
287
|
-
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
288
|
-
ref: function ref(inst) {
|
|
289
|
-
_this2.pageReadyInstance = inst;
|
|
290
|
-
},
|
|
291
|
-
onData: function onData(res) {
|
|
292
|
-
_this2.setState({
|
|
293
|
-
data: res.data
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
_onData(res);
|
|
297
|
-
},
|
|
298
|
-
getRequestInstance: function getRequestInstance() {
|
|
299
|
-
_this2.props.onIsLoading(true);
|
|
300
|
-
|
|
301
|
-
return getRequestPromise().then(function (out) {
|
|
302
|
-
_this2.props.onIsLoading(false);
|
|
303
|
-
|
|
304
|
-
return out;
|
|
305
|
-
}).catch(function (oops) {
|
|
306
|
-
_this2.props.onIsLoading(false);
|
|
307
|
-
|
|
308
|
-
return oops;
|
|
309
|
-
});
|
|
310
|
-
},
|
|
311
|
-
customErrorMessage: customErrorMessage,
|
|
312
|
-
customErrorHandler: customErrorHandler,
|
|
313
|
-
renderCustomLoader: function renderCustomLoader() {
|
|
314
|
-
return /*#__PURE__*/React__default.createElement(EllipsisLoader, null);
|
|
315
|
-
},
|
|
316
|
-
errorMessageInterpreter: interpretErrorMessage
|
|
317
|
-
}, /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Provider, {
|
|
318
|
-
value: {
|
|
319
|
-
data: data
|
|
320
|
-
}
|
|
321
|
-
}, children));
|
|
322
|
-
}
|
|
323
|
-
}]);
|
|
324
|
-
|
|
325
|
-
return LuxityPageReady;
|
|
326
|
-
}(React__default.Component);
|
|
257
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
327
258
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
return null;
|
|
331
|
-
},
|
|
332
|
-
customErrorMessage: '',
|
|
333
|
-
customErrorHandler: function customErrorHandler() {
|
|
334
|
-
return null;
|
|
335
|
-
},
|
|
336
|
-
onData: function onData() {
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
var _templateObject, _templateObject2;
|
|
342
|
-
var disabledButtonStyle = styled.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: not-allowed;\n opacity: 0.4;\n"])));
|
|
343
|
-
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"])));
|
|
344
|
-
|
|
345
|
-
var theme = {
|
|
346
|
-
breakpoints: ['40em', '52em', '64em'],
|
|
347
|
-
space: ['0px', '4px', '8px', '16px', '32px', '64px', '128px', '256px', '512px'],
|
|
348
|
-
fontSizes: ['12px', '14px', '16px', '20px', '24px', '32px', '48px', '64px', '72px'],
|
|
349
|
-
marginPaddings: ['0.5rem', '1rem', '1.5rem', '2rem', '2.5rem', '3rem', '3.5rem', '4rem', '4.5rem', '5rem', '5.5rem', '6rem'],
|
|
350
|
-
letterSpacings: ['-0.5px', '0px', '+0.5px'],
|
|
351
|
-
radii: ['0px', '2px', '4px', '8px'],
|
|
352
|
-
borderRadius: '6px',
|
|
353
|
-
colors: {
|
|
354
|
-
primary: '#000',
|
|
355
|
-
base: '#4e4949',
|
|
356
|
-
baseLt: '#817c7c',
|
|
357
|
-
borderColor: '#d8d8d8',
|
|
358
|
-
ntrlMin: '#fff',
|
|
359
|
-
ntrlMinTen: '#e6e6e6',
|
|
360
|
-
gray: '#efefef',
|
|
361
|
-
darkerGray: '#454141'
|
|
362
|
-
},
|
|
363
|
-
rareStepColors: {
|
|
364
|
-
primary: '#202b58',
|
|
365
|
-
secondary: '#ef5c2d',
|
|
366
|
-
ntrlMin: '#ffffff',
|
|
367
|
-
ntrl40: '#f4f4f4',
|
|
368
|
-
ntrl50: '#808080',
|
|
369
|
-
ntrl60: '#e8e8e8',
|
|
370
|
-
ntrl70: '#252525',
|
|
371
|
-
ntrlMax: '#000000'
|
|
372
|
-
},
|
|
373
|
-
rareStepFontWeights: {
|
|
374
|
-
normal: 400,
|
|
375
|
-
medium: 500,
|
|
376
|
-
semiBold: 600,
|
|
377
|
-
bold: 700
|
|
378
|
-
},
|
|
379
|
-
rareStepFontSize: {
|
|
380
|
-
h1: '36px',
|
|
381
|
-
h2: '30px',
|
|
382
|
-
h3: '24px',
|
|
383
|
-
h4: '20px',
|
|
384
|
-
h5: '16px',
|
|
385
|
-
h6: '14px',
|
|
386
|
-
footerTitle: '16px'
|
|
387
|
-
},
|
|
388
|
-
rareStepPageSizes: {
|
|
389
|
-
mobile: '500px',
|
|
390
|
-
tablet: '768px',
|
|
391
|
-
desktop: '992px',
|
|
392
|
-
screenl: '1280px',
|
|
393
|
-
screenxl: '1680px',
|
|
394
|
-
screenxxl: '1920px',
|
|
395
|
-
container: '1600px'
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
var themed = (function (Component) {
|
|
400
|
-
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
401
|
-
return /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
|
|
402
|
-
theme: theme
|
|
403
|
-
}, /*#__PURE__*/React__default.createElement(Component, _extends({}, props, {
|
|
404
|
-
ref: ref
|
|
405
|
-
})));
|
|
259
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
260
|
+
data: null
|
|
406
261
|
});
|
|
407
|
-
});
|
|
408
262
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
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
|
-
return props.theme.colors.base;
|
|
414
|
-
}, function (props) {
|
|
415
|
-
return props.theme.colors.primary;
|
|
416
|
-
}, disabledButtonStyle, function (props) {
|
|
417
|
-
return props.theme.colors.base;
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
var TextButton = function TextButton(_ref) {
|
|
421
|
-
var children = _ref.children,
|
|
422
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
423
|
-
|
|
424
|
-
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
425
|
-
};
|
|
263
|
+
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
264
|
+
return _this.pageReadyInstance.initRequest();
|
|
265
|
+
});
|
|
426
266
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
};
|
|
430
|
-
var TextButton$1 = themed(TextButton);
|
|
431
|
-
|
|
432
|
-
var _excluded$1 = ["children"];
|
|
433
|
-
|
|
434
|
-
var _templateObject$2;
|
|
435
|
-
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
|
-
return props.theme.colors.ntrlMin;
|
|
437
|
-
}, function (props) {
|
|
438
|
-
return props.theme.colors.primary;
|
|
439
|
-
}, function (props) {
|
|
440
|
-
return props.theme.colors.base;
|
|
441
|
-
}, function (props) {
|
|
442
|
-
return props.theme.colors.ntrlMin;
|
|
443
|
-
}, function (props) {
|
|
444
|
-
return props.theme.colors.ntrlMin;
|
|
445
|
-
}, function (props) {
|
|
446
|
-
return props.theme.colors.primary;
|
|
447
|
-
});
|
|
267
|
+
return _this;
|
|
268
|
+
}
|
|
448
269
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
270
|
+
_createClass(LuxityPageReady, [{
|
|
271
|
+
key: "render",
|
|
272
|
+
value: function render() {
|
|
273
|
+
var _this2 = this;
|
|
274
|
+
|
|
275
|
+
var _this$props = this.props,
|
|
276
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
277
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
278
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
279
|
+
_onData = _this$props.onData,
|
|
280
|
+
children = _this$props.children;
|
|
281
|
+
var data = this.state.data;
|
|
282
|
+
return /*#__PURE__*/React.createElement(PageReady, {
|
|
283
|
+
ref: function ref(inst) {
|
|
284
|
+
_this2.pageReadyInstance = inst;
|
|
285
|
+
},
|
|
286
|
+
onData: function onData(res) {
|
|
287
|
+
_this2.setState({
|
|
288
|
+
data: res.data
|
|
289
|
+
});
|
|
452
290
|
|
|
453
|
-
|
|
454
|
-
|
|
291
|
+
_onData(res);
|
|
292
|
+
},
|
|
293
|
+
getRequestInstance: function getRequestInstance() {
|
|
294
|
+
_this2.props.onIsLoading(true);
|
|
455
295
|
|
|
456
|
-
|
|
296
|
+
return getRequestPromise().then(function (out) {
|
|
297
|
+
_this2.props.onIsLoading(false);
|
|
457
298
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
md: '992px',
|
|
462
|
-
lg: '1200px'
|
|
463
|
-
};
|
|
299
|
+
return out;
|
|
300
|
+
}).catch(function (oops) {
|
|
301
|
+
_this2.props.onIsLoading(false);
|
|
464
302
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
return
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
303
|
+
return oops;
|
|
304
|
+
});
|
|
305
|
+
},
|
|
306
|
+
customErrorMessage: customErrorMessage,
|
|
307
|
+
customErrorHandler: customErrorHandler,
|
|
308
|
+
renderCustomLoader: function renderCustomLoader() {
|
|
309
|
+
return /*#__PURE__*/React.createElement(EllipsisLoader, null);
|
|
310
|
+
},
|
|
311
|
+
errorMessageInterpreter: interpretErrorMessage
|
|
312
|
+
}, /*#__PURE__*/React.createElement(LuxityPageReadyContext.Provider, {
|
|
313
|
+
value: {
|
|
314
|
+
data: data
|
|
315
|
+
}
|
|
316
|
+
}, children));
|
|
317
|
+
}
|
|
318
|
+
}]);
|
|
319
|
+
|
|
320
|
+
return LuxityPageReady;
|
|
321
|
+
}(React.Component);
|
|
322
|
+
|
|
323
|
+
LuxityPageReady.defaultProps = {
|
|
324
|
+
onIsLoading: function onIsLoading() {
|
|
325
|
+
return null;
|
|
326
|
+
},
|
|
327
|
+
customErrorMessage: '',
|
|
328
|
+
customErrorHandler: function customErrorHandler() {
|
|
329
|
+
return null;
|
|
330
|
+
},
|
|
331
|
+
onData: function onData() {
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
var _templateObject, _templateObject2;
|
|
337
|
+
var disabledButtonStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: not-allowed;\n opacity: 0.4;\n"])));
|
|
338
|
+
var baseButtonStyle = 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"])));
|
|
339
|
+
|
|
340
|
+
var theme = {
|
|
341
|
+
breakpoints: ['40em', '52em', '64em'],
|
|
342
|
+
space: ['0px', '4px', '8px', '16px', '32px', '64px', '128px', '256px', '512px'],
|
|
343
|
+
fontSizes: ['12px', '14px', '16px', '20px', '24px', '32px', '48px', '64px', '72px'],
|
|
344
|
+
marginPaddings: ['0.5rem', '1rem', '1.5rem', '2rem', '2.5rem', '3rem', '3.5rem', '4rem', '4.5rem', '5rem', '5.5rem', '6rem'],
|
|
345
|
+
letterSpacings: ['-0.5px', '0px', '+0.5px'],
|
|
346
|
+
radii: ['0px', '2px', '4px', '8px'],
|
|
347
|
+
borderRadius: '6px',
|
|
348
|
+
colors: {
|
|
349
|
+
primary: '#000',
|
|
350
|
+
base: '#4e4949',
|
|
351
|
+
baseLt: '#817c7c',
|
|
352
|
+
borderColor: '#d8d8d8',
|
|
353
|
+
ntrlMin: '#fff',
|
|
354
|
+
ntrlMinTen: '#e6e6e6',
|
|
355
|
+
gray: '#efefef',
|
|
356
|
+
darkerGray: '#454141'
|
|
357
|
+
},
|
|
358
|
+
rareStepColors: {
|
|
359
|
+
primary: '#202b58',
|
|
360
|
+
secondary: '#ef5c2d',
|
|
361
|
+
ntrlMin: '#ffffff',
|
|
362
|
+
ntrl40: '#f4f4f4',
|
|
363
|
+
ntrl50: '#808080',
|
|
364
|
+
ntrl60: '#e8e8e8',
|
|
365
|
+
ntrl70: '#252525',
|
|
366
|
+
ntrlMax: '#000000'
|
|
367
|
+
},
|
|
368
|
+
rareStepFontWeights: {
|
|
369
|
+
normal: 400,
|
|
370
|
+
medium: 500,
|
|
371
|
+
semiBold: 600,
|
|
372
|
+
bold: 700
|
|
373
|
+
},
|
|
374
|
+
rareStepFontSize: {
|
|
375
|
+
h1: '36px',
|
|
376
|
+
h2: '30px',
|
|
377
|
+
h3: '24px',
|
|
378
|
+
h4: '20px',
|
|
379
|
+
h5: '16px',
|
|
380
|
+
h6: '14px',
|
|
381
|
+
footerTitle: '16px'
|
|
382
|
+
},
|
|
383
|
+
rareStepPageSizes: {
|
|
384
|
+
mobile: '500px',
|
|
385
|
+
tablet: '768px',
|
|
386
|
+
desktop: '992px',
|
|
387
|
+
screenl: '1280px',
|
|
388
|
+
screenxl: '1680px',
|
|
389
|
+
screenxxl: '1920px',
|
|
390
|
+
container: '1600px'
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
var themed = (function (Component) {
|
|
395
|
+
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
396
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
397
|
+
theme: theme
|
|
398
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
399
|
+
ref: ref
|
|
400
|
+
})));
|
|
503
401
|
});
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
var _excluded = ["children"];
|
|
405
|
+
|
|
406
|
+
var _templateObject$1;
|
|
407
|
+
var Button = styled.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) {
|
|
408
|
+
return props.theme.colors.base;
|
|
409
|
+
}, function (props) {
|
|
410
|
+
return props.theme.colors.primary;
|
|
411
|
+
}, disabledButtonStyle, function (props) {
|
|
412
|
+
return props.theme.colors.base;
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
var TextButton = function TextButton(_ref) {
|
|
416
|
+
var children = _ref.children,
|
|
417
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
418
|
+
|
|
419
|
+
return /*#__PURE__*/React.createElement(Button, restProps, children);
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
TextButton.defaultProps = {
|
|
423
|
+
type: 'button'
|
|
424
|
+
};
|
|
425
|
+
var TextButton$1 = themed(TextButton);
|
|
426
|
+
|
|
427
|
+
var _excluded$1 = ["children"];
|
|
428
|
+
|
|
429
|
+
var _templateObject$2;
|
|
430
|
+
var Button$1 = styled(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) {
|
|
431
|
+
return props.theme.colors.ntrlMin;
|
|
432
|
+
}, function (props) {
|
|
433
|
+
return props.theme.colors.primary;
|
|
434
|
+
}, function (props) {
|
|
435
|
+
return props.theme.colors.base;
|
|
436
|
+
}, function (props) {
|
|
437
|
+
return props.theme.colors.ntrlMin;
|
|
438
|
+
}, function (props) {
|
|
439
|
+
return props.theme.colors.ntrlMin;
|
|
440
|
+
}, function (props) {
|
|
441
|
+
return props.theme.colors.primary;
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
445
|
+
var children = _ref.children,
|
|
446
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
447
|
+
|
|
448
|
+
return /*#__PURE__*/React.createElement(Button$1, restProps, children);
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
452
|
+
|
|
453
|
+
var media = {
|
|
454
|
+
xs: '576px',
|
|
455
|
+
sm: '768px',
|
|
456
|
+
md: '992px',
|
|
457
|
+
lg: '1200px'
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
var _templateObject$3, _templateObject2$1;
|
|
461
|
+
var ALL_ITEM = {
|
|
462
|
+
id: 'ALL',
|
|
463
|
+
name: 'ALL'
|
|
464
|
+
};
|
|
465
|
+
var multiSelectorItemMaxHeight = '3rem';
|
|
466
|
+
var multiSelectorItemAnimationDuration = '300ms';
|
|
467
|
+
var multiselectorItemFadeIn = keyframes(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n from {\n margin: 0;\n max-height: 0px;\n opacity: 0;\n }\n to {\n max-height: ", ";\n opacity: 1;\n }\n"])), multiSelectorItemMaxHeight);
|
|
468
|
+
var StyledMultiselector = styled.div(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n .multiselector__selected-items,\n .multiselector__selectable-items {\n display: flex;\n flex-flow: wrap;\n margin-left: calc(-1 * ", ");\n button {\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n text-transform: none;\n box-sizing: border-box;\n animation: ", " ease-in-out\n ", " forwards;\n flex-basis: calc(25% - ", ");\n margin-bottom: ", ";\n margin-left: ", ";\n text-overflow: ellipsis;\n overflow-x: hidden;\n min-height: 40px;\n\n @media (max-width: ", ") {\n flex-basis: calc(50% - ", ");\n }\n }\n }\n\n .multiselector__footer {\n display: flex;\n justify-content: center;\n button {\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n background-color: ", ";\n color: ", ";\n }\n }\n"])), function (props) {
|
|
469
|
+
return props.theme.marginPaddings[2];
|
|
470
|
+
}, function (props) {
|
|
471
|
+
return props.theme.colors.ntrlMin;
|
|
472
|
+
}, function (props) {
|
|
473
|
+
return props.theme.colors.primary;
|
|
474
|
+
}, function (props) {
|
|
475
|
+
return props.theme.colors.primary;
|
|
476
|
+
}, function (props) {
|
|
477
|
+
return props.theme.colors.ntrlMin;
|
|
478
|
+
}, function (props) {
|
|
479
|
+
return props.theme.colors.primary;
|
|
480
|
+
}, function (props) {
|
|
481
|
+
return props.theme.marginPaddings[0];
|
|
482
|
+
}, multiSelectorItemAnimationDuration, multiselectorItemFadeIn, function (props) {
|
|
483
|
+
return props.theme.marginPaddings[2];
|
|
484
|
+
}, function (props) {
|
|
485
|
+
return props.theme.marginPaddings[2];
|
|
486
|
+
}, function (props) {
|
|
487
|
+
return props.theme.marginPaddings[2];
|
|
488
|
+
}, media.sm, function (props) {
|
|
489
|
+
return props.theme.marginPaddings[2];
|
|
490
|
+
}, function (props) {
|
|
491
|
+
return props.theme.colors.primary;
|
|
492
|
+
}, function (props) {
|
|
493
|
+
return props.theme.colors.ntrlMin;
|
|
494
|
+
}, function (props) {
|
|
495
|
+
return props.theme.colors.primary;
|
|
496
|
+
}, function (props) {
|
|
497
|
+
return props.theme.colors.ntrlMin;
|
|
498
|
+
});
|
|
499
|
+
/**
|
|
500
|
+
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
501
|
+
*/
|
|
502
|
+
|
|
503
|
+
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
504
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
505
|
+
|
|
506
|
+
var _super = _createSuper(GraphQLMultiSelector);
|
|
507
|
+
|
|
508
|
+
function GraphQLMultiSelector(props) {
|
|
509
|
+
var _this;
|
|
510
|
+
|
|
511
|
+
_classCallCheck(this, GraphQLMultiSelector);
|
|
512
|
+
|
|
513
|
+
_this = _super.call(this, props);
|
|
514
|
+
|
|
515
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
516
|
+
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
517
|
+
_this.makeRequest();
|
|
518
|
+
}
|
|
519
|
+
});
|
|
519
520
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
});
|
|
521
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
522
|
+
_this.pageReady.refreshPage();
|
|
523
|
+
});
|
|
525
524
|
|
|
526
|
-
|
|
527
|
-
|
|
525
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
526
|
+
return _this.setState({
|
|
527
|
+
selected: [ALL_ITEM]
|
|
528
528
|
});
|
|
529
|
+
});
|
|
529
530
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
});
|
|
531
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
532
|
+
var selectedIds = _this.state.selected.map(function (sel) {
|
|
533
|
+
return sel.id;
|
|
534
534
|
});
|
|
535
535
|
|
|
536
|
-
|
|
537
|
-
var selectedIds = _this.state.selected.map(function (sel) {
|
|
538
|
-
return sel.id;
|
|
539
|
-
});
|
|
540
|
-
|
|
541
|
-
var pagination = _this.props.resultProcessor(res);
|
|
542
|
-
|
|
543
|
-
var allSelected = _this.state.selected.some(function (item) {
|
|
544
|
-
return item.id === ALL_ITEM.id;
|
|
545
|
-
});
|
|
546
|
-
|
|
547
|
-
var newList = pagination.data.filter(function (newItem) {
|
|
548
|
-
return !selectedIds.includes(newItem.id);
|
|
549
|
-
});
|
|
550
|
-
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
536
|
+
var pagination = _this.props.resultProcessor(res);
|
|
551
537
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
pagination: pagination
|
|
555
|
-
});
|
|
538
|
+
var allSelected = _this.state.selected.some(function (item) {
|
|
539
|
+
return item.id === ALL_ITEM.id;
|
|
556
540
|
});
|
|
557
541
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
var newSelectedList;
|
|
561
|
-
var newList;
|
|
562
|
-
|
|
563
|
-
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
564
|
-
// Clear Selected List
|
|
565
|
-
// and move previous Selected items to list
|
|
566
|
-
newSelectedList = [ALL_ITEM];
|
|
567
|
-
newList = prevState.list.filter(function (item) {
|
|
568
|
-
return item.id !== ALL_ITEM.id;
|
|
569
|
-
}).concat(prevState.selected).sort(function (a, b) {
|
|
570
|
-
return a.id - b.id;
|
|
571
|
-
});
|
|
572
|
-
} else {
|
|
573
|
-
newSelectedList = _toConsumableArray(prevState.selected.filter(function (item) {
|
|
574
|
-
return item.id !== ALL_ITEM.id;
|
|
575
|
-
})).concat(addSelectedItem);
|
|
576
|
-
newList = [ALL_ITEM].concat(_toConsumableArray(prevState.list.filter(function (item) {
|
|
577
|
-
return item.id !== ALL_ITEM.id;
|
|
578
|
-
}).filter(function (item) {
|
|
579
|
-
return item.id !== addSelectedItem.id;
|
|
580
|
-
})));
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
return {
|
|
584
|
-
selected: newSelectedList,
|
|
585
|
-
list: newList
|
|
586
|
-
};
|
|
587
|
-
}, function () {
|
|
588
|
-
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
589
|
-
return item.id !== ALL_ITEM.id;
|
|
590
|
-
}));
|
|
591
|
-
});
|
|
542
|
+
var newList = pagination.data.filter(function (newItem) {
|
|
543
|
+
return !selectedIds.includes(newItem.id);
|
|
592
544
|
});
|
|
545
|
+
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
593
546
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
}
|
|
547
|
+
_this.setState({
|
|
548
|
+
list: newList,
|
|
549
|
+
pagination: pagination
|
|
550
|
+
});
|
|
551
|
+
});
|
|
600
552
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
553
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
554
|
+
_this.setState(function (prevState) {
|
|
555
|
+
var newSelectedList;
|
|
556
|
+
var newList;
|
|
604
557
|
|
|
605
|
-
|
|
558
|
+
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
559
|
+
// Clear Selected List
|
|
560
|
+
// and move previous Selected items to list
|
|
561
|
+
newSelectedList = [ALL_ITEM];
|
|
562
|
+
newList = prevState.list.filter(function (item) {
|
|
606
563
|
return item.id !== ALL_ITEM.id;
|
|
607
|
-
}).sort(function (a, b) {
|
|
564
|
+
}).concat(prevState.selected).sort(function (a, b) {
|
|
608
565
|
return a.id - b.id;
|
|
609
566
|
});
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
list: newList,
|
|
613
|
-
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
614
|
-
};
|
|
615
|
-
}, function () {
|
|
616
|
-
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
567
|
+
} else {
|
|
568
|
+
newSelectedList = _toConsumableArray(prevState.selected.filter(function (item) {
|
|
617
569
|
return item.id !== ALL_ITEM.id;
|
|
618
|
-
}));
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
});
|
|
626
|
-
});
|
|
570
|
+
})).concat(addSelectedItem);
|
|
571
|
+
newList = [ALL_ITEM].concat(_toConsumableArray(prevState.list.filter(function (item) {
|
|
572
|
+
return item.id !== ALL_ITEM.id;
|
|
573
|
+
}).filter(function (item) {
|
|
574
|
+
return item.id !== addSelectedItem.id;
|
|
575
|
+
})));
|
|
576
|
+
}
|
|
627
577
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
list = _this$state.list,
|
|
637
|
-
selected = _this$state.selected,
|
|
638
|
-
pagination = _this$state.pagination,
|
|
639
|
-
isLoading = _this$state.isLoading;
|
|
640
|
-
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
641
|
-
"data-qe-id": identifier,
|
|
642
|
-
className: "".concat(className, " ").concat(baseClass)
|
|
643
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
644
|
-
className: "".concat(baseClass, "__selected-items")
|
|
645
|
-
}, selected.map(function (item) {
|
|
646
|
-
return /*#__PURE__*/React__default.createElement(ItemRenderer, {
|
|
647
|
-
key: item.id,
|
|
648
|
-
item: item,
|
|
649
|
-
onSelect: _this.onRemoveItem,
|
|
650
|
-
selected: true
|
|
651
|
-
});
|
|
652
|
-
})), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
653
|
-
ref: function ref(inst) {
|
|
654
|
-
_this.pageReady = inst;
|
|
655
|
-
},
|
|
656
|
-
onData: _this.setNewResults,
|
|
657
|
-
onIsLoading: _this.onIsLoading,
|
|
658
|
-
getRequestPromise: function getRequestPromise() {
|
|
659
|
-
return triggerRequest();
|
|
660
|
-
}
|
|
661
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
662
|
-
className: "".concat(baseClass, "__selectable-items")
|
|
663
|
-
}, list.map(function (item) {
|
|
664
|
-
return /*#__PURE__*/React__default.createElement(ItemRenderer, {
|
|
665
|
-
key: item.id,
|
|
666
|
-
item: item,
|
|
667
|
-
onSelect: _this.onAddItem,
|
|
668
|
-
selected: false
|
|
669
|
-
});
|
|
670
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
|
671
|
-
className: "".concat(baseClass, "__footer")
|
|
672
|
-
}, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
673
|
-
disabled: isLoading || !pagination.has_more_pages,
|
|
674
|
-
onClick: _this.props.increaseLimit,
|
|
675
|
-
type: "button"
|
|
676
|
-
}, "SHOW MORE"))));
|
|
578
|
+
return {
|
|
579
|
+
selected: newSelectedList,
|
|
580
|
+
list: newList
|
|
581
|
+
};
|
|
582
|
+
}, function () {
|
|
583
|
+
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
584
|
+
return item.id !== ALL_ITEM.id;
|
|
585
|
+
}));
|
|
677
586
|
});
|
|
587
|
+
});
|
|
678
588
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
return _this;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
return _createClass(GraphQLMultiSelector);
|
|
689
|
-
}(React__default.Component);
|
|
690
|
-
|
|
691
|
-
GraphQLMultiSelector.defaultProps = {
|
|
692
|
-
baseClass: 'multiselector'
|
|
693
|
-
};
|
|
694
|
-
var GraphQLMultiSelector$1 = themed(GraphQLMultiSelector);
|
|
695
|
-
|
|
696
|
-
var Search = (function (props) {
|
|
697
|
-
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
698
|
-
width: "15",
|
|
699
|
-
height: "15",
|
|
700
|
-
viewBox: "0 0 15 15",
|
|
701
|
-
overflow: "visible",
|
|
702
|
-
fill: "none",
|
|
703
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
704
|
-
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
705
|
-
d: "M14.82 13.93L11.21 10.32C12.1 9.23 12.64 7.83 12.64 6.31C12.64 2.83 9.81 0 6.32 0C2.83 0 0 2.83 0 6.32C0 9.81 2.83 12.64 6.32 12.64C7.84 12.64 9.23 12.1 10.32 11.21L13.93 14.81C14.17 15.06 14.57 15.06 14.81 14.81C15.06 14.57 15.06 14.18 14.82 13.93ZM6.32 11.38C3.53 11.38 1.25 9.11 1.25 6.32C1.25 3.53 3.52 1.25 6.32 1.25C9.11 1.25 11.39 3.52 11.39 6.32C11.39 9.12 9.11 11.38 6.32 11.38Z",
|
|
706
|
-
fill: "currentColor"
|
|
707
|
-
}));
|
|
708
|
-
});
|
|
709
|
-
|
|
710
|
-
var _templateObject$4, _templateObject2$2;
|
|
711
|
-
var Title = styled__default.h1(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n font-size: ", ";\n font-weight: bold;\n margin-bottom: 0;\n text-transform: uppercase;\n"])), function (props) {
|
|
712
|
-
return props.theme.fontSizes[2];
|
|
713
|
-
});
|
|
714
|
-
var InterestsSubheadingContainer = styled__default.div(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n border-bottom: 1px solid ", ";\n margin-bottom: ", ";\n margin-top: ", ";\n width: 100%;\n align-items: center;\n"])), function (props) {
|
|
715
|
-
return props.theme.marginPaddings[1];
|
|
716
|
-
}, function (props) {
|
|
717
|
-
return props.theme.colors.primary;
|
|
718
|
-
}, function (props) {
|
|
719
|
-
return props.theme.marginPaddings[3];
|
|
720
|
-
}, function (props) {
|
|
721
|
-
return props.theme.marginPaddings[3];
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
725
|
-
var title = _ref.title,
|
|
726
|
-
children = _ref.children,
|
|
727
|
-
className = _ref.className;
|
|
728
|
-
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
729
|
-
className: className
|
|
730
|
-
}, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
731
|
-
};
|
|
732
|
-
|
|
733
|
-
var _templateObject$5;
|
|
734
|
-
|
|
735
|
-
var Title$1 = function Title(_ref) {
|
|
736
|
-
var baseClass = _ref.baseClass,
|
|
737
|
-
className = _ref.className,
|
|
738
|
-
title = _ref.title,
|
|
739
|
-
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
740
|
-
onSearchChanged = _ref.onSearchChanged;
|
|
741
|
-
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
742
|
-
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
743
|
-
title: title
|
|
744
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
745
|
-
className: "title__search"
|
|
746
|
-
}, /*#__PURE__*/React__default.createElement(Search, null), /*#__PURE__*/React__default.createElement("input", {
|
|
747
|
-
placeholder: searchPlaceHolder,
|
|
748
|
-
type: "text",
|
|
749
|
-
name: "search",
|
|
750
|
-
onChange: onSearchChanged
|
|
751
|
-
})));
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
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
|
-
return props.theme.marginPaddings[2];
|
|
756
|
-
}, function (props) {
|
|
757
|
-
return props.theme.fontSizes[2];
|
|
758
|
-
}, function (props) {
|
|
759
|
-
return props.theme.marginPaddings[0];
|
|
760
|
-
}, function (props) {
|
|
761
|
-
return props.theme.marginPaddings[3];
|
|
762
|
-
}, function (props) {
|
|
763
|
-
return props.theme.colors.primary || '';
|
|
764
|
-
}, function (props) {
|
|
765
|
-
return props.theme.colors.primary || '';
|
|
766
|
-
}, function (props) {
|
|
767
|
-
return props.theme.fontSizes[2];
|
|
768
|
-
}, function (props) {
|
|
769
|
-
return props.theme.marginPaddings[0];
|
|
770
|
-
}, function (props) {
|
|
771
|
-
return props.theme.colors.primary;
|
|
772
|
-
});
|
|
773
|
-
var Title$2 = themed(StyledTitle);
|
|
774
|
-
|
|
775
|
-
var debounceBuilder = functions.debounced(200);
|
|
589
|
+
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
590
|
+
_this.setState(function (prevState) {
|
|
591
|
+
// Cannot remove ALL from selection by unselecting it
|
|
592
|
+
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
593
|
+
return {};
|
|
594
|
+
}
|
|
776
595
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
781
|
-
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
596
|
+
var newSelectedList = prevState.selected.filter(function (item) {
|
|
597
|
+
return item.id !== removeSelectedItem.id;
|
|
598
|
+
});
|
|
782
599
|
|
|
783
|
-
|
|
600
|
+
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
601
|
+
return item.id !== ALL_ITEM.id;
|
|
602
|
+
}).sort(function (a, b) {
|
|
603
|
+
return a.id - b.id;
|
|
604
|
+
});
|
|
784
605
|
|
|
785
|
-
|
|
786
|
-
|
|
606
|
+
return {
|
|
607
|
+
list: newList,
|
|
608
|
+
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
609
|
+
};
|
|
610
|
+
}, function () {
|
|
611
|
+
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
612
|
+
return item.id !== ALL_ITEM.id;
|
|
613
|
+
}));
|
|
614
|
+
});
|
|
615
|
+
});
|
|
787
616
|
|
|
788
|
-
|
|
617
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
618
|
+
_this.setState({
|
|
619
|
+
isLoading: flag
|
|
620
|
+
});
|
|
621
|
+
});
|
|
789
622
|
|
|
790
|
-
|
|
623
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
624
|
+
var _this$props = _this.props,
|
|
625
|
+
baseClass = _this$props.baseClass,
|
|
626
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
627
|
+
identifier = _this$props.identifier,
|
|
628
|
+
triggerRequest = _this$props.triggerRequest,
|
|
629
|
+
className = _this$props.className;
|
|
630
|
+
var _this$state = _this.state,
|
|
631
|
+
list = _this$state.list,
|
|
632
|
+
selected = _this$state.selected,
|
|
633
|
+
pagination = _this$state.pagination,
|
|
634
|
+
isLoading = _this$state.isLoading;
|
|
635
|
+
return /*#__PURE__*/React.createElement(StyledMultiselector, null, /*#__PURE__*/React.createElement("div", {
|
|
636
|
+
"data-qe-id": identifier,
|
|
637
|
+
className: "".concat(className, " ").concat(baseClass)
|
|
638
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
639
|
+
className: "".concat(baseClass, "__selected-items")
|
|
640
|
+
}, selected.map(function (item) {
|
|
641
|
+
return /*#__PURE__*/React.createElement(ItemRenderer, {
|
|
642
|
+
key: item.id,
|
|
643
|
+
item: item,
|
|
644
|
+
onSelect: _this.onRemoveItem,
|
|
645
|
+
selected: true
|
|
646
|
+
});
|
|
647
|
+
})), /*#__PURE__*/React.createElement(LuxityPageReady, {
|
|
648
|
+
ref: function ref(inst) {
|
|
649
|
+
_this.pageReady = inst;
|
|
650
|
+
},
|
|
651
|
+
onData: _this.setNewResults,
|
|
652
|
+
onIsLoading: _this.onIsLoading,
|
|
653
|
+
getRequestPromise: function getRequestPromise() {
|
|
654
|
+
return triggerRequest();
|
|
655
|
+
}
|
|
656
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
657
|
+
className: "".concat(baseClass, "__selectable-items")
|
|
658
|
+
}, list.map(function (item) {
|
|
659
|
+
return /*#__PURE__*/React.createElement(ItemRenderer, {
|
|
660
|
+
key: item.id,
|
|
661
|
+
item: item,
|
|
662
|
+
onSelect: _this.onAddItem,
|
|
663
|
+
selected: false
|
|
664
|
+
});
|
|
665
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
666
|
+
className: "".concat(baseClass, "__footer")
|
|
667
|
+
}, /*#__PURE__*/React.createElement(InvertedTextButton$1, {
|
|
668
|
+
disabled: isLoading || !pagination.has_more_pages,
|
|
669
|
+
onClick: _this.props.increaseLimit,
|
|
670
|
+
type: "button"
|
|
671
|
+
}, "SHOW MORE"))));
|
|
672
|
+
});
|
|
791
673
|
|
|
792
|
-
|
|
674
|
+
_this.state = {
|
|
675
|
+
selected: [ALL_ITEM],
|
|
676
|
+
list: [],
|
|
677
|
+
pagination: {},
|
|
678
|
+
isLoading: false
|
|
679
|
+
};
|
|
680
|
+
return _this;
|
|
681
|
+
}
|
|
793
682
|
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
683
|
+
return _createClass(GraphQLMultiSelector);
|
|
684
|
+
}(React.Component);
|
|
685
|
+
|
|
686
|
+
GraphQLMultiSelector.defaultProps = {
|
|
687
|
+
baseClass: 'multiselector'
|
|
688
|
+
};
|
|
689
|
+
var GraphQLMultiSelector$1 = themed(GraphQLMultiSelector);
|
|
690
|
+
|
|
691
|
+
var Search = (function (props) {
|
|
692
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
693
|
+
width: "15",
|
|
694
|
+
height: "15",
|
|
695
|
+
viewBox: "0 0 15 15",
|
|
696
|
+
overflow: "visible",
|
|
697
|
+
fill: "none",
|
|
698
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
699
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
700
|
+
d: "M14.82 13.93L11.21 10.32C12.1 9.23 12.64 7.83 12.64 6.31C12.64 2.83 9.81 0 6.32 0C2.83 0 0 2.83 0 6.32C0 9.81 2.83 12.64 6.32 12.64C7.84 12.64 9.23 12.1 10.32 11.21L13.93 14.81C14.17 15.06 14.57 15.06 14.81 14.81C15.06 14.57 15.06 14.18 14.82 13.93ZM6.32 11.38C3.53 11.38 1.25 9.11 1.25 6.32C1.25 3.53 3.52 1.25 6.32 1.25C9.11 1.25 11.39 3.52 11.39 6.32C11.39 9.12 9.11 11.38 6.32 11.38Z",
|
|
701
|
+
fill: "currentColor"
|
|
702
|
+
}));
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
var _templateObject$4, _templateObject2$2;
|
|
706
|
+
var Title = styled.h1(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n font-size: ", ";\n font-weight: bold;\n margin-bottom: 0;\n text-transform: uppercase;\n"])), function (props) {
|
|
707
|
+
return props.theme.fontSizes[2];
|
|
708
|
+
});
|
|
709
|
+
var InterestsSubheadingContainer = styled.div(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n border-bottom: 1px solid ", ";\n margin-bottom: ", ";\n margin-top: ", ";\n width: 100%;\n align-items: center;\n"])), function (props) {
|
|
710
|
+
return props.theme.marginPaddings[1];
|
|
711
|
+
}, function (props) {
|
|
712
|
+
return props.theme.colors.primary;
|
|
713
|
+
}, function (props) {
|
|
714
|
+
return props.theme.marginPaddings[3];
|
|
715
|
+
}, function (props) {
|
|
716
|
+
return props.theme.marginPaddings[3];
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
720
|
+
var title = _ref.title,
|
|
721
|
+
children = _ref.children,
|
|
722
|
+
className = _ref.className;
|
|
723
|
+
return /*#__PURE__*/React.createElement(InterestsSubheadingContainer, {
|
|
724
|
+
className: className
|
|
725
|
+
}, /*#__PURE__*/React.createElement(Title, null, title), /*#__PURE__*/React.createElement("div", null, children));
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
var _templateObject$5;
|
|
729
|
+
|
|
730
|
+
var Title$1 = function Title(_ref) {
|
|
731
|
+
var baseClass = _ref.baseClass,
|
|
732
|
+
className = _ref.className,
|
|
733
|
+
title = _ref.title,
|
|
734
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
735
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
736
|
+
return /*#__PURE__*/React.createElement(InterestsSubheading, {
|
|
737
|
+
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
738
|
+
title: title
|
|
739
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
740
|
+
className: "title__search"
|
|
741
|
+
}, /*#__PURE__*/React.createElement(Search, null), /*#__PURE__*/React.createElement("input", {
|
|
742
|
+
placeholder: searchPlaceHolder,
|
|
743
|
+
type: "text",
|
|
744
|
+
name: "search",
|
|
745
|
+
onChange: onSearchChanged
|
|
746
|
+
})));
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
var StyledTitle = styled(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) {
|
|
750
|
+
return props.theme.marginPaddings[2];
|
|
751
|
+
}, function (props) {
|
|
752
|
+
return props.theme.fontSizes[2];
|
|
753
|
+
}, function (props) {
|
|
754
|
+
return props.theme.marginPaddings[0];
|
|
755
|
+
}, function (props) {
|
|
756
|
+
return props.theme.marginPaddings[3];
|
|
757
|
+
}, function (props) {
|
|
758
|
+
return props.theme.colors.primary || '';
|
|
759
|
+
}, function (props) {
|
|
760
|
+
return props.theme.colors.primary || '';
|
|
761
|
+
}, function (props) {
|
|
762
|
+
return props.theme.fontSizes[2];
|
|
763
|
+
}, function (props) {
|
|
764
|
+
return props.theme.marginPaddings[0];
|
|
765
|
+
}, function (props) {
|
|
766
|
+
return props.theme.colors.primary;
|
|
767
|
+
});
|
|
768
|
+
var Title$2 = themed(StyledTitle);
|
|
769
|
+
|
|
770
|
+
var debounceBuilder = debounced(200);
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
774
|
+
*/
|
|
775
|
+
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
776
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
777
|
+
|
|
778
|
+
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
779
|
+
|
|
780
|
+
function LuxityGraphQLMultiselector(props) {
|
|
781
|
+
var _this;
|
|
782
|
+
|
|
783
|
+
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
784
|
+
|
|
785
|
+
_this = _super.call(this, props);
|
|
786
|
+
|
|
787
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React.createRef());
|
|
788
|
+
|
|
789
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
790
|
+
_this.setState(function (prevState) {
|
|
791
|
+
return {
|
|
792
|
+
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
793
|
+
};
|
|
800
794
|
});
|
|
795
|
+
});
|
|
801
796
|
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
797
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
798
|
+
_this.props.onChange(selection);
|
|
799
|
+
});
|
|
805
800
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
});
|
|
801
|
+
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
802
|
+
event.preventDefault();
|
|
803
|
+
var searchText = event.target.value;
|
|
804
|
+
debounceBuilder(function () {
|
|
805
|
+
_this.setState({
|
|
806
|
+
nameFilter: searchText
|
|
813
807
|
});
|
|
814
808
|
});
|
|
809
|
+
});
|
|
815
810
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
811
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
812
|
+
var _this$state = _this.state,
|
|
813
|
+
limit = _this$state.limit,
|
|
814
|
+
category = _this$state.category,
|
|
815
|
+
nameFilter = _this$state.nameFilter;
|
|
816
|
+
var _this$props = _this.props,
|
|
817
|
+
title = _this$props.title,
|
|
818
|
+
baseClass = _this$props.baseClass,
|
|
819
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
820
|
+
resultProcessor = _this$props.resultProcessor,
|
|
821
|
+
itemRenderer = _this$props.itemRenderer,
|
|
822
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
823
|
+
graphApi = _this$props.graphApi,
|
|
824
|
+
identifier = _this$props.identifier,
|
|
825
|
+
requestInstance = _this$props.requestInstance;
|
|
826
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
827
|
+
className: baseClass
|
|
828
|
+
}, /*#__PURE__*/React.createElement(Title$2, {
|
|
829
|
+
title: title,
|
|
830
|
+
baseClass: baseClass,
|
|
831
|
+
searchPlaceHolder: searchPlaceHolder,
|
|
832
|
+
onSearchChanged: _this.onSearchChanged
|
|
833
|
+
}), /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(GraphQLMultiSelector$1, {
|
|
834
|
+
triggerRequest: function triggerRequest() {
|
|
835
|
+
return requestInstance.post(graphApi, {
|
|
836
|
+
query: getGraphQuery(limit, 1, 'id|desc', category, nameFilter)
|
|
837
|
+
});
|
|
838
|
+
},
|
|
839
|
+
graphQuery: getGraphQuery(limit, 1, 'id|desc', category, nameFilter),
|
|
840
|
+
identifier: identifier,
|
|
841
|
+
ref: _this.multiSelectorRef,
|
|
842
|
+
onChange: _this.onChange,
|
|
843
|
+
resultProcessor: resultProcessor,
|
|
844
|
+
increaseLimit: _this.increaseLimit,
|
|
845
|
+
itemRenderer: itemRenderer
|
|
846
|
+
})));
|
|
847
|
+
});
|
|
853
848
|
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
849
|
+
_this.state = {
|
|
850
|
+
limit: props.baseQueryLimit,
|
|
851
|
+
category: props.category,
|
|
852
|
+
nameFilter: ''
|
|
853
|
+
};
|
|
854
|
+
return _this;
|
|
855
|
+
}
|
|
861
856
|
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
857
|
+
_createClass(LuxityGraphQLMultiselector, [{
|
|
858
|
+
key: "componentDidUpdate",
|
|
859
|
+
value: function componentDidUpdate(prevProps) {
|
|
860
|
+
var _this$multiSelectorRe;
|
|
866
861
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
862
|
+
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
863
|
+
this.multiSelectorRef.current.emptySelected();
|
|
870
864
|
}
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
return null;
|
|
865
|
+
}
|
|
866
|
+
}], [{
|
|
867
|
+
key: "getDerivedStateFromProps",
|
|
868
|
+
value: function getDerivedStateFromProps(props, prevState) {
|
|
869
|
+
if (prevState.category !== props.category) {
|
|
870
|
+
return {
|
|
871
|
+
category: props.category
|
|
872
|
+
};
|
|
881
873
|
}
|
|
882
|
-
}]);
|
|
883
874
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
LuxityGraphQLMultiselector.defaultProps = {
|
|
888
|
-
baseClass: '',
|
|
889
|
-
searchPlaceHolder: '',
|
|
890
|
-
queryLimitIncrement: 12,
|
|
891
|
-
baseQueryLimit: 12
|
|
892
|
-
};
|
|
875
|
+
return null;
|
|
876
|
+
}
|
|
877
|
+
}]);
|
|
893
878
|
|
|
894
879
|
return LuxityGraphQLMultiselector;
|
|
880
|
+
}(React.Component);
|
|
881
|
+
|
|
882
|
+
LuxityGraphQLMultiselector.defaultProps = {
|
|
883
|
+
baseClass: '',
|
|
884
|
+
searchPlaceHolder: '',
|
|
885
|
+
queryLimitIncrement: 12,
|
|
886
|
+
baseQueryLimit: 12
|
|
887
|
+
};
|
|
895
888
|
|
|
896
|
-
|
|
889
|
+
export default LuxityGraphQLMultiselector;
|