@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
|
styled = styled && Object.prototype.hasOwnProperty.call(styled, 'default') ? 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);
|
|
16
|
+
return n;
|
|
17
|
+
}, _extends.apply(null, arguments);
|
|
25
18
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _objectWithoutProperties(source, excluded) {
|
|
43
|
-
if (source == null) return {};
|
|
44
|
-
|
|
45
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
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
|
}
|
|
@@ -136,18 +108,50 @@
|
|
|
136
108
|
|
|
137
109
|
var isUndefined = (val) => val === undefined;
|
|
138
110
|
|
|
139
|
-
var get = (
|
|
140
|
-
if (!path || !isObject(
|
|
111
|
+
var get = (object, path, defaultValue) => {
|
|
112
|
+
if (!path || !isObject(object)) {
|
|
141
113
|
return defaultValue;
|
|
142
114
|
}
|
|
143
|
-
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key],
|
|
144
|
-
return isUndefined(result) || result ===
|
|
145
|
-
? isUndefined(
|
|
115
|
+
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
|
|
116
|
+
return isUndefined(result) || result === object
|
|
117
|
+
? isUndefined(object[path])
|
|
146
118
|
? defaultValue
|
|
147
|
-
:
|
|
119
|
+
: object[path]
|
|
148
120
|
: result;
|
|
149
121
|
};
|
|
150
122
|
|
|
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
|
+
|
|
151
155
|
const EVENTS = {
|
|
152
156
|
BLUR: 'blur',
|
|
153
157
|
FOCUS_OUT: 'focusout',
|
|
@@ -226,15 +230,13 @@
|
|
|
226
230
|
|
|
227
231
|
var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
|
|
228
232
|
|
|
229
|
-
var shouldSubscribeByName = (name, signalName, exact) =>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
convertToArrayPayload(name).some((currentName) => currentName &&
|
|
237
|
-
(currentName.startsWith(signalName) ||
|
|
233
|
+
var shouldSubscribeByName = (name, signalName, exact) => !name ||
|
|
234
|
+
!signalName ||
|
|
235
|
+
name === signalName ||
|
|
236
|
+
convertToArrayPayload(name).some((currentName) => currentName &&
|
|
237
|
+
(exact
|
|
238
|
+
? currentName === signalName
|
|
239
|
+
: currentName.startsWith(signalName) ||
|
|
238
240
|
signalName.startsWith(currentName)));
|
|
239
241
|
|
|
240
242
|
function useSubscribe(props) {
|
|
@@ -292,6 +294,7 @@
|
|
|
292
294
|
isLoading: false,
|
|
293
295
|
dirtyFields: false,
|
|
294
296
|
touchedFields: false,
|
|
297
|
+
validatingFields: false,
|
|
295
298
|
isValidating: false,
|
|
296
299
|
isValid: false,
|
|
297
300
|
errors: false,
|
|
@@ -342,7 +345,7 @@
|
|
|
342
345
|
*
|
|
343
346
|
* @example
|
|
344
347
|
* ```tsx
|
|
345
|
-
* const {
|
|
348
|
+
* const { control } = useForm();
|
|
346
349
|
* const values = useWatch({
|
|
347
350
|
* name: "fieldName"
|
|
348
351
|
* control,
|
|
@@ -368,33 +371,6 @@
|
|
|
368
371
|
return value;
|
|
369
372
|
}
|
|
370
373
|
|
|
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
|
-
|
|
398
374
|
/**
|
|
399
375
|
* 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.
|
|
400
376
|
*
|
|
@@ -432,17 +408,18 @@
|
|
|
432
408
|
const formState = useFormState({
|
|
433
409
|
control,
|
|
434
410
|
name,
|
|
411
|
+
exact: true,
|
|
435
412
|
});
|
|
436
413
|
const _registerProps = React__default.useRef(control.register(name, {
|
|
437
414
|
...props.rules,
|
|
438
415
|
value,
|
|
416
|
+
...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
|
|
439
417
|
}));
|
|
440
|
-
_registerProps.current = control.register(name, props.rules);
|
|
441
418
|
React__default.useEffect(() => {
|
|
442
419
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
443
420
|
const updateMounted = (name, value) => {
|
|
444
421
|
const field = get(control._fields, name);
|
|
445
|
-
if (field) {
|
|
422
|
+
if (field && field._f) {
|
|
446
423
|
field._f.mount = value;
|
|
447
424
|
}
|
|
448
425
|
};
|
|
@@ -463,17 +440,22 @@
|
|
|
463
440
|
};
|
|
464
441
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
465
442
|
React__default.useEffect(() => {
|
|
466
|
-
control.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
443
|
+
if (get(control._fields, name)) {
|
|
444
|
+
control._updateDisabledField({
|
|
445
|
+
disabled,
|
|
446
|
+
fields: control._fields,
|
|
447
|
+
name,
|
|
448
|
+
value: get(control._fields, name)._f.value,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
471
451
|
}, [disabled, name, control]);
|
|
472
452
|
return {
|
|
473
453
|
field: {
|
|
474
454
|
name,
|
|
475
455
|
value,
|
|
476
|
-
disabled
|
|
456
|
+
...(isBoolean(disabled) || formState.disabled
|
|
457
|
+
? { disabled: formState.disabled || disabled }
|
|
458
|
+
: {}),
|
|
477
459
|
onChange: React__default.useCallback((event) => _registerProps.current.onChange({
|
|
478
460
|
target: {
|
|
479
461
|
value: getEventValue(event),
|
|
@@ -488,7 +470,7 @@
|
|
|
488
470
|
},
|
|
489
471
|
type: EVENTS.BLUR,
|
|
490
472
|
}), [name, control]),
|
|
491
|
-
ref: (elm) => {
|
|
473
|
+
ref: React__default.useCallback((elm) => {
|
|
492
474
|
const field = get(control._fields, name);
|
|
493
475
|
if (field && elm) {
|
|
494
476
|
field._f.ref = {
|
|
@@ -498,7 +480,7 @@
|
|
|
498
480
|
reportValidity: () => elm.reportValidity(),
|
|
499
481
|
};
|
|
500
482
|
}
|
|
501
|
-
},
|
|
483
|
+
}, [control._fields, name]),
|
|
502
484
|
},
|
|
503
485
|
formState,
|
|
504
486
|
fieldState: Object.defineProperties({}, {
|
|
@@ -514,6 +496,10 @@
|
|
|
514
496
|
enumerable: true,
|
|
515
497
|
get: () => !!get(formState.touchedFields, name),
|
|
516
498
|
},
|
|
499
|
+
isValidating: {
|
|
500
|
+
enumerable: true,
|
|
501
|
+
get: () => !!get(formState.validatingFields, name),
|
|
502
|
+
},
|
|
517
503
|
error: {
|
|
518
504
|
enumerable: true,
|
|
519
505
|
get: () => get(formState.errors, name),
|
|
@@ -546,31 +532,27 @@
|
|
|
546
532
|
});
|
|
547
533
|
|
|
548
534
|
var _excluded = ["ref"];
|
|
549
|
-
|
|
550
535
|
var _templateObject$5, _templateObject2;
|
|
551
536
|
var OptionsRow = styled.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n"])));
|
|
552
537
|
var Options = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n flex-basis: 60%;\n"])));
|
|
553
|
-
|
|
554
538
|
var CommunicationPreferenceOptionsRenderer = function CommunicationPreferenceOptionsRenderer(_ref) {
|
|
555
539
|
var control = _ref.control,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
540
|
+
name = _ref.name,
|
|
541
|
+
isDisabled = _ref.isDisabled,
|
|
542
|
+
options = _ref.options,
|
|
543
|
+
defaultValue = _ref.defaultValue,
|
|
544
|
+
setValue = _ref.setValue;
|
|
562
545
|
var _useController = useController({
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
546
|
+
name: name,
|
|
547
|
+
control: control,
|
|
548
|
+
defaultValue: defaultValue
|
|
549
|
+
}),
|
|
550
|
+
_useController$field = _useController.field,
|
|
551
|
+
ref = _useController$field.ref,
|
|
552
|
+
inputProps = _objectWithoutProperties(_useController$field, _excluded),
|
|
553
|
+
_useController$fieldS = _useController.fieldState,
|
|
554
|
+
invalid = _useController$fieldS.invalid,
|
|
555
|
+
error = _useController$fieldS.error;
|
|
574
556
|
React.useEffect(function () {
|
|
575
557
|
if (defaultValue) {
|
|
576
558
|
setValue(name, defaultValue);
|