@docsvision/material-ui-pickers 3.2.0-beta.8 → 3.2.1-beta.1
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/DatePicker.d.ts +2 -2
- package/DatePicker/DatePicker.js +1 -1
- package/DatePicker/DatePickerToolbar.js +1 -1
- package/DateTimePicker/DateTimePicker.js +1 -1
- package/Picker/Picker.js +1 -1
- package/Picker/WrappedKeyboardPicker.js +4 -2
- package/Picker/WrappedPurePicker.js +4 -2
- package/README.md +1 -0
- package/Rifm/Rifm.d.ts +17 -0
- package/Rifm/Rifm.js +174 -0
- package/TimePicker/TimePicker.js +1 -1
- package/TimePicker/TimePickerToolbar.js +1 -1
- package/_helpers/text-field-helper.d.ts +2 -2
- package/_helpers/text-field-helper.js +62 -6
- package/_shared/KeyboardDateInput.js +27 -139
- package/_shared/ModalDialog.d.ts +2 -2
- package/_shared/ModalDialog.js +5 -3
- package/_shared/PickerToolbar.d.ts +1 -1
- package/_shared/PickerToolbar.js +7 -5
- package/_shared/PureDateInput.js +5 -3
- package/_shared/ToolbarButton.d.ts +2 -2
- package/_shared/ToolbarButton.js +4 -2
- package/_shared/ToolbarText.js +9 -7
- package/_shared/hooks/useKeyboardPickerState.js +5 -3
- package/_shared/hooks/useOpenState.js +1 -1
- package/_shared/hooks/usePickerState.js +9 -9
- package/constants/prop-types.js +2 -2
- package/dist/material-ui-pickers.esm.js +3626 -0
- package/dist/material-ui-pickers.esm.js.map +1 -0
- package/dist/material-ui-pickers.js +3651 -0
- package/dist/material-ui-pickers.js.map +1 -0
- package/dist/material-ui-pickers.umd.js +34161 -0
- package/dist/material-ui-pickers.umd.min.js +1 -0
- package/package.json +3 -4
- package/typings/BasePicker.d.ts +1 -1
- package/typings/overrides.d.ts +2 -2
- package/views/Calendar/Calendar.js +3 -2
- package/views/Calendar/CalendarHeader.d.ts +1 -1
- package/views/Calendar/Day.d.ts +1 -1
- package/views/Calendar/Day.js +5 -3
- package/views/Calendar/DayWrapper.js +4 -2
- package/views/Calendar/SlideTransition.d.ts +1 -1
- package/views/Clock/Clock.d.ts +1 -1
- package/views/Clock/ClockNumber.d.ts +1 -1
- package/views/Clock/ClockNumber.js +1 -1
- package/views/Clock/ClockPointer.d.ts +1 -1
- package/views/Month/Month.d.ts +1 -1
- package/views/Month/Month.js +5 -3
- package/views/Year/Year.d.ts +1 -1
- package/views/Year/Year.js +5 -3
- package/wrappers/InlineWrapper.d.ts +2 -0
- package/wrappers/InlineWrapper.js +5 -3
- package/wrappers/ModalWrapper.js +4 -2
- package/wrappers/Wrapper.js +4 -2
|
@@ -15,8 +15,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
@@ -33,162 +35,48 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
35
|
var React = __importStar(require("react"));
|
|
34
36
|
var InputAdornment_1 = __importDefault(require("@material-ui/core/InputAdornment"));
|
|
35
37
|
var TextField_1 = __importDefault(require("@material-ui/core/TextField"));
|
|
36
|
-
var rifm_1 = require("rifm");
|
|
37
38
|
var core_1 = require("@material-ui/core");
|
|
38
39
|
var KeyboardIcon_1 = require("./icons/KeyboardIcon");
|
|
39
40
|
var text_field_helper_1 = require("../_helpers/text-field-helper");
|
|
40
41
|
var react_1 = require("react");
|
|
42
|
+
var Rifm_1 = require("../Rifm/Rifm");
|
|
41
43
|
var KeyboardDateInput = function (_a) {
|
|
42
|
-
var inputValue = _a.inputValue, _b = _a.showErrorOnBlur, showErrorOnBlur = _b === void 0 ? false : _b, inputVariant = _a.inputVariant, validationError = _a.validationError, KeyboardButtonProps = _a.KeyboardButtonProps, InputAdornmentProps = _a.InputAdornmentProps, onClick = _a.onClick, onChange = _a.onChange, onBlur = _a.onBlur, InputProps = _a.InputProps, mask = _a.mask, _c = _a.maskChar, maskChar = _c === void 0 ? '_' : _c, _d = _a.refuse, refuse = _d === void 0 ? /[^\
|
|
44
|
+
var inputValue = _a.inputValue, _b = _a.showErrorOnBlur, showErrorOnBlur = _b === void 0 ? false : _b, inputVariant = _a.inputVariant, validationError = _a.validationError, KeyboardButtonProps = _a.KeyboardButtonProps, InputAdornmentProps = _a.InputAdornmentProps, onClick = _a.onClick, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, InputProps = _a.InputProps, mask = _a.mask, _c = _a.maskChar, maskChar = _c === void 0 ? '_' : _c, _d = _a.refuse, refuse = _d === void 0 ? /[^\d_]+/gi : _d, format = _a.format, keyboardIcon = _a.keyboardIcon, disabled = _a.disabled, rifmFormatter = _a.rifmFormatter, _e = _a.TextFieldComponent, TextFieldComponent = _e === void 0 ? TextField_1.default : _e, other = __rest(_a, ["inputValue", "showErrorOnBlur", "inputVariant", "validationError", "KeyboardButtonProps", "InputAdornmentProps", "onClick", "onChange", "onBlur", "onFocus", "InputProps", "mask", "maskChar", "refuse", "format", "keyboardIcon", "disabled", "rifmFormatter", "TextFieldComponent"]);
|
|
43
45
|
var inputMask = mask || text_field_helper_1.makeMaskFromFormat(format, maskChar);
|
|
46
|
+
var letterPosition = format.indexOf('a');
|
|
44
47
|
// prettier-ignore
|
|
45
|
-
var formatter = React.useCallback(text_field_helper_1.maskedDateFormatter(inputMask, maskChar
|
|
48
|
+
var formatter = React.useCallback(text_field_helper_1.maskedDateFormatter(inputMask, maskChar), [mask, maskChar]);
|
|
46
49
|
var position = InputAdornmentProps && InputAdornmentProps.position ? InputAdornmentProps.position : 'end';
|
|
47
50
|
var handleChange = function (text) {
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
if (previousValue == null) {
|
|
51
|
-
resultString = text;
|
|
52
|
-
}
|
|
53
|
-
else if (previousValue && currentValue) {
|
|
54
|
-
for (var i = 0; i < previousValue.length; i++) {
|
|
55
|
-
if (previousValue[i] != currentValue[i]) {
|
|
56
|
-
var digit = parseDigits(currentValue[i]);
|
|
57
|
-
if (digit != null) {
|
|
58
|
-
currentValue[i] = digit[0] + '_'.repeat(previousValue[i].length - digit[0].length);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
currentValueStr += currentValue[i];
|
|
62
|
-
}
|
|
63
|
-
var k = 0;
|
|
64
|
-
for (var i = 0; i < inputMask.length; i++) {
|
|
65
|
-
if (inputMask[i] == '_') {
|
|
66
|
-
resultString += currentValueStr[k];
|
|
67
|
-
k += 1;
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
resultString += inputMask[i];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var input = refTextInput.querySelector('.MuiInput-input');
|
|
75
|
-
onChange(resultString);
|
|
76
|
-
if (resultString[currentPos] != '_') {
|
|
77
|
-
setTimeout(function () {
|
|
78
|
-
currentPos += 1;
|
|
79
|
-
setInputSelect(input, currentPos);
|
|
80
|
-
}, 100);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var parseDigits = function (text) {
|
|
84
|
-
return text.match(/\d+/g);
|
|
85
|
-
};
|
|
86
|
-
var parseDigitsAndMask = function (text) {
|
|
87
|
-
return text.match(/\d+\_*|\d*\_+/g);
|
|
88
|
-
};
|
|
89
|
-
var changeInputStringValue = function (e) {
|
|
90
|
-
currentValue = parseDigitsAndMask(e.target.value);
|
|
91
|
-
currentPos = e.target.selectionStart;
|
|
92
|
-
};
|
|
93
|
-
var handleClick = function (e) {
|
|
94
|
-
clickFlag = true;
|
|
95
|
-
setInputSelect(e.target);
|
|
96
|
-
};
|
|
97
|
-
var handleKeyUp = function (e) {
|
|
98
|
-
var startPos = 0;
|
|
99
|
-
var clickPos = e.target.selectionStart;
|
|
100
|
-
if (e.keyCode == 37) {
|
|
101
|
-
var countSeparator = 0;
|
|
102
|
-
for (var i = clickPos; i > 0; i--) {
|
|
103
|
-
if (e.target.value[i].search(/[0-9]|[_]/) == -1) {
|
|
104
|
-
startPos = i;
|
|
105
|
-
countSeparator += 1;
|
|
106
|
-
}
|
|
107
|
-
if (countSeparator == 2) {
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (countSeparator == 1) {
|
|
112
|
-
startPos = 0;
|
|
113
|
-
}
|
|
114
|
-
clickFlag = true;
|
|
115
|
-
setInputSelect(e.target, startPos);
|
|
116
|
-
}
|
|
117
|
-
else if (e.keyCode == 39) {
|
|
118
|
-
for (var i = clickPos; i < e.target.value.length; i++) {
|
|
119
|
-
if (e.target.value[i].search(/[0-9]|[_]/) == -1) {
|
|
120
|
-
startPos = i + 1;
|
|
121
|
-
clickFlag = true;
|
|
122
|
-
setInputSelect(e.target, startPos);
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
51
|
+
var finalString = text === '' || text === inputMask ? null : text;
|
|
52
|
+
onChange(finalString);
|
|
127
53
|
};
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
if (clickPos == undefined) {
|
|
131
|
-
clickPos = element.selectionStart - 1;
|
|
132
|
-
}
|
|
133
|
-
else if (clickPos > element.value.length) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
var result = '';
|
|
137
|
-
var selectStart = 0;
|
|
138
|
-
for (var i = clickPos; 0 <= i; i--) {
|
|
139
|
-
if (element.value[i].search(/[0-9]|[_]/) == 0) {
|
|
140
|
-
result = element.value[i] + result;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
selectStart = i + 1;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
for (var i = clickPos + 1; i < element.value.length; i++) {
|
|
148
|
-
if (element.value[i].search(/[0-9]|[_]/) == 0) {
|
|
149
|
-
result = result + element.value[i];
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
var replaceStr = '';
|
|
156
|
-
for (var i = 0; i < result.length; i++) {
|
|
157
|
-
replaceStr += '_';
|
|
158
|
-
}
|
|
159
|
-
if (clickFlag) {
|
|
160
|
-
element.value = inputValue;
|
|
161
|
-
}
|
|
162
|
-
element.value =
|
|
163
|
-
element.value.substr(0, selectStart) +
|
|
164
|
-
replaceStr +
|
|
165
|
-
element.value.substr(selectStart + replaceStr.length, element.value.length);
|
|
166
|
-
if (element.setSelectionRange) {
|
|
167
|
-
element.focus();
|
|
168
|
-
element.setSelectionRange(selectStart, selectStart + result.length);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
54
|
+
var replace = function (text) {
|
|
55
|
+
return text;
|
|
171
56
|
};
|
|
172
|
-
var previousValue = parseDigitsAndMask(inputValue);
|
|
173
|
-
var currentValue = parseDigitsAndMask(inputValue);
|
|
174
|
-
var refTextInput;
|
|
175
|
-
var currentPos = 0;
|
|
176
|
-
var clickFlag = false;
|
|
177
57
|
var _f = react_1.useState(showErrorOnBlur ? true : false), showErrorFlag = _f[0], handleBlur = _f[1];
|
|
178
|
-
return (React.createElement(
|
|
179
|
-
var onChange = _a.onChange, value = _a.value;
|
|
58
|
+
return (React.createElement(Rifm_1.Rifm, { value: inputValue, onChange: handleChange, format: rifmFormatter || formatter, replace: replace, mask: true, maskChar: maskChar, letterPosition: letterPosition }, function (_a) {
|
|
180
59
|
var _b;
|
|
181
|
-
|
|
60
|
+
var onChange = _a.onChange, value = _a.value;
|
|
61
|
+
return (React.createElement(TextFieldComponent, __assign({ disabled: disabled, error: Boolean(validationError) && !showErrorFlag, helperText: !showErrorFlag && validationError }, other, { value: value, onChange: onChange,
|
|
62
|
+
// onInput={changeInputStringValue}
|
|
63
|
+
// onKeyUp={handleKeyUp}
|
|
64
|
+
// onMouseUp={handleClick}
|
|
65
|
+
onBlur: function () {
|
|
66
|
+
if (onBlur) {
|
|
67
|
+
onBlur();
|
|
68
|
+
}
|
|
182
69
|
if (showErrorOnBlur) {
|
|
183
|
-
if (onBlur)
|
|
184
|
-
onBlur();
|
|
185
70
|
handleBlur(false);
|
|
186
71
|
}
|
|
187
|
-
}, onFocus: function () {
|
|
72
|
+
}, onFocus: function (ev) {
|
|
73
|
+
if (onFocus) {
|
|
74
|
+
onFocus(ev);
|
|
75
|
+
}
|
|
188
76
|
if (showErrorOnBlur) {
|
|
189
77
|
handleBlur(true);
|
|
190
78
|
}
|
|
191
|
-
}, variant: inputVariant, InputProps: __assign({}, InputProps, (_b = {}, _b[position + "Adornment"] = (React.createElement(InputAdornment_1.default, __assign({ position: position }, InputAdornmentProps),
|
|
79
|
+
}, variant: inputVariant, InputProps: __assign(__assign({}, InputProps), (_b = {}, _b[position + "Adornment"] = (React.createElement(InputAdornment_1.default, __assign({ position: position }, InputAdornmentProps),
|
|
192
80
|
React.createElement(core_1.IconButton, __assign({ disabled: disabled }, KeyboardButtonProps, { onClick: onClick }), keyboardIcon))), _b)) })));
|
|
193
81
|
}));
|
|
194
82
|
};
|
package/_shared/ModalDialog.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export interface ModalDialogProps extends DialogProps {
|
|
|
16
16
|
wider?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare const ModalDialog: React.SFC<ModalDialogProps & WithStyles<typeof styles>>;
|
|
19
|
-
export declare const styles: Record<"dialog" | "dialogRoot" | "dialogRootWider" | "withAdditionalAction", import("@material-ui/
|
|
19
|
+
export declare const styles: Record<"dialog" | "dialogRoot" | "dialogRootWider" | "withAdditionalAction", import("@material-ui/styles").CSSProperties | (() => import("@material-ui/styles").CSSProperties)>;
|
|
20
20
|
declare const _default: React.ComponentType<Pick<React.PropsWithChildren<ModalDialogProps & {
|
|
21
21
|
classes: Record<"dialog" | "dialogRoot" | "dialogRootWider" | "withAdditionalAction", string>;
|
|
22
|
-
}>, "children" | "ref" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "innerRef" | "maxWidth" | "transitionDuration" | "scroll" | "open" | "fullWidth" | "
|
|
22
|
+
}>, "children" | "ref" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "innerRef" | "maxWidth" | "transitionDuration" | "scroll" | "open" | "fullWidth" | "onEnter" | "onEntering" | "onEntered" | "onExit" | "onExiting" | "onExited" | "onClose" | "container" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "disableAutoFocus" | "disableBackdropClick" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "manager" | "onBackdropClick" | "onEscapeKeyDown" | "onRendered" | "onAccept" | "onDismiss" | "onClear" | "onSetToday" | "okLabel" | "cancelLabel" | "clearLabel" | "todayLabel" | "clearable" | "showTodayButton" | "showTabs" | "wider" | "fullScreen" | "PaperComponent" | "PaperProps" | "TransitionComponent" | "TransitionProps"> & import("@material-ui/core/styles").StyledComponentProps<"dialog" | "dialogRoot" | "dialogRootWider" | "withAdditionalAction">>;
|
|
23
23
|
export default _default;
|
package/_shared/ModalDialog.js
CHANGED
|
@@ -15,8 +15,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
@@ -39,8 +41,8 @@ var Dialog_1 = __importDefault(require("@material-ui/core/Dialog"));
|
|
|
39
41
|
var dimensions_1 = require("../constants/dimensions");
|
|
40
42
|
var styles_1 = require("@material-ui/core/styles");
|
|
41
43
|
exports.ModalDialog = function (_a) {
|
|
42
|
-
var children = _a.children, classes = _a.classes, onAccept = _a.onAccept, onDismiss = _a.onDismiss, onClear = _a.onClear, onSetToday = _a.onSetToday, okLabel = _a.okLabel, cancelLabel = _a.cancelLabel, clearLabel = _a.clearLabel, todayLabel = _a.todayLabel, clearable = _a.clearable, showTodayButton = _a.showTodayButton, showTabs = _a.showTabs, wider = _a.wider, other = __rest(_a, ["children", "classes", "onAccept", "onDismiss", "onClear", "onSetToday", "okLabel", "cancelLabel", "clearLabel", "todayLabel", "clearable", "showTodayButton", "showTabs", "wider"]);
|
|
43
44
|
var _b, _c;
|
|
45
|
+
var children = _a.children, classes = _a.classes, onAccept = _a.onAccept, onDismiss = _a.onDismiss, onClear = _a.onClear, onSetToday = _a.onSetToday, okLabel = _a.okLabel, cancelLabel = _a.cancelLabel, clearLabel = _a.clearLabel, todayLabel = _a.todayLabel, clearable = _a.clearable, showTodayButton = _a.showTodayButton, showTabs = _a.showTabs, wider = _a.wider, other = __rest(_a, ["children", "classes", "onAccept", "onDismiss", "onClear", "onSetToday", "okLabel", "cancelLabel", "clearLabel", "todayLabel", "clearable", "showTodayButton", "showTabs", "wider"]);
|
|
44
46
|
return (React.createElement(Dialog_1.default, __assign({ role: "dialog", onClose: onDismiss, classes: {
|
|
45
47
|
paper: clsx_1.default(classes.dialogRoot, (_b = {},
|
|
46
48
|
_b[classes.dialogRootWider] = wider,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ToolbarProps } from '@material-ui/core/Toolbar';
|
|
3
3
|
import { ExtendMui } from '../typings/extendMui';
|
|
4
|
-
export declare const useStyles: any
|
|
4
|
+
export declare const useStyles: (props?: any) => Record<"toolbar" | "toolbarLandscape", string>;
|
|
5
5
|
interface PickerToolbarProps extends ExtendMui<ToolbarProps> {
|
|
6
6
|
isLandscape: boolean;
|
|
7
7
|
}
|
package/_shared/PickerToolbar.js
CHANGED
|
@@ -15,8 +15,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
@@ -53,9 +55,9 @@ exports.useStyles = styles_1.makeStyles(function (theme) { return ({
|
|
|
53
55
|
},
|
|
54
56
|
}); }, { name: 'MuiPickersToolbar' });
|
|
55
57
|
var PickerToolbar = function (_a) {
|
|
56
|
-
var
|
|
57
|
-
var _c;
|
|
58
|
+
var _b;
|
|
59
|
+
var children = _a.children, isLandscape = _a.isLandscape, _c = _a.className, className = _c === void 0 ? null : _c, other = __rest(_a, ["children", "isLandscape", "className"]);
|
|
58
60
|
var classes = exports.useStyles();
|
|
59
|
-
return (React.createElement(Toolbar_1.default, __assign({ className: clsx_1.default(classes.toolbar, (
|
|
61
|
+
return (React.createElement(Toolbar_1.default, __assign({ className: clsx_1.default(classes.toolbar, (_b = {}, _b[classes.toolbarLandscape] = isLandscape, _b), className) }, other), children));
|
|
60
62
|
};
|
|
61
63
|
exports.default = PickerToolbar;
|
package/_shared/PureDateInput.js
CHANGED
|
@@ -15,8 +15,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
@@ -34,7 +36,7 @@ var React = __importStar(require("react"));
|
|
|
34
36
|
var TextField_1 = __importDefault(require("@material-ui/core/TextField"));
|
|
35
37
|
exports.PureDateInput = function (_a) {
|
|
36
38
|
var inputValue = _a.inputValue, inputVariant = _a.inputVariant, validationError = _a.validationError, InputProps = _a.InputProps, _b = _a.TextFieldComponent, TextFieldComponent = _b === void 0 ? TextField_1.default : _b, other = __rest(_a, ["inputValue", "inputVariant", "validationError", "InputProps", "TextFieldComponent"]);
|
|
37
|
-
var PureDateInputProps = React.useMemo(function () { return (__assign({}, InputProps, { readOnly: true })); }, [InputProps]);
|
|
39
|
+
var PureDateInputProps = React.useMemo(function () { return (__assign(__assign({}, InputProps), { readOnly: true })); }, [InputProps]);
|
|
38
40
|
return (React.createElement(TextFieldComponent, __assign({ error: Boolean(validationError), helperText: validationError }, other, {
|
|
39
41
|
// do not overridable
|
|
40
42
|
value: inputValue, variant: inputVariant, InputProps: PureDateInputProps })));
|
|
@@ -10,6 +10,6 @@ export interface ToolbarButtonProps extends ExtendMui<ButtonProps, 'variant'>, W
|
|
|
10
10
|
align?: TypographyProps['align'];
|
|
11
11
|
typographyClassName?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const styles: Record<"toolbarBtn", import("@material-ui/
|
|
14
|
-
declare const _default: React.ComponentType<Pick<React.PropsWithChildren<ToolbarButtonProps>, "children" | "ref" | "form" | "label" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "variant" | "innerRef" | "size" | "disabled" | "selected" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "
|
|
13
|
+
export declare const styles: Record<"toolbarBtn", import("@material-ui/styles").CSSProperties | (() => import("@material-ui/styles").CSSProperties)>;
|
|
14
|
+
declare const _default: React.ComponentType<Pick<React.PropsWithChildren<ToolbarButtonProps>, "children" | "ref" | "form" | "label" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "variant" | "innerRef" | "name" | "size" | "disabled" | "selected" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "type" | "value" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "disableFocusRipple" | "fullWidth" | "href" | "typographyClassName"> & import("@material-ui/core/styles").StyledComponentProps<"toolbarBtn">>;
|
|
15
15
|
export default _default;
|
package/_shared/ToolbarButton.js
CHANGED
|
@@ -15,8 +15,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
var __importStar = (this && this.__importStar) || function (mod) {
|
package/_shared/ToolbarText.js
CHANGED
|
@@ -15,8 +15,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
@@ -48,11 +50,11 @@ exports.useStyles = styles_1.makeStyles(function (theme) {
|
|
|
48
50
|
};
|
|
49
51
|
}, { name: 'MuiPickersToolbarText' });
|
|
50
52
|
var ToolbarText = function (_a) {
|
|
51
|
-
var
|
|
52
|
-
var _c;
|
|
53
|
+
var _b;
|
|
54
|
+
var selected = _a.selected, label = _a.label, _c = _a.className, className = _c === void 0 ? null : _c, other = __rest(_a, ["selected", "label", "className"]);
|
|
53
55
|
var classes = exports.useStyles();
|
|
54
|
-
return (React.createElement(Typography_1.default, __assign({ children: label, className: clsx_1.default(classes.toolbarTxt, className, (
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
return (React.createElement(Typography_1.default, __assign({ children: label, className: clsx_1.default(classes.toolbarTxt, className, (_b = {},
|
|
57
|
+
_b[classes.toolbarBtnSelected] = selected,
|
|
58
|
+
_b)) }, other)));
|
|
57
59
|
};
|
|
58
60
|
exports.default = ToolbarText;
|
|
@@ -35,10 +35,12 @@ function useKeyboardPickerState(props, options) {
|
|
|
35
35
|
}
|
|
36
36
|
}, [displayDate, setInnerInputValue, utils, value]);
|
|
37
37
|
var handleKeyboardChange = react_1.useCallback(function (date) {
|
|
38
|
-
|
|
38
|
+
var formattedValue = date === null ? null : utils.format(date, format);
|
|
39
|
+
setInnerInputValue(formattedValue || '');
|
|
40
|
+
onChange(date, formattedValue);
|
|
39
41
|
}, [format, onChange, utils]);
|
|
40
|
-
var _c = usePickerState_1.usePickerState(__assign({}, props, { value: dateValue, onChange: handleKeyboardChange }), options), innerInputProps = _c.inputProps, wrapperProps = _c.wrapperProps, pickerProps = _c.pickerProps;
|
|
41
|
-
var inputProps = react_1.useMemo(function () { return (__assign({}, innerInputProps, { format: wrapperProps.format, inputValue: inputValue || innerInputValue, onChange: function (value) {
|
|
42
|
+
var _c = usePickerState_1.usePickerState(__assign(__assign({}, props), { value: dateValue, onChange: handleKeyboardChange }), options), innerInputProps = _c.inputProps, wrapperProps = _c.wrapperProps, pickerProps = _c.pickerProps;
|
|
43
|
+
var inputProps = react_1.useMemo(function () { return (__assign(__assign({}, innerInputProps), { format: wrapperProps.format, inputValue: inputValue || innerInputValue, onChange: function (value) {
|
|
42
44
|
setInnerInputValue(value || '');
|
|
43
45
|
var date = value === null ? null : utils.parse(value, wrapperProps.format);
|
|
44
46
|
onChange(date, value);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var react_1 = require("react");
|
|
4
4
|
function useOpenState(_a) {
|
|
5
|
-
var open = _a.open, onOpen = _a.onOpen, onClose = _a.onClose;
|
|
6
5
|
var _b;
|
|
6
|
+
var open = _a.open, onOpen = _a.onOpen, onClose = _a.onClose;
|
|
7
7
|
var setIsOpenState = null;
|
|
8
8
|
if (open === undefined || open === null) {
|
|
9
9
|
// The component is uncontrolled, so we need to give it its own state.
|
|
@@ -50,31 +50,31 @@ function usePickerState(props, options) {
|
|
|
50
50
|
onChange: function (newDate, isFinish) {
|
|
51
51
|
if (isFinish === void 0) { isFinish = true; }
|
|
52
52
|
setPickerDate(newDate);
|
|
53
|
-
if (variant === 'inline' || variant === 'static') {
|
|
54
|
-
onChange(newDate);
|
|
55
|
-
}
|
|
56
53
|
if (isFinish && autoOk) {
|
|
57
54
|
acceptDate(newDate);
|
|
58
55
|
}
|
|
56
|
+
else if (variant === 'inline' || variant === 'static') {
|
|
57
|
+
onChange(newDate);
|
|
58
|
+
}
|
|
59
59
|
},
|
|
60
60
|
onSetToday: function () {
|
|
61
61
|
var newDate = utils.date();
|
|
62
62
|
setPickerDate(newDate);
|
|
63
|
-
if (variant === 'inline' || variant === 'static') {
|
|
64
|
-
onChange(newDate);
|
|
65
|
-
}
|
|
66
63
|
if (autoOk) {
|
|
67
64
|
acceptDate(newDate);
|
|
68
65
|
}
|
|
66
|
+
else if (variant === 'inline' || variant === 'static') {
|
|
67
|
+
onChange(newDate);
|
|
68
|
+
}
|
|
69
69
|
},
|
|
70
70
|
onSetShift: function (shiftDate) {
|
|
71
71
|
var newDate = utils.date(shiftDate);
|
|
72
|
-
if (variant === 'inline' || variant === 'static') {
|
|
73
|
-
onChange(newDate);
|
|
74
|
-
}
|
|
75
72
|
if (autoOk) {
|
|
76
73
|
acceptDate(newDate);
|
|
77
74
|
}
|
|
75
|
+
else if (variant === 'inline' || variant === 'static') {
|
|
76
|
+
onChange(newDate);
|
|
77
|
+
}
|
|
78
78
|
},
|
|
79
79
|
}); }, [acceptDate, autoOk, onChange, pickerDate, variant]);
|
|
80
80
|
var validationError = text_field_helper_1.validate(value, utils, props);
|
package/constants/prop-types.js
CHANGED
|
@@ -34,10 +34,10 @@ exports.timePickerDefaultProps = {
|
|
|
34
34
|
};
|
|
35
35
|
exports.datePickerDefaultProps = {
|
|
36
36
|
minDate: new Date('1900-01-01'),
|
|
37
|
-
maxDate: new Date('
|
|
37
|
+
maxDate: new Date('2200-01-01'),
|
|
38
38
|
invalidDateMessage: 'Invalid Date Format',
|
|
39
39
|
minDateMessage: 'Date should not be before minimal date',
|
|
40
40
|
maxDateMessage: 'Date should not be after maximal date',
|
|
41
41
|
allowKeyboardControl: true,
|
|
42
42
|
};
|
|
43
|
-
exports.dateTimePickerDefaultProps = __assign({}, exports.timePickerDefaultProps, exports.datePickerDefaultProps, { showTabs: true });
|
|
43
|
+
exports.dateTimePickerDefaultProps = __assign(__assign(__assign({}, exports.timePickerDefaultProps), exports.datePickerDefaultProps), { showTabs: true });
|