@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
|
var styled__default = 'default' in styled ? 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
|
}
|
|
@@ -172,50 +200,18 @@
|
|
|
172
200
|
|
|
173
201
|
var isUndefined = (val) => val === undefined;
|
|
174
202
|
|
|
175
|
-
var get = (
|
|
176
|
-
if (!path || !isObject(
|
|
203
|
+
var get = (obj, path, defaultValue) => {
|
|
204
|
+
if (!path || !isObject(obj)) {
|
|
177
205
|
return defaultValue;
|
|
178
206
|
}
|
|
179
|
-
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key],
|
|
180
|
-
return isUndefined(result) || result ===
|
|
181
|
-
? isUndefined(
|
|
207
|
+
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
|
|
208
|
+
return isUndefined(result) || result === obj
|
|
209
|
+
? isUndefined(obj[path])
|
|
182
210
|
? defaultValue
|
|
183
|
-
:
|
|
211
|
+
: obj[path]
|
|
184
212
|
: result;
|
|
185
213
|
};
|
|
186
214
|
|
|
187
|
-
var isBoolean = (value) => typeof value === 'boolean';
|
|
188
|
-
|
|
189
|
-
var isKey = (value) => /^\w*$/.test(value);
|
|
190
|
-
|
|
191
|
-
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
|
|
192
|
-
|
|
193
|
-
var set = (object, path, value) => {
|
|
194
|
-
let index = -1;
|
|
195
|
-
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
196
|
-
const length = tempPath.length;
|
|
197
|
-
const lastIndex = length - 1;
|
|
198
|
-
while (++index < length) {
|
|
199
|
-
const key = tempPath[index];
|
|
200
|
-
let newValue = value;
|
|
201
|
-
if (index !== lastIndex) {
|
|
202
|
-
const objValue = object[key];
|
|
203
|
-
newValue =
|
|
204
|
-
isObject(objValue) || Array.isArray(objValue)
|
|
205
|
-
? objValue
|
|
206
|
-
: !isNaN(+tempPath[index + 1])
|
|
207
|
-
? []
|
|
208
|
-
: {};
|
|
209
|
-
}
|
|
210
|
-
if (key === '__proto__') {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
object[key] = newValue;
|
|
214
|
-
object = object[key];
|
|
215
|
-
}
|
|
216
|
-
return object;
|
|
217
|
-
};
|
|
218
|
-
|
|
219
215
|
const EVENTS = {
|
|
220
216
|
BLUR: 'blur',
|
|
221
217
|
FOCUS_OUT: 'focusout',
|
|
@@ -294,13 +290,15 @@
|
|
|
294
290
|
|
|
295
291
|
var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
|
|
296
292
|
|
|
297
|
-
var shouldSubscribeByName = (name, signalName, exact) =>
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
293
|
+
var shouldSubscribeByName = (name, signalName, exact) => exact && signalName
|
|
294
|
+
? name === signalName ||
|
|
295
|
+
(Array.isArray(name) &&
|
|
296
|
+
name.some((currentName) => currentName && exact && currentName === signalName))
|
|
297
|
+
: !name ||
|
|
298
|
+
!signalName ||
|
|
299
|
+
name === signalName ||
|
|
300
|
+
convertToArrayPayload(name).some((currentName) => currentName &&
|
|
301
|
+
(currentName.startsWith(signalName) ||
|
|
304
302
|
signalName.startsWith(currentName)));
|
|
305
303
|
|
|
306
304
|
function useSubscribe(props) {
|
|
@@ -358,7 +356,6 @@
|
|
|
358
356
|
isLoading: false,
|
|
359
357
|
dirtyFields: false,
|
|
360
358
|
touchedFields: false,
|
|
361
|
-
validatingFields: false,
|
|
362
359
|
isValidating: false,
|
|
363
360
|
isValid: false,
|
|
364
361
|
errors: false,
|
|
@@ -409,7 +406,7 @@
|
|
|
409
406
|
*
|
|
410
407
|
* @example
|
|
411
408
|
* ```tsx
|
|
412
|
-
* const {
|
|
409
|
+
* const { watch } = useForm();
|
|
413
410
|
* const values = useWatch({
|
|
414
411
|
* name: "fieldName"
|
|
415
412
|
* control,
|
|
@@ -435,6 +432,33 @@
|
|
|
435
432
|
return value;
|
|
436
433
|
}
|
|
437
434
|
|
|
435
|
+
var isKey = (value) => /^\w*$/.test(value);
|
|
436
|
+
|
|
437
|
+
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
|
|
438
|
+
|
|
439
|
+
function set(object, path, value) {
|
|
440
|
+
let index = -1;
|
|
441
|
+
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
442
|
+
const length = tempPath.length;
|
|
443
|
+
const lastIndex = length - 1;
|
|
444
|
+
while (++index < length) {
|
|
445
|
+
const key = tempPath[index];
|
|
446
|
+
let newValue = value;
|
|
447
|
+
if (index !== lastIndex) {
|
|
448
|
+
const objValue = object[key];
|
|
449
|
+
newValue =
|
|
450
|
+
isObject(objValue) || Array.isArray(objValue)
|
|
451
|
+
? objValue
|
|
452
|
+
: !isNaN(+tempPath[index + 1])
|
|
453
|
+
? []
|
|
454
|
+
: {};
|
|
455
|
+
}
|
|
456
|
+
object[key] = newValue;
|
|
457
|
+
object = object[key];
|
|
458
|
+
}
|
|
459
|
+
return object;
|
|
460
|
+
}
|
|
461
|
+
|
|
438
462
|
/**
|
|
439
463
|
* 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.
|
|
440
464
|
*
|
|
@@ -472,18 +496,17 @@
|
|
|
472
496
|
const formState = useFormState({
|
|
473
497
|
control,
|
|
474
498
|
name,
|
|
475
|
-
exact: true,
|
|
476
499
|
});
|
|
477
500
|
const _registerProps = React__default.useRef(control.register(name, {
|
|
478
501
|
...props.rules,
|
|
479
502
|
value,
|
|
480
|
-
...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
|
|
481
503
|
}));
|
|
504
|
+
_registerProps.current = control.register(name, props.rules);
|
|
482
505
|
React__default.useEffect(() => {
|
|
483
506
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
484
507
|
const updateMounted = (name, value) => {
|
|
485
508
|
const field = get(control._fields, name);
|
|
486
|
-
if (field
|
|
509
|
+
if (field) {
|
|
487
510
|
field._f.mount = value;
|
|
488
511
|
}
|
|
489
512
|
};
|
|
@@ -504,22 +527,17 @@
|
|
|
504
527
|
};
|
|
505
528
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
506
529
|
React__default.useEffect(() => {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
value: get(control._fields, name)._f.value,
|
|
513
|
-
});
|
|
514
|
-
}
|
|
530
|
+
control._updateDisabledField({
|
|
531
|
+
disabled,
|
|
532
|
+
fields: control._fields,
|
|
533
|
+
name,
|
|
534
|
+
});
|
|
515
535
|
}, [disabled, name, control]);
|
|
516
536
|
return {
|
|
517
537
|
field: {
|
|
518
538
|
name,
|
|
519
539
|
value,
|
|
520
|
-
|
|
521
|
-
? { disabled: formState.disabled || disabled }
|
|
522
|
-
: {}),
|
|
540
|
+
disabled,
|
|
523
541
|
onChange: React__default.useCallback((event) => _registerProps.current.onChange({
|
|
524
542
|
target: {
|
|
525
543
|
value: getEventValue(event),
|
|
@@ -534,7 +552,7 @@
|
|
|
534
552
|
},
|
|
535
553
|
type: EVENTS.BLUR,
|
|
536
554
|
}), [name, control]),
|
|
537
|
-
ref:
|
|
555
|
+
ref: (elm) => {
|
|
538
556
|
const field = get(control._fields, name);
|
|
539
557
|
if (field && elm) {
|
|
540
558
|
field._f.ref = {
|
|
@@ -544,7 +562,7 @@
|
|
|
544
562
|
reportValidity: () => elm.reportValidity(),
|
|
545
563
|
};
|
|
546
564
|
}
|
|
547
|
-
},
|
|
565
|
+
},
|
|
548
566
|
},
|
|
549
567
|
formState,
|
|
550
568
|
fieldState: Object.defineProperties({}, {
|
|
@@ -560,10 +578,6 @@
|
|
|
560
578
|
enumerable: true,
|
|
561
579
|
get: () => !!get(formState.touchedFields, name),
|
|
562
580
|
},
|
|
563
|
-
isValidating: {
|
|
564
|
-
enumerable: true,
|
|
565
|
-
get: () => !!get(formState.validatingFields, name),
|
|
566
|
-
},
|
|
567
581
|
error: {
|
|
568
582
|
enumerable: true,
|
|
569
583
|
get: () => get(formState.errors, name),
|
|
@@ -596,27 +610,31 @@
|
|
|
596
610
|
});
|
|
597
611
|
|
|
598
612
|
var _excluded = ["ref"];
|
|
613
|
+
|
|
599
614
|
var _templateObject$5, _templateObject2;
|
|
600
615
|
var OptionsRow = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n"])));
|
|
601
616
|
var Options = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n flex-basis: 60%;\n"])));
|
|
617
|
+
|
|
602
618
|
var CommunicationPreferenceOptionsRenderer = function CommunicationPreferenceOptionsRenderer(_ref) {
|
|
603
619
|
var control = _ref.control,
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
620
|
+
name = _ref.name,
|
|
621
|
+
isDisabled = _ref.isDisabled,
|
|
622
|
+
options = _ref.options,
|
|
623
|
+
defaultValue = _ref.defaultValue,
|
|
624
|
+
setValue = _ref.setValue;
|
|
625
|
+
|
|
609
626
|
var _useController = useController({
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
627
|
+
name: name,
|
|
628
|
+
control: control,
|
|
629
|
+
defaultValue: defaultValue
|
|
630
|
+
}),
|
|
631
|
+
_useController$field = _useController.field,
|
|
632
|
+
ref = _useController$field.ref,
|
|
633
|
+
inputProps = _objectWithoutProperties(_useController$field, _excluded),
|
|
634
|
+
_useController$fieldS = _useController.fieldState,
|
|
635
|
+
invalid = _useController$fieldS.invalid,
|
|
636
|
+
error = _useController$fieldS.error;
|
|
637
|
+
|
|
620
638
|
React.useEffect(function () {
|
|
621
639
|
if (defaultValue) {
|
|
622
640
|
setValue(name, defaultValue);
|
|
@@ -646,15 +664,16 @@
|
|
|
646
664
|
return props.theme.colors.primary;
|
|
647
665
|
});
|
|
648
666
|
var SectionHeading = styled__default.div(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding: 5px 10px;\n"])));
|
|
667
|
+
|
|
649
668
|
var CommunicationPreferenceSection = function CommunicationPreferenceSection(_ref) {
|
|
650
669
|
var section_heading = _ref.section_heading,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
670
|
+
description = _ref.description,
|
|
671
|
+
control = _ref.control,
|
|
672
|
+
name = _ref.name,
|
|
673
|
+
isDisabled = _ref.isDisabled,
|
|
674
|
+
options = _ref.options,
|
|
675
|
+
defaultValue = _ref.defaultValue,
|
|
676
|
+
setValue = _ref.setValue;
|
|
658
677
|
return /*#__PURE__*/React__default.createElement(SectionContainer, null, /*#__PURE__*/React__default.createElement(SectionHeading, null, section_heading), /*#__PURE__*/React__default.createElement(CommunicationPreferenceOptionsRenderer, {
|
|
659
678
|
description: description,
|
|
660
679
|
control: control,
|
|
@@ -665,6 +684,7 @@
|
|
|
665
684
|
setValue: setValue
|
|
666
685
|
}));
|
|
667
686
|
};
|
|
687
|
+
|
|
668
688
|
var index = themed(CommunicationPreferenceSection);
|
|
669
689
|
|
|
670
690
|
return index;
|