@thecb/components 3.5.5-beta.0 → 3.5.7
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/dist/index.cjs.js +648 -408
- package/package.json +1 -1
- package/src/components/atoms/form-layouts/FormInput.js +1 -0
- package/src/components/atoms/layouts/Cover.styled.js +0 -1
- package/src/components/atoms/layouts/Imposter.styled.js +0 -1
- package/src/components/atoms/loading/Loading.js +5 -2
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +11 -3
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +1 -1
- package/src/components/molecules/payment-form-ach/PaymentFormACH.state.js +1 -1
- package/src/components/molecules/payment-form-ach/PaymentFormACH.stories.js +24 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.stories.js +24 -0
- package/src/components/molecules/content/Content.js +0 -20
- package/src/components/molecules/content/Content.theme.js +0 -60
- package/src/components/molecules/content/blocks/accordion-block/AccordionBlock.js +0 -108
- package/src/components/molecules/content/blocks/accordion-block/index.js +0 -3
- package/src/components/molecules/content/blocks/article-block/ArticleBlock.js +0 -58
- package/src/components/molecules/content/blocks/article-block/index.js +0 -3
- package/src/components/molecules/content/blocks/attached-file-block/AttachedFileBlock.js +0 -60
- package/src/components/molecules/content/blocks/attached-file-block/index.js +0 -3
- package/src/components/molecules/content/blocks/featured-content-block/FeaturedContentBlock.js +0 -0
- package/src/components/molecules/content/blocks/featured-content-block/index.js +0 -0
- package/src/components/molecules/content/blocks/hero-block/HeroBlock.js +0 -54
- package/src/components/molecules/content/blocks/hero-block/index.js +0 -3
- package/src/components/molecules/content/blocks/highlight-block/HighlightBlock.js +0 -42
- package/src/components/molecules/content/blocks/highlight-block/index.js +0 -3
- package/src/components/molecules/content/blocks/index.js +0 -33
- package/src/components/molecules/content/blocks/info-block/InfoBlock.js +0 -15
- package/src/components/molecules/content/blocks/info-block/index.js +0 -3
- package/src/components/molecules/content/blocks/location-block/LocationBlock.js +0 -228
- package/src/components/molecules/content/blocks/location-block/index.js +0 -3
- package/src/components/molecules/content/blocks/related-links-block/RelatedLinksBlock.js +0 -35
- package/src/components/molecules/content/blocks/related-links-block/index.js +0 -3
- package/src/components/molecules/content/blocks/screendoor-block/ScreendoorBlock.js +0 -57
- package/src/components/molecules/content/blocks/screendoor-block/ScreendoorForm.styled.js +0 -314
- package/src/components/molecules/content/blocks/screendoor-block/index.js +0 -3
- package/src/components/molecules/content/blocks/tagline-block/TaglineBlock.js +0 -45
- package/src/components/molecules/content/blocks/tagline-block/index.js +0 -3
- package/src/components/molecules/content/blocks/task-block/TaskBlock.js +0 -40
- package/src/components/molecules/content/blocks/task-block/index.js +0 -3
- package/src/components/molecules/content/blocks/text-block/TextBlock.js +0 -40
- package/src/components/molecules/content/blocks/text-block/index.js +0 -3
- package/src/components/molecules/content/header/Header.js +0 -283
- package/src/components/molecules/content/header/Header.theme.js +0 -11
- package/src/components/molecules/content/header/index.js +0 -3
- package/src/components/molecules/content/index.js +0 -3
package/dist/index.cjs.js
CHANGED
|
@@ -215,6 +215,63 @@ function _nonIterableRest() {
|
|
|
215
215
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
219
|
+
var it;
|
|
220
|
+
|
|
221
|
+
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
222
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
223
|
+
if (it) o = it;
|
|
224
|
+
var i = 0;
|
|
225
|
+
|
|
226
|
+
var F = function () {};
|
|
227
|
+
|
|
228
|
+
return {
|
|
229
|
+
s: F,
|
|
230
|
+
n: function () {
|
|
231
|
+
if (i >= o.length) return {
|
|
232
|
+
done: true
|
|
233
|
+
};
|
|
234
|
+
return {
|
|
235
|
+
done: false,
|
|
236
|
+
value: o[i++]
|
|
237
|
+
};
|
|
238
|
+
},
|
|
239
|
+
e: function (e) {
|
|
240
|
+
throw e;
|
|
241
|
+
},
|
|
242
|
+
f: F
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
var normalCompletion = true,
|
|
250
|
+
didErr = false,
|
|
251
|
+
err;
|
|
252
|
+
return {
|
|
253
|
+
s: function () {
|
|
254
|
+
it = o[Symbol.iterator]();
|
|
255
|
+
},
|
|
256
|
+
n: function () {
|
|
257
|
+
var step = it.next();
|
|
258
|
+
normalCompletion = step.done;
|
|
259
|
+
return step;
|
|
260
|
+
},
|
|
261
|
+
e: function (e) {
|
|
262
|
+
didErr = true;
|
|
263
|
+
err = e;
|
|
264
|
+
},
|
|
265
|
+
f: function () {
|
|
266
|
+
try {
|
|
267
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
268
|
+
} finally {
|
|
269
|
+
if (didErr) throw err;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
218
275
|
/*! *****************************************************************************
|
|
219
276
|
Copyright (c) Microsoft Corporation.
|
|
220
277
|
|
|
@@ -6730,7 +6787,7 @@ var Stack = function Stack(_ref) {
|
|
|
6730
6787
|
};
|
|
6731
6788
|
|
|
6732
6789
|
function _templateObject$7() {
|
|
6733
|
-
var data = _taggedTemplateLiteral(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n min-height: ", ";\n padding: ", ";\n
|
|
6790
|
+
var data = _taggedTemplateLiteral(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n min-height: ", ";\n padding: ", ";\n\n > * {\n margin-top: ", ";\n margin-bottom: ", ";\n }\n\n > :first-child {\n margin-top: 0;\n }\n\n ", "\n\n ", "\n\n > :last-child {\n margin-bottom: 0;\n }\n"]);
|
|
6734
6791
|
|
|
6735
6792
|
_templateObject$7 = function _templateObject() {
|
|
6736
6793
|
return data;
|
|
@@ -6745,19 +6802,16 @@ var CoverOuterContainer = styled__default.div(_templateObject$7(), function (_re
|
|
|
6745
6802
|
var padding = _ref2.padding;
|
|
6746
6803
|
return padding;
|
|
6747
6804
|
}, function (_ref3) {
|
|
6748
|
-
var
|
|
6749
|
-
return
|
|
6805
|
+
var childGap = _ref3.childGap;
|
|
6806
|
+
return childGap;
|
|
6750
6807
|
}, function (_ref4) {
|
|
6751
6808
|
var childGap = _ref4.childGap;
|
|
6752
6809
|
return childGap;
|
|
6753
6810
|
}, function (_ref5) {
|
|
6754
|
-
var
|
|
6755
|
-
return childGap;
|
|
6756
|
-
}, function (_ref6) {
|
|
6757
|
-
var fillCenter = _ref6.fillCenter;
|
|
6811
|
+
var fillCenter = _ref5.fillCenter;
|
|
6758
6812
|
return fillCenter ? "> :nth-child(2) {flex-grow: 1;}" : "";
|
|
6759
|
-
}, function (
|
|
6760
|
-
var centerOverride =
|
|
6813
|
+
}, function (_ref6) {
|
|
6814
|
+
var centerOverride = _ref6.centerOverride;
|
|
6761
6815
|
return centerOverride ? "> :nth-child(2) {margin-top: 0; margin-bottom: auto;}" : "> :nth-child(2) {margin-top: auto; margin-bottom: auto;}";
|
|
6762
6816
|
});
|
|
6763
6817
|
|
|
@@ -6955,7 +7009,7 @@ var Switcher = function Switcher(_ref) {
|
|
|
6955
7009
|
};
|
|
6956
7010
|
|
|
6957
7011
|
function _templateObject$a() {
|
|
6958
|
-
var data = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n left: ", ";\n display: ", ";\n\n ", "\n\n ", "\n
|
|
7012
|
+
var data = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n left: ", ";\n display: ", ";\n\n ", "\n\n ", "\n"]);
|
|
6959
7013
|
|
|
6960
7014
|
_templateObject$a = function _templateObject() {
|
|
6961
7015
|
return data;
|
|
@@ -6983,9 +7037,6 @@ var ImposterWrapper = styled__default.div(_templateObject$a(), function (_ref) {
|
|
|
6983
7037
|
verticalMargin = _ref6.verticalMargin,
|
|
6984
7038
|
horizontalMargin = _ref6.horizontalMargin;
|
|
6985
7039
|
return breakout ? "" : "\n overflow: auto;\n max-width: calc(100% - (".concat(horizontalMargin, " * 2));\n max-height: calc(100% - (").concat(verticalMargin, " * 2));\n ");
|
|
6986
|
-
}, function (_ref7) {
|
|
6987
|
-
var extraStyles = _ref7.extraStyles;
|
|
6988
|
-
return extraStyles;
|
|
6989
7040
|
});
|
|
6990
7041
|
|
|
6991
7042
|
/*
|
|
@@ -18562,6 +18613,7 @@ var FormInput = function FormInput(_ref9) {
|
|
|
18562
18613
|
color: themeValues.linkColor,
|
|
18563
18614
|
weight: themeValues.fontWeight,
|
|
18564
18615
|
hoverStyles: themeValues.hoverFocusStyles,
|
|
18616
|
+
focusStyles: themeValues.hoverFocusStyles,
|
|
18565
18617
|
extraStyles: "cursor: pointer;",
|
|
18566
18618
|
onClick: function onClick() {
|
|
18567
18619
|
return setShowPassword(!showPassword);
|
|
@@ -19074,9 +19126,10 @@ var Spinner$2 = themeComponent(Spinner$1, "Spinner", fallbackValues$j);
|
|
|
19074
19126
|
|
|
19075
19127
|
var Loading = function Loading() {
|
|
19076
19128
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
19077
|
-
key: "spinner-container"
|
|
19129
|
+
key: "spinner-container",
|
|
19130
|
+
extraStyles: "position: fixed; top: 0; bottom: 0; left: 0; right: 0;"
|
|
19078
19131
|
}, /*#__PURE__*/React__default.createElement(Cover, {
|
|
19079
|
-
minHeight: "
|
|
19132
|
+
minHeight: "100%",
|
|
19080
19133
|
singleChild: true
|
|
19081
19134
|
}, /*#__PURE__*/React__default.createElement(Center, {
|
|
19082
19135
|
intrinsic: true
|
|
@@ -30520,378 +30573,401 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
30520
30573
|
|
|
30521
30574
|
var ToggleSwitch$1 = themeComponent(ToggleSwitch, "ToggleSwitch", fallbackValues$o);
|
|
30522
30575
|
|
|
30523
|
-
|
|
30524
|
-
value
|
|
30525
|
-
|
|
30526
|
-
|
|
30576
|
+
var validatorToPredicate = function validatorToPredicate(validatorFn, emptyCase) {
|
|
30577
|
+
return function (value) {
|
|
30578
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
30579
|
+
rest[_key - 1] = arguments[_key];
|
|
30580
|
+
}
|
|
30527
30581
|
|
|
30582
|
+
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
30583
|
+
};
|
|
30584
|
+
};
|
|
30528
30585
|
/* eslint-disable no-unused-vars */
|
|
30529
30586
|
|
|
30530
|
-
|
|
30531
|
-
|
|
30587
|
+
|
|
30588
|
+
var createValidator = function createValidator(type, error) {
|
|
30589
|
+
var validator = function validator() {
|
|
30590
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
30591
|
+
args[_key2] = arguments[_key2];
|
|
30592
|
+
}
|
|
30593
|
+
|
|
30594
|
+
return {
|
|
30595
|
+
type: type,
|
|
30596
|
+
args: args,
|
|
30597
|
+
error: error
|
|
30598
|
+
};
|
|
30599
|
+
};
|
|
30600
|
+
|
|
30532
30601
|
validator.error = error;
|
|
30533
30602
|
return validator;
|
|
30534
30603
|
};
|
|
30535
30604
|
|
|
30536
|
-
|
|
30605
|
+
var validatorFns = {};
|
|
30606
|
+
var REQUIRED = "validator/REQUIRED";
|
|
30607
|
+
var REQUIRED_ERROR = "error/REQUIRED";
|
|
30608
|
+
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
30537
30609
|
|
|
30538
|
-
|
|
30539
|
-
|
|
30540
|
-
|
|
30541
|
-
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
30610
|
+
validatorFns[REQUIRED] = function (value, args, form) {
|
|
30611
|
+
return value !== "";
|
|
30612
|
+
};
|
|
30542
30613
|
|
|
30543
|
-
|
|
30544
|
-
|
|
30545
|
-
|
|
30546
|
-
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
30614
|
+
var ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
30615
|
+
var ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
30616
|
+
var onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
30547
30617
|
|
|
30548
|
-
|
|
30549
|
-
|
|
30550
|
-
|
|
30551
|
-
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
30618
|
+
validatorFns[ONLY_INTEGERS] = function (value, args, form) {
|
|
30619
|
+
return /^(-?\d+)?$/.test(value);
|
|
30620
|
+
};
|
|
30552
30621
|
|
|
30553
|
-
|
|
30554
|
-
|
|
30555
|
-
|
|
30556
|
-
|
|
30557
|
-
|
|
30558
|
-
);
|
|
30559
|
-
|
|
30622
|
+
var ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
30623
|
+
var ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
30624
|
+
var onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
30625
|
+
|
|
30626
|
+
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
30627
|
+
return /^(\d+)?$/.test(value);
|
|
30628
|
+
};
|
|
30629
|
+
|
|
30630
|
+
var NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
30631
|
+
var NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
30632
|
+
var numberLessThan = createValidator(NUMBER_LESS_THAN, NUMBER_LESS_THAN_ERROR);
|
|
30633
|
+
|
|
30634
|
+
validatorFns[NUMBER_LESS_THAN] = function (value, args, form) {
|
|
30560
30635
|
if (value === "") {
|
|
30561
30636
|
return true;
|
|
30562
30637
|
}
|
|
30638
|
+
|
|
30563
30639
|
return Number(value) < args[0];
|
|
30564
30640
|
};
|
|
30565
30641
|
|
|
30566
|
-
|
|
30567
|
-
|
|
30568
|
-
|
|
30569
|
-
|
|
30570
|
-
|
|
30571
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
30572
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
30573
|
-
);
|
|
30574
|
-
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
30642
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO = "validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
30643
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
30644
|
+
var numberLessThanOrEqualTo = createValidator(NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR);
|
|
30645
|
+
|
|
30646
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
30575
30647
|
if (value === "") {
|
|
30576
30648
|
return true;
|
|
30577
30649
|
}
|
|
30650
|
+
|
|
30578
30651
|
return Number(value) <= args[0];
|
|
30579
30652
|
};
|
|
30580
30653
|
|
|
30581
|
-
|
|
30582
|
-
|
|
30583
|
-
|
|
30584
|
-
|
|
30585
|
-
|
|
30586
|
-
);
|
|
30587
|
-
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
30654
|
+
var NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
30655
|
+
var NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
30656
|
+
var numberGreaterThan = createValidator(NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_ERROR);
|
|
30657
|
+
|
|
30658
|
+
validatorFns[NUMBER_GREATER_THAN] = function (value, args, form) {
|
|
30588
30659
|
if (value === "") {
|
|
30589
30660
|
return true;
|
|
30590
30661
|
}
|
|
30662
|
+
|
|
30591
30663
|
return Number(value) > args[0];
|
|
30592
30664
|
};
|
|
30593
30665
|
|
|
30594
|
-
|
|
30595
|
-
|
|
30596
|
-
|
|
30597
|
-
|
|
30598
|
-
|
|
30599
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
30600
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
30601
|
-
);
|
|
30602
|
-
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
30666
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO = "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
30667
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
30668
|
+
var numberGreaterThanOrEqualTo = createValidator(NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR);
|
|
30669
|
+
|
|
30670
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
30603
30671
|
if (value === "") {
|
|
30604
30672
|
return true;
|
|
30605
30673
|
}
|
|
30674
|
+
|
|
30606
30675
|
return Number(value) >= args[0];
|
|
30607
30676
|
};
|
|
30608
30677
|
|
|
30609
|
-
|
|
30610
|
-
|
|
30611
|
-
|
|
30612
|
-
|
|
30678
|
+
var MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
30679
|
+
var MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
30680
|
+
var matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
30681
|
+
|
|
30682
|
+
validatorFns[MATCHES_FIELD] = function (value, args, form) {
|
|
30613
30683
|
if (value === "") {
|
|
30614
30684
|
return true;
|
|
30615
30685
|
}
|
|
30686
|
+
|
|
30616
30687
|
if (form[args[0]] === undefined) {
|
|
30617
|
-
throw new Error(
|
|
30618
|
-
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
30619
|
-
);
|
|
30688
|
+
throw new Error("".concat(args[0], " was passed to matchesField, but that field does not exist in the form"));
|
|
30620
30689
|
}
|
|
30690
|
+
|
|
30621
30691
|
return value === form[args[0]].rawValue;
|
|
30622
30692
|
};
|
|
30623
30693
|
|
|
30624
|
-
|
|
30625
|
-
|
|
30626
|
-
|
|
30627
|
-
|
|
30628
|
-
|
|
30629
|
-
|
|
30630
|
-
|
|
30631
|
-
|
|
30632
|
-
|
|
30633
|
-
|
|
30634
|
-
|
|
30635
|
-
|
|
30636
|
-
|
|
30637
|
-
|
|
30638
|
-
|
|
30639
|
-
type: VALIDATE_WHEN,
|
|
30640
|
-
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
30641
|
-
error: dependentValidator.error
|
|
30642
|
-
});
|
|
30694
|
+
var validateWhenErrorMessage = function validateWhenErrorMessage(type) {
|
|
30695
|
+
return "".concat(type, " was passed to validateWhen, but that validator type does not exist.\n Please check that you are only calling validator creator functions exported from\n redux-freeform in your form config and that you didn't forget to\n invoke the validator creator (you cannot pass the functions themselves to\n createFormState). Also make sure you aren't passing validateWhen() to validateWhen\n as the primary validator.");
|
|
30696
|
+
};
|
|
30697
|
+
|
|
30698
|
+
var VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
30699
|
+
var VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
30700
|
+
|
|
30701
|
+
var validateWhen = function validateWhen(dependentValidator, primaryValidator, optionalFieldName) {
|
|
30702
|
+
return {
|
|
30703
|
+
type: VALIDATE_WHEN,
|
|
30704
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
30705
|
+
error: dependentValidator.error
|
|
30706
|
+
};
|
|
30707
|
+
};
|
|
30708
|
+
|
|
30643
30709
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
30644
|
-
validatorFns[VALIDATE_WHEN] = (value, args, form) => {
|
|
30645
|
-
const [dependentValidator, primaryValidator, optionalFieldName] = args;
|
|
30646
|
-
const dependsOnOtherField = typeof optionalFieldName === "string";
|
|
30647
30710
|
|
|
30648
|
-
|
|
30649
|
-
|
|
30650
|
-
|
|
30651
|
-
|
|
30711
|
+
validatorFns[VALIDATE_WHEN] = function (value, args, form) {
|
|
30712
|
+
var _args = _slicedToArray(args, 3),
|
|
30713
|
+
dependentValidator = _args[0],
|
|
30714
|
+
primaryValidator = _args[1],
|
|
30715
|
+
optionalFieldName = _args[2];
|
|
30716
|
+
|
|
30717
|
+
var dependsOnOtherField = typeof optionalFieldName === "string";
|
|
30718
|
+
|
|
30719
|
+
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
30652
30720
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
30653
30721
|
}
|
|
30722
|
+
|
|
30654
30723
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
30655
|
-
throw new Error(
|
|
30656
|
-
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
30657
|
-
);
|
|
30724
|
+
throw new Error("".concat(args[2], " was passed to matchesField, but that field does not exist in the form"));
|
|
30658
30725
|
}
|
|
30659
30726
|
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
);
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
|
|
30669
|
-
|
|
30670
|
-
|
|
30671
|
-
|
|
30727
|
+
var primaryPredicate = validatorToPredicate(validatorFns[primaryValidator.type], false);
|
|
30728
|
+
var primaryValue = dependsOnOtherField ? form[optionalFieldName].rawValue : value;
|
|
30729
|
+
var primaryPredicatePassed = primaryPredicate(primaryValue, primaryValidator.args, form);
|
|
30730
|
+
return primaryPredicatePassed ? validatorFns[dependentValidator.type](value, dependentValidator.args, form) : true;
|
|
30731
|
+
};
|
|
30732
|
+
|
|
30733
|
+
var validateSumErrorMessage = function validateSumErrorMessage(type) {
|
|
30734
|
+
return "".concat(type, " was passed to validateSum, but that validator type does not exist.\n Please check that you are only calling validator creator functions exported from\n redux-freeform in your form config and that you didn't forget to\n invoke the validator creator (you cannot pass the functions themselves to\n createFormState).");
|
|
30735
|
+
};
|
|
30736
|
+
|
|
30737
|
+
var VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
30738
|
+
var VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
30739
|
+
|
|
30740
|
+
var validateSum = function validateSum(validator, fieldNamesArray) {
|
|
30741
|
+
return {
|
|
30742
|
+
type: VALIDATE_SUM,
|
|
30743
|
+
args: [validator, fieldNamesArray],
|
|
30744
|
+
error: validator.error
|
|
30745
|
+
};
|
|
30746
|
+
};
|
|
30672
30747
|
|
|
30673
|
-
return primaryPredicatePassed
|
|
30674
|
-
? validatorFns[dependentValidator.type](
|
|
30675
|
-
value,
|
|
30676
|
-
dependentValidator.args,
|
|
30677
|
-
form
|
|
30678
|
-
)
|
|
30679
|
-
: true;
|
|
30680
|
-
};
|
|
30681
|
-
|
|
30682
|
-
const validateSumErrorMessage = type =>
|
|
30683
|
-
`${type} was passed to validateSum, but that validator type does not exist.
|
|
30684
|
-
Please check that you are only calling validator creator functions exported from
|
|
30685
|
-
redux-freeform in your form config and that you didn't forget to
|
|
30686
|
-
invoke the validator creator (you cannot pass the functions themselves to
|
|
30687
|
-
createFormState).`;
|
|
30688
|
-
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
30689
|
-
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
30690
|
-
const validateSum = (validator, fieldNamesArray) => ({
|
|
30691
|
-
type: VALIDATE_SUM,
|
|
30692
|
-
args: [validator, fieldNamesArray],
|
|
30693
|
-
error: validator.error
|
|
30694
|
-
});
|
|
30695
30748
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
30696
|
-
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
30697
|
-
const [validator, fieldNamesArray] = args;
|
|
30698
30749
|
|
|
30699
|
-
|
|
30700
|
-
|
|
30701
|
-
|
|
30702
|
-
|
|
30750
|
+
validatorFns[VALIDATE_SUM] = function (value, args, form) {
|
|
30751
|
+
var _args2 = _slicedToArray(args, 2),
|
|
30752
|
+
validator = _args2[0],
|
|
30753
|
+
fieldNamesArray = _args2[1];
|
|
30754
|
+
|
|
30755
|
+
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
30703
30756
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
30704
30757
|
}
|
|
30705
30758
|
|
|
30706
|
-
|
|
30707
|
-
|
|
30708
|
-
|
|
30709
|
-
|
|
30710
|
-
|
|
30759
|
+
var _iterator = _createForOfIteratorHelper(fieldNamesArray),
|
|
30760
|
+
_step;
|
|
30761
|
+
|
|
30762
|
+
try {
|
|
30763
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
30764
|
+
var fieldName = _step.value;
|
|
30765
|
+
|
|
30766
|
+
if (form[fieldName] === undefined) {
|
|
30767
|
+
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
30768
|
+
}
|
|
30711
30769
|
}
|
|
30770
|
+
} catch (err) {
|
|
30771
|
+
_iterator.e(err);
|
|
30772
|
+
} finally {
|
|
30773
|
+
_iterator.f();
|
|
30712
30774
|
}
|
|
30713
30775
|
|
|
30714
|
-
|
|
30715
|
-
|
|
30716
|
-
|
|
30717
|
-
);
|
|
30718
|
-
|
|
30776
|
+
var sum = fieldNamesArray.reduce(function (acc, curr) {
|
|
30777
|
+
return acc + Number(form[curr].rawValue);
|
|
30778
|
+
}, Number(value));
|
|
30719
30779
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
30720
30780
|
};
|
|
30721
30781
|
|
|
30722
|
-
|
|
30723
|
-
|
|
30724
|
-
|
|
30725
|
-
|
|
30782
|
+
var HAS_LENGTH = "validator/HAS_LENGTH";
|
|
30783
|
+
var HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
30784
|
+
var hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
30785
|
+
|
|
30786
|
+
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
30726
30787
|
if (value === "") {
|
|
30727
30788
|
return true;
|
|
30728
30789
|
}
|
|
30729
|
-
|
|
30730
|
-
|
|
30790
|
+
|
|
30791
|
+
var min = args[0];
|
|
30792
|
+
var max = args[1];
|
|
30793
|
+
|
|
30731
30794
|
if (max == undefined || min == undefined) {
|
|
30732
|
-
throw new Error(
|
|
30733
|
-
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
30734
|
-
);
|
|
30795
|
+
throw new Error("Max and min need to be defined for hasLength, both or one of them is undefined");
|
|
30735
30796
|
}
|
|
30797
|
+
|
|
30736
30798
|
if (max < min) {
|
|
30737
|
-
throw new Error(
|
|
30738
|
-
"hasLength validator was passed a min greater than the max"
|
|
30739
|
-
);
|
|
30799
|
+
throw new Error("hasLength validator was passed a min greater than the max");
|
|
30740
30800
|
}
|
|
30741
|
-
|
|
30801
|
+
|
|
30802
|
+
var valueLength = value.length;
|
|
30742
30803
|
return max >= valueLength && valueLength >= min;
|
|
30743
30804
|
};
|
|
30744
30805
|
|
|
30745
|
-
|
|
30746
|
-
|
|
30747
|
-
|
|
30748
|
-
|
|
30806
|
+
var MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
30807
|
+
var MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
30808
|
+
var matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
30809
|
+
|
|
30810
|
+
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
30749
30811
|
if (value === "") {
|
|
30750
30812
|
return true;
|
|
30751
30813
|
}
|
|
30814
|
+
|
|
30752
30815
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
30753
|
-
};
|
|
30816
|
+
}; // based on http://www.brainjar.com/js/validation/
|
|
30754
30817
|
|
|
30755
|
-
|
|
30756
|
-
|
|
30757
|
-
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
);
|
|
30762
|
-
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
30818
|
+
|
|
30819
|
+
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
30820
|
+
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
30821
|
+
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
30822
|
+
|
|
30823
|
+
validatorFns[IS_ROUTING_NUMBER] = function (value, args, form) {
|
|
30763
30824
|
if (value === "") {
|
|
30764
30825
|
return true;
|
|
30765
30826
|
}
|
|
30827
|
+
|
|
30766
30828
|
if (value.length != 9) {
|
|
30767
30829
|
return false;
|
|
30768
30830
|
}
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
|
|
30774
|
-
|
|
30775
|
-
|
|
30776
|
-
|
|
30777
|
-
|
|
30778
|
-
|
|
30779
|
-
|
|
30780
|
-
|
|
30781
|
-
|
|
30831
|
+
|
|
30832
|
+
var sum = value.split("").map(function (ch) {
|
|
30833
|
+
return parseInt(ch);
|
|
30834
|
+
}).reduce(function (acc, cur, idx) {
|
|
30835
|
+
switch (idx % 3) {
|
|
30836
|
+
case 0:
|
|
30837
|
+
return acc + 3 * cur;
|
|
30838
|
+
|
|
30839
|
+
case 1:
|
|
30840
|
+
return acc + 7 * cur;
|
|
30841
|
+
|
|
30842
|
+
case 2:
|
|
30843
|
+
return acc + 1 * cur;
|
|
30844
|
+
}
|
|
30845
|
+
}, 0);
|
|
30782
30846
|
return sum != 0 && sum % 10 == 0;
|
|
30783
30847
|
};
|
|
30784
30848
|
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
|
|
30788
|
-
|
|
30849
|
+
var HAS_NUMBER = "validator/HAS_NUMBER";
|
|
30850
|
+
var HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
30851
|
+
var hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
30852
|
+
|
|
30853
|
+
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
30789
30854
|
if (value === "") {
|
|
30790
30855
|
return true;
|
|
30791
30856
|
}
|
|
30857
|
+
|
|
30792
30858
|
return new RegExp(/[0-9]/).test(value);
|
|
30793
30859
|
};
|
|
30794
30860
|
|
|
30795
|
-
|
|
30796
|
-
|
|
30797
|
-
|
|
30798
|
-
|
|
30799
|
-
|
|
30800
|
-
);
|
|
30801
|
-
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
30861
|
+
var HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
30862
|
+
var HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
30863
|
+
var hasLowercaseLetter = createValidator(HAS_LOWERCASE_LETTER, HAS_LOWERCASE_LETTER_ERROR$1);
|
|
30864
|
+
|
|
30865
|
+
validatorFns[HAS_LOWERCASE_LETTER] = function (value, args, form) {
|
|
30802
30866
|
if (value === "") {
|
|
30803
30867
|
return true;
|
|
30804
30868
|
}
|
|
30869
|
+
|
|
30805
30870
|
return new RegExp(/[a-z]/).test(value);
|
|
30806
30871
|
};
|
|
30807
30872
|
|
|
30808
|
-
|
|
30809
|
-
|
|
30810
|
-
|
|
30811
|
-
|
|
30812
|
-
|
|
30813
|
-
);
|
|
30814
|
-
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
30873
|
+
var HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
30874
|
+
var HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
30875
|
+
var hasUppercaseLetter = createValidator(HAS_UPPERCASE_LETTER, HAS_UPPERCASE_LETTER_ERROR$1);
|
|
30876
|
+
|
|
30877
|
+
validatorFns[HAS_UPPERCASE_LETTER] = function (value, args, form) {
|
|
30815
30878
|
if (value === "") {
|
|
30816
30879
|
return true;
|
|
30817
30880
|
}
|
|
30881
|
+
|
|
30818
30882
|
return new RegExp(/[A-Z]/).test(value);
|
|
30819
30883
|
};
|
|
30820
30884
|
|
|
30821
|
-
|
|
30822
|
-
|
|
30823
|
-
|
|
30824
|
-
|
|
30825
|
-
|
|
30826
|
-
);
|
|
30827
|
-
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
30885
|
+
var HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
30886
|
+
var HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
30887
|
+
var hasSpecialCharacter = createValidator(HAS_SPECIAL_CHARACTER, HAS_SPECIAL_CHARACTER_ERROR$1);
|
|
30888
|
+
|
|
30889
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = function (value, args, form) {
|
|
30828
30890
|
if (value === "") {
|
|
30829
30891
|
return true;
|
|
30830
30892
|
}
|
|
30893
|
+
|
|
30831
30894
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
30832
30895
|
};
|
|
30833
30896
|
|
|
30834
|
-
|
|
30835
|
-
|
|
30836
|
-
|
|
30837
|
-
|
|
30838
|
-
|
|
30839
|
-
);
|
|
30840
|
-
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
30897
|
+
var IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
30898
|
+
var IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
30899
|
+
var isProbablyEmail = createValidator(IS_PROBABLY_EMAIL, IS_PROBABLY_EMAIL_ERROR);
|
|
30900
|
+
|
|
30901
|
+
validatorFns[IS_PROBABLY_EMAIL] = function (value, args, form) {
|
|
30841
30902
|
if (value === "") {
|
|
30842
30903
|
return true;
|
|
30843
30904
|
}
|
|
30905
|
+
|
|
30844
30906
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
30845
30907
|
};
|
|
30846
30908
|
|
|
30847
|
-
|
|
30848
|
-
|
|
30849
|
-
|
|
30850
|
-
|
|
30851
|
-
|
|
30852
|
-
|
|
30909
|
+
var runValidatorErrorMessage = function runValidatorErrorMessage(type) {
|
|
30910
|
+
return "".concat(type, " was passed to runValidator, but that validator type does not exist. \n Please check that you are only calling validator creator functions exported from \n redux-freeform in your form config and that you didn't forget to \n invoke the validator creator (you cannot pass the functions themselves to \n createFormState)");
|
|
30911
|
+
};
|
|
30912
|
+
|
|
30913
|
+
var runValidator = function runValidator(validator, value, form) {
|
|
30914
|
+
var validatorFn = validatorFns[validator.type];
|
|
30853
30915
|
|
|
30854
|
-
const runValidator = (validator, value, form) => {
|
|
30855
|
-
const validatorFn = validatorFns[validator.type];
|
|
30856
30916
|
if (validatorFn === undefined) {
|
|
30857
30917
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
30858
30918
|
}
|
|
30919
|
+
|
|
30859
30920
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
30860
30921
|
};
|
|
30861
30922
|
|
|
30862
|
-
|
|
30863
|
-
return validators
|
|
30864
|
-
|
|
30865
|
-
|
|
30923
|
+
var _computeErrors = function _computeErrors(fieldName, form, validators) {
|
|
30924
|
+
return validators.map(function (v) {
|
|
30925
|
+
return runValidator(v, form[fieldName].rawValue, form);
|
|
30926
|
+
}).filter(function (x) {
|
|
30927
|
+
return x !== null;
|
|
30928
|
+
});
|
|
30866
30929
|
};
|
|
30867
30930
|
|
|
30868
|
-
|
|
30869
|
-
|
|
30931
|
+
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
30932
|
+
var constraints = form[fieldName].constraints;
|
|
30870
30933
|
return _computeErrors(fieldName, form, constraints);
|
|
30871
30934
|
};
|
|
30872
30935
|
|
|
30873
|
-
|
|
30874
|
-
|
|
30936
|
+
var computeErrors = function computeErrors(fieldName, form) {
|
|
30937
|
+
var validators = form[fieldName].validators;
|
|
30875
30938
|
return _computeErrors(fieldName, form, validators);
|
|
30876
30939
|
};
|
|
30877
30940
|
|
|
30878
30941
|
var obj;
|
|
30879
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (
|
|
30880
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
30881
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
30942
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
30943
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-draftable") : "__$immer_draftable";
|
|
30944
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-state") : "__$immer_state";
|
|
30945
|
+
|
|
30882
30946
|
function isDraft(value) {
|
|
30883
30947
|
return !!value && !!value[DRAFT_STATE];
|
|
30884
30948
|
}
|
|
30949
|
+
|
|
30885
30950
|
function isDraftable(value) {
|
|
30886
|
-
if (!value) {
|
|
30951
|
+
if (!value) {
|
|
30952
|
+
return false;
|
|
30953
|
+
}
|
|
30954
|
+
|
|
30887
30955
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
30888
30956
|
}
|
|
30957
|
+
|
|
30889
30958
|
function isPlainObject(value) {
|
|
30890
|
-
if (!value ||
|
|
30891
|
-
|
|
30959
|
+
if (!value || _typeof(value) !== "object") {
|
|
30960
|
+
return false;
|
|
30961
|
+
}
|
|
30962
|
+
|
|
30963
|
+
if (Array.isArray(value)) {
|
|
30964
|
+
return true;
|
|
30965
|
+
}
|
|
30966
|
+
|
|
30892
30967
|
var proto = Object.getPrototypeOf(value);
|
|
30893
30968
|
return !proto || proto === Object.prototype;
|
|
30894
30969
|
}
|
|
30970
|
+
|
|
30895
30971
|
var assign = Object.assign || function assign(target, value) {
|
|
30896
30972
|
for (var key in value) {
|
|
30897
30973
|
if (has(value, key)) {
|
|
@@ -30901,11 +30977,18 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
30901
30977
|
|
|
30902
30978
|
return target;
|
|
30903
30979
|
};
|
|
30904
|
-
|
|
30980
|
+
|
|
30981
|
+
var ownKeys$1 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
30982
|
+
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
30983
|
+
} : Object.getOwnPropertyNames;
|
|
30984
|
+
|
|
30905
30985
|
function shallowCopy(base, invokeGetters) {
|
|
30906
|
-
if (
|
|
30986
|
+
if (invokeGetters === void 0) invokeGetters = false;
|
|
30987
|
+
|
|
30988
|
+
if (Array.isArray(base)) {
|
|
30989
|
+
return base.slice();
|
|
30990
|
+
}
|
|
30907
30991
|
|
|
30908
|
-
if (Array.isArray(base)) { return base.slice(); }
|
|
30909
30992
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
30910
30993
|
ownKeys$1(base).forEach(function (key) {
|
|
30911
30994
|
if (key === DRAFT_STATE) {
|
|
@@ -30935,20 +31018,28 @@ function shallowCopy(base, invokeGetters) {
|
|
|
30935
31018
|
});
|
|
30936
31019
|
return clone;
|
|
30937
31020
|
}
|
|
31021
|
+
|
|
30938
31022
|
function each(value, cb) {
|
|
30939
31023
|
if (Array.isArray(value)) {
|
|
30940
|
-
for (var i = 0; i < value.length; i++) {
|
|
31024
|
+
for (var i = 0; i < value.length; i++) {
|
|
31025
|
+
cb(i, value[i], value);
|
|
31026
|
+
}
|
|
30941
31027
|
} else {
|
|
30942
|
-
ownKeys$1(value).forEach(function (key) {
|
|
31028
|
+
ownKeys$1(value).forEach(function (key) {
|
|
31029
|
+
return cb(key, value[key], value);
|
|
31030
|
+
});
|
|
30943
31031
|
}
|
|
30944
31032
|
}
|
|
31033
|
+
|
|
30945
31034
|
function isEnumerable(base, prop) {
|
|
30946
31035
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
30947
31036
|
return !!desc && desc.enumerable;
|
|
30948
31037
|
}
|
|
31038
|
+
|
|
30949
31039
|
function has(thing, prop) {
|
|
30950
31040
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
30951
31041
|
}
|
|
31042
|
+
|
|
30952
31043
|
function is(x, y) {
|
|
30953
31044
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
30954
31045
|
if (x === y) {
|
|
@@ -30957,18 +31048,27 @@ function is(x, y) {
|
|
|
30957
31048
|
return x !== x && y !== y;
|
|
30958
31049
|
}
|
|
30959
31050
|
}
|
|
31051
|
+
|
|
30960
31052
|
function clone(obj) {
|
|
30961
|
-
if (!isDraftable(obj)) {
|
|
30962
|
-
|
|
31053
|
+
if (!isDraftable(obj)) {
|
|
31054
|
+
return obj;
|
|
31055
|
+
}
|
|
31056
|
+
|
|
31057
|
+
if (Array.isArray(obj)) {
|
|
31058
|
+
return obj.map(clone);
|
|
31059
|
+
}
|
|
31060
|
+
|
|
30963
31061
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
30964
31062
|
|
|
30965
|
-
for (var key in obj) {
|
|
31063
|
+
for (var key in obj) {
|
|
31064
|
+
cloned[key] = clone(obj[key]);
|
|
31065
|
+
}
|
|
30966
31066
|
|
|
30967
31067
|
return cloned;
|
|
30968
31068
|
}
|
|
30969
|
-
|
|
30970
31069
|
/** Each scope represents a `produce` call. */
|
|
30971
31070
|
|
|
31071
|
+
|
|
30972
31072
|
var ImmerScope = function ImmerScope(parent) {
|
|
30973
31073
|
this.drafts = [];
|
|
30974
31074
|
this.parent = parent; // Whenever the modified draft contains a draft from another scope, we
|
|
@@ -30979,7 +31079,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
30979
31079
|
this.patches = null;
|
|
30980
31080
|
};
|
|
30981
31081
|
|
|
30982
|
-
ImmerScope.prototype.usePatches = function usePatches
|
|
31082
|
+
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
30983
31083
|
if (patchListener) {
|
|
30984
31084
|
this.patches = [];
|
|
30985
31085
|
this.inversePatches = [];
|
|
@@ -30987,17 +31087,18 @@ ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
|
30987
31087
|
}
|
|
30988
31088
|
};
|
|
30989
31089
|
|
|
30990
|
-
ImmerScope.prototype.revoke = function revoke$1
|
|
31090
|
+
ImmerScope.prototype.revoke = function revoke$1() {
|
|
30991
31091
|
this.leave();
|
|
30992
31092
|
this.drafts.forEach(revoke);
|
|
30993
31093
|
this.drafts = null; // Make draft-related methods throw.
|
|
30994
31094
|
};
|
|
30995
31095
|
|
|
30996
|
-
ImmerScope.prototype.leave = function leave
|
|
31096
|
+
ImmerScope.prototype.leave = function leave() {
|
|
30997
31097
|
if (this === ImmerScope.current) {
|
|
30998
31098
|
ImmerScope.current = this.parent;
|
|
30999
31099
|
}
|
|
31000
31100
|
};
|
|
31101
|
+
|
|
31001
31102
|
ImmerScope.current = null;
|
|
31002
31103
|
|
|
31003
31104
|
ImmerScope.enter = function () {
|
|
@@ -31006,11 +31107,11 @@ ImmerScope.enter = function () {
|
|
|
31006
31107
|
|
|
31007
31108
|
function revoke(draft) {
|
|
31008
31109
|
draft[DRAFT_STATE].revoke();
|
|
31009
|
-
}
|
|
31110
|
+
} // but share them all instead
|
|
31010
31111
|
|
|
31011
|
-
// but share them all instead
|
|
31012
31112
|
|
|
31013
31113
|
var descriptors = {};
|
|
31114
|
+
|
|
31014
31115
|
function willFinalize(scope, result, isReplaced) {
|
|
31015
31116
|
scope.drafts.forEach(function (draft) {
|
|
31016
31117
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -31028,6 +31129,7 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
31028
31129
|
markChangesSweep(scope.drafts);
|
|
31029
31130
|
}
|
|
31030
31131
|
}
|
|
31132
|
+
|
|
31031
31133
|
function createProxy(base, parent) {
|
|
31032
31134
|
var isArray = Array.isArray(base);
|
|
31033
31135
|
var draft = clonePotentialDraft(base);
|
|
@@ -31081,7 +31183,11 @@ function peek(draft, prop) {
|
|
|
31081
31183
|
function get(state, prop) {
|
|
31082
31184
|
assertUnrevoked(state);
|
|
31083
31185
|
var value = peek(source(state), prop);
|
|
31084
|
-
|
|
31186
|
+
|
|
31187
|
+
if (state.finalizing) {
|
|
31188
|
+
return value;
|
|
31189
|
+
} // Create a draft if the value is unmodified.
|
|
31190
|
+
|
|
31085
31191
|
|
|
31086
31192
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
31087
31193
|
prepareCopy(state);
|
|
@@ -31096,7 +31202,10 @@ function set(state, prop, value) {
|
|
|
31096
31202
|
state.assigned[prop] = true;
|
|
31097
31203
|
|
|
31098
31204
|
if (!state.modified) {
|
|
31099
|
-
if (is(value, peek(source(state), prop))) {
|
|
31205
|
+
if (is(value, peek(source(state), prop))) {
|
|
31206
|
+
return;
|
|
31207
|
+
}
|
|
31208
|
+
|
|
31100
31209
|
markChanged(state);
|
|
31101
31210
|
prepareCopy(state);
|
|
31102
31211
|
}
|
|
@@ -31107,12 +31216,17 @@ function set(state, prop, value) {
|
|
|
31107
31216
|
function markChanged(state) {
|
|
31108
31217
|
if (!state.modified) {
|
|
31109
31218
|
state.modified = true;
|
|
31110
|
-
|
|
31219
|
+
|
|
31220
|
+
if (state.parent) {
|
|
31221
|
+
markChanged(state.parent);
|
|
31222
|
+
}
|
|
31111
31223
|
}
|
|
31112
31224
|
}
|
|
31113
31225
|
|
|
31114
31226
|
function prepareCopy(state) {
|
|
31115
|
-
if (!state.copy) {
|
|
31227
|
+
if (!state.copy) {
|
|
31228
|
+
state.copy = clonePotentialDraft(state.base);
|
|
31229
|
+
}
|
|
31116
31230
|
}
|
|
31117
31231
|
|
|
31118
31232
|
function clonePotentialDraft(base) {
|
|
@@ -31137,15 +31251,12 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
31137
31251
|
descriptors[prop] = desc = {
|
|
31138
31252
|
configurable: true,
|
|
31139
31253
|
enumerable: enumerable,
|
|
31140
|
-
|
|
31141
31254
|
get: function get$1() {
|
|
31142
31255
|
return get(this[DRAFT_STATE], prop);
|
|
31143
31256
|
},
|
|
31144
|
-
|
|
31145
31257
|
set: function set$1(value) {
|
|
31146
31258
|
set(this[DRAFT_STATE], prop, value);
|
|
31147
31259
|
}
|
|
31148
|
-
|
|
31149
31260
|
};
|
|
31150
31261
|
}
|
|
31151
31262
|
|
|
@@ -31153,7 +31264,9 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
31153
31264
|
}
|
|
31154
31265
|
|
|
31155
31266
|
function assertUnrevoked(state) {
|
|
31156
|
-
if (state.revoked === true) {
|
|
31267
|
+
if (state.revoked === true) {
|
|
31268
|
+
throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + JSON.stringify(source(state)));
|
|
31269
|
+
}
|
|
31157
31270
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
31158
31271
|
|
|
31159
31272
|
|
|
@@ -31167,16 +31280,27 @@ function markChangesSweep(drafts) {
|
|
|
31167
31280
|
|
|
31168
31281
|
if (!state.modified) {
|
|
31169
31282
|
if (Array.isArray(state.base)) {
|
|
31170
|
-
if (hasArrayChanges(state)) {
|
|
31171
|
-
|
|
31283
|
+
if (hasArrayChanges(state)) {
|
|
31284
|
+
markChanged(state);
|
|
31285
|
+
}
|
|
31286
|
+
} else if (hasObjectChanges(state)) {
|
|
31287
|
+
markChanged(state);
|
|
31288
|
+
}
|
|
31172
31289
|
}
|
|
31173
31290
|
}
|
|
31174
31291
|
}
|
|
31175
31292
|
|
|
31176
31293
|
function markChangesRecursively(object) {
|
|
31177
|
-
if (!object ||
|
|
31294
|
+
if (!object || _typeof(object) !== "object") {
|
|
31295
|
+
return;
|
|
31296
|
+
}
|
|
31297
|
+
|
|
31178
31298
|
var state = object[DRAFT_STATE];
|
|
31179
|
-
|
|
31299
|
+
|
|
31300
|
+
if (!state) {
|
|
31301
|
+
return;
|
|
31302
|
+
}
|
|
31303
|
+
|
|
31180
31304
|
var base = state.base;
|
|
31181
31305
|
var draft = state.draft;
|
|
31182
31306
|
var assigned = state.assigned;
|
|
@@ -31206,14 +31330,20 @@ function markChangesRecursively(object) {
|
|
|
31206
31330
|
assigned.length = true;
|
|
31207
31331
|
|
|
31208
31332
|
if (draft.length < base.length) {
|
|
31209
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
31333
|
+
for (var i = draft.length; i < base.length; i++) {
|
|
31334
|
+
assigned[i] = false;
|
|
31335
|
+
}
|
|
31210
31336
|
} else {
|
|
31211
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
31337
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
31338
|
+
assigned[i$1] = true;
|
|
31339
|
+
}
|
|
31212
31340
|
}
|
|
31213
31341
|
|
|
31214
31342
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
31215
31343
|
// Only untouched indices trigger recursion.
|
|
31216
|
-
if (assigned[i$2] === undefined) {
|
|
31344
|
+
if (assigned[i$2] === undefined) {
|
|
31345
|
+
markChangesRecursively(draft[i$2]);
|
|
31346
|
+
}
|
|
31217
31347
|
}
|
|
31218
31348
|
}
|
|
31219
31349
|
}
|
|
@@ -31250,7 +31380,10 @@ function hasObjectChanges(state) {
|
|
|
31250
31380
|
|
|
31251
31381
|
function hasArrayChanges(state) {
|
|
31252
31382
|
var draft = state.draft;
|
|
31253
|
-
|
|
31383
|
+
|
|
31384
|
+
if (draft.length !== state.base.length) {
|
|
31385
|
+
return true;
|
|
31386
|
+
} // See #116
|
|
31254
31387
|
// If we first shorten the length, our array interceptors will be removed.
|
|
31255
31388
|
// If after that new items are added, result in the same original length,
|
|
31256
31389
|
// those last items will have no intercepting property.
|
|
@@ -31258,9 +31391,13 @@ function hasArrayChanges(state) {
|
|
|
31258
31391
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
31259
31392
|
// the last one
|
|
31260
31393
|
|
|
31394
|
+
|
|
31261
31395
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
31262
31396
|
|
|
31263
|
-
if (descriptor && !descriptor.get) {
|
|
31397
|
+
if (descriptor && !descriptor.get) {
|
|
31398
|
+
return true;
|
|
31399
|
+
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
31400
|
+
|
|
31264
31401
|
|
|
31265
31402
|
return false;
|
|
31266
31403
|
}
|
|
@@ -31274,11 +31411,12 @@ function createHiddenProperty(target, prop, value) {
|
|
|
31274
31411
|
}
|
|
31275
31412
|
|
|
31276
31413
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
31277
|
-
|
|
31278
|
-
|
|
31414
|
+
willFinalize: willFinalize,
|
|
31415
|
+
createProxy: createProxy
|
|
31279
31416
|
});
|
|
31280
31417
|
|
|
31281
31418
|
function willFinalize$1() {}
|
|
31419
|
+
|
|
31282
31420
|
function createProxy$1(base, parent) {
|
|
31283
31421
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
31284
31422
|
var state = {
|
|
@@ -31313,33 +31451,27 @@ function createProxy$1(base, parent) {
|
|
|
31313
31451
|
scope.drafts.push(proxy);
|
|
31314
31452
|
return proxy;
|
|
31315
31453
|
}
|
|
31454
|
+
|
|
31316
31455
|
var objectTraps = {
|
|
31317
31456
|
get: get$1,
|
|
31318
|
-
|
|
31319
31457
|
has: function has(target, prop) {
|
|
31320
31458
|
return prop in source$1(target);
|
|
31321
31459
|
},
|
|
31322
|
-
|
|
31323
31460
|
ownKeys: function ownKeys(target) {
|
|
31324
31461
|
return Reflect.ownKeys(source$1(target));
|
|
31325
31462
|
},
|
|
31326
|
-
|
|
31327
31463
|
set: set$1,
|
|
31328
31464
|
deleteProperty: deleteProperty,
|
|
31329
31465
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor,
|
|
31330
|
-
|
|
31331
31466
|
defineProperty: function defineProperty() {
|
|
31332
31467
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
31333
31468
|
},
|
|
31334
|
-
|
|
31335
31469
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
31336
31470
|
return Object.getPrototypeOf(target.base);
|
|
31337
31471
|
},
|
|
31338
|
-
|
|
31339
31472
|
setPrototypeOf: function setPrototypeOf() {
|
|
31340
31473
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
31341
31474
|
}
|
|
31342
|
-
|
|
31343
31475
|
};
|
|
31344
31476
|
var arrayTraps = {};
|
|
31345
31477
|
each(objectTraps, function (key, fn) {
|
|
@@ -31378,7 +31510,10 @@ function peek$1(draft, prop) {
|
|
|
31378
31510
|
}
|
|
31379
31511
|
|
|
31380
31512
|
function get$1(state, prop) {
|
|
31381
|
-
if (prop === DRAFT_STATE) {
|
|
31513
|
+
if (prop === DRAFT_STATE) {
|
|
31514
|
+
return state;
|
|
31515
|
+
}
|
|
31516
|
+
|
|
31382
31517
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
31383
31518
|
|
|
31384
31519
|
if (!state.modified && has(drafts, prop)) {
|
|
@@ -31394,7 +31529,10 @@ function get$1(state, prop) {
|
|
|
31394
31529
|
|
|
31395
31530
|
if (state.modified) {
|
|
31396
31531
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
31397
|
-
if (value !== peek$1(state.base, prop)) {
|
|
31532
|
+
if (value !== peek$1(state.base, prop)) {
|
|
31533
|
+
return value;
|
|
31534
|
+
} // Store drafts on the copy (when one exists).
|
|
31535
|
+
|
|
31398
31536
|
|
|
31399
31537
|
drafts = state.copy;
|
|
31400
31538
|
}
|
|
@@ -31409,7 +31547,11 @@ function set$1(state, prop, value) {
|
|
|
31409
31547
|
// values may be drafts, but falsy values are never drafts.
|
|
31410
31548
|
|
|
31411
31549
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
31412
|
-
|
|
31550
|
+
|
|
31551
|
+
if (isUnchanged) {
|
|
31552
|
+
return true;
|
|
31553
|
+
}
|
|
31554
|
+
|
|
31413
31555
|
markChanged$1(state);
|
|
31414
31556
|
}
|
|
31415
31557
|
|
|
@@ -31428,7 +31570,10 @@ function deleteProperty(state, prop) {
|
|
|
31428
31570
|
delete state.assigned[prop];
|
|
31429
31571
|
}
|
|
31430
31572
|
|
|
31431
|
-
if (state.copy) {
|
|
31573
|
+
if (state.copy) {
|
|
31574
|
+
delete state.copy[prop];
|
|
31575
|
+
}
|
|
31576
|
+
|
|
31432
31577
|
return true;
|
|
31433
31578
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
31434
31579
|
// the same guarantee in ES5 mode.
|
|
@@ -31451,13 +31596,16 @@ function markChanged$1(state) {
|
|
|
31451
31596
|
state.modified = true;
|
|
31452
31597
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
31453
31598
|
state.drafts = null;
|
|
31454
|
-
|
|
31599
|
+
|
|
31600
|
+
if (state.parent) {
|
|
31601
|
+
markChanged$1(state.parent);
|
|
31602
|
+
}
|
|
31455
31603
|
}
|
|
31456
31604
|
}
|
|
31457
31605
|
|
|
31458
31606
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
31459
|
-
|
|
31460
|
-
|
|
31607
|
+
willFinalize: willFinalize$1,
|
|
31608
|
+
createProxy: createProxy$1
|
|
31461
31609
|
});
|
|
31462
31610
|
|
|
31463
31611
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -31466,14 +31614,13 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
31466
31614
|
|
|
31467
31615
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
31468
31616
|
var assign, assign$1;
|
|
31469
|
-
|
|
31470
31617
|
var base = state.base;
|
|
31471
31618
|
var copy = state.copy;
|
|
31472
31619
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
31473
31620
|
|
|
31474
31621
|
if (copy.length < base.length) {
|
|
31475
|
-
|
|
31476
|
-
|
|
31622
|
+
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
31623
|
+
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
31477
31624
|
}
|
|
31478
31625
|
|
|
31479
31626
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -31531,7 +31678,11 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
31531
31678
|
var origValue = base[key];
|
|
31532
31679
|
var value = copy[key];
|
|
31533
31680
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
31534
|
-
|
|
31681
|
+
|
|
31682
|
+
if (origValue === value && op === "replace") {
|
|
31683
|
+
return;
|
|
31684
|
+
}
|
|
31685
|
+
|
|
31535
31686
|
var path = basePath.concat(key);
|
|
31536
31687
|
patches.push(op === "remove" ? {
|
|
31537
31688
|
op: op,
|
|
@@ -31556,20 +31707,26 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
31556
31707
|
});
|
|
31557
31708
|
}
|
|
31558
31709
|
|
|
31559
|
-
var applyPatches = function (draft, patches) {
|
|
31710
|
+
var applyPatches = function applyPatches(draft, patches) {
|
|
31560
31711
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
31561
31712
|
var patch = list[i$1];
|
|
31562
|
-
|
|
31563
31713
|
var path = patch.path;
|
|
31564
31714
|
var op = patch.op;
|
|
31565
31715
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
31566
31716
|
|
|
31567
|
-
if (!path.length) {
|
|
31717
|
+
if (!path.length) {
|
|
31718
|
+
throw new Error("Illegal state");
|
|
31719
|
+
}
|
|
31720
|
+
|
|
31568
31721
|
var base = draft;
|
|
31569
31722
|
|
|
31570
31723
|
for (var i = 0; i < path.length - 1; i++) {
|
|
31571
31724
|
base = base[path[i]];
|
|
31572
|
-
|
|
31725
|
+
|
|
31726
|
+
if (!base || _typeof(base) !== "object") {
|
|
31727
|
+
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
31728
|
+
} // prettier-ignore
|
|
31729
|
+
|
|
31573
31730
|
}
|
|
31574
31731
|
|
|
31575
31732
|
var key = path[path.length - 1];
|
|
@@ -31618,27 +31775,33 @@ var configDefaults = {
|
|
|
31618
31775
|
onDelete: null,
|
|
31619
31776
|
onCopy: null
|
|
31620
31777
|
};
|
|
31778
|
+
|
|
31621
31779
|
var Immer = function Immer(config) {
|
|
31622
31780
|
assign(this, configDefaults, config);
|
|
31623
31781
|
this.setUseProxies(this.useProxies);
|
|
31624
31782
|
this.produce = this.produce.bind(this);
|
|
31625
31783
|
};
|
|
31626
31784
|
|
|
31627
|
-
Immer.prototype.produce = function produce
|
|
31628
|
-
|
|
31785
|
+
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
31786
|
+
var this$1 = this; // curried invocation
|
|
31629
31787
|
|
|
31630
|
-
// curried invocation
|
|
31631
31788
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
31632
31789
|
var defaultBase = recipe;
|
|
31633
31790
|
recipe = base;
|
|
31634
31791
|
var self = this;
|
|
31635
31792
|
return function curriedProduce(base) {
|
|
31636
|
-
|
|
31637
|
-
|
|
31638
|
-
|
|
31639
|
-
|
|
31793
|
+
var this$1 = this;
|
|
31794
|
+
if (base === void 0) base = defaultBase;
|
|
31795
|
+
var args = [],
|
|
31796
|
+
len = arguments.length - 1;
|
|
31797
|
+
|
|
31798
|
+
while (len-- > 0) {
|
|
31799
|
+
args[len] = arguments[len + 1];
|
|
31800
|
+
}
|
|
31640
31801
|
|
|
31641
|
-
return self.produce(base, function (draft) {
|
|
31802
|
+
return self.produce(base, function (draft) {
|
|
31803
|
+
return recipe.call.apply(recipe, [this$1, draft].concat(args));
|
|
31804
|
+
}); // prettier-ignore
|
|
31642
31805
|
};
|
|
31643
31806
|
} // prettier-ignore
|
|
31644
31807
|
|
|
@@ -31664,7 +31827,11 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
31664
31827
|
hasError = false;
|
|
31665
31828
|
} finally {
|
|
31666
31829
|
// finally instead of catch + rethrow better preserves original stack
|
|
31667
|
-
if (hasError) {
|
|
31830
|
+
if (hasError) {
|
|
31831
|
+
scope.revoke();
|
|
31832
|
+
} else {
|
|
31833
|
+
scope.leave();
|
|
31834
|
+
}
|
|
31668
31835
|
}
|
|
31669
31836
|
|
|
31670
31837
|
if (result instanceof Promise) {
|
|
@@ -31681,25 +31848,38 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
31681
31848
|
return this.processResult(result, scope);
|
|
31682
31849
|
} else {
|
|
31683
31850
|
result = recipe(base);
|
|
31684
|
-
|
|
31851
|
+
|
|
31852
|
+
if (result === undefined) {
|
|
31853
|
+
return base;
|
|
31854
|
+
}
|
|
31855
|
+
|
|
31685
31856
|
return result !== NOTHING ? result : undefined;
|
|
31686
31857
|
}
|
|
31687
31858
|
};
|
|
31688
31859
|
|
|
31689
|
-
Immer.prototype.produceWithPatches = function produceWithPatches
|
|
31690
|
-
|
|
31860
|
+
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
31861
|
+
var this$1 = this;
|
|
31691
31862
|
|
|
31692
31863
|
if (typeof arg1 === "function") {
|
|
31693
31864
|
return function (state) {
|
|
31694
|
-
|
|
31695
|
-
|
|
31865
|
+
var args = [],
|
|
31866
|
+
len = arguments.length - 1;
|
|
31696
31867
|
|
|
31697
|
-
|
|
31698
|
-
|
|
31868
|
+
while (len-- > 0) {
|
|
31869
|
+
args[len] = arguments[len + 1];
|
|
31870
|
+
}
|
|
31871
|
+
|
|
31872
|
+
return this$1.produceWithPatches(state, function (draft) {
|
|
31873
|
+
return arg1.apply(void 0, [draft].concat(args));
|
|
31874
|
+
});
|
|
31875
|
+
};
|
|
31699
31876
|
} // non-curried form
|
|
31700
31877
|
|
|
31701
31878
|
|
|
31702
|
-
if (arg3) {
|
|
31879
|
+
if (arg3) {
|
|
31880
|
+
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
31881
|
+
}
|
|
31882
|
+
|
|
31703
31883
|
var patches, inversePatches;
|
|
31704
31884
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
31705
31885
|
patches = p;
|
|
@@ -31708,7 +31888,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, ar
|
|
|
31708
31888
|
return [nextState, patches, inversePatches];
|
|
31709
31889
|
};
|
|
31710
31890
|
|
|
31711
|
-
Immer.prototype.createDraft = function createDraft
|
|
31891
|
+
Immer.prototype.createDraft = function createDraft(base) {
|
|
31712
31892
|
if (!isDraftable(base)) {
|
|
31713
31893
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
31714
31894
|
}
|
|
@@ -31720,7 +31900,7 @@ Immer.prototype.createDraft = function createDraft (base) {
|
|
|
31720
31900
|
return proxy;
|
|
31721
31901
|
};
|
|
31722
31902
|
|
|
31723
|
-
Immer.prototype.finishDraft = function finishDraft
|
|
31903
|
+
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
31724
31904
|
var state = draft && draft[DRAFT_STATE];
|
|
31725
31905
|
|
|
31726
31906
|
if (!state || !state.isManual) {
|
|
@@ -31736,16 +31916,16 @@ Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
|
31736
31916
|
return this.processResult(undefined, scope);
|
|
31737
31917
|
};
|
|
31738
31918
|
|
|
31739
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze
|
|
31919
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
31740
31920
|
this.autoFreeze = value;
|
|
31741
31921
|
};
|
|
31742
31922
|
|
|
31743
|
-
Immer.prototype.setUseProxies = function setUseProxies
|
|
31923
|
+
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
31744
31924
|
this.useProxies = value;
|
|
31745
31925
|
assign(this, value ? modernProxy : legacyProxy);
|
|
31746
31926
|
};
|
|
31747
31927
|
|
|
31748
|
-
Immer.prototype.applyPatches = function applyPatches$1
|
|
31928
|
+
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
31749
31929
|
// If a patch replaces the entire state, take that replacement as base
|
|
31750
31930
|
// before applying patches
|
|
31751
31931
|
var i;
|
|
@@ -31765,12 +31945,14 @@ Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
|
31765
31945
|
} // Otherwise, produce a copy of the base state.
|
|
31766
31946
|
|
|
31767
31947
|
|
|
31768
|
-
return this.produce(base, function (draft) {
|
|
31948
|
+
return this.produce(base, function (draft) {
|
|
31949
|
+
return applyPatches(draft, patches.slice(i + 1));
|
|
31950
|
+
});
|
|
31769
31951
|
};
|
|
31770
31952
|
/** @internal */
|
|
31771
31953
|
|
|
31772
31954
|
|
|
31773
|
-
Immer.prototype.processResult = function processResult
|
|
31955
|
+
Immer.prototype.processResult = function processResult(result, scope) {
|
|
31774
31956
|
var baseDraft = scope.drafts[0];
|
|
31775
31957
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
31776
31958
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -31818,13 +32000,15 @@ Immer.prototype.processResult = function processResult (result, scope) {
|
|
|
31818
32000
|
*/
|
|
31819
32001
|
|
|
31820
32002
|
|
|
31821
|
-
Immer.prototype.finalize = function finalize
|
|
31822
|
-
|
|
31823
|
-
|
|
32003
|
+
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
32004
|
+
var this$1 = this;
|
|
31824
32005
|
var state = draft[DRAFT_STATE];
|
|
31825
32006
|
|
|
31826
32007
|
if (!state) {
|
|
31827
|
-
if (Object.isFrozen(draft)) {
|
|
32008
|
+
if (Object.isFrozen(draft)) {
|
|
32009
|
+
return draft;
|
|
32010
|
+
}
|
|
32011
|
+
|
|
31828
32012
|
return this.finalizeTree(draft, null, scope);
|
|
31829
32013
|
} // Never finalize drafts owned by another scope.
|
|
31830
32014
|
|
|
@@ -31847,13 +32031,17 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
31847
32031
|
var assigned = state.assigned;
|
|
31848
32032
|
|
|
31849
32033
|
for (var prop in assigned) {
|
|
31850
|
-
if (!assigned[prop]) {
|
|
32034
|
+
if (!assigned[prop]) {
|
|
32035
|
+
this.onDelete(state, prop);
|
|
32036
|
+
}
|
|
31851
32037
|
}
|
|
31852
32038
|
} else {
|
|
31853
32039
|
var base = state.base;
|
|
31854
|
-
|
|
32040
|
+
var copy = state.copy;
|
|
31855
32041
|
each(base, function (prop) {
|
|
31856
|
-
if (!has(copy, prop)) {
|
|
32042
|
+
if (!has(copy, prop)) {
|
|
32043
|
+
this$1.onDelete(state, prop);
|
|
32044
|
+
}
|
|
31857
32045
|
});
|
|
31858
32046
|
}
|
|
31859
32047
|
}
|
|
@@ -31881,9 +32069,8 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
31881
32069
|
*/
|
|
31882
32070
|
|
|
31883
32071
|
|
|
31884
|
-
Immer.prototype.finalizeTree = function finalizeTree
|
|
31885
|
-
|
|
31886
|
-
|
|
32072
|
+
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
32073
|
+
var this$1 = this;
|
|
31887
32074
|
var state = root[DRAFT_STATE];
|
|
31888
32075
|
|
|
31889
32076
|
if (state) {
|
|
@@ -31897,7 +32084,7 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
31897
32084
|
|
|
31898
32085
|
var needPatches = !!rootPath && !!scope.patches;
|
|
31899
32086
|
|
|
31900
|
-
var finalizeProperty = function (prop, value, parent) {
|
|
32087
|
+
var finalizeProperty = function finalizeProperty(prop, value, parent) {
|
|
31901
32088
|
if (value === parent) {
|
|
31902
32089
|
throw Error("Immer forbids circular references");
|
|
31903
32090
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -31924,7 +32111,9 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
31924
32111
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
31925
32112
|
|
|
31926
32113
|
|
|
31927
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
32114
|
+
if (isDraftProp && value === state.base[prop]) {
|
|
32115
|
+
return;
|
|
32116
|
+
}
|
|
31928
32117
|
} // Unchanged draft properties are ignored.
|
|
31929
32118
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
31930
32119
|
return;
|
|
@@ -32009,103 +32198,149 @@ var createDraft = immer.createDraft.bind(immer);
|
|
|
32009
32198
|
|
|
32010
32199
|
var finishDraft = immer.finishDraft.bind(immer);
|
|
32011
32200
|
|
|
32012
|
-
|
|
32013
|
-
|
|
32014
|
-
|
|
32015
|
-
|
|
32201
|
+
var createInitialState = function createInitialState(formConfig) {
|
|
32202
|
+
var initialForm = {};
|
|
32203
|
+
var formConfigKeys = Object.keys(formConfig);
|
|
32204
|
+
|
|
32205
|
+
for (var _i = 0, _formConfigKeys = formConfigKeys; _i < _formConfigKeys.length; _i++) {
|
|
32206
|
+
var formKey = _formConfigKeys[_i];
|
|
32016
32207
|
initialForm[formKey] = {
|
|
32017
32208
|
dirty: false,
|
|
32018
32209
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
32019
32210
|
validators: formConfig[formKey].validators || [],
|
|
32020
32211
|
constraints: formConfig[formKey].constraints || []
|
|
32021
32212
|
};
|
|
32022
|
-
}
|
|
32023
|
-
// Because validators require the entire form we have to do a
|
|
32213
|
+
} // Because validators require the entire form we have to do a
|
|
32024
32214
|
// second pass to add errors once the initial form has been
|
|
32025
32215
|
// constructed
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32029
|
-
|
|
32216
|
+
|
|
32217
|
+
|
|
32218
|
+
for (var _i2 = 0, _formConfigKeys2 = formConfigKeys; _i2 < _formConfigKeys2.length; _i2++) {
|
|
32219
|
+
var _formKey = _formConfigKeys2[_i2];
|
|
32220
|
+
var errors = computeErrors(_formKey, initialForm);
|
|
32221
|
+
initialForm[_formKey].errors = errors;
|
|
32222
|
+
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
32030
32223
|
}
|
|
32224
|
+
|
|
32031
32225
|
return initialForm;
|
|
32032
32226
|
};
|
|
32033
32227
|
|
|
32034
|
-
|
|
32035
|
-
const set$2 = fieldName => value => ({
|
|
32036
|
-
type: SET,
|
|
32037
|
-
payload: { fieldName, value }
|
|
32038
|
-
});
|
|
32228
|
+
var SET = "field/SET";
|
|
32039
32229
|
|
|
32040
|
-
|
|
32041
|
-
|
|
32042
|
-
|
|
32043
|
-
|
|
32044
|
-
|
|
32045
|
-
|
|
32046
|
-
|
|
32047
|
-
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
|
|
32052
|
-
return produce(state, draftState => {
|
|
32053
|
-
let originalValue = draftState[changedFieldName].rawValue;
|
|
32054
|
-
draftState[changedFieldName].rawValue = newRawValue;
|
|
32055
|
-
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
32056
|
-
// If the change violates constraints, revert the change
|
|
32057
|
-
draftState[changedFieldName].rawValue = originalValue;
|
|
32058
|
-
return draftState;
|
|
32059
|
-
}
|
|
32230
|
+
var set$2 = function set$2(fieldName) {
|
|
32231
|
+
return function (value) {
|
|
32232
|
+
return {
|
|
32233
|
+
type: SET,
|
|
32234
|
+
payload: {
|
|
32235
|
+
fieldName: fieldName,
|
|
32236
|
+
value: value
|
|
32237
|
+
}
|
|
32238
|
+
};
|
|
32239
|
+
};
|
|
32240
|
+
};
|
|
32060
32241
|
|
|
32061
|
-
|
|
32062
|
-
|
|
32063
|
-
|
|
32064
|
-
|
|
32065
|
-
|
|
32066
|
-
|
|
32067
|
-
|
|
32068
|
-
|
|
32069
|
-
|
|
32070
|
-
|
|
32071
|
-
|
|
32072
|
-
|
|
32073
|
-
|
|
32074
|
-
|
|
32075
|
-
|
|
32076
|
-
|
|
32242
|
+
var CLEAR = "form/CLEAR";
|
|
32243
|
+
|
|
32244
|
+
var _clear = function clear() {
|
|
32245
|
+
return {
|
|
32246
|
+
type: CLEAR
|
|
32247
|
+
};
|
|
32248
|
+
};
|
|
32249
|
+
|
|
32250
|
+
var createFormReducer = function createFormReducer(formConfig) {
|
|
32251
|
+
return function () {
|
|
32252
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
32253
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
32254
|
+
|
|
32255
|
+
switch (action.type) {
|
|
32256
|
+
case SET:
|
|
32257
|
+
var changedFieldName = action.payload.fieldName;
|
|
32258
|
+
var newRawValue = action.payload.value;
|
|
32259
|
+
return produce(state, function (draftState) {
|
|
32260
|
+
var originalValue = draftState[changedFieldName].rawValue;
|
|
32261
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
32262
|
+
|
|
32263
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
32264
|
+
// If the change violates constraints, revert the change
|
|
32265
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
32266
|
+
return draftState;
|
|
32267
|
+
}
|
|
32268
|
+
|
|
32269
|
+
var fields = Object.entries(draftState);
|
|
32270
|
+
|
|
32271
|
+
for (var _i3 = 0, _fields = fields; _i3 < _fields.length; _i3++) {
|
|
32272
|
+
var entry = _fields[_i3];
|
|
32273
|
+
var fieldName = entry[0];
|
|
32274
|
+
var field = entry[1];
|
|
32275
|
+
var errors = computeErrors(fieldName, draftState);
|
|
32276
|
+
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
32277
|
+
draftState[fieldName].errors = errors;
|
|
32278
|
+
draftState[fieldName].dirty = dirty;
|
|
32279
|
+
draftState[fieldName].hasErrors = errors.length > 0;
|
|
32280
|
+
}
|
|
32281
|
+
});
|
|
32282
|
+
|
|
32283
|
+
case CLEAR:
|
|
32284
|
+
return createInitialState(formConfig);
|
|
32285
|
+
|
|
32286
|
+
default:
|
|
32287
|
+
return state;
|
|
32288
|
+
}
|
|
32289
|
+
};
|
|
32077
32290
|
};
|
|
32078
32291
|
|
|
32079
|
-
|
|
32292
|
+
var createMapDispatchToProps = function createMapDispatchToProps(formConfig) {
|
|
32080
32293
|
// Do memo-ization
|
|
32081
|
-
|
|
32082
|
-
|
|
32083
|
-
return dispatch
|
|
32294
|
+
var cachedDispatch;
|
|
32295
|
+
var cacheValue;
|
|
32296
|
+
return function (dispatch) {
|
|
32084
32297
|
if (dispatch == cachedDispatch) {
|
|
32085
32298
|
return cacheValue;
|
|
32086
32299
|
}
|
|
32087
|
-
|
|
32300
|
+
|
|
32301
|
+
var dispatchObj = {};
|
|
32088
32302
|
dispatchObj.fields = {};
|
|
32089
|
-
|
|
32090
|
-
|
|
32303
|
+
var keys = Object.keys(formConfig);
|
|
32304
|
+
|
|
32305
|
+
var _loop = function _loop() {
|
|
32306
|
+
var fieldName = _keys[_i4];
|
|
32091
32307
|
dispatchObj.fields[fieldName] = {
|
|
32092
|
-
set:
|
|
32308
|
+
set: function set(value) {
|
|
32309
|
+
return dispatch(set$2(fieldName)(value));
|
|
32310
|
+
}
|
|
32093
32311
|
};
|
|
32312
|
+
};
|
|
32313
|
+
|
|
32314
|
+
for (var _i4 = 0, _keys = keys; _i4 < _keys.length; _i4++) {
|
|
32315
|
+
_loop();
|
|
32094
32316
|
}
|
|
32095
|
-
|
|
32317
|
+
|
|
32318
|
+
dispatchObj.form = {
|
|
32319
|
+
clear: function clear() {
|
|
32320
|
+
return dispatch(_clear());
|
|
32321
|
+
}
|
|
32322
|
+
};
|
|
32096
32323
|
cachedDispatch = dispatch;
|
|
32097
|
-
cacheValue = {
|
|
32324
|
+
cacheValue = {
|
|
32325
|
+
actions: dispatchObj
|
|
32326
|
+
};
|
|
32098
32327
|
return cacheValue;
|
|
32099
32328
|
};
|
|
32100
32329
|
};
|
|
32101
32330
|
|
|
32102
|
-
|
|
32331
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
32332
|
+
return {
|
|
32333
|
+
fields: state
|
|
32334
|
+
};
|
|
32335
|
+
};
|
|
32103
32336
|
|
|
32104
|
-
|
|
32105
|
-
|
|
32106
|
-
|
|
32107
|
-
|
|
32108
|
-
|
|
32337
|
+
var createFormState = function createFormState(formConfig) {
|
|
32338
|
+
return {
|
|
32339
|
+
reducer: createFormReducer(formConfig),
|
|
32340
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
32341
|
+
mapStateToProps: mapStateToProps
|
|
32342
|
+
};
|
|
32343
|
+
};
|
|
32109
32344
|
|
|
32110
32345
|
var formatDelimiter = "_";
|
|
32111
32346
|
var phoneFormats = ["", "_", "__", "(___) ", "(___) _", "(___) __", "(___) ___-", "(___) ___-_", "(___) ___-__", "(___) ___-___", "(___) ___-____"];
|
|
@@ -36126,7 +36361,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
|
36126
36361
|
|
|
36127
36362
|
var obligationSlug = config.obligationSlug;
|
|
36128
36363
|
var createPaymentFromProfile = actions.createPaymentFromProfile,
|
|
36129
|
-
setDetailedObligation = actions.setDetailedObligation
|
|
36364
|
+
setDetailedObligation = actions.setDetailedObligation,
|
|
36365
|
+
navigateToDetailedObligation = actions.navigateToDetailedObligation;
|
|
36130
36366
|
var detailsSlug = config.type === "ACCOUNT" ? "/profile/accounts/details/".concat(obligationSlug) : "/profile/properties/details/".concat(obligationSlug);
|
|
36131
36367
|
|
|
36132
36368
|
var handleClick = function handleClick(obligations) {
|
|
@@ -36135,7 +36371,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
|
36135
36371
|
};
|
|
36136
36372
|
|
|
36137
36373
|
var handleDetailsClick = function handleDetailsClick() {
|
|
36138
|
-
setDetailedObligation(obligations, config
|
|
36374
|
+
setDetailedObligation(obligations, config);
|
|
36375
|
+
navigateToDetailedObligation(detailsSlug);
|
|
36139
36376
|
};
|
|
36140
36377
|
|
|
36141
36378
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -36199,7 +36436,10 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
|
36199
36436
|
}, autoPayAvailable && !autoPayEnabled ? /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
36200
36437
|
variant: "tertiary",
|
|
36201
36438
|
text: "Set Up Autopay",
|
|
36202
|
-
action:
|
|
36439
|
+
action: function action() {
|
|
36440
|
+
setDetailedObligation(obligations, config);
|
|
36441
|
+
handleAutopayAction();
|
|
36442
|
+
},
|
|
36203
36443
|
dataQa: "Set Up Autopay",
|
|
36204
36444
|
extraStyles: isMobile && "flex-grow: 1; width: 100%;"
|
|
36205
36445
|
}) : /*#__PURE__*/React__default.createElement(AutopayModalModule, {
|
|
@@ -36771,7 +37011,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
36771
37011
|
|
|
36772
37012
|
var confirmRoutingNumberErrors = _defineProperty({}, matchesField.error, "Confirm routing number field must match routing number");
|
|
36773
37013
|
|
|
36774
|
-
var accountNumberErrors = (_accountNumberErrors = {}, _defineProperty(_accountNumberErrors, required.error, "Account number is required"), _defineProperty(_accountNumberErrors, hasLength.error, "Account number must be between
|
|
37014
|
+
var accountNumberErrors = (_accountNumberErrors = {}, _defineProperty(_accountNumberErrors, required.error, "Account number is required"), _defineProperty(_accountNumberErrors, hasLength.error, "Account number must be between 5 and 17 digits"), _accountNumberErrors);
|
|
36775
37015
|
|
|
36776
37016
|
var confirmAccountNumberErrors = _defineProperty({}, matchesField.error, "Confirm account number field must match account number");
|
|
36777
37017
|
|
|
@@ -36901,7 +37141,7 @@ var formConfig$6 = {
|
|
|
36901
37141
|
constraints: [onlyIntegers(), hasLength(0, 9)]
|
|
36902
37142
|
},
|
|
36903
37143
|
accountNumber: {
|
|
36904
|
-
validators: [required(), hasLength(
|
|
37144
|
+
validators: [required(), hasLength(5, 17)],
|
|
36905
37145
|
constraints: [onlyIntegers(), hasLength(0, 17)]
|
|
36906
37146
|
},
|
|
36907
37147
|
confirmAccountNumber: {
|