@bonlineza/luxity-lib 2.34.1 → 2.34.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +76 -116
- package/AddInterest.js +434 -768
- package/BrandSelector.js +176 -336
- package/Checkbox.js +68 -101
- package/CheckboxButton.js +79 -124
- package/CommunicationPreferenceOptionsRenderer.js +107 -125
- package/CommunicationPreferenceSection.js +114 -134
- package/CommunicationPreferences.js +443 -339
- package/CountryCodeSelect.js +7 -10
- package/CurrencyInputFormatter.js +29 -56
- package/CurrencySelect.js +188 -19
- package/GALink.js +6 -16
- package/GenderSelector.js +88 -142
- package/GraphQLDropdownSelector.js +505 -939
- package/GraphQLMultiSelector.js +141 -274
- package/IconHeader.js +11 -25
- package/IconWrapper.js +3 -7
- package/InterestCatSelector.js +34 -74
- package/InterestItem.js +103 -187
- package/Interests.js +485 -890
- package/InterestsSubheading.js +5 -10
- package/InvertedTextButton.js +27 -63
- package/LuxityAppSideNav.js +18 -21
- package/LuxityDesktopHeader.js +360 -211
- package/LuxityFooter.js +464 -260
- package/LuxityGraphQLDropdownSelector.js +519 -969
- package/LuxityGraphQLMultiselector.js +167 -321
- package/LuxityMobileHeader.js +453 -283
- package/LuxityPageReady.js +74 -136
- package/LuxitySideNav.js +355 -159
- package/MaterialSelector.js +525 -976
- package/ModelSelector.js +525 -976
- package/NotificationDropDown.js +111 -209
- package/Notify.js +0 -1
- package/OutlinePrimaryButton.js +26 -58
- package/PriceRangeSelector.js +168 -281
- package/PrimaryButton.js +26 -58
- package/RadioButtons.js +114 -140
- package/RangeSlider.js +152 -242
- package/RareStepFooter.js +27 -41
- package/RareStepHeader.js +139 -190
- package/ReactSelectWrapper.js +0 -1
- package/SecondaryButton.js +26 -58
- package/ShoeSizeRangeSelector.js +162 -260
- package/ShoeSizeSelector.js +158 -263
- package/SimpleErrorBoundary.js +59 -106
- package/StyleSelector.js +176 -336
- package/TextButton.js +26 -58
- package/Tooltip.js +17 -39
- package/Tracking.js +0 -1
- package/WrapperButton.js +20 -43
- package/build/bundle.css +1 -1
- package/build/bundle.js +1321 -1697
- package/package.json +1 -1
- package/svg/Accessories.js +6 -13
- package/svg/Account.js +6 -13
- package/svg/Add.js +6 -13
- package/svg/ArrowRight.js +6 -13
- package/svg/Bags.js +6 -13
- package/svg/BurgerMenu.js +6 -13
- package/svg/Calendar.js +6 -13
- package/svg/CalendarCircled.js +6 -13
- package/svg/CheckCircled.js +6 -13
- package/svg/Close.js +6 -13
- package/svg/Clothing.js +6 -13
- package/svg/Dot.js +6 -13
- package/svg/Edit.js +6 -13
- package/svg/Eye.js +6 -13
- package/svg/FileAttach.js +6 -13
- package/svg/FileAttachCircled.js +6 -13
- package/svg/LightBulb.js +6 -13
- package/svg/Logo.js +6 -13
- package/svg/LuxityMenu.js +6 -13
- package/svg/Minus.js +6 -13
- package/svg/MobileAvatar.js +6 -13
- package/svg/MyOrder.js +6 -13
- package/svg/MyPayment.js +6 -13
- package/svg/MyProfile.js +8 -14
- package/svg/MySale.js +6 -13
- package/svg/Notification.js +6 -13
- package/svg/PointerDown.js +6 -13
- package/svg/Search.js +6 -13
- package/svg/Shoes.js +6 -13
- package/svg/SvgWrapper.js +3 -7
- package/svg/Trash.js +6 -13
- package/svg/Watches.js +6 -13
|
@@ -8,66 +8,38 @@
|
|
|
8
8
|
var styled__default = 'default' in styled ? styled['default'] : styled;
|
|
9
9
|
|
|
10
10
|
function _extends() {
|
|
11
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
12
|
-
for (var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
for (var key in source) {
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17
|
-
target[key] = source[key];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
11
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
12
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
13
|
+
var t = arguments[e];
|
|
14
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
return _extends.apply(this, arguments);
|
|
25
|
-
}
|
|
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];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return target;
|
|
16
|
+
return n;
|
|
17
|
+
}, _extends.apply(null, arguments);
|
|
40
18
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var key, i;
|
|
48
|
-
|
|
19
|
+
function _objectWithoutProperties(e, t) {
|
|
20
|
+
if (null == e) return {};
|
|
21
|
+
var o,
|
|
22
|
+
r,
|
|
23
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
49
24
|
if (Object.getOwnPropertySymbols) {
|
|
50
|
-
var
|
|
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
|
-
}
|
|
25
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
26
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
58
27
|
}
|
|
59
|
-
|
|
60
|
-
return target;
|
|
28
|
+
return i;
|
|
61
29
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
30
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
31
|
+
if (null == r) return {};
|
|
32
|
+
var t = {};
|
|
33
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
34
|
+
if (e.includes(n)) continue;
|
|
35
|
+
t[n] = r[n];
|
|
66
36
|
}
|
|
67
|
-
|
|
68
|
-
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
function _taggedTemplateLiteral(e, t) {
|
|
40
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
69
41
|
raw: {
|
|
70
|
-
value: Object.freeze(
|
|
42
|
+
value: Object.freeze(t)
|
|
71
43
|
}
|
|
72
44
|
}));
|
|
73
45
|
}
|
|
@@ -200,18 +172,50 @@
|
|
|
200
172
|
|
|
201
173
|
var isUndefined = (val) => val === undefined;
|
|
202
174
|
|
|
203
|
-
var get = (
|
|
204
|
-
if (!path || !isObject(
|
|
175
|
+
var get = (object, path, defaultValue) => {
|
|
176
|
+
if (!path || !isObject(object)) {
|
|
205
177
|
return defaultValue;
|
|
206
178
|
}
|
|
207
|
-
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key],
|
|
208
|
-
return isUndefined(result) || result ===
|
|
209
|
-
? isUndefined(
|
|
179
|
+
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
|
|
180
|
+
return isUndefined(result) || result === object
|
|
181
|
+
? isUndefined(object[path])
|
|
210
182
|
? defaultValue
|
|
211
|
-
:
|
|
183
|
+
: object[path]
|
|
212
184
|
: result;
|
|
213
185
|
};
|
|
214
186
|
|
|
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
|
+
|
|
215
219
|
const EVENTS = {
|
|
216
220
|
BLUR: 'blur',
|
|
217
221
|
FOCUS_OUT: 'focusout',
|
|
@@ -290,15 +294,13 @@
|
|
|
290
294
|
|
|
291
295
|
var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
|
|
292
296
|
|
|
293
|
-
var shouldSubscribeByName = (name, signalName, exact) =>
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
convertToArrayPayload(name).some((currentName) => currentName &&
|
|
301
|
-
(currentName.startsWith(signalName) ||
|
|
297
|
+
var shouldSubscribeByName = (name, signalName, exact) => !name ||
|
|
298
|
+
!signalName ||
|
|
299
|
+
name === signalName ||
|
|
300
|
+
convertToArrayPayload(name).some((currentName) => currentName &&
|
|
301
|
+
(exact
|
|
302
|
+
? currentName === signalName
|
|
303
|
+
: currentName.startsWith(signalName) ||
|
|
302
304
|
signalName.startsWith(currentName)));
|
|
303
305
|
|
|
304
306
|
function useSubscribe(props) {
|
|
@@ -356,6 +358,7 @@
|
|
|
356
358
|
isLoading: false,
|
|
357
359
|
dirtyFields: false,
|
|
358
360
|
touchedFields: false,
|
|
361
|
+
validatingFields: false,
|
|
359
362
|
isValidating: false,
|
|
360
363
|
isValid: false,
|
|
361
364
|
errors: false,
|
|
@@ -406,7 +409,7 @@
|
|
|
406
409
|
*
|
|
407
410
|
* @example
|
|
408
411
|
* ```tsx
|
|
409
|
-
* const {
|
|
412
|
+
* const { control } = useForm();
|
|
410
413
|
* const values = useWatch({
|
|
411
414
|
* name: "fieldName"
|
|
412
415
|
* control,
|
|
@@ -432,33 +435,6 @@
|
|
|
432
435
|
return value;
|
|
433
436
|
}
|
|
434
437
|
|
|
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
|
-
|
|
462
438
|
/**
|
|
463
439
|
* 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.
|
|
464
440
|
*
|
|
@@ -496,17 +472,18 @@
|
|
|
496
472
|
const formState = useFormState({
|
|
497
473
|
control,
|
|
498
474
|
name,
|
|
475
|
+
exact: true,
|
|
499
476
|
});
|
|
500
477
|
const _registerProps = React__default.useRef(control.register(name, {
|
|
501
478
|
...props.rules,
|
|
502
479
|
value,
|
|
480
|
+
...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
|
|
503
481
|
}));
|
|
504
|
-
_registerProps.current = control.register(name, props.rules);
|
|
505
482
|
React__default.useEffect(() => {
|
|
506
483
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
507
484
|
const updateMounted = (name, value) => {
|
|
508
485
|
const field = get(control._fields, name);
|
|
509
|
-
if (field) {
|
|
486
|
+
if (field && field._f) {
|
|
510
487
|
field._f.mount = value;
|
|
511
488
|
}
|
|
512
489
|
};
|
|
@@ -527,17 +504,22 @@
|
|
|
527
504
|
};
|
|
528
505
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
529
506
|
React__default.useEffect(() => {
|
|
530
|
-
control.
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
507
|
+
if (get(control._fields, name)) {
|
|
508
|
+
control._updateDisabledField({
|
|
509
|
+
disabled,
|
|
510
|
+
fields: control._fields,
|
|
511
|
+
name,
|
|
512
|
+
value: get(control._fields, name)._f.value,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
535
515
|
}, [disabled, name, control]);
|
|
536
516
|
return {
|
|
537
517
|
field: {
|
|
538
518
|
name,
|
|
539
519
|
value,
|
|
540
|
-
disabled
|
|
520
|
+
...(isBoolean(disabled) || formState.disabled
|
|
521
|
+
? { disabled: formState.disabled || disabled }
|
|
522
|
+
: {}),
|
|
541
523
|
onChange: React__default.useCallback((event) => _registerProps.current.onChange({
|
|
542
524
|
target: {
|
|
543
525
|
value: getEventValue(event),
|
|
@@ -552,7 +534,7 @@
|
|
|
552
534
|
},
|
|
553
535
|
type: EVENTS.BLUR,
|
|
554
536
|
}), [name, control]),
|
|
555
|
-
ref: (elm) => {
|
|
537
|
+
ref: React__default.useCallback((elm) => {
|
|
556
538
|
const field = get(control._fields, name);
|
|
557
539
|
if (field && elm) {
|
|
558
540
|
field._f.ref = {
|
|
@@ -562,7 +544,7 @@
|
|
|
562
544
|
reportValidity: () => elm.reportValidity(),
|
|
563
545
|
};
|
|
564
546
|
}
|
|
565
|
-
},
|
|
547
|
+
}, [control._fields, name]),
|
|
566
548
|
},
|
|
567
549
|
formState,
|
|
568
550
|
fieldState: Object.defineProperties({}, {
|
|
@@ -578,6 +560,10 @@
|
|
|
578
560
|
enumerable: true,
|
|
579
561
|
get: () => !!get(formState.touchedFields, name),
|
|
580
562
|
},
|
|
563
|
+
isValidating: {
|
|
564
|
+
enumerable: true,
|
|
565
|
+
get: () => !!get(formState.validatingFields, name),
|
|
566
|
+
},
|
|
581
567
|
error: {
|
|
582
568
|
enumerable: true,
|
|
583
569
|
get: () => get(formState.errors, name),
|
|
@@ -610,31 +596,27 @@
|
|
|
610
596
|
});
|
|
611
597
|
|
|
612
598
|
var _excluded = ["ref"];
|
|
613
|
-
|
|
614
599
|
var _templateObject$5, _templateObject2;
|
|
615
600
|
var OptionsRow = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n"])));
|
|
616
601
|
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
|
-
|
|
618
602
|
var CommunicationPreferenceOptionsRenderer = function CommunicationPreferenceOptionsRenderer(_ref) {
|
|
619
603
|
var control = _ref.control,
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
604
|
+
name = _ref.name,
|
|
605
|
+
isDisabled = _ref.isDisabled,
|
|
606
|
+
options = _ref.options,
|
|
607
|
+
defaultValue = _ref.defaultValue,
|
|
608
|
+
setValue = _ref.setValue;
|
|
626
609
|
var _useController = useController({
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
610
|
+
name: name,
|
|
611
|
+
control: control,
|
|
612
|
+
defaultValue: defaultValue
|
|
613
|
+
}),
|
|
614
|
+
_useController$field = _useController.field,
|
|
615
|
+
ref = _useController$field.ref,
|
|
616
|
+
inputProps = _objectWithoutProperties(_useController$field, _excluded),
|
|
617
|
+
_useController$fieldS = _useController.fieldState,
|
|
618
|
+
invalid = _useController$fieldS.invalid,
|
|
619
|
+
error = _useController$fieldS.error;
|
|
638
620
|
React.useEffect(function () {
|
|
639
621
|
if (defaultValue) {
|
|
640
622
|
setValue(name, defaultValue);
|
|
@@ -664,16 +646,15 @@
|
|
|
664
646
|
return props.theme.colors.primary;
|
|
665
647
|
});
|
|
666
648
|
var SectionHeading = styled__default.div(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding: 5px 10px;\n"])));
|
|
667
|
-
|
|
668
649
|
var CommunicationPreferenceSection = function CommunicationPreferenceSection(_ref) {
|
|
669
650
|
var section_heading = _ref.section_heading,
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
651
|
+
description = _ref.description,
|
|
652
|
+
control = _ref.control,
|
|
653
|
+
name = _ref.name,
|
|
654
|
+
isDisabled = _ref.isDisabled,
|
|
655
|
+
options = _ref.options,
|
|
656
|
+
defaultValue = _ref.defaultValue,
|
|
657
|
+
setValue = _ref.setValue;
|
|
677
658
|
return /*#__PURE__*/React__default.createElement(SectionContainer, null, /*#__PURE__*/React__default.createElement(SectionHeading, null, section_heading), /*#__PURE__*/React__default.createElement(CommunicationPreferenceOptionsRenderer, {
|
|
678
659
|
description: description,
|
|
679
660
|
control: control,
|
|
@@ -684,7 +665,6 @@
|
|
|
684
665
|
setValue: setValue
|
|
685
666
|
}));
|
|
686
667
|
};
|
|
687
|
-
|
|
688
668
|
var index = themed(CommunicationPreferenceSection);
|
|
689
669
|
|
|
690
670
|
return index;
|