@titaui/pc 1.11.4-11 → 1.11.4-14
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.
|
@@ -21,7 +21,7 @@ var _utils = require("./utils");
|
|
|
21
21
|
|
|
22
22
|
require("./index.css");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["disabled", "timeFormat", "hourStep", "minuteStep", "onChange", "value"];
|
|
24
|
+
var _excluded = ["disabled", "enableKeyBoard", "timeFormat", "hourStep", "minuteStep", "onChange", "value"];
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
27
|
|
|
@@ -51,6 +51,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
51
51
|
|
|
52
52
|
var TimePicker = function TimePicker(props) {
|
|
53
53
|
var disabled = props.disabled,
|
|
54
|
+
_props$enableKeyBoard = props.enableKeyBoard,
|
|
55
|
+
enableKeyBoard = _props$enableKeyBoard === void 0 ? true : _props$enableKeyBoard,
|
|
54
56
|
_props$timeFormat = props.timeFormat,
|
|
55
57
|
timeFormat = _props$timeFormat === void 0 ? 'hh:mm' : _props$timeFormat,
|
|
56
58
|
_props$hourStep = props.hourStep,
|
|
@@ -253,8 +255,10 @@ var TimePicker = function TimePicker(props) {
|
|
|
253
255
|
};
|
|
254
256
|
|
|
255
257
|
(0, _react.useEffect)(function () {
|
|
256
|
-
|
|
258
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
259
|
+
enableKeyBoard && timeSetingtType && document.addEventListener('keydown', handleKeyDown);
|
|
257
260
|
return function () {
|
|
261
|
+
clearTimeout(timerRef.current);
|
|
258
262
|
document.removeEventListener('keydown', handleKeyDown);
|
|
259
263
|
};
|
|
260
264
|
}, [timeSetingtType]);
|
|
@@ -32,7 +32,7 @@ var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
32
32
|
_props$stopPropagatio = props.stopPropagation,
|
|
33
33
|
stopPropagation = _props$stopPropagatio === void 0 ? true : _props$stopPropagatio,
|
|
34
34
|
_props$type = props.type,
|
|
35
|
-
type = _props$type === void 0 ?
|
|
35
|
+
type = _props$type === void 0 ? 'text' : _props$type,
|
|
36
36
|
value = props.value,
|
|
37
37
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
38
38
|
|
|
@@ -80,6 +80,8 @@ var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
80
80
|
setSelectionRange(changeTimeout);
|
|
81
81
|
}, [value]);
|
|
82
82
|
return /*#__PURE__*/_react["default"].createElement("input", _extends({
|
|
83
|
+
autoFocus: false,
|
|
84
|
+
autoComplete: "off",
|
|
83
85
|
className: className,
|
|
84
86
|
maxLength: maxLength,
|
|
85
87
|
onClick: onClickHandler,
|