@react-spectrum/datepicker 3.9.4 → 3.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateField.main.js +110 -0
- package/dist/DateField.main.js.map +1 -0
- package/dist/DateField.mjs +105 -0
- package/dist/DateField.module.js +105 -0
- package/dist/DateField.module.js.map +1 -0
- package/dist/DatePicker.main.js +198 -0
- package/dist/DatePicker.main.js.map +1 -0
- package/dist/DatePicker.mjs +193 -0
- package/dist/DatePicker.module.js +193 -0
- package/dist/DatePicker.module.js.map +1 -0
- package/dist/DatePickerField.main.js +72 -0
- package/dist/DatePickerField.main.js.map +1 -0
- package/dist/DatePickerField.mjs +67 -0
- package/dist/DatePickerField.module.js +67 -0
- package/dist/DatePickerField.module.js.map +1 -0
- package/dist/DatePickerSegment.main.js +76 -0
- package/dist/DatePickerSegment.main.js.map +1 -0
- package/dist/DatePickerSegment.mjs +71 -0
- package/dist/DatePickerSegment.module.js +71 -0
- package/dist/DatePickerSegment.module.js.map +1 -0
- package/dist/DateRangePicker.main.js +225 -0
- package/dist/DateRangePicker.main.js.map +1 -0
- package/dist/DateRangePicker.mjs +220 -0
- package/dist/DateRangePicker.module.js +220 -0
- package/dist/DateRangePicker.module.js.map +1 -0
- package/dist/Input.main.js +123 -0
- package/dist/Input.main.js.map +1 -0
- package/dist/Input.mjs +118 -0
- package/dist/Input.module.js +118 -0
- package/dist/Input.module.js.map +1 -0
- package/dist/TimeField.main.js +102 -0
- package/dist/TimeField.main.js.map +1 -0
- package/dist/TimeField.mjs +97 -0
- package/dist/TimeField.module.js +97 -0
- package/dist/TimeField.module.js.map +1 -0
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +4 -1136
- package/dist/inputgroup_vars_css.main.js +86 -0
- package/dist/inputgroup_vars_css.main.js.map +1 -0
- package/dist/inputgroup_vars_css.mjs +88 -0
- package/dist/inputgroup_vars_css.module.js +88 -0
- package/dist/inputgroup_vars_css.module.js.map +1 -0
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +8 -1136
- package/dist/main.js.map +1 -1
- package/dist/module.js +4 -1136
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/styles.36ea4632.css +209 -0
- package/dist/styles.36ea4632.css.map +1 -0
- package/dist/styles_css.main.js +74 -0
- package/dist/styles_css.main.js.map +1 -0
- package/dist/styles_css.mjs +76 -0
- package/dist/styles_css.module.js +76 -0
- package/dist/styles_css.module.js.map +1 -0
- package/dist/sv-SE.mjs +1 -1
- package/dist/textfield_vars_css.main.js +74 -0
- package/dist/textfield_vars_css.main.js.map +1 -0
- package/dist/textfield_vars_css.mjs +76 -0
- package/dist/textfield_vars_css.module.js +76 -0
- package/dist/textfield_vars_css.module.js.map +1 -0
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/utils.main.js +89 -0
- package/dist/utils.main.js.map +1 -0
- package/dist/utils.mjs +82 -0
- package/dist/utils.module.js +82 -0
- package/dist/utils.module.js.map +1 -0
- package/dist/vars.3692148b.css +549 -0
- package/dist/vars.3692148b.css.map +1 -0
- package/dist/vars.ccbd2e3f.css +649 -0
- package/dist/vars.ccbd2e3f.css.map +1 -0
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +22 -22
- package/dist/main.css +0 -1626
- package/dist/main.css.map +0 -1
package/dist/Input.mjs
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import "./styles.36ea4632.css";
|
|
2
|
+
import $fVzF9$styles_cssmodulejs from "./styles_css.mjs";
|
|
3
|
+
import "./vars.3692148b.css";
|
|
4
|
+
import $fVzF9$textfield_vars_cssmodulejs from "./textfield_vars_css.mjs";
|
|
5
|
+
import $fVzF9$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
|
6
|
+
import $fVzF9$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
|
|
7
|
+
import {useValueEffect as $fVzF9$useValueEffect, classNames as $fVzF9$classNames} from "@react-spectrum/utils";
|
|
8
|
+
import {useLayoutEffect as $fVzF9$useLayoutEffect, useResizeObserver as $fVzF9$useResizeObserver, useEvent as $fVzF9$useEvent, mergeProps as $fVzF9$mergeProps, mergeRefs as $fVzF9$mergeRefs} from "@react-aria/utils";
|
|
9
|
+
import $fVzF9$react, {useRef as $fVzF9$useRef, useCallback as $fVzF9$useCallback} from "react";
|
|
10
|
+
import {useFocusRing as $fVzF9$useFocusRing} from "@react-aria/focus";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
function $parcel$interopDefault(a) {
|
|
14
|
+
return a && a.__esModule ? a.default : a;
|
|
15
|
+
}
|
|
16
|
+
/*
|
|
17
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
18
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
19
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
20
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
*
|
|
22
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
23
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
24
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
25
|
+
* governing permissions and limitations under the License.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
function $79348162c55d687f$var$Input(props, ref) {
|
|
35
|
+
let inputRef = (0, $fVzF9$useRef)(null);
|
|
36
|
+
let { isDisabled: isDisabled, isQuiet: isQuiet, inputClassName: inputClassName, validationState: validationState, children: children, fieldProps: fieldProps, className: className, style: style, disableFocusRing: disableFocusRing } = props;
|
|
37
|
+
// Reserve padding for the error icon when the width of the input is unconstrained.
|
|
38
|
+
// When constrained, don't reserve space because adding it only when invalid will
|
|
39
|
+
// not cause a layout shift.
|
|
40
|
+
let [reservePadding, setReservePadding] = (0, $fVzF9$useValueEffect)(false);
|
|
41
|
+
let onResize = (0, $fVzF9$useCallback)(()=>setReservePadding(function*(reservePadding) {
|
|
42
|
+
if (inputRef.current) {
|
|
43
|
+
if (reservePadding) // Try to collapse padding if the content is clipped.
|
|
44
|
+
{
|
|
45
|
+
if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {
|
|
46
|
+
let width = inputRef.current.parentElement.offsetWidth;
|
|
47
|
+
yield false;
|
|
48
|
+
// If removing padding causes a layout shift, add it back.
|
|
49
|
+
if (inputRef.current.parentElement.offsetWidth !== width) yield true;
|
|
50
|
+
}
|
|
51
|
+
} else // Try to add padding if the content is not clipped.
|
|
52
|
+
if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {
|
|
53
|
+
let width = inputRef.current.parentElement.offsetWidth;
|
|
54
|
+
yield true;
|
|
55
|
+
// If adding padding does not change the width (i.e. width is constrained), remove it again.
|
|
56
|
+
if (inputRef.current.parentElement.offsetWidth === width) yield false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}), [
|
|
60
|
+
inputRef,
|
|
61
|
+
setReservePadding
|
|
62
|
+
]);
|
|
63
|
+
(0, $fVzF9$useLayoutEffect)(onResize, [
|
|
64
|
+
onResize
|
|
65
|
+
]);
|
|
66
|
+
(0, $fVzF9$useResizeObserver)({
|
|
67
|
+
ref: inputRef,
|
|
68
|
+
onResize: onResize
|
|
69
|
+
});
|
|
70
|
+
// We also need to listen for resize events of the window so we can detect
|
|
71
|
+
// when there is enough space for the padding to be re-added. Ideally we'd
|
|
72
|
+
// use a resize observer on a parent element, but it's hard to know _what_
|
|
73
|
+
// parent element.
|
|
74
|
+
(0, $fVzF9$useEvent)((0, $fVzF9$useRef)(typeof window !== "undefined" ? window : null), "resize", onResize);
|
|
75
|
+
let { focusProps: focusProps, isFocusVisible: isFocusVisible, isFocused: isFocused } = (0, $fVzF9$useFocusRing)({
|
|
76
|
+
isTextInput: true,
|
|
77
|
+
within: true
|
|
78
|
+
});
|
|
79
|
+
let isInvalid = validationState === "invalid" && !isDisabled;
|
|
80
|
+
let textfieldClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), "spectrum-Textfield", {
|
|
81
|
+
"spectrum-Textfield--invalid": isInvalid,
|
|
82
|
+
"spectrum-Textfield--valid": validationState === "valid" && !isDisabled,
|
|
83
|
+
"spectrum-Textfield--quiet": isQuiet,
|
|
84
|
+
"focus-ring": isFocusVisible && !disableFocusRing
|
|
85
|
+
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-Datepicker-field"), className);
|
|
86
|
+
let inputClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), "spectrum-Textfield-input", {
|
|
87
|
+
"is-disabled": isDisabled,
|
|
88
|
+
"is-focused": isFocused
|
|
89
|
+
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-DateField-Input"), reservePadding && (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-Datepicker-input"), inputClassName);
|
|
90
|
+
let iconClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), "spectrum-Textfield-validationIcon");
|
|
91
|
+
let validationIcon = null;
|
|
92
|
+
if (validationState === "invalid" && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiAlertMedium), {
|
|
93
|
+
"data-testid": "invalid-icon",
|
|
94
|
+
UNSAFE_className: iconClass
|
|
95
|
+
});
|
|
96
|
+
else if (validationState === "valid" && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiCheckmarkMedium), {
|
|
97
|
+
"data-testid": "valid-icon",
|
|
98
|
+
UNSAFE_className: iconClass
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
101
|
+
role: "presentation",
|
|
102
|
+
...(0, $fVzF9$mergeProps)(fieldProps, focusProps),
|
|
103
|
+
className: textfieldClass,
|
|
104
|
+
style: style
|
|
105
|
+
}, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
106
|
+
role: "presentation",
|
|
107
|
+
className: inputClass
|
|
108
|
+
}, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
109
|
+
role: "presentation",
|
|
110
|
+
className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-Datepicker-inputContents"),
|
|
111
|
+
ref: (0, $fVzF9$mergeRefs)(ref, inputRef)
|
|
112
|
+
}, children)), validationIcon);
|
|
113
|
+
}
|
|
114
|
+
const $79348162c55d687f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $fVzF9$react).forwardRef($79348162c55d687f$var$Input);
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export {$79348162c55d687f$export$f5b8910cec6cf069 as Input};
|
|
118
|
+
//# sourceMappingURL=Input.mjs.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import "./styles.36ea4632.css";
|
|
2
|
+
import $fVzF9$styles_cssmodulejs from "./styles_css.module.js";
|
|
3
|
+
import "./vars.3692148b.css";
|
|
4
|
+
import $fVzF9$textfield_vars_cssmodulejs from "./textfield_vars_css.module.js";
|
|
5
|
+
import $fVzF9$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
|
6
|
+
import $fVzF9$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
|
|
7
|
+
import {useValueEffect as $fVzF9$useValueEffect, classNames as $fVzF9$classNames} from "@react-spectrum/utils";
|
|
8
|
+
import {useLayoutEffect as $fVzF9$useLayoutEffect, useResizeObserver as $fVzF9$useResizeObserver, useEvent as $fVzF9$useEvent, mergeProps as $fVzF9$mergeProps, mergeRefs as $fVzF9$mergeRefs} from "@react-aria/utils";
|
|
9
|
+
import $fVzF9$react, {useRef as $fVzF9$useRef, useCallback as $fVzF9$useCallback} from "react";
|
|
10
|
+
import {useFocusRing as $fVzF9$useFocusRing} from "@react-aria/focus";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
function $parcel$interopDefault(a) {
|
|
14
|
+
return a && a.__esModule ? a.default : a;
|
|
15
|
+
}
|
|
16
|
+
/*
|
|
17
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
18
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
19
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
20
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
*
|
|
22
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
23
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
24
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
25
|
+
* governing permissions and limitations under the License.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
function $79348162c55d687f$var$Input(props, ref) {
|
|
35
|
+
let inputRef = (0, $fVzF9$useRef)(null);
|
|
36
|
+
let { isDisabled: isDisabled, isQuiet: isQuiet, inputClassName: inputClassName, validationState: validationState, children: children, fieldProps: fieldProps, className: className, style: style, disableFocusRing: disableFocusRing } = props;
|
|
37
|
+
// Reserve padding for the error icon when the width of the input is unconstrained.
|
|
38
|
+
// When constrained, don't reserve space because adding it only when invalid will
|
|
39
|
+
// not cause a layout shift.
|
|
40
|
+
let [reservePadding, setReservePadding] = (0, $fVzF9$useValueEffect)(false);
|
|
41
|
+
let onResize = (0, $fVzF9$useCallback)(()=>setReservePadding(function*(reservePadding) {
|
|
42
|
+
if (inputRef.current) {
|
|
43
|
+
if (reservePadding) // Try to collapse padding if the content is clipped.
|
|
44
|
+
{
|
|
45
|
+
if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {
|
|
46
|
+
let width = inputRef.current.parentElement.offsetWidth;
|
|
47
|
+
yield false;
|
|
48
|
+
// If removing padding causes a layout shift, add it back.
|
|
49
|
+
if (inputRef.current.parentElement.offsetWidth !== width) yield true;
|
|
50
|
+
}
|
|
51
|
+
} else // Try to add padding if the content is not clipped.
|
|
52
|
+
if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {
|
|
53
|
+
let width = inputRef.current.parentElement.offsetWidth;
|
|
54
|
+
yield true;
|
|
55
|
+
// If adding padding does not change the width (i.e. width is constrained), remove it again.
|
|
56
|
+
if (inputRef.current.parentElement.offsetWidth === width) yield false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}), [
|
|
60
|
+
inputRef,
|
|
61
|
+
setReservePadding
|
|
62
|
+
]);
|
|
63
|
+
(0, $fVzF9$useLayoutEffect)(onResize, [
|
|
64
|
+
onResize
|
|
65
|
+
]);
|
|
66
|
+
(0, $fVzF9$useResizeObserver)({
|
|
67
|
+
ref: inputRef,
|
|
68
|
+
onResize: onResize
|
|
69
|
+
});
|
|
70
|
+
// We also need to listen for resize events of the window so we can detect
|
|
71
|
+
// when there is enough space for the padding to be re-added. Ideally we'd
|
|
72
|
+
// use a resize observer on a parent element, but it's hard to know _what_
|
|
73
|
+
// parent element.
|
|
74
|
+
(0, $fVzF9$useEvent)((0, $fVzF9$useRef)(typeof window !== "undefined" ? window : null), "resize", onResize);
|
|
75
|
+
let { focusProps: focusProps, isFocusVisible: isFocusVisible, isFocused: isFocused } = (0, $fVzF9$useFocusRing)({
|
|
76
|
+
isTextInput: true,
|
|
77
|
+
within: true
|
|
78
|
+
});
|
|
79
|
+
let isInvalid = validationState === "invalid" && !isDisabled;
|
|
80
|
+
let textfieldClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), "spectrum-Textfield", {
|
|
81
|
+
"spectrum-Textfield--invalid": isInvalid,
|
|
82
|
+
"spectrum-Textfield--valid": validationState === "valid" && !isDisabled,
|
|
83
|
+
"spectrum-Textfield--quiet": isQuiet,
|
|
84
|
+
"focus-ring": isFocusVisible && !disableFocusRing
|
|
85
|
+
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-Datepicker-field"), className);
|
|
86
|
+
let inputClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), "spectrum-Textfield-input", {
|
|
87
|
+
"is-disabled": isDisabled,
|
|
88
|
+
"is-focused": isFocused
|
|
89
|
+
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-DateField-Input"), reservePadding && (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-Datepicker-input"), inputClassName);
|
|
90
|
+
let iconClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), "spectrum-Textfield-validationIcon");
|
|
91
|
+
let validationIcon = null;
|
|
92
|
+
if (validationState === "invalid" && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiAlertMedium), {
|
|
93
|
+
"data-testid": "invalid-icon",
|
|
94
|
+
UNSAFE_className: iconClass
|
|
95
|
+
});
|
|
96
|
+
else if (validationState === "valid" && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiCheckmarkMedium), {
|
|
97
|
+
"data-testid": "valid-icon",
|
|
98
|
+
UNSAFE_className: iconClass
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
101
|
+
role: "presentation",
|
|
102
|
+
...(0, $fVzF9$mergeProps)(fieldProps, focusProps),
|
|
103
|
+
className: textfieldClass,
|
|
104
|
+
style: style
|
|
105
|
+
}, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
106
|
+
role: "presentation",
|
|
107
|
+
className: inputClass
|
|
108
|
+
}, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
109
|
+
role: "presentation",
|
|
110
|
+
className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), "react-spectrum-Datepicker-inputContents"),
|
|
111
|
+
ref: (0, $fVzF9$mergeRefs)(ref, inputRef)
|
|
112
|
+
}, children)), validationIcon);
|
|
113
|
+
}
|
|
114
|
+
const $79348162c55d687f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $fVzF9$react).forwardRef($79348162c55d687f$var$Input);
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export {$79348162c55d687f$export$f5b8910cec6cf069 as Input};
|
|
118
|
+
//# sourceMappingURL=Input.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"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","sources":["packages/@react-spectrum/datepicker/src/Input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Alert from '@spectrum-icons/ui/AlertMedium';\nimport Checkmark from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, useValueEffect} from '@react-spectrum/utils';\nimport datepickerStyles from './styles.css';\nimport {mergeProps, mergeRefs, useEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport React, {useCallback, useRef} from 'react';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\n\nfunction Input(props, ref) {\n let inputRef = useRef(null);\n let {\n isDisabled,\n isQuiet,\n inputClassName,\n validationState,\n children,\n fieldProps,\n className,\n style,\n disableFocusRing\n } = props;\n\n // Reserve padding for the error icon when the width of the input is unconstrained.\n // When constrained, don't reserve space because adding it only when invalid will\n // not cause a layout shift.\n let [reservePadding, setReservePadding] = useValueEffect(false);\n let onResize = useCallback(() => setReservePadding(function *(reservePadding) {\n if (inputRef.current) {\n if (reservePadding) {\n // Try to collapse padding if the content is clipped.\n if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield false;\n\n // If removing padding causes a layout shift, add it back.\n if (inputRef.current.parentElement.offsetWidth !== width) {\n yield true;\n }\n }\n } else {\n // Try to add padding if the content is not clipped.\n if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield true;\n\n // If adding padding does not change the width (i.e. width is constrained), remove it again.\n if (inputRef.current.parentElement.offsetWidth === width) {\n yield false;\n }\n }\n }\n }\n\n }), [inputRef, setReservePadding]);\n\n useLayoutEffect(onResize, [onResize]);\n useResizeObserver({\n ref: inputRef,\n onResize\n });\n\n // We also need to listen for resize events of the window so we can detect\n // when there is enough space for the padding to be re-added. Ideally we'd\n // use a resize observer on a parent element, but it's hard to know _what_\n // parent element.\n useEvent(useRef(typeof window !== 'undefined' ? window : null), 'resize', onResize);\n\n let {focusProps, isFocusVisible, isFocused} = useFocusRing({\n isTextInput: true,\n within: true\n });\n\n let isInvalid = validationState === 'invalid' && !isDisabled;\n let textfieldClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet,\n 'focus-ring': isFocusVisible && !disableFocusRing\n },\n classNames(datepickerStyles, 'react-spectrum-Datepicker-field'),\n className\n );\n\n let inputClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-disabled': isDisabled,\n 'is-focused': isFocused\n },\n classNames(datepickerStyles, 'react-spectrum-DateField-Input'),\n reservePadding && classNames(datepickerStyles, 'react-spectrum-Datepicker-input'),\n inputClassName\n );\n\n let iconClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon'\n );\n\n let validationIcon = null;\n if (validationState === 'invalid' && !isDisabled) {\n validationIcon = <Alert data-testid=\"invalid-icon\" UNSAFE_className={iconClass} />;\n } else if (validationState === 'valid' && !isDisabled) {\n validationIcon = <Checkmark data-testid=\"valid-icon\" UNSAFE_className={iconClass} />;\n }\n\n return (\n <div role=\"presentation\" {...mergeProps(fieldProps, focusProps)} className={textfieldClass} style={style}>\n <div role=\"presentation\" className={inputClass}>\n <div role=\"presentation\" className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputContents')} ref={mergeRefs(ref, inputRef)}>\n {children}\n </div>\n </div>\n {validationIcon}\n </div>\n );\n}\n\nconst _Input = React.forwardRef(Input);\nexport {_Input as Input};\n"],"names":[],"version":3,"file":"Input.module.js.map"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var $edac158d20ebe4a9$exports = require("./DatePickerSegment.main.js");
|
|
2
|
+
require("./styles.36ea4632.css");
|
|
3
|
+
var $91c3db8c6a21ca71$exports = require("./styles_css.main.js");
|
|
4
|
+
var $c3ebc4931d9b9977$exports = require("./Input.main.js");
|
|
5
|
+
var $4d2e419f522adb48$exports = require("./utils.main.js");
|
|
6
|
+
var $gfZkn$reactspectrumutils = require("@react-spectrum/utils");
|
|
7
|
+
var $gfZkn$reactspectrumlabel = require("@react-spectrum/label");
|
|
8
|
+
var $gfZkn$react = require("react");
|
|
9
|
+
var $gfZkn$reactspectrumform = require("@react-spectrum/form");
|
|
10
|
+
var $gfZkn$reactariai18n = require("@react-aria/i18n");
|
|
11
|
+
var $gfZkn$reactspectrumprovider = require("@react-spectrum/provider");
|
|
12
|
+
var $gfZkn$reactariadatepicker = require("@react-aria/datepicker");
|
|
13
|
+
var $gfZkn$reactstatelydatepicker = require("@react-stately/datepicker");
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
function $parcel$interopDefault(a) {
|
|
17
|
+
return a && a.__esModule ? a.default : a;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function $parcel$export(e, n, v, s) {
|
|
21
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
$parcel$export(module.exports, "TimeField", () => $740ff83729a8f317$export$5eaee2322dd727eb);
|
|
25
|
+
/*
|
|
26
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
27
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
28
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
29
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
30
|
+
*
|
|
31
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
32
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
33
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
34
|
+
* governing permissions and limitations under the License.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
function $740ff83729a8f317$var$TimeField(props, ref) {
|
|
48
|
+
props = (0, $gfZkn$reactspectrumprovider.useProviderProps)(props);
|
|
49
|
+
props = (0, $gfZkn$reactspectrumform.useFormProps)(props);
|
|
50
|
+
let { autoFocus: autoFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, isQuiet: isQuiet } = props;
|
|
51
|
+
let domRef = (0, $4d2e419f522adb48$exports.useFocusManagerRef)(ref);
|
|
52
|
+
let { locale: locale } = (0, $gfZkn$reactariai18n.useLocale)();
|
|
53
|
+
let state = (0, $gfZkn$reactstatelydatepicker.useTimeFieldState)({
|
|
54
|
+
...props,
|
|
55
|
+
locale: locale
|
|
56
|
+
});
|
|
57
|
+
let fieldRef = (0, $gfZkn$react.useRef)(null);
|
|
58
|
+
let inputRef = (0, $gfZkn$react.useRef)(null);
|
|
59
|
+
let { labelProps: labelProps, fieldProps: fieldProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $gfZkn$reactariadatepicker.useTimeField)({
|
|
60
|
+
...props,
|
|
61
|
+
inputRef: inputRef
|
|
62
|
+
}, state, fieldRef);
|
|
63
|
+
let validationState = state.validationState || (isInvalid ? "invalid" : null);
|
|
64
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).createElement((0, $gfZkn$reactspectrumlabel.Field), {
|
|
65
|
+
...props,
|
|
66
|
+
ref: domRef,
|
|
67
|
+
elementType: "span",
|
|
68
|
+
labelProps: labelProps,
|
|
69
|
+
descriptionProps: descriptionProps,
|
|
70
|
+
errorMessageProps: errorMessageProps,
|
|
71
|
+
validationState: validationState,
|
|
72
|
+
isInvalid: isInvalid,
|
|
73
|
+
validationErrors: validationErrors,
|
|
74
|
+
validationDetails: validationDetails,
|
|
75
|
+
wrapperClassName: (0, $gfZkn$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), "react-spectrum-TimeField-fieldWrapper")
|
|
76
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).createElement((0, $c3ebc4931d9b9977$exports.Input), {
|
|
77
|
+
ref: fieldRef,
|
|
78
|
+
fieldProps: fieldProps,
|
|
79
|
+
isDisabled: isDisabled,
|
|
80
|
+
isQuiet: isQuiet,
|
|
81
|
+
autoFocus: autoFocus,
|
|
82
|
+
validationState: validationState,
|
|
83
|
+
className: (0, $gfZkn$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), "react-spectrum-TimeField")
|
|
84
|
+
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).createElement((0, $edac158d20ebe4a9$exports.DatePickerSegment), {
|
|
85
|
+
key: i,
|
|
86
|
+
segment: segment,
|
|
87
|
+
state: state,
|
|
88
|
+
isDisabled: isDisabled,
|
|
89
|
+
isReadOnly: isReadOnly,
|
|
90
|
+
isRequired: isRequired
|
|
91
|
+
})), /*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).createElement("input", {
|
|
92
|
+
...inputProps,
|
|
93
|
+
ref: inputRef
|
|
94
|
+
})));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* TimeFields allow users to enter and edit time values using a keyboard.
|
|
98
|
+
* Each part of the time is displayed in an individually editable segment.
|
|
99
|
+
*/ const $740ff83729a8f317$export$5eaee2322dd727eb = /*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).forwardRef($740ff83729a8f317$var$TimeField);
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=TimeField.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,4CAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,+CAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,uCAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB;QACjB,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,0DAAC,CAAA,GAAA,+BAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,0DAAC,CAAA,GAAA,2CAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef(null);\n let inputRef = useRef(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.main.js.map"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {DatePickerSegment as $cfa347761f172638$export$6388987c5223b54e} from "./DatePickerSegment.mjs";
|
|
2
|
+
import "./styles.36ea4632.css";
|
|
3
|
+
import $immgY$styles_cssmodulejs from "./styles_css.mjs";
|
|
4
|
+
import {Input as $79348162c55d687f$export$f5b8910cec6cf069} from "./Input.mjs";
|
|
5
|
+
import {useFocusManagerRef as $04e96200274b03de$export$71a23a36270e4bf0} from "./utils.mjs";
|
|
6
|
+
import {classNames as $immgY$classNames} from "@react-spectrum/utils";
|
|
7
|
+
import {Field as $immgY$Field} from "@react-spectrum/label";
|
|
8
|
+
import $immgY$react, {useRef as $immgY$useRef} from "react";
|
|
9
|
+
import {useFormProps as $immgY$useFormProps} from "@react-spectrum/form";
|
|
10
|
+
import {useLocale as $immgY$useLocale} from "@react-aria/i18n";
|
|
11
|
+
import {useProviderProps as $immgY$useProviderProps} from "@react-spectrum/provider";
|
|
12
|
+
import {useTimeField as $immgY$useTimeField} from "@react-aria/datepicker";
|
|
13
|
+
import {useTimeFieldState as $immgY$useTimeFieldState} from "@react-stately/datepicker";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
function $parcel$interopDefault(a) {
|
|
17
|
+
return a && a.__esModule ? a.default : a;
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
+
* governing permissions and limitations under the License.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
42
|
+
props = (0, $immgY$useProviderProps)(props);
|
|
43
|
+
props = (0, $immgY$useFormProps)(props);
|
|
44
|
+
let { autoFocus: autoFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, isQuiet: isQuiet } = props;
|
|
45
|
+
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
46
|
+
let { locale: locale } = (0, $immgY$useLocale)();
|
|
47
|
+
let state = (0, $immgY$useTimeFieldState)({
|
|
48
|
+
...props,
|
|
49
|
+
locale: locale
|
|
50
|
+
});
|
|
51
|
+
let fieldRef = (0, $immgY$useRef)(null);
|
|
52
|
+
let inputRef = (0, $immgY$useRef)(null);
|
|
53
|
+
let { labelProps: labelProps, fieldProps: fieldProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $immgY$useTimeField)({
|
|
54
|
+
...props,
|
|
55
|
+
inputRef: inputRef
|
|
56
|
+
}, state, fieldRef);
|
|
57
|
+
let validationState = state.validationState || (isInvalid ? "invalid" : null);
|
|
58
|
+
return /*#__PURE__*/ (0, $immgY$react).createElement((0, $immgY$Field), {
|
|
59
|
+
...props,
|
|
60
|
+
ref: domRef,
|
|
61
|
+
elementType: "span",
|
|
62
|
+
labelProps: labelProps,
|
|
63
|
+
descriptionProps: descriptionProps,
|
|
64
|
+
errorMessageProps: errorMessageProps,
|
|
65
|
+
validationState: validationState,
|
|
66
|
+
isInvalid: isInvalid,
|
|
67
|
+
validationErrors: validationErrors,
|
|
68
|
+
validationDetails: validationDetails,
|
|
69
|
+
wrapperClassName: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), "react-spectrum-TimeField-fieldWrapper")
|
|
70
|
+
}, /*#__PURE__*/ (0, $immgY$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
71
|
+
ref: fieldRef,
|
|
72
|
+
fieldProps: fieldProps,
|
|
73
|
+
isDisabled: isDisabled,
|
|
74
|
+
isQuiet: isQuiet,
|
|
75
|
+
autoFocus: autoFocus,
|
|
76
|
+
validationState: validationState,
|
|
77
|
+
className: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), "react-spectrum-TimeField")
|
|
78
|
+
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $immgY$react).createElement((0, $cfa347761f172638$export$6388987c5223b54e), {
|
|
79
|
+
key: i,
|
|
80
|
+
segment: segment,
|
|
81
|
+
state: state,
|
|
82
|
+
isDisabled: isDisabled,
|
|
83
|
+
isReadOnly: isReadOnly,
|
|
84
|
+
isRequired: isRequired
|
|
85
|
+
})), /*#__PURE__*/ (0, $immgY$react).createElement("input", {
|
|
86
|
+
...inputProps,
|
|
87
|
+
ref: inputRef
|
|
88
|
+
})));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* TimeFields allow users to enter and edit time values using a keyboard.
|
|
92
|
+
* Each part of the time is displayed in an individually editable segment.
|
|
93
|
+
*/ const $f0a04554754386b6$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $immgY$react).forwardRef($f0a04554754386b6$var$TimeField);
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
export {$f0a04554754386b6$export$5eaee2322dd727eb as TimeField};
|
|
97
|
+
//# sourceMappingURL=TimeField.mjs.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {DatePickerSegment as $cfa347761f172638$export$6388987c5223b54e} from "./DatePickerSegment.module.js";
|
|
2
|
+
import "./styles.36ea4632.css";
|
|
3
|
+
import $immgY$styles_cssmodulejs from "./styles_css.module.js";
|
|
4
|
+
import {Input as $79348162c55d687f$export$f5b8910cec6cf069} from "./Input.module.js";
|
|
5
|
+
import {useFocusManagerRef as $04e96200274b03de$export$71a23a36270e4bf0} from "./utils.module.js";
|
|
6
|
+
import {classNames as $immgY$classNames} from "@react-spectrum/utils";
|
|
7
|
+
import {Field as $immgY$Field} from "@react-spectrum/label";
|
|
8
|
+
import $immgY$react, {useRef as $immgY$useRef} from "react";
|
|
9
|
+
import {useFormProps as $immgY$useFormProps} from "@react-spectrum/form";
|
|
10
|
+
import {useLocale as $immgY$useLocale} from "@react-aria/i18n";
|
|
11
|
+
import {useProviderProps as $immgY$useProviderProps} from "@react-spectrum/provider";
|
|
12
|
+
import {useTimeField as $immgY$useTimeField} from "@react-aria/datepicker";
|
|
13
|
+
import {useTimeFieldState as $immgY$useTimeFieldState} from "@react-stately/datepicker";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
function $parcel$interopDefault(a) {
|
|
17
|
+
return a && a.__esModule ? a.default : a;
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
+
* governing permissions and limitations under the License.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
42
|
+
props = (0, $immgY$useProviderProps)(props);
|
|
43
|
+
props = (0, $immgY$useFormProps)(props);
|
|
44
|
+
let { autoFocus: autoFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, isQuiet: isQuiet } = props;
|
|
45
|
+
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
46
|
+
let { locale: locale } = (0, $immgY$useLocale)();
|
|
47
|
+
let state = (0, $immgY$useTimeFieldState)({
|
|
48
|
+
...props,
|
|
49
|
+
locale: locale
|
|
50
|
+
});
|
|
51
|
+
let fieldRef = (0, $immgY$useRef)(null);
|
|
52
|
+
let inputRef = (0, $immgY$useRef)(null);
|
|
53
|
+
let { labelProps: labelProps, fieldProps: fieldProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $immgY$useTimeField)({
|
|
54
|
+
...props,
|
|
55
|
+
inputRef: inputRef
|
|
56
|
+
}, state, fieldRef);
|
|
57
|
+
let validationState = state.validationState || (isInvalid ? "invalid" : null);
|
|
58
|
+
return /*#__PURE__*/ (0, $immgY$react).createElement((0, $immgY$Field), {
|
|
59
|
+
...props,
|
|
60
|
+
ref: domRef,
|
|
61
|
+
elementType: "span",
|
|
62
|
+
labelProps: labelProps,
|
|
63
|
+
descriptionProps: descriptionProps,
|
|
64
|
+
errorMessageProps: errorMessageProps,
|
|
65
|
+
validationState: validationState,
|
|
66
|
+
isInvalid: isInvalid,
|
|
67
|
+
validationErrors: validationErrors,
|
|
68
|
+
validationDetails: validationDetails,
|
|
69
|
+
wrapperClassName: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), "react-spectrum-TimeField-fieldWrapper")
|
|
70
|
+
}, /*#__PURE__*/ (0, $immgY$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
71
|
+
ref: fieldRef,
|
|
72
|
+
fieldProps: fieldProps,
|
|
73
|
+
isDisabled: isDisabled,
|
|
74
|
+
isQuiet: isQuiet,
|
|
75
|
+
autoFocus: autoFocus,
|
|
76
|
+
validationState: validationState,
|
|
77
|
+
className: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), "react-spectrum-TimeField")
|
|
78
|
+
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $immgY$react).createElement((0, $cfa347761f172638$export$6388987c5223b54e), {
|
|
79
|
+
key: i,
|
|
80
|
+
segment: segment,
|
|
81
|
+
state: state,
|
|
82
|
+
isDisabled: isDisabled,
|
|
83
|
+
isReadOnly: isReadOnly,
|
|
84
|
+
isRequired: isRequired
|
|
85
|
+
})), /*#__PURE__*/ (0, $immgY$react).createElement("input", {
|
|
86
|
+
...inputProps,
|
|
87
|
+
ref: inputRef
|
|
88
|
+
})));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* TimeFields allow users to enter and edit time values using a keyboard.
|
|
92
|
+
* Each part of the time is displayed in an individually editable segment.
|
|
93
|
+
*/ const $f0a04554754386b6$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $immgY$react).forwardRef($f0a04554754386b6$var$TimeField);
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
export {$f0a04554754386b6$export$5eaee2322dd727eb as TimeField};
|
|
97
|
+
//# sourceMappingURL=TimeField.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,yCAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB;QACjB,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,gCAAC,CAAA,GAAA,yCAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,gCAAC,CAAA,GAAA,yCAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,gCAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef(null);\n let inputRef = useRef(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.module.js.map"}
|
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED