@docsvision/material-ui-pickers 3.2.0-beta.27 → 3.2.0-beta.29
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/DatePicker/DatePickerToolbar.js +3 -3
- package/DateTimePicker/DateTimePicker.d.ts +2 -2
- package/DateTimePicker/DateTimePicker.js +2 -2
- package/DateTimePicker/DateTimePickerToolbar.js +4 -4
- package/MuiPickersUtilsProvider.d.ts +1 -1
- package/MuiPickersUtilsProvider.js +11 -5
- package/Picker/Picker.d.ts +3 -3
- package/Picker/Picker.js +1 -1
- package/Picker/WrappedPurePicker.js +2 -1
- package/TimePicker/TimePicker.d.ts +4 -2
- package/TimePicker/TimePicker.js +2 -2
- package/TimePicker/TimePickerToolbar.js +3 -3
- package/_helpers/date-utils.d.ts +2 -2
- package/_helpers/date-utils.js +3 -3
- package/_helpers/text-field-helper.d.ts +3 -3
- package/_helpers/text-field-helper.js +1 -1
- package/_helpers/time-utils.d.ts +2 -2
- package/_shared/WithUtils.d.ts +1 -1
- package/_shared/hooks/useKeyboardPickerState.js +1 -1
- package/_shared/hooks/useUtils.d.ts +2 -2
- package/dist/material-ui-pickers.esm.js +1195 -835
- package/dist/material-ui-pickers.esm.js.map +1 -1
- package/dist/material-ui-pickers.js +1195 -835
- package/dist/material-ui-pickers.js.map +1 -1
- package/dist/material-ui-pickers.umd.js +6017 -834
- package/dist/material-ui-pickers.umd.min.js +1 -1
- package/index.d.ts +11 -11
- package/package.json +6 -6
- package/typings/BasePicker.d.ts +1 -1
- package/views/Calendar/Calendar.js +1 -1
- package/views/Calendar/CalendarHeader.js +1 -1
- package/views/Clock/Clock.js +1 -1
- package/views/Clock/ClockNumbers.d.ts +2 -2
- package/views/Clock/ClockView.js +1 -1
- package/views/Month/MonthView.js +1 -1
- package/views/Year/YearView.js +2 -2
|
@@ -8,6 +8,7 @@ var tslib = require('tslib');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var React__default = _interopDefault(React);
|
|
10
10
|
var PropTypes = require('prop-types');
|
|
11
|
+
var MomentUtils = _interopDefault(require('@date-io/moment'));
|
|
11
12
|
var clsx = _interopDefault(require('clsx'));
|
|
12
13
|
var Typography = _interopDefault(require('@material-ui/core/Typography'));
|
|
13
14
|
var styles$5 = require('@material-ui/core/styles');
|
|
@@ -28,22 +29,33 @@ var Tab = _interopDefault(require('@material-ui/core/Tab'));
|
|
|
28
29
|
var Tabs = _interopDefault(require('@material-ui/core/Tabs'));
|
|
29
30
|
var Paper = _interopDefault(require('@material-ui/core/Paper'));
|
|
30
31
|
|
|
31
|
-
var MuiPickersContext =
|
|
32
|
-
|
|
32
|
+
var MuiPickersContext =
|
|
33
|
+
/*#__PURE__*/
|
|
34
|
+
React.createContext(null);
|
|
35
|
+
var MuiPickersUtilsProvider = function MuiPickersUtilsProvider(_a) {
|
|
33
36
|
var Utils = _a.utils,
|
|
34
37
|
children = _a.children,
|
|
35
38
|
locale = _a.locale,
|
|
36
39
|
libInstance = _a.libInstance;
|
|
37
40
|
var utils = React.useMemo(function () {
|
|
38
|
-
|
|
41
|
+
var instance = new Utils({
|
|
39
42
|
locale: locale,
|
|
40
43
|
moment: libInstance
|
|
41
44
|
});
|
|
45
|
+
|
|
46
|
+
if (instance instanceof MomentUtils) {
|
|
47
|
+
instance.moment.locale(locale);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return instance;
|
|
42
51
|
}, [Utils, libInstance, locale]);
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
return (
|
|
53
|
+
/*#__PURE__*/
|
|
54
|
+
React.createElement(MuiPickersContext.Provider, {
|
|
55
|
+
value: utils,
|
|
56
|
+
children: children
|
|
57
|
+
})
|
|
58
|
+
);
|
|
47
59
|
};
|
|
48
60
|
process.env.NODE_ENV !== "production" ? MuiPickersUtilsProvider.propTypes = {
|
|
49
61
|
utils: PropTypes.func.isRequired,
|
|
@@ -51,7 +63,7 @@ process.env.NODE_ENV !== "production" ? MuiPickersUtilsProvider.propTypes = {
|
|
|
51
63
|
children: PropTypes.oneOfType([PropTypes.element.isRequired, PropTypes.arrayOf(PropTypes.element.isRequired)]).isRequired
|
|
52
64
|
} : void 0;
|
|
53
65
|
|
|
54
|
-
var checkUtils = function (utils) {
|
|
66
|
+
var checkUtils = function checkUtils(utils) {
|
|
55
67
|
if (!utils) {
|
|
56
68
|
// tslint:disable-next-line
|
|
57
69
|
throw new Error('Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.');
|
|
@@ -64,7 +76,7 @@ function useUtils() {
|
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
var useStyles = styles$5.makeStyles(function (theme) {
|
|
67
|
-
var textColor = theme.palette.type === 'light' ? theme.palette.primary.contrastText : theme.palette.getContrastText(theme.palette.background
|
|
79
|
+
var textColor = theme.palette.type === 'light' ? theme.palette.primary.contrastText : theme.palette.getContrastText(theme.palette.background["default"]);
|
|
68
80
|
return {
|
|
69
81
|
toolbarTxt: {
|
|
70
82
|
color: styles$5.fade(textColor, 0.54)
|
|
@@ -77,7 +89,7 @@ var useStyles = styles$5.makeStyles(function (theme) {
|
|
|
77
89
|
name: 'MuiPickersToolbarText'
|
|
78
90
|
});
|
|
79
91
|
|
|
80
|
-
var ToolbarText = function (_a) {
|
|
92
|
+
var ToolbarText = function ToolbarText(_a) {
|
|
81
93
|
var _b;
|
|
82
94
|
|
|
83
95
|
var selected = _a.selected,
|
|
@@ -87,13 +99,16 @@ var ToolbarText = function (_a) {
|
|
|
87
99
|
other = tslib.__rest(_a, ["selected", "label", "className"]);
|
|
88
100
|
|
|
89
101
|
var classes = useStyles();
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
return (
|
|
103
|
+
/*#__PURE__*/
|
|
104
|
+
React.createElement(Typography, tslib.__assign({
|
|
105
|
+
children: label,
|
|
106
|
+
className: clsx(classes.toolbarTxt, className, (_b = {}, _b[classes.toolbarBtnSelected] = selected, _b))
|
|
107
|
+
}, other))
|
|
108
|
+
);
|
|
94
109
|
};
|
|
95
110
|
|
|
96
|
-
var ToolbarButton = function (_a) {
|
|
111
|
+
var ToolbarButton = function ToolbarButton(_a) {
|
|
97
112
|
var classes = _a.classes,
|
|
98
113
|
_b = _a.className,
|
|
99
114
|
className = _b === void 0 ? null : _b,
|
|
@@ -104,16 +119,21 @@ var ToolbarButton = function (_a) {
|
|
|
104
119
|
typographyClassName = _a.typographyClassName,
|
|
105
120
|
other = tslib.__rest(_a, ["classes", "className", "label", "selected", "variant", "align", "typographyClassName"]);
|
|
106
121
|
|
|
107
|
-
return
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
return (
|
|
123
|
+
/*#__PURE__*/
|
|
124
|
+
React.createElement(Button, tslib.__assign({
|
|
125
|
+
variant: "text",
|
|
126
|
+
className: clsx(classes.toolbarBtn, className)
|
|
127
|
+
}, other),
|
|
128
|
+
/*#__PURE__*/
|
|
129
|
+
React.createElement(ToolbarText, {
|
|
130
|
+
align: align,
|
|
131
|
+
className: typographyClassName,
|
|
132
|
+
variant: variant,
|
|
133
|
+
label: label,
|
|
134
|
+
selected: selected
|
|
135
|
+
}))
|
|
136
|
+
);
|
|
117
137
|
};
|
|
118
138
|
|
|
119
139
|
process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
|
|
@@ -145,7 +165,7 @@ var useStyles$1 = styles$5.makeStyles(function (theme) {
|
|
|
145
165
|
alignItems: 'center',
|
|
146
166
|
justifyContent: 'center',
|
|
147
167
|
height: 100,
|
|
148
|
-
backgroundColor: theme.palette.type === 'light' ? theme.palette.primary.main : theme.palette.background
|
|
168
|
+
backgroundColor: theme.palette.type === 'light' ? theme.palette.primary.main : theme.palette.background["default"]
|
|
149
169
|
},
|
|
150
170
|
toolbarLandscape: {
|
|
151
171
|
height: 'auto',
|
|
@@ -158,7 +178,7 @@ var useStyles$1 = styles$5.makeStyles(function (theme) {
|
|
|
158
178
|
name: 'MuiPickersToolbar'
|
|
159
179
|
});
|
|
160
180
|
|
|
161
|
-
var PickerToolbar = function (_a) {
|
|
181
|
+
var PickerToolbar = function PickerToolbar(_a) {
|
|
162
182
|
var _b;
|
|
163
183
|
|
|
164
184
|
var children = _a.children,
|
|
@@ -168,9 +188,12 @@ var PickerToolbar = function (_a) {
|
|
|
168
188
|
other = tslib.__rest(_a, ["children", "isLandscape", "className"]);
|
|
169
189
|
|
|
170
190
|
var classes = useStyles$1();
|
|
171
|
-
return
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
return (
|
|
192
|
+
/*#__PURE__*/
|
|
193
|
+
React.createElement(Toolbar, tslib.__assign({
|
|
194
|
+
className: clsx(classes.toolbar, (_b = {}, _b[classes.toolbarLandscape] = isLandscape, _b), className)
|
|
195
|
+
}, other), children)
|
|
196
|
+
);
|
|
174
197
|
};
|
|
175
198
|
|
|
176
199
|
/** Use it instead of .includes method for IE support */
|
|
@@ -184,7 +207,7 @@ function arrayIncludes(array, itemOrItems) {
|
|
|
184
207
|
return array.indexOf(itemOrItems) !== -1;
|
|
185
208
|
}
|
|
186
209
|
|
|
187
|
-
var findClosestEnabledDate = function (_a) {
|
|
210
|
+
var findClosestEnabledDate = function findClosestEnabledDate(_a) {
|
|
188
211
|
var date = _a.date,
|
|
189
212
|
utils = _a.utils,
|
|
190
213
|
minDate = _a.minDate,
|
|
@@ -246,22 +269,22 @@ var findClosestEnabledDate = function (_a) {
|
|
|
246
269
|
|
|
247
270
|
return null;
|
|
248
271
|
};
|
|
249
|
-
var isYearOnlyView = function (views) {
|
|
272
|
+
var isYearOnlyView = function isYearOnlyView(views) {
|
|
250
273
|
return views.length === 1 && views[0] === 'year';
|
|
251
274
|
};
|
|
252
|
-
var isYearAndMonthViews = function (views) {
|
|
275
|
+
var isYearAndMonthViews = function isYearAndMonthViews(views) {
|
|
253
276
|
return views.length === 2 && arrayIncludes(views, 'month') && arrayIncludes(views, 'year');
|
|
254
277
|
};
|
|
255
|
-
var getFormatByViews = function (views, utils) {
|
|
278
|
+
var getFormatByViews = function getFormatByViews(views, utils) {
|
|
256
279
|
if (isYearOnlyView(views)) {
|
|
257
|
-
return utils.
|
|
280
|
+
return utils.formats.year;
|
|
258
281
|
}
|
|
259
282
|
|
|
260
283
|
if (isYearAndMonthViews(views)) {
|
|
261
|
-
return utils.
|
|
284
|
+
return utils.formats.monthAndYear;
|
|
262
285
|
}
|
|
263
286
|
|
|
264
|
-
return utils.
|
|
287
|
+
return utils.formats.monthAndDate;
|
|
265
288
|
};
|
|
266
289
|
|
|
267
290
|
var useStyles$2 = styles$5.makeStyles({
|
|
@@ -278,7 +301,7 @@ var useStyles$2 = styles$5.makeStyles({
|
|
|
278
301
|
}, {
|
|
279
302
|
name: 'MuiPickersDatePickerRoot'
|
|
280
303
|
});
|
|
281
|
-
var DatePickerToolbar = function (_a) {
|
|
304
|
+
var DatePickerToolbar = function DatePickerToolbar(_a) {
|
|
282
305
|
var _b, _c;
|
|
283
306
|
|
|
284
307
|
var date = _a.date,
|
|
@@ -294,33 +317,42 @@ var DatePickerToolbar = function (_a) {
|
|
|
294
317
|
var isYearAndMonth = React.useMemo(function () {
|
|
295
318
|
return isYearAndMonthViews(views);
|
|
296
319
|
}, [views]);
|
|
297
|
-
return
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
onClick: function () {
|
|
303
|
-
return setOpenView('year');
|
|
304
|
-
},
|
|
305
|
-
selected: openView === 'year',
|
|
306
|
-
label: utils.getYearText(date)
|
|
307
|
-
}), !isYearOnly && !isYearAndMonth && React.createElement(ToolbarButton$1, {
|
|
308
|
-
variant: "h4",
|
|
309
|
-
selected: openView === 'date',
|
|
310
|
-
onClick: function () {
|
|
311
|
-
return setOpenView('date');
|
|
312
|
-
},
|
|
313
|
-
align: isLandscape ? 'left' : 'center',
|
|
314
|
-
label: utils.getDatePickerHeaderText(date),
|
|
315
|
-
className: clsx((_c = {}, _c[classes.dateLandscape] = isLandscape, _c))
|
|
316
|
-
}), isYearAndMonth && React.createElement(ToolbarButton$1, {
|
|
317
|
-
variant: "h4",
|
|
318
|
-
onClick: function () {
|
|
319
|
-
return setOpenView('month');
|
|
320
|
+
return (
|
|
321
|
+
/*#__PURE__*/
|
|
322
|
+
React.createElement(PickerToolbar, {
|
|
323
|
+
isLandscape: isLandscape,
|
|
324
|
+
className: clsx((_b = {}, _b[classes.toolbar] = !isYearOnly, _b[classes.toolbarLandscape] = isLandscape, _b))
|
|
320
325
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
326
|
+
/*#__PURE__*/
|
|
327
|
+
React.createElement(ToolbarButton$1, {
|
|
328
|
+
variant: isYearOnly ? 'h3' : 'subtitle1',
|
|
329
|
+
onClick: function onClick() {
|
|
330
|
+
return setOpenView('year');
|
|
331
|
+
},
|
|
332
|
+
selected: openView === 'year',
|
|
333
|
+
label: utils.formatByString(date, utils.formats.year)
|
|
334
|
+
}), !isYearOnly && !isYearAndMonth &&
|
|
335
|
+
/*#__PURE__*/
|
|
336
|
+
React.createElement(ToolbarButton$1, {
|
|
337
|
+
variant: "h4",
|
|
338
|
+
selected: openView === 'date',
|
|
339
|
+
onClick: function onClick() {
|
|
340
|
+
return setOpenView('date');
|
|
341
|
+
},
|
|
342
|
+
align: isLandscape ? 'left' : 'center',
|
|
343
|
+
label: utils.formatByString(date, utils.formats.normalDateWithWeekday),
|
|
344
|
+
className: clsx((_c = {}, _c[classes.dateLandscape] = isLandscape, _c))
|
|
345
|
+
}), isYearAndMonth &&
|
|
346
|
+
/*#__PURE__*/
|
|
347
|
+
React.createElement(ToolbarButton$1, {
|
|
348
|
+
variant: "h4",
|
|
349
|
+
onClick: function onClick() {
|
|
350
|
+
return setOpenView('month');
|
|
351
|
+
},
|
|
352
|
+
selected: openView === 'month',
|
|
353
|
+
label: utils.formatByString(date, utils.formats.month)
|
|
354
|
+
}))
|
|
355
|
+
);
|
|
324
356
|
};
|
|
325
357
|
|
|
326
358
|
var date = PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]);
|
|
@@ -378,7 +410,7 @@ var useStyles$3 = styles$5.makeStyles(function (theme) {
|
|
|
378
410
|
}, {
|
|
379
411
|
name: 'MuiPickersDay'
|
|
380
412
|
});
|
|
381
|
-
var Day = function (_a) {
|
|
413
|
+
var Day = function Day(_a) {
|
|
382
414
|
var _b;
|
|
383
415
|
|
|
384
416
|
var children = _a.children,
|
|
@@ -390,13 +422,18 @@ var Day = function (_a) {
|
|
|
390
422
|
|
|
391
423
|
var classes = useStyles$3();
|
|
392
424
|
var className = clsx(classes.day, (_b = {}, _b[classes.hidden] = hidden, _b[classes.current] = current, _b[classes.daySelected] = selected, _b[classes.dayDisabled] = disabled, _b));
|
|
393
|
-
return
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
425
|
+
return (
|
|
426
|
+
/*#__PURE__*/
|
|
427
|
+
React.createElement(IconButton, tslib.__assign({
|
|
428
|
+
className: className,
|
|
429
|
+
tabIndex: hidden || disabled ? -1 : 0
|
|
430
|
+
}, other),
|
|
431
|
+
/*#__PURE__*/
|
|
432
|
+
React.createElement(Typography, {
|
|
433
|
+
variant: "body2",
|
|
434
|
+
color: "inherit"
|
|
435
|
+
}, children))
|
|
436
|
+
);
|
|
400
437
|
};
|
|
401
438
|
Day.displayName = 'Day';
|
|
402
439
|
process.env.NODE_ENV !== "production" ? Day.propTypes = {
|
|
@@ -412,7 +449,7 @@ Day.defaultProps = {
|
|
|
412
449
|
selected: false
|
|
413
450
|
};
|
|
414
451
|
|
|
415
|
-
var DayWrapper = function (_a) {
|
|
452
|
+
var DayWrapper = function DayWrapper(_a) {
|
|
416
453
|
var children = _a.children,
|
|
417
454
|
value = _a.value,
|
|
418
455
|
disabled = _a.disabled,
|
|
@@ -423,11 +460,14 @@ var DayWrapper = function (_a) {
|
|
|
423
460
|
var handleClick = React.useCallback(function () {
|
|
424
461
|
return onSelect(value);
|
|
425
462
|
}, [onSelect, value]);
|
|
426
|
-
return
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
463
|
+
return (
|
|
464
|
+
/*#__PURE__*/
|
|
465
|
+
React.createElement("div", tslib.__assign({
|
|
466
|
+
role: "presentation",
|
|
467
|
+
onClick: dayInCurrentMonth && !disabled ? handleClick : undefined,
|
|
468
|
+
onKeyPress: dayInCurrentMonth && !disabled ? handleClick : undefined
|
|
469
|
+
}, other), children)
|
|
470
|
+
);
|
|
431
471
|
};
|
|
432
472
|
|
|
433
473
|
var animationDuration = 350;
|
|
@@ -477,7 +517,7 @@ var useStyles$4 = styles$5.makeStyles(function (theme) {
|
|
|
477
517
|
name: 'MuiPickersSlideTransition'
|
|
478
518
|
});
|
|
479
519
|
|
|
480
|
-
var SlideTransition = function (_a) {
|
|
520
|
+
var SlideTransition = function SlideTransition(_a) {
|
|
481
521
|
var children = _a.children,
|
|
482
522
|
transKey = _a.transKey,
|
|
483
523
|
slideDirection = _a.slideDirection,
|
|
@@ -492,39 +532,61 @@ var SlideTransition = function (_a) {
|
|
|
492
532
|
// @ts-ignore
|
|
493
533
|
exitActive: classes['slideExitActiveLeft-' + slideDirection]
|
|
494
534
|
};
|
|
495
|
-
return
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
535
|
+
return (
|
|
536
|
+
/*#__PURE__*/
|
|
537
|
+
React.createElement(reactTransitionGroup.TransitionGroup, {
|
|
538
|
+
className: clsx(classes.transitionContainer, className),
|
|
539
|
+
childFactory: function childFactory(element) {
|
|
540
|
+
return (
|
|
541
|
+
/*#__PURE__*/
|
|
542
|
+
React.cloneElement(element, {
|
|
543
|
+
classNames: transitionClasses
|
|
544
|
+
})
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
/*#__PURE__*/
|
|
549
|
+
React.createElement(reactTransitionGroup.CSSTransition, {
|
|
550
|
+
mountOnEnter: true,
|
|
551
|
+
unmountOnExit: true,
|
|
552
|
+
key: transKey + slideDirection,
|
|
553
|
+
timeout: animationDuration,
|
|
554
|
+
classNames: transitionClasses,
|
|
555
|
+
children: children
|
|
556
|
+
}))
|
|
557
|
+
);
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
var ArrowLeftIcon = function ArrowLeftIcon(props) {
|
|
561
|
+
return (
|
|
562
|
+
/*#__PURE__*/
|
|
563
|
+
React__default.createElement(SvgIcon, tslib.__assign({}, props),
|
|
564
|
+
/*#__PURE__*/
|
|
565
|
+
React__default.createElement("path", {
|
|
566
|
+
d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"
|
|
567
|
+
}),
|
|
568
|
+
/*#__PURE__*/
|
|
569
|
+
React__default.createElement("path", {
|
|
570
|
+
fill: "none",
|
|
571
|
+
d: "M0 0h24v24H0V0z"
|
|
572
|
+
}))
|
|
573
|
+
);
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
var ArrowRightIcon = function ArrowRightIcon(props) {
|
|
577
|
+
return (
|
|
578
|
+
/*#__PURE__*/
|
|
579
|
+
React__default.createElement(SvgIcon, tslib.__assign({}, props),
|
|
580
|
+
/*#__PURE__*/
|
|
581
|
+
React__default.createElement("path", {
|
|
582
|
+
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
583
|
+
}),
|
|
584
|
+
/*#__PURE__*/
|
|
585
|
+
React__default.createElement("path", {
|
|
586
|
+
fill: "none",
|
|
587
|
+
d: "M0 0h24v24H0V0z"
|
|
588
|
+
}))
|
|
589
|
+
);
|
|
528
590
|
};
|
|
529
591
|
|
|
530
592
|
var useStyles$5 = styles$5.makeStyles(function (theme) {
|
|
@@ -561,7 +623,7 @@ var useStyles$5 = styles$5.makeStyles(function (theme) {
|
|
|
561
623
|
}, {
|
|
562
624
|
name: 'MuiPickersCalendarHeader'
|
|
563
625
|
});
|
|
564
|
-
var CalendarHeader = function (_a) {
|
|
626
|
+
var CalendarHeader = function CalendarHeader(_a) {
|
|
565
627
|
var currentMonth = _a.currentMonth,
|
|
566
628
|
onMonthChange = _a.onMonthChange,
|
|
567
629
|
leftArrowIcon = _a.leftArrowIcon,
|
|
@@ -576,40 +638,58 @@ var CalendarHeader = function (_a) {
|
|
|
576
638
|
var theme = styles$5.useTheme();
|
|
577
639
|
var rtl = theme.direction === 'rtl';
|
|
578
640
|
|
|
579
|
-
var selectNextMonth = function () {
|
|
641
|
+
var selectNextMonth = function selectNextMonth() {
|
|
580
642
|
return onMonthChange(utils.getNextMonth(currentMonth), 'left');
|
|
581
643
|
};
|
|
582
644
|
|
|
583
|
-
var selectPreviousMonth = function () {
|
|
645
|
+
var selectPreviousMonth = function selectPreviousMonth() {
|
|
584
646
|
return onMonthChange(utils.getPreviousMonth(currentMonth), 'right');
|
|
585
647
|
};
|
|
586
648
|
|
|
587
|
-
return
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
variant: "
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
649
|
+
return (
|
|
650
|
+
/*#__PURE__*/
|
|
651
|
+
React.createElement("div", null,
|
|
652
|
+
/*#__PURE__*/
|
|
653
|
+
React.createElement("div", {
|
|
654
|
+
className: classes.switchHeader
|
|
655
|
+
},
|
|
656
|
+
/*#__PURE__*/
|
|
657
|
+
React.createElement(IconButton, tslib.__assign({}, leftArrowButtonProps, {
|
|
658
|
+
disabled: disablePrevMonth,
|
|
659
|
+
onClick: selectPreviousMonth,
|
|
660
|
+
className: classes.iconButton
|
|
661
|
+
}), rtl ? rightArrowIcon : leftArrowIcon),
|
|
662
|
+
/*#__PURE__*/
|
|
663
|
+
React.createElement(SlideTransition, {
|
|
664
|
+
slideDirection: slideDirection,
|
|
665
|
+
transKey: currentMonth.toString(),
|
|
666
|
+
className: classes.transitionContainer
|
|
667
|
+
},
|
|
668
|
+
/*#__PURE__*/
|
|
669
|
+
React.createElement(Typography, {
|
|
670
|
+
align: "center",
|
|
671
|
+
variant: "body1"
|
|
672
|
+
}, utils.formatByString(currentMonth, utils.formats.monthAndYear))),
|
|
673
|
+
/*#__PURE__*/
|
|
674
|
+
React.createElement(IconButton, tslib.__assign({}, rightArrowButtonProps, {
|
|
675
|
+
disabled: disableNextMonth,
|
|
676
|
+
onClick: selectNextMonth,
|
|
677
|
+
className: classes.iconButton
|
|
678
|
+
}), rtl ? leftArrowIcon : rightArrowIcon)),
|
|
679
|
+
/*#__PURE__*/
|
|
680
|
+
React.createElement("div", {
|
|
681
|
+
className: classes.daysHeader
|
|
682
|
+
}, utils.getWeekdays().map(function (day, index) {
|
|
683
|
+
return (
|
|
684
|
+
/*#__PURE__*/
|
|
685
|
+
React.createElement(Typography, {
|
|
686
|
+
key: index,
|
|
687
|
+
variant: "caption",
|
|
688
|
+
className: classes.dayLabel
|
|
689
|
+
}, day)
|
|
690
|
+
);
|
|
691
|
+
})))
|
|
692
|
+
);
|
|
613
693
|
};
|
|
614
694
|
CalendarHeader.displayName = 'CalendarHeader';
|
|
615
695
|
process.env.NODE_ENV !== "production" ? CalendarHeader.propTypes = {
|
|
@@ -619,8 +699,12 @@ process.env.NODE_ENV !== "production" ? CalendarHeader.propTypes = {
|
|
|
619
699
|
disableNextMonth: PropTypes.bool
|
|
620
700
|
} : void 0;
|
|
621
701
|
CalendarHeader.defaultProps = {
|
|
622
|
-
leftArrowIcon:
|
|
623
|
-
|
|
702
|
+
leftArrowIcon:
|
|
703
|
+
/*#__PURE__*/
|
|
704
|
+
React.createElement(ArrowLeftIcon, null),
|
|
705
|
+
rightArrowIcon:
|
|
706
|
+
/*#__PURE__*/
|
|
707
|
+
React.createElement(ArrowRightIcon, null),
|
|
624
708
|
disablePrevMonth: false,
|
|
625
709
|
disableNextMonth: false
|
|
626
710
|
};
|
|
@@ -642,7 +726,7 @@ function useKeyDown(active, keyHandlers) {
|
|
|
642
726
|
});
|
|
643
727
|
React.useEffect(function () {
|
|
644
728
|
if (active) {
|
|
645
|
-
var handleKeyDown_1 = function (event) {
|
|
729
|
+
var handleKeyDown_1 = function handleKeyDown_1(event) {
|
|
646
730
|
runKeyHandler(event, keyHandlers);
|
|
647
731
|
};
|
|
648
732
|
|
|
@@ -654,13 +738,16 @@ function useKeyDown(active, keyHandlers) {
|
|
|
654
738
|
}, [active, keyHandlers]);
|
|
655
739
|
}
|
|
656
740
|
|
|
657
|
-
var withUtils = function () {
|
|
741
|
+
var withUtils = function withUtils() {
|
|
658
742
|
return function (Component) {
|
|
659
|
-
var WithUtils = function (props) {
|
|
743
|
+
var WithUtils = function WithUtils(props) {
|
|
660
744
|
var utils = useUtils();
|
|
661
|
-
return
|
|
662
|
-
|
|
663
|
-
|
|
745
|
+
return (
|
|
746
|
+
/*#__PURE__*/
|
|
747
|
+
React.createElement(Component, tslib.__assign({
|
|
748
|
+
utils: utils
|
|
749
|
+
}, props))
|
|
750
|
+
);
|
|
664
751
|
};
|
|
665
752
|
|
|
666
753
|
WithUtils.displayName = "WithUtils(" + (Component.displayName || Component.name) + ")";
|
|
@@ -668,7 +755,7 @@ var withUtils = function () {
|
|
|
668
755
|
};
|
|
669
756
|
};
|
|
670
757
|
|
|
671
|
-
var KeyDownListener = function (_a) {
|
|
758
|
+
var KeyDownListener = function KeyDownListener(_a) {
|
|
672
759
|
var onKeyDown = _a.onKeyDown;
|
|
673
760
|
React.useEffect(function () {
|
|
674
761
|
window.addEventListener('keydown', onKeyDown);
|
|
@@ -796,16 +883,16 @@ function (_super) {
|
|
|
796
883
|
date = _a.date,
|
|
797
884
|
utils = _a.utils;
|
|
798
885
|
runKeyHandler(event, {
|
|
799
|
-
ArrowUp: function () {
|
|
886
|
+
ArrowUp: function ArrowUp() {
|
|
800
887
|
return _this.moveToDay(utils.addDays(date, -7));
|
|
801
888
|
},
|
|
802
|
-
ArrowDown: function () {
|
|
889
|
+
ArrowDown: function ArrowDown() {
|
|
803
890
|
return _this.moveToDay(utils.addDays(date, 7));
|
|
804
891
|
},
|
|
805
|
-
ArrowLeft: function () {
|
|
892
|
+
ArrowLeft: function ArrowLeft() {
|
|
806
893
|
return _this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? -1 : 1));
|
|
807
894
|
},
|
|
808
|
-
ArrowRight: function () {
|
|
895
|
+
ArrowRight: function ArrowRight() {
|
|
809
896
|
return _this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? 1 : -1));
|
|
810
897
|
}
|
|
811
898
|
});
|
|
@@ -817,10 +904,13 @@ function (_super) {
|
|
|
817
904
|
classes = _a.classes;
|
|
818
905
|
var weeks = utils.getWeekArray(_this.state.currentMonth);
|
|
819
906
|
return weeks.map(function (week) {
|
|
820
|
-
return
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
907
|
+
return (
|
|
908
|
+
/*#__PURE__*/
|
|
909
|
+
React.createElement("div", {
|
|
910
|
+
key: "week-" + week[0].toString(),
|
|
911
|
+
className: classes.week
|
|
912
|
+
}, _this.renderDays(week))
|
|
913
|
+
);
|
|
824
914
|
});
|
|
825
915
|
};
|
|
826
916
|
|
|
@@ -836,24 +926,29 @@ function (_super) {
|
|
|
836
926
|
var disabled = _this.shouldDisableDate(day);
|
|
837
927
|
|
|
838
928
|
var isDayInCurrentMonth = utils.getMonth(day) === currentMonthNumber;
|
|
839
|
-
var dayComponent =
|
|
929
|
+
var dayComponent =
|
|
930
|
+
/*#__PURE__*/
|
|
931
|
+
React.createElement(Day, {
|
|
840
932
|
disabled: disabled,
|
|
841
933
|
current: utils.isSameDay(day, now),
|
|
842
934
|
hidden: !isDayInCurrentMonth,
|
|
843
935
|
selected: utils.isSameDay(selectedDate, day)
|
|
844
|
-
}, utils.
|
|
936
|
+
}, utils.formatByString(day, utils.formats.dayOfMonth));
|
|
845
937
|
|
|
846
938
|
if (renderDay) {
|
|
847
939
|
dayComponent = renderDay(day, selectedDate, isDayInCurrentMonth, dayComponent);
|
|
848
940
|
}
|
|
849
941
|
|
|
850
|
-
return
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
942
|
+
return (
|
|
943
|
+
/*#__PURE__*/
|
|
944
|
+
React.createElement(DayWrapper, {
|
|
945
|
+
value: day,
|
|
946
|
+
key: day.toString(),
|
|
947
|
+
disabled: disabled,
|
|
948
|
+
dayInCurrentMonth: isDayInCurrentMonth,
|
|
949
|
+
onSelect: _this.handleDaySelect
|
|
950
|
+
}, dayComponent)
|
|
951
|
+
);
|
|
857
952
|
});
|
|
858
953
|
};
|
|
859
954
|
|
|
@@ -914,26 +1009,43 @@ function (_super) {
|
|
|
914
1009
|
rightArrowButtonProps = _b.rightArrowButtonProps,
|
|
915
1010
|
rightArrowIcon = _b.rightArrowIcon,
|
|
916
1011
|
loadingIndicator = _b.loadingIndicator;
|
|
917
|
-
var loadingElement = loadingIndicator ? loadingIndicator :
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1012
|
+
var loadingElement = loadingIndicator ? loadingIndicator :
|
|
1013
|
+
/*#__PURE__*/
|
|
1014
|
+
React.createElement(CircularProgress, null);
|
|
1015
|
+
return (
|
|
1016
|
+
/*#__PURE__*/
|
|
1017
|
+
React.createElement(React.Fragment, null, allowKeyboardControl &&
|
|
1018
|
+
/*#__PURE__*/
|
|
1019
|
+
React.createElement(KeyDownListener, {
|
|
1020
|
+
onKeyDown: this.handleKeyDown
|
|
1021
|
+
}),
|
|
1022
|
+
/*#__PURE__*/
|
|
1023
|
+
React.createElement(CalendarHeader, {
|
|
1024
|
+
currentMonth: currentMonth,
|
|
1025
|
+
slideDirection: slideDirection,
|
|
1026
|
+
onMonthChange: this.handleChangeMonth,
|
|
1027
|
+
leftArrowIcon: leftArrowIcon,
|
|
1028
|
+
leftArrowButtonProps: leftArrowButtonProps,
|
|
1029
|
+
rightArrowIcon: rightArrowIcon,
|
|
1030
|
+
rightArrowButtonProps: rightArrowButtonProps,
|
|
1031
|
+
disablePrevMonth: this.shouldDisablePrevMonth(),
|
|
1032
|
+
disableNextMonth: this.shouldDisableNextMonth()
|
|
1033
|
+
}),
|
|
1034
|
+
/*#__PURE__*/
|
|
1035
|
+
React.createElement(SlideTransition, {
|
|
1036
|
+
slideDirection: slideDirection,
|
|
1037
|
+
transKey: currentMonth.toString(),
|
|
1038
|
+
className: classes.transitionContainer
|
|
1039
|
+
},
|
|
1040
|
+
/*#__PURE__*/
|
|
1041
|
+
React.createElement(React.Fragment, null, this.state.loadingQueue > 0 &&
|
|
1042
|
+
/*#__PURE__*/
|
|
1043
|
+
React.createElement("div", {
|
|
1044
|
+
className: classes.progressContainer
|
|
1045
|
+
}, loadingElement) ||
|
|
1046
|
+
/*#__PURE__*/
|
|
1047
|
+
React.createElement("div", null, this.renderWeeks()))))
|
|
1048
|
+
);
|
|
937
1049
|
};
|
|
938
1050
|
|
|
939
1051
|
process.env.NODE_ENV !== "production" ? Calendar.propTypes = {
|
|
@@ -950,7 +1062,7 @@ function (_super) {
|
|
|
950
1062
|
};
|
|
951
1063
|
return Calendar;
|
|
952
1064
|
}(React.Component);
|
|
953
|
-
var styles$1 = function (theme) {
|
|
1065
|
+
var styles$1 = function styles(theme) {
|
|
954
1066
|
return {
|
|
955
1067
|
transitionContainer: {
|
|
956
1068
|
minHeight: 36 * 6,
|
|
@@ -1024,7 +1136,7 @@ var useStyles$6 = styles$5.makeStyles(function (theme) {
|
|
|
1024
1136
|
}, {
|
|
1025
1137
|
name: 'MuiPickersYear'
|
|
1026
1138
|
});
|
|
1027
|
-
var Year = function (_a) {
|
|
1139
|
+
var Year = function Year(_a) {
|
|
1028
1140
|
var _b;
|
|
1029
1141
|
|
|
1030
1142
|
var onSelect = _a.onSelect,
|
|
@@ -1039,24 +1151,31 @@ var Year = function (_a) {
|
|
|
1039
1151
|
var handleClick = React.useCallback(function () {
|
|
1040
1152
|
return onSelect(value);
|
|
1041
1153
|
}, [onSelect, value]);
|
|
1042
|
-
return
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1154
|
+
return (
|
|
1155
|
+
/*#__PURE__*/
|
|
1156
|
+
React.createElement(Typography, tslib.__assign({
|
|
1157
|
+
role: "button",
|
|
1158
|
+
component: "div",
|
|
1159
|
+
tabIndex: disabled ? -1 : 0,
|
|
1160
|
+
onClick: handleClick,
|
|
1161
|
+
onKeyPress: handleClick,
|
|
1162
|
+
color: selected ? 'primary' : undefined,
|
|
1163
|
+
variant: selected ? 'h5' : 'subtitle1',
|
|
1164
|
+
children: children,
|
|
1165
|
+
ref: forwardedRef,
|
|
1166
|
+
className: clsx(classes.root, (_b = {}, _b[classes.yearSelected] = selected, _b[classes.yearDisabled] = disabled, _b))
|
|
1167
|
+
}, other))
|
|
1168
|
+
);
|
|
1054
1169
|
};
|
|
1055
1170
|
Year.displayName = 'Year';
|
|
1056
|
-
var Year$1 =
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1171
|
+
var Year$1 = /*#__PURE__*/
|
|
1172
|
+
React.forwardRef(function (props, ref) {
|
|
1173
|
+
return (
|
|
1174
|
+
/*#__PURE__*/
|
|
1175
|
+
React.createElement(Year, tslib.__assign({}, props, {
|
|
1176
|
+
forwardedRef: ref
|
|
1177
|
+
}))
|
|
1178
|
+
);
|
|
1060
1179
|
});
|
|
1061
1180
|
|
|
1062
1181
|
var DIALOG_WIDTH = 310;
|
|
@@ -1076,16 +1195,19 @@ var useStyles$7 = core.makeStyles(function (theme) {
|
|
|
1076
1195
|
}, {
|
|
1077
1196
|
name: 'MuiPickersStaticWrapper'
|
|
1078
1197
|
});
|
|
1079
|
-
var StaticWrapper = function (_a) {
|
|
1198
|
+
var StaticWrapper = function StaticWrapper(_a) {
|
|
1080
1199
|
var children = _a.children;
|
|
1081
1200
|
var classes = useStyles$7();
|
|
1082
|
-
return
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1201
|
+
return (
|
|
1202
|
+
/*#__PURE__*/
|
|
1203
|
+
React.createElement("div", {
|
|
1204
|
+
className: classes.staticWrapperRoot,
|
|
1205
|
+
children: children
|
|
1206
|
+
})
|
|
1207
|
+
);
|
|
1086
1208
|
};
|
|
1087
1209
|
|
|
1088
|
-
var ModalDialog = function (_a) {
|
|
1210
|
+
var ModalDialog = function ModalDialog(_a) {
|
|
1089
1211
|
var _b, _c;
|
|
1090
1212
|
|
|
1091
1213
|
var children = _a.children,
|
|
@@ -1104,32 +1226,47 @@ var ModalDialog = function (_a) {
|
|
|
1104
1226
|
wider = _a.wider,
|
|
1105
1227
|
other = tslib.__rest(_a, ["children", "classes", "onAccept", "onDismiss", "onClear", "onSetToday", "okLabel", "cancelLabel", "clearLabel", "todayLabel", "clearable", "showTodayButton", "showTabs", "wider"]);
|
|
1106
1228
|
|
|
1107
|
-
return
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1229
|
+
return (
|
|
1230
|
+
/*#__PURE__*/
|
|
1231
|
+
React.createElement(Dialog, tslib.__assign({
|
|
1232
|
+
role: "dialog",
|
|
1233
|
+
onClose: onDismiss,
|
|
1234
|
+
classes: {
|
|
1235
|
+
paper: clsx(classes.dialogRoot, (_b = {}, _b[classes.dialogRootWider] = wider, _b))
|
|
1236
|
+
}
|
|
1237
|
+
}, other),
|
|
1238
|
+
/*#__PURE__*/
|
|
1239
|
+
React.createElement(DialogContent, {
|
|
1240
|
+
children: children,
|
|
1241
|
+
className: classes.dialog
|
|
1242
|
+
}),
|
|
1243
|
+
/*#__PURE__*/
|
|
1244
|
+
React.createElement(DialogActions, {
|
|
1245
|
+
classes: {
|
|
1246
|
+
root: clsx((_c = {}, _c[classes.withAdditionalAction] = clearable || showTodayButton, _c))
|
|
1247
|
+
}
|
|
1248
|
+
}, clearable &&
|
|
1249
|
+
/*#__PURE__*/
|
|
1250
|
+
React.createElement(Button, {
|
|
1251
|
+
color: "primary",
|
|
1252
|
+
onClick: onClear
|
|
1253
|
+
}, clearLabel), !clearable && showTodayButton &&
|
|
1254
|
+
/*#__PURE__*/
|
|
1255
|
+
React.createElement(Button, {
|
|
1256
|
+
color: "primary",
|
|
1257
|
+
onClick: onSetToday
|
|
1258
|
+
}, todayLabel), cancelLabel &&
|
|
1259
|
+
/*#__PURE__*/
|
|
1260
|
+
React.createElement(Button, {
|
|
1261
|
+
color: "primary",
|
|
1262
|
+
onClick: onDismiss
|
|
1263
|
+
}, cancelLabel), okLabel &&
|
|
1264
|
+
/*#__PURE__*/
|
|
1265
|
+
React.createElement(Button, {
|
|
1266
|
+
color: "primary",
|
|
1267
|
+
onClick: onAccept
|
|
1268
|
+
}, okLabel)))
|
|
1269
|
+
);
|
|
1133
1270
|
};
|
|
1134
1271
|
ModalDialog.displayName = 'ModalDialog';
|
|
1135
1272
|
var styles$2 = styles$5.createStyles({
|
|
@@ -1156,7 +1293,7 @@ var ModalDialog$1 = styles$5.withStyles(styles$2, {
|
|
|
1156
1293
|
name: 'MuiPickersModal'
|
|
1157
1294
|
})(ModalDialog);
|
|
1158
1295
|
|
|
1159
|
-
var ModalWrapper = function (_a) {
|
|
1296
|
+
var ModalWrapper = function ModalWrapper(_a) {
|
|
1160
1297
|
var open = _a.open,
|
|
1161
1298
|
children = _a.children,
|
|
1162
1299
|
okLabel = _a.okLabel,
|
|
@@ -1179,22 +1316,29 @@ var ModalWrapper = function (_a) {
|
|
|
1179
1316
|
useKeyDown(open, {
|
|
1180
1317
|
Enter: onAccept
|
|
1181
1318
|
});
|
|
1182
|
-
return
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1319
|
+
return (
|
|
1320
|
+
/*#__PURE__*/
|
|
1321
|
+
React.createElement(React.Fragment, null,
|
|
1322
|
+
/*#__PURE__*/
|
|
1323
|
+
React.createElement(InputComponent, tslib.__assign({}, other, DateInputProps)),
|
|
1324
|
+
/*#__PURE__*/
|
|
1325
|
+
React.createElement(ModalDialog$1, tslib.__assign({
|
|
1326
|
+
wider: wider,
|
|
1327
|
+
showTabs: showTabs,
|
|
1328
|
+
open: open,
|
|
1329
|
+
onClear: onClear,
|
|
1330
|
+
onAccept: onAccept,
|
|
1331
|
+
onDismiss: onDismiss,
|
|
1332
|
+
onSetToday: onSetToday,
|
|
1333
|
+
clearLabel: clearLabel,
|
|
1334
|
+
todayLabel: todayLabel,
|
|
1335
|
+
okLabel: okLabel,
|
|
1336
|
+
cancelLabel: cancelLabel,
|
|
1337
|
+
clearable: clearable,
|
|
1338
|
+
showTodayButton: showTodayButton,
|
|
1339
|
+
children: children
|
|
1340
|
+
}, DialogProps)))
|
|
1341
|
+
);
|
|
1198
1342
|
};
|
|
1199
1343
|
process.env.NODE_ENV !== "production" ? ModalWrapper.propTypes = {
|
|
1200
1344
|
okLabel: PropTypes.node,
|
|
@@ -1225,7 +1369,7 @@ var useStyles$8 = styles$5.makeStyles({
|
|
|
1225
1369
|
}, {
|
|
1226
1370
|
name: 'MuiPickersInlineWrapper'
|
|
1227
1371
|
});
|
|
1228
|
-
var InlineWrapper = function (_a) {
|
|
1372
|
+
var InlineWrapper = function InlineWrapper(_a) {
|
|
1229
1373
|
var _b;
|
|
1230
1374
|
|
|
1231
1375
|
var open = _a.open,
|
|
@@ -1246,25 +1390,32 @@ var InlineWrapper = function (_a) {
|
|
|
1246
1390
|
useKeyDown(open, {
|
|
1247
1391
|
Enter: onAccept
|
|
1248
1392
|
});
|
|
1249
|
-
return
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1393
|
+
return (
|
|
1394
|
+
/*#__PURE__*/
|
|
1395
|
+
React.createElement(React.Fragment, null,
|
|
1396
|
+
/*#__PURE__*/
|
|
1397
|
+
React.createElement(InputComponent, tslib.__assign({}, other, DateInputProps, {
|
|
1398
|
+
inputRef: ref
|
|
1399
|
+
})),
|
|
1400
|
+
/*#__PURE__*/
|
|
1401
|
+
React.createElement(Popover, tslib.__assign({
|
|
1402
|
+
open: open,
|
|
1403
|
+
onClose: onDismiss,
|
|
1404
|
+
anchorEl: ref.current,
|
|
1405
|
+
classes: {
|
|
1406
|
+
paper: clsx(classes.popoverPaper, (_b = {}, _b[classes.popoverPaperWider] = wider, _b))
|
|
1407
|
+
},
|
|
1408
|
+
anchorOrigin: {
|
|
1409
|
+
vertical: 'bottom',
|
|
1410
|
+
horizontal: 'center'
|
|
1411
|
+
},
|
|
1412
|
+
transformOrigin: {
|
|
1413
|
+
vertical: 'top',
|
|
1414
|
+
horizontal: 'center'
|
|
1415
|
+
},
|
|
1416
|
+
children: children
|
|
1417
|
+
}, PopoverProps)))
|
|
1418
|
+
);
|
|
1268
1419
|
};
|
|
1269
1420
|
process.env.NODE_ENV !== "production" ? InlineWrapper.propTypes = {
|
|
1270
1421
|
onOpen: PropTypes.func,
|
|
@@ -1284,15 +1435,22 @@ function getWrapperFromVariant(variant) {
|
|
|
1284
1435
|
return ModalWrapper;
|
|
1285
1436
|
}
|
|
1286
1437
|
}
|
|
1287
|
-
var VariantContext =
|
|
1288
|
-
|
|
1438
|
+
var VariantContext =
|
|
1439
|
+
/*#__PURE__*/
|
|
1440
|
+
React.createContext(null);
|
|
1441
|
+
var Wrapper = function Wrapper(_a) {
|
|
1289
1442
|
var variant = _a.variant,
|
|
1290
1443
|
props = tslib.__rest(_a, ["variant"]);
|
|
1291
1444
|
|
|
1292
1445
|
var Component = getWrapperFromVariant(variant);
|
|
1293
|
-
return
|
|
1294
|
-
|
|
1295
|
-
|
|
1446
|
+
return (
|
|
1447
|
+
/*#__PURE__*/
|
|
1448
|
+
React.createElement(VariantContext.Provider, {
|
|
1449
|
+
value: variant || 'dialog'
|
|
1450
|
+
},
|
|
1451
|
+
/*#__PURE__*/
|
|
1452
|
+
React.createElement(Component, tslib.__assign({}, props)))
|
|
1453
|
+
);
|
|
1296
1454
|
};
|
|
1297
1455
|
|
|
1298
1456
|
var useStyles$9 = styles$5.makeStyles({
|
|
@@ -1303,7 +1461,7 @@ var useStyles$9 = styles$5.makeStyles({
|
|
|
1303
1461
|
}, {
|
|
1304
1462
|
name: 'MuiPickersYearSelection'
|
|
1305
1463
|
});
|
|
1306
|
-
var YearSelection = function (_a) {
|
|
1464
|
+
var YearSelection = function YearSelection(_a) {
|
|
1307
1465
|
var date = _a.date,
|
|
1308
1466
|
onChange = _a.onChange,
|
|
1309
1467
|
onYearChange = _a.onYearChange,
|
|
@@ -1335,20 +1493,26 @@ var YearSelection = function (_a) {
|
|
|
1335
1493
|
|
|
1336
1494
|
onChange(newDate, true);
|
|
1337
1495
|
}, [date, onChange, onYearChange, utils]);
|
|
1338
|
-
return
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1496
|
+
return (
|
|
1497
|
+
/*#__PURE__*/
|
|
1498
|
+
React.createElement("div", {
|
|
1499
|
+
className: classes.container
|
|
1500
|
+
}, utils.getYearRange(minDate, maxDate).map(function (year) {
|
|
1501
|
+
var yearNumber = utils.getYear(year);
|
|
1502
|
+
var selected = yearNumber === currentYear;
|
|
1503
|
+
return (
|
|
1504
|
+
/*#__PURE__*/
|
|
1505
|
+
React.createElement(Year$1, {
|
|
1506
|
+
key: utils.formatByString(year, utils.formats.year),
|
|
1507
|
+
selected: selected,
|
|
1508
|
+
value: yearNumber,
|
|
1509
|
+
onSelect: onYearSelect,
|
|
1510
|
+
ref: selected ? selectedYearRef : undefined,
|
|
1511
|
+
disabled: Boolean(disablePast && utils.isBeforeYear(year, utils.date()) || disableFuture && utils.isAfterYear(year, utils.date()))
|
|
1512
|
+
}, utils.formatByString(year, utils.formats.year))
|
|
1513
|
+
);
|
|
1514
|
+
}))
|
|
1515
|
+
);
|
|
1352
1516
|
};
|
|
1353
1517
|
|
|
1354
1518
|
var ClockType;
|
|
@@ -1401,12 +1565,17 @@ function (_super) {
|
|
|
1401
1565
|
var _c = this.props,
|
|
1402
1566
|
classes = _c.classes,
|
|
1403
1567
|
hasSelected = _c.hasSelected;
|
|
1404
|
-
return
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1568
|
+
return (
|
|
1569
|
+
/*#__PURE__*/
|
|
1570
|
+
React.createElement("div", {
|
|
1571
|
+
style: this.getAngleStyle(),
|
|
1572
|
+
className: clsx(classes.pointer, (_a = {}, _a[classes.animateTransform] = this.state.toAnimateTransform, _a))
|
|
1573
|
+
},
|
|
1574
|
+
/*#__PURE__*/
|
|
1575
|
+
React.createElement("div", {
|
|
1576
|
+
className: clsx(classes.thumb, (_b = {}, _b[classes.noPoint] = hasSelected, _b))
|
|
1577
|
+
}))
|
|
1578
|
+
);
|
|
1410
1579
|
};
|
|
1411
1580
|
|
|
1412
1581
|
ClockPointer.getDerivedStateFromProps = function (nextProps, state) {
|
|
@@ -1425,7 +1594,7 @@ function (_super) {
|
|
|
1425
1594
|
|
|
1426
1595
|
return ClockPointer;
|
|
1427
1596
|
}(React.Component);
|
|
1428
|
-
var styles$3 = function (theme) {
|
|
1597
|
+
var styles$3 = function styles(theme) {
|
|
1429
1598
|
return styles$5.createStyles({
|
|
1430
1599
|
pointer: {
|
|
1431
1600
|
width: 2,
|
|
@@ -1469,11 +1638,11 @@ var basePoint = {
|
|
|
1469
1638
|
var cx = basePoint.x - center.x;
|
|
1470
1639
|
var cy = basePoint.y - center.y;
|
|
1471
1640
|
|
|
1472
|
-
var rad2deg = function (rad) {
|
|
1641
|
+
var rad2deg = function rad2deg(rad) {
|
|
1473
1642
|
return rad * 57.29577951308232;
|
|
1474
1643
|
};
|
|
1475
1644
|
|
|
1476
|
-
var getAngleValue = function (step, offsetX, offsetY) {
|
|
1645
|
+
var getAngleValue = function getAngleValue(step, offsetX, offsetY) {
|
|
1477
1646
|
var x = offsetX - center.x;
|
|
1478
1647
|
var y = offsetY - center.y;
|
|
1479
1648
|
var atan = Math.atan2(cx, cy) - Math.atan2(x, y);
|
|
@@ -1489,7 +1658,7 @@ var getAngleValue = function (step, offsetX, offsetY) {
|
|
|
1489
1658
|
};
|
|
1490
1659
|
};
|
|
1491
1660
|
|
|
1492
|
-
var getHours = function (offsetX, offsetY, ampm) {
|
|
1661
|
+
var getHours = function getHours(offsetX, offsetY, ampm) {
|
|
1493
1662
|
var _a = getAngleValue(30, offsetX, offsetY),
|
|
1494
1663
|
value = _a.value,
|
|
1495
1664
|
distance = _a.distance;
|
|
@@ -1507,7 +1676,7 @@ var getHours = function (offsetX, offsetY, ampm) {
|
|
|
1507
1676
|
|
|
1508
1677
|
return value;
|
|
1509
1678
|
};
|
|
1510
|
-
var getMinutes = function (offsetX, offsetY, step) {
|
|
1679
|
+
var getMinutes = function getMinutes(offsetX, offsetY, step) {
|
|
1511
1680
|
if (step === void 0) {
|
|
1512
1681
|
step = 1;
|
|
1513
1682
|
}
|
|
@@ -1517,10 +1686,10 @@ var getMinutes = function (offsetX, offsetY, step) {
|
|
|
1517
1686
|
value = value * step % 60;
|
|
1518
1687
|
return value;
|
|
1519
1688
|
};
|
|
1520
|
-
var getMeridiem = function (date, utils) {
|
|
1689
|
+
var getMeridiem = function getMeridiem(date, utils) {
|
|
1521
1690
|
return utils.getHours(date) >= 12 ? 'pm' : 'am';
|
|
1522
1691
|
};
|
|
1523
|
-
var convertToMeridiem = function (time, meridiem, ampm, utils) {
|
|
1692
|
+
var convertToMeridiem = function convertToMeridiem(time, meridiem, ampm, utils) {
|
|
1524
1693
|
if (ampm) {
|
|
1525
1694
|
var currentMeridiem = utils.getHours(time) >= 12 ? 'pm' : 'am';
|
|
1526
1695
|
|
|
@@ -1617,32 +1786,41 @@ function (_super) {
|
|
|
1617
1786
|
type = _a.type,
|
|
1618
1787
|
ampm = _a.ampm;
|
|
1619
1788
|
var isPointerInner = !ampm && type === ClockType$1.HOURS && (value < 1 || value > 12);
|
|
1620
|
-
return
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1789
|
+
return (
|
|
1790
|
+
/*#__PURE__*/
|
|
1791
|
+
React.createElement("div", {
|
|
1792
|
+
className: classes.container
|
|
1793
|
+
},
|
|
1794
|
+
/*#__PURE__*/
|
|
1795
|
+
React.createElement("div", {
|
|
1796
|
+
className: classes.clock
|
|
1797
|
+
},
|
|
1798
|
+
/*#__PURE__*/
|
|
1799
|
+
React.createElement("div", {
|
|
1800
|
+
role: "menu",
|
|
1801
|
+
tabIndex: -1,
|
|
1802
|
+
className: classes.squareMask,
|
|
1803
|
+
onTouchMove: this.handleTouchMove,
|
|
1804
|
+
onTouchEnd: this.handleTouchEnd,
|
|
1805
|
+
onMouseUp: this.handleMouseUp,
|
|
1806
|
+
onMouseMove: this.handleMove
|
|
1807
|
+
}),
|
|
1808
|
+
/*#__PURE__*/
|
|
1809
|
+
React.createElement("div", {
|
|
1810
|
+
className: classes.pin
|
|
1811
|
+
}),
|
|
1812
|
+
/*#__PURE__*/
|
|
1813
|
+
React.createElement(ClockPointer$1, {
|
|
1814
|
+
type: type,
|
|
1815
|
+
value: value,
|
|
1816
|
+
isInner: isPointerInner,
|
|
1817
|
+
hasSelected: this.hasSelected()
|
|
1818
|
+
}), children))
|
|
1819
|
+
);
|
|
1640
1820
|
};
|
|
1641
1821
|
|
|
1642
1822
|
process.env.NODE_ENV !== "production" ? Clock.propTypes = {
|
|
1643
|
-
type: PropTypes.oneOf(Object.
|
|
1644
|
-
return ClockType$1[key];
|
|
1645
|
-
})).isRequired,
|
|
1823
|
+
type: PropTypes.oneOf(Object.values(ClockType$1)).isRequired,
|
|
1646
1824
|
value: PropTypes.number.isRequired,
|
|
1647
1825
|
onChange: PropTypes.func.isRequired,
|
|
1648
1826
|
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
@@ -1656,7 +1834,7 @@ function (_super) {
|
|
|
1656
1834
|
};
|
|
1657
1835
|
return Clock;
|
|
1658
1836
|
}(React.Component);
|
|
1659
|
-
var styles$4 = function (theme) {
|
|
1837
|
+
var styles$4 = function styles(theme) {
|
|
1660
1838
|
return styles$5.createStyles({
|
|
1661
1839
|
container: {
|
|
1662
1840
|
display: 'flex',
|
|
@@ -1749,7 +1927,7 @@ var useStyles$a = styles$5.makeStyles(function (theme) {
|
|
|
1749
1927
|
}, {
|
|
1750
1928
|
name: 'MuiPickersClockNumber'
|
|
1751
1929
|
});
|
|
1752
|
-
var ClockNumber = function (_a) {
|
|
1930
|
+
var ClockNumber = function ClockNumber(_a) {
|
|
1753
1931
|
var _b;
|
|
1754
1932
|
|
|
1755
1933
|
var selected = _a.selected,
|
|
@@ -1764,16 +1942,19 @@ var ClockNumber = function (_a) {
|
|
|
1764
1942
|
transform: "translate(" + position[0] + "px, " + position[1] + "px"
|
|
1765
1943
|
};
|
|
1766
1944
|
}, [index]);
|
|
1767
|
-
return
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1945
|
+
return (
|
|
1946
|
+
/*#__PURE__*/
|
|
1947
|
+
React.createElement(Typography, {
|
|
1948
|
+
component: "span",
|
|
1949
|
+
className: className,
|
|
1950
|
+
variant: isInner ? 'body2' : 'body1',
|
|
1951
|
+
style: transformStyle,
|
|
1952
|
+
children: label
|
|
1953
|
+
})
|
|
1954
|
+
);
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1957
|
+
var getHourNumbers = function getHourNumbers(_a) {
|
|
1777
1958
|
var ampm = _a.ampm,
|
|
1778
1959
|
utils = _a.utils,
|
|
1779
1960
|
date = _a.date;
|
|
@@ -1782,7 +1963,7 @@ var getHourNumbers = function (_a) {
|
|
|
1782
1963
|
var startHour = ampm ? 1 : 0;
|
|
1783
1964
|
var endHour = ampm ? 12 : 23;
|
|
1784
1965
|
|
|
1785
|
-
var isSelected = function (hour) {
|
|
1966
|
+
var isSelected = function isSelected(hour) {
|
|
1786
1967
|
if (ampm) {
|
|
1787
1968
|
if (hour === 12) {
|
|
1788
1969
|
return currentHours === 12 || currentHours === 0;
|
|
@@ -1807,73 +1988,99 @@ var getHourNumbers = function (_a) {
|
|
|
1807
1988
|
selected: isSelected(hour),
|
|
1808
1989
|
isInner: !ampm && (hour === 0 || hour > 12)
|
|
1809
1990
|
};
|
|
1810
|
-
hourNumbers.push(
|
|
1991
|
+
hourNumbers.push(
|
|
1992
|
+
/*#__PURE__*/
|
|
1993
|
+
React.createElement(ClockNumber, tslib.__assign({
|
|
1811
1994
|
key: hour
|
|
1812
1995
|
}, props)));
|
|
1813
1996
|
}
|
|
1814
1997
|
|
|
1815
1998
|
return hourNumbers;
|
|
1816
1999
|
};
|
|
1817
|
-
var getMinutesNumbers = function (_a) {
|
|
2000
|
+
var getMinutesNumbers = function getMinutesNumbers(_a) {
|
|
1818
2001
|
var value = _a.value,
|
|
1819
2002
|
utils = _a.utils;
|
|
1820
2003
|
var f = utils.formatNumber;
|
|
1821
|
-
return [
|
|
2004
|
+
return [
|
|
2005
|
+
/*#__PURE__*/
|
|
2006
|
+
React.createElement(ClockNumber, {
|
|
1822
2007
|
label: f('00'),
|
|
1823
2008
|
selected: value === 0,
|
|
1824
2009
|
index: 12,
|
|
1825
2010
|
key: 12
|
|
1826
|
-
}),
|
|
2011
|
+
}),
|
|
2012
|
+
/*#__PURE__*/
|
|
2013
|
+
React.createElement(ClockNumber, {
|
|
1827
2014
|
label: f('05'),
|
|
1828
2015
|
selected: value === 5,
|
|
1829
2016
|
index: 1,
|
|
1830
2017
|
key: 1
|
|
1831
|
-
}),
|
|
2018
|
+
}),
|
|
2019
|
+
/*#__PURE__*/
|
|
2020
|
+
React.createElement(ClockNumber, {
|
|
1832
2021
|
label: f('10'),
|
|
1833
2022
|
selected: value === 10,
|
|
1834
2023
|
index: 2,
|
|
1835
2024
|
key: 2
|
|
1836
|
-
}),
|
|
2025
|
+
}),
|
|
2026
|
+
/*#__PURE__*/
|
|
2027
|
+
React.createElement(ClockNumber, {
|
|
1837
2028
|
label: f('15'),
|
|
1838
2029
|
selected: value === 15,
|
|
1839
2030
|
index: 3,
|
|
1840
2031
|
key: 3
|
|
1841
|
-
}),
|
|
2032
|
+
}),
|
|
2033
|
+
/*#__PURE__*/
|
|
2034
|
+
React.createElement(ClockNumber, {
|
|
1842
2035
|
label: f('20'),
|
|
1843
2036
|
selected: value === 20,
|
|
1844
2037
|
index: 4,
|
|
1845
2038
|
key: 4
|
|
1846
|
-
}),
|
|
2039
|
+
}),
|
|
2040
|
+
/*#__PURE__*/
|
|
2041
|
+
React.createElement(ClockNumber, {
|
|
1847
2042
|
label: f('25'),
|
|
1848
2043
|
selected: value === 25,
|
|
1849
2044
|
index: 5,
|
|
1850
2045
|
key: 5
|
|
1851
|
-
}),
|
|
2046
|
+
}),
|
|
2047
|
+
/*#__PURE__*/
|
|
2048
|
+
React.createElement(ClockNumber, {
|
|
1852
2049
|
label: f('30'),
|
|
1853
2050
|
selected: value === 30,
|
|
1854
2051
|
index: 6,
|
|
1855
2052
|
key: 6
|
|
1856
|
-
}),
|
|
2053
|
+
}),
|
|
2054
|
+
/*#__PURE__*/
|
|
2055
|
+
React.createElement(ClockNumber, {
|
|
1857
2056
|
label: f('35'),
|
|
1858
2057
|
selected: value === 35,
|
|
1859
2058
|
index: 7,
|
|
1860
2059
|
key: 7
|
|
1861
|
-
}),
|
|
2060
|
+
}),
|
|
2061
|
+
/*#__PURE__*/
|
|
2062
|
+
React.createElement(ClockNumber, {
|
|
1862
2063
|
label: f('40'),
|
|
1863
2064
|
selected: value === 40,
|
|
1864
2065
|
index: 8,
|
|
1865
2066
|
key: 8
|
|
1866
|
-
}),
|
|
2067
|
+
}),
|
|
2068
|
+
/*#__PURE__*/
|
|
2069
|
+
React.createElement(ClockNumber, {
|
|
1867
2070
|
label: f('45'),
|
|
1868
2071
|
selected: value === 45,
|
|
1869
2072
|
index: 9,
|
|
1870
2073
|
key: 9
|
|
1871
|
-
}),
|
|
2074
|
+
}),
|
|
2075
|
+
/*#__PURE__*/
|
|
2076
|
+
React.createElement(ClockNumber, {
|
|
1872
2077
|
label: f('50'),
|
|
1873
2078
|
selected: value === 50,
|
|
1874
2079
|
index: 10,
|
|
1875
2080
|
key: 10
|
|
1876
|
-
}),
|
|
2081
|
+
}),
|
|
2082
|
+
/*#__PURE__*/
|
|
2083
|
+
React.createElement(ClockNumber, {
|
|
1877
2084
|
label: f('55'),
|
|
1878
2085
|
selected: value === 55,
|
|
1879
2086
|
index: 11,
|
|
@@ -1881,7 +2088,7 @@ var getMinutesNumbers = function (_a) {
|
|
|
1881
2088
|
})];
|
|
1882
2089
|
};
|
|
1883
2090
|
|
|
1884
|
-
var TimePickerView = function (_a) {
|
|
2091
|
+
var TimePickerView = function TimePickerView(_a) {
|
|
1885
2092
|
var type = _a.type,
|
|
1886
2093
|
onHourChange = _a.onHourChange,
|
|
1887
2094
|
onMinutesChange = _a.onMinutesChange,
|
|
@@ -1900,7 +2107,7 @@ var TimePickerView = function (_a) {
|
|
|
1900
2107
|
utils: utils,
|
|
1901
2108
|
ampm: Boolean(ampm)
|
|
1902
2109
|
}),
|
|
1903
|
-
onChange: function (value, isFinish) {
|
|
2110
|
+
onChange: function onChange(value, isFinish) {
|
|
1904
2111
|
var currentMeridiem = getMeridiem(date, utils);
|
|
1905
2112
|
var updatedTimeWithMeridiem = convertToMeridiem(utils.setHours(date, value), currentMeridiem, Boolean(ampm), utils);
|
|
1906
2113
|
onHourChange(updatedTimeWithMeridiem, isFinish);
|
|
@@ -1915,7 +2122,7 @@ var TimePickerView = function (_a) {
|
|
|
1915
2122
|
value: minutesValue,
|
|
1916
2123
|
utils: utils
|
|
1917
2124
|
}),
|
|
1918
|
-
onChange: function (value, isFinish) {
|
|
2125
|
+
onChange: function onChange(value, isFinish) {
|
|
1919
2126
|
var updatedTime = utils.setMinutes(date, value);
|
|
1920
2127
|
onMinutesChange(updatedTime, isFinish);
|
|
1921
2128
|
}
|
|
@@ -1929,7 +2136,7 @@ var TimePickerView = function (_a) {
|
|
|
1929
2136
|
value: secondsValue,
|
|
1930
2137
|
utils: utils
|
|
1931
2138
|
}),
|
|
1932
|
-
onChange: function (value, isFinish) {
|
|
2139
|
+
onChange: function onChange(value, isFinish) {
|
|
1933
2140
|
var updatedTime = utils.setSeconds(date, value);
|
|
1934
2141
|
onSecondsChange(updatedTime, isFinish);
|
|
1935
2142
|
}
|
|
@@ -1939,11 +2146,14 @@ var TimePickerView = function (_a) {
|
|
|
1939
2146
|
throw new Error('You must provide the type for TimePickerView');
|
|
1940
2147
|
}
|
|
1941
2148
|
}, [ampm, date, onHourChange, onMinutesChange, onSecondsChange, type, utils]);
|
|
1942
|
-
return
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
2149
|
+
return (
|
|
2150
|
+
/*#__PURE__*/
|
|
2151
|
+
React.createElement(Clock$1, tslib.__assign({
|
|
2152
|
+
type: type,
|
|
2153
|
+
ampm: ampm,
|
|
2154
|
+
minutesStep: minutesStep
|
|
2155
|
+
}, viewProps))
|
|
2156
|
+
);
|
|
1947
2157
|
};
|
|
1948
2158
|
TimePickerView.displayName = 'TimePickerView';
|
|
1949
2159
|
process.env.NODE_ENV !== "production" ? TimePickerView.propTypes = {
|
|
@@ -1953,15 +2163,14 @@ process.env.NODE_ENV !== "production" ? TimePickerView.propTypes = {
|
|
|
1953
2163
|
onSecondsChange: PropTypes.func.isRequired,
|
|
1954
2164
|
ampm: PropTypes.bool,
|
|
1955
2165
|
minutesStep: PropTypes.number,
|
|
1956
|
-
type: PropTypes.oneOf(Object.
|
|
1957
|
-
return ClockType$1[key];
|
|
1958
|
-
})).isRequired
|
|
2166
|
+
type: PropTypes.oneOf(Object.values(ClockType$1)).isRequired
|
|
1959
2167
|
} : void 0;
|
|
1960
2168
|
TimePickerView.defaultProps = {
|
|
1961
2169
|
ampm: true,
|
|
1962
2170
|
minutesStep: 1
|
|
1963
2171
|
};
|
|
1964
|
-
var ClockView =
|
|
2172
|
+
var ClockView = /*#__PURE__*/
|
|
2173
|
+
React.memo(TimePickerView);
|
|
1965
2174
|
|
|
1966
2175
|
var useStyles$b = styles$5.makeStyles(function (theme) {
|
|
1967
2176
|
return {
|
|
@@ -1993,7 +2202,7 @@ var useStyles$b = styles$5.makeStyles(function (theme) {
|
|
|
1993
2202
|
}, {
|
|
1994
2203
|
name: 'MuiPickersMonth'
|
|
1995
2204
|
});
|
|
1996
|
-
var Month = function (_a) {
|
|
2205
|
+
var Month = function Month(_a) {
|
|
1997
2206
|
var _b;
|
|
1998
2207
|
|
|
1999
2208
|
var selected = _a.selected,
|
|
@@ -2007,17 +2216,20 @@ var Month = function (_a) {
|
|
|
2007
2216
|
var handleSelection = React.useCallback(function () {
|
|
2008
2217
|
onSelect(value);
|
|
2009
2218
|
}, [onSelect, value]);
|
|
2010
|
-
return
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2219
|
+
return (
|
|
2220
|
+
/*#__PURE__*/
|
|
2221
|
+
React.createElement(Typography, tslib.__assign({
|
|
2222
|
+
role: "button",
|
|
2223
|
+
component: "div",
|
|
2224
|
+
className: clsx(classes.root, (_b = {}, _b[classes.monthSelected] = selected, _b[classes.monthDisabled] = disabled, _b)),
|
|
2225
|
+
tabIndex: disabled ? -1 : 0,
|
|
2226
|
+
onClick: handleSelection,
|
|
2227
|
+
onKeyPress: handleSelection,
|
|
2228
|
+
color: selected ? 'primary' : undefined,
|
|
2229
|
+
variant: selected ? 'h5' : 'subtitle1',
|
|
2230
|
+
children: children
|
|
2231
|
+
}, other))
|
|
2232
|
+
);
|
|
2021
2233
|
};
|
|
2022
2234
|
Month.displayName = 'Month';
|
|
2023
2235
|
|
|
@@ -2031,7 +2243,7 @@ var useStyles$c = styles$5.makeStyles({
|
|
|
2031
2243
|
}, {
|
|
2032
2244
|
name: 'MuiPickersMonthSelection'
|
|
2033
2245
|
});
|
|
2034
|
-
var MonthSelection = function (_a) {
|
|
2246
|
+
var MonthSelection = function MonthSelection(_a) {
|
|
2035
2247
|
var disablePast = _a.disablePast,
|
|
2036
2248
|
disableFuture = _a.disableFuture,
|
|
2037
2249
|
minDate = _a.minDate,
|
|
@@ -2043,7 +2255,7 @@ var MonthSelection = function (_a) {
|
|
|
2043
2255
|
var classes = useStyles$c();
|
|
2044
2256
|
var currentMonth = utils.getMonth(date);
|
|
2045
2257
|
|
|
2046
|
-
var shouldDisableMonth = function (month) {
|
|
2258
|
+
var shouldDisableMonth = function shouldDisableMonth(month) {
|
|
2047
2259
|
var now = utils.date();
|
|
2048
2260
|
var utilMinDate = utils.date(minDate);
|
|
2049
2261
|
var utilMaxDate = utils.date(maxDate);
|
|
@@ -2062,22 +2274,28 @@ var MonthSelection = function (_a) {
|
|
|
2062
2274
|
onMonthChange(newDate);
|
|
2063
2275
|
}
|
|
2064
2276
|
}, [date, onChange, onMonthChange, utils]);
|
|
2065
|
-
return
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2277
|
+
return (
|
|
2278
|
+
/*#__PURE__*/
|
|
2279
|
+
React.createElement("div", {
|
|
2280
|
+
className: classes.container
|
|
2281
|
+
}, utils.getMonthArray(date).map(function (month) {
|
|
2282
|
+
var monthNumber = utils.getMonth(month);
|
|
2283
|
+
var monthText = utils.formatByString(month, utils.formats.monthShort);
|
|
2284
|
+
return (
|
|
2285
|
+
/*#__PURE__*/
|
|
2286
|
+
React.createElement(Month, {
|
|
2287
|
+
key: monthText,
|
|
2288
|
+
value: monthNumber,
|
|
2289
|
+
selected: monthNumber === currentMonth,
|
|
2290
|
+
onSelect: onMonthSelect,
|
|
2291
|
+
disabled: shouldDisableMonth(month)
|
|
2292
|
+
}, monthText)
|
|
2293
|
+
);
|
|
2294
|
+
}))
|
|
2295
|
+
);
|
|
2296
|
+
};
|
|
2297
|
+
|
|
2298
|
+
var getOrientation = function getOrientation() {
|
|
2081
2299
|
return typeof window !== 'undefined' && window.screen && window.screen.orientation && Math.abs(window.screen.orientation.angle) === 90 ? 'landscape' : 'portrait';
|
|
2082
2300
|
};
|
|
2083
2301
|
|
|
@@ -2140,7 +2358,7 @@ var useButtonsStyles = styles$5.makeStyles({
|
|
|
2140
2358
|
var useDialogActionsStyles = styles$5.makeStyles({
|
|
2141
2359
|
withAdditionalAction: {}
|
|
2142
2360
|
});
|
|
2143
|
-
var Picker = function (props) {
|
|
2361
|
+
var Picker = function Picker(props) {
|
|
2144
2362
|
var _a, _b, _c;
|
|
2145
2363
|
|
|
2146
2364
|
var date = props.date,
|
|
@@ -2198,10 +2416,12 @@ var Picker = function (props) {
|
|
|
2198
2416
|
var shiftButtons = new Array();
|
|
2199
2417
|
|
|
2200
2418
|
if (showShiftButtons && setShiftFunction && onSetShift && shiftButtonValues) {
|
|
2201
|
-
var _loop_1 = function (key) {
|
|
2202
|
-
shiftButtons.push(
|
|
2419
|
+
var _loop_1 = function _loop_1(key) {
|
|
2420
|
+
shiftButtons.push(
|
|
2421
|
+
/*#__PURE__*/
|
|
2422
|
+
React.createElement(core.Button, {
|
|
2203
2423
|
color: "primary",
|
|
2204
|
-
onClick: function () {
|
|
2424
|
+
onClick: function onClick() {
|
|
2205
2425
|
return onSetShift(setShiftFunction(parseInt(key)));
|
|
2206
2426
|
},
|
|
2207
2427
|
key: shiftButtonValues[key]
|
|
@@ -2213,69 +2433,86 @@ var Picker = function (props) {
|
|
|
2213
2433
|
}
|
|
2214
2434
|
}
|
|
2215
2435
|
|
|
2216
|
-
return
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2436
|
+
return (
|
|
2437
|
+
/*#__PURE__*/
|
|
2438
|
+
React.createElement("div", {
|
|
2439
|
+
className: clsx(classes.container, (_a = {}, _a[classes.containerLandscape] = isLandscape, _a))
|
|
2440
|
+
}, !disableToolbar &&
|
|
2441
|
+
/*#__PURE__*/
|
|
2442
|
+
React.createElement(ToolbarComponent, tslib.__assign({
|
|
2443
|
+
setOpenView: setOpenView,
|
|
2444
|
+
openView: openView,
|
|
2445
|
+
hideTabs: hideTabs,
|
|
2446
|
+
dateRangeIcon: dateRangeIcon,
|
|
2447
|
+
timeIcon: timeIcon,
|
|
2448
|
+
isLandscape: isLandscape
|
|
2449
|
+
}, props)),
|
|
2450
|
+
/*#__PURE__*/
|
|
2451
|
+
React.createElement("div", {
|
|
2452
|
+
className: clsx(classes.pickerView, (_b = {}, _b[classes.pickerViewLandscape] = isLandscape, _b))
|
|
2453
|
+
}, openView === 'year' &&
|
|
2454
|
+
/*#__PURE__*/
|
|
2455
|
+
React.createElement(YearSelection, {
|
|
2456
|
+
date: date,
|
|
2457
|
+
onChange: handleChangeAndOpenNext,
|
|
2458
|
+
minDate: minDate,
|
|
2459
|
+
maxDate: maxDate,
|
|
2460
|
+
disablePast: disablePast,
|
|
2461
|
+
disableFuture: disableFuture,
|
|
2462
|
+
onYearChange: onYearChange,
|
|
2463
|
+
animateYearScrolling: animateYearScrolling
|
|
2464
|
+
}), openView === 'month' &&
|
|
2465
|
+
/*#__PURE__*/
|
|
2466
|
+
React.createElement(MonthSelection, {
|
|
2467
|
+
date: date,
|
|
2468
|
+
onChange: handleChangeAndOpenNext,
|
|
2469
|
+
minDate: minDate,
|
|
2470
|
+
maxDate: maxDate,
|
|
2471
|
+
disablePast: disablePast,
|
|
2472
|
+
disableFuture: disableFuture,
|
|
2473
|
+
onMonthChange: onMonthChange
|
|
2474
|
+
}), openView === 'date' &&
|
|
2475
|
+
/*#__PURE__*/
|
|
2476
|
+
React.createElement(Calendar$1, {
|
|
2477
|
+
date: date,
|
|
2478
|
+
onChange: handleChangeAndOpenNext,
|
|
2479
|
+
onMonthChange: onMonthChange,
|
|
2480
|
+
disablePast: disablePast,
|
|
2481
|
+
disableFuture: disableFuture,
|
|
2482
|
+
minDate: minDate,
|
|
2483
|
+
maxDate: maxDate,
|
|
2484
|
+
leftArrowIcon: leftArrowIcon,
|
|
2485
|
+
leftArrowButtonProps: leftArrowButtonProps,
|
|
2486
|
+
rightArrowIcon: rightArrowIcon,
|
|
2487
|
+
rightArrowButtonProps: rightArrowButtonProps,
|
|
2488
|
+
renderDay: renderDay,
|
|
2489
|
+
shouldDisableDate: shouldDisableDate,
|
|
2490
|
+
allowKeyboardControl: allowKeyboardControl,
|
|
2491
|
+
loadingIndicator: loadingIndicator
|
|
2492
|
+
}), (openView === 'hours' || openView === 'minutes' || openView === 'seconds') &&
|
|
2493
|
+
/*#__PURE__*/
|
|
2494
|
+
React.createElement(TimePickerView, {
|
|
2495
|
+
date: date,
|
|
2496
|
+
ampm: ampm,
|
|
2497
|
+
type: openView,
|
|
2498
|
+
minutesStep: minutesStep,
|
|
2499
|
+
onHourChange: handleChangeAndOpenNext,
|
|
2500
|
+
onMinutesChange: handleChangeAndOpenNext,
|
|
2501
|
+
onSecondsChange: handleChangeAndOpenNext
|
|
2502
|
+
})), showActionsBar &&
|
|
2503
|
+
/*#__PURE__*/
|
|
2504
|
+
React.createElement(core.DialogActions, {
|
|
2505
|
+
classes: {
|
|
2506
|
+
root: clsx((_c = {}, _c[dialogActionsClasses.withAdditionalAction] = showTodayButton, _c))
|
|
2507
|
+
}
|
|
2508
|
+
}, showTodayButton &&
|
|
2509
|
+
/*#__PURE__*/
|
|
2510
|
+
React.createElement(core.Button, {
|
|
2511
|
+
color: "primary",
|
|
2512
|
+
onClick: onSetToday,
|
|
2513
|
+
key: "today"
|
|
2514
|
+
}, todayLabel), showShiftButtons && setShiftFunction && shiftButtons))
|
|
2515
|
+
);
|
|
2279
2516
|
};
|
|
2280
2517
|
Picker.defaultProps = tslib.__assign(tslib.__assign({}, datePickerDefaultProps), {
|
|
2281
2518
|
views: Object.keys(viewsMap)
|
|
@@ -2305,7 +2542,7 @@ function useOpenState(_a) {
|
|
|
2305
2542
|
};
|
|
2306
2543
|
}
|
|
2307
2544
|
|
|
2308
|
-
var getDisplayDate = function (value, format, utils, isEmpty, _a) {
|
|
2545
|
+
var getDisplayDate = function getDisplayDate(value, format, utils, isEmpty, _a) {
|
|
2309
2546
|
var invalidLabel = _a.invalidLabel,
|
|
2310
2547
|
emptyLabel = _a.emptyLabel,
|
|
2311
2548
|
labelFunc = _a.labelFunc;
|
|
@@ -2319,10 +2556,10 @@ var getDisplayDate = function (value, format, utils, isEmpty, _a) {
|
|
|
2319
2556
|
return emptyLabel || '';
|
|
2320
2557
|
}
|
|
2321
2558
|
|
|
2322
|
-
return utils.isValid(date) ? utils.
|
|
2559
|
+
return utils.isValid(date) ? utils.formatByString(date, format) : invalidLabel;
|
|
2323
2560
|
};
|
|
2324
2561
|
|
|
2325
|
-
var getComparisonMaxDate = function (utils, strictCompareDates, date) {
|
|
2562
|
+
var getComparisonMaxDate = function getComparisonMaxDate(utils, strictCompareDates, date) {
|
|
2326
2563
|
if (strictCompareDates) {
|
|
2327
2564
|
return date;
|
|
2328
2565
|
}
|
|
@@ -2330,7 +2567,7 @@ var getComparisonMaxDate = function (utils, strictCompareDates, date) {
|
|
|
2330
2567
|
return utils.endOfDay(date);
|
|
2331
2568
|
};
|
|
2332
2569
|
|
|
2333
|
-
var getComparisonMinDate = function (utils, strictCompareDates, date) {
|
|
2570
|
+
var getComparisonMinDate = function getComparisonMinDate(utils, strictCompareDates, date) {
|
|
2334
2571
|
if (strictCompareDates) {
|
|
2335
2572
|
return date;
|
|
2336
2573
|
}
|
|
@@ -2338,7 +2575,7 @@ var getComparisonMinDate = function (utils, strictCompareDates, date) {
|
|
|
2338
2575
|
return utils.startOfDay(date);
|
|
2339
2576
|
};
|
|
2340
2577
|
|
|
2341
|
-
var validate = function (value, utils, _a // DateTimePicker doesn't support
|
|
2578
|
+
var validate = function validate(value, utils, _a // DateTimePicker doesn't support
|
|
2342
2579
|
) {
|
|
2343
2580
|
var maxDate = _a.maxDate,
|
|
2344
2581
|
minDate = _a.minDate,
|
|
@@ -2390,7 +2627,7 @@ function pick12hOr24hFormat(userFormat, ampm, formats) {
|
|
|
2390
2627
|
function makeMaskFromFormat(format, numberMaskChar) {
|
|
2391
2628
|
return format.replace(/[a-z]/gi, numberMaskChar);
|
|
2392
2629
|
}
|
|
2393
|
-
var maskedDateFormatter = function (mask, numberMaskChar) {
|
|
2630
|
+
var maskedDateFormatter = function maskedDateFormatter(mask, numberMaskChar) {
|
|
2394
2631
|
return function (value, oldValue, currentCaretPosition) {
|
|
2395
2632
|
var refuse = /[^\d\w_]+/gi;
|
|
2396
2633
|
|
|
@@ -2470,7 +2707,7 @@ var maskedDateFormatter = function (mask, numberMaskChar) {
|
|
|
2470
2707
|
};
|
|
2471
2708
|
};
|
|
2472
2709
|
|
|
2473
|
-
var useValueToDate = function (utils, _a) {
|
|
2710
|
+
var useValueToDate = function useValueToDate(utils, _a) {
|
|
2474
2711
|
var value = _a.value,
|
|
2475
2712
|
initialFocusedDate = _a.initialFocusedDate;
|
|
2476
2713
|
var nowRef = React.useRef(utils.date());
|
|
@@ -2492,7 +2729,7 @@ function usePickerState(props, options) {
|
|
|
2492
2729
|
var autoOk = props.autoOk,
|
|
2493
2730
|
disabled = props.disabled,
|
|
2494
2731
|
onAccept = props.onAccept,
|
|
2495
|
-
|
|
2732
|
+
_onChange = props.onChange,
|
|
2496
2733
|
onError = props.onError,
|
|
2497
2734
|
value = props.value,
|
|
2498
2735
|
variant = props.variant;
|
|
@@ -2518,26 +2755,27 @@ function usePickerState(props, options) {
|
|
|
2518
2755
|
}, [date, isOpen, pickerDate, utils]);
|
|
2519
2756
|
var acceptDate = React.useCallback(function (acceptedDate) {
|
|
2520
2757
|
setIsOpen(false);
|
|
2521
|
-
|
|
2758
|
+
|
|
2759
|
+
_onChange(acceptedDate);
|
|
2522
2760
|
|
|
2523
2761
|
if (onAccept) {
|
|
2524
2762
|
onAccept(acceptedDate);
|
|
2525
2763
|
}
|
|
2526
|
-
}, [onAccept,
|
|
2764
|
+
}, [onAccept, _onChange, setIsOpen]);
|
|
2527
2765
|
var wrapperProps = React.useMemo(function () {
|
|
2528
2766
|
return {
|
|
2529
2767
|
format: format,
|
|
2530
2768
|
open: isOpen,
|
|
2531
|
-
onClear: function () {
|
|
2769
|
+
onClear: function onClear() {
|
|
2532
2770
|
return acceptDate(null);
|
|
2533
2771
|
},
|
|
2534
|
-
onAccept: function () {
|
|
2772
|
+
onAccept: function onAccept() {
|
|
2535
2773
|
return acceptDate(pickerDate);
|
|
2536
2774
|
},
|
|
2537
|
-
onSetToday: function () {
|
|
2775
|
+
onSetToday: function onSetToday() {
|
|
2538
2776
|
return setPickerDate(utils.date());
|
|
2539
2777
|
},
|
|
2540
|
-
onDismiss: function () {
|
|
2778
|
+
onDismiss: function onDismiss() {
|
|
2541
2779
|
setIsOpen(false);
|
|
2542
2780
|
}
|
|
2543
2781
|
};
|
|
@@ -2545,7 +2783,7 @@ function usePickerState(props, options) {
|
|
|
2545
2783
|
var pickerProps = React.useMemo(function () {
|
|
2546
2784
|
return {
|
|
2547
2785
|
date: pickerDate,
|
|
2548
|
-
onChange: function (newDate, isFinish) {
|
|
2786
|
+
onChange: function onChange(newDate, isFinish) {
|
|
2549
2787
|
if (isFinish === void 0) {
|
|
2550
2788
|
isFinish = true;
|
|
2551
2789
|
}
|
|
@@ -2553,30 +2791,30 @@ function usePickerState(props, options) {
|
|
|
2553
2791
|
setPickerDate(newDate);
|
|
2554
2792
|
|
|
2555
2793
|
if (variant === 'inline' || variant === 'static') {
|
|
2556
|
-
|
|
2794
|
+
_onChange(newDate);
|
|
2557
2795
|
}
|
|
2558
2796
|
|
|
2559
2797
|
if (isFinish && autoOk) {
|
|
2560
2798
|
acceptDate(newDate);
|
|
2561
2799
|
}
|
|
2562
2800
|
},
|
|
2563
|
-
onSetToday: function () {
|
|
2801
|
+
onSetToday: function onSetToday() {
|
|
2564
2802
|
var newDate = utils.date();
|
|
2565
2803
|
setPickerDate(newDate);
|
|
2566
2804
|
|
|
2567
2805
|
if (variant === 'inline' || variant === 'static') {
|
|
2568
|
-
|
|
2806
|
+
_onChange(newDate);
|
|
2569
2807
|
}
|
|
2570
2808
|
|
|
2571
2809
|
if (autoOk) {
|
|
2572
2810
|
acceptDate(newDate);
|
|
2573
2811
|
}
|
|
2574
2812
|
},
|
|
2575
|
-
onSetShift: function (shiftDate) {
|
|
2813
|
+
onSetShift: function onSetShift(shiftDate) {
|
|
2576
2814
|
var newDate = utils.date(shiftDate);
|
|
2577
2815
|
|
|
2578
2816
|
if (variant === 'inline' || variant === 'static') {
|
|
2579
|
-
|
|
2817
|
+
_onChange(newDate);
|
|
2580
2818
|
}
|
|
2581
2819
|
|
|
2582
2820
|
if (autoOk) {
|
|
@@ -2584,7 +2822,7 @@ function usePickerState(props, options) {
|
|
|
2584
2822
|
}
|
|
2585
2823
|
}
|
|
2586
2824
|
};
|
|
2587
|
-
}, [acceptDate, autoOk,
|
|
2825
|
+
}, [acceptDate, autoOk, _onChange, pickerDate, variant]);
|
|
2588
2826
|
var validationError = validate(value, utils, props);
|
|
2589
2827
|
React.useEffect(function () {
|
|
2590
2828
|
if (validationError && onError) {
|
|
@@ -2596,7 +2834,7 @@ function usePickerState(props, options) {
|
|
|
2596
2834
|
return {
|
|
2597
2835
|
inputValue: inputValue,
|
|
2598
2836
|
validationError: validationError,
|
|
2599
|
-
onClick: function () {
|
|
2837
|
+
onClick: function onClick() {
|
|
2600
2838
|
return !disabled && setIsOpen(true);
|
|
2601
2839
|
}
|
|
2602
2840
|
};
|
|
@@ -2610,7 +2848,7 @@ function usePickerState(props, options) {
|
|
|
2610
2848
|
return pickerState;
|
|
2611
2849
|
}
|
|
2612
2850
|
|
|
2613
|
-
var PureDateInput = function (_a) {
|
|
2851
|
+
var PureDateInput = function PureDateInput(_a) {
|
|
2614
2852
|
var inputValue = _a.inputValue,
|
|
2615
2853
|
inputVariant = _a.inputVariant,
|
|
2616
2854
|
validationError = _a.validationError,
|
|
@@ -2624,15 +2862,18 @@ var PureDateInput = function (_a) {
|
|
|
2624
2862
|
readOnly: true
|
|
2625
2863
|
});
|
|
2626
2864
|
}, [InputProps]);
|
|
2627
|
-
return
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2865
|
+
return (
|
|
2866
|
+
/*#__PURE__*/
|
|
2867
|
+
React.createElement(TextFieldComponent, tslib.__assign({
|
|
2868
|
+
error: Boolean(validationError),
|
|
2869
|
+
helperText: validationError
|
|
2870
|
+
}, other, {
|
|
2871
|
+
// do not overridable
|
|
2872
|
+
value: inputValue,
|
|
2873
|
+
variant: inputVariant,
|
|
2874
|
+
InputProps: PureDateInputProps
|
|
2875
|
+
}))
|
|
2876
|
+
);
|
|
2636
2877
|
};
|
|
2637
2878
|
PureDateInput.displayName = 'PureDateInput';
|
|
2638
2879
|
|
|
@@ -2694,6 +2935,10 @@ function makePurePicker(_a) {
|
|
|
2694
2935
|
other = tslib.__rest(props, ["allowKeyboardControl", "ampm", "hideTabs", "animateYearScrolling", "autoOk", "disableFuture", "disablePast", "format", "forwardedRef", "initialFocusedDate", "invalidDateMessage", "labelFunc", "leftArrowIcon", "leftArrowButtonProps", "maxDate", "maxDateMessage", "minDate", "onOpen", "onClose", "minDateMessage", "strictCompareDates", "minutesStep", "onAccept", "onChange", "onMonthChange", "onYearChange", "renderDay", "views", "openTo", "rightArrowIcon", "rightArrowButtonProps", "shouldDisableDate", "dateRangeIcon", "emptyLabel", "invalidLabel", "timeIcon", "value", "variant", "orientation", "disableToolbar", "loadingIndicator", "ToolbarComponent", "showActionsBar", "showTodayButton", "todayLabel", "showShiftButtons", "setShiftFunction", "shiftButtonValues"]);
|
|
2695
2936
|
|
|
2696
2937
|
var injectedProps = getCustomProps ? getCustomProps(props) : {};
|
|
2938
|
+
var dialogVariantProps = variant === "dialog" ? {
|
|
2939
|
+
showTodayButton: showTodayButton,
|
|
2940
|
+
todayLabel: todayLabel
|
|
2941
|
+
} : {};
|
|
2697
2942
|
var options = useOptions(props);
|
|
2698
2943
|
|
|
2699
2944
|
var _b = usePickerState(props, options),
|
|
@@ -2701,61 +2946,71 @@ function makePurePicker(_a) {
|
|
|
2701
2946
|
inputProps = _b.inputProps,
|
|
2702
2947
|
wrapperProps = _b.wrapperProps;
|
|
2703
2948
|
|
|
2704
|
-
return
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2949
|
+
return (
|
|
2950
|
+
/*#__PURE__*/
|
|
2951
|
+
React.createElement(Wrapper, tslib.__assign({
|
|
2952
|
+
variant: variant,
|
|
2953
|
+
InputComponent: PureDateInput,
|
|
2954
|
+
DateInputProps: inputProps
|
|
2955
|
+
}, wrapperProps, injectedProps, dialogVariantProps, other),
|
|
2956
|
+
/*#__PURE__*/
|
|
2957
|
+
React.createElement(Picker, tslib.__assign({}, pickerProps, {
|
|
2958
|
+
orientation: orientation,
|
|
2959
|
+
disableToolbar: disableToolbar,
|
|
2960
|
+
ToolbarComponent: ToolbarComponent,
|
|
2961
|
+
hideTabs: hideTabs,
|
|
2962
|
+
ampm: ampm,
|
|
2963
|
+
views: views,
|
|
2964
|
+
openTo: openTo,
|
|
2965
|
+
allowKeyboardControl: allowKeyboardControl,
|
|
2966
|
+
minutesStep: minutesStep,
|
|
2967
|
+
animateYearScrolling: animateYearScrolling,
|
|
2968
|
+
disableFuture: disableFuture,
|
|
2969
|
+
disablePast: disablePast,
|
|
2970
|
+
leftArrowIcon: leftArrowIcon,
|
|
2971
|
+
leftArrowButtonProps: leftArrowButtonProps,
|
|
2972
|
+
maxDate: maxDate,
|
|
2973
|
+
minDate: minDate,
|
|
2974
|
+
strictCompareDates: strictCompareDates,
|
|
2975
|
+
onMonthChange: onMonthChange,
|
|
2976
|
+
onYearChange: onYearChange,
|
|
2977
|
+
renderDay: renderDay,
|
|
2978
|
+
dateRangeIcon: dateRangeIcon,
|
|
2979
|
+
timeIcon: timeIcon,
|
|
2980
|
+
rightArrowIcon: rightArrowIcon,
|
|
2981
|
+
rightArrowButtonProps: rightArrowButtonProps,
|
|
2982
|
+
shouldDisableDate: shouldDisableDate,
|
|
2983
|
+
loadingIndicator: loadingIndicator,
|
|
2984
|
+
showActionsBar: showActionsBar,
|
|
2985
|
+
showTodayButton: showTodayButton,
|
|
2986
|
+
todayLabel: todayLabel,
|
|
2987
|
+
showShiftButtons: showShiftButtons,
|
|
2988
|
+
setShiftFunction: setShiftFunction,
|
|
2989
|
+
shiftButtonValues: shiftButtonValues
|
|
2990
|
+
})))
|
|
2991
|
+
);
|
|
2744
2992
|
}
|
|
2745
2993
|
|
|
2746
2994
|
return WrappedPurePicker;
|
|
2747
2995
|
}
|
|
2748
2996
|
|
|
2749
|
-
var KeyboardIcon = function (props) {
|
|
2750
|
-
return
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2997
|
+
var KeyboardIcon = function KeyboardIcon(props) {
|
|
2998
|
+
return (
|
|
2999
|
+
/*#__PURE__*/
|
|
3000
|
+
React__default.createElement(SvgIcon, tslib.__assign({}, props),
|
|
3001
|
+
/*#__PURE__*/
|
|
3002
|
+
React__default.createElement("path", {
|
|
3003
|
+
d: "M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"
|
|
3004
|
+
}),
|
|
3005
|
+
/*#__PURE__*/
|
|
3006
|
+
React__default.createElement("path", {
|
|
3007
|
+
fill: "none",
|
|
3008
|
+
d: "M0 0h24v24H0z"
|
|
3009
|
+
}))
|
|
3010
|
+
);
|
|
3011
|
+
};
|
|
3012
|
+
|
|
3013
|
+
var Rifm = function Rifm(props) {
|
|
2759
3014
|
var _a = React.useReducer(function (c) {
|
|
2760
3015
|
return c + 1;
|
|
2761
3016
|
}, 0),
|
|
@@ -2776,7 +3031,7 @@ var Rifm = function (props) {
|
|
|
2776
3031
|
|
|
2777
3032
|
var isDeleleteButtonDownRef = React.useRef(false);
|
|
2778
3033
|
|
|
2779
|
-
var onChange = function (evt) {
|
|
3034
|
+
var onChange = function onChange(evt) {
|
|
2780
3035
|
var eventValue = evt.target.value;
|
|
2781
3036
|
var selectionStart = evt.target.selectionStart;
|
|
2782
3037
|
valueRef.current = [eventValue, evt.target, eventValue.length > userValue.length, isDeleleteButtonDownRef.current, selectionStart, userValue === props.format(eventValue, currentPreviousValue, selectionStart)]; // The main trick is to update underlying input with non formatted value (= eventValue)
|
|
@@ -2805,7 +3060,7 @@ var Rifm = function (props) {
|
|
|
2805
3060
|
|
|
2806
3061
|
var deleteWasNoOp = isDeleleteButtonDown && isNoOperation; // Create string from only accepted symbols
|
|
2807
3062
|
|
|
2808
|
-
var clean = function (str) {
|
|
3063
|
+
var clean = function clean(str) {
|
|
2809
3064
|
return (str.match(props.accept || /\d|\w/g) || []).join('');
|
|
2810
3065
|
};
|
|
2811
3066
|
|
|
@@ -2818,7 +3073,7 @@ var Rifm = function (props) {
|
|
|
2818
3073
|
// so for formatting just this function to determine cursor position after formatting is enough
|
|
2819
3074
|
// with masking we need to do some additional checks see `mask` below
|
|
2820
3075
|
|
|
2821
|
-
var getCursorPosition = function (val) {
|
|
3076
|
+
var getCursorPosition = function getCursorPosition(val) {
|
|
2822
3077
|
var start = 0;
|
|
2823
3078
|
var cleanPos = 0;
|
|
2824
3079
|
|
|
@@ -2893,13 +3148,13 @@ var Rifm = function (props) {
|
|
|
2893
3148
|
// there is no way I found to distinguish in onChange
|
|
2894
3149
|
// backspace or delete was called in some situations
|
|
2895
3150
|
// firefox track https://bugzilla.mozilla.org/show_bug.cgi?id=1447239
|
|
2896
|
-
var handleKeyDown = function (evt) {
|
|
3151
|
+
var handleKeyDown = function handleKeyDown(evt) {
|
|
2897
3152
|
if (evt.code === 'Delete') {
|
|
2898
3153
|
isDeleleteButtonDownRef.current = true;
|
|
2899
3154
|
}
|
|
2900
3155
|
};
|
|
2901
3156
|
|
|
2902
|
-
var handleKeyUp = function (evt) {
|
|
3157
|
+
var handleKeyUp = function handleKeyUp(evt) {
|
|
2903
3158
|
if (evt.code === 'Delete') {
|
|
2904
3159
|
isDeleleteButtonDownRef.current = false;
|
|
2905
3160
|
}
|
|
@@ -2921,7 +3176,7 @@ var Rifm = function (props) {
|
|
|
2921
3176
|
});
|
|
2922
3177
|
};
|
|
2923
3178
|
|
|
2924
|
-
var KeyboardDateInput = function (_a) {
|
|
3179
|
+
var KeyboardDateInput = function KeyboardDateInput(_a) {
|
|
2925
3180
|
var inputValue = _a.inputValue,
|
|
2926
3181
|
_b = _a.showErrorOnBlur,
|
|
2927
3182
|
showErrorOnBlur = _b === void 0 ? false : _b,
|
|
@@ -2931,8 +3186,8 @@ var KeyboardDateInput = function (_a) {
|
|
|
2931
3186
|
InputAdornmentProps = _a.InputAdornmentProps,
|
|
2932
3187
|
onClick = _a.onClick,
|
|
2933
3188
|
onChange = _a.onChange,
|
|
2934
|
-
|
|
2935
|
-
|
|
3189
|
+
_onBlur = _a.onBlur,
|
|
3190
|
+
_onFocus = _a.onFocus,
|
|
2936
3191
|
InputProps = _a.InputProps,
|
|
2937
3192
|
mask = _a.mask,
|
|
2938
3193
|
_c = _a.maskChar,
|
|
@@ -2952,12 +3207,12 @@ var KeyboardDateInput = function (_a) {
|
|
|
2952
3207
|
var formatter = React.useCallback(maskedDateFormatter(inputMask, maskChar), [mask, maskChar]);
|
|
2953
3208
|
var position = InputAdornmentProps && InputAdornmentProps.position ? InputAdornmentProps.position : 'end';
|
|
2954
3209
|
|
|
2955
|
-
var handleChange = function (text) {
|
|
3210
|
+
var handleChange = function handleChange(text) {
|
|
2956
3211
|
var finalString = text === '' || text === inputMask ? null : text;
|
|
2957
3212
|
onChange(finalString);
|
|
2958
3213
|
};
|
|
2959
3214
|
|
|
2960
|
-
var replace = function (text) {
|
|
3215
|
+
var replace = function replace(text) {
|
|
2961
3216
|
return text;
|
|
2962
3217
|
};
|
|
2963
3218
|
|
|
@@ -2965,61 +3220,73 @@ var KeyboardDateInput = function (_a) {
|
|
|
2965
3220
|
showErrorFlag = _f[0],
|
|
2966
3221
|
handleBlur = _f[1];
|
|
2967
3222
|
|
|
2968
|
-
return
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3223
|
+
return (
|
|
3224
|
+
/*#__PURE__*/
|
|
3225
|
+
React.createElement(Rifm, {
|
|
3226
|
+
value: inputValue,
|
|
3227
|
+
onChange: handleChange,
|
|
3228
|
+
format: rifmFormatter || formatter,
|
|
3229
|
+
replace: replace,
|
|
3230
|
+
mask: true,
|
|
3231
|
+
maskChar: maskChar,
|
|
3232
|
+
letterPosition: letterPosition
|
|
3233
|
+
}, function (_a) {
|
|
3234
|
+
var _b;
|
|
3235
|
+
|
|
3236
|
+
var onChange = _a.onChange,
|
|
3237
|
+
value = _a.value;
|
|
3238
|
+
return (
|
|
3239
|
+
/*#__PURE__*/
|
|
3240
|
+
React.createElement(TextFieldComponent, tslib.__assign({
|
|
3241
|
+
disabled: disabled,
|
|
3242
|
+
error: Boolean(validationError) && !showErrorFlag,
|
|
3243
|
+
helperText: !showErrorFlag && validationError
|
|
3244
|
+
}, other, {
|
|
3245
|
+
value: value,
|
|
3246
|
+
onChange: onChange,
|
|
3247
|
+
// onInput={changeInputStringValue}
|
|
3248
|
+
// onKeyUp={handleKeyUp}
|
|
3249
|
+
// onMouseUp={handleClick}
|
|
3250
|
+
onBlur: function onBlur() {
|
|
3251
|
+
if (_onBlur) {
|
|
3252
|
+
_onBlur();
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
if (showErrorOnBlur) {
|
|
3256
|
+
handleBlur(false);
|
|
3257
|
+
}
|
|
3258
|
+
},
|
|
3259
|
+
onFocus: function onFocus(ev) {
|
|
3260
|
+
if (_onFocus) {
|
|
3261
|
+
_onFocus(ev);
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
if (showErrorOnBlur) {
|
|
3265
|
+
handleBlur(true);
|
|
3266
|
+
}
|
|
3267
|
+
},
|
|
3268
|
+
variant: inputVariant,
|
|
3269
|
+
InputProps: tslib.__assign(tslib.__assign({}, InputProps), (_b = {}, _b[position + "Adornment"] =
|
|
3270
|
+
/*#__PURE__*/
|
|
3271
|
+
React.createElement(InputAdornment, tslib.__assign({
|
|
3272
|
+
position: position
|
|
3273
|
+
}, InputAdornmentProps),
|
|
3274
|
+
/*#__PURE__*/
|
|
3275
|
+
React.createElement(core.IconButton, tslib.__assign({
|
|
3276
|
+
disabled: disabled
|
|
3277
|
+
}, KeyboardButtonProps, {
|
|
3278
|
+
onClick: onClick
|
|
3279
|
+
}), keyboardIcon)), _b))
|
|
3280
|
+
}))
|
|
3281
|
+
);
|
|
3282
|
+
})
|
|
3283
|
+
);
|
|
3019
3284
|
};
|
|
3020
3285
|
|
|
3021
3286
|
KeyboardDateInput.defaultProps = {
|
|
3022
|
-
keyboardIcon:
|
|
3287
|
+
keyboardIcon:
|
|
3288
|
+
/*#__PURE__*/
|
|
3289
|
+
React.createElement(KeyboardIcon, null)
|
|
3023
3290
|
};
|
|
3024
3291
|
|
|
3025
3292
|
function parseInputString(value, utils, format) {
|
|
@@ -3034,7 +3301,7 @@ function useKeyboardPickerState(props, options) {
|
|
|
3034
3301
|
var _a = props.format,
|
|
3035
3302
|
format = _a === void 0 ? options.getDefaultFormat() : _a,
|
|
3036
3303
|
inputValue = props.inputValue,
|
|
3037
|
-
|
|
3304
|
+
_onChange = props.onChange,
|
|
3038
3305
|
value = props.value;
|
|
3039
3306
|
var utils = useUtils();
|
|
3040
3307
|
var displayDate = getDisplayDate(value, format, utils, value === null, props);
|
|
@@ -3050,8 +3317,8 @@ function useKeyboardPickerState(props, options) {
|
|
|
3050
3317
|
}
|
|
3051
3318
|
}, [displayDate, setInnerInputValue, utils, value]);
|
|
3052
3319
|
var handleKeyboardChange = React.useCallback(function (date) {
|
|
3053
|
-
|
|
3054
|
-
}, [format,
|
|
3320
|
+
_onChange(date, date === null ? null : utils.formatByString(date, format));
|
|
3321
|
+
}, [format, _onChange, utils]);
|
|
3055
3322
|
|
|
3056
3323
|
var _c = usePickerState(tslib.__assign(tslib.__assign({}, props), {
|
|
3057
3324
|
value: dateValue,
|
|
@@ -3065,13 +3332,14 @@ function useKeyboardPickerState(props, options) {
|
|
|
3065
3332
|
return tslib.__assign(tslib.__assign({}, innerInputProps), {
|
|
3066
3333
|
format: wrapperProps.format,
|
|
3067
3334
|
inputValue: inputValue || innerInputValue,
|
|
3068
|
-
onChange: function (value) {
|
|
3335
|
+
onChange: function onChange(value) {
|
|
3069
3336
|
setInnerInputValue(value || '');
|
|
3070
3337
|
var date = value === null ? null : utils.parse(value, wrapperProps.format);
|
|
3071
|
-
|
|
3338
|
+
|
|
3339
|
+
_onChange(date, value);
|
|
3072
3340
|
}
|
|
3073
3341
|
});
|
|
3074
|
-
}, [innerInputProps, innerInputValue, inputValue,
|
|
3342
|
+
}, [innerInputProps, innerInputValue, inputValue, _onChange, utils, wrapperProps.format]);
|
|
3075
3343
|
return {
|
|
3076
3344
|
inputProps: inputProps,
|
|
3077
3345
|
wrapperProps: wrapperProps,
|
|
@@ -3146,44 +3414,49 @@ function makeKeyboardPicker(_a) {
|
|
|
3146
3414
|
inputProps = _b.inputProps,
|
|
3147
3415
|
wrapperProps = _b.wrapperProps;
|
|
3148
3416
|
|
|
3149
|
-
return
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3417
|
+
return (
|
|
3418
|
+
/*#__PURE__*/
|
|
3419
|
+
React.createElement(Wrapper, tslib.__assign({
|
|
3420
|
+
variant: variant,
|
|
3421
|
+
InputComponent: KeyboardDateInput,
|
|
3422
|
+
DateInputProps: inputProps
|
|
3423
|
+
}, injectedProps, wrapperProps, other),
|
|
3424
|
+
/*#__PURE__*/
|
|
3425
|
+
React.createElement(Picker, tslib.__assign({}, pickerProps, {
|
|
3426
|
+
ToolbarComponent: ToolbarComponent,
|
|
3427
|
+
disableToolbar: disableToolbar,
|
|
3428
|
+
hideTabs: hideTabs,
|
|
3429
|
+
orientation: orientation,
|
|
3430
|
+
showActionsBar: showActionsBar,
|
|
3431
|
+
showTodayButton: showTodayButton,
|
|
3432
|
+
todayLabel: todayLabel,
|
|
3433
|
+
ampm: ampm,
|
|
3434
|
+
views: views,
|
|
3435
|
+
openTo: openTo,
|
|
3436
|
+
allowKeyboardControl: allowKeyboardControl,
|
|
3437
|
+
minutesStep: minutesStep,
|
|
3438
|
+
animateYearScrolling: animateYearScrolling,
|
|
3439
|
+
disableFuture: disableFuture,
|
|
3440
|
+
disablePast: disablePast,
|
|
3441
|
+
leftArrowIcon: leftArrowIcon,
|
|
3442
|
+
leftArrowButtonProps: leftArrowButtonProps,
|
|
3443
|
+
maxDate: maxDate,
|
|
3444
|
+
minDate: minDate,
|
|
3445
|
+
strictCompareDates: strictCompareDates,
|
|
3446
|
+
onMonthChange: onMonthChange,
|
|
3447
|
+
onYearChange: onYearChange,
|
|
3448
|
+
renderDay: renderDay,
|
|
3449
|
+
dateRangeIcon: dateRangeIcon,
|
|
3450
|
+
timeIcon: timeIcon,
|
|
3451
|
+
rightArrowIcon: rightArrowIcon,
|
|
3452
|
+
rightArrowButtonProps: rightArrowButtonProps,
|
|
3453
|
+
shouldDisableDate: shouldDisableDate,
|
|
3454
|
+
loadingIndicator: loadingIndicator,
|
|
3455
|
+
showShiftButtons: showShiftButtons,
|
|
3456
|
+
setShiftFunction: setShiftFunction,
|
|
3457
|
+
shiftButtonValues: shiftButtonValues
|
|
3458
|
+
})))
|
|
3459
|
+
);
|
|
3187
3460
|
}
|
|
3188
3461
|
|
|
3189
3462
|
return WrappedKeyboardPicker;
|
|
@@ -3199,7 +3472,7 @@ var defaultProps = tslib.__assign(tslib.__assign({}, datePickerDefaultProps), {
|
|
|
3199
3472
|
function useOptions(props) {
|
|
3200
3473
|
var utils = useUtils();
|
|
3201
3474
|
return {
|
|
3202
|
-
getDefaultFormat: function () {
|
|
3475
|
+
getDefaultFormat: function getDefaultFormat() {
|
|
3203
3476
|
return getFormatByViews(props.views, utils);
|
|
3204
3477
|
}
|
|
3205
3478
|
};
|
|
@@ -3273,7 +3546,7 @@ function useMeridiemMode(date, ampm, onChange) {
|
|
|
3273
3546
|
};
|
|
3274
3547
|
}
|
|
3275
3548
|
|
|
3276
|
-
var TimePickerToolbar = function (_a) {
|
|
3549
|
+
var TimePickerToolbar = function TimePickerToolbar(_a) {
|
|
3277
3550
|
var _b, _c, _d;
|
|
3278
3551
|
|
|
3279
3552
|
var date = _a.date,
|
|
@@ -3292,63 +3565,84 @@ var TimePickerToolbar = function (_a) {
|
|
|
3292
3565
|
handleMeridiemChange = _e.handleMeridiemChange;
|
|
3293
3566
|
|
|
3294
3567
|
var clockTypographyVariant = isLandscape ? 'h3' : 'h2';
|
|
3295
|
-
return
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
}, arrayIncludes(views, 'hours') && React.createElement(ToolbarButton$1, {
|
|
3301
|
-
variant: clockTypographyVariant,
|
|
3302
|
-
onClick: function () {
|
|
3303
|
-
return setOpenView(ClockType$1.HOURS);
|
|
3568
|
+
return (
|
|
3569
|
+
/*#__PURE__*/
|
|
3570
|
+
React.createElement(PickerToolbar, {
|
|
3571
|
+
isLandscape: isLandscape,
|
|
3572
|
+
className: clsx((_b = {}, _b[classes.toolbarLandscape] = isLandscape, _b[classes.toolbarAmpmLeftPadding] = ampm && !isLandscape, _b))
|
|
3304
3573
|
},
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3574
|
+
/*#__PURE__*/
|
|
3575
|
+
React.createElement("div", {
|
|
3576
|
+
className: clsx(classes.hourMinuteLabel, (_c = {}, _c[classes.hourMinuteLabelLandscape] = isLandscape, _c[classes.hourMinuteLabelReverse] = theme.direction === 'rtl', _c))
|
|
3577
|
+
}, arrayIncludes(views, 'hours') &&
|
|
3578
|
+
/*#__PURE__*/
|
|
3579
|
+
React.createElement(ToolbarButton$1, {
|
|
3580
|
+
variant: clockTypographyVariant,
|
|
3581
|
+
onClick: function onClick() {
|
|
3582
|
+
return setOpenView(ClockType$1.HOURS);
|
|
3583
|
+
},
|
|
3584
|
+
selected: openView === ClockType$1.HOURS,
|
|
3585
|
+
label: utils.formatByString(date, ampm ? utils.formats.hours12h : utils.formats.hours24h)
|
|
3586
|
+
}), arrayIncludes(views, ['hours', 'minutes']) &&
|
|
3587
|
+
/*#__PURE__*/
|
|
3588
|
+
React.createElement(ToolbarText, {
|
|
3589
|
+
label: ":",
|
|
3590
|
+
variant: clockTypographyVariant,
|
|
3591
|
+
selected: false,
|
|
3592
|
+
className: classes.separator
|
|
3593
|
+
}), arrayIncludes(views, 'minutes') &&
|
|
3594
|
+
/*#__PURE__*/
|
|
3595
|
+
React.createElement(ToolbarButton$1, {
|
|
3596
|
+
variant: clockTypographyVariant,
|
|
3597
|
+
onClick: function onClick() {
|
|
3598
|
+
return setOpenView(ClockType$1.MINUTES);
|
|
3599
|
+
},
|
|
3600
|
+
selected: openView === ClockType$1.MINUTES,
|
|
3601
|
+
label: utils.formatByString(date, utils.formats.minutes)
|
|
3602
|
+
}), arrayIncludes(views, ['minutes', 'seconds']) &&
|
|
3603
|
+
/*#__PURE__*/
|
|
3604
|
+
React.createElement(ToolbarText, {
|
|
3605
|
+
variant: "h2",
|
|
3606
|
+
label: ":",
|
|
3607
|
+
selected: false,
|
|
3608
|
+
className: classes.separator
|
|
3609
|
+
}), arrayIncludes(views, 'seconds') &&
|
|
3610
|
+
/*#__PURE__*/
|
|
3611
|
+
React.createElement(ToolbarButton$1, {
|
|
3612
|
+
variant: "h2",
|
|
3613
|
+
onClick: function onClick() {
|
|
3614
|
+
return setOpenView(ClockType$1.SECONDS);
|
|
3615
|
+
},
|
|
3616
|
+
selected: openView === ClockType$1.SECONDS,
|
|
3617
|
+
label: utils.formatByString(date, utils.formats.seconds)
|
|
3618
|
+
})), ampm &&
|
|
3619
|
+
/*#__PURE__*/
|
|
3620
|
+
React.createElement("div", {
|
|
3621
|
+
className: clsx(classes.ampmSelection, (_d = {}, _d[classes.ampmLandscape] = isLandscape, _d[classes.ampmSelectionWithSeconds] = arrayIncludes(views, 'seconds'), _d))
|
|
3328
3622
|
},
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
}
|
|
3351
|
-
|
|
3623
|
+
/*#__PURE__*/
|
|
3624
|
+
React.createElement(ToolbarButton$1, {
|
|
3625
|
+
disableRipple: true,
|
|
3626
|
+
variant: "subtitle1",
|
|
3627
|
+
selected: meridiemMode === 'am',
|
|
3628
|
+
typographyClassName: classes.ampmLabel,
|
|
3629
|
+
label: utils.getMeridiemText('am'),
|
|
3630
|
+
onClick: function onClick() {
|
|
3631
|
+
return handleMeridiemChange('am');
|
|
3632
|
+
}
|
|
3633
|
+
}),
|
|
3634
|
+
/*#__PURE__*/
|
|
3635
|
+
React.createElement(ToolbarButton$1, {
|
|
3636
|
+
disableRipple: true,
|
|
3637
|
+
variant: "subtitle1",
|
|
3638
|
+
selected: meridiemMode === 'pm',
|
|
3639
|
+
typographyClassName: classes.ampmLabel,
|
|
3640
|
+
label: utils.getMeridiemText('pm'),
|
|
3641
|
+
onClick: function onClick() {
|
|
3642
|
+
return handleMeridiemChange('pm');
|
|
3643
|
+
}
|
|
3644
|
+
})))
|
|
3645
|
+
);
|
|
3352
3646
|
};
|
|
3353
3647
|
|
|
3354
3648
|
var defaultProps$1 = tslib.__assign(tslib.__assign({}, timePickerDefaultProps), {
|
|
@@ -3359,10 +3653,10 @@ var defaultProps$1 = tslib.__assign(tslib.__assign({}, timePickerDefaultProps),
|
|
|
3359
3653
|
function useOptions$1(props) {
|
|
3360
3654
|
var utils = useUtils();
|
|
3361
3655
|
return {
|
|
3362
|
-
getDefaultFormat: function () {
|
|
3656
|
+
getDefaultFormat: function getDefaultFormat() {
|
|
3363
3657
|
return pick12hOr24hFormat(props.format, props.ampm, {
|
|
3364
|
-
'12h': utils.
|
|
3365
|
-
'24h': utils.
|
|
3658
|
+
'12h': utils.formats.hours12h,
|
|
3659
|
+
'24h': utils.formats.hours24h
|
|
3366
3660
|
});
|
|
3367
3661
|
}
|
|
3368
3662
|
};
|
|
@@ -3375,7 +3669,7 @@ var TimePicker = makePurePicker({
|
|
|
3375
3669
|
var KeyboardTimePicker = makeKeyboardPicker({
|
|
3376
3670
|
useOptions: useOptions$1,
|
|
3377
3671
|
DefaultToolbarComponent: TimePickerToolbar,
|
|
3378
|
-
getCustomProps: function (props) {
|
|
3672
|
+
getCustomProps: function getCustomProps(props) {
|
|
3379
3673
|
return {
|
|
3380
3674
|
refuse: props.ampm ? /[^\dap]+/gi : /[^\d]+/gi
|
|
3381
3675
|
};
|
|
@@ -3384,27 +3678,43 @@ var KeyboardTimePicker = makeKeyboardPicker({
|
|
|
3384
3678
|
TimePicker.defaultProps = defaultProps$1;
|
|
3385
3679
|
KeyboardTimePicker.defaultProps = defaultProps$1;
|
|
3386
3680
|
|
|
3387
|
-
var TimeIcon = function (props) {
|
|
3388
|
-
return
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
};
|
|
3406
|
-
|
|
3407
|
-
var
|
|
3681
|
+
var TimeIcon = function TimeIcon(props) {
|
|
3682
|
+
return (
|
|
3683
|
+
/*#__PURE__*/
|
|
3684
|
+
React__default.createElement(SvgIcon, tslib.__assign({}, props),
|
|
3685
|
+
/*#__PURE__*/
|
|
3686
|
+
React__default.createElement("path", {
|
|
3687
|
+
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
3688
|
+
}),
|
|
3689
|
+
/*#__PURE__*/
|
|
3690
|
+
React__default.createElement("path", {
|
|
3691
|
+
fill: "none",
|
|
3692
|
+
d: "M0 0h24v24H0z"
|
|
3693
|
+
}),
|
|
3694
|
+
/*#__PURE__*/
|
|
3695
|
+
React__default.createElement("path", {
|
|
3696
|
+
d: "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"
|
|
3697
|
+
}))
|
|
3698
|
+
);
|
|
3699
|
+
};
|
|
3700
|
+
|
|
3701
|
+
var DateRangeIcon = function DateRangeIcon(props) {
|
|
3702
|
+
return (
|
|
3703
|
+
/*#__PURE__*/
|
|
3704
|
+
React__default.createElement(SvgIcon, tslib.__assign({}, props),
|
|
3705
|
+
/*#__PURE__*/
|
|
3706
|
+
React__default.createElement("path", {
|
|
3707
|
+
d: "M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"
|
|
3708
|
+
}),
|
|
3709
|
+
/*#__PURE__*/
|
|
3710
|
+
React__default.createElement("path", {
|
|
3711
|
+
fill: "none",
|
|
3712
|
+
d: "M0 0h24v24H0z"
|
|
3713
|
+
}))
|
|
3714
|
+
);
|
|
3715
|
+
};
|
|
3716
|
+
|
|
3717
|
+
var viewToTabIndex = function viewToTabIndex(openView) {
|
|
3408
3718
|
if (openView === 'date' || openView === 'year') {
|
|
3409
3719
|
return 'date';
|
|
3410
3720
|
}
|
|
@@ -3412,7 +3722,7 @@ var viewToTabIndex = function (openView) {
|
|
|
3412
3722
|
return 'time';
|
|
3413
3723
|
};
|
|
3414
3724
|
|
|
3415
|
-
var tabIndexToView = function (tab) {
|
|
3725
|
+
var tabIndexToView = function tabIndexToView(tab) {
|
|
3416
3726
|
if (tab === 'date') {
|
|
3417
3727
|
return 'date';
|
|
3418
3728
|
}
|
|
@@ -3422,7 +3732,7 @@ var tabIndexToView = function (tab) {
|
|
|
3422
3732
|
|
|
3423
3733
|
var useStyles$f = styles$5.makeStyles(function (theme) {
|
|
3424
3734
|
// prettier-ignore
|
|
3425
|
-
var tabsBackground = theme.palette.type === 'light' ? theme.palette.primary.main : theme.palette.background
|
|
3735
|
+
var tabsBackground = theme.palette.type === 'light' ? theme.palette.primary.main : theme.palette.background["default"];
|
|
3426
3736
|
return {
|
|
3427
3737
|
tabs: {
|
|
3428
3738
|
color: theme.palette.getContrastText(tabsBackground),
|
|
@@ -3432,7 +3742,7 @@ var useStyles$f = styles$5.makeStyles(function (theme) {
|
|
|
3432
3742
|
}, {
|
|
3433
3743
|
name: 'MuiPickerDTTabs'
|
|
3434
3744
|
});
|
|
3435
|
-
var DateTimePickerTabs = function (_a) {
|
|
3745
|
+
var DateTimePickerTabs = function DateTimePickerTabs(_a) {
|
|
3436
3746
|
var view = _a.view,
|
|
3437
3747
|
onChange = _a.onChange,
|
|
3438
3748
|
dateRangeIcon = _a.dateRangeIcon,
|
|
@@ -3441,29 +3751,46 @@ var DateTimePickerTabs = function (_a) {
|
|
|
3441
3751
|
var theme = styles$5.useTheme();
|
|
3442
3752
|
var indicatorColor = theme.palette.type === 'light' ? 'secondary' : 'primary';
|
|
3443
3753
|
|
|
3444
|
-
var handleChange = function (e, value) {
|
|
3754
|
+
var handleChange = function handleChange(e, value) {
|
|
3445
3755
|
if (value !== viewToTabIndex(view)) {
|
|
3446
3756
|
onChange(tabIndexToView(value));
|
|
3447
3757
|
}
|
|
3448
3758
|
};
|
|
3449
3759
|
|
|
3450
|
-
return
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3760
|
+
return (
|
|
3761
|
+
/*#__PURE__*/
|
|
3762
|
+
React.createElement(Paper, null,
|
|
3763
|
+
/*#__PURE__*/
|
|
3764
|
+
React.createElement(Tabs, {
|
|
3765
|
+
variant: "fullWidth",
|
|
3766
|
+
value: viewToTabIndex(view),
|
|
3767
|
+
onChange: handleChange,
|
|
3768
|
+
className: classes.tabs,
|
|
3769
|
+
indicatorColor: indicatorColor
|
|
3770
|
+
},
|
|
3771
|
+
/*#__PURE__*/
|
|
3772
|
+
React.createElement(Tab, {
|
|
3773
|
+
value: "date",
|
|
3774
|
+
icon:
|
|
3775
|
+
/*#__PURE__*/
|
|
3776
|
+
React.createElement(React.Fragment, null, dateRangeIcon)
|
|
3777
|
+
}),
|
|
3778
|
+
/*#__PURE__*/
|
|
3779
|
+
React.createElement(Tab, {
|
|
3780
|
+
value: "time",
|
|
3781
|
+
icon:
|
|
3782
|
+
/*#__PURE__*/
|
|
3783
|
+
React.createElement(React.Fragment, null, timeIcon)
|
|
3784
|
+
})))
|
|
3785
|
+
);
|
|
3463
3786
|
};
|
|
3464
3787
|
DateTimePickerTabs.defaultProps = {
|
|
3465
|
-
dateRangeIcon:
|
|
3466
|
-
|
|
3788
|
+
dateRangeIcon:
|
|
3789
|
+
/*#__PURE__*/
|
|
3790
|
+
React.createElement(DateRangeIcon, null),
|
|
3791
|
+
timeIcon:
|
|
3792
|
+
/*#__PURE__*/
|
|
3793
|
+
React.createElement(TimeIcon, null)
|
|
3467
3794
|
};
|
|
3468
3795
|
|
|
3469
3796
|
var useStyles$g = styles$5.makeStyles(function (_) {
|
|
@@ -3481,7 +3808,7 @@ var useStyles$g = styles$5.makeStyles(function (_) {
|
|
|
3481
3808
|
}, {
|
|
3482
3809
|
name: 'MuiPickerDTToolbar'
|
|
3483
3810
|
});
|
|
3484
|
-
var DateTimePickerToolbar = function (_a) {
|
|
3811
|
+
var DateTimePickerToolbar = function DateTimePickerToolbar(_a) {
|
|
3485
3812
|
var date = _a.date,
|
|
3486
3813
|
openView = _a.openView,
|
|
3487
3814
|
setOpenView = _a.setOpenView,
|
|
@@ -3500,84 +3827,117 @@ var DateTimePickerToolbar = function (_a) {
|
|
|
3500
3827
|
|
|
3501
3828
|
var theme = styles$5.useTheme();
|
|
3502
3829
|
var rtl = theme.direction === 'rtl';
|
|
3503
|
-
return
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
}, React.createElement(core.Grid, {
|
|
3511
|
-
item: true,
|
|
3512
|
-
container: true,
|
|
3513
|
-
xs: 5,
|
|
3514
|
-
justify: "flex-start",
|
|
3515
|
-
direction: "column"
|
|
3516
|
-
}, React.createElement("div", null, React.createElement(ToolbarButton$1, {
|
|
3517
|
-
variant: "subtitle1",
|
|
3518
|
-
onClick: function () {
|
|
3519
|
-
return setOpenView('year');
|
|
3830
|
+
return (
|
|
3831
|
+
/*#__PURE__*/
|
|
3832
|
+
React.createElement(React.Fragment, null,
|
|
3833
|
+
/*#__PURE__*/
|
|
3834
|
+
React.createElement(PickerToolbar, {
|
|
3835
|
+
isLandscape: false,
|
|
3836
|
+
className: classes.toolbar
|
|
3520
3837
|
},
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
return setOpenView('date');
|
|
3838
|
+
/*#__PURE__*/
|
|
3839
|
+
React.createElement(core.Grid, {
|
|
3840
|
+
container: true,
|
|
3841
|
+
justify: "center",
|
|
3842
|
+
wrap: "nowrap"
|
|
3527
3843
|
},
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
alignItems: "flex-end",
|
|
3536
|
-
direction: rtl ? 'row-reverse' : 'row'
|
|
3537
|
-
}, React.createElement(ToolbarButton$1, {
|
|
3538
|
-
variant: "h3",
|
|
3539
|
-
onClick: function () {
|
|
3540
|
-
return setOpenView('hours');
|
|
3844
|
+
/*#__PURE__*/
|
|
3845
|
+
React.createElement(core.Grid, {
|
|
3846
|
+
item: true,
|
|
3847
|
+
container: true,
|
|
3848
|
+
xs: 5,
|
|
3849
|
+
justify: "flex-start",
|
|
3850
|
+
direction: "column"
|
|
3541
3851
|
},
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3852
|
+
/*#__PURE__*/
|
|
3853
|
+
React.createElement("div", null,
|
|
3854
|
+
/*#__PURE__*/
|
|
3855
|
+
React.createElement(ToolbarButton$1, {
|
|
3856
|
+
variant: "subtitle1",
|
|
3857
|
+
onClick: function onClick() {
|
|
3858
|
+
return setOpenView('year');
|
|
3859
|
+
},
|
|
3860
|
+
selected: openView === 'year',
|
|
3861
|
+
label: utils.formatByString(date, utils.formats.year)
|
|
3862
|
+
})),
|
|
3863
|
+
/*#__PURE__*/
|
|
3864
|
+
React.createElement("div", null,
|
|
3865
|
+
/*#__PURE__*/
|
|
3866
|
+
React.createElement(ToolbarButton$1, {
|
|
3867
|
+
variant: "h4",
|
|
3868
|
+
onClick: function onClick() {
|
|
3869
|
+
return setOpenView('date');
|
|
3870
|
+
},
|
|
3871
|
+
selected: openView === 'date',
|
|
3872
|
+
label: utils.formatByString(date, utils.formats.shortDate)
|
|
3873
|
+
}))),
|
|
3874
|
+
/*#__PURE__*/
|
|
3875
|
+
React.createElement(core.Grid, {
|
|
3876
|
+
item: true,
|
|
3877
|
+
container: true,
|
|
3878
|
+
xs: 6,
|
|
3879
|
+
justify: "center",
|
|
3880
|
+
alignItems: "flex-end",
|
|
3881
|
+
direction: rtl ? 'row-reverse' : 'row'
|
|
3552
3882
|
},
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
}
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3883
|
+
/*#__PURE__*/
|
|
3884
|
+
React.createElement(ToolbarButton$1, {
|
|
3885
|
+
variant: "h3",
|
|
3886
|
+
onClick: function onClick() {
|
|
3887
|
+
return setOpenView('hours');
|
|
3888
|
+
},
|
|
3889
|
+
selected: openView === 'hours',
|
|
3890
|
+
label: utils.formatByString(date, ampm ? utils.formats.hours12h : utils.formats.hours24h)
|
|
3891
|
+
}),
|
|
3892
|
+
/*#__PURE__*/
|
|
3893
|
+
React.createElement(ToolbarText, {
|
|
3894
|
+
variant: "h3",
|
|
3895
|
+
label: ":",
|
|
3896
|
+
className: classes.separator
|
|
3897
|
+
}),
|
|
3898
|
+
/*#__PURE__*/
|
|
3899
|
+
React.createElement(ToolbarButton$1, {
|
|
3900
|
+
variant: "h3",
|
|
3901
|
+
onClick: function onClick() {
|
|
3902
|
+
return setOpenView('minutes');
|
|
3903
|
+
},
|
|
3904
|
+
selected: openView === 'minutes',
|
|
3905
|
+
label: utils.formatByString(date, utils.formats.minutes)
|
|
3906
|
+
})), ampm &&
|
|
3907
|
+
/*#__PURE__*/
|
|
3908
|
+
React.createElement(core.Grid, {
|
|
3909
|
+
item: true,
|
|
3910
|
+
container: true,
|
|
3911
|
+
xs: 1,
|
|
3912
|
+
direction: "column",
|
|
3913
|
+
justify: "flex-end"
|
|
3914
|
+
},
|
|
3915
|
+
/*#__PURE__*/
|
|
3916
|
+
React.createElement(ToolbarButton$1, {
|
|
3917
|
+
variant: "subtitle1",
|
|
3918
|
+
selected: meridiemMode === 'am',
|
|
3919
|
+
label: utils.getMeridiemText('am'),
|
|
3920
|
+
onClick: function onClick() {
|
|
3921
|
+
return handleMeridiemChange('am');
|
|
3922
|
+
}
|
|
3923
|
+
}),
|
|
3924
|
+
/*#__PURE__*/
|
|
3925
|
+
React.createElement(ToolbarButton$1, {
|
|
3926
|
+
variant: "subtitle1",
|
|
3927
|
+
selected: meridiemMode === 'pm',
|
|
3928
|
+
label: utils.getMeridiemText('pm'),
|
|
3929
|
+
onClick: function onClick() {
|
|
3930
|
+
return handleMeridiemChange('pm');
|
|
3931
|
+
}
|
|
3932
|
+
})))), showTabs &&
|
|
3933
|
+
/*#__PURE__*/
|
|
3934
|
+
React.createElement(DateTimePickerTabs, {
|
|
3935
|
+
dateRangeIcon: dateRangeIcon,
|
|
3936
|
+
timeIcon: timeIcon,
|
|
3937
|
+
view: openView,
|
|
3938
|
+
onChange: setOpenView
|
|
3939
|
+
}))
|
|
3940
|
+
);
|
|
3581
3941
|
};
|
|
3582
3942
|
|
|
3583
3943
|
var defaultProps$2 = tslib.__assign(tslib.__assign({}, dateTimePickerDefaultProps), {
|
|
@@ -3597,10 +3957,10 @@ function useOptions$2(props) {
|
|
|
3597
3957
|
}
|
|
3598
3958
|
|
|
3599
3959
|
return {
|
|
3600
|
-
getDefaultFormat: function () {
|
|
3960
|
+
getDefaultFormat: function getDefaultFormat() {
|
|
3601
3961
|
return pick12hOr24hFormat(props.format, props.ampm, {
|
|
3602
|
-
'12h': utils.
|
|
3603
|
-
'24h': utils.
|
|
3962
|
+
'12h': utils.formats.fullDateTime12h,
|
|
3963
|
+
'24h': utils.formats.fullDateTime24h
|
|
3604
3964
|
});
|
|
3605
3965
|
}
|
|
3606
3966
|
};
|
|
@@ -3613,7 +3973,7 @@ var DateTimePicker = makePurePicker({
|
|
|
3613
3973
|
var KeyboardDateTimePicker = makeKeyboardPicker({
|
|
3614
3974
|
useOptions: useOptions$2,
|
|
3615
3975
|
DefaultToolbarComponent: DateTimePickerToolbar,
|
|
3616
|
-
getCustomProps: function (props) {
|
|
3976
|
+
getCustomProps: function getCustomProps(props) {
|
|
3617
3977
|
return {
|
|
3618
3978
|
refuse: props.ampm ? /[^\dap]+/gi : /[^\d]+/gi
|
|
3619
3979
|
};
|