@uncinc/uncinc-react-kitchen-sink 2.11.11 → 2.11.13
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.
|
@@ -117,18 +117,25 @@ var DateSelect = function DateSelect(props) {
|
|
|
117
117
|
|
|
118
118
|
// Validation and setting either an error or the FieldValue
|
|
119
119
|
useEffect(function () {
|
|
120
|
-
|
|
120
|
+
if (hideYear) {
|
|
121
|
+
setYear(fixedYear || new Date().getFullYear());
|
|
122
|
+
}
|
|
121
123
|
|
|
122
124
|
// In some cases, this element can re-render while there's already a value in the Formik Context.
|
|
123
125
|
// For example, when we build a Webform with multiplate pages, and you go báck a page.
|
|
124
126
|
//
|
|
125
127
|
// The values will still be in the Formik Context, but we need to set them again in useState
|
|
126
128
|
if (value) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
if (!day && value.getDate()) {
|
|
130
|
+
setDay(value.getDate());
|
|
131
|
+
}
|
|
132
|
+
if (!month && value.getMonth() !== undefined) {
|
|
133
|
+
// months are zero-indexed
|
|
134
|
+
setMonth(value.getMonth() + 1);
|
|
135
|
+
}
|
|
136
|
+
if (!year && value.getFullYear()) {
|
|
137
|
+
setYear(value.getFullYear());
|
|
138
|
+
}
|
|
132
139
|
}
|
|
133
140
|
|
|
134
141
|
// All options are filled, start validation
|
|
@@ -143,6 +150,7 @@ var DateSelect = function DateSelect(props) {
|
|
|
143
150
|
var date = new Date("".concat(year, "-").concat(toTwoDigits(month), "-").concat(toTwoDigits(day)));
|
|
144
151
|
setFieldValue(fieldName, date);
|
|
145
152
|
}
|
|
153
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
146
154
|
}, [isSubmitting, day, month, year]);
|
|
147
155
|
var handleValidation = function handleValidation(value) {
|
|
148
156
|
if (validation && typeof validation === 'function') {
|
|
@@ -48,7 +48,7 @@ var AdaptivePicture = function AdaptivePicture(_ref) {
|
|
|
48
48
|
var container = image.parentElement;
|
|
49
49
|
if (!container) return;
|
|
50
50
|
var resizeObserver = new ResizeObserver(function (entries) {
|
|
51
|
-
// In order to prevent the 'ResizeObserver loop completed with undelivered notifications.'
|
|
51
|
+
// In order to prevent the 'ResizeObserver loop completed with undelivered notifications.'
|
|
52
52
|
// message, debounce handling the ResizeObserver action by adding a timeout.
|
|
53
53
|
clearTimeout(resizingDelayTimer.current);
|
|
54
54
|
resizingDelayTimer.current = setTimeout(function () {
|
|
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { useEffect, useState } from 'react';
|
|
9
|
-
var breakpoints = [256, 512, 1024, 2048];
|
|
9
|
+
var breakpoints = [128, 256, 512, 1024, 2048];
|
|
10
10
|
var mimeTypes = {
|
|
11
11
|
'.gif': 'image/gif',
|
|
12
12
|
'.png': 'image/png',
|