@uncinc/uncinc-react-kitchen-sink 2.11.1 → 2.11.2
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.
|
@@ -116,6 +116,18 @@ var DateSelect = function DateSelect(props) {
|
|
|
116
116
|
useEffect(function () {
|
|
117
117
|
hideYear && setYear(fixedYear || new Date().getFullYear());
|
|
118
118
|
|
|
119
|
+
// In some cases, this element can re-render while there's already a value in the Formik Context.
|
|
120
|
+
// For example, when we build a Webform with multiplate pages, and you go báck a page.
|
|
121
|
+
//
|
|
122
|
+
// The values will still be in the Formik Context, but we need to set them again in useState
|
|
123
|
+
if (value) {
|
|
124
|
+
value.getDate() && setDay(value.getDate());
|
|
125
|
+
|
|
126
|
+
// months are zero-indexed
|
|
127
|
+
value.getMonth() !== undefined && setMonth(value.getMonth() + 1);
|
|
128
|
+
value.getFullYear() && setYear(value.getFullYear());
|
|
129
|
+
}
|
|
130
|
+
|
|
119
131
|
// All options are filled, start validation
|
|
120
132
|
if (required && (!day || !month || !year)) {
|
|
121
133
|
setFieldError(fieldName, requiredError);
|
|
@@ -20,12 +20,12 @@ var Number = function Number(props) {
|
|
|
20
20
|
return requiredError || t(['webform.number.required', 'webform.required', 'webform_required']);
|
|
21
21
|
}
|
|
22
22
|
if (min && parseInt(value) < min) {
|
|
23
|
-
return t(['webform.number.min', 'webform.min', 'webform_min'], {
|
|
23
|
+
return t(['webform.components.number.min', 'webform.number.min', 'webform.min', 'webform_min'], {
|
|
24
24
|
min: min
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
if (max && parseInt(value) > max) {
|
|
28
|
-
return t(['webform.number.max', 'webform.max', 'webform_max'], {
|
|
28
|
+
return t(['webform.components.number.max', 'webform.number.max', 'webform.max', 'webform_max'], {
|
|
29
29
|
max: max
|
|
30
30
|
});
|
|
31
31
|
}
|