@mantine/dates 8.0.1 → 8.1.0
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/cjs/components/Calendar/Calendar.cjs +13 -1
- package/cjs/components/Calendar/Calendar.cjs.map +1 -1
- package/cjs/components/Calendar/pick-calendar-levels-props/pick-calendar-levels-props.cjs +5 -0
- package/cjs/components/Calendar/pick-calendar-levels-props/pick-calendar-levels-props.cjs.map +1 -1
- package/cjs/components/CalendarHeader/CalendarHeader.cjs +75 -60
- package/cjs/components/CalendarHeader/CalendarHeader.cjs.map +1 -1
- package/cjs/components/DateInput/DateInput.cjs +23 -3
- package/cjs/components/DateInput/DateInput.cjs.map +1 -1
- package/cjs/components/DatePicker/DatePicker.cjs +82 -27
- package/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
- package/cjs/components/DatePicker/DatePicker.module.css.cjs +7 -0
- package/cjs/components/DatePicker/DatePicker.module.css.cjs.map +1 -0
- package/cjs/components/DatePickerInput/DatePickerInput.cjs +3 -1
- package/cjs/components/DatePickerInput/DatePickerInput.cjs.map +1 -1
- package/cjs/components/DateTimePicker/DateTimePicker.cjs +9 -2
- package/cjs/components/DateTimePicker/DateTimePicker.cjs.map +1 -1
- package/cjs/components/Day/Day.cjs.map +1 -1
- package/cjs/components/DecadeLevel/DecadeLevel.cjs +2 -0
- package/cjs/components/DecadeLevel/DecadeLevel.cjs.map +1 -1
- package/cjs/components/DecadeLevelGroup/DecadeLevelGroup.cjs +3 -1
- package/cjs/components/DecadeLevelGroup/DecadeLevelGroup.cjs.map +1 -1
- package/cjs/components/LevelsGroup/LevelsGroup.cjs.map +1 -1
- package/cjs/components/Month/Month.cjs +5 -1
- package/cjs/components/Month/Month.cjs.map +1 -1
- package/cjs/components/MonthLevel/MonthLevel.cjs +2 -0
- package/cjs/components/MonthLevel/MonthLevel.cjs.map +1 -1
- package/cjs/components/MonthLevelGroup/MonthLevelGroup.cjs +3 -1
- package/cjs/components/MonthLevelGroup/MonthLevelGroup.cjs.map +1 -1
- package/cjs/components/MonthPicker/MonthPicker.cjs.map +1 -1
- package/cjs/components/MonthPickerInput/MonthPickerInput.cjs.map +1 -1
- package/cjs/components/MonthsList/MonthsList.cjs +5 -1
- package/cjs/components/MonthsList/MonthsList.cjs.map +1 -1
- package/cjs/components/PickerControl/PickerControl.cjs.map +1 -1
- package/cjs/components/PickerInputBase/PickerInputBase.cjs.map +1 -1
- package/cjs/components/SpinInput/SpinInput.cjs +1 -1
- package/cjs/components/SpinInput/SpinInput.cjs.map +1 -1
- package/cjs/components/TimeGrid/TimeGrid.cjs.map +1 -1
- package/cjs/components/TimeInput/TimeInput.cjs +6 -2
- package/cjs/components/TimeInput/TimeInput.cjs.map +1 -1
- package/cjs/components/TimePicker/TimePicker.cjs +216 -223
- package/cjs/components/TimePicker/TimePicker.cjs.map +1 -1
- package/cjs/components/TimePicker/use-time-picker.cjs +8 -0
- package/cjs/components/TimePicker/use-time-picker.cjs.map +1 -1
- package/cjs/components/WeekdaysRow/WeekdaysRow.cjs.map +1 -1
- package/cjs/components/YearLevel/YearLevel.cjs +2 -0
- package/cjs/components/YearLevel/YearLevel.cjs.map +1 -1
- package/cjs/components/YearLevelGroup/YearLevelGroup.cjs +3 -1
- package/cjs/components/YearLevelGroup/YearLevelGroup.cjs.map +1 -1
- package/cjs/components/YearPicker/YearPicker.cjs.map +1 -1
- package/cjs/components/YearPickerInput/YearPickerInput.cjs.map +1 -1
- package/cjs/components/YearsList/YearsList.cjs +5 -1
- package/cjs/components/YearsList/YearsList.cjs.map +1 -1
- package/esm/components/Calendar/Calendar.mjs +13 -1
- package/esm/components/Calendar/Calendar.mjs.map +1 -1
- package/esm/components/Calendar/pick-calendar-levels-props/pick-calendar-levels-props.mjs +5 -0
- package/esm/components/Calendar/pick-calendar-levels-props/pick-calendar-levels-props.mjs.map +1 -1
- package/esm/components/CalendarHeader/CalendarHeader.mjs +77 -62
- package/esm/components/CalendarHeader/CalendarHeader.mjs.map +1 -1
- package/esm/components/DateInput/DateInput.mjs +23 -3
- package/esm/components/DateInput/DateInput.mjs.map +1 -1
- package/esm/components/DatePicker/DatePicker.mjs +84 -29
- package/esm/components/DatePicker/DatePicker.mjs.map +1 -1
- package/esm/components/DatePicker/DatePicker.module.css.mjs +5 -0
- package/esm/components/DatePicker/DatePicker.module.css.mjs.map +1 -0
- package/esm/components/DatePickerInput/DatePickerInput.mjs +3 -1
- package/esm/components/DatePickerInput/DatePickerInput.mjs.map +1 -1
- package/esm/components/DateTimePicker/DateTimePicker.mjs +9 -2
- package/esm/components/DateTimePicker/DateTimePicker.mjs.map +1 -1
- package/esm/components/Day/Day.mjs.map +1 -1
- package/esm/components/DecadeLevel/DecadeLevel.mjs +2 -0
- package/esm/components/DecadeLevel/DecadeLevel.mjs.map +1 -1
- package/esm/components/DecadeLevelGroup/DecadeLevelGroup.mjs +3 -1
- package/esm/components/DecadeLevelGroup/DecadeLevelGroup.mjs.map +1 -1
- package/esm/components/LevelsGroup/LevelsGroup.mjs.map +1 -1
- package/esm/components/Month/Month.mjs +5 -1
- package/esm/components/Month/Month.mjs.map +1 -1
- package/esm/components/MonthLevel/MonthLevel.mjs +2 -0
- package/esm/components/MonthLevel/MonthLevel.mjs.map +1 -1
- package/esm/components/MonthLevelGroup/MonthLevelGroup.mjs +3 -1
- package/esm/components/MonthLevelGroup/MonthLevelGroup.mjs.map +1 -1
- package/esm/components/MonthPicker/MonthPicker.mjs.map +1 -1
- package/esm/components/MonthPickerInput/MonthPickerInput.mjs.map +1 -1
- package/esm/components/MonthsList/MonthsList.mjs +5 -1
- package/esm/components/MonthsList/MonthsList.mjs.map +1 -1
- package/esm/components/PickerControl/PickerControl.mjs.map +1 -1
- package/esm/components/PickerInputBase/PickerInputBase.mjs.map +1 -1
- package/esm/components/SpinInput/SpinInput.mjs +1 -1
- package/esm/components/SpinInput/SpinInput.mjs.map +1 -1
- package/esm/components/TimeGrid/TimeGrid.mjs.map +1 -1
- package/esm/components/TimeInput/TimeInput.mjs +6 -2
- package/esm/components/TimeInput/TimeInput.mjs.map +1 -1
- package/esm/components/TimePicker/TimePicker.mjs +216 -223
- package/esm/components/TimePicker/TimePicker.mjs.map +1 -1
- package/esm/components/TimePicker/use-time-picker.mjs +8 -0
- package/esm/components/TimePicker/use-time-picker.mjs.map +1 -1
- package/esm/components/WeekdaysRow/WeekdaysRow.mjs.map +1 -1
- package/esm/components/YearLevel/YearLevel.mjs +2 -0
- package/esm/components/YearLevel/YearLevel.mjs.map +1 -1
- package/esm/components/YearLevelGroup/YearLevelGroup.mjs +3 -1
- package/esm/components/YearLevelGroup/YearLevelGroup.mjs.map +1 -1
- package/esm/components/YearPicker/YearPicker.mjs.map +1 -1
- package/esm/components/YearPickerInput/YearPickerInput.mjs.map +1 -1
- package/esm/components/YearsList/YearsList.mjs +5 -1
- package/esm/components/YearsList/YearsList.mjs.map +1 -1
- package/lib/components/Calendar/Calendar.d.ts +4 -0
- package/lib/components/Calendar/pick-calendar-levels-props/pick-calendar-levels-props.d.ts +3 -1
- package/lib/components/CalendarHeader/CalendarHeader.d.ts +2 -0
- package/lib/components/DatePicker/DatePicker.d.ts +13 -2
- package/lib/components/DatePicker/index.d.ts +1 -1
- package/lib/components/DateTimePicker/DateTimePicker.d.ts +6 -1
- package/lib/hooks/use-dates-input/use-dates-input.d.ts +1 -5
- package/package.json +3 -3
- package/styles.css +48 -0
- package/styles.layer.css +48 -0
|
@@ -19,7 +19,6 @@ const defaultProps = {
|
|
|
19
19
|
secondsStep: 1,
|
|
20
20
|
format: "24h",
|
|
21
21
|
amPmLabels: { am: "AM", pm: "PM" },
|
|
22
|
-
withDropdown: false,
|
|
23
22
|
pasteSplit: getParsedTime,
|
|
24
23
|
maxDropdownContentHeight: 200
|
|
25
24
|
};
|
|
@@ -134,250 +133,244 @@ const TimePicker = factory((_props, ref) => {
|
|
|
134
133
|
onBlur?.(event);
|
|
135
134
|
}
|
|
136
135
|
};
|
|
137
|
-
return /* @__PURE__ */ jsx(
|
|
138
|
-
|
|
136
|
+
return /* @__PURE__ */ jsx(TimePickerProvider, { value: { getStyles, scrollAreaProps, maxDropdownContentHeight }, children: /* @__PURE__ */ jsxs(
|
|
137
|
+
Popover,
|
|
139
138
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
139
|
+
opened: withDropdown && !readOnly && dropdownOpened,
|
|
140
|
+
transitionProps: { duration: 0 },
|
|
141
|
+
position: "bottom-start",
|
|
142
|
+
withRoles: false,
|
|
143
|
+
...popoverProps,
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsxs(
|
|
146
|
+
InputBase,
|
|
147
|
+
{
|
|
148
|
+
component: "div",
|
|
149
|
+
size,
|
|
150
|
+
disabled,
|
|
151
|
+
ref,
|
|
152
|
+
onClick: (event) => {
|
|
153
|
+
onClick?.(event);
|
|
154
|
+
controller.focus("hours");
|
|
155
|
+
},
|
|
156
|
+
onMouseDown: (event) => {
|
|
157
|
+
event.preventDefault();
|
|
158
|
+
onMouseDown?.(event);
|
|
159
|
+
},
|
|
160
|
+
onFocusCapture: (event) => {
|
|
161
|
+
setDropdownOpened(true);
|
|
162
|
+
onFocusCapture?.(event);
|
|
163
|
+
},
|
|
164
|
+
onBlurCapture: (event) => {
|
|
165
|
+
setDropdownOpened(false);
|
|
166
|
+
onBlurCapture?.(event);
|
|
167
|
+
},
|
|
168
|
+
rightSection: rightSection || controller.isClearable && /* @__PURE__ */ jsx(
|
|
169
|
+
CloseButton,
|
|
152
170
|
{
|
|
153
|
-
|
|
171
|
+
...clearButtonProps,
|
|
154
172
|
size,
|
|
155
|
-
disabled,
|
|
156
|
-
ref,
|
|
157
173
|
onClick: (event) => {
|
|
158
|
-
|
|
159
|
-
|
|
174
|
+
controller.clear();
|
|
175
|
+
clearButtonProps?.onClick?.(event);
|
|
160
176
|
},
|
|
161
177
|
onMouseDown: (event) => {
|
|
162
178
|
event.preventDefault();
|
|
163
|
-
onMouseDown?.(event);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
179
|
+
clearButtonProps?.onMouseDown?.(event);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
labelProps: { htmlFor: hoursInputId, ...labelProps },
|
|
184
|
+
style,
|
|
185
|
+
className,
|
|
186
|
+
classNames: resolvedClassNames,
|
|
187
|
+
styles: resolvedStyles,
|
|
188
|
+
__staticSelector: "TimePicker",
|
|
189
|
+
...others,
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsx("div", { ...getStyles("fieldsRoot"), dir: "ltr", children: /* @__PURE__ */ jsxs("div", { ...getStyles("fieldsGroup"), onBlur: handleBlur, children: [
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
SpinInput,
|
|
175
194
|
{
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
195
|
+
id: hoursInputId,
|
|
196
|
+
...hoursInputProps,
|
|
197
|
+
...getStyles("field", {
|
|
198
|
+
className: hoursInputProps?.className,
|
|
199
|
+
style: hoursInputProps?.style
|
|
200
|
+
}),
|
|
201
|
+
value: controller.values.hours,
|
|
202
|
+
onChange: controller.setHours,
|
|
203
|
+
onNextInput: () => controller.focus("minutes"),
|
|
204
|
+
min: format === "12h" ? 1 : 0,
|
|
205
|
+
max: format === "12h" ? 12 : 23,
|
|
206
|
+
focusable: true,
|
|
207
|
+
step: hoursStep,
|
|
208
|
+
ref: _hoursRef,
|
|
209
|
+
"aria-label": hoursInputLabel,
|
|
210
|
+
readOnly,
|
|
211
|
+
disabled,
|
|
212
|
+
onPaste: controller.onPaste,
|
|
213
|
+
onFocus: (event) => {
|
|
214
|
+
handleFocus(event);
|
|
215
|
+
hoursInputProps?.onFocus?.(event);
|
|
185
216
|
}
|
|
186
217
|
}
|
|
187
218
|
),
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
classNames: resolvedClassNames,
|
|
192
|
-
styles: resolvedStyles,
|
|
193
|
-
__staticSelector: "TimePicker",
|
|
194
|
-
...others,
|
|
195
|
-
children: [
|
|
196
|
-
/* @__PURE__ */ jsx("div", { ...getStyles("fieldsRoot"), dir: "ltr", children: /* @__PURE__ */ jsxs("div", { ...getStyles("fieldsGroup"), onBlur: handleBlur, children: [
|
|
197
|
-
/* @__PURE__ */ jsx(
|
|
198
|
-
SpinInput,
|
|
199
|
-
{
|
|
200
|
-
id: hoursInputId,
|
|
201
|
-
...hoursInputProps,
|
|
202
|
-
...getStyles("field", {
|
|
203
|
-
className: hoursInputProps?.className,
|
|
204
|
-
style: hoursInputProps?.style
|
|
205
|
-
}),
|
|
206
|
-
value: controller.values.hours,
|
|
207
|
-
onChange: controller.setHours,
|
|
208
|
-
onNextInput: () => controller.focus("minutes"),
|
|
209
|
-
min: format === "12h" ? 1 : 0,
|
|
210
|
-
max: format === "12h" ? 12 : 23,
|
|
211
|
-
focusable: true,
|
|
212
|
-
step: hoursStep,
|
|
213
|
-
ref: _hoursRef,
|
|
214
|
-
"aria-label": hoursInputLabel,
|
|
215
|
-
readOnly,
|
|
216
|
-
disabled,
|
|
217
|
-
onPaste: controller.onPaste,
|
|
218
|
-
onFocus: (event) => {
|
|
219
|
-
handleFocus(event);
|
|
220
|
-
hoursInputProps?.onFocus?.(event);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
/* @__PURE__ */ jsx("span", { children: ":" }),
|
|
225
|
-
/* @__PURE__ */ jsx(
|
|
226
|
-
SpinInput,
|
|
227
|
-
{
|
|
228
|
-
...minutesInputProps,
|
|
229
|
-
...getStyles("field", {
|
|
230
|
-
className: minutesInputProps?.className,
|
|
231
|
-
style: minutesInputProps?.style
|
|
232
|
-
}),
|
|
233
|
-
value: controller.values.minutes,
|
|
234
|
-
onChange: controller.setMinutes,
|
|
235
|
-
min: 0,
|
|
236
|
-
max: 59,
|
|
237
|
-
focusable: true,
|
|
238
|
-
step: minutesStep,
|
|
239
|
-
ref: _minutesRef,
|
|
240
|
-
onPreviousInput: () => controller.focus("hours"),
|
|
241
|
-
onNextInput: () => withSeconds ? controller.focus("seconds") : controller.focus("amPm"),
|
|
242
|
-
"aria-label": minutesInputLabel,
|
|
243
|
-
tabIndex: -1,
|
|
244
|
-
readOnly,
|
|
245
|
-
disabled,
|
|
246
|
-
onPaste: controller.onPaste,
|
|
247
|
-
onFocus: (event) => {
|
|
248
|
-
handleFocus(event);
|
|
249
|
-
minutesInputProps?.onFocus?.(event);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
),
|
|
253
|
-
withSeconds && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
254
|
-
/* @__PURE__ */ jsx("span", { children: ":" }),
|
|
255
|
-
/* @__PURE__ */ jsx(
|
|
256
|
-
SpinInput,
|
|
257
|
-
{
|
|
258
|
-
...secondsInputProps,
|
|
259
|
-
...getStyles("field", {
|
|
260
|
-
className: secondsInputProps?.className,
|
|
261
|
-
style: secondsInputProps?.style
|
|
262
|
-
}),
|
|
263
|
-
value: controller.values.seconds,
|
|
264
|
-
onChange: controller.setSeconds,
|
|
265
|
-
min: 0,
|
|
266
|
-
max: 59,
|
|
267
|
-
focusable: true,
|
|
268
|
-
step: secondsStep,
|
|
269
|
-
ref: _secondsRef,
|
|
270
|
-
onPreviousInput: () => controller.focus("minutes"),
|
|
271
|
-
onNextInput: () => controller.focus("amPm"),
|
|
272
|
-
"aria-label": secondsInputLabel,
|
|
273
|
-
tabIndex: -1,
|
|
274
|
-
readOnly,
|
|
275
|
-
disabled,
|
|
276
|
-
onPaste: controller.onPaste,
|
|
277
|
-
onFocus: (event) => {
|
|
278
|
-
handleFocus(event);
|
|
279
|
-
secondsInputProps?.onFocus?.(event);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
)
|
|
283
|
-
] }),
|
|
284
|
-
format === "12h" && /* @__PURE__ */ jsx(
|
|
285
|
-
AmPmInput,
|
|
286
|
-
{
|
|
287
|
-
...amPmSelectProps,
|
|
288
|
-
inputType: withDropdown ? "input" : "select",
|
|
289
|
-
labels: amPmLabels,
|
|
290
|
-
value: controller.values.amPm,
|
|
291
|
-
onChange: controller.setAmPm,
|
|
292
|
-
ref: _amPmRef,
|
|
293
|
-
"aria-label": amPmInputLabel,
|
|
294
|
-
onPreviousInput: () => withSeconds ? controller.focus("seconds") : controller.focus("minutes"),
|
|
295
|
-
readOnly,
|
|
296
|
-
disabled,
|
|
297
|
-
tabIndex: -1,
|
|
298
|
-
onPaste: controller.onPaste,
|
|
299
|
-
onFocus: (event) => {
|
|
300
|
-
handleFocus(event);
|
|
301
|
-
amPmSelectProps?.onFocus?.(event);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
)
|
|
305
|
-
] }) }),
|
|
306
|
-
/* @__PURE__ */ jsx(
|
|
307
|
-
"input",
|
|
308
|
-
{
|
|
309
|
-
type: "hidden",
|
|
310
|
-
name,
|
|
311
|
-
form,
|
|
312
|
-
value: controller.hiddenInputValue,
|
|
313
|
-
...hiddenInputProps
|
|
314
|
-
}
|
|
315
|
-
)
|
|
316
|
-
]
|
|
317
|
-
}
|
|
318
|
-
) }),
|
|
319
|
-
/* @__PURE__ */ jsx(
|
|
320
|
-
Popover.Dropdown,
|
|
321
|
-
{
|
|
322
|
-
...getStyles("dropdown"),
|
|
323
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
324
|
-
children: presets ? /* @__PURE__ */ jsx(
|
|
325
|
-
TimePresets,
|
|
219
|
+
/* @__PURE__ */ jsx("span", { children: ":" }),
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
SpinInput,
|
|
326
222
|
{
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
223
|
+
...minutesInputProps,
|
|
224
|
+
...getStyles("field", {
|
|
225
|
+
className: minutesInputProps?.className,
|
|
226
|
+
style: minutesInputProps?.style
|
|
227
|
+
}),
|
|
228
|
+
value: controller.values.minutes,
|
|
229
|
+
onChange: controller.setMinutes,
|
|
230
|
+
min: 0,
|
|
231
|
+
max: 59,
|
|
232
|
+
focusable: true,
|
|
233
|
+
step: minutesStep,
|
|
234
|
+
ref: _minutesRef,
|
|
235
|
+
onPreviousInput: () => controller.focus("hours"),
|
|
236
|
+
onNextInput: () => withSeconds ? controller.focus("seconds") : controller.focus("amPm"),
|
|
237
|
+
"aria-label": minutesInputLabel,
|
|
238
|
+
tabIndex: -1,
|
|
239
|
+
readOnly,
|
|
240
|
+
disabled,
|
|
241
|
+
onPaste: controller.onPaste,
|
|
242
|
+
onFocus: (event) => {
|
|
243
|
+
handleFocus(event);
|
|
244
|
+
minutesInputProps?.onFocus?.(event);
|
|
343
245
|
}
|
|
344
|
-
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
withSeconds && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
249
|
+
/* @__PURE__ */ jsx("span", { children: ":" }),
|
|
345
250
|
/* @__PURE__ */ jsx(
|
|
346
|
-
|
|
347
|
-
{
|
|
348
|
-
min: 0,
|
|
349
|
-
max: 59,
|
|
350
|
-
step: minutesStep,
|
|
351
|
-
value: controller.values.minutes,
|
|
352
|
-
onSelect: controller.setMinutes
|
|
353
|
-
}
|
|
354
|
-
),
|
|
355
|
-
withSeconds && /* @__PURE__ */ jsx(
|
|
356
|
-
TimeControlsList,
|
|
251
|
+
SpinInput,
|
|
357
252
|
{
|
|
253
|
+
...secondsInputProps,
|
|
254
|
+
...getStyles("field", {
|
|
255
|
+
className: secondsInputProps?.className,
|
|
256
|
+
style: secondsInputProps?.style
|
|
257
|
+
}),
|
|
258
|
+
value: controller.values.seconds,
|
|
259
|
+
onChange: controller.setSeconds,
|
|
358
260
|
min: 0,
|
|
359
261
|
max: 59,
|
|
262
|
+
focusable: true,
|
|
360
263
|
step: secondsStep,
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
264
|
+
ref: _secondsRef,
|
|
265
|
+
onPreviousInput: () => controller.focus("minutes"),
|
|
266
|
+
onNextInput: () => controller.focus("amPm"),
|
|
267
|
+
"aria-label": secondsInputLabel,
|
|
268
|
+
tabIndex: -1,
|
|
269
|
+
readOnly,
|
|
270
|
+
disabled,
|
|
271
|
+
onPaste: controller.onPaste,
|
|
272
|
+
onFocus: (event) => {
|
|
273
|
+
handleFocus(event);
|
|
274
|
+
secondsInputProps?.onFocus?.(event);
|
|
275
|
+
}
|
|
371
276
|
}
|
|
372
277
|
)
|
|
373
|
-
] })
|
|
278
|
+
] }),
|
|
279
|
+
format === "12h" && /* @__PURE__ */ jsx(
|
|
280
|
+
AmPmInput,
|
|
281
|
+
{
|
|
282
|
+
...amPmSelectProps,
|
|
283
|
+
inputType: withDropdown ? "input" : "select",
|
|
284
|
+
labels: amPmLabels,
|
|
285
|
+
value: controller.values.amPm,
|
|
286
|
+
onChange: controller.setAmPm,
|
|
287
|
+
ref: _amPmRef,
|
|
288
|
+
"aria-label": amPmInputLabel,
|
|
289
|
+
onPreviousInput: () => withSeconds ? controller.focus("seconds") : controller.focus("minutes"),
|
|
290
|
+
readOnly,
|
|
291
|
+
disabled,
|
|
292
|
+
tabIndex: -1,
|
|
293
|
+
onPaste: controller.onPaste,
|
|
294
|
+
onFocus: (event) => {
|
|
295
|
+
handleFocus(event);
|
|
296
|
+
amPmSelectProps?.onFocus?.(event);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
)
|
|
300
|
+
] }) }),
|
|
301
|
+
/* @__PURE__ */ jsx(
|
|
302
|
+
"input",
|
|
303
|
+
{
|
|
304
|
+
type: "hidden",
|
|
305
|
+
name,
|
|
306
|
+
form,
|
|
307
|
+
value: controller.hiddenInputValue,
|
|
308
|
+
...hiddenInputProps
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
) }),
|
|
314
|
+
/* @__PURE__ */ jsx(
|
|
315
|
+
Popover.Dropdown,
|
|
316
|
+
{
|
|
317
|
+
...getStyles("dropdown"),
|
|
318
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
319
|
+
children: presets ? /* @__PURE__ */ jsx(
|
|
320
|
+
TimePresets,
|
|
321
|
+
{
|
|
322
|
+
value: controller.hiddenInputValue,
|
|
323
|
+
onChange: controller.setTimeString,
|
|
324
|
+
format,
|
|
325
|
+
presets,
|
|
326
|
+
amPmLabels,
|
|
327
|
+
withSeconds: withSeconds || false
|
|
374
328
|
}
|
|
375
|
-
)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
329
|
+
) : /* @__PURE__ */ jsxs("div", { ...getStyles("controlsListGroup"), children: [
|
|
330
|
+
/* @__PURE__ */ jsx(
|
|
331
|
+
TimeControlsList,
|
|
332
|
+
{
|
|
333
|
+
min: format === "12h" ? 1 : 0,
|
|
334
|
+
max: format === "12h" ? 12 : 23,
|
|
335
|
+
step: hoursStep,
|
|
336
|
+
value: controller.values.hours,
|
|
337
|
+
onSelect: controller.setHours
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
/* @__PURE__ */ jsx(
|
|
341
|
+
TimeControlsList,
|
|
342
|
+
{
|
|
343
|
+
min: 0,
|
|
344
|
+
max: 59,
|
|
345
|
+
step: minutesStep,
|
|
346
|
+
value: controller.values.minutes,
|
|
347
|
+
onSelect: controller.setMinutes
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
withSeconds && /* @__PURE__ */ jsx(
|
|
351
|
+
TimeControlsList,
|
|
352
|
+
{
|
|
353
|
+
min: 0,
|
|
354
|
+
max: 59,
|
|
355
|
+
step: secondsStep,
|
|
356
|
+
value: controller.values.seconds,
|
|
357
|
+
onSelect: controller.setSeconds
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
format === "12h" && /* @__PURE__ */ jsx(
|
|
361
|
+
AmPmControlsList,
|
|
362
|
+
{
|
|
363
|
+
labels: amPmLabels,
|
|
364
|
+
value: controller.values.amPm,
|
|
365
|
+
onSelect: controller.setAmPm
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] })
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
]
|
|
379
372
|
}
|
|
380
|
-
);
|
|
373
|
+
) });
|
|
381
374
|
});
|
|
382
375
|
TimePicker.displayName = "@mantine/dates/TimePicker";
|
|
383
376
|
TimePicker.classes = classes;
|