@react-spectrum/datepicker 3.2.0 → 3.3.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/main.css +1 -1
- package/dist/main.js +349 -260
- package/dist/main.js.map +1 -1
- package/dist/module.js +350 -261
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/DatePicker.tsx +4 -3
- package/src/DateRangePicker.tsx +4 -3
- package/src/Input.tsx +22 -16
- package/src/styles.css +4 -4
package/dist/module.js
CHANGED
|
@@ -10,7 +10,7 @@ import {mergeProps as $aayOp$mergeProps, useLayoutEffect as $aayOp$useLayoutEffe
|
|
|
10
10
|
import $aayOp$react, {useRef as $aayOp$useRef, useCallback as $aayOp$useCallback, useMemo as $aayOp$useMemo, useState as $aayOp$useState, useImperativeHandle as $aayOp$useImperativeHandle} from "react";
|
|
11
11
|
import {useDatePicker as $aayOp$useDatePicker, useDateField as $aayOp$useDateField, useDateSegment as $aayOp$useDateSegment, useTimeField as $aayOp$useTimeField, useDisplayNames as $aayOp$useDisplayNames, useDateRangePicker as $aayOp$useDateRangePicker} from "@react-aria/datepicker";
|
|
12
12
|
import {useDatePickerState as $aayOp$useDatePickerState, useDateFieldState as $aayOp$useDateFieldState, useTimeFieldState as $aayOp$useTimeFieldState, useDateRangePickerState as $aayOp$useDateRangePickerState} from "@react-stately/datepicker";
|
|
13
|
-
import {useFocusRing as $aayOp$useFocusRing,
|
|
13
|
+
import {useFocusRing as $aayOp$useFocusRing, createFocusManager as $aayOp$createFocusManager} from "@react-aria/focus";
|
|
14
14
|
import {useHover as $aayOp$useHover} from "@react-aria/interactions";
|
|
15
15
|
import {useLocale as $aayOp$useLocale, useLocalizedStringFormatter as $aayOp$useLocalizedStringFormatter, useDateFormatter as $aayOp$useDateFormatter} from "@react-aria/i18n";
|
|
16
16
|
import {useProviderProps as $aayOp$useProviderProps, useProvider as $aayOp$useProvider} from "@react-spectrum/provider";
|
|
@@ -25,13 +25,54 @@ function $parcel$interopDefault(a) {
|
|
|
25
25
|
function $parcel$export(e, n, v, s) {
|
|
26
26
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
/*
|
|
29
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
30
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
31
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
32
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
33
|
+
*
|
|
34
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
35
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
36
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
37
|
+
* governing permissions and limitations under the License.
|
|
38
|
+
*/ /// <reference types="css-module-types" />
|
|
39
|
+
/*
|
|
40
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
41
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
42
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
43
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
44
|
+
*
|
|
45
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
46
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
47
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
48
|
+
* governing permissions and limitations under the License.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
55
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
56
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
57
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
58
|
+
*
|
|
59
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
60
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
61
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
62
|
+
* governing permissions and limitations under the License.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/*
|
|
66
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
67
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
68
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
69
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
70
|
+
*
|
|
71
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
72
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
73
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
74
|
+
* governing permissions and limitations under the License.
|
|
75
|
+
*/
|
|
35
76
|
|
|
36
77
|
var $465eb3a688ef3440$exports = {};
|
|
37
78
|
|
|
@@ -104,45 +145,45 @@ $465eb3a688ef3440$export$8d47712a13573e39 = "react-spectrum-Datepicker-timeField
|
|
|
104
145
|
function $cfa347761f172638$export$6388987c5223b54e({ segment: segment , state: state , ...otherProps }) {
|
|
105
146
|
switch(segment.type){
|
|
106
147
|
// A separator, e.g. punctuation
|
|
107
|
-
case
|
|
108
|
-
return
|
|
148
|
+
case "literal":
|
|
149
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement($cfa347761f172638$var$LiteralSegment, {
|
|
109
150
|
segment: segment
|
|
110
|
-
})
|
|
151
|
+
});
|
|
111
152
|
// Editable segment
|
|
112
153
|
default:
|
|
113
|
-
return
|
|
154
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement($cfa347761f172638$var$EditableSegment, {
|
|
114
155
|
segment: segment,
|
|
115
156
|
state: state,
|
|
116
157
|
...otherProps
|
|
117
|
-
})
|
|
158
|
+
});
|
|
118
159
|
}
|
|
119
160
|
}
|
|
120
161
|
function $cfa347761f172638$var$LiteralSegment({ segment: segment }) {
|
|
121
|
-
return
|
|
162
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement("span", {
|
|
122
163
|
"aria-hidden": "true",
|
|
123
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
124
|
-
"data-testid": segment.type ===
|
|
125
|
-
}, segment.text)
|
|
164
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-literal"),
|
|
165
|
+
"data-testid": segment.type === "literal" ? undefined : segment.type
|
|
166
|
+
}, segment.text);
|
|
126
167
|
}
|
|
127
168
|
function $cfa347761f172638$var$EditableSegment({ segment: segment , state: state }) {
|
|
128
|
-
let ref = $aayOp$useRef();
|
|
129
|
-
let { segmentProps: segmentProps } = $aayOp$useDateSegment(segment, state, ref);
|
|
130
|
-
return
|
|
169
|
+
let ref = (0, $aayOp$useRef)();
|
|
170
|
+
let { segmentProps: segmentProps } = (0, $aayOp$useDateSegment)(segment, state, ref);
|
|
171
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
131
172
|
...segmentProps,
|
|
132
173
|
ref: ref,
|
|
133
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
134
|
-
|
|
135
|
-
|
|
174
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-DatePicker-cell", {
|
|
175
|
+
"is-placeholder": segment.isPlaceholder,
|
|
176
|
+
"is-read-only": !segment.isEditable
|
|
136
177
|
}),
|
|
137
178
|
style: {
|
|
138
179
|
...segmentProps.style,
|
|
139
|
-
minWidth: segment.maxValue != null ? String(segment.maxValue).length +
|
|
180
|
+
minWidth: segment.maxValue != null ? String(segment.maxValue).length + "ch" : null
|
|
140
181
|
},
|
|
141
182
|
"data-testid": segment.type
|
|
142
|
-
}, /*#__PURE__*/ $aayOp$react.createElement("span", {
|
|
183
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement("span", {
|
|
143
184
|
"aria-hidden": "true",
|
|
144
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
145
|
-
}, segment.placeholder), segment.isPlaceholder ?
|
|
185
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-DatePicker-placeholder")
|
|
186
|
+
}, segment.placeholder), segment.isPlaceholder ? "" : segment.text);
|
|
146
187
|
}
|
|
147
188
|
|
|
148
189
|
|
|
@@ -153,28 +194,27 @@ function $cfa347761f172638$var$EditableSegment({ segment: segment , state: state
|
|
|
153
194
|
|
|
154
195
|
function $d2bb88c82604b25f$export$34dc4cfa15ead1(props) {
|
|
155
196
|
let { isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired , inputClassName: inputClassName } = props;
|
|
156
|
-
let ref = $aayOp$useRef();
|
|
157
|
-
let { locale: locale } = $aayOp$useLocale();
|
|
158
|
-
let state = $aayOp$useDateFieldState({
|
|
197
|
+
let ref = (0, $aayOp$useRef)();
|
|
198
|
+
let { locale: locale } = (0, $aayOp$useLocale)();
|
|
199
|
+
let state = (0, $aayOp$useDateFieldState)({
|
|
159
200
|
...props,
|
|
160
201
|
locale: locale,
|
|
161
202
|
createCalendar: $aayOp$createCalendar
|
|
162
203
|
});
|
|
163
|
-
let { fieldProps: fieldProps } = $aayOp$useDateField(props, state, ref);
|
|
164
|
-
return
|
|
204
|
+
let { fieldProps: fieldProps } = (0, $aayOp$useDateField)(props, state, ref);
|
|
205
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
165
206
|
...fieldProps,
|
|
166
|
-
"data-testid": props[
|
|
167
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
207
|
+
"data-testid": props["data-testid"],
|
|
208
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-segments", inputClassName),
|
|
168
209
|
ref: ref
|
|
169
|
-
}, state.segments.map((segment, i)=>/*#__PURE__*/ $aayOp$react.createElement($cfa347761f172638$export$6388987c5223b54e, {
|
|
210
|
+
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $aayOp$react).createElement((0, $cfa347761f172638$export$6388987c5223b54e), {
|
|
170
211
|
key: i,
|
|
171
212
|
segment: segment,
|
|
172
213
|
state: state,
|
|
173
214
|
isDisabled: isDisabled,
|
|
174
215
|
isReadOnly: isReadOnly,
|
|
175
216
|
isRequired: isRequired
|
|
176
|
-
})
|
|
177
|
-
)));
|
|
217
|
+
})));
|
|
178
218
|
}
|
|
179
219
|
|
|
180
220
|
|
|
@@ -182,8 +222,17 @@ function $d2bb88c82604b25f$export$34dc4cfa15ead1(props) {
|
|
|
182
222
|
|
|
183
223
|
|
|
184
224
|
|
|
185
|
-
|
|
186
|
-
|
|
225
|
+
/*
|
|
226
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
227
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
228
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
229
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
230
|
+
*
|
|
231
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
232
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
233
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
234
|
+
* governing permissions and limitations under the License.
|
|
235
|
+
*/
|
|
187
236
|
|
|
188
237
|
|
|
189
238
|
|
|
@@ -193,6 +242,7 @@ var $c14528ddc146317f$exports = {};
|
|
|
193
242
|
|
|
194
243
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-input", () => $c14528ddc146317f$export$1ac009feb2b0bd0c, (v) => $c14528ddc146317f$export$1ac009feb2b0bd0c = v);
|
|
195
244
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield", () => $c14528ddc146317f$export$2c8a10299d8b3418, (v) => $c14528ddc146317f$export$2c8a10299d8b3418 = v);
|
|
245
|
+
$parcel$export($c14528ddc146317f$exports, "focus-ring", () => $c14528ddc146317f$export$f39a09f249340e2a, (v) => $c14528ddc146317f$export$f39a09f249340e2a = v);
|
|
196
246
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--quiet", () => $c14528ddc146317f$export$bffd5e3d61a81737, (v) => $c14528ddc146317f$export$bffd5e3d61a81737 = v);
|
|
197
247
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--multiline", () => $c14528ddc146317f$export$9699f1c538a448a0, (v) => $c14528ddc146317f$export$9699f1c538a448a0 = v);
|
|
198
248
|
$parcel$export($c14528ddc146317f$exports, "is-placeholder", () => $c14528ddc146317f$export$e5b2f5233e4e5194, (v) => $c14528ddc146317f$export$e5b2f5233e4e5194 = v);
|
|
@@ -201,15 +251,16 @@ $parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--valid", () => $c1
|
|
|
201
251
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--invalid", () => $c14528ddc146317f$export$58e50b10d30123df, (v) => $c14528ddc146317f$export$58e50b10d30123df = v);
|
|
202
252
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--loadable", () => $c14528ddc146317f$export$14fd30fea6f1348c, (v) => $c14528ddc146317f$export$14fd30fea6f1348c = v);
|
|
203
253
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-wrapper", () => $c14528ddc146317f$export$dd1165e0e6012973, (v) => $c14528ddc146317f$export$dd1165e0e6012973 = v);
|
|
254
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-wrapper--quiet", () => $c14528ddc146317f$export$9fcb3d6af94a9d12, (v) => $c14528ddc146317f$export$9fcb3d6af94a9d12 = v);
|
|
204
255
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-validationIcon", () => $c14528ddc146317f$export$cf0ead5b44db0da3, (v) => $c14528ddc146317f$export$cf0ead5b44db0da3 = v);
|
|
205
256
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-icon", () => $c14528ddc146317f$export$222d1ccd1870be1d, (v) => $c14528ddc146317f$export$222d1ccd1870be1d = v);
|
|
206
257
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-inputIcon", () => $c14528ddc146317f$export$c1cdcaa5fe76a871, (v) => $c14528ddc146317f$export$c1cdcaa5fe76a871 = v);
|
|
207
258
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-circleLoader", () => $c14528ddc146317f$export$82a249fb4d6127, (v) => $c14528ddc146317f$export$82a249fb4d6127 = v);
|
|
208
259
|
$parcel$export($c14528ddc146317f$exports, "is-focused", () => $c14528ddc146317f$export$e7dc768d35940237, (v) => $c14528ddc146317f$export$e7dc768d35940237 = v);
|
|
209
|
-
$parcel$export($c14528ddc146317f$exports, "focus-ring", () => $c14528ddc146317f$export$f39a09f249340e2a, (v) => $c14528ddc146317f$export$f39a09f249340e2a = v);
|
|
210
260
|
$parcel$export($c14528ddc146317f$exports, "is-disabled", () => $c14528ddc146317f$export$d35bc1e505d1ebbf, (v) => $c14528ddc146317f$export$d35bc1e505d1ebbf = v);
|
|
211
261
|
var $c14528ddc146317f$export$1ac009feb2b0bd0c;
|
|
212
262
|
var $c14528ddc146317f$export$2c8a10299d8b3418;
|
|
263
|
+
var $c14528ddc146317f$export$f39a09f249340e2a;
|
|
213
264
|
var $c14528ddc146317f$export$bffd5e3d61a81737;
|
|
214
265
|
var $c14528ddc146317f$export$9699f1c538a448a0;
|
|
215
266
|
var $c14528ddc146317f$export$e5b2f5233e4e5194;
|
|
@@ -218,15 +269,16 @@ var $c14528ddc146317f$export$c2abbc3f970170b7;
|
|
|
218
269
|
var $c14528ddc146317f$export$58e50b10d30123df;
|
|
219
270
|
var $c14528ddc146317f$export$14fd30fea6f1348c;
|
|
220
271
|
var $c14528ddc146317f$export$dd1165e0e6012973;
|
|
272
|
+
var $c14528ddc146317f$export$9fcb3d6af94a9d12;
|
|
221
273
|
var $c14528ddc146317f$export$cf0ead5b44db0da3;
|
|
222
274
|
var $c14528ddc146317f$export$222d1ccd1870be1d;
|
|
223
275
|
var $c14528ddc146317f$export$c1cdcaa5fe76a871;
|
|
224
276
|
var $c14528ddc146317f$export$82a249fb4d6127;
|
|
225
277
|
var $c14528ddc146317f$export$e7dc768d35940237;
|
|
226
|
-
var $c14528ddc146317f$export$f39a09f249340e2a;
|
|
227
278
|
var $c14528ddc146317f$export$d35bc1e505d1ebbf;
|
|
228
279
|
$c14528ddc146317f$export$1ac009feb2b0bd0c = "spectrum-Textfield-input_73bc77";
|
|
229
280
|
$c14528ddc146317f$export$2c8a10299d8b3418 = "spectrum-Textfield_73bc77";
|
|
281
|
+
$c14528ddc146317f$export$f39a09f249340e2a = "focus-ring_73bc77";
|
|
230
282
|
$c14528ddc146317f$export$bffd5e3d61a81737 = "spectrum-Textfield--quiet_73bc77";
|
|
231
283
|
$c14528ddc146317f$export$9699f1c538a448a0 = "spectrum-Textfield--multiline_73bc77";
|
|
232
284
|
$c14528ddc146317f$export$e5b2f5233e4e5194 = "is-placeholder_73bc77";
|
|
@@ -235,23 +287,24 @@ $c14528ddc146317f$export$c2abbc3f970170b7 = "spectrum-Textfield--valid_73bc77";
|
|
|
235
287
|
$c14528ddc146317f$export$58e50b10d30123df = "spectrum-Textfield--invalid_73bc77";
|
|
236
288
|
$c14528ddc146317f$export$14fd30fea6f1348c = "spectrum-Textfield--loadable_73bc77";
|
|
237
289
|
$c14528ddc146317f$export$dd1165e0e6012973 = "spectrum-Textfield-wrapper_73bc77";
|
|
290
|
+
$c14528ddc146317f$export$9fcb3d6af94a9d12 = "spectrum-Textfield-wrapper--quiet_73bc77";
|
|
238
291
|
$c14528ddc146317f$export$cf0ead5b44db0da3 = "spectrum-Textfield-validationIcon_73bc77";
|
|
239
292
|
$c14528ddc146317f$export$222d1ccd1870be1d = "spectrum-Textfield-icon_73bc77";
|
|
240
293
|
$c14528ddc146317f$export$c1cdcaa5fe76a871 = "spectrum-Textfield-inputIcon_73bc77";
|
|
241
294
|
$c14528ddc146317f$export$82a249fb4d6127 = "spectrum-Textfield-circleLoader_73bc77";
|
|
242
295
|
$c14528ddc146317f$export$e7dc768d35940237 = "is-focused_73bc77";
|
|
243
|
-
$c14528ddc146317f$export$f39a09f249340e2a = "focus-ring_73bc77";
|
|
244
296
|
$c14528ddc146317f$export$d35bc1e505d1ebbf = "is-disabled_73bc77";
|
|
245
297
|
|
|
246
298
|
|
|
299
|
+
|
|
247
300
|
function $79348162c55d687f$var$Input(props, ref) {
|
|
248
|
-
let inputRef = $aayOp$useRef(null);
|
|
249
|
-
let { isDisabled: isDisabled , isQuiet: isQuiet , inputClassName: inputClassName , validationState: validationState , children: children , fieldProps: fieldProps , className: className , style: style } = props;
|
|
301
|
+
let inputRef = (0, $aayOp$useRef)(null);
|
|
302
|
+
let { isDisabled: isDisabled , isQuiet: isQuiet , inputClassName: inputClassName , validationState: validationState , children: children , fieldProps: fieldProps , className: className , style: style , disableFocusRing: disableFocusRing } = props;
|
|
250
303
|
// Reserve padding for the error icon when the width of the input is unconstrained.
|
|
251
304
|
// When constrained, don't reserve space because adding it only when invalid will
|
|
252
305
|
// not cause a layout shift.
|
|
253
|
-
let [
|
|
254
|
-
let onResize = $aayOp$useCallback(()=>setReservePadding(function*(reservePadding) {
|
|
306
|
+
let [reservePadding, setReservePadding] = (0, $aayOp$useValueEffect)(false);
|
|
307
|
+
let onResize = (0, $aayOp$useCallback)(()=>setReservePadding(function*(reservePadding) {
|
|
255
308
|
if (inputRef.current) {
|
|
256
309
|
if (reservePadding) // Try to collapse padding if the content is clipped.
|
|
257
310
|
{
|
|
@@ -263,21 +316,20 @@ function $79348162c55d687f$var$Input(props, ref) {
|
|
|
263
316
|
}
|
|
264
317
|
} else // Try to add padding if the content is not clipped.
|
|
265
318
|
if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {
|
|
266
|
-
let
|
|
319
|
+
let width1 = inputRef.current.parentElement.offsetWidth;
|
|
267
320
|
yield true;
|
|
268
321
|
// If adding padding does not change the width (i.e. width is constrained), remove it again.
|
|
269
|
-
if (inputRef.current.parentElement.offsetWidth ===
|
|
322
|
+
if (inputRef.current.parentElement.offsetWidth === width1) yield false;
|
|
270
323
|
}
|
|
271
324
|
}
|
|
272
|
-
})
|
|
273
|
-
, [
|
|
325
|
+
}), [
|
|
274
326
|
inputRef,
|
|
275
327
|
setReservePadding
|
|
276
328
|
]);
|
|
277
|
-
$aayOp$useLayoutEffect(onResize, [
|
|
329
|
+
(0, $aayOp$useLayoutEffect)(onResize, [
|
|
278
330
|
onResize
|
|
279
331
|
]);
|
|
280
|
-
$aayOp$useResizeObserver({
|
|
332
|
+
(0, $aayOp$useResizeObserver)({
|
|
281
333
|
ref: inputRef,
|
|
282
334
|
onResize: onResize
|
|
283
335
|
});
|
|
@@ -285,47 +337,48 @@ function $79348162c55d687f$var$Input(props, ref) {
|
|
|
285
337
|
// when there is enough space for the padding to be re-added. Ideally we'd
|
|
286
338
|
// use a resize observer on a parent element, but it's hard to know _what_
|
|
287
339
|
// parent element.
|
|
288
|
-
$aayOp$useEvent($aayOp$useRef(typeof window !==
|
|
289
|
-
let
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
340
|
+
(0, $aayOp$useEvent)((0, $aayOp$useRef)(typeof window !== "undefined" ? window : null), "resize", onResize);
|
|
341
|
+
let { focusProps: focusProps , isFocusVisible: isFocusVisible , isFocused: isFocused } = (0, $aayOp$useFocusRing)({
|
|
342
|
+
isTextInput: true,
|
|
343
|
+
within: true
|
|
344
|
+
});
|
|
345
|
+
let isInvalid = validationState === "invalid" && !isDisabled;
|
|
346
|
+
let textfieldClass = (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield", {
|
|
347
|
+
"spectrum-Textfield--invalid": isInvalid,
|
|
348
|
+
"spectrum-Textfield--valid": validationState === "valid" && !isDisabled,
|
|
349
|
+
"spectrum-Textfield--quiet": isQuiet,
|
|
350
|
+
"focus-ring": isFocusVisible && !disableFocusRing
|
|
351
|
+
}, (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-field"), className);
|
|
352
|
+
let inputClass = (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-input", {
|
|
353
|
+
"is-disabled": isDisabled,
|
|
354
|
+
"is-invalid": isInvalid,
|
|
355
|
+
"is-focused": isFocused
|
|
356
|
+
}, reservePadding && (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-input"), inputClassName);
|
|
357
|
+
let iconClass = (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-validationIcon");
|
|
300
358
|
let validationIcon = null;
|
|
301
|
-
if (validationState ===
|
|
359
|
+
if (validationState === "invalid" && !isDisabled) validationIcon = /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$spectrumiconsuiAlertMedium), {
|
|
302
360
|
"data-testid": "invalid-icon",
|
|
303
361
|
UNSAFE_className: iconClass
|
|
304
362
|
});
|
|
305
|
-
else if (validationState ===
|
|
363
|
+
else if (validationState === "valid" && !isDisabled) validationIcon = /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$spectrumiconsuiCheckmarkMedium), {
|
|
306
364
|
"data-testid": "valid-icon",
|
|
307
365
|
UNSAFE_className: iconClass
|
|
308
366
|
});
|
|
309
|
-
return
|
|
367
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
310
368
|
role: "presentation",
|
|
311
|
-
...fieldProps,
|
|
369
|
+
...(0, $aayOp$mergeProps)(fieldProps, focusProps),
|
|
312
370
|
className: textfieldClass,
|
|
313
371
|
style: style
|
|
314
|
-
}, /*#__PURE__*/ $aayOp$react.createElement(
|
|
315
|
-
focusClass: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'is-focused'),
|
|
316
|
-
focusRingClass: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'focus-ring'),
|
|
317
|
-
isTextInput: true,
|
|
318
|
-
within: true
|
|
319
|
-
}, /*#__PURE__*/ $aayOp$react.createElement("div", {
|
|
372
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
320
373
|
role: "presentation",
|
|
321
374
|
className: inputClass
|
|
322
|
-
}, /*#__PURE__*/ $aayOp$react.createElement("div", {
|
|
375
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
323
376
|
role: "presentation",
|
|
324
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
325
|
-
ref: $aayOp$mergeRefs(ref, inputRef)
|
|
326
|
-
}, children))
|
|
377
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-inputContents"),
|
|
378
|
+
ref: (0, $aayOp$mergeRefs)(ref, inputRef)
|
|
379
|
+
}, children)), validationIcon);
|
|
327
380
|
}
|
|
328
|
-
const $79348162c55d687f$export$f5b8910cec6cf069 = /*#__PURE__*/ $aayOp$react.forwardRef($79348162c55d687f$var$Input);
|
|
381
|
+
const $79348162c55d687f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $aayOp$react).forwardRef($79348162c55d687f$var$Input);
|
|
329
382
|
|
|
330
383
|
|
|
331
384
|
var $71a986712918c3de$exports = {};
|
|
@@ -645,10 +698,11 @@ $71a986712918c3de$exports = {
|
|
|
645
698
|
var $8fb52a80fe52b1c7$exports = {};
|
|
646
699
|
|
|
647
700
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup", () => $8fb52a80fe52b1c7$export$5be359c1227eedcb, (v) => $8fb52a80fe52b1c7$export$5be359c1227eedcb = v);
|
|
701
|
+
$parcel$export($8fb52a80fe52b1c7$exports, "focus-ring", () => $8fb52a80fe52b1c7$export$f39a09f249340e2a, (v) => $8fb52a80fe52b1c7$export$f39a09f249340e2a = v);
|
|
702
|
+
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup--quiet", () => $8fb52a80fe52b1c7$export$ebf265ffc062029b, (v) => $8fb52a80fe52b1c7$export$ebf265ffc062029b = v);
|
|
648
703
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-FieldButton", () => $8fb52a80fe52b1c7$export$a024c99ecf6b5741, (v) => $8fb52a80fe52b1c7$export$a024c99ecf6b5741 = v);
|
|
649
704
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-disabled", () => $8fb52a80fe52b1c7$export$d35bc1e505d1ebbf, (v) => $8fb52a80fe52b1c7$export$d35bc1e505d1ebbf = v);
|
|
650
705
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup--invalid", () => $8fb52a80fe52b1c7$export$3b48509739a9cda0, (v) => $8fb52a80fe52b1c7$export$3b48509739a9cda0 = v);
|
|
651
|
-
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup--quiet", () => $8fb52a80fe52b1c7$export$ebf265ffc062029b, (v) => $8fb52a80fe52b1c7$export$ebf265ffc062029b = v);
|
|
652
706
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup-field", () => $8fb52a80fe52b1c7$export$ea77459595e26bec, (v) => $8fb52a80fe52b1c7$export$ea77459595e26bec = v);
|
|
653
707
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup-input-validationIcon", () => $8fb52a80fe52b1c7$export$f7ab13ee113f4884, (v) => $8fb52a80fe52b1c7$export$f7ab13ee113f4884 = v);
|
|
654
708
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup-input-circleLoader", () => $8fb52a80fe52b1c7$export$dcc9e00cdad967fa, (v) => $8fb52a80fe52b1c7$export$dcc9e00cdad967fa = v);
|
|
@@ -663,14 +717,14 @@ $parcel$export($8fb52a80fe52b1c7$exports, "spectrum-Datepicker--rangeDash", () =
|
|
|
663
717
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-focused", () => $8fb52a80fe52b1c7$export$e7dc768d35940237, (v) => $8fb52a80fe52b1c7$export$e7dc768d35940237 = v);
|
|
664
718
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-Datepicker-focusRing", () => $8fb52a80fe52b1c7$export$eb262b15b9261fde, (v) => $8fb52a80fe52b1c7$export$eb262b15b9261fde = v);
|
|
665
719
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-hovered", () => $8fb52a80fe52b1c7$export$b8813cd5d7824ce7, (v) => $8fb52a80fe52b1c7$export$b8813cd5d7824ce7 = v);
|
|
666
|
-
$parcel$export($8fb52a80fe52b1c7$exports, "focus-ring", () => $8fb52a80fe52b1c7$export$f39a09f249340e2a, (v) => $8fb52a80fe52b1c7$export$f39a09f249340e2a = v);
|
|
667
720
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-selected", () => $8fb52a80fe52b1c7$export$1e0fb04f31d3c22a, (v) => $8fb52a80fe52b1c7$export$1e0fb04f31d3c22a = v);
|
|
668
721
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-FieldButton--invalid", () => $8fb52a80fe52b1c7$export$c9f503f672e8a3c1, (v) => $8fb52a80fe52b1c7$export$c9f503f672e8a3c1 = v);
|
|
669
722
|
var $8fb52a80fe52b1c7$export$5be359c1227eedcb;
|
|
723
|
+
var $8fb52a80fe52b1c7$export$f39a09f249340e2a;
|
|
724
|
+
var $8fb52a80fe52b1c7$export$ebf265ffc062029b;
|
|
670
725
|
var $8fb52a80fe52b1c7$export$a024c99ecf6b5741;
|
|
671
726
|
var $8fb52a80fe52b1c7$export$d35bc1e505d1ebbf;
|
|
672
727
|
var $8fb52a80fe52b1c7$export$3b48509739a9cda0;
|
|
673
|
-
var $8fb52a80fe52b1c7$export$ebf265ffc062029b;
|
|
674
728
|
var $8fb52a80fe52b1c7$export$ea77459595e26bec;
|
|
675
729
|
var $8fb52a80fe52b1c7$export$f7ab13ee113f4884;
|
|
676
730
|
var $8fb52a80fe52b1c7$export$dcc9e00cdad967fa;
|
|
@@ -685,14 +739,14 @@ var $8fb52a80fe52b1c7$export$202113e883898dc;
|
|
|
685
739
|
var $8fb52a80fe52b1c7$export$e7dc768d35940237;
|
|
686
740
|
var $8fb52a80fe52b1c7$export$eb262b15b9261fde;
|
|
687
741
|
var $8fb52a80fe52b1c7$export$b8813cd5d7824ce7;
|
|
688
|
-
var $8fb52a80fe52b1c7$export$f39a09f249340e2a;
|
|
689
742
|
var $8fb52a80fe52b1c7$export$1e0fb04f31d3c22a;
|
|
690
743
|
var $8fb52a80fe52b1c7$export$c9f503f672e8a3c1;
|
|
691
744
|
$8fb52a80fe52b1c7$export$5be359c1227eedcb = "spectrum-InputGroup_a0942f";
|
|
745
|
+
$8fb52a80fe52b1c7$export$f39a09f249340e2a = "focus-ring_a0942f";
|
|
746
|
+
$8fb52a80fe52b1c7$export$ebf265ffc062029b = "spectrum-InputGroup--quiet_a0942f";
|
|
692
747
|
$8fb52a80fe52b1c7$export$a024c99ecf6b5741 = "spectrum-FieldButton_a0942f";
|
|
693
748
|
$8fb52a80fe52b1c7$export$d35bc1e505d1ebbf = "is-disabled_a0942f";
|
|
694
749
|
$8fb52a80fe52b1c7$export$3b48509739a9cda0 = "spectrum-InputGroup--invalid_a0942f";
|
|
695
|
-
$8fb52a80fe52b1c7$export$ebf265ffc062029b = "spectrum-InputGroup--quiet_a0942f";
|
|
696
750
|
$8fb52a80fe52b1c7$export$ea77459595e26bec = "spectrum-InputGroup-field_a0942f";
|
|
697
751
|
$8fb52a80fe52b1c7$export$f7ab13ee113f4884 = "spectrum-InputGroup-input-validationIcon_a0942f";
|
|
698
752
|
$8fb52a80fe52b1c7$export$dcc9e00cdad967fa = "spectrum-InputGroup-input-circleLoader_a0942f";
|
|
@@ -707,18 +761,37 @@ $8fb52a80fe52b1c7$export$202113e883898dc = "spectrum-Datepicker--rangeDash_a0942
|
|
|
707
761
|
$8fb52a80fe52b1c7$export$e7dc768d35940237 = "is-focused_a0942f";
|
|
708
762
|
$8fb52a80fe52b1c7$export$eb262b15b9261fde = "spectrum-Datepicker-focusRing_a0942f";
|
|
709
763
|
$8fb52a80fe52b1c7$export$b8813cd5d7824ce7 = "is-hovered_a0942f";
|
|
710
|
-
$8fb52a80fe52b1c7$export$f39a09f249340e2a = "focus-ring_a0942f";
|
|
711
764
|
$8fb52a80fe52b1c7$export$1e0fb04f31d3c22a = "is-selected_a0942f";
|
|
712
765
|
$8fb52a80fe52b1c7$export$c9f503f672e8a3c1 = "spectrum-FieldButton--invalid_a0942f";
|
|
713
766
|
|
|
714
767
|
|
|
768
|
+
/*
|
|
769
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
770
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
771
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
772
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
773
|
+
*
|
|
774
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
775
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
776
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
777
|
+
* governing permissions and limitations under the License.
|
|
778
|
+
*/
|
|
715
779
|
|
|
716
780
|
|
|
717
781
|
|
|
718
782
|
|
|
719
783
|
|
|
720
|
-
|
|
721
|
-
|
|
784
|
+
/*
|
|
785
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
786
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
787
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
788
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
789
|
+
*
|
|
790
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
791
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
792
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
793
|
+
* governing permissions and limitations under the License.
|
|
794
|
+
*/
|
|
722
795
|
|
|
723
796
|
|
|
724
797
|
|
|
@@ -726,17 +799,17 @@ $8fb52a80fe52b1c7$export$c9f503f672e8a3c1 = "spectrum-FieldButton--invalid_a0942
|
|
|
726
799
|
|
|
727
800
|
|
|
728
801
|
function $04e96200274b03de$export$322f4580ccd8dde6(props) {
|
|
729
|
-
let formatter = $aayOp$useDateFormatter({
|
|
730
|
-
dateStyle:
|
|
802
|
+
let formatter = (0, $aayOp$useDateFormatter)({
|
|
803
|
+
dateStyle: "short"
|
|
731
804
|
});
|
|
732
|
-
let displayNames = $aayOp$useDisplayNames();
|
|
733
|
-
return $aayOp$useMemo(()=>{
|
|
805
|
+
let displayNames = (0, $aayOp$useDisplayNames)();
|
|
806
|
+
return (0, $aayOp$useMemo)(()=>{
|
|
734
807
|
if (props.description) return props.description;
|
|
735
808
|
if (props.showFormatHelpText) return formatter.formatToParts(new Date()).map((s)=>{
|
|
736
|
-
if (s.type ===
|
|
809
|
+
if (s.type === "literal") return s.value;
|
|
737
810
|
return displayNames.of(s.type);
|
|
738
|
-
}).join(
|
|
739
|
-
return
|
|
811
|
+
}).join(" ");
|
|
812
|
+
return "";
|
|
740
813
|
}, [
|
|
741
814
|
props.description,
|
|
742
815
|
props.showFormatHelpText,
|
|
@@ -745,15 +818,14 @@ function $04e96200274b03de$export$322f4580ccd8dde6(props) {
|
|
|
745
818
|
]);
|
|
746
819
|
}
|
|
747
820
|
function $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
748
|
-
let { scale: scale } = $aayOp$useProvider();
|
|
749
|
-
let [visibleMonths, setVisibleMonths] = $aayOp$useState($04e96200274b03de$var$getVisibleMonths(scale));
|
|
750
|
-
$aayOp$useLayoutEffect(()=>{
|
|
751
|
-
let onResize = ()=>setVisibleMonths($04e96200274b03de$var$getVisibleMonths(scale))
|
|
752
|
-
;
|
|
821
|
+
let { scale: scale } = (0, $aayOp$useProvider)();
|
|
822
|
+
let [visibleMonths, setVisibleMonths] = (0, $aayOp$useState)($04e96200274b03de$var$getVisibleMonths(scale));
|
|
823
|
+
(0, $aayOp$useLayoutEffect)(()=>{
|
|
824
|
+
let onResize = ()=>setVisibleMonths($04e96200274b03de$var$getVisibleMonths(scale));
|
|
753
825
|
onResize();
|
|
754
|
-
window.addEventListener(
|
|
826
|
+
window.addEventListener("resize", onResize);
|
|
755
827
|
return ()=>{
|
|
756
|
-
window.removeEventListener(
|
|
828
|
+
window.removeEventListener("resize", onResize);
|
|
757
829
|
};
|
|
758
830
|
}, [
|
|
759
831
|
scale
|
|
@@ -761,23 +833,22 @@ function $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths) {
|
|
|
761
833
|
return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));
|
|
762
834
|
}
|
|
763
835
|
function $04e96200274b03de$var$getVisibleMonths(scale) {
|
|
764
|
-
if (typeof window ===
|
|
765
|
-
let monthWidth = scale ===
|
|
766
|
-
let gap = scale ===
|
|
767
|
-
let popoverPadding = scale ===
|
|
836
|
+
if (typeof window === "undefined") return 1;
|
|
837
|
+
let monthWidth = scale === "large" ? 336 : 280;
|
|
838
|
+
let gap = scale === "large" ? 30 : 24;
|
|
839
|
+
let popoverPadding = scale === "large" ? 32 : 48;
|
|
768
840
|
return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
|
|
769
841
|
}
|
|
770
842
|
function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
771
|
-
let domRef = $aayOp$useRef();
|
|
772
|
-
$aayOp$useImperativeHandle(ref, ()=>({
|
|
773
|
-
|
|
843
|
+
let domRef = (0, $aayOp$useRef)();
|
|
844
|
+
(0, $aayOp$useImperativeHandle)(ref, ()=>({
|
|
845
|
+
...(0, $aayOp$createDOMRef)(domRef),
|
|
774
846
|
focus () {
|
|
775
|
-
$aayOp$createFocusManager(domRef).focusFirst({
|
|
847
|
+
(0, $aayOp$createFocusManager)(domRef).focusFirst({
|
|
776
848
|
tabbable: true
|
|
777
849
|
});
|
|
778
850
|
}
|
|
779
|
-
})
|
|
780
|
-
);
|
|
851
|
+
}));
|
|
781
852
|
return domRef;
|
|
782
853
|
}
|
|
783
854
|
|
|
@@ -787,17 +858,17 @@ function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
|
787
858
|
|
|
788
859
|
|
|
789
860
|
function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
790
|
-
props = $aayOp$useProviderProps(props);
|
|
861
|
+
props = (0, $aayOp$useProviderProps)(props);
|
|
791
862
|
let { autoFocus: autoFocus , isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired , isQuiet: isQuiet } = props;
|
|
792
|
-
let domRef = $04e96200274b03de$export$71a23a36270e4bf0(ref);
|
|
793
|
-
let { locale: locale } = $aayOp$useLocale();
|
|
794
|
-
let state = $aayOp$useTimeFieldState({
|
|
863
|
+
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
864
|
+
let { locale: locale } = (0, $aayOp$useLocale)();
|
|
865
|
+
let state = (0, $aayOp$useTimeFieldState)({
|
|
795
866
|
...props,
|
|
796
867
|
locale: locale
|
|
797
868
|
});
|
|
798
|
-
let inputRef = $aayOp$useRef(null);
|
|
799
|
-
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $aayOp$useTimeField(props, state, inputRef);
|
|
800
|
-
return
|
|
869
|
+
let inputRef = (0, $aayOp$useRef)(null);
|
|
870
|
+
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $aayOp$useTimeField)(props, state, inputRef);
|
|
871
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Field), {
|
|
801
872
|
...props,
|
|
802
873
|
ref: domRef,
|
|
803
874
|
elementType: "span",
|
|
@@ -805,29 +876,28 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
805
876
|
descriptionProps: descriptionProps,
|
|
806
877
|
errorMessageProps: errorMessageProps,
|
|
807
878
|
validationState: state.validationState,
|
|
808
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
809
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($79348162c55d687f$export$f5b8910cec6cf069, {
|
|
879
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-TimeField-fieldWrapper")
|
|
880
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
810
881
|
ref: inputRef,
|
|
811
882
|
fieldProps: fieldProps,
|
|
812
883
|
isDisabled: isDisabled,
|
|
813
884
|
isQuiet: isQuiet,
|
|
814
885
|
autoFocus: autoFocus,
|
|
815
886
|
validationState: state.validationState,
|
|
816
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
817
|
-
}, state.segments.map((segment, i)=>/*#__PURE__*/ $aayOp$react.createElement($cfa347761f172638$export$6388987c5223b54e, {
|
|
887
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-TimeField")
|
|
888
|
+
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $aayOp$react).createElement((0, $cfa347761f172638$export$6388987c5223b54e), {
|
|
818
889
|
key: i,
|
|
819
890
|
segment: segment,
|
|
820
891
|
state: state,
|
|
821
892
|
isDisabled: isDisabled,
|
|
822
893
|
isReadOnly: isReadOnly,
|
|
823
894
|
isRequired: isRequired
|
|
824
|
-
})
|
|
825
|
-
))));
|
|
895
|
+
}))));
|
|
826
896
|
}
|
|
827
897
|
/**
|
|
828
898
|
* TimeFields allow users to enter and edit time values using a keyboard.
|
|
829
899
|
* Each part of the time is displayed in an individually editable segment.
|
|
830
|
-
*/ const $f0a04554754386b6$export$5eaee2322dd727eb = /*#__PURE__*/ $aayOp$react.forwardRef($f0a04554754386b6$var$TimeField);
|
|
900
|
+
*/ const $f0a04554754386b6$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $aayOp$react).forwardRef($f0a04554754386b6$var$TimeField);
|
|
831
901
|
|
|
832
902
|
|
|
833
903
|
|
|
@@ -838,55 +908,55 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
|
|
|
838
908
|
|
|
839
909
|
|
|
840
910
|
function $beaeefa091999363$var$DatePicker(props, ref) {
|
|
841
|
-
props = $aayOp$useProviderProps(props);
|
|
911
|
+
props = (0, $aayOp$useProviderProps)(props);
|
|
842
912
|
let { autoFocus: autoFocus , isQuiet: isQuiet , isDisabled: isDisabled , isReadOnly: isReadOnly , placeholderValue: placeholderValue , maxVisibleMonths: maxVisibleMonths = 1 } = props;
|
|
843
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $aayOp$useHover({
|
|
913
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $aayOp$useHover)({
|
|
844
914
|
isDisabled: isDisabled
|
|
845
915
|
});
|
|
846
|
-
let targetRef = $aayOp$useRef();
|
|
847
|
-
let state = $aayOp$useDatePickerState({
|
|
916
|
+
let targetRef = (0, $aayOp$useRef)();
|
|
917
|
+
let state = (0, $aayOp$useDatePickerState)({
|
|
848
918
|
...props,
|
|
849
919
|
shouldCloseOnSelect: ()=>!state.hasTime
|
|
850
920
|
});
|
|
851
|
-
let { groupProps: groupProps , labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps , buttonProps: buttonProps , dialogProps: dialogProps , calendarProps: calendarProps } = $aayOp$useDatePicker(props, state, targetRef);
|
|
921
|
+
let { groupProps: groupProps , labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps , buttonProps: buttonProps , dialogProps: dialogProps , calendarProps: calendarProps } = (0, $aayOp$useDatePicker)(props, state, targetRef);
|
|
852
922
|
let { isOpen: isOpen , setOpen: setOpen } = state;
|
|
853
|
-
let { direction: direction } = $aayOp$useLocale();
|
|
854
|
-
let domRef = $04e96200274b03de$export$71a23a36270e4bf0(ref);
|
|
855
|
-
let stringFormatter = $aayOp$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($71a986712918c3de$exports)));
|
|
856
|
-
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $aayOp$useFocusRing({
|
|
923
|
+
let { direction: direction } = (0, $aayOp$useLocale)();
|
|
924
|
+
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
925
|
+
let stringFormatter = (0, $aayOp$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($71a986712918c3de$exports))));
|
|
926
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $aayOp$useFocusRing)({
|
|
857
927
|
within: true,
|
|
858
928
|
isTextInput: true,
|
|
859
929
|
autoFocus: autoFocus
|
|
860
930
|
});
|
|
861
|
-
let { isFocused: isFocusedButton , focusProps: focusPropsButton } = $aayOp$useFocusRing({
|
|
931
|
+
let { isFocused: isFocusedButton , focusProps: focusPropsButton } = (0, $aayOp$useFocusRing)({
|
|
862
932
|
within: false,
|
|
863
933
|
isTextInput: false,
|
|
864
934
|
autoFocus: autoFocus
|
|
865
935
|
});
|
|
866
|
-
let className = $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
936
|
+
let className = (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup", {
|
|
937
|
+
"spectrum-InputGroup--quiet": isQuiet,
|
|
938
|
+
"spectrum-InputGroup--invalid": state.validationState === "invalid" && !isDisabled,
|
|
939
|
+
"is-disabled": isDisabled,
|
|
940
|
+
"is-hovered": isHovered,
|
|
941
|
+
"is-focused": isFocused,
|
|
942
|
+
"focus-ring": isFocusVisible && !isFocusedButton
|
|
873
943
|
});
|
|
874
|
-
let fieldClassName = $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
875
|
-
|
|
876
|
-
|
|
944
|
+
let fieldClassName = (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-input", {
|
|
945
|
+
"is-disabled": isDisabled,
|
|
946
|
+
"is-invalid": state.validationState === "invalid" && !isDisabled
|
|
877
947
|
});
|
|
878
948
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
879
949
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
880
|
-
let description = $04e96200274b03de$export$322f4580ccd8dde6(props);
|
|
950
|
+
let description = (0, $04e96200274b03de$export$322f4580ccd8dde6)(props);
|
|
881
951
|
if (description && !props.description) descriptionProps.id = null;
|
|
882
952
|
let placeholder = placeholderValue;
|
|
883
|
-
let timePlaceholder = placeholder &&
|
|
884
|
-
let timeMinValue = props.minValue &&
|
|
885
|
-
let timeMaxValue = props.maxValue &&
|
|
886
|
-
let timeGranularity = state.granularity ===
|
|
953
|
+
let timePlaceholder = placeholder && "hour" in placeholder ? placeholder : null;
|
|
954
|
+
let timeMinValue = props.minValue && "hour" in props.minValue ? props.minValue : null;
|
|
955
|
+
let timeMaxValue = props.maxValue && "hour" in props.maxValue ? props.maxValue : null;
|
|
956
|
+
let timeGranularity = state.granularity === "hour" || state.granularity === "minute" || state.granularity === "second" ? state.granularity : null;
|
|
887
957
|
let showTimeField = !!timeGranularity;
|
|
888
|
-
let visibleMonths = $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths);
|
|
889
|
-
return
|
|
958
|
+
let visibleMonths = (0, $04e96200274b03de$export$12ce2869ce471b1f)(maxVisibleMonths);
|
|
959
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Field), {
|
|
890
960
|
...props,
|
|
891
961
|
ref: domRef,
|
|
892
962
|
elementType: "span",
|
|
@@ -895,51 +965,52 @@ function $beaeefa091999363$var$DatePicker(props, ref) {
|
|
|
895
965
|
descriptionProps: descriptionProps,
|
|
896
966
|
errorMessageProps: errorMessageProps,
|
|
897
967
|
validationState: state.validationState,
|
|
898
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
899
|
-
}, /*#__PURE__*/ $aayOp$react.createElement("div", {
|
|
900
|
-
|
|
968
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-fieldWrapper")
|
|
969
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
970
|
+
...(0, $aayOp$mergeProps)(groupProps, hoverProps, focusProps),
|
|
901
971
|
className: className,
|
|
902
972
|
ref: targetRef
|
|
903
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($79348162c55d687f$export$f5b8910cec6cf069, {
|
|
973
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
904
974
|
isDisabled: isDisabled,
|
|
905
975
|
isQuiet: isQuiet,
|
|
906
976
|
validationState: state.validationState,
|
|
907
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
908
|
-
inputClassName: fieldClassName
|
|
909
|
-
|
|
977
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-field"),
|
|
978
|
+
inputClassName: fieldClassName,
|
|
979
|
+
disableFocusRing: true
|
|
980
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
|
|
910
981
|
...fieldProps,
|
|
911
982
|
"data-testid": "date-field",
|
|
912
983
|
isQuiet: isQuiet
|
|
913
|
-
})), /*#__PURE__*/ $aayOp$react.createElement($aayOp$DialogTrigger, {
|
|
984
|
+
})), /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$DialogTrigger), {
|
|
914
985
|
type: "popover",
|
|
915
986
|
mobileType: "tray",
|
|
916
|
-
placement: direction ===
|
|
987
|
+
placement: direction === "rtl" ? "bottom right" : "bottom left",
|
|
917
988
|
targetRef: targetRef,
|
|
918
989
|
hideArrow: true,
|
|
919
990
|
isOpen: isOpen,
|
|
920
991
|
onOpenChange: setOpen,
|
|
921
992
|
shouldFlip: props.shouldFlip
|
|
922
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$FieldButton, {
|
|
923
|
-
|
|
924
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
993
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$FieldButton), {
|
|
994
|
+
...(0, $aayOp$mergeProps)(buttonProps, focusPropsButton),
|
|
995
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-FieldButton"),
|
|
925
996
|
isQuiet: isQuiet,
|
|
926
997
|
validationState: state.validationState,
|
|
927
998
|
isDisabled: isDisabled || isReadOnly
|
|
928
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$spectrumiconsworkflowCalendar, null)), /*#__PURE__*/ $aayOp$react.createElement($aayOp$Dialog, {
|
|
929
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
999
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$spectrumiconsworkflowCalendar), null)), /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Dialog), {
|
|
1000
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-dialog"),
|
|
930
1001
|
...dialogProps
|
|
931
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$Content, null, /*#__PURE__*/ $aayOp$react.createElement("div", {
|
|
932
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
933
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$Calendar, {
|
|
1002
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Content), null, /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
1003
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-dialogContent")
|
|
1004
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Calendar), {
|
|
934
1005
|
...calendarProps,
|
|
935
1006
|
visibleMonths: visibleMonths,
|
|
936
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
937
|
-
|
|
1007
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-calendar", {
|
|
1008
|
+
"is-invalid": state.validationState === "invalid"
|
|
938
1009
|
})
|
|
939
|
-
}), showTimeField && /*#__PURE__*/ $aayOp$react.createElement("div", {
|
|
940
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
941
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($f0a04554754386b6$export$5eaee2322dd727eb, {
|
|
942
|
-
label: stringFormatter.format(
|
|
1010
|
+
}), showTimeField && /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
1011
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-timeFields")
|
|
1012
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
|
|
1013
|
+
label: stringFormatter.format("time"),
|
|
943
1014
|
value: state.timeValue,
|
|
944
1015
|
onChange: state.setTimeValue,
|
|
945
1016
|
placeholderValue: timePlaceholder,
|
|
@@ -949,14 +1020,24 @@ function $beaeefa091999363$var$DatePicker(props, ref) {
|
|
|
949
1020
|
hourCycle: props.hourCycle,
|
|
950
1021
|
hideTimeZone: props.hideTimeZone,
|
|
951
1022
|
marginTop: "size-100"
|
|
952
|
-
}))))))))
|
|
1023
|
+
}))))))));
|
|
953
1024
|
}
|
|
954
1025
|
/**
|
|
955
1026
|
* DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date and time value.
|
|
956
|
-
*/ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ $aayOp$react.forwardRef($beaeefa091999363$var$DatePicker);
|
|
957
|
-
|
|
1027
|
+
*/ const $beaeefa091999363$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $aayOp$react).forwardRef($beaeefa091999363$var$DatePicker);
|
|
958
1028
|
|
|
959
1029
|
|
|
1030
|
+
/*
|
|
1031
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
1032
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1033
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1034
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1035
|
+
*
|
|
1036
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1037
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1038
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1039
|
+
* governing permissions and limitations under the License.
|
|
1040
|
+
*/
|
|
960
1041
|
|
|
961
1042
|
|
|
962
1043
|
|
|
@@ -980,56 +1061,56 @@ function $beaeefa091999363$var$DatePicker(props, ref) {
|
|
|
980
1061
|
|
|
981
1062
|
|
|
982
1063
|
function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
983
|
-
var
|
|
984
|
-
props = $aayOp$useProviderProps(props);
|
|
1064
|
+
var _state_timeRange, _state_timeRange1;
|
|
1065
|
+
props = (0, $aayOp$useProviderProps)(props);
|
|
985
1066
|
let { isQuiet: isQuiet , isDisabled: isDisabled , isReadOnly: isReadOnly , autoFocus: autoFocus , placeholderValue: placeholderValue , maxVisibleMonths: maxVisibleMonths = 1 } = props;
|
|
986
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $aayOp$useHover({
|
|
1067
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $aayOp$useHover)({
|
|
987
1068
|
isDisabled: isDisabled
|
|
988
1069
|
});
|
|
989
|
-
let targetRef = $aayOp$useRef();
|
|
990
|
-
let state = $aayOp$useDateRangePickerState({
|
|
1070
|
+
let targetRef = (0, $aayOp$useRef)();
|
|
1071
|
+
let state = (0, $aayOp$useDateRangePickerState)({
|
|
991
1072
|
...props,
|
|
992
1073
|
shouldCloseOnSelect: ()=>!state.hasTime
|
|
993
1074
|
});
|
|
994
|
-
let { labelProps: labelProps , groupProps: groupProps , buttonProps: buttonProps , dialogProps: dialogProps , startFieldProps: startFieldProps , endFieldProps: endFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps , calendarProps: calendarProps } = $aayOp$useDateRangePicker(props, state, targetRef);
|
|
1075
|
+
let { labelProps: labelProps , groupProps: groupProps , buttonProps: buttonProps , dialogProps: dialogProps , startFieldProps: startFieldProps , endFieldProps: endFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps , calendarProps: calendarProps } = (0, $aayOp$useDateRangePicker)(props, state, targetRef);
|
|
995
1076
|
let { isOpen: isOpen , setOpen: setOpen } = state;
|
|
996
|
-
let { direction: direction } = $aayOp$useLocale();
|
|
997
|
-
let domRef = $04e96200274b03de$export$71a23a36270e4bf0(ref);
|
|
998
|
-
let stringFormatter = $aayOp$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($71a986712918c3de$exports)));
|
|
999
|
-
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = $aayOp$useFocusRing({
|
|
1077
|
+
let { direction: direction } = (0, $aayOp$useLocale)();
|
|
1078
|
+
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
1079
|
+
let stringFormatter = (0, $aayOp$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($71a986712918c3de$exports))));
|
|
1080
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $aayOp$useFocusRing)({
|
|
1000
1081
|
within: true,
|
|
1001
1082
|
isTextInput: true,
|
|
1002
1083
|
autoFocus: autoFocus
|
|
1003
1084
|
});
|
|
1004
|
-
let { isFocused: isFocusedButton , focusProps: focusPropsButton } = $aayOp$useFocusRing({
|
|
1085
|
+
let { isFocused: isFocusedButton , focusProps: focusPropsButton } = (0, $aayOp$useFocusRing)({
|
|
1005
1086
|
within: false,
|
|
1006
1087
|
isTextInput: false,
|
|
1007
1088
|
autoFocus: autoFocus
|
|
1008
1089
|
});
|
|
1009
|
-
let className = $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1090
|
+
let className = (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup", {
|
|
1091
|
+
"spectrum-InputGroup--quiet": isQuiet,
|
|
1092
|
+
"spectrum-InputGroup--invalid": state.validationState === "invalid" && !isDisabled,
|
|
1093
|
+
"is-disabled": isDisabled,
|
|
1094
|
+
"is-hovered": isHovered,
|
|
1095
|
+
"is-focused": isFocused,
|
|
1096
|
+
"focus-ring": isFocusVisible && !isFocusedButton
|
|
1016
1097
|
});
|
|
1017
|
-
let fieldClassName = $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1018
|
-
|
|
1019
|
-
|
|
1098
|
+
let fieldClassName = (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-input", {
|
|
1099
|
+
"is-disabled": isDisabled,
|
|
1100
|
+
"is-invalid": state.validationState === "invalid" && !isDisabled
|
|
1020
1101
|
});
|
|
1021
1102
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
1022
1103
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
1023
|
-
let description = $04e96200274b03de$export$322f4580ccd8dde6(props);
|
|
1104
|
+
let description = (0, $04e96200274b03de$export$322f4580ccd8dde6)(props);
|
|
1024
1105
|
if (description && !props.description) descriptionProps.id = null;
|
|
1025
1106
|
let placeholder = placeholderValue;
|
|
1026
|
-
let timePlaceholder = placeholder &&
|
|
1027
|
-
let timeMinValue = props.minValue &&
|
|
1028
|
-
let timeMaxValue = props.maxValue &&
|
|
1029
|
-
let timeGranularity = state.granularity ===
|
|
1107
|
+
let timePlaceholder = placeholder && "hour" in placeholder ? placeholder : null;
|
|
1108
|
+
let timeMinValue = props.minValue && "hour" in props.minValue ? props.minValue : null;
|
|
1109
|
+
let timeMaxValue = props.maxValue && "hour" in props.maxValue ? props.maxValue : null;
|
|
1110
|
+
let timeGranularity = state.granularity === "hour" || state.granularity === "minute" || state.granularity === "second" ? state.granularity : null;
|
|
1030
1111
|
let showTimeField = !!timeGranularity;
|
|
1031
|
-
let visibleMonths = $04e96200274b03de$export$12ce2869ce471b1f(maxVisibleMonths);
|
|
1032
|
-
return
|
|
1112
|
+
let visibleMonths = (0, $04e96200274b03de$export$12ce2869ce471b1f)(maxVisibleMonths);
|
|
1113
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Field), {
|
|
1033
1114
|
...props,
|
|
1034
1115
|
ref: domRef,
|
|
1035
1116
|
elementType: "span",
|
|
@@ -1038,62 +1119,62 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
1038
1119
|
descriptionProps: descriptionProps,
|
|
1039
1120
|
errorMessageProps: errorMessageProps,
|
|
1040
1121
|
validationState: state.validationState,
|
|
1041
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1042
|
-
}, /*#__PURE__*/ $aayOp$react.createElement("div", {
|
|
1043
|
-
|
|
1122
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-fieldWrapper")
|
|
1123
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
1124
|
+
...(0, $aayOp$mergeProps)(groupProps, hoverProps, focusProps),
|
|
1044
1125
|
className: className,
|
|
1045
1126
|
ref: targetRef
|
|
1046
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($79348162c55d687f$export$f5b8910cec6cf069, {
|
|
1127
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
1047
1128
|
isDisabled: isDisabled,
|
|
1048
1129
|
isQuiet: isQuiet,
|
|
1049
1130
|
validationState: state.validationState,
|
|
1050
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1051
|
-
inputClassName: fieldClassName
|
|
1052
|
-
|
|
1131
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-field"),
|
|
1132
|
+
inputClassName: fieldClassName,
|
|
1133
|
+
disableFocusRing: true
|
|
1134
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
|
|
1053
1135
|
...startFieldProps,
|
|
1054
1136
|
"data-testid": "start-date",
|
|
1055
1137
|
isQuiet: props.isQuiet,
|
|
1056
|
-
inputClassName: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1057
|
-
}), /*#__PURE__*/ $aayOp$react.createElement($cb301300011a98f7$var$DateRangeDash, null), /*#__PURE__*/ $aayOp$react.createElement($d2bb88c82604b25f$export$34dc4cfa15ead1, {
|
|
1138
|
+
inputClassName: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-startField")
|
|
1139
|
+
}), /*#__PURE__*/ (0, $aayOp$react).createElement($cb301300011a98f7$var$DateRangeDash, null), /*#__PURE__*/ (0, $aayOp$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
|
|
1058
1140
|
...endFieldProps,
|
|
1059
1141
|
"data-testid": "end-date",
|
|
1060
1142
|
isQuiet: props.isQuiet,
|
|
1061
|
-
inputClassName: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1062
|
-
})), /*#__PURE__*/ $aayOp$react.createElement($aayOp$DialogTrigger, {
|
|
1143
|
+
inputClassName: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-Datepicker-endField", (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-endField"))
|
|
1144
|
+
})), /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$DialogTrigger), {
|
|
1063
1145
|
type: "popover",
|
|
1064
1146
|
mobileType: "tray",
|
|
1065
|
-
placement: direction ===
|
|
1147
|
+
placement: direction === "rtl" ? "bottom right" : "bottom left",
|
|
1066
1148
|
targetRef: targetRef,
|
|
1067
1149
|
hideArrow: true,
|
|
1068
1150
|
isOpen: isOpen,
|
|
1069
1151
|
onOpenChange: setOpen,
|
|
1070
1152
|
shouldFlip: props.shouldFlip
|
|
1071
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$FieldButton, {
|
|
1072
|
-
|
|
1073
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1153
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$FieldButton), {
|
|
1154
|
+
...(0, $aayOp$mergeProps)(buttonProps, focusPropsButton),
|
|
1155
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-FieldButton"),
|
|
1074
1156
|
isQuiet: isQuiet,
|
|
1075
1157
|
validationState: state.validationState,
|
|
1076
1158
|
isDisabled: isDisabled || isReadOnly
|
|
1077
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$spectrumiconsworkflowCalendar, null)), /*#__PURE__*/ $aayOp$react.createElement($aayOp$Dialog, {
|
|
1078
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1159
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$spectrumiconsworkflowCalendar), null)), /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Dialog), {
|
|
1160
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-dialog"),
|
|
1079
1161
|
...dialogProps
|
|
1080
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$Content, null, /*#__PURE__*/ $aayOp$react.createElement("div", {
|
|
1081
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1082
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($aayOp$RangeCalendar, {
|
|
1162
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Content), null, /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
1163
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-dialogContent")
|
|
1164
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$RangeCalendar), {
|
|
1083
1165
|
...calendarProps,
|
|
1084
1166
|
visibleMonths: visibleMonths,
|
|
1085
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1086
|
-
|
|
1167
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-calendar", {
|
|
1168
|
+
"is-invalid": state.validationState === "invalid"
|
|
1087
1169
|
})
|
|
1088
|
-
}), showTimeField && /*#__PURE__*/ $aayOp$react.createElement($aayOp$Flex, {
|
|
1170
|
+
}), showTimeField && /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Flex), {
|
|
1089
1171
|
gap: "size-100",
|
|
1090
1172
|
marginTop: "size-100",
|
|
1091
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1092
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($f0a04554754386b6$export$5eaee2322dd727eb, {
|
|
1093
|
-
label: stringFormatter.format(
|
|
1094
|
-
value: ((
|
|
1095
|
-
onChange: (v)=>state.setTime(
|
|
1096
|
-
,
|
|
1173
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-timeFields")
|
|
1174
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
|
|
1175
|
+
label: stringFormatter.format("startTime"),
|
|
1176
|
+
value: ((_state_timeRange = state.timeRange) === null || _state_timeRange === void 0 ? void 0 : _state_timeRange.start) || null,
|
|
1177
|
+
onChange: (v)=>state.setTime("start", v),
|
|
1097
1178
|
placeholderValue: timePlaceholder,
|
|
1098
1179
|
granularity: timeGranularity,
|
|
1099
1180
|
minValue: timeMinValue,
|
|
@@ -1101,11 +1182,10 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
1101
1182
|
hourCycle: props.hourCycle,
|
|
1102
1183
|
hideTimeZone: props.hideTimeZone,
|
|
1103
1184
|
flex: true
|
|
1104
|
-
}), /*#__PURE__*/ $aayOp$react.createElement($f0a04554754386b6$export$5eaee2322dd727eb, {
|
|
1105
|
-
label: stringFormatter.format(
|
|
1106
|
-
value: ((
|
|
1107
|
-
onChange: (v)=>state.setTime(
|
|
1108
|
-
,
|
|
1185
|
+
}), /*#__PURE__*/ (0, $aayOp$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
|
|
1186
|
+
label: stringFormatter.format("endTime"),
|
|
1187
|
+
value: ((_state_timeRange1 = state.timeRange) === null || _state_timeRange1 === void 0 ? void 0 : _state_timeRange1.end) || null,
|
|
1188
|
+
onChange: (v)=>state.setTime("end", v),
|
|
1109
1189
|
placeholderValue: timePlaceholder,
|
|
1110
1190
|
granularity: timeGranularity,
|
|
1111
1191
|
minValue: timeMinValue,
|
|
@@ -1113,23 +1193,33 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
|
|
|
1113
1193
|
hourCycle: props.hourCycle,
|
|
1114
1194
|
hideTimeZone: props.hideTimeZone,
|
|
1115
1195
|
flex: true
|
|
1116
|
-
}))))))))
|
|
1196
|
+
}))))))));
|
|
1117
1197
|
}
|
|
1118
1198
|
function $cb301300011a98f7$var$DateRangeDash() {
|
|
1119
|
-
return
|
|
1199
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement("div", {
|
|
1120
1200
|
"aria-hidden": "true",
|
|
1121
1201
|
"data-testid": "date-range-dash",
|
|
1122
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1123
|
-
})
|
|
1202
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-rangeDash")
|
|
1203
|
+
});
|
|
1124
1204
|
}
|
|
1125
1205
|
/**
|
|
1126
1206
|
* DateRangePickers combine two DateFields and a RangeCalendar popover to allow users
|
|
1127
1207
|
* to enter or select a date and time range.
|
|
1128
|
-
*/ const $cb301300011a98f7$export$17334619f3ac2224 = /*#__PURE__*/ $aayOp$react.forwardRef($cb301300011a98f7$var$DateRangePicker);
|
|
1129
|
-
|
|
1208
|
+
*/ const $cb301300011a98f7$export$17334619f3ac2224 = /*#__PURE__*/ (0, $aayOp$react).forwardRef($cb301300011a98f7$var$DateRangePicker);
|
|
1130
1209
|
|
|
1131
1210
|
|
|
1132
1211
|
|
|
1212
|
+
/*
|
|
1213
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
1214
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1215
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1216
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1217
|
+
*
|
|
1218
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1219
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1220
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1221
|
+
* governing permissions and limitations under the License.
|
|
1222
|
+
*/
|
|
1133
1223
|
|
|
1134
1224
|
|
|
1135
1225
|
|
|
@@ -1142,22 +1232,22 @@ function $cb301300011a98f7$var$DateRangeDash() {
|
|
|
1142
1232
|
|
|
1143
1233
|
|
|
1144
1234
|
function $0129798af6791690$var$DateField(props, ref) {
|
|
1145
|
-
props = $aayOp$useProviderProps(props);
|
|
1235
|
+
props = (0, $aayOp$useProviderProps)(props);
|
|
1146
1236
|
let { autoFocus: autoFocus , isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired , isQuiet: isQuiet } = props;
|
|
1147
|
-
let domRef = $04e96200274b03de$export$71a23a36270e4bf0(ref);
|
|
1148
|
-
let { locale: locale } = $aayOp$useLocale();
|
|
1149
|
-
let state = $aayOp$useDateFieldState({
|
|
1237
|
+
let domRef = (0, $04e96200274b03de$export$71a23a36270e4bf0)(ref);
|
|
1238
|
+
let { locale: locale } = (0, $aayOp$useLocale)();
|
|
1239
|
+
let state = (0, $aayOp$useDateFieldState)({
|
|
1150
1240
|
...props,
|
|
1151
1241
|
locale: locale,
|
|
1152
1242
|
createCalendar: $aayOp$createCalendar
|
|
1153
1243
|
});
|
|
1154
|
-
let inputRef = $aayOp$useRef(null);
|
|
1155
|
-
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $aayOp$useDateField(props, state, inputRef);
|
|
1244
|
+
let inputRef = (0, $aayOp$useRef)(null);
|
|
1245
|
+
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $aayOp$useDateField)(props, state, inputRef);
|
|
1156
1246
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
1157
1247
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
1158
|
-
let description = $04e96200274b03de$export$322f4580ccd8dde6(props);
|
|
1248
|
+
let description = (0, $04e96200274b03de$export$322f4580ccd8dde6)(props);
|
|
1159
1249
|
if (description && !props.description) descriptionProps.id = null;
|
|
1160
|
-
return
|
|
1250
|
+
return /*#__PURE__*/ (0, $aayOp$react).createElement((0, $aayOp$Field), {
|
|
1161
1251
|
...props,
|
|
1162
1252
|
ref: domRef,
|
|
1163
1253
|
elementType: "span",
|
|
@@ -1166,29 +1256,28 @@ function $0129798af6791690$var$DateField(props, ref) {
|
|
|
1166
1256
|
descriptionProps: descriptionProps,
|
|
1167
1257
|
errorMessageProps: errorMessageProps,
|
|
1168
1258
|
validationState: state.validationState,
|
|
1169
|
-
UNSAFE_className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1170
|
-
}, /*#__PURE__*/ $aayOp$react.createElement($79348162c55d687f$export$f5b8910cec6cf069, {
|
|
1259
|
+
UNSAFE_className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-Datepicker-fieldWrapper")
|
|
1260
|
+
}, /*#__PURE__*/ (0, $aayOp$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
|
|
1171
1261
|
ref: inputRef,
|
|
1172
1262
|
fieldProps: fieldProps,
|
|
1173
1263
|
isDisabled: isDisabled,
|
|
1174
1264
|
isQuiet: isQuiet,
|
|
1175
1265
|
autoFocus: autoFocus,
|
|
1176
1266
|
validationState: state.validationState,
|
|
1177
|
-
className: $aayOp$classNames((/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports)),
|
|
1178
|
-
}, state.segments.map((segment, i)=>/*#__PURE__*/ $aayOp$react.createElement($cfa347761f172638$export$6388987c5223b54e, {
|
|
1267
|
+
className: (0, $aayOp$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($465eb3a688ef3440$exports))), "react-spectrum-DateField")
|
|
1268
|
+
}, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $aayOp$react).createElement((0, $cfa347761f172638$export$6388987c5223b54e), {
|
|
1179
1269
|
key: i,
|
|
1180
1270
|
segment: segment,
|
|
1181
1271
|
state: state,
|
|
1182
1272
|
isDisabled: isDisabled,
|
|
1183
1273
|
isReadOnly: isReadOnly,
|
|
1184
1274
|
isRequired: isRequired
|
|
1185
|
-
})
|
|
1186
|
-
))));
|
|
1275
|
+
}))));
|
|
1187
1276
|
}
|
|
1188
1277
|
/**
|
|
1189
1278
|
* DateFields allow users to enter and edit date and time values using a keyboard.
|
|
1190
1279
|
* Each part of a date value is displayed in an individually editable segment.
|
|
1191
|
-
*/ const $0129798af6791690$export$d9781c7894a82487 = /*#__PURE__*/ $aayOp$react.forwardRef($0129798af6791690$var$DateField);
|
|
1280
|
+
*/ const $0129798af6791690$export$d9781c7894a82487 = /*#__PURE__*/ (0, $aayOp$react).forwardRef($0129798af6791690$var$DateField);
|
|
1192
1281
|
|
|
1193
1282
|
|
|
1194
1283
|
|