@react-spectrum/datepicker 3.9.5 → 3.9.6
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 +3 -3
- package/dist/DateField.mjs +4 -4
- package/dist/DateField.module.js +3 -3
- package/dist/DatePicker.main.js +26 -26
- package/dist/DatePicker.mjs +27 -27
- package/dist/DatePicker.module.js +26 -26
- package/dist/DatePickerField.main.js +2 -2
- package/dist/DatePickerField.mjs +3 -3
- package/dist/DatePickerField.module.js +2 -2
- package/dist/DatePickerSegment.main.js +9 -9
- package/dist/DatePickerSegment.mjs +10 -10
- package/dist/DatePickerSegment.module.js +9 -9
- package/dist/DateRangePicker.main.js +32 -32
- package/dist/DateRangePicker.mjs +33 -33
- package/dist/DateRangePicker.module.js +32 -32
- package/dist/Input.main.js +16 -16
- package/dist/Input.mjs +17 -17
- package/dist/Input.module.js +16 -16
- package/dist/TimeField.main.js +3 -3
- package/dist/TimeField.mjs +4 -4
- package/dist/TimeField.module.js +3 -3
- 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/inputgroup_vars_css.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- 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/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_css.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/textfield_vars_css.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/utils.main.js +10 -10
- package/dist/utils.mjs +11 -11
- package/dist/utils.module.js +10 -10
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +21 -21
package/dist/Input.mjs
CHANGED
|
@@ -71,29 +71,29 @@ function $79348162c55d687f$var$Input(props, ref) {
|
|
|
71
71
|
// when there is enough space for the padding to be re-added. Ideally we'd
|
|
72
72
|
// use a resize observer on a parent element, but it's hard to know _what_
|
|
73
73
|
// parent element.
|
|
74
|
-
(0, $fVzF9$useEvent)((0, $fVzF9$useRef)(typeof window !==
|
|
74
|
+
(0, $fVzF9$useEvent)((0, $fVzF9$useRef)(typeof window !== 'undefined' ? window : null), 'resize', onResize);
|
|
75
75
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible, isFocused: isFocused } = (0, $fVzF9$useFocusRing)({
|
|
76
76
|
isTextInput: true,
|
|
77
77
|
within: true
|
|
78
78
|
});
|
|
79
|
-
let isInvalid = validationState ===
|
|
80
|
-
let textfieldClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))),
|
|
86
|
-
let inputClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))),
|
|
90
|
-
let iconClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))),
|
|
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
91
|
let validationIcon = null;
|
|
92
|
-
if (validationState ===
|
|
92
|
+
if (validationState === 'invalid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiAlertMedium), {
|
|
93
93
|
"data-testid": "invalid-icon",
|
|
94
94
|
UNSAFE_className: iconClass
|
|
95
95
|
});
|
|
96
|
-
else if (validationState ===
|
|
96
|
+
else if (validationState === 'valid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiCheckmarkMedium), {
|
|
97
97
|
"data-testid": "valid-icon",
|
|
98
98
|
UNSAFE_className: iconClass
|
|
99
99
|
});
|
|
@@ -107,7 +107,7 @@ function $79348162c55d687f$var$Input(props, ref) {
|
|
|
107
107
|
className: inputClass
|
|
108
108
|
}, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
109
109
|
role: "presentation",
|
|
110
|
-
className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))),
|
|
110
|
+
className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), 'react-spectrum-Datepicker-inputContents'),
|
|
111
111
|
ref: (0, $fVzF9$mergeRefs)(ref, inputRef)
|
|
112
112
|
}, children)), validationIcon);
|
|
113
113
|
}
|
|
@@ -115,4 +115,4 @@ const $79348162c55d687f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $fVzF9$react
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
export {$79348162c55d687f$export$f5b8910cec6cf069 as Input};
|
|
118
|
-
//# sourceMappingURL=Input.
|
|
118
|
+
//# sourceMappingURL=Input.module.js.map
|
package/dist/Input.module.js
CHANGED
|
@@ -71,29 +71,29 @@ function $79348162c55d687f$var$Input(props, ref) {
|
|
|
71
71
|
// when there is enough space for the padding to be re-added. Ideally we'd
|
|
72
72
|
// use a resize observer on a parent element, but it's hard to know _what_
|
|
73
73
|
// parent element.
|
|
74
|
-
(0, $fVzF9$useEvent)((0, $fVzF9$useRef)(typeof window !==
|
|
74
|
+
(0, $fVzF9$useEvent)((0, $fVzF9$useRef)(typeof window !== 'undefined' ? window : null), 'resize', onResize);
|
|
75
75
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible, isFocused: isFocused } = (0, $fVzF9$useFocusRing)({
|
|
76
76
|
isTextInput: true,
|
|
77
77
|
within: true
|
|
78
78
|
});
|
|
79
|
-
let isInvalid = validationState ===
|
|
80
|
-
let textfieldClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))),
|
|
86
|
-
let inputClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))),
|
|
90
|
-
let iconClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))),
|
|
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
91
|
let validationIcon = null;
|
|
92
|
-
if (validationState ===
|
|
92
|
+
if (validationState === 'invalid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiAlertMedium), {
|
|
93
93
|
"data-testid": "invalid-icon",
|
|
94
94
|
UNSAFE_className: iconClass
|
|
95
95
|
});
|
|
96
|
-
else if (validationState ===
|
|
96
|
+
else if (validationState === 'valid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiCheckmarkMedium), {
|
|
97
97
|
"data-testid": "valid-icon",
|
|
98
98
|
UNSAFE_className: iconClass
|
|
99
99
|
});
|
|
@@ -107,7 +107,7 @@ function $79348162c55d687f$var$Input(props, ref) {
|
|
|
107
107
|
className: inputClass
|
|
108
108
|
}, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
|
|
109
109
|
role: "presentation",
|
|
110
|
-
className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))),
|
|
110
|
+
className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), 'react-spectrum-Datepicker-inputContents'),
|
|
111
111
|
ref: (0, $fVzF9$mergeRefs)(ref, inputRef)
|
|
112
112
|
}, children)), validationIcon);
|
|
113
113
|
}
|
package/dist/TimeField.main.js
CHANGED
|
@@ -60,7 +60,7 @@ function $740ff83729a8f317$var$TimeField(props, ref) {
|
|
|
60
60
|
...props,
|
|
61
61
|
inputRef: inputRef
|
|
62
62
|
}, state, fieldRef);
|
|
63
|
-
let validationState = state.validationState || (isInvalid ?
|
|
63
|
+
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
64
64
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).createElement((0, $gfZkn$reactspectrumlabel.Field), {
|
|
65
65
|
...props,
|
|
66
66
|
ref: domRef,
|
|
@@ -72,7 +72,7 @@ function $740ff83729a8f317$var$TimeField(props, ref) {
|
|
|
72
72
|
isInvalid: isInvalid,
|
|
73
73
|
validationErrors: validationErrors,
|
|
74
74
|
validationDetails: validationDetails,
|
|
75
|
-
wrapperClassName: (0, $gfZkn$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
75
|
+
wrapperClassName: (0, $gfZkn$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-TimeField-fieldWrapper')
|
|
76
76
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).createElement((0, $c3ebc4931d9b9977$exports.Input), {
|
|
77
77
|
ref: fieldRef,
|
|
78
78
|
fieldProps: fieldProps,
|
|
@@ -80,7 +80,7 @@ function $740ff83729a8f317$var$TimeField(props, ref) {
|
|
|
80
80
|
isQuiet: isQuiet,
|
|
81
81
|
autoFocus: autoFocus,
|
|
82
82
|
validationState: validationState,
|
|
83
|
-
className: (0, $gfZkn$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
83
|
+
className: (0, $gfZkn$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-TimeField')
|
|
84
84
|
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, ($parcel$interopDefault($gfZkn$react))).createElement((0, $edac158d20ebe4a9$exports.DatePickerSegment), {
|
|
85
85
|
key: i,
|
|
86
86
|
segment: segment,
|
package/dist/TimeField.mjs
CHANGED
|
@@ -54,7 +54,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
54
54
|
...props,
|
|
55
55
|
inputRef: inputRef
|
|
56
56
|
}, state, fieldRef);
|
|
57
|
-
let validationState = state.validationState || (isInvalid ?
|
|
57
|
+
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
58
58
|
return /*#__PURE__*/ (0, $immgY$react).createElement((0, $immgY$Field), {
|
|
59
59
|
...props,
|
|
60
60
|
ref: domRef,
|
|
@@ -66,7 +66,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
66
66
|
isInvalid: isInvalid,
|
|
67
67
|
validationErrors: validationErrors,
|
|
68
68
|
validationDetails: validationDetails,
|
|
69
|
-
wrapperClassName: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))),
|
|
69
|
+
wrapperClassName: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), 'react-spectrum-TimeField-fieldWrapper')
|
|
70
70
|
}, /*#__PURE__*/ (0, $immgY$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
71
71
|
ref: fieldRef,
|
|
72
72
|
fieldProps: fieldProps,
|
|
@@ -74,7 +74,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
74
74
|
isQuiet: isQuiet,
|
|
75
75
|
autoFocus: autoFocus,
|
|
76
76
|
validationState: validationState,
|
|
77
|
-
className: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))),
|
|
77
|
+
className: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), 'react-spectrum-TimeField')
|
|
78
78
|
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $immgY$react).createElement((0, $cfa347761f172638$export$6388987c5223b54e), {
|
|
79
79
|
key: i,
|
|
80
80
|
segment: segment,
|
|
@@ -94,4 +94,4 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
export {$f0a04554754386b6$export$5eaee2322dd727eb as TimeField};
|
|
97
|
-
//# sourceMappingURL=TimeField.
|
|
97
|
+
//# sourceMappingURL=TimeField.module.js.map
|
package/dist/TimeField.module.js
CHANGED
|
@@ -54,7 +54,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
54
54
|
...props,
|
|
55
55
|
inputRef: inputRef
|
|
56
56
|
}, state, fieldRef);
|
|
57
|
-
let validationState = state.validationState || (isInvalid ?
|
|
57
|
+
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
58
58
|
return /*#__PURE__*/ (0, $immgY$react).createElement((0, $immgY$Field), {
|
|
59
59
|
...props,
|
|
60
60
|
ref: domRef,
|
|
@@ -66,7 +66,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
66
66
|
isInvalid: isInvalid,
|
|
67
67
|
validationErrors: validationErrors,
|
|
68
68
|
validationDetails: validationDetails,
|
|
69
|
-
wrapperClassName: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))),
|
|
69
|
+
wrapperClassName: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), 'react-spectrum-TimeField-fieldWrapper')
|
|
70
70
|
}, /*#__PURE__*/ (0, $immgY$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
71
71
|
ref: fieldRef,
|
|
72
72
|
fieldProps: fieldProps,
|
|
@@ -74,7 +74,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
74
74
|
isQuiet: isQuiet,
|
|
75
75
|
autoFocus: autoFocus,
|
|
76
76
|
validationState: validationState,
|
|
77
|
-
className: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))),
|
|
77
|
+
className: (0, $immgY$classNames)((0, ($parcel$interopDefault($immgY$styles_cssmodulejs))), 'react-spectrum-TimeField')
|
|
78
78
|
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $immgY$react).createElement((0, $cfa347761f172638$export$6388987c5223b54e), {
|
|
79
79
|
key: i,
|
|
80
80
|
segment: segment,
|
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
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED
package/dist/intlStrings.mjs
CHANGED
package/dist/it-IT.mjs
CHANGED
package/dist/ja-JP.mjs
CHANGED
package/dist/ko-KR.mjs
CHANGED
package/dist/lt-LT.mjs
CHANGED
package/dist/lv-LV.mjs
CHANGED
package/dist/nb-NO.mjs
CHANGED
package/dist/nl-NL.mjs
CHANGED
package/dist/pl-PL.mjs
CHANGED
package/dist/pt-BR.mjs
CHANGED
package/dist/pt-PT.mjs
CHANGED
package/dist/ro-RO.mjs
CHANGED
package/dist/ru-RU.mjs
CHANGED
package/dist/sk-SK.mjs
CHANGED
package/dist/sl-SI.mjs
CHANGED
package/dist/sr-SP.mjs
CHANGED
package/dist/styles_css.mjs
CHANGED
package/dist/sv-SE.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/uk-UA.mjs
CHANGED
package/dist/utils.main.js
CHANGED
|
@@ -33,16 +33,16 @@ $parcel$export(module.exports, "useFocusManagerRef", () => $4d2e419f522adb48$exp
|
|
|
33
33
|
|
|
34
34
|
function $4d2e419f522adb48$export$322f4580ccd8dde6(props) {
|
|
35
35
|
let formatter = (0, $61dVa$reactariai18n.useDateFormatter)({
|
|
36
|
-
dateStyle:
|
|
36
|
+
dateStyle: 'short'
|
|
37
37
|
});
|
|
38
38
|
let displayNames = (0, $61dVa$reactariadatepicker.useDisplayNames)();
|
|
39
39
|
return (0, $61dVa$react.useMemo)(()=>{
|
|
40
40
|
if (props.description) return props.description;
|
|
41
41
|
if (props.showFormatHelpText) return formatter.formatToParts(new Date()).map((s)=>{
|
|
42
|
-
if (s.type ===
|
|
42
|
+
if (s.type === 'literal') return s.value;
|
|
43
43
|
return displayNames.of(s.type);
|
|
44
|
-
}).join(
|
|
45
|
-
return
|
|
44
|
+
}).join(' ');
|
|
45
|
+
return '';
|
|
46
46
|
}, [
|
|
47
47
|
props.description,
|
|
48
48
|
props.showFormatHelpText,
|
|
@@ -56,9 +56,9 @@ function $4d2e419f522adb48$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
|
56
56
|
(0, $61dVa$reactariautils.useLayoutEffect)(()=>{
|
|
57
57
|
let onResize = ()=>setVisibleMonths($4d2e419f522adb48$var$getVisibleMonths(scale));
|
|
58
58
|
onResize();
|
|
59
|
-
window.addEventListener(
|
|
59
|
+
window.addEventListener('resize', onResize);
|
|
60
60
|
return ()=>{
|
|
61
|
-
window.removeEventListener(
|
|
61
|
+
window.removeEventListener('resize', onResize);
|
|
62
62
|
};
|
|
63
63
|
}, [
|
|
64
64
|
scale
|
|
@@ -66,10 +66,10 @@ function $4d2e419f522adb48$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
|
66
66
|
return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));
|
|
67
67
|
}
|
|
68
68
|
function $4d2e419f522adb48$var$getVisibleMonths(scale) {
|
|
69
|
-
if (typeof window ===
|
|
70
|
-
let monthWidth = scale ===
|
|
71
|
-
let gap = scale ===
|
|
72
|
-
let popoverPadding = scale ===
|
|
69
|
+
if (typeof window === 'undefined') return 1;
|
|
70
|
+
let monthWidth = scale === 'large' ? 336 : 280;
|
|
71
|
+
let gap = scale === 'large' ? 30 : 24;
|
|
72
|
+
let popoverPadding = scale === 'large' ? 32 : 48;
|
|
73
73
|
return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
|
|
74
74
|
}
|
|
75
75
|
function $4d2e419f522adb48$export$71a23a36270e4bf0(ref) {
|
package/dist/utils.mjs
CHANGED
|
@@ -25,16 +25,16 @@ import {useProvider as $d7JPl$useProvider} from "@react-spectrum/provider";
|
|
|
25
25
|
|
|
26
26
|
function $04e96200274b03de$export$322f4580ccd8dde6(props) {
|
|
27
27
|
let formatter = (0, $d7JPl$useDateFormatter)({
|
|
28
|
-
dateStyle:
|
|
28
|
+
dateStyle: 'short'
|
|
29
29
|
});
|
|
30
30
|
let displayNames = (0, $d7JPl$useDisplayNames)();
|
|
31
31
|
return (0, $d7JPl$useMemo)(()=>{
|
|
32
32
|
if (props.description) return props.description;
|
|
33
33
|
if (props.showFormatHelpText) return formatter.formatToParts(new Date()).map((s)=>{
|
|
34
|
-
if (s.type ===
|
|
34
|
+
if (s.type === 'literal') return s.value;
|
|
35
35
|
return displayNames.of(s.type);
|
|
36
|
-
}).join(
|
|
37
|
-
return
|
|
36
|
+
}).join(' ');
|
|
37
|
+
return '';
|
|
38
38
|
}, [
|
|
39
39
|
props.description,
|
|
40
40
|
props.showFormatHelpText,
|
|
@@ -48,9 +48,9 @@ function $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
|
48
48
|
(0, $d7JPl$useLayoutEffect)(()=>{
|
|
49
49
|
let onResize = ()=>setVisibleMonths($04e96200274b03de$var$getVisibleMonths(scale));
|
|
50
50
|
onResize();
|
|
51
|
-
window.addEventListener(
|
|
51
|
+
window.addEventListener('resize', onResize);
|
|
52
52
|
return ()=>{
|
|
53
|
-
window.removeEventListener(
|
|
53
|
+
window.removeEventListener('resize', onResize);
|
|
54
54
|
};
|
|
55
55
|
}, [
|
|
56
56
|
scale
|
|
@@ -58,10 +58,10 @@ function $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
|
58
58
|
return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));
|
|
59
59
|
}
|
|
60
60
|
function $04e96200274b03de$var$getVisibleMonths(scale) {
|
|
61
|
-
if (typeof window ===
|
|
62
|
-
let monthWidth = scale ===
|
|
63
|
-
let gap = scale ===
|
|
64
|
-
let popoverPadding = scale ===
|
|
61
|
+
if (typeof window === 'undefined') return 1;
|
|
62
|
+
let monthWidth = scale === 'large' ? 336 : 280;
|
|
63
|
+
let gap = scale === 'large' ? 30 : 24;
|
|
64
|
+
let popoverPadding = scale === 'large' ? 32 : 48;
|
|
65
65
|
return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
|
|
66
66
|
}
|
|
67
67
|
function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
@@ -79,4 +79,4 @@ function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
export {$04e96200274b03de$export$322f4580ccd8dde6 as useFormatHelpText, $04e96200274b03de$export$12ce2869ce471b1f as useVisibleMonths, $04e96200274b03de$export$71a23a36270e4bf0 as useFocusManagerRef};
|
|
82
|
-
//# sourceMappingURL=utils.
|
|
82
|
+
//# sourceMappingURL=utils.module.js.map
|
package/dist/utils.module.js
CHANGED
|
@@ -25,16 +25,16 @@ import {useProvider as $d7JPl$useProvider} from "@react-spectrum/provider";
|
|
|
25
25
|
|
|
26
26
|
function $04e96200274b03de$export$322f4580ccd8dde6(props) {
|
|
27
27
|
let formatter = (0, $d7JPl$useDateFormatter)({
|
|
28
|
-
dateStyle:
|
|
28
|
+
dateStyle: 'short'
|
|
29
29
|
});
|
|
30
30
|
let displayNames = (0, $d7JPl$useDisplayNames)();
|
|
31
31
|
return (0, $d7JPl$useMemo)(()=>{
|
|
32
32
|
if (props.description) return props.description;
|
|
33
33
|
if (props.showFormatHelpText) return formatter.formatToParts(new Date()).map((s)=>{
|
|
34
|
-
if (s.type ===
|
|
34
|
+
if (s.type === 'literal') return s.value;
|
|
35
35
|
return displayNames.of(s.type);
|
|
36
|
-
}).join(
|
|
37
|
-
return
|
|
36
|
+
}).join(' ');
|
|
37
|
+
return '';
|
|
38
38
|
}, [
|
|
39
39
|
props.description,
|
|
40
40
|
props.showFormatHelpText,
|
|
@@ -48,9 +48,9 @@ function $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
|
48
48
|
(0, $d7JPl$useLayoutEffect)(()=>{
|
|
49
49
|
let onResize = ()=>setVisibleMonths($04e96200274b03de$var$getVisibleMonths(scale));
|
|
50
50
|
onResize();
|
|
51
|
-
window.addEventListener(
|
|
51
|
+
window.addEventListener('resize', onResize);
|
|
52
52
|
return ()=>{
|
|
53
|
-
window.removeEventListener(
|
|
53
|
+
window.removeEventListener('resize', onResize);
|
|
54
54
|
};
|
|
55
55
|
}, [
|
|
56
56
|
scale
|
|
@@ -58,10 +58,10 @@ function $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
|
58
58
|
return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));
|
|
59
59
|
}
|
|
60
60
|
function $04e96200274b03de$var$getVisibleMonths(scale) {
|
|
61
|
-
if (typeof window ===
|
|
62
|
-
let monthWidth = scale ===
|
|
63
|
-
let gap = scale ===
|
|
64
|
-
let popoverPadding = scale ===
|
|
61
|
+
if (typeof window === 'undefined') return 1;
|
|
62
|
+
let monthWidth = scale === 'large' ? 336 : 280;
|
|
63
|
+
let gap = scale === 'large' ? 30 : 24;
|
|
64
|
+
let popoverPadding = scale === 'large' ? 32 : 48;
|
|
65
65
|
return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
|
|
66
66
|
}
|
|
67
67
|
function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|