@mantine/dates 9.0.0-alpha.6 → 9.0.0-alpha.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine/dates",
3
- "version": "9.0.0-alpha.6",
3
+ "version": "9.0.0-alpha.7",
4
4
  "description": "Calendars, date and time pickers based on Mantine components",
5
5
  "homepage": "https://mantine.dev/dates/getting-started/",
6
6
  "license": "MIT",
@@ -45,8 +45,8 @@
45
45
  "directory": "packages/@mantine/dates"
46
46
  },
47
47
  "peerDependencies": {
48
- "@mantine/core": "9.0.0-alpha.6",
49
- "@mantine/hooks": "9.0.0-alpha.6",
48
+ "@mantine/core": "9.0.0-alpha.7",
49
+ "@mantine/hooks": "9.0.0-alpha.7",
50
50
  "dayjs": ">=1.0.0",
51
51
  "react": "^19.2.0",
52
52
  "react-dom": "^19.2.0"
@@ -1,286 +0,0 @@
1
- "use client";
2
- const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
3
- const require_assign_time = require("../../utils/assign-time/assign-time.cjs");
4
- const require_get_default_clamped_date = require("../../utils/get-default-clamped-date/get-default-clamped-date.cjs");
5
- const require_clamp_date = require("../../utils/clamp-date/clamp-date.cjs");
6
- const require_use_dates_context = require("../DatesProvider/use-dates-context.cjs");
7
- const require_TimePicker = require("../TimePicker/TimePicker.cjs");
8
- const require_use_uncontrolled_dates = require("../../hooks/use-uncontrolled-dates/use-uncontrolled-dates.cjs");
9
- const require_pick_calendar_levels_props = require("../Calendar/pick-calendar-levels-props/pick-calendar-levels-props.cjs");
10
- const require_DatePicker = require("../DatePicker/DatePicker.cjs");
11
- const require_get_min_max_time = require("../DateTimePicker/get-min-max-time/get-min-max-time.cjs");
12
- const require_InlineDateTimePicker_module = require("./InlineDateTimePicker.module.cjs");
13
- let dayjs = require("dayjs");
14
- dayjs = require_runtime.__toESM(dayjs);
15
- let react = require("react");
16
- let react_jsx_runtime = require("react/jsx-runtime");
17
- let _mantine_core = require("@mantine/core");
18
- let _mantine_hooks = require("@mantine/hooks");
19
- //#region packages/@mantine/dates/src/components/InlineDateTimePicker/InlineDateTimePicker.tsx
20
- const defaultProps = {
21
- type: "default",
22
- size: "sm"
23
- };
24
- const InlineDateTimePicker = (0, _mantine_core.genericFactory)((_props) => {
25
- const props = (0, _mantine_core.useProps)("InlineDateTimePicker", defaultProps, _props);
26
- const { value, defaultValue, onChange, valueFormat, locale, classNames, styles, unstyled, timePickerProps, endTimePickerProps, submitButtonProps, withSeconds, level, defaultLevel, size, variant, vars, minDate, maxDate, defaultDate, defaultTimeValue, presets, attributes, onSubmit, labelSeparator, type, className, style, __stopPropagation, __staticSelector, __onEnter, __onPresetSelect, fullWidth, ...rest } = props;
27
- const _staticSelector = __staticSelector || "InlineDateTimePicker";
28
- const getStyles = (0, _mantine_core.useStyles)({
29
- name: _staticSelector,
30
- classes: require_InlineDateTimePicker_module.default,
31
- props,
32
- classNames,
33
- styles,
34
- unstyled,
35
- attributes,
36
- vars
37
- });
38
- const { resolvedClassNames, resolvedStyles } = (0, _mantine_core.useResolvedStylesApi)({
39
- classNames,
40
- styles,
41
- props
42
- });
43
- const ctx = require_use_dates_context.useDatesContext();
44
- const _valueFormat = valueFormat || (withSeconds ? "DD/MM/YYYY HH:mm:ss" : "DD/MM/YYYY HH:mm");
45
- const _labelSeparator = ctx.getLabelSeparator(labelSeparator);
46
- const isRange = type === "range";
47
- const startTimePickerRef = (0, react.useRef)(null);
48
- const startTimePickerRefMerged = (0, _mantine_hooks.useMergedRef)(startTimePickerRef, timePickerProps?.hoursRef);
49
- const endTimePickerRefMerged = (0, _mantine_hooks.useMergedRef)((0, react.useRef)(null), endTimePickerProps?.hoursRef);
50
- const { calendarProps: { allowSingleDateInRange, ...calendarProps }, others } = require_pick_calendar_levels_props.pickCalendarProps(rest);
51
- const [_value, setValue] = require_use_uncontrolled_dates.useUncontrolledDates({
52
- type,
53
- value,
54
- defaultValue,
55
- onChange,
56
- withTime: true
57
- });
58
- const formatTime = (dateValue) => dateValue ? (0, dayjs.default)(dateValue).format(withSeconds ? "HH:mm:ss" : "HH:mm") : "";
59
- const getInitialStartTime = () => {
60
- if (defaultTimeValue) return defaultTimeValue;
61
- if (isRange) return Array.isArray(_value) ? formatTime(_value[0]) : "";
62
- return formatTime(_value);
63
- };
64
- const getInitialEndTime = () => {
65
- if (defaultTimeValue) return defaultTimeValue;
66
- return isRange && Array.isArray(_value) ? formatTime(_value[1]) : "";
67
- };
68
- const [startTimeValue, setStartTimeValue] = (0, react.useState)(getInitialStartTime);
69
- const [endTimeValue, setEndTimeValue] = (0, react.useState)(getInitialEndTime);
70
- const [currentLevel, setCurrentLevel] = (0, react.useState)(level || defaultLevel || "month");
71
- const _defaultDate = isRange ? (Array.isArray(_value) ? _value[0] : null) || defaultDate : _value || defaultDate;
72
- const handleDefaultDateChange = (date) => {
73
- if (date) setValue(require_assign_time.assignTime(require_clamp_date.clampDate(minDate, maxDate, date), startTimeValue || defaultTimeValue || ""));
74
- startTimePickerRef.current?.focus();
75
- };
76
- const handleRangeDateChange = (dates) => {
77
- const [start, end] = dates;
78
- setValue([start ? require_assign_time.assignTime(require_clamp_date.clampDate(minDate, maxDate, start), startTimeValue || defaultTimeValue || "") : null, end ? require_assign_time.assignTime(require_clamp_date.clampDate(minDate, maxDate, end), endTimeValue || defaultTimeValue || "") : null]);
79
- if (start && end) startTimePickerRef.current?.focus();
80
- };
81
- const handleDateChange = (date) => {
82
- if (isRange) handleRangeDateChange(date);
83
- else handleDefaultDateChange(date);
84
- };
85
- const handleStartTimeChange = (timeString) => {
86
- timePickerProps?.onChange?.(timeString);
87
- setStartTimeValue(timeString);
88
- if (timeString) if (isRange && Array.isArray(_value)) {
89
- if (_value[0]) setValue([require_assign_time.assignTime(_value[0], timeString), _value[1]]);
90
- } else setValue(require_assign_time.assignTime(_value, timeString));
91
- };
92
- const handleEndTimeChange = (timeString) => {
93
- endTimePickerProps?.onChange?.(timeString);
94
- setEndTimeValue(timeString);
95
- if (timeString && isRange && Array.isArray(_value) && _value[1]) {
96
- const newEnd = require_assign_time.assignTime(_value[1], timeString);
97
- setValue([_value[0], newEnd]);
98
- }
99
- };
100
- const handleTimeInputKeyDown = (event) => {
101
- if (event.key === "Enter") {
102
- event.preventDefault();
103
- __onEnter?.();
104
- }
105
- };
106
- const getFormattedRange = () => {
107
- if (!isRange || !Array.isArray(_value)) return "";
108
- const formatDate = (v) => v ? (0, dayjs.default)(v).locale(ctx.getLocale(locale)).format(_valueFormat) : "";
109
- const start = formatDate(_value[0]);
110
- const end = formatDate(_value[1]);
111
- if (start && end) return `${start} ${_labelSeparator} ${end}`;
112
- if (start) return `${start} ${_labelSeparator} ...`;
113
- return "";
114
- };
115
- (0, _mantine_hooks.useDidUpdate)(() => {
116
- if (isRange && Array.isArray(_value)) {
117
- setStartTimeValue(formatTime(_value[0]));
118
- setEndTimeValue(formatTime(_value[1]));
119
- } else setStartTimeValue(formatTime(_value));
120
- }, [_value]);
121
- const startMinTime = isRange ? require_get_min_max_time.getMinTime({
122
- minDate,
123
- value: Array.isArray(_value) ? _value[0] : null
124
- }) : require_get_min_max_time.getMinTime({
125
- minDate,
126
- value: _value
127
- });
128
- const startMaxTime = isRange ? require_get_min_max_time.getMaxTime({
129
- maxDate,
130
- value: Array.isArray(_value) ? _value[0] : null
131
- }) : require_get_min_max_time.getMaxTime({
132
- maxDate,
133
- value: _value
134
- });
135
- const endMinTime = isRange ? require_get_min_max_time.getMinTime({
136
- minDate,
137
- value: Array.isArray(_value) ? _value[1] : null
138
- }) : void 0;
139
- const endMaxTime = isRange ? require_get_min_max_time.getMaxTime({
140
- maxDate,
141
- value: Array.isArray(_value) ? _value[1] : null
142
- }) : void 0;
143
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
144
- ...getStyles("root", {
145
- className,
146
- style
147
- }),
148
- ...others,
149
- ref: props.ref,
150
- children: [
151
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DatePicker.DatePicker, {
152
- fullWidth: fullWidth ?? true,
153
- ...calendarProps,
154
- maxDate,
155
- minDate,
156
- size,
157
- variant,
158
- type,
159
- value: _value,
160
- defaultDate: _defaultDate || require_get_default_clamped_date.getDefaultClampedDate({
161
- maxDate,
162
- minDate
163
- }),
164
- onChange: handleDateChange,
165
- locale,
166
- classNames: resolvedClassNames,
167
- styles: resolvedStyles,
168
- unstyled,
169
- __staticSelector: _staticSelector,
170
- __stopPropagation,
171
- level,
172
- defaultLevel,
173
- onLevelChange: (_level) => {
174
- setCurrentLevel(_level);
175
- calendarProps.onLevelChange?.(_level);
176
- },
177
- presets,
178
- allowSingleDateInRange,
179
- __onPresetSelect,
180
- attributes
181
- }),
182
- currentLevel === "month" && !isRange && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
183
- ...getStyles("timeWrapper"),
184
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TimePicker.TimePicker, {
185
- value: startTimeValue,
186
- withSeconds,
187
- unstyled,
188
- min: startMinTime,
189
- max: startMaxTime,
190
- ...timePickerProps,
191
- ...getStyles("timeInput", {
192
- className: timePickerProps?.className,
193
- style: timePickerProps?.style
194
- }),
195
- onChange: handleStartTimeChange,
196
- onKeyDown: handleTimeInputKeyDown,
197
- size,
198
- "data-mantine-stop-propagation": __stopPropagation || void 0,
199
- hoursRef: startTimePickerRefMerged
200
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
201
- variant: "default",
202
- size: `input-${size || "sm"}`,
203
- ...getStyles("submitButton", {
204
- className: submitButtonProps?.className,
205
- style: submitButtonProps?.style
206
- }),
207
- unstyled,
208
- "data-mantine-stop-propagation": __stopPropagation || void 0,
209
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.CheckIcon, { size: "30%" }),
210
- ...submitButtonProps,
211
- onClick: (event) => {
212
- submitButtonProps?.onClick?.(event);
213
- onSubmit?.();
214
- }
215
- })]
216
- }),
217
- currentLevel === "month" && isRange && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
218
- ...getStyles("rangeInfo"),
219
- children: getFormattedRange()
220
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
221
- ...getStyles("rangeTimeWrapper"),
222
- children: [
223
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TimePicker.TimePicker, {
224
- value: startTimeValue,
225
- withSeconds,
226
- unstyled,
227
- min: startMinTime,
228
- max: startMaxTime,
229
- ...timePickerProps,
230
- ...getStyles("rangeTimeInput", {
231
- className: timePickerProps?.className,
232
- style: timePickerProps?.style
233
- }),
234
- onChange: handleStartTimeChange,
235
- onKeyDown: handleTimeInputKeyDown,
236
- size,
237
- "data-mantine-stop-propagation": __stopPropagation || void 0,
238
- hoursRef: startTimePickerRefMerged
239
- }),
240
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TimePicker.TimePicker, {
241
- value: endTimeValue,
242
- withSeconds,
243
- unstyled,
244
- min: endMinTime,
245
- max: endMaxTime,
246
- ...endTimePickerProps,
247
- ...getStyles("rangeTimeInput", {
248
- className: endTimePickerProps?.className,
249
- style: endTimePickerProps?.style
250
- }),
251
- onChange: handleEndTimeChange,
252
- onKeyDown: handleTimeInputKeyDown,
253
- size,
254
- "data-mantine-stop-propagation": __stopPropagation || void 0,
255
- hoursRef: endTimePickerRefMerged
256
- }),
257
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
258
- variant: "default",
259
- size: `input-${size || "sm"}`,
260
- ...getStyles("submitButton", {
261
- className: submitButtonProps?.className,
262
- style: submitButtonProps?.style
263
- }),
264
- unstyled,
265
- "data-mantine-stop-propagation": __stopPropagation || void 0,
266
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.CheckIcon, { size: "30%" }),
267
- ...submitButtonProps,
268
- onClick: (event) => {
269
- submitButtonProps?.onClick?.(event);
270
- onSubmit?.();
271
- }
272
- })
273
- ]
274
- })] })
275
- ]
276
- });
277
- });
278
- InlineDateTimePicker.classes = {
279
- ...require_InlineDateTimePicker_module.default,
280
- ...require_DatePicker.DatePicker.classes
281
- };
282
- InlineDateTimePicker.displayName = "@mantine/dates/InlineDateTimePicker";
283
- //#endregion
284
- exports.InlineDateTimePicker = InlineDateTimePicker;
285
-
286
- //# sourceMappingURL=InlineDateTimePicker.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineDateTimePicker.cjs","names":["useDatesContext","pickCalendarProps","useUncontrolledDates","assignTime","clampDate","getMinTime","getMaxTime","Box","DatePicker","getDefaultClampedDate","TimePicker","ActionIcon","CheckIcon","Text","classes"],"sources":["../../../src/components/InlineDateTimePicker/InlineDateTimePicker.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useRef, useState } from 'react';\nimport {\n ActionIcon,\n ActionIconProps,\n Box,\n BoxProps,\n CheckIcon,\n ElementProps,\n Factory,\n genericFactory,\n MantineSize,\n StylesApiProps,\n Text,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDidUpdate, useMergedRef } from '@mantine/hooks';\nimport { useUncontrolledDates } from '../../hooks';\nimport { DatePickerType, DateStringValue, DateValue } from '../../types';\nimport { assignTime, clampDate, getDefaultClampedDate } from '../../utils';\nimport { pickCalendarProps } from '../Calendar';\nimport { DatePicker, DatePickerBaseProps, DatePickerStylesNames } from '../DatePicker';\nimport { useDatesContext } from '../DatesProvider';\nimport { getMaxTime, getMinTime } from '../DateTimePicker/get-min-max-time/get-min-max-time';\nimport { TimePicker, TimePickerProps } from '../TimePicker/TimePicker';\nimport classes from './InlineDateTimePicker.module.css';\n\nexport type InlineDateTimePickerStylesNames =\n | 'root'\n | 'timeWrapper'\n | 'timeInput'\n | 'submitButton'\n | 'rangeTimeWrapper'\n | 'rangeTimeInput'\n | 'rangeInfo'\n | DatePickerStylesNames;\n\nexport interface InlineDateTimePickerProps<Type extends DatePickerType = 'default'>\n extends\n BoxProps,\n DatePickerBaseProps<Type>,\n StylesApiProps<InlineDateTimePickerFactory>,\n ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {\n /** Default time value in `HH:mm` or `HH:mm:ss` format. Assigned to time when date is selected. */\n defaultTimeValue?: string;\n\n /** Props passed down to `TimePicker` component */\n timePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;\n\n /** Props passed down to the end time `TimePicker` component in range mode */\n endTimePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;\n\n /** Props passed down to the submit button */\n submitButtonProps?: ActionIconProps & React.ComponentProps<'button'>;\n\n /** Determines whether the seconds input should be displayed @default false */\n withSeconds?: boolean;\n\n /** Called when the submit button is clicked */\n onSubmit?: () => void;\n\n /** `dayjs` format for range display @default \"DD/MM/YYYY HH:mm\" */\n valueFormat?: string;\n\n /** Separator between range values */\n labelSeparator?: string;\n\n /** Component size @default 'sm' */\n size?: MantineSize;\n\n /** Min date */\n minDate?: DateStringValue | Date;\n\n /** Max date */\n maxDate?: DateStringValue | Date;\n\n /** @internal Adds data-mantine-stop-propagation to interactive elements */\n __stopPropagation?: boolean;\n\n /** @internal Overrides the static selector used for class names */\n __staticSelector?: string;\n\n /** @internal Called when Enter is pressed in a time input */\n __onEnter?: () => void;\n\n /** @internal Forwarded to DatePicker for preset handling */\n __onPresetSelect?: (val: any) => void;\n}\n\nexport type InlineDateTimePickerFactory = Factory<{\n props: InlineDateTimePickerProps;\n ref: HTMLDivElement;\n stylesNames: InlineDateTimePickerStylesNames;\n signature: <Type extends DatePickerType = 'default'>(\n props: InlineDateTimePickerProps<Type> & { ref?: React.Ref<HTMLDivElement> }\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n type: 'default',\n size: 'sm',\n} satisfies Partial<InlineDateTimePickerProps>;\n\nexport const InlineDateTimePicker = genericFactory<InlineDateTimePickerFactory>((_props) => {\n const props = useProps('InlineDateTimePicker', defaultProps as any, _props);\n const {\n value,\n defaultValue,\n onChange,\n valueFormat,\n locale,\n classNames,\n styles,\n unstyled,\n timePickerProps,\n endTimePickerProps,\n submitButtonProps,\n withSeconds,\n level,\n defaultLevel,\n size,\n variant,\n vars,\n minDate,\n maxDate,\n defaultDate,\n defaultTimeValue,\n presets,\n attributes,\n onSubmit,\n labelSeparator,\n type,\n className,\n style,\n __stopPropagation,\n __staticSelector,\n __onEnter,\n __onPresetSelect,\n fullWidth,\n ...rest\n } = props;\n\n const _staticSelector = __staticSelector || 'InlineDateTimePicker';\n\n const getStyles = useStyles<InlineDateTimePickerFactory>({\n name: _staticSelector,\n classes,\n props: props as InlineDateTimePickerProps,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<InlineDateTimePickerFactory>({\n classNames,\n styles,\n props: props as InlineDateTimePickerProps,\n });\n\n const ctx = useDatesContext();\n const _valueFormat = valueFormat || (withSeconds ? 'DD/MM/YYYY HH:mm:ss' : 'DD/MM/YYYY HH:mm');\n const _labelSeparator = ctx.getLabelSeparator(labelSeparator);\n const isRange = (type as string) === 'range';\n\n const startTimePickerRef = useRef<HTMLInputElement>(null);\n const startTimePickerRefMerged = useMergedRef(startTimePickerRef, timePickerProps?.hoursRef);\n const endTimePickerRef = useRef<HTMLInputElement>(null);\n const endTimePickerRefMerged = useMergedRef(endTimePickerRef, endTimePickerProps?.hoursRef);\n\n const {\n calendarProps: { allowSingleDateInRange, ...calendarProps },\n others,\n } = pickCalendarProps(rest);\n\n const [_value, setValue] = useUncontrolledDates({\n type: type as any,\n value,\n defaultValue,\n onChange: onChange as any,\n withTime: true,\n });\n\n const formatTime = (dateValue: DateStringValue | null) =>\n dateValue ? dayjs(dateValue).format(withSeconds ? 'HH:mm:ss' : 'HH:mm') : '';\n\n const getInitialStartTime = () => {\n if (defaultTimeValue) {\n return defaultTimeValue;\n }\n if (isRange) {\n return Array.isArray(_value) ? formatTime(_value[0]) : '';\n }\n return formatTime(_value as DateStringValue | null);\n };\n\n const getInitialEndTime = () => {\n if (defaultTimeValue) {\n return defaultTimeValue;\n }\n return isRange && Array.isArray(_value) ? formatTime(_value[1]) : '';\n };\n\n const [startTimeValue, setStartTimeValue] = useState(getInitialStartTime);\n const [endTimeValue, setEndTimeValue] = useState(getInitialEndTime);\n const [currentLevel, setCurrentLevel] = useState(level || defaultLevel || 'month');\n\n const _defaultDate = isRange\n ? (Array.isArray(_value) ? _value[0] : null) || defaultDate\n : (_value as DateStringValue | null) || defaultDate;\n\n const handleDefaultDateChange = (date: DateValue) => {\n if (date) {\n setValue(\n assignTime(clampDate(minDate, maxDate, date), startTimeValue || defaultTimeValue || '')\n );\n }\n startTimePickerRef.current?.focus();\n };\n\n const handleRangeDateChange = (dates: any) => {\n const [start, end] = dates;\n const newStart = start\n ? assignTime(clampDate(minDate, maxDate, start), startTimeValue || defaultTimeValue || '')\n : null;\n const newEnd = end\n ? assignTime(clampDate(minDate, maxDate, end), endTimeValue || defaultTimeValue || '')\n : null;\n setValue([newStart, newEnd] as any);\n\n if (start && end) {\n startTimePickerRef.current?.focus();\n }\n };\n\n const handleDateChange = (date: any) => {\n if (isRange) {\n handleRangeDateChange(date);\n } else {\n handleDefaultDateChange(date);\n }\n };\n\n const handleStartTimeChange = (timeString: string) => {\n timePickerProps?.onChange?.(timeString);\n setStartTimeValue(timeString);\n\n if (timeString) {\n if (isRange && Array.isArray(_value)) {\n if (_value[0]) {\n const newStart = assignTime(_value[0], timeString);\n setValue([newStart, _value[1]] as any);\n }\n } else {\n setValue(assignTime(_value as DateStringValue | null, timeString));\n }\n }\n };\n\n const handleEndTimeChange = (timeString: string) => {\n endTimePickerProps?.onChange?.(timeString);\n setEndTimeValue(timeString);\n\n if (timeString && isRange && Array.isArray(_value) && _value[1]) {\n const newEnd = assignTime(_value[1], timeString);\n setValue([_value[0], newEnd] as any);\n }\n };\n\n const handleTimeInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n __onEnter?.();\n }\n };\n\n const getFormattedRange = () => {\n if (!isRange || !Array.isArray(_value)) {\n return '';\n }\n\n const formatDate = (v: DateStringValue | null) =>\n v ? dayjs(v).locale(ctx.getLocale(locale)).format(_valueFormat) : '';\n\n const start = formatDate(_value[0]);\n const end = formatDate(_value[1]);\n\n if (start && end) {\n return `${start} ${_labelSeparator} ${end}`;\n }\n\n if (start) {\n return `${start} ${_labelSeparator} ...`;\n }\n\n return '';\n };\n\n useDidUpdate(() => {\n if (isRange && Array.isArray(_value)) {\n setStartTimeValue(formatTime(_value[0]));\n setEndTimeValue(formatTime(_value[1]));\n } else {\n setStartTimeValue(formatTime(_value as DateStringValue | null));\n }\n }, [_value]);\n\n const startMinTime = isRange\n ? getMinTime({ minDate, value: Array.isArray(_value) ? _value[0] : null })\n : getMinTime({ minDate, value: _value as DateStringValue | null });\n\n const startMaxTime = isRange\n ? getMaxTime({ maxDate, value: Array.isArray(_value) ? _value[0] : null })\n : getMaxTime({ maxDate, value: _value as DateStringValue | null });\n\n const endMinTime = isRange\n ? getMinTime({ minDate, value: Array.isArray(_value) ? _value[1] : null })\n : undefined;\n\n const endMaxTime = isRange\n ? getMaxTime({ maxDate, value: Array.isArray(_value) ? _value[1] : null })\n : undefined;\n\n return (\n <Box {...getStyles('root', { className, style })} {...others} ref={props.ref as any}>\n <DatePicker\n fullWidth={fullWidth ?? true}\n {...calendarProps}\n maxDate={maxDate}\n minDate={minDate}\n size={size}\n variant={variant}\n type={type as any}\n value={_value as any}\n defaultDate={_defaultDate || getDefaultClampedDate({ maxDate, minDate })}\n onChange={handleDateChange}\n locale={locale}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector={_staticSelector}\n __stopPropagation={__stopPropagation}\n level={level}\n defaultLevel={defaultLevel}\n onLevelChange={(_level) => {\n setCurrentLevel(_level);\n calendarProps.onLevelChange?.(_level);\n }}\n presets={presets}\n allowSingleDateInRange={allowSingleDateInRange}\n __onPresetSelect={__onPresetSelect}\n attributes={attributes}\n />\n\n {currentLevel === 'month' && !isRange && (\n <div {...getStyles('timeWrapper')}>\n <TimePicker\n value={startTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={startMinTime}\n max={startMaxTime}\n {...timePickerProps}\n {...getStyles('timeInput', {\n className: timePickerProps?.className,\n style: timePickerProps?.style,\n })}\n onChange={handleStartTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={startTimePickerRefMerged}\n />\n\n <ActionIcon\n variant=\"default\"\n size={`input-${size || 'sm'}`}\n {...getStyles('submitButton', {\n className: submitButtonProps?.className,\n style: submitButtonProps?.style,\n })}\n unstyled={unstyled}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n // eslint-disable-next-line react/no-children-prop\n children={<CheckIcon size=\"30%\" />}\n {...submitButtonProps}\n onClick={(event) => {\n submitButtonProps?.onClick?.(event);\n onSubmit?.();\n }}\n />\n </div>\n )}\n\n {currentLevel === 'month' && isRange && (\n <>\n <Text {...getStyles('rangeInfo')}>{getFormattedRange()}</Text>\n\n <div {...getStyles('rangeTimeWrapper')}>\n <TimePicker\n value={startTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={startMinTime}\n max={startMaxTime}\n {...timePickerProps}\n {...getStyles('rangeTimeInput', {\n className: timePickerProps?.className,\n style: timePickerProps?.style,\n })}\n onChange={handleStartTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={startTimePickerRefMerged}\n />\n\n <TimePicker\n value={endTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={endMinTime}\n max={endMaxTime}\n {...endTimePickerProps}\n {...getStyles('rangeTimeInput', {\n className: endTimePickerProps?.className,\n style: endTimePickerProps?.style,\n })}\n onChange={handleEndTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={endTimePickerRefMerged}\n />\n\n <ActionIcon\n variant=\"default\"\n size={`input-${size || 'sm'}`}\n {...getStyles('submitButton', {\n className: submitButtonProps?.className,\n style: submitButtonProps?.style,\n })}\n unstyled={unstyled}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n // eslint-disable-next-line react/no-children-prop\n children={<CheckIcon size=\"30%\" />}\n {...submitButtonProps}\n onClick={(event) => {\n submitButtonProps?.onClick?.(event);\n onSubmit?.();\n }}\n />\n </div>\n </>\n )}\n </Box>\n );\n});\n\nInlineDateTimePicker.classes = { ...classes, ...DatePicker.classes };\nInlineDateTimePicker.displayName = '@mantine/dates/InlineDateTimePicker';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoGA,MAAM,eAAe;CACnB,MAAM;CACN,MAAM;CACP;AAED,MAAa,wBAAA,GAAA,cAAA,iBAAoE,WAAW;CAC1F,MAAM,SAAA,GAAA,cAAA,UAAiB,wBAAwB,cAAqB,OAAO;CAC3E,MAAM,EACJ,OACA,cACA,UACA,aACA,QACA,YACA,QACA,UACA,iBACA,oBACA,mBACA,aACA,OACA,cACA,MACA,SACA,MACA,SACA,SACA,aACA,kBACA,SACA,YACA,UACA,gBACA,MACA,WACA,OACA,mBACA,kBACA,WACA,kBACA,WACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,oBAAoB;CAE5C,MAAM,aAAA,GAAA,cAAA,WAAmD;EACvD,MAAM;EACN,SAAA,oCAAA;EACO;EACP;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,EAAE,oBAAoB,oBAAA,GAAA,cAAA,sBAAqE;EAC/F;EACA;EACO;EACR,CAAC;CAEF,MAAM,MAAMA,0BAAAA,iBAAiB;CAC7B,MAAM,eAAe,gBAAgB,cAAc,wBAAwB;CAC3E,MAAM,kBAAkB,IAAI,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I,UAAU,kBAAkB;OAC9B,WAAW,iBAAiB;OAC5B,OAAO,iBAAiB;OACzB,CAAC;MACF,UAAU;MACV,WAAW;MACL;MACN,iCAA+B,qBAAqB,KAAA;MACpD,UAAU;MACV,CAAA;KAEF,iBAAA,GAAA,kBAAA,KAACA,mBAAAA,YAAD;MACE,OAAO;MACM;MACH;MACV,KAAK;MACL,KAAK;MACL,GAAI;MACJ,GAAI,UAAU,kBAAkB;OAC9B,WAAW,oBAAoB;OAC/B,OAAO,oBAAoB;OAC5B,CAAC;MACF,UAAU;MACV,WAAW;MACL;MACN,iCAA+B,qBAAqB,KAAA;MACpD,UAAU;MACV,CAAA;KAEF,iBAAA,GAAA,kBAAA,KAACC,cAAAA,YAAD;MACE,SAAQ;MACR,MAAM,SAAS,QAAQ;MACvB,GAAI,UAAU,gBAAgB;OAC5B,WAAW,mBAAmB;OAC9B,OAAO,mBAAmB;OAC3B,CAAC;MACQ;MACV,iCAA+B,qBAAqB,KAAA;MAEpD,UAAU,iBAAA,GAAA,kBAAA,KAACC,cAAAA,WAAD,EAAW,MAAK,OAAQ,CAAA;MAClC,GAAI;MACJ,UAAU,UAAU;AAClB,0BAAmB,UAAU,MAAM;AACnC,mBAAY;;MAEd,CAAA;KACE;MACL,EAAA,CAAA;GAED;;EAER;AAEF,qBAAqB,UAAU;CAAE,GAAGE,oCAAAA;CAAS,GAAGN,mBAAAA,WAAW;CAAS;AACpE,qBAAqB,cAAc"}
@@ -1,13 +0,0 @@
1
- "use client";
2
- //#region packages/@mantine/dates/src/components/InlineDateTimePicker/InlineDateTimePicker.module.css
3
- var InlineDateTimePicker_module_default = {
4
- "timeWrapper": "m_43bf4edb",
5
- "timeInput": "m_49f1412",
6
- "rangeInfo": "m_d6d672a0",
7
- "rangeTimeWrapper": "m_80eb36d4",
8
- "rangeTimeInput": "m_5566a64b"
9
- };
10
- //#endregion
11
- exports.default = InlineDateTimePicker_module_default;
12
-
13
- //# sourceMappingURL=InlineDateTimePicker.module.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineDateTimePicker.module.cjs","names":[],"sources":["../../../src/components/InlineDateTimePicker/InlineDateTimePicker.module.css"],"sourcesContent":[".timeWrapper {\n display: flex;\n align-items: stretch;\n margin-top: var(--mantine-spacing-md);\n}\n\n.timeInput {\n flex: 1;\n margin-inline-end: var(--mantine-spacing-md);\n}\n\n.rangeInfo {\n margin-top: var(--mantine-spacing-md);\n font-size: calc(var(--mantine-font-size-sm) - rem(2px));\n color: var(--mantine-color-text);\n line-height: 1.4;\n height: calc((var(--mantine-font-size-sm) - rem(2px)) * 1.4);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rangeTimeWrapper {\n display: flex;\n align-items: stretch;\n gap: var(--mantine-spacing-md);\n margin-top: var(--mantine-spacing-md);\n}\n\n.rangeTimeInput {\n flex: 1;\n}\n"],"mappings":""}
@@ -1,11 +0,0 @@
1
- "use client";
2
- //#region packages/@mantine/dates/src/components/MonthPicker/MonthPicker.module.css
3
- var MonthPicker_module_default = {
4
- "monthPickerRoot": "m_53c9e871",
5
- "presetsList": "m_cccb8ff3",
6
- "presetButton": "m_7b4fbf50"
7
- };
8
- //#endregion
9
- exports.default = MonthPicker_module_default;
10
-
11
- //# sourceMappingURL=MonthPicker.module.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MonthPicker.module.cjs","names":[],"sources":["../../../src/components/MonthPicker/MonthPicker.module.css"],"sourcesContent":[".monthPickerRoot {\n display: flex;\n font-size: var(--preset-font-size);\n}\n\n.presetsList {\n display: flex;\n flex-direction: column;\n border-inline-end: 1px solid;\n padding-inline-end: 0.5em;\n margin-inline-end: 0.5em;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-5);\n }\n}\n\n.presetButton {\n padding: 0.52em 0.8em;\n border-radius: var(--mantine-radius-default);\n font-size: var(--preset-font-size);\n white-space: nowrap;\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n}\n"],"mappings":""}
@@ -1,11 +0,0 @@
1
- "use client";
2
- //#region packages/@mantine/dates/src/components/YearPicker/YearPicker.module.css
3
- var YearPicker_module_default = {
4
- "yearPickerRoot": "m_d01e596f",
5
- "presetsList": "m_52a6b4b0",
6
- "presetButton": "m_b0d93233"
7
- };
8
- //#endregion
9
- exports.default = YearPicker_module_default;
10
-
11
- //# sourceMappingURL=YearPicker.module.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YearPicker.module.cjs","names":[],"sources":["../../../src/components/YearPicker/YearPicker.module.css"],"sourcesContent":[".yearPickerRoot {\n display: flex;\n font-size: var(--preset-font-size);\n}\n\n.presetsList {\n display: flex;\n flex-direction: column;\n border-inline-end: 1px solid;\n padding-inline-end: 0.5em;\n margin-inline-end: 0.5em;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-5);\n }\n}\n\n.presetButton {\n padding: 0.52em 0.8em;\n border-radius: var(--mantine-radius-default);\n font-size: var(--preset-font-size);\n white-space: nowrap;\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n}\n"],"mappings":""}
@@ -1,284 +0,0 @@
1
- "use client";
2
- import { assignTime } from "../../utils/assign-time/assign-time.mjs";
3
- import { getDefaultClampedDate } from "../../utils/get-default-clamped-date/get-default-clamped-date.mjs";
4
- import { clampDate } from "../../utils/clamp-date/clamp-date.mjs";
5
- import { useDatesContext } from "../DatesProvider/use-dates-context.mjs";
6
- import { TimePicker } from "../TimePicker/TimePicker.mjs";
7
- import { useUncontrolledDates } from "../../hooks/use-uncontrolled-dates/use-uncontrolled-dates.mjs";
8
- import { pickCalendarProps } from "../Calendar/pick-calendar-levels-props/pick-calendar-levels-props.mjs";
9
- import { DatePicker } from "../DatePicker/DatePicker.mjs";
10
- import { getMaxTime, getMinTime } from "../DateTimePicker/get-min-max-time/get-min-max-time.mjs";
11
- import InlineDateTimePicker_module_default from "./InlineDateTimePicker.module.mjs";
12
- import dayjs from "dayjs";
13
- import { useRef, useState } from "react";
14
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
- import { ActionIcon, Box, CheckIcon, Text, genericFactory, useProps, useResolvedStylesApi, useStyles } from "@mantine/core";
16
- import { useDidUpdate, useMergedRef } from "@mantine/hooks";
17
- //#region packages/@mantine/dates/src/components/InlineDateTimePicker/InlineDateTimePicker.tsx
18
- const defaultProps = {
19
- type: "default",
20
- size: "sm"
21
- };
22
- const InlineDateTimePicker = genericFactory((_props) => {
23
- const props = useProps("InlineDateTimePicker", defaultProps, _props);
24
- const { value, defaultValue, onChange, valueFormat, locale, classNames, styles, unstyled, timePickerProps, endTimePickerProps, submitButtonProps, withSeconds, level, defaultLevel, size, variant, vars, minDate, maxDate, defaultDate, defaultTimeValue, presets, attributes, onSubmit, labelSeparator, type, className, style, __stopPropagation, __staticSelector, __onEnter, __onPresetSelect, fullWidth, ...rest } = props;
25
- const _staticSelector = __staticSelector || "InlineDateTimePicker";
26
- const getStyles = useStyles({
27
- name: _staticSelector,
28
- classes: InlineDateTimePicker_module_default,
29
- props,
30
- classNames,
31
- styles,
32
- unstyled,
33
- attributes,
34
- vars
35
- });
36
- const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
37
- classNames,
38
- styles,
39
- props
40
- });
41
- const ctx = useDatesContext();
42
- const _valueFormat = valueFormat || (withSeconds ? "DD/MM/YYYY HH:mm:ss" : "DD/MM/YYYY HH:mm");
43
- const _labelSeparator = ctx.getLabelSeparator(labelSeparator);
44
- const isRange = type === "range";
45
- const startTimePickerRef = useRef(null);
46
- const startTimePickerRefMerged = useMergedRef(startTimePickerRef, timePickerProps?.hoursRef);
47
- const endTimePickerRefMerged = useMergedRef(useRef(null), endTimePickerProps?.hoursRef);
48
- const { calendarProps: { allowSingleDateInRange, ...calendarProps }, others } = pickCalendarProps(rest);
49
- const [_value, setValue] = useUncontrolledDates({
50
- type,
51
- value,
52
- defaultValue,
53
- onChange,
54
- withTime: true
55
- });
56
- const formatTime = (dateValue) => dateValue ? dayjs(dateValue).format(withSeconds ? "HH:mm:ss" : "HH:mm") : "";
57
- const getInitialStartTime = () => {
58
- if (defaultTimeValue) return defaultTimeValue;
59
- if (isRange) return Array.isArray(_value) ? formatTime(_value[0]) : "";
60
- return formatTime(_value);
61
- };
62
- const getInitialEndTime = () => {
63
- if (defaultTimeValue) return defaultTimeValue;
64
- return isRange && Array.isArray(_value) ? formatTime(_value[1]) : "";
65
- };
66
- const [startTimeValue, setStartTimeValue] = useState(getInitialStartTime);
67
- const [endTimeValue, setEndTimeValue] = useState(getInitialEndTime);
68
- const [currentLevel, setCurrentLevel] = useState(level || defaultLevel || "month");
69
- const _defaultDate = isRange ? (Array.isArray(_value) ? _value[0] : null) || defaultDate : _value || defaultDate;
70
- const handleDefaultDateChange = (date) => {
71
- if (date) setValue(assignTime(clampDate(minDate, maxDate, date), startTimeValue || defaultTimeValue || ""));
72
- startTimePickerRef.current?.focus();
73
- };
74
- const handleRangeDateChange = (dates) => {
75
- const [start, end] = dates;
76
- setValue([start ? assignTime(clampDate(minDate, maxDate, start), startTimeValue || defaultTimeValue || "") : null, end ? assignTime(clampDate(minDate, maxDate, end), endTimeValue || defaultTimeValue || "") : null]);
77
- if (start && end) startTimePickerRef.current?.focus();
78
- };
79
- const handleDateChange = (date) => {
80
- if (isRange) handleRangeDateChange(date);
81
- else handleDefaultDateChange(date);
82
- };
83
- const handleStartTimeChange = (timeString) => {
84
- timePickerProps?.onChange?.(timeString);
85
- setStartTimeValue(timeString);
86
- if (timeString) if (isRange && Array.isArray(_value)) {
87
- if (_value[0]) setValue([assignTime(_value[0], timeString), _value[1]]);
88
- } else setValue(assignTime(_value, timeString));
89
- };
90
- const handleEndTimeChange = (timeString) => {
91
- endTimePickerProps?.onChange?.(timeString);
92
- setEndTimeValue(timeString);
93
- if (timeString && isRange && Array.isArray(_value) && _value[1]) {
94
- const newEnd = assignTime(_value[1], timeString);
95
- setValue([_value[0], newEnd]);
96
- }
97
- };
98
- const handleTimeInputKeyDown = (event) => {
99
- if (event.key === "Enter") {
100
- event.preventDefault();
101
- __onEnter?.();
102
- }
103
- };
104
- const getFormattedRange = () => {
105
- if (!isRange || !Array.isArray(_value)) return "";
106
- const formatDate = (v) => v ? dayjs(v).locale(ctx.getLocale(locale)).format(_valueFormat) : "";
107
- const start = formatDate(_value[0]);
108
- const end = formatDate(_value[1]);
109
- if (start && end) return `${start} ${_labelSeparator} ${end}`;
110
- if (start) return `${start} ${_labelSeparator} ...`;
111
- return "";
112
- };
113
- useDidUpdate(() => {
114
- if (isRange && Array.isArray(_value)) {
115
- setStartTimeValue(formatTime(_value[0]));
116
- setEndTimeValue(formatTime(_value[1]));
117
- } else setStartTimeValue(formatTime(_value));
118
- }, [_value]);
119
- const startMinTime = isRange ? getMinTime({
120
- minDate,
121
- value: Array.isArray(_value) ? _value[0] : null
122
- }) : getMinTime({
123
- minDate,
124
- value: _value
125
- });
126
- const startMaxTime = isRange ? getMaxTime({
127
- maxDate,
128
- value: Array.isArray(_value) ? _value[0] : null
129
- }) : getMaxTime({
130
- maxDate,
131
- value: _value
132
- });
133
- const endMinTime = isRange ? getMinTime({
134
- minDate,
135
- value: Array.isArray(_value) ? _value[1] : null
136
- }) : void 0;
137
- const endMaxTime = isRange ? getMaxTime({
138
- maxDate,
139
- value: Array.isArray(_value) ? _value[1] : null
140
- }) : void 0;
141
- return /* @__PURE__ */ jsxs(Box, {
142
- ...getStyles("root", {
143
- className,
144
- style
145
- }),
146
- ...others,
147
- ref: props.ref,
148
- children: [
149
- /* @__PURE__ */ jsx(DatePicker, {
150
- fullWidth: fullWidth ?? true,
151
- ...calendarProps,
152
- maxDate,
153
- minDate,
154
- size,
155
- variant,
156
- type,
157
- value: _value,
158
- defaultDate: _defaultDate || getDefaultClampedDate({
159
- maxDate,
160
- minDate
161
- }),
162
- onChange: handleDateChange,
163
- locale,
164
- classNames: resolvedClassNames,
165
- styles: resolvedStyles,
166
- unstyled,
167
- __staticSelector: _staticSelector,
168
- __stopPropagation,
169
- level,
170
- defaultLevel,
171
- onLevelChange: (_level) => {
172
- setCurrentLevel(_level);
173
- calendarProps.onLevelChange?.(_level);
174
- },
175
- presets,
176
- allowSingleDateInRange,
177
- __onPresetSelect,
178
- attributes
179
- }),
180
- currentLevel === "month" && !isRange && /* @__PURE__ */ jsxs("div", {
181
- ...getStyles("timeWrapper"),
182
- children: [/* @__PURE__ */ jsx(TimePicker, {
183
- value: startTimeValue,
184
- withSeconds,
185
- unstyled,
186
- min: startMinTime,
187
- max: startMaxTime,
188
- ...timePickerProps,
189
- ...getStyles("timeInput", {
190
- className: timePickerProps?.className,
191
- style: timePickerProps?.style
192
- }),
193
- onChange: handleStartTimeChange,
194
- onKeyDown: handleTimeInputKeyDown,
195
- size,
196
- "data-mantine-stop-propagation": __stopPropagation || void 0,
197
- hoursRef: startTimePickerRefMerged
198
- }), /* @__PURE__ */ jsx(ActionIcon, {
199
- variant: "default",
200
- size: `input-${size || "sm"}`,
201
- ...getStyles("submitButton", {
202
- className: submitButtonProps?.className,
203
- style: submitButtonProps?.style
204
- }),
205
- unstyled,
206
- "data-mantine-stop-propagation": __stopPropagation || void 0,
207
- children: /* @__PURE__ */ jsx(CheckIcon, { size: "30%" }),
208
- ...submitButtonProps,
209
- onClick: (event) => {
210
- submitButtonProps?.onClick?.(event);
211
- onSubmit?.();
212
- }
213
- })]
214
- }),
215
- currentLevel === "month" && isRange && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Text, {
216
- ...getStyles("rangeInfo"),
217
- children: getFormattedRange()
218
- }), /* @__PURE__ */ jsxs("div", {
219
- ...getStyles("rangeTimeWrapper"),
220
- children: [
221
- /* @__PURE__ */ jsx(TimePicker, {
222
- value: startTimeValue,
223
- withSeconds,
224
- unstyled,
225
- min: startMinTime,
226
- max: startMaxTime,
227
- ...timePickerProps,
228
- ...getStyles("rangeTimeInput", {
229
- className: timePickerProps?.className,
230
- style: timePickerProps?.style
231
- }),
232
- onChange: handleStartTimeChange,
233
- onKeyDown: handleTimeInputKeyDown,
234
- size,
235
- "data-mantine-stop-propagation": __stopPropagation || void 0,
236
- hoursRef: startTimePickerRefMerged
237
- }),
238
- /* @__PURE__ */ jsx(TimePicker, {
239
- value: endTimeValue,
240
- withSeconds,
241
- unstyled,
242
- min: endMinTime,
243
- max: endMaxTime,
244
- ...endTimePickerProps,
245
- ...getStyles("rangeTimeInput", {
246
- className: endTimePickerProps?.className,
247
- style: endTimePickerProps?.style
248
- }),
249
- onChange: handleEndTimeChange,
250
- onKeyDown: handleTimeInputKeyDown,
251
- size,
252
- "data-mantine-stop-propagation": __stopPropagation || void 0,
253
- hoursRef: endTimePickerRefMerged
254
- }),
255
- /* @__PURE__ */ jsx(ActionIcon, {
256
- variant: "default",
257
- size: `input-${size || "sm"}`,
258
- ...getStyles("submitButton", {
259
- className: submitButtonProps?.className,
260
- style: submitButtonProps?.style
261
- }),
262
- unstyled,
263
- "data-mantine-stop-propagation": __stopPropagation || void 0,
264
- children: /* @__PURE__ */ jsx(CheckIcon, { size: "30%" }),
265
- ...submitButtonProps,
266
- onClick: (event) => {
267
- submitButtonProps?.onClick?.(event);
268
- onSubmit?.();
269
- }
270
- })
271
- ]
272
- })] })
273
- ]
274
- });
275
- });
276
- InlineDateTimePicker.classes = {
277
- ...InlineDateTimePicker_module_default,
278
- ...DatePicker.classes
279
- };
280
- InlineDateTimePicker.displayName = "@mantine/dates/InlineDateTimePicker";
281
- //#endregion
282
- export { InlineDateTimePicker };
283
-
284
- //# sourceMappingURL=InlineDateTimePicker.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineDateTimePicker.mjs","names":["classes"],"sources":["../../../src/components/InlineDateTimePicker/InlineDateTimePicker.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useRef, useState } from 'react';\nimport {\n ActionIcon,\n ActionIconProps,\n Box,\n BoxProps,\n CheckIcon,\n ElementProps,\n Factory,\n genericFactory,\n MantineSize,\n StylesApiProps,\n Text,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDidUpdate, useMergedRef } from '@mantine/hooks';\nimport { useUncontrolledDates } from '../../hooks';\nimport { DatePickerType, DateStringValue, DateValue } from '../../types';\nimport { assignTime, clampDate, getDefaultClampedDate } from '../../utils';\nimport { pickCalendarProps } from '../Calendar';\nimport { DatePicker, DatePickerBaseProps, DatePickerStylesNames } from '../DatePicker';\nimport { useDatesContext } from '../DatesProvider';\nimport { getMaxTime, getMinTime } from '../DateTimePicker/get-min-max-time/get-min-max-time';\nimport { TimePicker, TimePickerProps } from '../TimePicker/TimePicker';\nimport classes from './InlineDateTimePicker.module.css';\n\nexport type InlineDateTimePickerStylesNames =\n | 'root'\n | 'timeWrapper'\n | 'timeInput'\n | 'submitButton'\n | 'rangeTimeWrapper'\n | 'rangeTimeInput'\n | 'rangeInfo'\n | DatePickerStylesNames;\n\nexport interface InlineDateTimePickerProps<Type extends DatePickerType = 'default'>\n extends\n BoxProps,\n DatePickerBaseProps<Type>,\n StylesApiProps<InlineDateTimePickerFactory>,\n ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {\n /** Default time value in `HH:mm` or `HH:mm:ss` format. Assigned to time when date is selected. */\n defaultTimeValue?: string;\n\n /** Props passed down to `TimePicker` component */\n timePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;\n\n /** Props passed down to the end time `TimePicker` component in range mode */\n endTimePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;\n\n /** Props passed down to the submit button */\n submitButtonProps?: ActionIconProps & React.ComponentProps<'button'>;\n\n /** Determines whether the seconds input should be displayed @default false */\n withSeconds?: boolean;\n\n /** Called when the submit button is clicked */\n onSubmit?: () => void;\n\n /** `dayjs` format for range display @default \"DD/MM/YYYY HH:mm\" */\n valueFormat?: string;\n\n /** Separator between range values */\n labelSeparator?: string;\n\n /** Component size @default 'sm' */\n size?: MantineSize;\n\n /** Min date */\n minDate?: DateStringValue | Date;\n\n /** Max date */\n maxDate?: DateStringValue | Date;\n\n /** @internal Adds data-mantine-stop-propagation to interactive elements */\n __stopPropagation?: boolean;\n\n /** @internal Overrides the static selector used for class names */\n __staticSelector?: string;\n\n /** @internal Called when Enter is pressed in a time input */\n __onEnter?: () => void;\n\n /** @internal Forwarded to DatePicker for preset handling */\n __onPresetSelect?: (val: any) => void;\n}\n\nexport type InlineDateTimePickerFactory = Factory<{\n props: InlineDateTimePickerProps;\n ref: HTMLDivElement;\n stylesNames: InlineDateTimePickerStylesNames;\n signature: <Type extends DatePickerType = 'default'>(\n props: InlineDateTimePickerProps<Type> & { ref?: React.Ref<HTMLDivElement> }\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n type: 'default',\n size: 'sm',\n} satisfies Partial<InlineDateTimePickerProps>;\n\nexport const InlineDateTimePicker = genericFactory<InlineDateTimePickerFactory>((_props) => {\n const props = useProps('InlineDateTimePicker', defaultProps as any, _props);\n const {\n value,\n defaultValue,\n onChange,\n valueFormat,\n locale,\n classNames,\n styles,\n unstyled,\n timePickerProps,\n endTimePickerProps,\n submitButtonProps,\n withSeconds,\n level,\n defaultLevel,\n size,\n variant,\n vars,\n minDate,\n maxDate,\n defaultDate,\n defaultTimeValue,\n presets,\n attributes,\n onSubmit,\n labelSeparator,\n type,\n className,\n style,\n __stopPropagation,\n __staticSelector,\n __onEnter,\n __onPresetSelect,\n fullWidth,\n ...rest\n } = props;\n\n const _staticSelector = __staticSelector || 'InlineDateTimePicker';\n\n const getStyles = useStyles<InlineDateTimePickerFactory>({\n name: _staticSelector,\n classes,\n props: props as InlineDateTimePickerProps,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<InlineDateTimePickerFactory>({\n classNames,\n styles,\n props: props as InlineDateTimePickerProps,\n });\n\n const ctx = useDatesContext();\n const _valueFormat = valueFormat || (withSeconds ? 'DD/MM/YYYY HH:mm:ss' : 'DD/MM/YYYY HH:mm');\n const _labelSeparator = ctx.getLabelSeparator(labelSeparator);\n const isRange = (type as string) === 'range';\n\n const startTimePickerRef = useRef<HTMLInputElement>(null);\n const startTimePickerRefMerged = useMergedRef(startTimePickerRef, timePickerProps?.hoursRef);\n const endTimePickerRef = useRef<HTMLInputElement>(null);\n const endTimePickerRefMerged = useMergedRef(endTimePickerRef, endTimePickerProps?.hoursRef);\n\n const {\n calendarProps: { allowSingleDateInRange, ...calendarProps },\n others,\n } = pickCalendarProps(rest);\n\n const [_value, setValue] = useUncontrolledDates({\n type: type as any,\n value,\n defaultValue,\n onChange: onChange as any,\n withTime: true,\n });\n\n const formatTime = (dateValue: DateStringValue | null) =>\n dateValue ? dayjs(dateValue).format(withSeconds ? 'HH:mm:ss' : 'HH:mm') : '';\n\n const getInitialStartTime = () => {\n if (defaultTimeValue) {\n return defaultTimeValue;\n }\n if (isRange) {\n return Array.isArray(_value) ? formatTime(_value[0]) : '';\n }\n return formatTime(_value as DateStringValue | null);\n };\n\n const getInitialEndTime = () => {\n if (defaultTimeValue) {\n return defaultTimeValue;\n }\n return isRange && Array.isArray(_value) ? formatTime(_value[1]) : '';\n };\n\n const [startTimeValue, setStartTimeValue] = useState(getInitialStartTime);\n const [endTimeValue, setEndTimeValue] = useState(getInitialEndTime);\n const [currentLevel, setCurrentLevel] = useState(level || defaultLevel || 'month');\n\n const _defaultDate = isRange\n ? (Array.isArray(_value) ? _value[0] : null) || defaultDate\n : (_value as DateStringValue | null) || defaultDate;\n\n const handleDefaultDateChange = (date: DateValue) => {\n if (date) {\n setValue(\n assignTime(clampDate(minDate, maxDate, date), startTimeValue || defaultTimeValue || '')\n );\n }\n startTimePickerRef.current?.focus();\n };\n\n const handleRangeDateChange = (dates: any) => {\n const [start, end] = dates;\n const newStart = start\n ? assignTime(clampDate(minDate, maxDate, start), startTimeValue || defaultTimeValue || '')\n : null;\n const newEnd = end\n ? assignTime(clampDate(minDate, maxDate, end), endTimeValue || defaultTimeValue || '')\n : null;\n setValue([newStart, newEnd] as any);\n\n if (start && end) {\n startTimePickerRef.current?.focus();\n }\n };\n\n const handleDateChange = (date: any) => {\n if (isRange) {\n handleRangeDateChange(date);\n } else {\n handleDefaultDateChange(date);\n }\n };\n\n const handleStartTimeChange = (timeString: string) => {\n timePickerProps?.onChange?.(timeString);\n setStartTimeValue(timeString);\n\n if (timeString) {\n if (isRange && Array.isArray(_value)) {\n if (_value[0]) {\n const newStart = assignTime(_value[0], timeString);\n setValue([newStart, _value[1]] as any);\n }\n } else {\n setValue(assignTime(_value as DateStringValue | null, timeString));\n }\n }\n };\n\n const handleEndTimeChange = (timeString: string) => {\n endTimePickerProps?.onChange?.(timeString);\n setEndTimeValue(timeString);\n\n if (timeString && isRange && Array.isArray(_value) && _value[1]) {\n const newEnd = assignTime(_value[1], timeString);\n setValue([_value[0], newEnd] as any);\n }\n };\n\n const handleTimeInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n __onEnter?.();\n }\n };\n\n const getFormattedRange = () => {\n if (!isRange || !Array.isArray(_value)) {\n return '';\n }\n\n const formatDate = (v: DateStringValue | null) =>\n v ? dayjs(v).locale(ctx.getLocale(locale)).format(_valueFormat) : '';\n\n const start = formatDate(_value[0]);\n const end = formatDate(_value[1]);\n\n if (start && end) {\n return `${start} ${_labelSeparator} ${end}`;\n }\n\n if (start) {\n return `${start} ${_labelSeparator} ...`;\n }\n\n return '';\n };\n\n useDidUpdate(() => {\n if (isRange && Array.isArray(_value)) {\n setStartTimeValue(formatTime(_value[0]));\n setEndTimeValue(formatTime(_value[1]));\n } else {\n setStartTimeValue(formatTime(_value as DateStringValue | null));\n }\n }, [_value]);\n\n const startMinTime = isRange\n ? getMinTime({ minDate, value: Array.isArray(_value) ? _value[0] : null })\n : getMinTime({ minDate, value: _value as DateStringValue | null });\n\n const startMaxTime = isRange\n ? getMaxTime({ maxDate, value: Array.isArray(_value) ? _value[0] : null })\n : getMaxTime({ maxDate, value: _value as DateStringValue | null });\n\n const endMinTime = isRange\n ? getMinTime({ minDate, value: Array.isArray(_value) ? _value[1] : null })\n : undefined;\n\n const endMaxTime = isRange\n ? getMaxTime({ maxDate, value: Array.isArray(_value) ? _value[1] : null })\n : undefined;\n\n return (\n <Box {...getStyles('root', { className, style })} {...others} ref={props.ref as any}>\n <DatePicker\n fullWidth={fullWidth ?? true}\n {...calendarProps}\n maxDate={maxDate}\n minDate={minDate}\n size={size}\n variant={variant}\n type={type as any}\n value={_value as any}\n defaultDate={_defaultDate || getDefaultClampedDate({ maxDate, minDate })}\n onChange={handleDateChange}\n locale={locale}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector={_staticSelector}\n __stopPropagation={__stopPropagation}\n level={level}\n defaultLevel={defaultLevel}\n onLevelChange={(_level) => {\n setCurrentLevel(_level);\n calendarProps.onLevelChange?.(_level);\n }}\n presets={presets}\n allowSingleDateInRange={allowSingleDateInRange}\n __onPresetSelect={__onPresetSelect}\n attributes={attributes}\n />\n\n {currentLevel === 'month' && !isRange && (\n <div {...getStyles('timeWrapper')}>\n <TimePicker\n value={startTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={startMinTime}\n max={startMaxTime}\n {...timePickerProps}\n {...getStyles('timeInput', {\n className: timePickerProps?.className,\n style: timePickerProps?.style,\n })}\n onChange={handleStartTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={startTimePickerRefMerged}\n />\n\n <ActionIcon\n variant=\"default\"\n size={`input-${size || 'sm'}`}\n {...getStyles('submitButton', {\n className: submitButtonProps?.className,\n style: submitButtonProps?.style,\n })}\n unstyled={unstyled}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n // eslint-disable-next-line react/no-children-prop\n children={<CheckIcon size=\"30%\" />}\n {...submitButtonProps}\n onClick={(event) => {\n submitButtonProps?.onClick?.(event);\n onSubmit?.();\n }}\n />\n </div>\n )}\n\n {currentLevel === 'month' && isRange && (\n <>\n <Text {...getStyles('rangeInfo')}>{getFormattedRange()}</Text>\n\n <div {...getStyles('rangeTimeWrapper')}>\n <TimePicker\n value={startTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={startMinTime}\n max={startMaxTime}\n {...timePickerProps}\n {...getStyles('rangeTimeInput', {\n className: timePickerProps?.className,\n style: timePickerProps?.style,\n })}\n onChange={handleStartTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={startTimePickerRefMerged}\n />\n\n <TimePicker\n value={endTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={endMinTime}\n max={endMaxTime}\n {...endTimePickerProps}\n {...getStyles('rangeTimeInput', {\n className: endTimePickerProps?.className,\n style: endTimePickerProps?.style,\n })}\n onChange={handleEndTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={endTimePickerRefMerged}\n />\n\n <ActionIcon\n variant=\"default\"\n size={`input-${size || 'sm'}`}\n {...getStyles('submitButton', {\n className: submitButtonProps?.className,\n style: submitButtonProps?.style,\n })}\n unstyled={unstyled}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n // eslint-disable-next-line react/no-children-prop\n children={<CheckIcon size=\"30%\" />}\n {...submitButtonProps}\n onClick={(event) => {\n submitButtonProps?.onClick?.(event);\n onSubmit?.();\n }}\n />\n </div>\n </>\n )}\n </Box>\n );\n});\n\nInlineDateTimePicker.classes = { ...classes, ...DatePicker.classes };\nInlineDateTimePicker.displayName = '@mantine/dates/InlineDateTimePicker';\n"],"mappings":";;;;;;;;;;;;;;;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AD;MACE,OAAO;MACM;MACH;MACV,KAAK;MACL,KAAK;MACL,GAAI;MACJ,GAAI,UAAU,kBAAkB;OAC9B,WAAW,iBAAiB;OAC5B,OAAO,iBAAiB;OACzB,CAAC;MACF,UAAU;MACV,WAAW;MACL;MACN,iCAA+B,qBAAqB,KAAA;MACpD,UAAU;MACV,CAAA;KAEF,oBAAC,YAAD;MACE,OAAO;MACM;MACH;MACV,KAAK;MACL,KAAK;MACL,GAAI;MACJ,GAAI,UAAU,kBAAkB;OAC9B,WAAW,oBAAoB;OAC/B,OAAO,oBAAoB;OAC5B,CAAC;MACF,UAAU;MACV,WAAW;MACL;MACN,iCAA+B,qBAAqB,KAAA;MACpD,UAAU;MACV,CAAA;KAEF,oBAAC,YAAD;MACE,SAAQ;MACR,MAAM,SAAS,QAAQ;MACvB,GAAI,UAAU,gBAAgB;OAC5B,WAAW,mBAAmB;OAC9B,OAAO,mBAAmB;OAC3B,CAAC;MACQ;MACV,iCAA+B,qBAAqB,KAAA;MAEpD,UAAU,oBAAC,WAAD,EAAW,MAAK,OAAQ,CAAA;MAClC,GAAI;MACJ,UAAU,UAAU;AAClB,0BAAmB,UAAU,MAAM;AACnC,mBAAY;;MAEd,CAAA;KACE;MACL,EAAA,CAAA;GAED;;EAER;AAEF,qBAAqB,UAAU;CAAE,GAAGA;CAAS,GAAG,WAAW;CAAS;AACpE,qBAAqB,cAAc"}
@@ -1,13 +0,0 @@
1
- "use client";
2
- //#region packages/@mantine/dates/src/components/InlineDateTimePicker/InlineDateTimePicker.module.css
3
- var InlineDateTimePicker_module_default = {
4
- "timeWrapper": "m_43bf4edb",
5
- "timeInput": "m_49f1412",
6
- "rangeInfo": "m_d6d672a0",
7
- "rangeTimeWrapper": "m_80eb36d4",
8
- "rangeTimeInput": "m_5566a64b"
9
- };
10
- //#endregion
11
- export { InlineDateTimePicker_module_default as default };
12
-
13
- //# sourceMappingURL=InlineDateTimePicker.module.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineDateTimePicker.module.mjs","names":[],"sources":["../../../src/components/InlineDateTimePicker/InlineDateTimePicker.module.css"],"sourcesContent":[".timeWrapper {\n display: flex;\n align-items: stretch;\n margin-top: var(--mantine-spacing-md);\n}\n\n.timeInput {\n flex: 1;\n margin-inline-end: var(--mantine-spacing-md);\n}\n\n.rangeInfo {\n margin-top: var(--mantine-spacing-md);\n font-size: calc(var(--mantine-font-size-sm) - rem(2px));\n color: var(--mantine-color-text);\n line-height: 1.4;\n height: calc((var(--mantine-font-size-sm) - rem(2px)) * 1.4);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rangeTimeWrapper {\n display: flex;\n align-items: stretch;\n gap: var(--mantine-spacing-md);\n margin-top: var(--mantine-spacing-md);\n}\n\n.rangeTimeInput {\n flex: 1;\n}\n"],"mappings":""}
@@ -1,11 +0,0 @@
1
- "use client";
2
- //#region packages/@mantine/dates/src/components/MonthPicker/MonthPicker.module.css
3
- var MonthPicker_module_default = {
4
- "monthPickerRoot": "m_53c9e871",
5
- "presetsList": "m_cccb8ff3",
6
- "presetButton": "m_7b4fbf50"
7
- };
8
- //#endregion
9
- export { MonthPicker_module_default as default };
10
-
11
- //# sourceMappingURL=MonthPicker.module.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MonthPicker.module.mjs","names":[],"sources":["../../../src/components/MonthPicker/MonthPicker.module.css"],"sourcesContent":[".monthPickerRoot {\n display: flex;\n font-size: var(--preset-font-size);\n}\n\n.presetsList {\n display: flex;\n flex-direction: column;\n border-inline-end: 1px solid;\n padding-inline-end: 0.5em;\n margin-inline-end: 0.5em;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-5);\n }\n}\n\n.presetButton {\n padding: 0.52em 0.8em;\n border-radius: var(--mantine-radius-default);\n font-size: var(--preset-font-size);\n white-space: nowrap;\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n}\n"],"mappings":""}
@@ -1,11 +0,0 @@
1
- "use client";
2
- //#region packages/@mantine/dates/src/components/YearPicker/YearPicker.module.css
3
- var YearPicker_module_default = {
4
- "yearPickerRoot": "m_d01e596f",
5
- "presetsList": "m_52a6b4b0",
6
- "presetButton": "m_b0d93233"
7
- };
8
- //#endregion
9
- export { YearPicker_module_default as default };
10
-
11
- //# sourceMappingURL=YearPicker.module.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YearPicker.module.mjs","names":[],"sources":["../../../src/components/YearPicker/YearPicker.module.css"],"sourcesContent":[".yearPickerRoot {\n display: flex;\n font-size: var(--preset-font-size);\n}\n\n.presetsList {\n display: flex;\n flex-direction: column;\n border-inline-end: 1px solid;\n padding-inline-end: 0.5em;\n margin-inline-end: 0.5em;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-5);\n }\n}\n\n.presetButton {\n padding: 0.52em 0.8em;\n border-radius: var(--mantine-radius-default);\n font-size: var(--preset-font-size);\n white-space: nowrap;\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n}\n"],"mappings":""}
@@ -1,71 +0,0 @@
1
- import { ActionIconProps, BoxProps, ElementProps, Factory, MantineSize, StylesApiProps } from '@mantine/core';
2
- import { DatePickerType, DateStringValue } from '../../types';
3
- import { DatePickerBaseProps, DatePickerStylesNames } from '../DatePicker';
4
- import { TimePickerProps } from '../TimePicker/TimePicker';
5
- export type InlineDateTimePickerStylesNames = 'root' | 'timeWrapper' | 'timeInput' | 'submitButton' | 'rangeTimeWrapper' | 'rangeTimeInput' | 'rangeInfo' | DatePickerStylesNames;
6
- export interface InlineDateTimePickerProps<Type extends DatePickerType = 'default'> extends BoxProps, DatePickerBaseProps<Type>, StylesApiProps<InlineDateTimePickerFactory>, ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {
7
- /** Default time value in `HH:mm` or `HH:mm:ss` format. Assigned to time when date is selected. */
8
- defaultTimeValue?: string;
9
- /** Props passed down to `TimePicker` component */
10
- timePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;
11
- /** Props passed down to the end time `TimePicker` component in range mode */
12
- endTimePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;
13
- /** Props passed down to the submit button */
14
- submitButtonProps?: ActionIconProps & React.ComponentProps<'button'>;
15
- /** Determines whether the seconds input should be displayed @default false */
16
- withSeconds?: boolean;
17
- /** Called when the submit button is clicked */
18
- onSubmit?: () => void;
19
- /** `dayjs` format for range display @default "DD/MM/YYYY HH:mm" */
20
- valueFormat?: string;
21
- /** Separator between range values */
22
- labelSeparator?: string;
23
- /** Component size @default 'sm' */
24
- size?: MantineSize;
25
- /** Min date */
26
- minDate?: DateStringValue | Date;
27
- /** Max date */
28
- maxDate?: DateStringValue | Date;
29
- /** @internal Adds data-mantine-stop-propagation to interactive elements */
30
- __stopPropagation?: boolean;
31
- /** @internal Overrides the static selector used for class names */
32
- __staticSelector?: string;
33
- /** @internal Called when Enter is pressed in a time input */
34
- __onEnter?: () => void;
35
- /** @internal Forwarded to DatePicker for preset handling */
36
- __onPresetSelect?: (val: any) => void;
37
- }
38
- export type InlineDateTimePickerFactory = Factory<{
39
- props: InlineDateTimePickerProps;
40
- ref: HTMLDivElement;
41
- stylesNames: InlineDateTimePickerStylesNames;
42
- signature: <Type extends DatePickerType = 'default'>(props: InlineDateTimePickerProps<Type> & {
43
- ref?: React.Ref<HTMLDivElement>;
44
- }) => React.JSX.Element;
45
- }>;
46
- export declare const InlineDateTimePicker: (<Type extends DatePickerType = "default">(props: InlineDateTimePickerProps<Type> & {
47
- ref?: React.Ref<HTMLDivElement>;
48
- }) => React.JSX.Element) & import("@mantine/core").ThemeExtend<{
49
- props: InlineDateTimePickerProps;
50
- ref: HTMLDivElement;
51
- stylesNames: InlineDateTimePickerStylesNames;
52
- signature: <Type extends DatePickerType = "default">(props: InlineDateTimePickerProps<Type> & {
53
- ref?: React.Ref<HTMLDivElement>;
54
- }) => React.JSX.Element;
55
- }> & import("@mantine/core").ComponentClasses<{
56
- props: InlineDateTimePickerProps;
57
- ref: HTMLDivElement;
58
- stylesNames: InlineDateTimePickerStylesNames;
59
- signature: <Type extends DatePickerType = "default">(props: InlineDateTimePickerProps<Type> & {
60
- ref?: React.Ref<HTMLDivElement>;
61
- }) => React.JSX.Element;
62
- }> & Record<string, never> & import("@mantine/core").FactoryComponentWithProps<{
63
- props: InlineDateTimePickerProps;
64
- ref: HTMLDivElement;
65
- stylesNames: InlineDateTimePickerStylesNames;
66
- signature: <Type extends DatePickerType = "default">(props: InlineDateTimePickerProps<Type> & {
67
- ref?: React.Ref<HTMLDivElement>;
68
- }) => React.JSX.Element;
69
- }> & {
70
- displayName?: string;
71
- };
@@ -1,9 +0,0 @@
1
- import { DatePickerType } from '../../types';
2
- import type { InlineDateTimePickerFactory, InlineDateTimePickerProps, InlineDateTimePickerStylesNames } from './InlineDateTimePicker';
3
- export { InlineDateTimePicker } from './InlineDateTimePicker';
4
- export type { InlineDateTimePickerProps, InlineDateTimePickerStylesNames, InlineDateTimePickerFactory, };
5
- export declare namespace InlineDateTimePicker {
6
- type Props<Type extends DatePickerType> = InlineDateTimePickerProps<Type>;
7
- type StylesNames = InlineDateTimePickerStylesNames;
8
- type Factory = InlineDateTimePickerFactory;
9
- }