@mantine-vue/dates 3.0.0 → 3.2.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.
Files changed (116) hide show
  1. package/cjs/index.cjs +4093 -2032
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +4059 -1998
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/components/AmPmInput/AmPmInput.types.d.ts +3 -0
  6. package/lib/components/AmPmInput/AmPmInput.vue.d.ts +12 -0
  7. package/lib/components/AmPmInput/index.d.ts +2 -0
  8. package/lib/components/Calendar/Calendar.types.d.ts +3 -0
  9. package/lib/components/Calendar/Calendar.vue.d.ts +33 -0
  10. package/lib/components/Calendar/index.d.ts +2 -0
  11. package/lib/components/CalendarHeader/CalendarHeader.types.d.ts +3 -0
  12. package/lib/components/CalendarHeader/CalendarHeader.vue.d.ts +14 -0
  13. package/lib/components/CalendarHeader/index.d.ts +2 -0
  14. package/lib/components/DateInput/DateInput.types.d.ts +3 -0
  15. package/lib/components/DateInput/DateInput.vue.d.ts +10 -0
  16. package/lib/components/DateInput/index.d.ts +2 -0
  17. package/lib/components/DatePicker/DatePicker.types.d.ts +3 -0
  18. package/lib/components/DatePicker/DatePicker.vue.d.ts +17 -0
  19. package/lib/components/DatePicker/index.d.ts +2 -0
  20. package/lib/components/DatePickerInput/DatePickerInput.types.d.ts +3 -0
  21. package/lib/components/DatePickerInput/DatePickerInput.vue.d.ts +14 -0
  22. package/lib/components/DatePickerInput/index.d.ts +2 -0
  23. package/lib/components/DateTimePicker/DateTimePicker.types.d.ts +3 -0
  24. package/lib/components/DateTimePicker/DateTimePicker.vue.d.ts +10 -0
  25. package/lib/components/DateTimePicker/index.d.ts +2 -0
  26. package/lib/components/DatesProvider/DatesProvider.context.d.ts +6 -0
  27. package/lib/components/DatesProvider/DatesProvider.types.d.ts +3 -0
  28. package/lib/components/DatesProvider/DatesProvider.vue.d.ts +14 -0
  29. package/lib/components/DatesProvider/index.d.ts +3 -0
  30. package/lib/components/Day/Day.types.d.ts +3 -0
  31. package/lib/components/Day/Day.vue.d.ts +11 -0
  32. package/lib/components/Day/index.d.ts +2 -0
  33. package/lib/components/DecadeLevel/DecadeLevel.types.d.ts +3 -0
  34. package/lib/components/DecadeLevel/DecadeLevel.vue.d.ts +24 -0
  35. package/lib/components/DecadeLevel/index.d.ts +2 -0
  36. package/lib/components/DecadeLevelGroup/DecadeLevelGroup.types.d.ts +3 -0
  37. package/lib/components/DecadeLevelGroup/DecadeLevelGroup.vue.d.ts +24 -0
  38. package/lib/components/DecadeLevelGroup/index.d.ts +2 -0
  39. package/lib/components/HiddenDatesInput/HiddenDatesInput.types.d.ts +3 -0
  40. package/lib/components/HiddenDatesInput/HiddenDatesInput.vue.d.ts +4 -0
  41. package/lib/components/HiddenDatesInput/index.d.ts +2 -0
  42. package/lib/components/InlineDateTimePicker/InlineDateTimePicker.types.d.ts +3 -0
  43. package/lib/components/InlineDateTimePicker/InlineDateTimePicker.vue.d.ts +12 -0
  44. package/lib/components/InlineDateTimePicker/index.d.ts +2 -0
  45. package/lib/components/LevelsGroup/LevelsGroup.types.d.ts +3 -0
  46. package/lib/components/LevelsGroup/LevelsGroup.vue.d.ts +24 -0
  47. package/lib/components/LevelsGroup/index.d.ts +2 -0
  48. package/lib/components/MiniCalendar/MiniCalendar.types.d.ts +3 -0
  49. package/lib/components/MiniCalendar/MiniCalendar.vue.d.ts +18 -0
  50. package/lib/components/MiniCalendar/index.d.ts +2 -0
  51. package/lib/components/Month/Month.types.d.ts +3 -0
  52. package/lib/components/Month/Month.vue.d.ts +17 -0
  53. package/lib/components/Month/index.d.ts +2 -0
  54. package/lib/components/MonthLevel/MonthLevel.types.d.ts +3 -0
  55. package/lib/components/MonthLevel/MonthLevel.vue.d.ts +24 -0
  56. package/lib/components/MonthLevel/index.d.ts +2 -0
  57. package/lib/components/MonthLevelGroup/MonthLevelGroup.types.d.ts +3 -0
  58. package/lib/components/MonthLevelGroup/MonthLevelGroup.vue.d.ts +24 -0
  59. package/lib/components/MonthLevelGroup/index.d.ts +2 -0
  60. package/lib/components/MonthPicker/MonthPicker.types.d.ts +3 -0
  61. package/lib/components/MonthPicker/MonthPicker.vue.d.ts +10 -0
  62. package/lib/components/MonthPicker/index.d.ts +2 -0
  63. package/lib/components/MonthPickerInput/MonthPickerInput.types.d.ts +6 -0
  64. package/lib/components/MonthPickerInput/MonthPickerInput.vue.d.ts +14 -0
  65. package/lib/components/MonthPickerInput/index.d.ts +2 -0
  66. package/lib/components/MonthsList/MonthsList.types.d.ts +3 -0
  67. package/lib/components/MonthsList/MonthsList.vue.d.ts +10 -0
  68. package/lib/components/MonthsList/index.d.ts +2 -0
  69. package/lib/components/PickerControl/PickerControl.types.d.ts +3 -0
  70. package/lib/components/PickerControl/PickerControl.vue.d.ts +14 -0
  71. package/lib/components/PickerControl/index.d.ts +2 -0
  72. package/lib/components/PickerInputBase/PickerInputBase.types.d.ts +3 -0
  73. package/lib/components/PickerInputBase/PickerInputBase.vue.d.ts +21 -0
  74. package/lib/components/PickerInputBase/index.d.ts +2 -0
  75. package/lib/components/SpinInput/SpinInput.types.d.ts +3 -0
  76. package/lib/components/SpinInput/SpinInput.vue.d.ts +16 -0
  77. package/lib/components/SpinInput/index.d.ts +2 -0
  78. package/lib/components/TimeControlsList/TimeControlsList.types.d.ts +3 -0
  79. package/lib/components/TimeControlsList/TimeControlsList.vue.d.ts +8 -0
  80. package/lib/components/TimeControlsList/index.d.ts +2 -0
  81. package/lib/components/TimeGrid/TimeGrid.types.d.ts +3 -0
  82. package/lib/components/TimeGrid/TimeGrid.vue.d.ts +10 -0
  83. package/lib/components/TimeGrid/index.d.ts +2 -0
  84. package/lib/components/TimeInput/TimeInput.types.d.ts +3 -0
  85. package/lib/components/TimeInput/TimeInput.vue.d.ts +10 -0
  86. package/lib/components/TimeInput/index.d.ts +2 -0
  87. package/lib/components/TimePicker/TimePicker.types.d.ts +3 -0
  88. package/lib/components/TimePicker/TimePicker.vue.d.ts +10 -0
  89. package/lib/components/TimePicker/index.d.ts +2 -0
  90. package/lib/components/TimeValue/TimeValue.types.d.ts +3 -0
  91. package/lib/components/TimeValue/TimeValue.vue.d.ts +4 -0
  92. package/lib/components/TimeValue/index.d.ts +2 -0
  93. package/lib/components/WeekdaysRow/WeekdaysRow.types.d.ts +3 -0
  94. package/lib/components/WeekdaysRow/WeekdaysRow.vue.d.ts +4 -0
  95. package/lib/components/WeekdaysRow/index.d.ts +2 -0
  96. package/lib/components/YearLevel/YearLevel.types.d.ts +3 -0
  97. package/lib/components/YearLevel/YearLevel.vue.d.ts +24 -0
  98. package/lib/components/YearLevel/index.d.ts +2 -0
  99. package/lib/components/YearLevelGroup/YearLevelGroup.types.d.ts +3 -0
  100. package/lib/components/YearLevelGroup/YearLevelGroup.vue.d.ts +24 -0
  101. package/lib/components/YearLevelGroup/index.d.ts +2 -0
  102. package/lib/components/YearPicker/YearPicker.types.d.ts +3 -0
  103. package/lib/components/YearPicker/YearPicker.vue.d.ts +10 -0
  104. package/lib/components/YearPicker/index.d.ts +2 -0
  105. package/lib/components/YearPickerInput/YearPickerInput.types.d.ts +6 -0
  106. package/lib/components/YearPickerInput/YearPickerInput.vue.d.ts +14 -0
  107. package/lib/components/YearPickerInput/index.d.ts +2 -0
  108. package/lib/components/YearsList/YearsList.types.d.ts +3 -0
  109. package/lib/components/YearsList/YearsList.vue.d.ts +10 -0
  110. package/lib/components/YearsList/index.d.ts +2 -0
  111. package/lib/index.d.mts +47 -2889
  112. package/lib/index.d.ts +47 -2889
  113. package/lib/types.d.ts +646 -0
  114. package/lib/utils/index.d.ts +91 -0
  115. package/lib/utils/use-forwarded-props.d.ts +7 -0
  116. package/package.json +3 -3
@@ -0,0 +1,91 @@
1
+ import type { ControlKeydownPayload, DateFormatter, DatePickerType, DatePickerValueType, DatesRangeValue, DateStringValue } from '../types';
2
+ export declare function toDateString(value: Date | string | null | undefined): DateStringValue | null;
3
+ /** Compatibility helper. Date values are already timezone-independent ISO strings in v3. */
4
+ export declare function shiftTimezone<T>(direction: 'add' | 'remove', date: T, timezone?: string): T;
5
+ /** Returns the browser offset for a date; `timezone` is retained for API compatibility. */
6
+ export declare function getTimezoneOffset(date: Date | string, timezone?: string): number;
7
+ export declare function clampDate(date: DateStringValue, minDate?: Date | string, maxDate?: Date | string): string;
8
+ export declare function getDefaultClampedDate({ minDate, maxDate, defaultDate, }?: {
9
+ minDate?: Date | string;
10
+ maxDate?: Date | string;
11
+ defaultDate?: Date | string;
12
+ }): string;
13
+ export declare function assignTime(date: Date | string, time: Date | string): Date;
14
+ export declare function getFormattedDate({ date, format, locale, }: {
15
+ date: Date | string;
16
+ format?: string;
17
+ locale?: string;
18
+ }): string;
19
+ export declare function isSameDate(a: Date | string | null | undefined, b: Date | string | null | undefined): boolean;
20
+ export declare function isSameMonth(a: Date | string, b: Date | string): boolean;
21
+ export declare function isSameYear(a: Date | string, b: Date | string): boolean;
22
+ export declare function getStartOfWeek(date: Date | string, firstDayOfWeek?: number): string;
23
+ export declare function getEndOfWeek(date: Date | string, firstDayOfWeek?: number): string;
24
+ export declare function getWeekNumber(date: Date | string): number;
25
+ export declare function handleControlKeyDown({ rowIndex, cellIndex, event, controlsRef, }: ControlKeydownPayload): void;
26
+ export declare function focusAdjacentControl(refs: (HTMLElement | null | undefined)[][], rowIndex: number, cellIndex: number, direction: 'up' | 'down' | 'left' | 'right'): void;
27
+ export declare function keyToDirection(key: string): 'up' | 'down' | 'left' | 'right' | null;
28
+ export declare function setGridRef(refs: (HTMLElement | null | undefined)[][], rowIndex: number, cellIndex: number, node: any): void;
29
+ export declare function getMonthDays(month: DateStringValue, firstDayOfWeek: number, consistentWeeks?: boolean): string[][];
30
+ export declare function isBeforeMin(date: DateStringValue, minDate?: Date | string): boolean;
31
+ export declare function isAfterMax(date: DateStringValue, maxDate?: Date | string): boolean;
32
+ export declare function getMonthLabel(date: DateStringValue, format?: string, locale?: string): string;
33
+ export declare function getYearRange(date: DateStringValue): string[];
34
+ export declare function getDecadeLabel(date: DateStringValue): string;
35
+ export declare function formatValue(value: DatePickerValueType, type: DatePickerType, format: string, locale?: string, labelSeparator?: string, valueFormatter?: DateFormatter): string;
36
+ export declare function isInRangeGranular(date: DateStringValue, range: [DateStringValue, DateStringValue], unit: 'month' | 'year'): boolean;
37
+ export declare function getNextPickerValue(value: DatePickerValueType, date: DateStringValue, type: DatePickerType, sortDates?: boolean): string | string[] | DatesRangeValue;
38
+ export declare function dateStringParser(value: string, format?: string, locale?: string): string | null;
39
+ export declare function isDateValid({ date, minDate, maxDate, }: {
40
+ date: string;
41
+ minDate?: string | Date;
42
+ maxDate?: string | Date;
43
+ }): boolean;
44
+ export declare function padTime(value: number | string): string;
45
+ export declare function getParsedTime({ time, format, amPmLabels, }: {
46
+ time: string;
47
+ format: '12h' | '24h';
48
+ amPmLabels?: {
49
+ am: string;
50
+ pm: string;
51
+ };
52
+ }): {
53
+ hours: null;
54
+ minutes: null;
55
+ seconds: null;
56
+ amPm: null;
57
+ } | {
58
+ hours: number;
59
+ minutes: number;
60
+ seconds: number;
61
+ amPm: string;
62
+ } | {
63
+ hours: number;
64
+ minutes: number;
65
+ seconds: number;
66
+ amPm: null;
67
+ };
68
+ export declare function getTimeString({ hours, minutes, seconds, format, withSeconds, amPm, amPmLabels, }: {
69
+ hours: number | null;
70
+ minutes: number | null;
71
+ seconds?: number | null;
72
+ format?: '12h' | '24h';
73
+ withSeconds?: boolean;
74
+ amPm?: string | null;
75
+ amPmLabels?: {
76
+ am: string;
77
+ pm: string;
78
+ };
79
+ }): {
80
+ valid: boolean;
81
+ value: string;
82
+ };
83
+ export declare function timeToSeconds(value: string): number;
84
+ export declare function isSameTime(a?: string, b?: string): boolean;
85
+ export declare function compareTime(a: string, b: string): number;
86
+ export declare function clampTime(value: string, min?: string, max?: string): string;
87
+ export declare function getTimeRange(start: string, end: string, step?: number): string[];
88
+ export declare const getFormattedTime: ({ value, format, }: {
89
+ value: string | Date;
90
+ format?: string;
91
+ }) => string;
@@ -0,0 +1,7 @@
1
+ import { type ComputedRef } from 'vue';
2
+ /**
3
+ * Forwards only props that were actually supplied by the consumer. This is important for
4
+ * adapter components because Vue casts absent Boolean props to `false`, which must not shadow
5
+ * defaults owned by the implementation component.
6
+ */
7
+ export declare function useForwardedProps<Props extends object>(props: Props): ComputedRef<Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine-vue/dates",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Vue date and time picker components equivalent to @mantine/dates",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -40,8 +40,8 @@
40
40
  "vue": "^3.5.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@mantine-vue/core": "3.0.0",
44
- "@mantine-vue/hooks": "3.0.0",
43
+ "@mantine-vue/core": "3.2.0",
44
+ "@mantine-vue/hooks": "3.2.0",
45
45
  "dayjs": ">=1.0.0",
46
46
  "vue": "^3.5.0"
47
47
  }