@7shifts/sous-chef 3.31.1-beta2 → 3.31.1-beta4
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.js +22 -7
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +22 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/overlay/Calendar/Calendar.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6457,7 +6457,8 @@ var Calendar = function Calendar(_ref) {
|
|
|
6457
6457
|
disabledDays = _ref.disabledDays,
|
|
6458
6458
|
anchorRef = _ref.anchorRef,
|
|
6459
6459
|
testId = _ref.testId,
|
|
6460
|
-
onMonthChange = _ref.onMonthChange
|
|
6460
|
+
onMonthChange = _ref.onMonthChange,
|
|
6461
|
+
id = _ref.id;
|
|
6461
6462
|
var _useState = React.useState(null),
|
|
6462
6463
|
calendarRef = _useState[0],
|
|
6463
6464
|
setCalendarRef = _useState[1];
|
|
@@ -6520,7 +6521,9 @@ var Calendar = function Calendar(_ref) {
|
|
|
6520
6521
|
}
|
|
6521
6522
|
};
|
|
6522
6523
|
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
6523
|
-
className: styles$G['calendar']
|
|
6524
|
+
className: styles$G['calendar'],
|
|
6525
|
+
id: id,
|
|
6526
|
+
tabIndex: 1
|
|
6524
6527
|
}, React__default.createElement("div", {
|
|
6525
6528
|
className: styles$G['calendar__overlay'],
|
|
6526
6529
|
ref: function ref(_ref2) {
|
|
@@ -9082,6 +9085,7 @@ var DateField = function DateField(_ref) {
|
|
|
9082
9085
|
onMonthChange = _ref.onMonthChange,
|
|
9083
9086
|
testId = _ref.testId,
|
|
9084
9087
|
weekStart = _ref.weekStart;
|
|
9088
|
+
var calendarId = name + "-calendar";
|
|
9085
9089
|
var maskfy = useFieldMask(format);
|
|
9086
9090
|
var inputRef = React.useRef(null);
|
|
9087
9091
|
var _useState = React.useState(false),
|
|
@@ -9146,9 +9150,6 @@ var DateField = function DateField(_ref) {
|
|
|
9146
9150
|
onFocus: function onFocus(e) {
|
|
9147
9151
|
setShowCalendar(true);
|
|
9148
9152
|
maskfy(e.target);
|
|
9149
|
-
setTimeout(function () {
|
|
9150
|
-
e.target.setSelectionRange(0, 0);
|
|
9151
|
-
}, 10);
|
|
9152
9153
|
},
|
|
9153
9154
|
onClick: function onClick() {
|
|
9154
9155
|
return setShowCalendar(true);
|
|
@@ -9161,7 +9162,20 @@ var DateField = function DateField(_ref) {
|
|
|
9161
9162
|
controllers.onChange(parsedDate);
|
|
9162
9163
|
}
|
|
9163
9164
|
},
|
|
9164
|
-
onBlur:
|
|
9165
|
+
onBlur: function onBlur(event) {
|
|
9166
|
+
setTimeout(function () {
|
|
9167
|
+
var calendar = document.getElementById(calendarId);
|
|
9168
|
+
if (!calendar || calendar.contains(document.activeElement)) {
|
|
9169
|
+
return;
|
|
9170
|
+
}
|
|
9171
|
+
var parsedDate = parseDate(event.target.value, format);
|
|
9172
|
+
if (!parsedDate) {
|
|
9173
|
+
controllers.onChange(undefined);
|
|
9174
|
+
}
|
|
9175
|
+
controllers.onBlur();
|
|
9176
|
+
setShowCalendar(false);
|
|
9177
|
+
}, 100);
|
|
9178
|
+
},
|
|
9165
9179
|
defaultValue: getDefaultValue()
|
|
9166
9180
|
})), showCalendar && React__default.createElement(Calendar, {
|
|
9167
9181
|
onSelect: function onSelect(date) {
|
|
@@ -9184,7 +9198,8 @@ var DateField = function DateField(_ref) {
|
|
|
9184
9198
|
initialMonth: initialMonth,
|
|
9185
9199
|
onMonthChange: onMonthChange,
|
|
9186
9200
|
weekStart: weekStart,
|
|
9187
|
-
key: selectedDate ? formatDate(selectedDate, format) : ''
|
|
9201
|
+
key: selectedDate ? formatDate(selectedDate, format) : '',
|
|
9202
|
+
id: calendarId
|
|
9188
9203
|
}));
|
|
9189
9204
|
};
|
|
9190
9205
|
|