@react-spectrum/datepicker 3.0.0-nightly.2912 → 3.0.0-nightly.2925
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 +3 -3
- package/dist/DateField.module.js +3 -3
- package/dist/DatePicker.main.js +26 -26
- package/dist/DatePicker.mjs +26 -26
- package/dist/DatePicker.module.js +26 -26
- package/dist/DatePickerField.main.js +2 -2
- package/dist/DatePickerField.mjs +2 -2
- package/dist/DatePickerField.module.js +2 -2
- package/dist/DatePickerSegment.main.js +9 -9
- package/dist/DatePickerSegment.mjs +9 -9
- package/dist/DatePickerSegment.module.js +9 -9
- package/dist/DateRangePicker.main.js +32 -32
- package/dist/DateRangePicker.mjs +32 -32
- package/dist/DateRangePicker.module.js +32 -32
- package/dist/Input.main.js +16 -16
- package/dist/Input.mjs +16 -16
- package/dist/Input.module.js +16 -16
- package/dist/TimeField.main.js +3 -3
- package/dist/TimeField.mjs +3 -3
- package/dist/TimeField.module.js +3 -3
- package/dist/utils.main.js +10 -10
- package/dist/utils.mjs +10 -10
- package/dist/utils.module.js +10 -10
- package/package.json +23 -23
|
@@ -86,7 +86,7 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
|
|
|
86
86
|
let { isOpen: isOpen, setOpen: setOpen } = state;
|
|
87
87
|
let { direction: direction } = (0, $56Vum$reactariai18n.useLocale)();
|
|
88
88
|
let domRef = (0, $4d2e419f522adb48$exports.useFocusManagerRef)(ref);
|
|
89
|
-
let stringFormatter = (0, $56Vum$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($0045b32a117743a7$exports))),
|
|
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,
|
|
92
92
|
isTextInput: true,
|
|
@@ -97,30 +97,30 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
|
|
|
97
97
|
isTextInput: false,
|
|
98
98
|
autoFocus: autoFocus
|
|
99
99
|
});
|
|
100
|
-
let className = (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
let className = (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup', {
|
|
101
|
+
'spectrum-InputGroup--quiet': isQuiet,
|
|
102
|
+
'spectrum-InputGroup--invalid': isInvalid && !isDisabled,
|
|
103
|
+
'is-disabled': isDisabled,
|
|
104
|
+
'is-hovered': isHovered,
|
|
105
|
+
'is-focused': isFocused,
|
|
106
|
+
'focus-ring': isFocusVisible && !isFocusedButton
|
|
107
107
|
});
|
|
108
|
-
let fieldClassName = (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))),
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
let fieldClassName = (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup-input', {
|
|
109
|
+
'is-disabled': isDisabled,
|
|
110
|
+
'is-invalid': isInvalid && !isDisabled
|
|
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
114
|
let description = (0, $4d2e419f522adb48$exports.useFormatHelpText)(props);
|
|
115
115
|
if (description && !props.description) descriptionProps.id = null;
|
|
116
116
|
let placeholder = placeholderValue;
|
|
117
|
-
let timePlaceholder = placeholder &&
|
|
118
|
-
let timeMinValue = props.minValue &&
|
|
119
|
-
let timeMaxValue = props.maxValue &&
|
|
120
|
-
let timeGranularity = state.granularity ===
|
|
117
|
+
let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
|
|
118
|
+
let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;
|
|
119
|
+
let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
|
|
120
|
+
let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
|
|
121
121
|
let showTimeField = !!timeGranularity;
|
|
122
122
|
let visibleMonths = (0, $4d2e419f522adb48$exports.useVisibleMonths)(maxVisibleMonths);
|
|
123
|
-
let validationState = state.validationState || (isInvalid ?
|
|
123
|
+
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
124
124
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumlabel.Field), {
|
|
125
125
|
...props,
|
|
126
126
|
ref: domRef,
|
|
@@ -133,7 +133,7 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
|
|
|
133
133
|
isInvalid: isInvalid,
|
|
134
134
|
validationErrors: validationErrors,
|
|
135
135
|
validationDetails: validationDetails,
|
|
136
|
-
wrapperClassName: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
136
|
+
wrapperClassName: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-fieldWrapper')
|
|
137
137
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement("div", {
|
|
138
138
|
...(0, $56Vum$reactariautils.mergeProps)(groupProps, hoverProps, focusProps),
|
|
139
139
|
className: className,
|
|
@@ -142,23 +142,23 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
|
|
|
142
142
|
isDisabled: isDisabled,
|
|
143
143
|
isQuiet: isQuiet,
|
|
144
144
|
validationState: validationState,
|
|
145
|
-
className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))),
|
|
145
|
+
className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup-field'),
|
|
146
146
|
inputClassName: fieldClassName,
|
|
147
147
|
disableFocusRing: true
|
|
148
148
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $bd22dc8dad9522bc$exports.DatePickerField), {
|
|
149
149
|
...startFieldProps,
|
|
150
150
|
"data-testid": "start-date",
|
|
151
151
|
isQuiet: props.isQuiet,
|
|
152
|
-
inputClassName: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
152
|
+
inputClassName: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-startField')
|
|
153
153
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement($16cafb71dac155a4$var$DateRangeDash, null), /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $bd22dc8dad9522bc$exports.DatePickerField), {
|
|
154
154
|
...endFieldProps,
|
|
155
155
|
"data-testid": "end-date",
|
|
156
156
|
isQuiet: props.isQuiet,
|
|
157
|
-
inputClassName: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))),
|
|
157
|
+
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'))
|
|
158
158
|
})), /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumdialog.DialogTrigger), {
|
|
159
159
|
type: "popover",
|
|
160
160
|
mobileType: "tray",
|
|
161
|
-
placement: direction ===
|
|
161
|
+
placement: direction === 'rtl' ? 'bottom right' : 'bottom left',
|
|
162
162
|
targetRef: targetRef,
|
|
163
163
|
hideArrow: true,
|
|
164
164
|
isOpen: isOpen,
|
|
@@ -166,29 +166,29 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
|
|
|
166
166
|
shouldFlip: props.shouldFlip
|
|
167
167
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumbutton.FieldButton), {
|
|
168
168
|
...(0, $56Vum$reactariautils.mergeProps)(buttonProps, focusPropsButton),
|
|
169
|
-
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))),
|
|
169
|
+
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-FieldButton'),
|
|
170
170
|
isQuiet: isQuiet,
|
|
171
171
|
validationState: validationState
|
|
172
172
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, ($parcel$interopDefault($56Vum$spectrumiconsworkflowCalendar))), null)), /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumdialog.Dialog), {
|
|
173
|
-
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
173
|
+
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-dialog'),
|
|
174
174
|
...dialogProps
|
|
175
175
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumview.Content), null, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement("div", {
|
|
176
|
-
className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
176
|
+
className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-dialogContent')
|
|
177
177
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumcalendar.RangeCalendar), {
|
|
178
178
|
...calendarProps,
|
|
179
179
|
visibleMonths: visibleMonths,
|
|
180
180
|
pageBehavior: pageBehavior,
|
|
181
|
-
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
182
|
-
|
|
181
|
+
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-calendar', {
|
|
182
|
+
'is-invalid': validationState === 'invalid'
|
|
183
183
|
})
|
|
184
184
|
}), showTimeField && /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $56Vum$reactspectrumlayout.Flex), {
|
|
185
185
|
gap: "size-100",
|
|
186
186
|
marginTop: "size-100",
|
|
187
|
-
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
187
|
+
UNSAFE_className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-timeFields')
|
|
188
188
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $740ff83729a8f317$exports.TimeField), {
|
|
189
|
-
label: stringFormatter.format(
|
|
189
|
+
label: stringFormatter.format('startTime'),
|
|
190
190
|
value: ((_state_timeRange = state.timeRange) === null || _state_timeRange === void 0 ? void 0 : _state_timeRange.start) || null,
|
|
191
|
-
onChange: (v)=>state.setTime(
|
|
191
|
+
onChange: (v)=>state.setTime('start', v),
|
|
192
192
|
placeholderValue: timePlaceholder,
|
|
193
193
|
granularity: timeGranularity,
|
|
194
194
|
minValue: timeMinValue,
|
|
@@ -197,9 +197,9 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
|
|
|
197
197
|
hideTimeZone: props.hideTimeZone,
|
|
198
198
|
flex: true
|
|
199
199
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement((0, $740ff83729a8f317$exports.TimeField), {
|
|
200
|
-
label: stringFormatter.format(
|
|
200
|
+
label: stringFormatter.format('endTime'),
|
|
201
201
|
value: ((_state_timeRange1 = state.timeRange) === null || _state_timeRange1 === void 0 ? void 0 : _state_timeRange1.end) || null,
|
|
202
|
-
onChange: (v)=>state.setTime(
|
|
202
|
+
onChange: (v)=>state.setTime('end', v),
|
|
203
203
|
placeholderValue: timePlaceholder,
|
|
204
204
|
granularity: timeGranularity,
|
|
205
205
|
minValue: timeMinValue,
|
|
@@ -213,7 +213,7 @@ function $16cafb71dac155a4$var$DateRangeDash() {
|
|
|
213
213
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($56Vum$react))).createElement("div", {
|
|
214
214
|
"aria-hidden": "true",
|
|
215
215
|
"data-testid": "date-range-dash",
|
|
216
|
-
className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
216
|
+
className: (0, $56Vum$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-rangeDash')
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
/**
|
package/dist/DateRangePicker.mjs
CHANGED
|
@@ -80,7 +80,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
80
80
|
let { isOpen: isOpen, setOpen: setOpen } = state;
|
|
81
81
|
let { direction: direction } = (0, $dUbU7$useLocale)();
|
|
82
82
|
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
83
|
-
let stringFormatter = (0, $dUbU7$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dUbU7$intlStringsmodulejs))),
|
|
83
|
+
let stringFormatter = (0, $dUbU7$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dUbU7$intlStringsmodulejs))), '@react-spectrum/datepicker');
|
|
84
84
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $dUbU7$useFocusRing)({
|
|
85
85
|
within: true,
|
|
86
86
|
isTextInput: true,
|
|
@@ -91,30 +91,30 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
91
91
|
isTextInput: false,
|
|
92
92
|
autoFocus: autoFocus
|
|
93
93
|
});
|
|
94
|
-
let className = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
let className = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup', {
|
|
95
|
+
'spectrum-InputGroup--quiet': isQuiet,
|
|
96
|
+
'spectrum-InputGroup--invalid': isInvalid && !isDisabled,
|
|
97
|
+
'is-disabled': isDisabled,
|
|
98
|
+
'is-hovered': isHovered,
|
|
99
|
+
'is-focused': isFocused,
|
|
100
|
+
'focus-ring': isFocusVisible && !isFocusedButton
|
|
101
101
|
});
|
|
102
|
-
let fieldClassName = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
let fieldClassName = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-input', {
|
|
103
|
+
'is-disabled': isDisabled,
|
|
104
|
+
'is-invalid': isInvalid && !isDisabled
|
|
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
108
|
let description = (0, $04e96200274b03de$export$322f4580ccd8dde6)(props);
|
|
109
109
|
if (description && !props.description) descriptionProps.id = null;
|
|
110
110
|
let placeholder = placeholderValue;
|
|
111
|
-
let timePlaceholder = placeholder &&
|
|
112
|
-
let timeMinValue = props.minValue &&
|
|
113
|
-
let timeMaxValue = props.maxValue &&
|
|
114
|
-
let timeGranularity = state.granularity ===
|
|
111
|
+
let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
|
|
112
|
+
let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;
|
|
113
|
+
let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
|
|
114
|
+
let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
|
|
115
115
|
let showTimeField = !!timeGranularity;
|
|
116
116
|
let visibleMonths = (0, $04e96200274b03de$export$12ce2869ce471b1f)(maxVisibleMonths);
|
|
117
|
-
let validationState = state.validationState || (isInvalid ?
|
|
117
|
+
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
118
118
|
return /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Field), {
|
|
119
119
|
...props,
|
|
120
120
|
ref: domRef,
|
|
@@ -127,7 +127,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
127
127
|
isInvalid: isInvalid,
|
|
128
128
|
validationErrors: validationErrors,
|
|
129
129
|
validationDetails: validationDetails,
|
|
130
|
-
wrapperClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
130
|
+
wrapperClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-fieldWrapper')
|
|
131
131
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
|
|
132
132
|
...(0, $dUbU7$mergeProps)(groupProps, hoverProps, focusProps),
|
|
133
133
|
className: className,
|
|
@@ -136,23 +136,23 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
136
136
|
isDisabled: isDisabled,
|
|
137
137
|
isQuiet: isQuiet,
|
|
138
138
|
validationState: validationState,
|
|
139
|
-
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
139
|
+
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-field'),
|
|
140
140
|
inputClassName: fieldClassName,
|
|
141
141
|
disableFocusRing: true
|
|
142
142
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
|
|
143
143
|
...startFieldProps,
|
|
144
144
|
"data-testid": "start-date",
|
|
145
145
|
isQuiet: props.isQuiet,
|
|
146
|
-
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
146
|
+
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-startField')
|
|
147
147
|
}), /*#__PURE__*/ (0, $dUbU7$react).createElement($cb301300011a98f7$var$DateRangeDash, null), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
|
|
148
148
|
...endFieldProps,
|
|
149
149
|
"data-testid": "end-date",
|
|
150
150
|
isQuiet: props.isQuiet,
|
|
151
|
-
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
151
|
+
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-Datepicker-endField', (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-endField'))
|
|
152
152
|
})), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$DialogTrigger), {
|
|
153
153
|
type: "popover",
|
|
154
154
|
mobileType: "tray",
|
|
155
|
-
placement: direction ===
|
|
155
|
+
placement: direction === 'rtl' ? 'bottom right' : 'bottom left',
|
|
156
156
|
targetRef: targetRef,
|
|
157
157
|
hideArrow: true,
|
|
158
158
|
isOpen: isOpen,
|
|
@@ -160,29 +160,29 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
160
160
|
shouldFlip: props.shouldFlip
|
|
161
161
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$FieldButton), {
|
|
162
162
|
...(0, $dUbU7$mergeProps)(buttonProps, focusPropsButton),
|
|
163
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
163
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-FieldButton'),
|
|
164
164
|
isQuiet: isQuiet,
|
|
165
165
|
validationState: validationState
|
|
166
166
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$spectrumiconsworkflowCalendar), null)), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Dialog), {
|
|
167
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
167
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-dialog'),
|
|
168
168
|
...dialogProps
|
|
169
169
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Content), null, /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
|
|
170
|
-
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
170
|
+
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-dialogContent')
|
|
171
171
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$RangeCalendar), {
|
|
172
172
|
...calendarProps,
|
|
173
173
|
visibleMonths: visibleMonths,
|
|
174
174
|
pageBehavior: pageBehavior,
|
|
175
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
176
|
-
|
|
175
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-calendar', {
|
|
176
|
+
'is-invalid': validationState === 'invalid'
|
|
177
177
|
})
|
|
178
178
|
}), showTimeField && /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Flex), {
|
|
179
179
|
gap: "size-100",
|
|
180
180
|
marginTop: "size-100",
|
|
181
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
181
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-timeFields')
|
|
182
182
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
|
|
183
|
-
label: stringFormatter.format(
|
|
183
|
+
label: stringFormatter.format('startTime'),
|
|
184
184
|
value: ((_state_timeRange = state.timeRange) === null || _state_timeRange === void 0 ? void 0 : _state_timeRange.start) || null,
|
|
185
|
-
onChange: (v)=>state.setTime(
|
|
185
|
+
onChange: (v)=>state.setTime('start', v),
|
|
186
186
|
placeholderValue: timePlaceholder,
|
|
187
187
|
granularity: timeGranularity,
|
|
188
188
|
minValue: timeMinValue,
|
|
@@ -191,9 +191,9 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
191
191
|
hideTimeZone: props.hideTimeZone,
|
|
192
192
|
flex: true
|
|
193
193
|
}), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
|
|
194
|
-
label: stringFormatter.format(
|
|
194
|
+
label: stringFormatter.format('endTime'),
|
|
195
195
|
value: ((_state_timeRange1 = state.timeRange) === null || _state_timeRange1 === void 0 ? void 0 : _state_timeRange1.end) || null,
|
|
196
|
-
onChange: (v)=>state.setTime(
|
|
196
|
+
onChange: (v)=>state.setTime('end', v),
|
|
197
197
|
placeholderValue: timePlaceholder,
|
|
198
198
|
granularity: timeGranularity,
|
|
199
199
|
minValue: timeMinValue,
|
|
@@ -207,7 +207,7 @@ function $cb301300011a98f7$var$DateRangeDash() {
|
|
|
207
207
|
return /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
|
|
208
208
|
"aria-hidden": "true",
|
|
209
209
|
"data-testid": "date-range-dash",
|
|
210
|
-
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
210
|
+
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-rangeDash')
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
@@ -80,7 +80,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
80
80
|
let { isOpen: isOpen, setOpen: setOpen } = state;
|
|
81
81
|
let { direction: direction } = (0, $dUbU7$useLocale)();
|
|
82
82
|
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
83
|
-
let stringFormatter = (0, $dUbU7$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dUbU7$intlStringsmodulejs))),
|
|
83
|
+
let stringFormatter = (0, $dUbU7$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dUbU7$intlStringsmodulejs))), '@react-spectrum/datepicker');
|
|
84
84
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $dUbU7$useFocusRing)({
|
|
85
85
|
within: true,
|
|
86
86
|
isTextInput: true,
|
|
@@ -91,30 +91,30 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
91
91
|
isTextInput: false,
|
|
92
92
|
autoFocus: autoFocus
|
|
93
93
|
});
|
|
94
|
-
let className = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
let className = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup', {
|
|
95
|
+
'spectrum-InputGroup--quiet': isQuiet,
|
|
96
|
+
'spectrum-InputGroup--invalid': isInvalid && !isDisabled,
|
|
97
|
+
'is-disabled': isDisabled,
|
|
98
|
+
'is-hovered': isHovered,
|
|
99
|
+
'is-focused': isFocused,
|
|
100
|
+
'focus-ring': isFocusVisible && !isFocusedButton
|
|
101
101
|
});
|
|
102
|
-
let fieldClassName = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
let fieldClassName = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-input', {
|
|
103
|
+
'is-disabled': isDisabled,
|
|
104
|
+
'is-invalid': isInvalid && !isDisabled
|
|
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
108
|
let description = (0, $04e96200274b03de$export$322f4580ccd8dde6)(props);
|
|
109
109
|
if (description && !props.description) descriptionProps.id = null;
|
|
110
110
|
let placeholder = placeholderValue;
|
|
111
|
-
let timePlaceholder = placeholder &&
|
|
112
|
-
let timeMinValue = props.minValue &&
|
|
113
|
-
let timeMaxValue = props.maxValue &&
|
|
114
|
-
let timeGranularity = state.granularity ===
|
|
111
|
+
let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
|
|
112
|
+
let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;
|
|
113
|
+
let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
|
|
114
|
+
let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
|
|
115
115
|
let showTimeField = !!timeGranularity;
|
|
116
116
|
let visibleMonths = (0, $04e96200274b03de$export$12ce2869ce471b1f)(maxVisibleMonths);
|
|
117
|
-
let validationState = state.validationState || (isInvalid ?
|
|
117
|
+
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
118
118
|
return /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Field), {
|
|
119
119
|
...props,
|
|
120
120
|
ref: domRef,
|
|
@@ -127,7 +127,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
127
127
|
isInvalid: isInvalid,
|
|
128
128
|
validationErrors: validationErrors,
|
|
129
129
|
validationDetails: validationDetails,
|
|
130
|
-
wrapperClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
130
|
+
wrapperClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-fieldWrapper')
|
|
131
131
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
|
|
132
132
|
...(0, $dUbU7$mergeProps)(groupProps, hoverProps, focusProps),
|
|
133
133
|
className: className,
|
|
@@ -136,23 +136,23 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
136
136
|
isDisabled: isDisabled,
|
|
137
137
|
isQuiet: isQuiet,
|
|
138
138
|
validationState: validationState,
|
|
139
|
-
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
139
|
+
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-field'),
|
|
140
140
|
inputClassName: fieldClassName,
|
|
141
141
|
disableFocusRing: true
|
|
142
142
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
|
|
143
143
|
...startFieldProps,
|
|
144
144
|
"data-testid": "start-date",
|
|
145
145
|
isQuiet: props.isQuiet,
|
|
146
|
-
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
146
|
+
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-startField')
|
|
147
147
|
}), /*#__PURE__*/ (0, $dUbU7$react).createElement($cb301300011a98f7$var$DateRangeDash, null), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
|
|
148
148
|
...endFieldProps,
|
|
149
149
|
"data-testid": "end-date",
|
|
150
150
|
isQuiet: props.isQuiet,
|
|
151
|
-
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
151
|
+
inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-Datepicker-endField', (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-endField'))
|
|
152
152
|
})), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$DialogTrigger), {
|
|
153
153
|
type: "popover",
|
|
154
154
|
mobileType: "tray",
|
|
155
|
-
placement: direction ===
|
|
155
|
+
placement: direction === 'rtl' ? 'bottom right' : 'bottom left',
|
|
156
156
|
targetRef: targetRef,
|
|
157
157
|
hideArrow: true,
|
|
158
158
|
isOpen: isOpen,
|
|
@@ -160,29 +160,29 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
160
160
|
shouldFlip: props.shouldFlip
|
|
161
161
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$FieldButton), {
|
|
162
162
|
...(0, $dUbU7$mergeProps)(buttonProps, focusPropsButton),
|
|
163
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))),
|
|
163
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-FieldButton'),
|
|
164
164
|
isQuiet: isQuiet,
|
|
165
165
|
validationState: validationState
|
|
166
166
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$spectrumiconsworkflowCalendar), null)), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Dialog), {
|
|
167
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
167
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-dialog'),
|
|
168
168
|
...dialogProps
|
|
169
169
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Content), null, /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
|
|
170
|
-
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
170
|
+
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-dialogContent')
|
|
171
171
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$RangeCalendar), {
|
|
172
172
|
...calendarProps,
|
|
173
173
|
visibleMonths: visibleMonths,
|
|
174
174
|
pageBehavior: pageBehavior,
|
|
175
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
176
|
-
|
|
175
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-calendar', {
|
|
176
|
+
'is-invalid': validationState === 'invalid'
|
|
177
177
|
})
|
|
178
178
|
}), showTimeField && /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Flex), {
|
|
179
179
|
gap: "size-100",
|
|
180
180
|
marginTop: "size-100",
|
|
181
|
-
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
181
|
+
UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-timeFields')
|
|
182
182
|
}, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
|
|
183
|
-
label: stringFormatter.format(
|
|
183
|
+
label: stringFormatter.format('startTime'),
|
|
184
184
|
value: ((_state_timeRange = state.timeRange) === null || _state_timeRange === void 0 ? void 0 : _state_timeRange.start) || null,
|
|
185
|
-
onChange: (v)=>state.setTime(
|
|
185
|
+
onChange: (v)=>state.setTime('start', v),
|
|
186
186
|
placeholderValue: timePlaceholder,
|
|
187
187
|
granularity: timeGranularity,
|
|
188
188
|
minValue: timeMinValue,
|
|
@@ -191,9 +191,9 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
191
191
|
hideTimeZone: props.hideTimeZone,
|
|
192
192
|
flex: true
|
|
193
193
|
}), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
|
|
194
|
-
label: stringFormatter.format(
|
|
194
|
+
label: stringFormatter.format('endTime'),
|
|
195
195
|
value: ((_state_timeRange1 = state.timeRange) === null || _state_timeRange1 === void 0 ? void 0 : _state_timeRange1.end) || null,
|
|
196
|
-
onChange: (v)=>state.setTime(
|
|
196
|
+
onChange: (v)=>state.setTime('end', v),
|
|
197
197
|
placeholderValue: timePlaceholder,
|
|
198
198
|
granularity: timeGranularity,
|
|
199
199
|
minValue: timeMinValue,
|
|
@@ -207,7 +207,7 @@ function $cb301300011a98f7$var$DateRangeDash() {
|
|
|
207
207
|
return /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
|
|
208
208
|
"aria-hidden": "true",
|
|
209
209
|
"data-testid": "date-range-dash",
|
|
210
|
-
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))),
|
|
210
|
+
className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-rangeDash')
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
/**
|
package/dist/Input.main.js
CHANGED
|
@@ -77,29 +77,29 @@ function $c3ebc4931d9b9977$var$Input(props, ref) {
|
|
|
77
77
|
// when there is enough space for the padding to be re-added. Ideally we'd
|
|
78
78
|
// use a resize observer on a parent element, but it's hard to know _what_
|
|
79
79
|
// parent element.
|
|
80
|
-
(0, $9cini$reactariautils.useEvent)((0, $9cini$react.useRef)(typeof window !==
|
|
80
|
+
(0, $9cini$reactariautils.useEvent)((0, $9cini$react.useRef)(typeof window !== 'undefined' ? window : null), 'resize', onResize);
|
|
81
81
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible, isFocused: isFocused } = (0, $9cini$reactariafocus.useFocusRing)({
|
|
82
82
|
isTextInput: true,
|
|
83
83
|
within: true
|
|
84
84
|
});
|
|
85
|
-
let isInvalid = validationState ===
|
|
86
|
-
let textfieldClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}, (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
92
|
-
let inputClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
96
|
-
let iconClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
85
|
+
let isInvalid = validationState === 'invalid' && !isDisabled;
|
|
86
|
+
let textfieldClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield', {
|
|
87
|
+
'spectrum-Textfield--invalid': isInvalid,
|
|
88
|
+
'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
|
|
89
|
+
'spectrum-Textfield--quiet': isQuiet,
|
|
90
|
+
'focus-ring': isFocusVisible && !disableFocusRing
|
|
91
|
+
}, (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-field'), className);
|
|
92
|
+
let inputClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-input', {
|
|
93
|
+
'is-disabled': isDisabled,
|
|
94
|
+
'is-focused': isFocused
|
|
95
|
+
}, (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-DateField-Input'), reservePadding && (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-input'), inputClassName);
|
|
96
|
+
let iconClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-validationIcon');
|
|
97
97
|
let validationIcon = null;
|
|
98
|
-
if (validationState ===
|
|
98
|
+
if (validationState === 'invalid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement((0, ($parcel$interopDefault($9cini$spectrumiconsuiAlertMedium))), {
|
|
99
99
|
"data-testid": "invalid-icon",
|
|
100
100
|
UNSAFE_className: iconClass
|
|
101
101
|
});
|
|
102
|
-
else if (validationState ===
|
|
102
|
+
else if (validationState === 'valid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement((0, ($parcel$interopDefault($9cini$spectrumiconsuiCheckmarkMedium))), {
|
|
103
103
|
"data-testid": "valid-icon",
|
|
104
104
|
UNSAFE_className: iconClass
|
|
105
105
|
});
|
|
@@ -113,7 +113,7 @@ function $c3ebc4931d9b9977$var$Input(props, ref) {
|
|
|
113
113
|
className: inputClass
|
|
114
114
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement("div", {
|
|
115
115
|
role: "presentation",
|
|
116
|
-
className: (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))),
|
|
116
|
+
className: (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-inputContents'),
|
|
117
117
|
ref: (0, $9cini$reactariautils.mergeRefs)(ref, inputRef)
|
|
118
118
|
}, children)), validationIcon);
|
|
119
119
|
}
|
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
|
}
|