@7shifts/sous-chef 2.5.1 → 2.6.0
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/forms/DatePickerCalendar/DatePickerCalendar.d.ts +2 -0
- package/dist/forms/DateRangeField/DateRangeField.d.ts +3 -1
- package/dist/forms/DateRangeField/FromDate/FromDate.d.ts +3 -2
- package/dist/forms/DateRangeField/ToDate/ToDate.d.ts +3 -1
- package/dist/index.css +3 -3
- package/dist/index.js +159 -23
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +159 -23
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/date.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WeekStart, DateRange } from '../../utils/date';
|
|
2
|
+
import { WeekStart, DateRange, BlockedDays } from '../../utils/date';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
name: string;
|
|
5
5
|
/** If not provided it will generate a random id so the label links properly with the text input */
|
|
6
6
|
id?: string;
|
|
7
7
|
value?: DateRange;
|
|
8
|
+
/** It disable some dates so the user can't click on them. Refer to this [doc](https://react-day-picker.js.org/api/types/matcher) to see what values you can use. */
|
|
9
|
+
disabledDays?: BlockedDays;
|
|
8
10
|
/** Reference this for valid formats: https://date-fns.org/v2.18.0/docs/format */
|
|
9
11
|
format?: string;
|
|
10
12
|
onChange?: (e: DateRange) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { WeekStart } from '../../../utils/date';
|
|
1
|
+
import { WeekStart, BlockedDays } from '../../../utils/date';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
name: string;
|
|
4
4
|
id: string;
|
|
5
5
|
format: string;
|
|
6
|
+
disabledDays?: BlockedDays;
|
|
6
7
|
start?: Date;
|
|
7
8
|
end?: Date;
|
|
8
9
|
placeholder: string;
|
|
@@ -12,5 +13,5 @@ declare type Props = {
|
|
|
12
13
|
onChange: (e: Date) => void;
|
|
13
14
|
onDayClick: () => void;
|
|
14
15
|
};
|
|
15
|
-
declare const FromDate: ({ name, id, format, start, end, placeholder, weekStart, disabled, readOnly, onChange, onDayClick }: Props) => JSX.Element;
|
|
16
|
+
declare const FromDate: ({ name, id, format, disabledDays, start, end, placeholder, weekStart, disabled, readOnly, onChange, onDayClick }: Props) => JSX.Element;
|
|
16
17
|
export default FromDate;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WeekStart } from '../../../utils/date';
|
|
2
|
+
import { WeekStart, BlockedDays } from '../../../utils/date';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
name: string;
|
|
5
5
|
format: string;
|
|
6
|
+
disabledDays?: BlockedDays;
|
|
6
7
|
start?: Date;
|
|
7
8
|
end?: Date;
|
|
8
9
|
placeholder: string;
|
|
@@ -10,6 +11,7 @@ declare type Props = {
|
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
readOnly: boolean;
|
|
12
13
|
onChange: (e: Date) => void;
|
|
14
|
+
onBlur: () => void;
|
|
13
15
|
};
|
|
14
16
|
declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
15
17
|
export default _default;
|
package/dist/index.css
CHANGED
|
@@ -1785,7 +1785,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
1785
1785
|
cursor: default;
|
|
1786
1786
|
}
|
|
1787
1787
|
|
|
1788
|
-
._276GV {
|
|
1788
|
+
._276GV:not(._3vJkw) {
|
|
1789
1789
|
color: #c1c1c1;
|
|
1790
1790
|
cursor: default;
|
|
1791
1791
|
}
|
|
@@ -2003,7 +2003,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
2003
2003
|
cursor: default;
|
|
2004
2004
|
}
|
|
2005
2005
|
|
|
2006
|
-
._CRqyX {
|
|
2006
|
+
._CRqyX:not(._2pgnH) {
|
|
2007
2007
|
color: #c1c1c1;
|
|
2008
2008
|
cursor: default;
|
|
2009
2009
|
}
|
|
@@ -2331,7 +2331,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
2331
2331
|
cursor: default;
|
|
2332
2332
|
}
|
|
2333
2333
|
|
|
2334
|
-
._1PIJa {
|
|
2334
|
+
._1PIJa:not(._1M4ZF) {
|
|
2335
2335
|
color: #c1c1c1;
|
|
2336
2336
|
cursor: default;
|
|
2337
2337
|
}
|
package/dist/index.js
CHANGED
|
@@ -5117,8 +5117,17 @@ var DatePickerCalendar = function DatePickerCalendar(_ref) {
|
|
|
5117
5117
|
children = _ref.children,
|
|
5118
5118
|
onBlur = _ref.onBlur,
|
|
5119
5119
|
onFocus = _ref.onFocus,
|
|
5120
|
-
tabIndex = _ref.tabIndex
|
|
5120
|
+
tabIndex = _ref.tabIndex,
|
|
5121
|
+
showCalendar = _ref.showCalendar,
|
|
5122
|
+
onClickOutside = _ref.onClickOutside;
|
|
5121
5123
|
var inputPosition = inputNode.getBoundingClientRect();
|
|
5124
|
+
var calendarRef = React.useRef(null);
|
|
5125
|
+
useOnClickOutside(calendarRef, onClickOutside);
|
|
5126
|
+
|
|
5127
|
+
if (!showCalendar) {
|
|
5128
|
+
return null;
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5122
5131
|
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
5123
5132
|
className: classNames.overlayWrapper,
|
|
5124
5133
|
onBlur: onBlur,
|
|
@@ -5128,7 +5137,8 @@ var DatePickerCalendar = function DatePickerCalendar(_ref) {
|
|
|
5128
5137
|
zIndex: 9999,
|
|
5129
5138
|
left: inputPosition.left,
|
|
5130
5139
|
top: inputPosition.top + window.scrollY + inputPosition.height + 3
|
|
5131
|
-
}
|
|
5140
|
+
},
|
|
5141
|
+
ref: calendarRef
|
|
5132
5142
|
}, React__default.createElement("div", {
|
|
5133
5143
|
className: classNames.overlay
|
|
5134
5144
|
}, children)));
|
|
@@ -5198,6 +5208,11 @@ var DateField = function DateField(_ref) {
|
|
|
5198
5208
|
_ref$readOnly = _ref.readOnly,
|
|
5199
5209
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
5200
5210
|
var inputRef = React.useRef();
|
|
5211
|
+
|
|
5212
|
+
var _useState = React.useState(false),
|
|
5213
|
+
showCalendar = _useState[0],
|
|
5214
|
+
setShowCalendar = _useState[1];
|
|
5215
|
+
|
|
5201
5216
|
var controllers = useDateFieldControllers({
|
|
5202
5217
|
name: name,
|
|
5203
5218
|
id: inputId,
|
|
@@ -5239,10 +5254,17 @@ var DateField = function DateField(_ref) {
|
|
|
5239
5254
|
defaultValue: defaultValue,
|
|
5240
5255
|
value: controllers.value || '',
|
|
5241
5256
|
onDayChange: controllers.onChange,
|
|
5242
|
-
onDayPickerHide:
|
|
5257
|
+
onDayPickerHide: function onDayPickerHide() {
|
|
5258
|
+
controllers.onBlur();
|
|
5259
|
+
setShowCalendar(false);
|
|
5260
|
+
},
|
|
5243
5261
|
overlayComponent: function overlayComponent(props) {
|
|
5244
5262
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5245
|
-
inputNode: inputRef.current
|
|
5263
|
+
inputNode: inputRef.current,
|
|
5264
|
+
showCalendar: showCalendar,
|
|
5265
|
+
onClickOutside: function onClickOutside() {
|
|
5266
|
+
return setShowCalendar(false);
|
|
5267
|
+
}
|
|
5246
5268
|
}));
|
|
5247
5269
|
},
|
|
5248
5270
|
dayPickerProps: dayPickerProps,
|
|
@@ -5256,7 +5278,13 @@ var DateField = function DateField(_ref) {
|
|
|
5256
5278
|
autoComplete: 'off',
|
|
5257
5279
|
ref: inputRef,
|
|
5258
5280
|
readOnly: readOnly,
|
|
5259
|
-
disabled: disabled
|
|
5281
|
+
disabled: disabled,
|
|
5282
|
+
onFocus: function onFocus() {
|
|
5283
|
+
return setShowCalendar(true);
|
|
5284
|
+
}
|
|
5285
|
+
},
|
|
5286
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5287
|
+
return setShowCalendar(true);
|
|
5260
5288
|
}
|
|
5261
5289
|
})));
|
|
5262
5290
|
};
|
|
@@ -5294,7 +5322,7 @@ var useRangeFieldControllers = function useRangeFieldControllers(_ref) {
|
|
|
5294
5322
|
|
|
5295
5323
|
if (formik && formikState) {
|
|
5296
5324
|
return _extends({}, initialControllers, {
|
|
5297
|
-
error: error !== undefined ? initialControllers.error : formikState.error,
|
|
5325
|
+
error: error !== undefined ? initialControllers.error : getFormikError(formikState.error),
|
|
5298
5326
|
value: value !== undefined ? initialControllers.value : formikState.value,
|
|
5299
5327
|
onChange: _onChange ? initialControllers.onChange : function (newValue) {
|
|
5300
5328
|
formik.setFieldValue(name, newValue === undefined ? null : newValue);
|
|
@@ -5308,12 +5336,33 @@ var useRangeFieldControllers = function useRangeFieldControllers(_ref) {
|
|
|
5308
5336
|
return initialControllers;
|
|
5309
5337
|
};
|
|
5310
5338
|
|
|
5339
|
+
var getFormikError = function getFormikError(error) {
|
|
5340
|
+
if (!error) {
|
|
5341
|
+
return undefined;
|
|
5342
|
+
}
|
|
5343
|
+
|
|
5344
|
+
if (typeof error === 'string') {
|
|
5345
|
+
return error;
|
|
5346
|
+
}
|
|
5347
|
+
|
|
5348
|
+
if (error.start) {
|
|
5349
|
+
return error.start;
|
|
5350
|
+
}
|
|
5351
|
+
|
|
5352
|
+
if (error.end) {
|
|
5353
|
+
return error.end;
|
|
5354
|
+
}
|
|
5355
|
+
|
|
5356
|
+
return undefined;
|
|
5357
|
+
};
|
|
5358
|
+
|
|
5311
5359
|
var styles$s = {"container":"_1Ini2","wrapper":"_21VnL","interactionDisabled":"_wJ6Cb","DayPicker-Day":"_1c48y","navBar":"_3KwsN","todayButton":"_10CBO","navButtonInteractionDisabled":"_dHL-D","navButtonPrev":"_6kNi3","navButtonNext":"_13W_e","months":"_1FeSY","month":"_wU6A4","caption":"_AMbAo","weekdays":"_1LEst","weekdaysRow":"_2XECo","weekday":"_1C5ry","body":"_11F-Y","week":"_3MAFk","day":"_mG73F","disabled":"_2pgnH","selected":"_MtLaz","outside":"_CRqyX","footer":"_2KG9-","today":"_2JA2y","overlayWrapper":"_1JWbc","overlay":"_2tL6g","weekNumber":"_3u72O","text-field":"_25rf7","date-range-field":"_3qVhi","text-field--invalid":"_2M9Ud","text-field--prefixed":"_3TUb2","text-field--suffixed":"_foqL0","date-range-field--invalid":"_3df9R","date-range-field--disabled":"_2Nkht"};
|
|
5312
5360
|
|
|
5313
5361
|
var FromDate = function FromDate(_ref) {
|
|
5314
5362
|
var name = _ref.name,
|
|
5315
5363
|
id = _ref.id,
|
|
5316
5364
|
format = _ref.format,
|
|
5365
|
+
disabledDays = _ref.disabledDays,
|
|
5317
5366
|
start = _ref.start,
|
|
5318
5367
|
end = _ref.end,
|
|
5319
5368
|
placeholder = _ref.placeholder,
|
|
@@ -5321,12 +5370,29 @@ var FromDate = function FromDate(_ref) {
|
|
|
5321
5370
|
disabled = _ref.disabled,
|
|
5322
5371
|
readOnly = _ref.readOnly,
|
|
5323
5372
|
onChange = _ref.onChange,
|
|
5324
|
-
|
|
5373
|
+
_onDayClick = _ref.onDayClick;
|
|
5374
|
+
|
|
5375
|
+
var _useState = React.useState(false),
|
|
5376
|
+
showCalendar = _useState[0],
|
|
5377
|
+
setShowCalendar = _useState[1];
|
|
5378
|
+
|
|
5325
5379
|
var inputRef = React.useRef();
|
|
5326
5380
|
var modifiers = {
|
|
5327
5381
|
from: start,
|
|
5328
5382
|
to: end
|
|
5329
5383
|
};
|
|
5384
|
+
var disabledDaysChecks = end ? [{
|
|
5385
|
+
after: end
|
|
5386
|
+
}] : [];
|
|
5387
|
+
|
|
5388
|
+
if (disabledDays) {
|
|
5389
|
+
if (Array.isArray(disabledDays)) {
|
|
5390
|
+
disabledDaysChecks.push.apply(disabledDaysChecks, disabledDays);
|
|
5391
|
+
} else {
|
|
5392
|
+
disabledDaysChecks.push(disabledDays);
|
|
5393
|
+
}
|
|
5394
|
+
}
|
|
5395
|
+
|
|
5330
5396
|
var dayPickerProps = {
|
|
5331
5397
|
classNames: styles$s,
|
|
5332
5398
|
months: MONTH_NAMES,
|
|
@@ -5340,12 +5406,18 @@ var FromDate = function FromDate(_ref) {
|
|
|
5340
5406
|
from: start,
|
|
5341
5407
|
to: end
|
|
5342
5408
|
}],
|
|
5343
|
-
disabledDays:
|
|
5344
|
-
after: end
|
|
5345
|
-
},
|
|
5409
|
+
disabledDays: disabledDaysChecks,
|
|
5346
5410
|
toMonth: end,
|
|
5347
5411
|
modifiers: modifiers,
|
|
5348
|
-
onDayClick: onDayClick
|
|
5412
|
+
onDayClick: function onDayClick(_, activeModifiers) {
|
|
5413
|
+
var isDateDisabled = Object.keys(activeModifiers).find(function (modifier) {
|
|
5414
|
+
return modifier;
|
|
5415
|
+
});
|
|
5416
|
+
|
|
5417
|
+
if (!Boolean(isDateDisabled)) {
|
|
5418
|
+
_onDayClick();
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5349
5421
|
};
|
|
5350
5422
|
return React__default.createElement(DayPickerInput, {
|
|
5351
5423
|
format: format,
|
|
@@ -5356,9 +5428,16 @@ var FromDate = function FromDate(_ref) {
|
|
|
5356
5428
|
parseDate: parseDate,
|
|
5357
5429
|
placeholder: placeholder,
|
|
5358
5430
|
onDayChange: onChange,
|
|
5431
|
+
onDayPickerHide: function onDayPickerHide() {
|
|
5432
|
+
return setShowCalendar(false);
|
|
5433
|
+
},
|
|
5359
5434
|
overlayComponent: function overlayComponent(props) {
|
|
5360
5435
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5361
|
-
inputNode: inputRef.current
|
|
5436
|
+
inputNode: inputRef.current,
|
|
5437
|
+
showCalendar: showCalendar,
|
|
5438
|
+
onClickOutside: function onClickOutside() {
|
|
5439
|
+
return setShowCalendar(false);
|
|
5440
|
+
}
|
|
5362
5441
|
}));
|
|
5363
5442
|
},
|
|
5364
5443
|
dayPickerProps: dayPickerProps,
|
|
@@ -5370,7 +5449,13 @@ var FromDate = function FromDate(_ref) {
|
|
|
5370
5449
|
readOnly: readOnly,
|
|
5371
5450
|
disabled: disabled,
|
|
5372
5451
|
'data-testid': "range-picker-field-from-" + name,
|
|
5373
|
-
type: 'text'
|
|
5452
|
+
type: 'text',
|
|
5453
|
+
onFocus: function onFocus() {
|
|
5454
|
+
return setShowCalendar(true);
|
|
5455
|
+
}
|
|
5456
|
+
},
|
|
5457
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5458
|
+
return setShowCalendar(true);
|
|
5374
5459
|
}
|
|
5375
5460
|
});
|
|
5376
5461
|
};
|
|
@@ -5378,17 +5463,36 @@ var FromDate = function FromDate(_ref) {
|
|
|
5378
5463
|
var ToDate = function ToDate(_ref, ref) {
|
|
5379
5464
|
var name = _ref.name,
|
|
5380
5465
|
format = _ref.format,
|
|
5466
|
+
disabledDays = _ref.disabledDays,
|
|
5381
5467
|
start = _ref.start,
|
|
5382
5468
|
end = _ref.end,
|
|
5383
5469
|
placeholder = _ref.placeholder,
|
|
5384
5470
|
weekStart = _ref.weekStart,
|
|
5385
5471
|
disabled = _ref.disabled,
|
|
5386
5472
|
readOnly = _ref.readOnly,
|
|
5387
|
-
onChange = _ref.onChange
|
|
5473
|
+
onChange = _ref.onChange,
|
|
5474
|
+
_onBlur = _ref.onBlur;
|
|
5475
|
+
|
|
5476
|
+
var _useState = React.useState(false),
|
|
5477
|
+
showCalendar = _useState[0],
|
|
5478
|
+
setShowCalendar = _useState[1];
|
|
5479
|
+
|
|
5388
5480
|
var modifiers = {
|
|
5389
5481
|
from: start,
|
|
5390
5482
|
to: end
|
|
5391
5483
|
};
|
|
5484
|
+
var disabledDaysChecks = start ? [{
|
|
5485
|
+
before: start
|
|
5486
|
+
}] : [];
|
|
5487
|
+
|
|
5488
|
+
if (disabledDays) {
|
|
5489
|
+
if (Array.isArray(disabledDays)) {
|
|
5490
|
+
disabledDaysChecks.push.apply(disabledDaysChecks, disabledDays);
|
|
5491
|
+
} else {
|
|
5492
|
+
disabledDaysChecks.push(disabledDays);
|
|
5493
|
+
}
|
|
5494
|
+
}
|
|
5495
|
+
|
|
5392
5496
|
var dayPickerProps = {
|
|
5393
5497
|
classNames: styles$s,
|
|
5394
5498
|
months: MONTH_NAMES,
|
|
@@ -5402,9 +5506,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5402
5506
|
from: start,
|
|
5403
5507
|
to: end
|
|
5404
5508
|
}],
|
|
5405
|
-
disabledDays:
|
|
5406
|
-
before: start
|
|
5407
|
-
},
|
|
5509
|
+
disabledDays: disabledDaysChecks,
|
|
5408
5510
|
modifiers: modifiers,
|
|
5409
5511
|
month: end || start,
|
|
5410
5512
|
fromMonth: start
|
|
@@ -5418,9 +5520,16 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5418
5520
|
parseDate: parseDate,
|
|
5419
5521
|
placeholder: placeholder,
|
|
5420
5522
|
onDayChange: onChange,
|
|
5523
|
+
onDayPickerHide: function onDayPickerHide() {
|
|
5524
|
+
return setShowCalendar(false);
|
|
5525
|
+
},
|
|
5421
5526
|
overlayComponent: function overlayComponent(props) {
|
|
5422
5527
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5423
|
-
inputNode: ref === null || ref === void 0 ? void 0 : ref.current
|
|
5528
|
+
inputNode: ref === null || ref === void 0 ? void 0 : ref.current,
|
|
5529
|
+
showCalendar: showCalendar,
|
|
5530
|
+
onClickOutside: function onClickOutside() {
|
|
5531
|
+
return setShowCalendar(false);
|
|
5532
|
+
}
|
|
5424
5533
|
}));
|
|
5425
5534
|
},
|
|
5426
5535
|
dayPickerProps: dayPickerProps,
|
|
@@ -5431,7 +5540,16 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5431
5540
|
readOnly: readOnly,
|
|
5432
5541
|
disabled: disabled,
|
|
5433
5542
|
'data-testid': "range-picker-field-to-" + name,
|
|
5434
|
-
type: 'text'
|
|
5543
|
+
type: 'text',
|
|
5544
|
+
onFocus: function onFocus() {
|
|
5545
|
+
return setShowCalendar(true);
|
|
5546
|
+
},
|
|
5547
|
+
onBlur: function onBlur() {
|
|
5548
|
+
setTimeout(_onBlur, 200);
|
|
5549
|
+
}
|
|
5550
|
+
},
|
|
5551
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5552
|
+
return setShowCalendar(true);
|
|
5435
5553
|
}
|
|
5436
5554
|
});
|
|
5437
5555
|
};
|
|
@@ -5439,11 +5557,12 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5439
5557
|
var ToDate$1 = React.forwardRef(ToDate);
|
|
5440
5558
|
|
|
5441
5559
|
var DateRangeField = function DateRangeField(_ref) {
|
|
5442
|
-
var _classnames
|
|
5560
|
+
var _classnames;
|
|
5443
5561
|
|
|
5444
5562
|
var name = _ref.name,
|
|
5445
5563
|
inputId = _ref.id,
|
|
5446
5564
|
value = _ref.value,
|
|
5565
|
+
disabledDays = _ref.disabledDays,
|
|
5447
5566
|
_ref$format = _ref.format,
|
|
5448
5567
|
format = _ref$format === void 0 ? 'MM/dd/yyyy' : _ref$format,
|
|
5449
5568
|
onChange = _ref.onChange,
|
|
@@ -5478,7 +5597,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
5478
5597
|
start = _controllers$value.start,
|
|
5479
5598
|
end = _controllers$value.end;
|
|
5480
5599
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
5481
|
-
className: classnames(styles$s['date-range-field'], (_classnames = {}, _classnames[styles$s['date-range-field--invalid']] = hasError, _classnames
|
|
5600
|
+
className: classnames(styles$s['date-range-field'], (_classnames = {}, _classnames[styles$s['date-range-field--invalid']] = hasError, _classnames[styles$s['date-range-field--disabled']] = disabled, _classnames))
|
|
5482
5601
|
}, React__default.createElement(IconCalendarAlt, {
|
|
5483
5602
|
size: "medium",
|
|
5484
5603
|
color: GREY400
|
|
@@ -5491,6 +5610,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
5491
5610
|
placeholder: placeholder || format.toUpperCase(),
|
|
5492
5611
|
weekStart: weekStart,
|
|
5493
5612
|
disabled: disabled,
|
|
5613
|
+
disabledDays: disabledDays,
|
|
5494
5614
|
readOnly: readOnly,
|
|
5495
5615
|
onChange: function onChange(val) {
|
|
5496
5616
|
return controllers.onChange({
|
|
@@ -5514,7 +5634,9 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
5514
5634
|
placeholder: placeholder || format.toUpperCase(),
|
|
5515
5635
|
weekStart: weekStart,
|
|
5516
5636
|
disabled: disabled,
|
|
5637
|
+
disabledDays: disabledDays,
|
|
5517
5638
|
readOnly: readOnly,
|
|
5639
|
+
onBlur: controllers.onBlur,
|
|
5518
5640
|
onChange: function onChange(val) {
|
|
5519
5641
|
return controllers.onChange({
|
|
5520
5642
|
start: start,
|
|
@@ -5554,6 +5676,10 @@ var WeekField = function WeekField(_ref) {
|
|
|
5554
5676
|
hoverDate = _useState[0],
|
|
5555
5677
|
setHoverDate = _useState[1];
|
|
5556
5678
|
|
|
5679
|
+
var _useState2 = React.useState(false),
|
|
5680
|
+
showCalendar = _useState2[0],
|
|
5681
|
+
setShowCalendar = _useState2[1];
|
|
5682
|
+
|
|
5557
5683
|
var inputRef = React.useRef();
|
|
5558
5684
|
var controllers = useDateFieldControllers({
|
|
5559
5685
|
name: name,
|
|
@@ -5636,7 +5762,11 @@ var WeekField = function WeekField(_ref) {
|
|
|
5636
5762
|
onDayPickerHide: controllers.onBlur,
|
|
5637
5763
|
overlayComponent: function overlayComponent(props) {
|
|
5638
5764
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5639
|
-
inputNode: inputRef.current
|
|
5765
|
+
inputNode: inputRef.current,
|
|
5766
|
+
showCalendar: showCalendar,
|
|
5767
|
+
onClickOutside: function onClickOutside() {
|
|
5768
|
+
return setShowCalendar(false);
|
|
5769
|
+
}
|
|
5640
5770
|
}));
|
|
5641
5771
|
},
|
|
5642
5772
|
dayPickerProps: dayPickerProps,
|
|
@@ -5650,7 +5780,13 @@ var WeekField = function WeekField(_ref) {
|
|
|
5650
5780
|
autoComplete: 'off',
|
|
5651
5781
|
ref: inputRef,
|
|
5652
5782
|
readOnly: readOnly,
|
|
5653
|
-
disabled: disabled
|
|
5783
|
+
disabled: disabled,
|
|
5784
|
+
onFocus: function onFocus() {
|
|
5785
|
+
return setShowCalendar(true);
|
|
5786
|
+
}
|
|
5787
|
+
},
|
|
5788
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5789
|
+
return setShowCalendar(true);
|
|
5654
5790
|
}
|
|
5655
5791
|
})));
|
|
5656
5792
|
};
|