@react-spectrum/datepicker 3.12.0 → 3.13.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/dist/DateField.main.js +5 -5
- package/dist/DateField.mjs +5 -5
- package/dist/DateField.module.js +5 -5
- package/dist/DatePicker.main.js +7 -7
- package/dist/DatePicker.mjs +7 -7
- package/dist/DatePicker.module.js +7 -7
- package/dist/DatePickerField.main.js +2 -2
- package/dist/DatePickerField.main.js.map +1 -1
- package/dist/DatePickerField.mjs +2 -2
- package/dist/DatePickerField.module.js +2 -2
- package/dist/DatePickerField.module.js.map +1 -1
- package/dist/DatePickerSegment.main.js +2 -2
- package/dist/DatePickerSegment.main.js.map +1 -1
- package/dist/DatePickerSegment.mjs +2 -2
- package/dist/DatePickerSegment.module.js +2 -2
- package/dist/DatePickerSegment.module.js.map +1 -1
- package/dist/DateRangePicker.main.js +14 -9
- package/dist/DateRangePicker.main.js.map +1 -1
- package/dist/DateRangePicker.mjs +14 -9
- package/dist/DateRangePicker.module.js +14 -9
- package/dist/DateRangePicker.module.js.map +1 -1
- package/dist/Input.main.js +1 -1
- package/dist/Input.mjs +1 -1
- package/dist/Input.module.js +1 -1
- package/dist/TimeField.main.js +4 -4
- package/dist/TimeField.mjs +4 -4
- package/dist/TimeField.module.js +4 -4
- package/dist/inputgroup_vars_css.main.js +26 -26
- package/dist/inputgroup_vars_css.mjs +26 -26
- package/dist/inputgroup_vars_css.module.js +26 -26
- package/dist/{styles.d49f4d83.css → styles.cec10db3.css} +43 -44
- package/dist/styles.cec10db3.css.map +1 -0
- package/dist/styles_css.main.js +23 -23
- package/dist/styles_css.main.js.map +1 -1
- package/dist/styles_css.mjs +23 -23
- package/dist/styles_css.module.js +23 -23
- package/dist/styles_css.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js +44 -32
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +37 -29
- package/dist/utils.module.js +37 -29
- package/dist/utils.module.js.map +1 -1
- package/dist/{vars.cf48e391.css → vars.fb8d1a6e.css} +132 -132
- package/dist/{vars.cf48e391.css.map → vars.fb8d1a6e.css.map} +1 -1
- package/package.json +20 -20
- package/src/DatePickerField.tsx +2 -2
- package/src/DatePickerSegment.tsx +2 -2
- package/src/DateRangePicker.tsx +30 -28
- package/src/styles.css +3 -4
- package/src/{utils.ts → utils.tsx} +9 -7
- package/dist/styles.d49f4d83.css.map +0 -1
package/dist/DateField.main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var $edac158d20ebe4a9$exports = require("./DatePickerSegment.main.js");
|
|
2
|
-
require("./styles.
|
|
2
|
+
require("./styles.cec10db3.css");
|
|
3
3
|
var $91c3db8c6a21ca71$exports = require("./styles_css.main.js");
|
|
4
4
|
var $c3ebc4931d9b9977$exports = require("./Input.main.js");
|
|
5
|
-
var $
|
|
5
|
+
var $9d3b96715dbbb2b7$exports = require("./utils.main.js");
|
|
6
6
|
var $2sBGl$reactspectrumutils = require("@react-spectrum/utils");
|
|
7
7
|
var $2sBGl$internationalizeddate = require("@internationalized/date");
|
|
8
8
|
var $2sBGl$reactspectrumlabel = require("@react-spectrum/label");
|
|
@@ -50,7 +50,7 @@ const $1ab74d2cd1dc2e45$export$d9781c7894a82487 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
50
50
|
props = (0, $2sBGl$reactspectrumprovider.useProviderProps)(props);
|
|
51
51
|
props = (0, $2sBGl$reactspectrumform.useFormProps)(props);
|
|
52
52
|
let { autoFocus: autoFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, isQuiet: isQuiet } = props;
|
|
53
|
-
let domRef = (0, $
|
|
53
|
+
let domRef = (0, $9d3b96715dbbb2b7$exports.useFocusManagerRef)(ref);
|
|
54
54
|
let { locale: locale } = (0, $2sBGl$reactariai18n.useLocale)();
|
|
55
55
|
let state = (0, $2sBGl$reactstatelydatepicker.useDateFieldState)({
|
|
56
56
|
...props,
|
|
@@ -65,10 +65,10 @@ const $1ab74d2cd1dc2e45$export$d9781c7894a82487 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
65
65
|
}, state, fieldRef);
|
|
66
66
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
67
67
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
68
|
-
let description = (0, $
|
|
68
|
+
let description = (0, $9d3b96715dbbb2b7$exports.useFormatHelpText)(props);
|
|
69
69
|
if (description && !props.description) descriptionProps.id = undefined;
|
|
70
70
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
71
|
-
let approximateWidth = (0, $
|
|
71
|
+
let approximateWidth = (0, $9d3b96715dbbb2b7$exports.useFormattedDateWidth)(state) + 'ch';
|
|
72
72
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($2sBGl$react))).createElement((0, $2sBGl$reactspectrumlabel.Field), {
|
|
73
73
|
...props,
|
|
74
74
|
ref: domRef,
|
package/dist/DateField.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {DatePickerSegment as $cfa347761f172638$export$6388987c5223b54e} from "./DatePickerSegment.mjs";
|
|
2
|
-
import "./styles.
|
|
2
|
+
import "./styles.cec10db3.css";
|
|
3
3
|
import $6iHxC$styles_cssmodulejs from "./styles_css.mjs";
|
|
4
4
|
import {Input as $79348162c55d687f$export$f5b8910cec6cf069} from "./Input.mjs";
|
|
5
|
-
import {useFocusManagerRef as $
|
|
5
|
+
import {useFocusManagerRef as $ea94a5cfe92db3c2$export$71a23a36270e4bf0, useFormatHelpText as $ea94a5cfe92db3c2$export$322f4580ccd8dde6, useFormattedDateWidth as $ea94a5cfe92db3c2$export$31e22e3c931fc056} from "./utils.mjs";
|
|
6
6
|
import {classNames as $6iHxC$classNames} from "@react-spectrum/utils";
|
|
7
7
|
import {createCalendar as $6iHxC$createCalendar} from "@internationalized/date";
|
|
8
8
|
import {Field as $6iHxC$Field} from "@react-spectrum/label";
|
|
@@ -44,7 +44,7 @@ const $0129798af6791690$export$d9781c7894a82487 = /*#__PURE__*/ (0, $6iHxC$react
|
|
|
44
44
|
props = (0, $6iHxC$useProviderProps)(props);
|
|
45
45
|
props = (0, $6iHxC$useFormProps)(props);
|
|
46
46
|
let { autoFocus: autoFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, isQuiet: isQuiet } = props;
|
|
47
|
-
let domRef = (0, $
|
|
47
|
+
let domRef = (0, $ea94a5cfe92db3c2$export$71a23a36270e4bf0)(ref);
|
|
48
48
|
let { locale: locale } = (0, $6iHxC$useLocale)();
|
|
49
49
|
let state = (0, $6iHxC$useDateFieldState)({
|
|
50
50
|
...props,
|
|
@@ -59,10 +59,10 @@ const $0129798af6791690$export$d9781c7894a82487 = /*#__PURE__*/ (0, $6iHxC$react
|
|
|
59
59
|
}, state, fieldRef);
|
|
60
60
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
61
61
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
62
|
-
let description = (0, $
|
|
62
|
+
let description = (0, $ea94a5cfe92db3c2$export$322f4580ccd8dde6)(props);
|
|
63
63
|
if (description && !props.description) descriptionProps.id = undefined;
|
|
64
64
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
65
|
-
let approximateWidth = (0, $
|
|
65
|
+
let approximateWidth = (0, $ea94a5cfe92db3c2$export$31e22e3c931fc056)(state) + 'ch';
|
|
66
66
|
return /*#__PURE__*/ (0, $6iHxC$react).createElement((0, $6iHxC$Field), {
|
|
67
67
|
...props,
|
|
68
68
|
ref: domRef,
|
package/dist/DateField.module.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {DatePickerSegment as $cfa347761f172638$export$6388987c5223b54e} from "./DatePickerSegment.module.js";
|
|
2
|
-
import "./styles.
|
|
2
|
+
import "./styles.cec10db3.css";
|
|
3
3
|
import $6iHxC$styles_cssmodulejs from "./styles_css.module.js";
|
|
4
4
|
import {Input as $79348162c55d687f$export$f5b8910cec6cf069} from "./Input.module.js";
|
|
5
|
-
import {useFocusManagerRef as $
|
|
5
|
+
import {useFocusManagerRef as $ea94a5cfe92db3c2$export$71a23a36270e4bf0, useFormatHelpText as $ea94a5cfe92db3c2$export$322f4580ccd8dde6, useFormattedDateWidth as $ea94a5cfe92db3c2$export$31e22e3c931fc056} from "./utils.module.js";
|
|
6
6
|
import {classNames as $6iHxC$classNames} from "@react-spectrum/utils";
|
|
7
7
|
import {createCalendar as $6iHxC$createCalendar} from "@internationalized/date";
|
|
8
8
|
import {Field as $6iHxC$Field} from "@react-spectrum/label";
|
|
@@ -44,7 +44,7 @@ const $0129798af6791690$export$d9781c7894a82487 = /*#__PURE__*/ (0, $6iHxC$react
|
|
|
44
44
|
props = (0, $6iHxC$useProviderProps)(props);
|
|
45
45
|
props = (0, $6iHxC$useFormProps)(props);
|
|
46
46
|
let { autoFocus: autoFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, isQuiet: isQuiet } = props;
|
|
47
|
-
let domRef = (0, $
|
|
47
|
+
let domRef = (0, $ea94a5cfe92db3c2$export$71a23a36270e4bf0)(ref);
|
|
48
48
|
let { locale: locale } = (0, $6iHxC$useLocale)();
|
|
49
49
|
let state = (0, $6iHxC$useDateFieldState)({
|
|
50
50
|
...props,
|
|
@@ -59,10 +59,10 @@ const $0129798af6791690$export$d9781c7894a82487 = /*#__PURE__*/ (0, $6iHxC$react
|
|
|
59
59
|
}, state, fieldRef);
|
|
60
60
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
61
61
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
62
|
-
let description = (0, $
|
|
62
|
+
let description = (0, $ea94a5cfe92db3c2$export$322f4580ccd8dde6)(props);
|
|
63
63
|
if (description && !props.description) descriptionProps.id = undefined;
|
|
64
64
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
65
|
-
let approximateWidth = (0, $
|
|
65
|
+
let approximateWidth = (0, $ea94a5cfe92db3c2$export$31e22e3c931fc056)(state) + 'ch';
|
|
66
66
|
return /*#__PURE__*/ (0, $6iHxC$react).createElement((0, $6iHxC$Field), {
|
|
67
67
|
...props,
|
|
68
68
|
ref: domRef,
|
package/dist/DatePicker.main.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var $bd22dc8dad9522bc$exports = require("./DatePickerField.main.js");
|
|
2
|
-
require("./styles.
|
|
2
|
+
require("./styles.cec10db3.css");
|
|
3
3
|
var $91c3db8c6a21ca71$exports = require("./styles_css.main.js");
|
|
4
4
|
var $c3ebc4931d9b9977$exports = require("./Input.main.js");
|
|
5
5
|
var $0045b32a117743a7$exports = require("./intlStrings.main.js");
|
|
6
6
|
require("./vars.ba84240a.css");
|
|
7
7
|
require("./textfield_vars_css.main.js");
|
|
8
|
-
require("./vars.
|
|
8
|
+
require("./vars.fb8d1a6e.css");
|
|
9
9
|
var $2f86633ce5b04f1e$exports = require("./inputgroup_vars_css.main.js");
|
|
10
10
|
var $740ff83729a8f317$exports = require("./TimeField.main.js");
|
|
11
|
-
var $
|
|
11
|
+
var $9d3b96715dbbb2b7$exports = require("./utils.main.js");
|
|
12
12
|
var $2ni54$reactspectrumcalendar = require("@react-spectrum/calendar");
|
|
13
13
|
var $2ni54$spectrumiconsworkflowCalendar = require("@spectrum-icons/workflow/Calendar");
|
|
14
14
|
var $2ni54$reactspectrumutils = require("@react-spectrum/utils");
|
|
@@ -85,7 +85,7 @@ const $5c1ddf85d7c27889$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
85
85
|
let { groupProps: groupProps, labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $2ni54$reactariadatepicker.useDatePicker)(props, state, targetRef);
|
|
86
86
|
let { isOpen: isOpen, setOpen: setOpen } = state;
|
|
87
87
|
let { direction: direction } = (0, $2ni54$reactariai18n.useLocale)();
|
|
88
|
-
let domRef = (0, $
|
|
88
|
+
let domRef = (0, $9d3b96715dbbb2b7$exports.useFocusManagerRef)(ref);
|
|
89
89
|
let stringFormatter = (0, $2ni54$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($0045b32a117743a7$exports))), '@react-spectrum/datepicker');
|
|
90
90
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $2ni54$reactariafocus.useFocusRing)({
|
|
91
91
|
within: true,
|
|
@@ -111,7 +111,7 @@ const $5c1ddf85d7c27889$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
111
111
|
});
|
|
112
112
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
113
113
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
114
|
-
let description = (0, $
|
|
114
|
+
let description = (0, $9d3b96715dbbb2b7$exports.useFormatHelpText)(props);
|
|
115
115
|
if (description && !props.description) descriptionProps.id = undefined;
|
|
116
116
|
let placeholder = placeholderValue;
|
|
117
117
|
let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
|
|
@@ -119,9 +119,9 @@ const $5c1ddf85d7c27889$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
119
119
|
let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
|
|
120
120
|
let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
|
|
121
121
|
let showTimeField = !!timeGranularity;
|
|
122
|
-
let visibleMonths = (0, $
|
|
122
|
+
let visibleMonths = (0, $9d3b96715dbbb2b7$exports.useVisibleMonths)(maxVisibleMonths);
|
|
123
123
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
124
|
-
let approximateWidth = (0, $
|
|
124
|
+
let approximateWidth = (0, $9d3b96715dbbb2b7$exports.useFormattedDateWidth)(state) + 'ch';
|
|
125
125
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($2ni54$react))).createElement((0, $2ni54$reactspectrumlabel.Field), {
|
|
126
126
|
...props,
|
|
127
127
|
ref: domRef,
|
package/dist/DatePicker.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {DatePickerField as $d2bb88c82604b25f$export$34dc4cfa15ead1} from "./DatePickerField.mjs";
|
|
2
|
-
import "./styles.
|
|
2
|
+
import "./styles.cec10db3.css";
|
|
3
3
|
import $8czI1$styles_cssmodulejs from "./styles_css.mjs";
|
|
4
4
|
import {Input as $79348162c55d687f$export$f5b8910cec6cf069} from "./Input.mjs";
|
|
5
5
|
import $8czI1$intlStringsmodulejs from "./intlStrings.mjs";
|
|
6
6
|
import "./vars.ba84240a.css";
|
|
7
7
|
import "./textfield_vars_css.mjs";
|
|
8
|
-
import "./vars.
|
|
8
|
+
import "./vars.fb8d1a6e.css";
|
|
9
9
|
import $8czI1$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.mjs";
|
|
10
10
|
import {TimeField as $f0a04554754386b6$export$5eaee2322dd727eb} from "./TimeField.mjs";
|
|
11
|
-
import {useFocusManagerRef as $
|
|
11
|
+
import {useFocusManagerRef as $ea94a5cfe92db3c2$export$71a23a36270e4bf0, useFormatHelpText as $ea94a5cfe92db3c2$export$322f4580ccd8dde6, useFormattedDateWidth as $ea94a5cfe92db3c2$export$31e22e3c931fc056, useVisibleMonths as $ea94a5cfe92db3c2$export$12ce2869ce471b1f} from "./utils.mjs";
|
|
12
12
|
import {Calendar as $8czI1$Calendar} from "@react-spectrum/calendar";
|
|
13
13
|
import $8czI1$spectrumiconsworkflowCalendar from "@spectrum-icons/workflow/Calendar";
|
|
14
14
|
import {classNames as $8czI1$classNames} from "@react-spectrum/utils";
|
|
@@ -79,7 +79,7 @@ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8czI1$react
|
|
|
79
79
|
let { groupProps: groupProps, labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $8czI1$useDatePicker)(props, state, targetRef);
|
|
80
80
|
let { isOpen: isOpen, setOpen: setOpen } = state;
|
|
81
81
|
let { direction: direction } = (0, $8czI1$useLocale)();
|
|
82
|
-
let domRef = (0, $
|
|
82
|
+
let domRef = (0, $ea94a5cfe92db3c2$export$71a23a36270e4bf0)(ref);
|
|
83
83
|
let stringFormatter = (0, $8czI1$useLocalizedStringFormatter)((0, ($parcel$interopDefault($8czI1$intlStringsmodulejs))), '@react-spectrum/datepicker');
|
|
84
84
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $8czI1$useFocusRing)({
|
|
85
85
|
within: true,
|
|
@@ -105,7 +105,7 @@ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8czI1$react
|
|
|
105
105
|
});
|
|
106
106
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
107
107
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
108
|
-
let description = (0, $
|
|
108
|
+
let description = (0, $ea94a5cfe92db3c2$export$322f4580ccd8dde6)(props);
|
|
109
109
|
if (description && !props.description) descriptionProps.id = undefined;
|
|
110
110
|
let placeholder = placeholderValue;
|
|
111
111
|
let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
|
|
@@ -113,9 +113,9 @@ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8czI1$react
|
|
|
113
113
|
let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
|
|
114
114
|
let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
|
|
115
115
|
let showTimeField = !!timeGranularity;
|
|
116
|
-
let visibleMonths = (0, $
|
|
116
|
+
let visibleMonths = (0, $ea94a5cfe92db3c2$export$12ce2869ce471b1f)(maxVisibleMonths);
|
|
117
117
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
118
|
-
let approximateWidth = (0, $
|
|
118
|
+
let approximateWidth = (0, $ea94a5cfe92db3c2$export$31e22e3c931fc056)(state) + 'ch';
|
|
119
119
|
return /*#__PURE__*/ (0, $8czI1$react).createElement((0, $8czI1$Field), {
|
|
120
120
|
...props,
|
|
121
121
|
ref: domRef,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {DatePickerField as $d2bb88c82604b25f$export$34dc4cfa15ead1} from "./DatePickerField.module.js";
|
|
2
|
-
import "./styles.
|
|
2
|
+
import "./styles.cec10db3.css";
|
|
3
3
|
import $8czI1$styles_cssmodulejs from "./styles_css.module.js";
|
|
4
4
|
import {Input as $79348162c55d687f$export$f5b8910cec6cf069} from "./Input.module.js";
|
|
5
5
|
import $8czI1$intlStringsmodulejs from "./intlStrings.module.js";
|
|
6
6
|
import "./vars.ba84240a.css";
|
|
7
7
|
import "./textfield_vars_css.module.js";
|
|
8
|
-
import "./vars.
|
|
8
|
+
import "./vars.fb8d1a6e.css";
|
|
9
9
|
import $8czI1$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.module.js";
|
|
10
10
|
import {TimeField as $f0a04554754386b6$export$5eaee2322dd727eb} from "./TimeField.module.js";
|
|
11
|
-
import {useFocusManagerRef as $
|
|
11
|
+
import {useFocusManagerRef as $ea94a5cfe92db3c2$export$71a23a36270e4bf0, useFormatHelpText as $ea94a5cfe92db3c2$export$322f4580ccd8dde6, useFormattedDateWidth as $ea94a5cfe92db3c2$export$31e22e3c931fc056, useVisibleMonths as $ea94a5cfe92db3c2$export$12ce2869ce471b1f} from "./utils.module.js";
|
|
12
12
|
import {Calendar as $8czI1$Calendar} from "@react-spectrum/calendar";
|
|
13
13
|
import $8czI1$spectrumiconsworkflowCalendar from "@spectrum-icons/workflow/Calendar";
|
|
14
14
|
import {classNames as $8czI1$classNames} from "@react-spectrum/utils";
|
|
@@ -79,7 +79,7 @@ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8czI1$react
|
|
|
79
79
|
let { groupProps: groupProps, labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $8czI1$useDatePicker)(props, state, targetRef);
|
|
80
80
|
let { isOpen: isOpen, setOpen: setOpen } = state;
|
|
81
81
|
let { direction: direction } = (0, $8czI1$useLocale)();
|
|
82
|
-
let domRef = (0, $
|
|
82
|
+
let domRef = (0, $ea94a5cfe92db3c2$export$71a23a36270e4bf0)(ref);
|
|
83
83
|
let stringFormatter = (0, $8czI1$useLocalizedStringFormatter)((0, ($parcel$interopDefault($8czI1$intlStringsmodulejs))), '@react-spectrum/datepicker');
|
|
84
84
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $8czI1$useFocusRing)({
|
|
85
85
|
within: true,
|
|
@@ -105,7 +105,7 @@ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8czI1$react
|
|
|
105
105
|
});
|
|
106
106
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
107
107
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
108
|
-
let description = (0, $
|
|
108
|
+
let description = (0, $ea94a5cfe92db3c2$export$322f4580ccd8dde6)(props);
|
|
109
109
|
if (description && !props.description) descriptionProps.id = undefined;
|
|
110
110
|
let placeholder = placeholderValue;
|
|
111
111
|
let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
|
|
@@ -113,9 +113,9 @@ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8czI1$react
|
|
|
113
113
|
let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
|
|
114
114
|
let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
|
|
115
115
|
let showTimeField = !!timeGranularity;
|
|
116
|
-
let visibleMonths = (0, $
|
|
116
|
+
let visibleMonths = (0, $ea94a5cfe92db3c2$export$12ce2869ce471b1f)(maxVisibleMonths);
|
|
117
117
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
118
|
-
let approximateWidth = (0, $
|
|
118
|
+
let approximateWidth = (0, $ea94a5cfe92db3c2$export$31e22e3c931fc056)(state) + 'ch';
|
|
119
119
|
return /*#__PURE__*/ (0, $8czI1$react).createElement((0, $8czI1$Field), {
|
|
120
120
|
...props,
|
|
121
121
|
ref: domRef,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var $edac158d20ebe4a9$exports = require("./DatePickerSegment.main.js");
|
|
2
|
-
require("./styles.
|
|
2
|
+
require("./styles.cec10db3.css");
|
|
3
3
|
var $91c3db8c6a21ca71$exports = require("./styles_css.main.js");
|
|
4
4
|
var $g7Fnj$reactspectrumutils = require("@react-spectrum/utils");
|
|
5
5
|
var $g7Fnj$internationalizeddate = require("@internationalized/date");
|
|
@@ -50,7 +50,7 @@ function $bd22dc8dad9522bc$export$34dc4cfa15ead1(props) {
|
|
|
50
50
|
...props,
|
|
51
51
|
inputRef: inputRef
|
|
52
52
|
}, state, ref);
|
|
53
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($g7Fnj$react))).createElement("
|
|
53
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($g7Fnj$react))).createElement("span", {
|
|
54
54
|
...fieldProps,
|
|
55
55
|
"data-testid": props['data-testid'],
|
|
56
56
|
className: (0, $g7Fnj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-segments', inputClassName),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AA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AA,GAAA,2CAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAGlC","sources":["packages/@react-spectrum/datepicker/src/DatePickerField.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 {createCalendar} from '@internationalized/date';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDatePickerProps} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport {useDateField} from '@react-aria/datepicker';\nimport {useDateFieldState} from '@react-stately/datepicker';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface DatePickerFieldProps<T extends DateValue> extends SpectrumDatePickerProps<T> {\n inputClassName?: string,\n hideValidationIcon?: boolean,\n maxGranularity?: SpectrumDatePickerProps<T>['granularity']\n}\n\nexport function DatePickerField<T extends DateValue>(props: DatePickerFieldProps<T>) {\n let {\n isDisabled,\n isReadOnly,\n isRequired,\n inputClassName\n } = props;\n let ref = useRef<HTMLDivElement | null>(null);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar\n });\n\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {fieldProps, inputProps} = useDateField({...props, inputRef}, state, ref);\n\n return (\n <span {...fieldProps} data-testid={props['data-testid']} className={classNames(datepickerStyles, 'react-spectrum-Datepicker-segments', inputClassName)} ref={ref}>\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 </span>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerField.main.js.map"}
|
package/dist/DatePickerField.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {DatePickerSegment as $cfa347761f172638$export$6388987c5223b54e} from "./DatePickerSegment.mjs";
|
|
2
|
-
import "./styles.
|
|
2
|
+
import "./styles.cec10db3.css";
|
|
3
3
|
import $332Ed$styles_cssmodulejs from "./styles_css.mjs";
|
|
4
4
|
import {classNames as $332Ed$classNames} from "@react-spectrum/utils";
|
|
5
5
|
import {createCalendar as $332Ed$createCalendar} from "@internationalized/date";
|
|
@@ -44,7 +44,7 @@ function $d2bb88c82604b25f$export$34dc4cfa15ead1(props) {
|
|
|
44
44
|
...props,
|
|
45
45
|
inputRef: inputRef
|
|
46
46
|
}, state, ref);
|
|
47
|
-
return /*#__PURE__*/ (0, $332Ed$react).createElement("
|
|
47
|
+
return /*#__PURE__*/ (0, $332Ed$react).createElement("span", {
|
|
48
48
|
...fieldProps,
|
|
49
49
|
"data-testid": props['data-testid'],
|
|
50
50
|
className: (0, $332Ed$classNames)((0, ($parcel$interopDefault($332Ed$styles_cssmodulejs))), 'react-spectrum-Datepicker-segments', inputClassName),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {DatePickerSegment as $cfa347761f172638$export$6388987c5223b54e} from "./DatePickerSegment.module.js";
|
|
2
|
-
import "./styles.
|
|
2
|
+
import "./styles.cec10db3.css";
|
|
3
3
|
import $332Ed$styles_cssmodulejs from "./styles_css.module.js";
|
|
4
4
|
import {classNames as $332Ed$classNames} from "@react-spectrum/utils";
|
|
5
5
|
import {createCalendar as $332Ed$createCalendar} from "@internationalized/date";
|
|
@@ -44,7 +44,7 @@ function $d2bb88c82604b25f$export$34dc4cfa15ead1(props) {
|
|
|
44
44
|
...props,
|
|
45
45
|
inputRef: inputRef
|
|
46
46
|
}, state, ref);
|
|
47
|
-
return /*#__PURE__*/ (0, $332Ed$react).createElement("
|
|
47
|
+
return /*#__PURE__*/ (0, $332Ed$react).createElement("span", {
|
|
48
48
|
...fieldProps,
|
|
49
49
|
"data-testid": props['data-testid'],
|
|
50
50
|
className: (0, $332Ed$classNames)((0, ($parcel$interopDefault($332Ed$styles_cssmodulejs))), 'react-spectrum-Datepicker-segments', inputClassName),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBM,SAAS,wCAAqC,KAA8B;IACjF,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,kBACV,cAAc,EACf,GAAG;IACJ,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAAC,GAAG,KAAK;kBAAE;IAAQ,GAAG,OAAO;IAEzE,qBACE,gCAAC;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBM,SAAS,wCAAqC,KAA8B;IACjF,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,kBACV,cAAc,EACf,GAAG;IACJ,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAAC,GAAG,KAAK;kBAAE;IAAQ,GAAG,OAAO;IAEzE,qBACE,gCAAC;QAAM,GAAG,UAAU;QAAE,eAAa,KAAK,CAAC,cAAc;QAAE,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,sCAAsC;QAAiB,KAAK;OAC1J,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;;AAGlC","sources":["packages/@react-spectrum/datepicker/src/DatePickerField.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 {createCalendar} from '@internationalized/date';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDatePickerProps} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport {useDateField} from '@react-aria/datepicker';\nimport {useDateFieldState} from '@react-stately/datepicker';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface DatePickerFieldProps<T extends DateValue> extends SpectrumDatePickerProps<T> {\n inputClassName?: string,\n hideValidationIcon?: boolean,\n maxGranularity?: SpectrumDatePickerProps<T>['granularity']\n}\n\nexport function DatePickerField<T extends DateValue>(props: DatePickerFieldProps<T>) {\n let {\n isDisabled,\n isReadOnly,\n isRequired,\n inputClassName\n } = props;\n let ref = useRef<HTMLDivElement | null>(null);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar\n });\n\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {fieldProps, inputProps} = useDateField({...props, inputRef}, state, ref);\n\n return (\n <span {...fieldProps} data-testid={props['data-testid']} className={classNames(datepickerStyles, 'react-spectrum-Datepicker-segments', inputClassName)} ref={ref}>\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 </span>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerField.module.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("./styles.
|
|
1
|
+
require("./styles.cec10db3.css");
|
|
2
2
|
var $91c3db8c6a21ca71$exports = require("./styles_css.main.js");
|
|
3
3
|
var $9PhAi$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
4
|
var $9PhAi$react = require("react");
|
|
@@ -54,7 +54,7 @@ function $edac158d20ebe4a9$var$LiteralSegment({ segment: segment }) {
|
|
|
54
54
|
function $edac158d20ebe4a9$var$EditableSegment({ segment: segment, state: state }) {
|
|
55
55
|
let ref = (0, $9PhAi$react.useRef)(null);
|
|
56
56
|
let { segmentProps: segmentProps } = (0, $9PhAi$reactariadatepicker.useDateSegment)(segment, state, ref);
|
|
57
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($9PhAi$react))).createElement("
|
|
57
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($9PhAi$react))).createElement("span", {
|
|
58
58
|
...segmentProps,
|
|
59
59
|
ref: ref,
|
|
60
60
|
className: (0, $9PhAi$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-DatePicker-cell', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,0DAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,0DAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,0DAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAyB;IACxC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,0DAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,0DAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.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 {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef<HTMLDivElement | null>(null);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,0DAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,0DAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,0DAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAyB;IACxC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,0DAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,0DAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.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 {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef<HTMLDivElement | null>(null);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <span\n {...segmentProps}\n ref={ref}\n className={classNames(styles, 'react-spectrum-DatePicker-cell', {\n 'is-placeholder': segment.isPlaceholder,\n 'is-read-only': !segment.isEditable\n })}\n style={segmentProps.style}\n data-testid={segment.type}>\n {segment.isPlaceholder ? <span aria-hidden=\"true\" className={classNames(styles, 'react-spectrum-DatePicker-placeholder')}>{segment.placeholder}</span> : segment.text}\n </span>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerSegment.main.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./styles.
|
|
1
|
+
import "./styles.cec10db3.css";
|
|
2
2
|
import $jOVo7$styles_cssmodulejs from "./styles_css.mjs";
|
|
3
3
|
import {classNames as $jOVo7$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import $jOVo7$react, {useRef as $jOVo7$useRef} from "react";
|
|
@@ -48,7 +48,7 @@ function $cfa347761f172638$var$LiteralSegment({ segment: segment }) {
|
|
|
48
48
|
function $cfa347761f172638$var$EditableSegment({ segment: segment, state: state }) {
|
|
49
49
|
let ref = (0, $jOVo7$useRef)(null);
|
|
50
50
|
let { segmentProps: segmentProps } = (0, $jOVo7$useDateSegment)(segment, state, ref);
|
|
51
|
-
return /*#__PURE__*/ (0, $jOVo7$react).createElement("
|
|
51
|
+
return /*#__PURE__*/ (0, $jOVo7$react).createElement("span", {
|
|
52
52
|
...segmentProps,
|
|
53
53
|
ref: ref,
|
|
54
54
|
className: (0, $jOVo7$classNames)((0, ($parcel$interopDefault($jOVo7$styles_cssmodulejs))), 'react-spectrum-DatePicker-cell', {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./styles.
|
|
1
|
+
import "./styles.cec10db3.css";
|
|
2
2
|
import $jOVo7$styles_cssmodulejs from "./styles_css.module.js";
|
|
3
3
|
import {classNames as $jOVo7$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import $jOVo7$react, {useRef as $jOVo7$useRef} from "react";
|
|
@@ -48,7 +48,7 @@ function $cfa347761f172638$var$LiteralSegment({ segment: segment }) {
|
|
|
48
48
|
function $cfa347761f172638$var$EditableSegment({ segment: segment, state: state }) {
|
|
49
49
|
let ref = (0, $jOVo7$useRef)(null);
|
|
50
50
|
let { segmentProps: segmentProps } = (0, $jOVo7$useDateSegment)(segment, state, ref);
|
|
51
|
-
return /*#__PURE__*/ (0, $jOVo7$react).createElement("
|
|
51
|
+
return /*#__PURE__*/ (0, $jOVo7$react).createElement("span", {
|
|
52
52
|
...segmentProps,
|
|
53
53
|
ref: ref,
|
|
54
54
|
className: (0, $jOVo7$classNames)((0, ($parcel$interopDefault($jOVo7$styles_cssmodulejs))), 'react-spectrum-DatePicker-cell', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,gCAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,gCAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,gCAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,gCAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,gCAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.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 {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef<HTMLDivElement | null>(null);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,gCAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,gCAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,gCAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,gCAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,gCAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.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 {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef<HTMLDivElement | null>(null);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <span\n {...segmentProps}\n ref={ref}\n className={classNames(styles, 'react-spectrum-DatePicker-cell', {\n 'is-placeholder': segment.isPlaceholder,\n 'is-read-only': !segment.isEditable\n })}\n style={segmentProps.style}\n data-testid={segment.type}>\n {segment.isPlaceholder ? <span aria-hidden=\"true\" className={classNames(styles, 'react-spectrum-DatePicker-placeholder')}>{segment.placeholder}</span> : segment.text}\n </span>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerSegment.module.js.map"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var $bd22dc8dad9522bc$exports = require("./DatePickerField.main.js");
|
|
2
|
-
require("./styles.
|
|
2
|
+
require("./styles.cec10db3.css");
|
|
3
3
|
var $91c3db8c6a21ca71$exports = require("./styles_css.main.js");
|
|
4
4
|
var $c3ebc4931d9b9977$exports = require("./Input.main.js");
|
|
5
5
|
var $0045b32a117743a7$exports = require("./intlStrings.main.js");
|
|
6
|
-
require("./vars.
|
|
6
|
+
require("./vars.fb8d1a6e.css");
|
|
7
7
|
var $2f86633ce5b04f1e$exports = require("./inputgroup_vars_css.main.js");
|
|
8
8
|
var $740ff83729a8f317$exports = require("./TimeField.main.js");
|
|
9
|
-
var $
|
|
9
|
+
var $9d3b96715dbbb2b7$exports = require("./utils.main.js");
|
|
10
10
|
var $56Vum$spectrumiconsworkflowCalendar = require("@spectrum-icons/workflow/Calendar");
|
|
11
11
|
var $56Vum$reactspectrumutils = require("@react-spectrum/utils");
|
|
12
12
|
var $56Vum$reactspectrumview = require("@react-spectrum/view");
|
|
@@ -85,7 +85,7 @@ const $16cafb71dac155a4$export$17334619f3ac2224 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
85
85
|
let { labelProps: labelProps, groupProps: groupProps, buttonProps: buttonProps, dialogProps: dialogProps, startFieldProps: startFieldProps, endFieldProps: endFieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, calendarProps: calendarProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $56Vum$reactariadatepicker.useDateRangePicker)(props, state, targetRef);
|
|
86
86
|
let { isOpen: isOpen, setOpen: setOpen } = state;
|
|
87
87
|
let { direction: direction } = (0, $56Vum$reactariai18n.useLocale)();
|
|
88
|
-
let domRef = (0, $
|
|
88
|
+
let domRef = (0, $9d3b96715dbbb2b7$exports.useFocusManagerRef)(ref);
|
|
89
89
|
let stringFormatter = (0, $56Vum$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($0045b32a117743a7$exports))), '@react-spectrum/datepicker');
|
|
90
90
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $56Vum$reactariafocus.useFocusRing)({
|
|
91
91
|
within: true,
|
|
@@ -111,7 +111,7 @@ const $16cafb71dac155a4$export$17334619f3ac2224 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
111
111
|
});
|
|
112
112
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
113
113
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
114
|
-
let description = (0, $
|
|
114
|
+
let description = (0, $9d3b96715dbbb2b7$exports.useFormatHelpText)(props);
|
|
115
115
|
if (description && !props.description) descriptionProps.id = undefined;
|
|
116
116
|
let placeholder = placeholderValue;
|
|
117
117
|
let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
|
|
@@ -119,10 +119,10 @@ const $16cafb71dac155a4$export$17334619f3ac2224 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
119
119
|
let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
|
|
120
120
|
let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
|
|
121
121
|
let showTimeField = !!timeGranularity;
|
|
122
|
-
let visibleMonths = (0, $
|
|
122
|
+
let visibleMonths = (0, $9d3b96715dbbb2b7$exports.useVisibleMonths)(maxVisibleMonths);
|
|
123
123
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
124
124
|
// Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash
|
|
125
|
-
let approximateWidth = `calc(${(0, $
|
|
125
|
+
let approximateWidth = `calc(${(0, $9d3b96715dbbb2b7$exports.useFormattedDateWidth)(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;
|
|
126
126
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumlabel.Field), {
|
|
127
127
|
...props,
|
|
128
128
|
ref: domRef,
|
|
@@ -140,6 +140,11 @@ const $16cafb71dac155a4$export$17334619f3ac2224 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
140
140
|
...(0, $56Vum$reactariautils.mergeProps)(groupProps, hoverProps, focusProps),
|
|
141
141
|
className: className,
|
|
142
142
|
ref: targetRef
|
|
143
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement("div", {
|
|
144
|
+
style: {
|
|
145
|
+
overflow: 'hidden',
|
|
146
|
+
width: '100%'
|
|
147
|
+
}
|
|
143
148
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $c3ebc4931d9b9977$exports.Input), {
|
|
144
149
|
isDisabled: isDisabled,
|
|
145
150
|
isQuiet: isQuiet,
|
|
@@ -158,7 +163,7 @@ const $16cafb71dac155a4$export$17334619f3ac2224 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
158
163
|
"data-testid": "end-date",
|
|
159
164
|
isQuiet: props.isQuiet,
|
|
160
165
|
inputClassName: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-Datepicker-endField', (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-endField'))
|
|
161
|
-
})), /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumdialog.DialogTrigger), {
|
|
166
|
+
}))), /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumdialog.DialogTrigger), {
|
|
162
167
|
type: "popover",
|
|
163
168
|
mobileType: "tray",
|
|
164
169
|
placement: direction === 'rtl' ? 'bottom right' : 'bottom left',
|
|
@@ -214,7 +219,7 @@ const $16cafb71dac155a4$export$17334619f3ac2224 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
214
219
|
}))))))));
|
|
215
220
|
});
|
|
216
221
|
function $16cafb71dac155a4$var$DateRangeDash() {
|
|
217
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement("
|
|
222
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement("span", {
|
|
218
223
|
"aria-hidden": "true",
|
|
219
224
|
"data-testid": "date-range-dash",
|
|
220
225
|
className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-rangeDash')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;AAkCM,MAAM,0DAAkB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,gBAAqC,KAAsC,E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;QACV,GAAG,aAAa;QACjB,eAAe;QACf,cAAc;QACd,gBAAgB;QAChB,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,sCAAsC;YAAC,cAAc,oBAAoB;QAAS;QAClI,+BACC,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAI;QAAW,WAAU;QAAW,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBACvF,0DAAC,CAAA,GAAA,mCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,EAAA,mBAAA,MAAM,SAAS,cAAf,uCAAA,iBAAiB,KAAK,KAAI;QACjC,UAAU,CAAA,IAAK,MAAM,OAAO,CAAC,SAAS;QACtC,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;sBACF,0DAAC,CAAA,GAAA,mCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,EAAA,oBAAA,MAAM,SAAS,cAAf,wCAAA,kBAAiB,GAAG,KAAI;QAC/B,UAAU,CAAA,IAAK,MAAM,OAAO,CAAC,OAAO;QACpC,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;;AAUtB;AAEA,SAAS;IACP,qBACE,0DAAC;QACC,eAAY;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;;AAE9C","sources":["packages/@react-spectrum/datepicker/src/DateRangePicker.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 CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDateRangePickerProps} from '@react-types/datepicker';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {Flex} from '@react-spectrum/layout';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {RangeCalendar} from '@react-spectrum/calendar';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePicker} from '@react-aria/datepicker';\nimport {useDateRangePickerState} from '@react-stately/datepicker';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * DateRangePickers combine two DateFields and a RangeCalendar popover to allow users\n * to enter or select a date and time range.\n */\nexport const DateRangePicker = React.forwardRef(function DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isQuiet,\n isDisabled,\n autoFocus,\n placeholderValue,\n maxVisibleMonths = 1,\n pageBehavior,\n firstDayOfWeek\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDateRangePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {labelProps, groupProps, buttonProps, dialogProps, startFieldProps, endFieldProps, descriptionProps, errorMessageProps, calendarProps, isInvalid, validationErrors, validationDetails} = useDateRangePicker(props, state, targetRef);\n let {isOpen, setOpen} = state;\n let {direction} = useLocale();\n let domRef = useFocusManagerRef(ref);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/datepicker');\n\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true,\n isTextInput: true,\n autoFocus\n });\n\n let {isFocused: isFocusedButton, focusProps: focusPropsButton} = useFocusRing({\n within: false,\n isTextInput: false,\n autoFocus\n });\n\n let className = classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'focus-ring': isFocusVisible && !isFocusedButton\n }\n );\n\n let fieldClassName = classNames(\n styles,\n 'spectrum-InputGroup-input',\n {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\n }\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = undefined;\n }\n\n let placeholder: DateValue | null | undefined = placeholderValue;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;\n let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash\n let approximateWidth = `calc(${useFormattedDateWidth(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\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-Datepicker-fieldWrapper')}>\n <div\n {...mergeProps(groupProps, hoverProps, focusProps)}\n className={className}\n ref={targetRef}>\n <Input\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n className={classNames(styles, 'spectrum-InputGroup-field')}\n inputClassName={fieldClassName}\n disableFocusRing\n minWidth={approximateWidth}>\n <DatePickerField\n {...startFieldProps}\n data-testid=\"start-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-startField')} />\n <DateRangeDash />\n <DatePickerField\n {...endFieldProps}\n data-testid=\"end-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(\n styles,\n 'spectrum-Datepicker-endField',\n classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-endField'\n )\n )} />\n </Input>\n <DialogTrigger\n type=\"popover\"\n mobileType=\"tray\"\n placement={direction === 'rtl' ? 'bottom right' : 'bottom left'}\n targetRef={targetRef}\n hideArrow\n isOpen={isOpen}\n onOpenChange={setOpen}\n shouldFlip={props.shouldFlip}>\n <FieldButton\n {...mergeProps(buttonProps, focusPropsButton)}\n UNSAFE_className={classNames(styles, 'spectrum-FieldButton')}\n isQuiet={isQuiet}\n validationState={validationState}>\n <CalendarIcon />\n </FieldButton>\n <Dialog UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')} {...dialogProps}>\n <Content>\n <div className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n pageBehavior={pageBehavior}\n firstDayOfWeek={firstDayOfWeek}\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-calendar', {'is-invalid': validationState === 'invalid'})} />\n {showTimeField &&\n <Flex gap=\"size-100\" marginTop=\"size-100\" UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-timeFields')}>\n <TimeField\n label={stringFormatter.format('startTime')}\n value={state.timeRange?.start || null}\n onChange={v => state.setTime('start', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n <TimeField\n label={stringFormatter.format('endTime')}\n value={state.timeRange?.end || null}\n onChange={v => state.setTime('end', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n </Flex>\n }\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\nfunction DateRangeDash() {\n return (\n <div\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')} />\n );\n}\n"],"names":[],"version":3,"file":"DateRangePicker.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;AAkCM,MAAM,0DAAkB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,gBAAqC,KAAsC,EAAE,GAA8B;QA0JvI,kBAWA;IApK3B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IAC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B;QAChB,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,sCAAsC;YAAC,cAAc,oBAAoB;QAAS;QAClI,+BACC,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAI;QAAW,WAAU;QAAW,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBACvF,0DAAC,CAAA,GAAA,mCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,EAAA,mBAAA,MAAM,SAAS,cAAf,uCAAA,iBAAiB,KAAK,KAAI;QACjC,UAAU,CAAA,IAAK,MAAM,OAAO,CAAC,SAAS;QACtC,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;sBACF,0DAAC,CAAA,GAAA,mCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,EAAA,oBAAA,MAAM,SAAS,cAAf,wCAAA,kBAAiB,GAAG,KAAI;QAC/B,UAAU,CAAA,IAAK,MAAM,OAAO,CAAC,OAAO;QACpC,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;;AAUtB;AAEA,SAAS;IACP,qBACE,0DAAC;QACC,eAAY;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;;AAE9C","sources":["packages/@react-spectrum/datepicker/src/DateRangePicker.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 CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDateRangePickerProps} from '@react-types/datepicker';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {Flex} from '@react-spectrum/layout';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {RangeCalendar} from '@react-spectrum/calendar';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePicker} from '@react-aria/datepicker';\nimport {useDateRangePickerState} from '@react-stately/datepicker';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * DateRangePickers combine two DateFields and a RangeCalendar popover to allow users\n * to enter or select a date and time range.\n */\nexport const DateRangePicker = React.forwardRef(function DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isQuiet,\n isDisabled,\n autoFocus,\n placeholderValue,\n maxVisibleMonths = 1,\n pageBehavior,\n firstDayOfWeek\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDateRangePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {labelProps, groupProps, buttonProps, dialogProps, startFieldProps, endFieldProps, descriptionProps, errorMessageProps, calendarProps, isInvalid, validationErrors, validationDetails} = useDateRangePicker(props, state, targetRef);\n let {isOpen, setOpen} = state;\n let {direction} = useLocale();\n let domRef = useFocusManagerRef(ref);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/datepicker');\n\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true,\n isTextInput: true,\n autoFocus\n });\n\n let {isFocused: isFocusedButton, focusProps: focusPropsButton} = useFocusRing({\n within: false,\n isTextInput: false,\n autoFocus\n });\n\n let className = classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'focus-ring': isFocusVisible && !isFocusedButton\n }\n );\n\n let fieldClassName = classNames(\n styles,\n 'spectrum-InputGroup-input',\n {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\n }\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = undefined;\n }\n\n let placeholder: DateValue | null | undefined = placeholderValue;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;\n let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash\n let approximateWidth = `calc(${useFormattedDateWidth(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\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-Datepicker-fieldWrapper')}>\n <div\n {...mergeProps(groupProps, hoverProps, focusProps)}\n className={className}\n ref={targetRef}>\n <div style={{overflow: 'hidden', width: '100%'}}>\n <Input\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n className={classNames(styles, 'spectrum-InputGroup-field')}\n inputClassName={fieldClassName}\n disableFocusRing\n minWidth={approximateWidth}>\n <DatePickerField\n {...startFieldProps}\n data-testid=\"start-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-startField')} />\n <DateRangeDash />\n <DatePickerField\n {...endFieldProps}\n data-testid=\"end-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(\n styles,\n 'spectrum-Datepicker-endField',\n classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-endField'\n )\n )} />\n </Input>\n </div>\n <DialogTrigger\n type=\"popover\"\n mobileType=\"tray\"\n placement={direction === 'rtl' ? 'bottom right' : 'bottom left'}\n targetRef={targetRef}\n hideArrow\n isOpen={isOpen}\n onOpenChange={setOpen}\n shouldFlip={props.shouldFlip}>\n <FieldButton\n {...mergeProps(buttonProps, focusPropsButton)}\n UNSAFE_className={classNames(styles, 'spectrum-FieldButton')}\n isQuiet={isQuiet}\n validationState={validationState}>\n <CalendarIcon />\n </FieldButton>\n <Dialog UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')} {...dialogProps}>\n <Content>\n <div className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n pageBehavior={pageBehavior}\n firstDayOfWeek={firstDayOfWeek}\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-calendar', {'is-invalid': validationState === 'invalid'})} />\n {showTimeField &&\n <Flex gap=\"size-100\" marginTop=\"size-100\" UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-timeFields')}>\n <TimeField\n label={stringFormatter.format('startTime')}\n value={state.timeRange?.start || null}\n onChange={v => state.setTime('start', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n <TimeField\n label={stringFormatter.format('endTime')}\n value={state.timeRange?.end || null}\n onChange={v => state.setTime('end', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n </Flex>\n }\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\nfunction DateRangeDash() {\n return (\n <span\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')} />\n );\n}\n"],"names":[],"version":3,"file":"DateRangePicker.main.js.map"}
|