@bonlineza/luxity-lib 2.39.6 → 2.39.8
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 +352 -342
- package/AddInterest.js +3179 -3136
- package/AddProductInterest.js +7584 -1011
- package/BrandSelector.js +861 -854
- package/Checkbox.js +250 -240
- package/CheckboxButton.js +236 -229
- package/CommunicationPreferenceOptionsRenderer.js +568 -560
- package/CommunicationPreferenceSection.js +659 -651
- package/CommunicationPreferences.js +2402 -2394
- package/ConditionSelector.js +859 -852
- package/CountryCodeSelect.js +6650 -79
- package/CurrencyInputFormatter.js +96 -86
- package/CurrencySelect.js +227 -219
- package/DropdownSelector.js +6820 -211
- package/GALink.js +51 -43
- package/GenderSelector.js +362 -355
- package/GraphQLDropdownSelector.js +11914 -5307
- package/GraphQLMultiSelector.js +601 -593
- package/IconHeader.js +126 -118
- package/IconWrapper.js +25 -17
- package/InterestCatSelector.js +432 -424
- package/InterestItem.js +470 -462
- package/Interests.js +11324 -4717
- package/InterestsSubheading.js +41 -33
- package/InvertedTextButton.js +175 -167
- package/LuxityAppSideNav.js +189 -181
- package/LuxityDesktopHeader.js +1363 -1355
- package/LuxityFooter.js +2236 -2228
- package/LuxityGraphQLDropdownSelector.js +11999 -5392
- package/LuxityGraphQLMultiselector.js +785 -778
- package/LuxityMobileHeader.js +1794 -1786
- package/LuxityPageReady.js +209 -199
- package/LuxityProductInterestItem.js +367 -359
- package/LuxitySideNav.js +673 -665
- package/MaterialSelector.js +12029 -5422
- package/ModelSelector.js +12029 -5422
- package/NotificationDropDown.js +7029 -459
- package/Notify.js +32 -20
- package/OutlinePrimaryButton.js +142 -134
- package/PriceRangeSelector.js +1277 -1264
- package/PrimaryButton.js +137 -129
- package/RadioButtons.js +318 -308
- package/RangeSlider.js +1039 -1033
- package/RareStepFooter.js +264 -257
- package/RareStepHeader.js +808 -801
- package/ReactSelectWrapper.js +6604 -33
- package/SecondaryButton.js +152 -144
- package/ShoeSizeRangeSelector.js +1153 -1147
- package/ShoeSizeSelector.js +1198 -1146
- package/SimpleErrorBoundary.js +138 -130
- package/StyleSelector.js +861 -854
- package/TextButton.js +143 -135
- package/Tooltip.js +184 -176
- package/Tracking.js +25 -15
- package/WrapperButton.js +58 -50
- package/build/bundle.css +1 -1
- package/build/bundle.js +17272 -10631
- package/build/constants.js +45 -32
- package/package.json +3 -2
- package/svg/Accessories.js +42 -34
- package/svg/Account.js +38 -30
- package/svg/Add.js +39 -31
- package/svg/ArrowRight.js +36 -28
- package/svg/Bags.js +48 -40
- package/svg/BurgerMenu.js +32 -24
- package/svg/Calendar.js +106 -98
- package/svg/CalendarCircled.js +108 -100
- package/svg/CheckCircled.js +40 -32
- package/svg/Close.js +37 -29
- package/svg/Clothing.js +44 -36
- package/svg/Dot.js +40 -32
- package/svg/Edit.js +35 -27
- package/svg/Eye.js +36 -28
- package/svg/FileAttach.js +36 -28
- package/svg/FileAttachCircled.js +38 -30
- package/svg/Jewellery.js +57 -49
- package/svg/LightBulb.js +66 -58
- package/svg/Logo.js +140 -132
- package/svg/LuxityMenu.js +36 -28
- package/svg/Minus.js +37 -29
- package/svg/MobileAvatar.js +36 -28
- package/svg/MyOrder.js +44 -36
- package/svg/MyPayment.js +44 -36
- package/svg/MyProfile.js +52 -44
- package/svg/MySale.js +39 -31
- package/svg/Notification.js +38 -30
- package/svg/PointerDown.js +36 -28
- package/svg/Search.js +35 -27
- package/svg/Shoes.js +45 -37
- package/svg/SvgWrapper.js +21 -13
- package/svg/Trash.js +40 -32
- package/svg/Watches.js +55 -47
|
@@ -1,889 +1,896 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('@bonlineza/b-lib/functions'), require('styled-components'), require('@bonlineza/b-lib/EllipsisLoader'), require('@bonlineza/b-lib/PageReady')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['react', '@bonlineza/b-lib/functions', 'styled-components', '@bonlineza/b-lib/EllipsisLoader', '@bonlineza/b-lib/PageReady'], factory) :
|
|
4
|
+
(global = global || self, global.LuxityGraphQLMultiselector = factory(global.React, global.function, global.styled, global.EllipsisLoader, global.PageReady));
|
|
5
|
+
}(this, (function (React, functions, styled, EllipsisLoader, PageReady) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var React__default = 'default' in React ? React['default'] : React;
|
|
8
|
+
var styled__default = 'default' in styled ? styled['default'] : styled;
|
|
9
|
+
EllipsisLoader = EllipsisLoader && Object.prototype.hasOwnProperty.call(EllipsisLoader, 'default') ? EllipsisLoader['default'] : EllipsisLoader;
|
|
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
|
+
}
|
|
10
16
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
|
|
18
|
+
function _defineProperties(target, props) {
|
|
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
|
+
}
|
|
20
26
|
}
|
|
21
|
-
}
|
|
22
27
|
|
|
23
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
29
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
30
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
31
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
32
|
+
writable: false
|
|
39
33
|
});
|
|
40
|
-
|
|
41
|
-
obj[key] = value;
|
|
34
|
+
return Constructor;
|
|
42
35
|
}
|
|
43
36
|
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
function _defineProperty(obj, key, value) {
|
|
38
|
+
if (key in obj) {
|
|
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
|
+
}
|
|
46
51
|
|
|
47
|
-
function _extends() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
function _extends() {
|
|
53
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
54
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
55
|
+
var source = arguments[i];
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
for (var key in source) {
|
|
58
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
59
|
+
target[key] = source[key];
|
|
60
|
+
}
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return target;
|
|
60
|
-
};
|
|
61
|
-
return _extends.apply(this, arguments);
|
|
62
|
-
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
return target;
|
|
65
|
+
};
|
|
66
|
+
return _extends.apply(this, arguments);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
writable: true,
|
|
73
|
-
configurable: true
|
|
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");
|
|
74
72
|
}
|
|
75
|
-
});
|
|
76
|
-
Object.defineProperty(subClass, "prototype", {
|
|
77
|
-
writable: false
|
|
78
|
-
});
|
|
79
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
80
|
-
}
|
|
81
|
-
|
|
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
|
-
}
|
|
88
73
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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];
|
|
74
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
75
|
+
constructor: {
|
|
76
|
+
value: subClass,
|
|
77
|
+
writable: true,
|
|
78
|
+
configurable: true
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(subClass, "prototype", {
|
|
82
|
+
writable: false
|
|
83
|
+
});
|
|
84
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
120
85
|
}
|
|
121
86
|
|
|
122
|
-
|
|
123
|
-
|
|
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
|
+
}
|
|
124
93
|
|
|
125
|
-
function
|
|
126
|
-
|
|
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);
|
|
100
|
+
}
|
|
127
101
|
|
|
128
|
-
|
|
102
|
+
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;
|
|
129
106
|
|
|
130
|
-
|
|
107
|
+
try {
|
|
108
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
109
|
+
return true;
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
131
114
|
|
|
132
|
-
|
|
133
|
-
|
|
115
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
116
|
+
if (source == null) return {};
|
|
117
|
+
var target = {};
|
|
118
|
+
var sourceKeys = Object.keys(source);
|
|
119
|
+
var key, i;
|
|
134
120
|
|
|
135
|
-
for (i = 0; i <
|
|
136
|
-
key =
|
|
121
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
122
|
+
key = sourceKeys[i];
|
|
137
123
|
if (excluded.indexOf(key) >= 0) continue;
|
|
138
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
139
124
|
target[key] = source[key];
|
|
140
125
|
}
|
|
126
|
+
|
|
127
|
+
return target;
|
|
141
128
|
}
|
|
142
129
|
|
|
143
|
-
|
|
144
|
-
}
|
|
130
|
+
function _objectWithoutProperties(source, excluded) {
|
|
131
|
+
if (source == null) return {};
|
|
132
|
+
|
|
133
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
134
|
+
|
|
135
|
+
var key, i;
|
|
145
136
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
137
|
+
if (Object.getOwnPropertySymbols) {
|
|
138
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
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
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return target;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
function _assertThisInitialized(self) {
|
|
152
|
+
if (self === void 0) {
|
|
153
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
154
|
+
}
|
|
153
155
|
|
|
154
|
-
|
|
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");
|
|
156
|
+
return self;
|
|
159
157
|
}
|
|
160
158
|
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
function _possibleConstructorReturn(self, call) {
|
|
160
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
161
|
+
return call;
|
|
162
|
+
} else if (call !== void 0) {
|
|
163
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
164
|
+
}
|
|
163
165
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
return _assertThisInitialized(self);
|
|
167
|
+
}
|
|
166
168
|
|
|
167
|
-
|
|
168
|
-
var
|
|
169
|
-
result;
|
|
169
|
+
function _createSuper(Derived) {
|
|
170
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
var
|
|
172
|
+
return function _createSuperInternal() {
|
|
173
|
+
var Super = _getPrototypeOf(Derived),
|
|
174
|
+
result;
|
|
173
175
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
result = Super.apply(this, arguments);
|
|
177
|
-
}
|
|
176
|
+
if (hasNativeReflectConstruct) {
|
|
177
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
180
|
+
} else {
|
|
181
|
+
result = Super.apply(this, arguments);
|
|
182
|
+
}
|
|
182
183
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
raw = strings.slice(0);
|
|
184
|
+
return _possibleConstructorReturn(this, result);
|
|
185
|
+
};
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
raw
|
|
190
|
-
|
|
188
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
189
|
+
if (!raw) {
|
|
190
|
+
raw = strings.slice(0);
|
|
191
191
|
}
|
|
192
|
-
}));
|
|
193
|
-
}
|
|
194
192
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
194
|
+
raw: {
|
|
195
|
+
value: Object.freeze(raw)
|
|
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
|
+
}
|
|
207
|
+
|
|
208
|
+
function _iterableToArray(iter) {
|
|
209
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
213
|
+
if (!o) return;
|
|
214
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
215
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
216
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
217
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
218
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
219
|
+
}
|
|
198
220
|
|
|
199
|
-
function
|
|
200
|
-
|
|
201
|
-
}
|
|
221
|
+
function _arrayLikeToArray(arr, len) {
|
|
222
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
202
223
|
|
|
203
|
-
|
|
204
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
205
|
-
}
|
|
224
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
206
225
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
214
|
-
}
|
|
226
|
+
return arr2;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function _nonIterableSpread() {
|
|
230
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
231
|
+
}
|
|
215
232
|
|
|
216
|
-
function
|
|
217
|
-
|
|
233
|
+
var interpretErrorMessage = function interpretErrorMessage(error) {
|
|
234
|
+
var customMessage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Failed: :error_code';
|
|
235
|
+
var message = customMessage || 'Network Error';
|
|
236
|
+
return message.replace(':error_code', error.status || 'Network Down');
|
|
237
|
+
};
|
|
218
238
|
|
|
219
|
-
|
|
239
|
+
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
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
|
+
*/
|
|
220
247
|
|
|
221
|
-
|
|
222
|
-
|
|
248
|
+
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
249
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
223
250
|
|
|
224
|
-
|
|
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
|
-
}
|
|
251
|
+
var _super = _createSuper(LuxityPageReady);
|
|
227
252
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var message = customMessage || 'Network Error';
|
|
231
|
-
return message.replace(':error_code', error.status || 'Network Down');
|
|
232
|
-
};
|
|
253
|
+
function LuxityPageReady() {
|
|
254
|
+
var _this;
|
|
233
255
|
|
|
234
|
-
|
|
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
|
-
*/
|
|
256
|
+
_classCallCheck(this, LuxityPageReady);
|
|
242
257
|
|
|
243
|
-
var
|
|
244
|
-
|
|
258
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
259
|
+
args[_key] = arguments[_key];
|
|
260
|
+
}
|
|
245
261
|
|
|
246
|
-
|
|
262
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
247
263
|
|
|
248
|
-
|
|
249
|
-
|
|
264
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
265
|
+
data: null
|
|
266
|
+
});
|
|
250
267
|
|
|
251
|
-
|
|
268
|
+
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
269
|
+
return _this.pageReadyInstance.initRequest();
|
|
270
|
+
});
|
|
252
271
|
|
|
253
|
-
|
|
254
|
-
args[_key] = arguments[_key];
|
|
272
|
+
return _this;
|
|
255
273
|
}
|
|
256
274
|
|
|
257
|
-
|
|
275
|
+
_createClass(LuxityPageReady, [{
|
|
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
|
+
}]);
|
|
258
324
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
});
|
|
325
|
+
return LuxityPageReady;
|
|
326
|
+
}(React__default.Component);
|
|
262
327
|
|
|
263
|
-
|
|
264
|
-
|
|
328
|
+
LuxityPageReady.defaultProps = {
|
|
329
|
+
onIsLoading: function onIsLoading() {
|
|
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
|
+
})));
|
|
265
406
|
});
|
|
407
|
+
});
|
|
266
408
|
|
|
267
|
-
|
|
268
|
-
}
|
|
409
|
+
var _excluded = ["children"];
|
|
269
410
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
-
});
|
|
411
|
+
var _templateObject$1;
|
|
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
|
+
});
|
|
290
419
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
_this2.props.onIsLoading(true);
|
|
420
|
+
var TextButton = function TextButton(_ref) {
|
|
421
|
+
var children = _ref.children,
|
|
422
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
295
423
|
|
|
296
|
-
|
|
297
|
-
|
|
424
|
+
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
425
|
+
};
|
|
298
426
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
427
|
+
TextButton.defaultProps = {
|
|
428
|
+
type: 'button'
|
|
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
|
+
});
|
|
302
448
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
return
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
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
|
-
})));
|
|
449
|
+
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
450
|
+
var children = _ref.children,
|
|
451
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
452
|
+
|
|
453
|
+
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
457
|
+
|
|
458
|
+
var media = {
|
|
459
|
+
xs: '576px',
|
|
460
|
+
sm: '768px',
|
|
461
|
+
md: '992px',
|
|
462
|
+
lg: '1200px'
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
var _templateObject$3, _templateObject2$1;
|
|
466
|
+
var ALL_ITEM = {
|
|
467
|
+
id: 'ALL',
|
|
468
|
+
name: 'ALL'
|
|
469
|
+
};
|
|
470
|
+
var multiSelectorItemMaxHeight = '3rem';
|
|
471
|
+
var multiSelectorItemAnimationDuration = '300ms';
|
|
472
|
+
var multiselectorItemFadeIn = styled.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);
|
|
473
|
+
var StyledMultiselector = styled__default.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) {
|
|
474
|
+
return props.theme.marginPaddings[2];
|
|
475
|
+
}, function (props) {
|
|
476
|
+
return props.theme.colors.ntrlMin;
|
|
477
|
+
}, function (props) {
|
|
478
|
+
return props.theme.colors.primary;
|
|
479
|
+
}, function (props) {
|
|
480
|
+
return props.theme.colors.primary;
|
|
481
|
+
}, function (props) {
|
|
482
|
+
return props.theme.colors.ntrlMin;
|
|
483
|
+
}, function (props) {
|
|
484
|
+
return props.theme.colors.primary;
|
|
485
|
+
}, function (props) {
|
|
486
|
+
return props.theme.marginPaddings[0];
|
|
487
|
+
}, multiSelectorItemAnimationDuration, multiselectorItemFadeIn, function (props) {
|
|
488
|
+
return props.theme.marginPaddings[2];
|
|
489
|
+
}, function (props) {
|
|
490
|
+
return props.theme.marginPaddings[2];
|
|
491
|
+
}, function (props) {
|
|
492
|
+
return props.theme.marginPaddings[2];
|
|
493
|
+
}, media.sm, function (props) {
|
|
494
|
+
return props.theme.marginPaddings[2];
|
|
495
|
+
}, function (props) {
|
|
496
|
+
return props.theme.colors.primary;
|
|
497
|
+
}, function (props) {
|
|
498
|
+
return props.theme.colors.ntrlMin;
|
|
499
|
+
}, function (props) {
|
|
500
|
+
return props.theme.colors.primary;
|
|
501
|
+
}, function (props) {
|
|
502
|
+
return props.theme.colors.ntrlMin;
|
|
401
503
|
});
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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
|
-
});
|
|
504
|
+
/**
|
|
505
|
+
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
506
|
+
*/
|
|
520
507
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
});
|
|
508
|
+
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
509
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
524
510
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
511
|
+
var _super = _createSuper(GraphQLMultiSelector);
|
|
512
|
+
|
|
513
|
+
function GraphQLMultiSelector(props) {
|
|
514
|
+
var _this;
|
|
515
|
+
|
|
516
|
+
_classCallCheck(this, GraphQLMultiSelector);
|
|
530
517
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
518
|
+
_this = _super.call(this, props);
|
|
519
|
+
|
|
520
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
521
|
+
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
522
|
+
_this.makeRequest();
|
|
523
|
+
}
|
|
534
524
|
});
|
|
535
525
|
|
|
536
|
-
|
|
526
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
527
|
+
_this.pageReady.refreshPage();
|
|
528
|
+
});
|
|
537
529
|
|
|
538
|
-
|
|
539
|
-
return
|
|
530
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
531
|
+
return _this.setState({
|
|
532
|
+
selected: [ALL_ITEM]
|
|
533
|
+
});
|
|
540
534
|
});
|
|
541
535
|
|
|
542
|
-
|
|
543
|
-
|
|
536
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
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));
|
|
551
|
+
|
|
552
|
+
_this.setState({
|
|
553
|
+
list: newList,
|
|
554
|
+
pagination: pagination
|
|
555
|
+
});
|
|
544
556
|
});
|
|
545
|
-
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
546
557
|
|
|
547
|
-
_this
|
|
548
|
-
|
|
549
|
-
|
|
558
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
559
|
+
_this.setState(function (prevState) {
|
|
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
|
+
});
|
|
550
592
|
});
|
|
551
|
-
});
|
|
552
593
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
594
|
+
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
595
|
+
_this.setState(function (prevState) {
|
|
596
|
+
// Cannot remove ALL from selection by unselecting it
|
|
597
|
+
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
598
|
+
return {};
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
var newSelectedList = prevState.selected.filter(function (item) {
|
|
602
|
+
return item.id !== removeSelectedItem.id;
|
|
603
|
+
});
|
|
557
604
|
|
|
558
|
-
|
|
559
|
-
// Clear Selected List
|
|
560
|
-
// and move previous Selected items to list
|
|
561
|
-
newSelectedList = [ALL_ITEM];
|
|
562
|
-
newList = prevState.list.filter(function (item) {
|
|
605
|
+
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
563
606
|
return item.id !== ALL_ITEM.id;
|
|
564
|
-
}).
|
|
607
|
+
}).sort(function (a, b) {
|
|
565
608
|
return a.id - b.id;
|
|
566
609
|
});
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
610
|
+
|
|
611
|
+
return {
|
|
612
|
+
list: newList,
|
|
613
|
+
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
614
|
+
};
|
|
615
|
+
}, function () {
|
|
616
|
+
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
572
617
|
return item.id !== ALL_ITEM.id;
|
|
573
|
-
})
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
}
|
|
618
|
+
}));
|
|
619
|
+
});
|
|
620
|
+
});
|
|
577
621
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
};
|
|
582
|
-
}, function () {
|
|
583
|
-
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
584
|
-
return item.id !== ALL_ITEM.id;
|
|
585
|
-
}));
|
|
622
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
623
|
+
_this.setState({
|
|
624
|
+
isLoading: flag
|
|
625
|
+
});
|
|
586
626
|
});
|
|
587
|
-
});
|
|
588
627
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
628
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
629
|
+
var _this$props = _this.props,
|
|
630
|
+
baseClass = _this$props.baseClass,
|
|
631
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
632
|
+
identifier = _this$props.identifier,
|
|
633
|
+
triggerRequest = _this$props.triggerRequest,
|
|
634
|
+
className = _this$props.className;
|
|
635
|
+
var _this$state = _this.state,
|
|
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"))));
|
|
677
|
+
});
|
|
595
678
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
679
|
+
_this.state = {
|
|
680
|
+
selected: [ALL_ITEM],
|
|
681
|
+
list: [],
|
|
682
|
+
pagination: {},
|
|
683
|
+
isLoading: false
|
|
684
|
+
};
|
|
685
|
+
return _this;
|
|
686
|
+
}
|
|
599
687
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}).sort(function (a, b) {
|
|
603
|
-
return a.id - b.id;
|
|
604
|
-
});
|
|
688
|
+
return _createClass(GraphQLMultiSelector);
|
|
689
|
+
}(React__default.Component);
|
|
605
690
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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
|
+
});
|
|
616
709
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
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
|
+
});
|
|
622
723
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
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
|
-
});
|
|
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
|
+
};
|
|
673
732
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
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
|
+
};
|
|
682
753
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
}, props)
|
|
700
|
-
|
|
701
|
-
|
|
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
|
-
};
|
|
794
|
-
});
|
|
795
|
-
});
|
|
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);
|
|
796
774
|
|
|
797
|
-
|
|
798
|
-
_this.props.onChange(selection);
|
|
799
|
-
});
|
|
775
|
+
var debounceBuilder = functions.debounced(200);
|
|
800
776
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
777
|
+
/**
|
|
778
|
+
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
779
|
+
*/
|
|
780
|
+
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
781
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
782
|
+
|
|
783
|
+
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
784
|
+
|
|
785
|
+
function LuxityGraphQLMultiselector(props) {
|
|
786
|
+
var _this;
|
|
787
|
+
|
|
788
|
+
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
789
|
+
|
|
790
|
+
_this = _super.call(this, props);
|
|
791
|
+
|
|
792
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
793
|
+
|
|
794
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
795
|
+
_this.setState(function (prevState) {
|
|
796
|
+
return {
|
|
797
|
+
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
798
|
+
};
|
|
807
799
|
});
|
|
808
800
|
});
|
|
809
|
-
});
|
|
810
801
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
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)
|
|
802
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
803
|
+
_this.props.onChange(selection);
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
807
|
+
event.preventDefault();
|
|
808
|
+
var searchText = event.target.value;
|
|
809
|
+
debounceBuilder(function () {
|
|
810
|
+
_this.setState({
|
|
811
|
+
nameFilter: searchText
|
|
837
812
|
});
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
identifier: identifier,
|
|
841
|
-
ref: _this.multiSelectorRef,
|
|
842
|
-
onChange: _this.onChange,
|
|
843
|
-
resultProcessor: resultProcessor,
|
|
844
|
-
increaseLimit: _this.increaseLimit,
|
|
845
|
-
itemRenderer: itemRenderer
|
|
846
|
-
})));
|
|
847
|
-
});
|
|
813
|
+
});
|
|
814
|
+
});
|
|
848
815
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
816
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
817
|
+
var _this$state = _this.state,
|
|
818
|
+
limit = _this$state.limit,
|
|
819
|
+
category = _this$state.category,
|
|
820
|
+
nameFilter = _this$state.nameFilter;
|
|
821
|
+
var _this$props = _this.props,
|
|
822
|
+
title = _this$props.title,
|
|
823
|
+
baseClass = _this$props.baseClass,
|
|
824
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
825
|
+
resultProcessor = _this$props.resultProcessor,
|
|
826
|
+
itemRenderer = _this$props.itemRenderer,
|
|
827
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
828
|
+
graphApi = _this$props.graphApi,
|
|
829
|
+
identifier = _this$props.identifier,
|
|
830
|
+
requestInstance = _this$props.requestInstance;
|
|
831
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
832
|
+
className: baseClass
|
|
833
|
+
}, /*#__PURE__*/React__default.createElement(Title$2, {
|
|
834
|
+
title: title,
|
|
835
|
+
baseClass: baseClass,
|
|
836
|
+
searchPlaceHolder: searchPlaceHolder,
|
|
837
|
+
onSearchChanged: _this.onSearchChanged
|
|
838
|
+
}), /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(GraphQLMultiSelector$1, {
|
|
839
|
+
triggerRequest: function triggerRequest() {
|
|
840
|
+
return requestInstance.post(graphApi, {
|
|
841
|
+
query: getGraphQuery(limit, 1, 'id|desc', category, nameFilter)
|
|
842
|
+
});
|
|
843
|
+
},
|
|
844
|
+
graphQuery: getGraphQuery(limit, 1, 'id|desc', category, nameFilter),
|
|
845
|
+
identifier: identifier,
|
|
846
|
+
ref: _this.multiSelectorRef,
|
|
847
|
+
onChange: _this.onChange,
|
|
848
|
+
resultProcessor: resultProcessor,
|
|
849
|
+
increaseLimit: _this.increaseLimit,
|
|
850
|
+
itemRenderer: itemRenderer
|
|
851
|
+
})));
|
|
852
|
+
});
|
|
856
853
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
854
|
+
_this.state = {
|
|
855
|
+
limit: props.baseQueryLimit,
|
|
856
|
+
category: props.category,
|
|
857
|
+
nameFilter: ''
|
|
858
|
+
};
|
|
859
|
+
return _this;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
_createClass(LuxityGraphQLMultiselector, [{
|
|
863
|
+
key: "componentDidUpdate",
|
|
864
|
+
value: function componentDidUpdate(prevProps) {
|
|
865
|
+
var _this$multiSelectorRe;
|
|
861
866
|
|
|
862
|
-
|
|
863
|
-
|
|
867
|
+
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
868
|
+
this.multiSelectorRef.current.emptySelected();
|
|
869
|
+
}
|
|
864
870
|
}
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}
|
|
871
|
+
}], [{
|
|
872
|
+
key: "getDerivedStateFromProps",
|
|
873
|
+
value: function getDerivedStateFromProps(props, prevState) {
|
|
874
|
+
if (prevState.category !== props.category) {
|
|
875
|
+
return {
|
|
876
|
+
category: props.category
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
return null;
|
|
873
881
|
}
|
|
882
|
+
}]);
|
|
874
883
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}]);
|
|
884
|
+
return LuxityGraphQLMultiselector;
|
|
885
|
+
}(React__default.Component);
|
|
878
886
|
|
|
879
|
-
|
|
880
|
-
|
|
887
|
+
LuxityGraphQLMultiselector.defaultProps = {
|
|
888
|
+
baseClass: '',
|
|
889
|
+
searchPlaceHolder: '',
|
|
890
|
+
queryLimitIncrement: 12,
|
|
891
|
+
baseQueryLimit: 12
|
|
892
|
+
};
|
|
881
893
|
|
|
882
|
-
LuxityGraphQLMultiselector
|
|
883
|
-
baseClass: '',
|
|
884
|
-
searchPlaceHolder: '',
|
|
885
|
-
queryLimitIncrement: 12,
|
|
886
|
-
baseQueryLimit: 12
|
|
887
|
-
};
|
|
894
|
+
return LuxityGraphQLMultiselector;
|
|
888
895
|
|
|
889
|
-
|
|
896
|
+
})));
|