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