@bonlineza/luxity-lib 2.34.3 → 2.34.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +116 -76
- package/AddInterest.js +768 -434
- package/BrandSelector.js +336 -176
- package/Checkbox.js +101 -68
- package/CheckboxButton.js +124 -79
- package/CommunicationPreferenceOptionsRenderer.js +125 -107
- package/CommunicationPreferenceSection.js +134 -114
- package/CommunicationPreferences.js +339 -443
- package/CountryCodeSelect.js +10 -7
- package/CurrencyInputFormatter.js +56 -29
- package/CurrencySelect.js +49 -23
- package/GALink.js +16 -6
- package/GenderSelector.js +142 -88
- package/GraphQLDropdownSelector.js +937 -503
- package/GraphQLMultiSelector.js +274 -141
- package/IconHeader.js +25 -11
- package/IconWrapper.js +7 -3
- package/InterestCatSelector.js +74 -34
- package/InterestItem.js +187 -103
- package/Interests.js +890 -485
- package/InterestsSubheading.js +10 -5
- package/InvertedTextButton.js +63 -27
- package/LuxityAppSideNav.js +21 -18
- package/LuxityDesktopHeader.js +258 -191
- package/LuxityFooter.js +276 -374
- package/LuxityGraphQLDropdownSelector.js +969 -519
- package/LuxityGraphQLMultiselector.js +321 -167
- package/LuxityMobileHeader.js +351 -253
- package/LuxityPageReady.js +136 -74
- package/LuxitySideNav.js +213 -165
- package/MaterialSelector.js +976 -525
- package/ModelSelector.js +976 -525
- package/NotificationDropDown.js +209 -111
- package/Notify.js +1 -0
- package/OutlinePrimaryButton.js +58 -26
- package/PriceRangeSelector.js +281 -168
- package/PrimaryButton.js +58 -26
- package/RadioButtons.js +140 -114
- package/RangeSlider.js +242 -152
- package/RareStepFooter.js +41 -27
- package/RareStepHeader.js +190 -139
- package/ReactSelectWrapper.js +1 -0
- package/SecondaryButton.js +58 -26
- package/ShoeSizeRangeSelector.js +260 -162
- package/ShoeSizeSelector.js +263 -158
- package/SimpleErrorBoundary.js +106 -59
- package/StyleSelector.js +336 -176
- package/TestComponent.js +15 -0
- package/TextButton.js +58 -26
- package/Tooltip.js +39 -17
- package/Tracking.js +1 -0
- package/WrapperButton.js +43 -20
- package/build/bundle.css +1 -1
- package/build/bundle.js +1711 -1265
- package/package.json +1 -1
- package/svg/Accessories.js +13 -6
- package/svg/Account.js +13 -6
- package/svg/Add.js +13 -6
- package/svg/ArrowRight.js +13 -6
- package/svg/Bags.js +13 -6
- package/svg/BurgerMenu.js +13 -6
- package/svg/Calendar.js +13 -6
- package/svg/CalendarCircled.js +13 -6
- package/svg/CheckCircled.js +13 -6
- package/svg/Close.js +13 -6
- package/svg/Clothing.js +13 -6
- package/svg/Dot.js +13 -6
- package/svg/Edit.js +13 -6
- package/svg/Eye.js +13 -6
- package/svg/FileAttach.js +13 -6
- package/svg/FileAttachCircled.js +13 -6
- package/svg/LightBulb.js +13 -6
- package/svg/Logo.js +13 -6
- package/svg/LuxityMenu.js +13 -6
- package/svg/Minus.js +13 -6
- package/svg/MobileAvatar.js +13 -6
- package/svg/MyOrder.js +13 -6
- package/svg/MyPayment.js +13 -6
- package/svg/MyProfile.js +14 -8
- package/svg/MySale.js +13 -6
- package/svg/Notification.js +13 -6
- package/svg/PointerDown.js +13 -6
- package/svg/Search.js +13 -6
- package/svg/Shoes.js +13 -6
- package/svg/SvgWrapper.js +7 -3
- package/svg/Trash.js +13 -6
- package/svg/Watches.js +13 -6
|
@@ -8,38 +8,66 @@
|
|
|
8
8
|
styled = styled && Object.prototype.hasOwnProperty.call(styled, 'default') ? styled['default'] : styled;
|
|
9
9
|
|
|
10
10
|
function _extends() {
|
|
11
|
-
|
|
12
|
-
for (var
|
|
13
|
-
var
|
|
14
|
-
|
|
11
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
12
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
13
|
+
var source = arguments[i];
|
|
14
|
+
|
|
15
|
+
for (var key in source) {
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17
|
+
target[key] = source[key];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
15
20
|
}
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
|
|
22
|
+
return target;
|
|
23
|
+
};
|
|
24
|
+
return _extends.apply(this, arguments);
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
28
|
+
if (source == null) return {};
|
|
29
|
+
var target = {};
|
|
30
|
+
var sourceKeys = Object.keys(source);
|
|
31
|
+
var key, i;
|
|
32
|
+
|
|
33
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
34
|
+
key = sourceKeys[i];
|
|
35
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
36
|
+
target[key] = source[key];
|
|
27
37
|
}
|
|
28
|
-
|
|
38
|
+
|
|
39
|
+
return target;
|
|
29
40
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
|
|
42
|
+
function _objectWithoutProperties(source, excluded) {
|
|
43
|
+
if (source == null) return {};
|
|
44
|
+
|
|
45
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
46
|
+
|
|
47
|
+
var key, i;
|
|
48
|
+
|
|
49
|
+
if (Object.getOwnPropertySymbols) {
|
|
50
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
51
|
+
|
|
52
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
53
|
+
key = sourceSymbolKeys[i];
|
|
54
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
55
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
56
|
+
target[key] = source[key];
|
|
57
|
+
}
|
|
36
58
|
}
|
|
37
|
-
|
|
59
|
+
|
|
60
|
+
return target;
|
|
38
61
|
}
|
|
39
|
-
|
|
40
|
-
|
|
62
|
+
|
|
63
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
64
|
+
if (!raw) {
|
|
65
|
+
raw = strings.slice(0);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
41
69
|
raw: {
|
|
42
|
-
value: Object.freeze(
|
|
70
|
+
value: Object.freeze(raw)
|
|
43
71
|
}
|
|
44
72
|
}));
|
|
45
73
|
}
|
|
@@ -108,50 +136,18 @@
|
|
|
108
136
|
|
|
109
137
|
var isUndefined = (val) => val === undefined;
|
|
110
138
|
|
|
111
|
-
var get = (
|
|
112
|
-
if (!path || !isObject(
|
|
139
|
+
var get = (obj, path, defaultValue) => {
|
|
140
|
+
if (!path || !isObject(obj)) {
|
|
113
141
|
return defaultValue;
|
|
114
142
|
}
|
|
115
|
-
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key],
|
|
116
|
-
return isUndefined(result) || result ===
|
|
117
|
-
? isUndefined(
|
|
143
|
+
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
|
|
144
|
+
return isUndefined(result) || result === obj
|
|
145
|
+
? isUndefined(obj[path])
|
|
118
146
|
? defaultValue
|
|
119
|
-
:
|
|
147
|
+
: obj[path]
|
|
120
148
|
: result;
|
|
121
149
|
};
|
|
122
150
|
|
|
123
|
-
var isBoolean = (value) => typeof value === 'boolean';
|
|
124
|
-
|
|
125
|
-
var isKey = (value) => /^\w*$/.test(value);
|
|
126
|
-
|
|
127
|
-
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
|
|
128
|
-
|
|
129
|
-
var set = (object, path, value) => {
|
|
130
|
-
let index = -1;
|
|
131
|
-
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
132
|
-
const length = tempPath.length;
|
|
133
|
-
const lastIndex = length - 1;
|
|
134
|
-
while (++index < length) {
|
|
135
|
-
const key = tempPath[index];
|
|
136
|
-
let newValue = value;
|
|
137
|
-
if (index !== lastIndex) {
|
|
138
|
-
const objValue = object[key];
|
|
139
|
-
newValue =
|
|
140
|
-
isObject(objValue) || Array.isArray(objValue)
|
|
141
|
-
? objValue
|
|
142
|
-
: !isNaN(+tempPath[index + 1])
|
|
143
|
-
? []
|
|
144
|
-
: {};
|
|
145
|
-
}
|
|
146
|
-
if (key === '__proto__') {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
object[key] = newValue;
|
|
150
|
-
object = object[key];
|
|
151
|
-
}
|
|
152
|
-
return object;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
151
|
const EVENTS = {
|
|
156
152
|
BLUR: 'blur',
|
|
157
153
|
FOCUS_OUT: 'focusout',
|
|
@@ -230,13 +226,15 @@
|
|
|
230
226
|
|
|
231
227
|
var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
|
|
232
228
|
|
|
233
|
-
var shouldSubscribeByName = (name, signalName, exact) =>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
229
|
+
var shouldSubscribeByName = (name, signalName, exact) => exact && signalName
|
|
230
|
+
? name === signalName ||
|
|
231
|
+
(Array.isArray(name) &&
|
|
232
|
+
name.some((currentName) => currentName && exact && currentName === signalName))
|
|
233
|
+
: !name ||
|
|
234
|
+
!signalName ||
|
|
235
|
+
name === signalName ||
|
|
236
|
+
convertToArrayPayload(name).some((currentName) => currentName &&
|
|
237
|
+
(currentName.startsWith(signalName) ||
|
|
240
238
|
signalName.startsWith(currentName)));
|
|
241
239
|
|
|
242
240
|
function useSubscribe(props) {
|
|
@@ -294,7 +292,6 @@
|
|
|
294
292
|
isLoading: false,
|
|
295
293
|
dirtyFields: false,
|
|
296
294
|
touchedFields: false,
|
|
297
|
-
validatingFields: false,
|
|
298
295
|
isValidating: false,
|
|
299
296
|
isValid: false,
|
|
300
297
|
errors: false,
|
|
@@ -345,7 +342,7 @@
|
|
|
345
342
|
*
|
|
346
343
|
* @example
|
|
347
344
|
* ```tsx
|
|
348
|
-
* const {
|
|
345
|
+
* const { watch } = useForm();
|
|
349
346
|
* const values = useWatch({
|
|
350
347
|
* name: "fieldName"
|
|
351
348
|
* control,
|
|
@@ -371,6 +368,33 @@
|
|
|
371
368
|
return value;
|
|
372
369
|
}
|
|
373
370
|
|
|
371
|
+
var isKey = (value) => /^\w*$/.test(value);
|
|
372
|
+
|
|
373
|
+
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
|
|
374
|
+
|
|
375
|
+
function set(object, path, value) {
|
|
376
|
+
let index = -1;
|
|
377
|
+
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
378
|
+
const length = tempPath.length;
|
|
379
|
+
const lastIndex = length - 1;
|
|
380
|
+
while (++index < length) {
|
|
381
|
+
const key = tempPath[index];
|
|
382
|
+
let newValue = value;
|
|
383
|
+
if (index !== lastIndex) {
|
|
384
|
+
const objValue = object[key];
|
|
385
|
+
newValue =
|
|
386
|
+
isObject(objValue) || Array.isArray(objValue)
|
|
387
|
+
? objValue
|
|
388
|
+
: !isNaN(+tempPath[index + 1])
|
|
389
|
+
? []
|
|
390
|
+
: {};
|
|
391
|
+
}
|
|
392
|
+
object[key] = newValue;
|
|
393
|
+
object = object[key];
|
|
394
|
+
}
|
|
395
|
+
return object;
|
|
396
|
+
}
|
|
397
|
+
|
|
374
398
|
/**
|
|
375
399
|
* Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.
|
|
376
400
|
*
|
|
@@ -408,18 +432,17 @@
|
|
|
408
432
|
const formState = useFormState({
|
|
409
433
|
control,
|
|
410
434
|
name,
|
|
411
|
-
exact: true,
|
|
412
435
|
});
|
|
413
436
|
const _registerProps = React__default.useRef(control.register(name, {
|
|
414
437
|
...props.rules,
|
|
415
438
|
value,
|
|
416
|
-
...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
|
|
417
439
|
}));
|
|
440
|
+
_registerProps.current = control.register(name, props.rules);
|
|
418
441
|
React__default.useEffect(() => {
|
|
419
442
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
420
443
|
const updateMounted = (name, value) => {
|
|
421
444
|
const field = get(control._fields, name);
|
|
422
|
-
if (field
|
|
445
|
+
if (field) {
|
|
423
446
|
field._f.mount = value;
|
|
424
447
|
}
|
|
425
448
|
};
|
|
@@ -440,22 +463,17 @@
|
|
|
440
463
|
};
|
|
441
464
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
442
465
|
React__default.useEffect(() => {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
value: get(control._fields, name)._f.value,
|
|
449
|
-
});
|
|
450
|
-
}
|
|
466
|
+
control._updateDisabledField({
|
|
467
|
+
disabled,
|
|
468
|
+
fields: control._fields,
|
|
469
|
+
name,
|
|
470
|
+
});
|
|
451
471
|
}, [disabled, name, control]);
|
|
452
472
|
return {
|
|
453
473
|
field: {
|
|
454
474
|
name,
|
|
455
475
|
value,
|
|
456
|
-
|
|
457
|
-
? { disabled: formState.disabled || disabled }
|
|
458
|
-
: {}),
|
|
476
|
+
disabled,
|
|
459
477
|
onChange: React__default.useCallback((event) => _registerProps.current.onChange({
|
|
460
478
|
target: {
|
|
461
479
|
value: getEventValue(event),
|
|
@@ -470,7 +488,7 @@
|
|
|
470
488
|
},
|
|
471
489
|
type: EVENTS.BLUR,
|
|
472
490
|
}), [name, control]),
|
|
473
|
-
ref:
|
|
491
|
+
ref: (elm) => {
|
|
474
492
|
const field = get(control._fields, name);
|
|
475
493
|
if (field && elm) {
|
|
476
494
|
field._f.ref = {
|
|
@@ -480,7 +498,7 @@
|
|
|
480
498
|
reportValidity: () => elm.reportValidity(),
|
|
481
499
|
};
|
|
482
500
|
}
|
|
483
|
-
},
|
|
501
|
+
},
|
|
484
502
|
},
|
|
485
503
|
formState,
|
|
486
504
|
fieldState: Object.defineProperties({}, {
|
|
@@ -496,10 +514,6 @@
|
|
|
496
514
|
enumerable: true,
|
|
497
515
|
get: () => !!get(formState.touchedFields, name),
|
|
498
516
|
},
|
|
499
|
-
isValidating: {
|
|
500
|
-
enumerable: true,
|
|
501
|
-
get: () => !!get(formState.validatingFields, name),
|
|
502
|
-
},
|
|
503
517
|
error: {
|
|
504
518
|
enumerable: true,
|
|
505
519
|
get: () => get(formState.errors, name),
|
|
@@ -532,27 +546,31 @@
|
|
|
532
546
|
});
|
|
533
547
|
|
|
534
548
|
var _excluded = ["ref"];
|
|
549
|
+
|
|
535
550
|
var _templateObject$5, _templateObject2;
|
|
536
551
|
var OptionsRow = styled.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n"])));
|
|
537
552
|
var Options = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n flex-basis: 60%;\n"])));
|
|
553
|
+
|
|
538
554
|
var CommunicationPreferenceOptionsRenderer = function CommunicationPreferenceOptionsRenderer(_ref) {
|
|
539
555
|
var control = _ref.control,
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
556
|
+
name = _ref.name,
|
|
557
|
+
isDisabled = _ref.isDisabled,
|
|
558
|
+
options = _ref.options,
|
|
559
|
+
defaultValue = _ref.defaultValue,
|
|
560
|
+
setValue = _ref.setValue;
|
|
561
|
+
|
|
545
562
|
var _useController = useController({
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
563
|
+
name: name,
|
|
564
|
+
control: control,
|
|
565
|
+
defaultValue: defaultValue
|
|
566
|
+
}),
|
|
567
|
+
_useController$field = _useController.field,
|
|
568
|
+
ref = _useController$field.ref,
|
|
569
|
+
inputProps = _objectWithoutProperties(_useController$field, _excluded),
|
|
570
|
+
_useController$fieldS = _useController.fieldState,
|
|
571
|
+
invalid = _useController$fieldS.invalid,
|
|
572
|
+
error = _useController$fieldS.error;
|
|
573
|
+
|
|
556
574
|
React.useEffect(function () {
|
|
557
575
|
if (defaultValue) {
|
|
558
576
|
setValue(name, defaultValue);
|