rc-picker
Advanced tools
Comparing version 4.0.0-alpha.6 to 4.0.0-alpha.7
@@ -6,3 +6,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["id", "clearIcon", "suffixIcon", "separator", "activeIndex", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "value", "onChange", "onSubmit", "onInputChange", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onActiveOffset", "onMouseDown", "required", "aria-required"]; | ||
var _excluded = ["id", "clearIcon", "suffixIcon", "separator", "activeIndex", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "value", "onChange", "onSubmit", "onInputChange", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onActiveOffset", "onMouseDown", "required", "aria-required", "autoFocus"]; | ||
import classNames from 'classnames'; | ||
@@ -55,2 +55,3 @@ import ResizeObserver from 'rc-resize-observer'; | ||
ariaRequired = props['aria-required'], | ||
autoFocus = props.autoFocus, | ||
restProps = _objectWithoutProperties(props, _excluded); | ||
@@ -149,2 +150,6 @@ var rtl = direction === 'rtl'; | ||
// ======================= Disabled ======================= | ||
var startAutoFocus = autoFocus && !disabled[0]; | ||
var endAutoFocus = autoFocus && !startAutoFocus && !disabled[1]; | ||
// ======================== Render ======================== | ||
@@ -172,2 +177,3 @@ return /*#__PURE__*/React.createElement(ResizeObserver, { | ||
}, getInputProps(0), { | ||
autoFocus: startAutoFocus, | ||
"date-range": "start" | ||
@@ -179,2 +185,3 @@ })), /*#__PURE__*/React.createElement("div", { | ||
}, getInputProps(1), { | ||
autoFocus: endAutoFocus, | ||
"date-range": "end" | ||
@@ -181,0 +188,0 @@ })), /*#__PURE__*/React.createElement("div", { |
@@ -6,3 +6,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["id", "open", "clearIcon", "suffixIcon", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "internalPicker", "value", "onChange", "onSubmit", "onInputChange", "multiple", "maxTagCount", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onMouseDown", "required", "aria-required"]; | ||
var _excluded = ["id", "open", "clearIcon", "suffixIcon", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "internalPicker", "value", "onChange", "onSubmit", "onInputChange", "multiple", "maxTagCount", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onMouseDown", "required", "aria-required", "autoFocus"]; | ||
import classNames from 'classnames'; | ||
@@ -55,2 +55,3 @@ import * as React from 'react'; | ||
ariaRequired = props['aria-required'], | ||
autoFocus = props.autoFocus, | ||
restProps = _objectWithoutProperties(props, _excluded); | ||
@@ -128,3 +129,4 @@ var rtl = direction === 'rtl'; | ||
ref: inputRef, | ||
readOnly: true | ||
readOnly: true, | ||
autoFocus: autoFocus | ||
}), /*#__PURE__*/React.createElement(Icon, { | ||
@@ -139,2 +141,3 @@ type: "suffix", | ||
}, getInputProps(), { | ||
autoFocus: autoFocus, | ||
suffixIcon: suffixIcon, | ||
@@ -141,0 +144,0 @@ clearIcon: showClear && /*#__PURE__*/React.createElement(ClearIcon, { |
@@ -23,3 +23,3 @@ "use strict"; | ||
var _Input = _interopRequireDefault(require("./Input")); | ||
var _excluded = ["id", "clearIcon", "suffixIcon", "separator", "activeIndex", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "value", "onChange", "onSubmit", "onInputChange", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onActiveOffset", "onMouseDown", "required", "aria-required"]; | ||
var _excluded = ["id", "clearIcon", "suffixIcon", "separator", "activeIndex", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "value", "onChange", "onSubmit", "onInputChange", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onActiveOffset", "onMouseDown", "required", "aria-required", "autoFocus"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
@@ -65,2 +65,3 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
ariaRequired = props['aria-required'], | ||
autoFocus = props.autoFocus, | ||
restProps = (0, _objectWithoutProperties2.default)(props, _excluded); | ||
@@ -159,2 +160,6 @@ var rtl = direction === 'rtl'; | ||
// ======================= Disabled ======================= | ||
var startAutoFocus = autoFocus && !disabled[0]; | ||
var endAutoFocus = autoFocus && !startAutoFocus && !disabled[1]; | ||
// ======================== Render ======================== | ||
@@ -182,2 +187,3 @@ return /*#__PURE__*/React.createElement(_rcResizeObserver.default, { | ||
}, getInputProps(0), { | ||
autoFocus: startAutoFocus, | ||
"date-range": "start" | ||
@@ -189,2 +195,3 @@ })), /*#__PURE__*/React.createElement("div", { | ||
}, getInputProps(1), { | ||
autoFocus: endAutoFocus, | ||
"date-range": "end" | ||
@@ -191,0 +198,0 @@ })), /*#__PURE__*/React.createElement("div", { |
@@ -23,3 +23,3 @@ "use strict"; | ||
var _MultipleDates = _interopRequireDefault(require("./MultipleDates")); | ||
var _excluded = ["id", "open", "clearIcon", "suffixIcon", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "internalPicker", "value", "onChange", "onSubmit", "onInputChange", "multiple", "maxTagCount", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onMouseDown", "required", "aria-required"]; | ||
var _excluded = ["id", "open", "clearIcon", "suffixIcon", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "internalPicker", "value", "onChange", "onSubmit", "onInputChange", "multiple", "maxTagCount", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onMouseDown", "required", "aria-required", "autoFocus"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
@@ -65,2 +65,3 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
ariaRequired = props['aria-required'], | ||
autoFocus = props.autoFocus, | ||
restProps = (0, _objectWithoutProperties2.default)(props, _excluded); | ||
@@ -138,3 +139,4 @@ var rtl = direction === 'rtl'; | ||
ref: inputRef, | ||
readOnly: true | ||
readOnly: true, | ||
autoFocus: autoFocus | ||
}), /*#__PURE__*/React.createElement(_Icon.default, { | ||
@@ -149,2 +151,3 @@ type: "suffix", | ||
}, getInputProps(), { | ||
autoFocus: autoFocus, | ||
suffixIcon: suffixIcon, | ||
@@ -151,0 +154,0 @@ clearIcon: showClear && /*#__PURE__*/React.createElement(_Icon.ClearIcon, { |
{ | ||
"name": "rc-picker", | ||
"version": "4.0.0-alpha.6", | ||
"version": "4.0.0-alpha.7", | ||
"description": "React date & time picker", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
862975
20956