@semcore/date-picker 4.57.2-prerelease.0 → 4.58.0-prerelease.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 (149) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/DatePicker.js +27 -36
  3. package/lib/cjs/DatePicker.js.map +1 -1
  4. package/lib/cjs/DateRangeComparator.js +38 -43
  5. package/lib/cjs/DateRangeComparator.js.map +1 -1
  6. package/lib/cjs/DateRangePicker.js +17 -22
  7. package/lib/cjs/DateRangePicker.js.map +1 -1
  8. package/lib/cjs/MonthDateRangeComparator.js +42 -47
  9. package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
  10. package/lib/cjs/MonthPicker.js +16 -21
  11. package/lib/cjs/MonthPicker.js.map +1 -1
  12. package/lib/cjs/MonthRangePicker.js +18 -23
  13. package/lib/cjs/MonthRangePicker.js.map +1 -1
  14. package/lib/cjs/components/ButtonTrigger.js +8 -10
  15. package/lib/cjs/components/ButtonTrigger.js.map +1 -1
  16. package/lib/cjs/components/Calendar.js +109 -125
  17. package/lib/cjs/components/Calendar.js.map +1 -1
  18. package/lib/cjs/components/DateRangeComparatorAbstract.js +121 -104
  19. package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
  20. package/lib/cjs/components/InputTrigger.js +179 -189
  21. package/lib/cjs/components/InputTrigger.js.map +1 -1
  22. package/lib/cjs/components/PickerAbstract.js +58 -57
  23. package/lib/cjs/components/PickerAbstract.js.map +1 -1
  24. package/lib/cjs/components/RangePickerAbstract.js +97 -76
  25. package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
  26. package/lib/cjs/components/index.js +41 -46
  27. package/lib/cjs/components/index.js.map +1 -1
  28. package/lib/cjs/index.d.js.map +1 -1
  29. package/lib/cjs/index.js +2 -2
  30. package/lib/cjs/index.js.map +1 -1
  31. package/lib/cjs/style/calendar.shadow.css +40 -42
  32. package/lib/cjs/style/date-picker.shadow.css +15 -16
  33. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
  34. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  35. package/lib/cjs/translations/de.json +6 -2
  36. package/lib/cjs/translations/es.json +6 -2
  37. package/lib/cjs/translations/fr.json +6 -2
  38. package/lib/cjs/translations/it.json +6 -2
  39. package/lib/cjs/translations/ja.json +6 -2
  40. package/lib/cjs/translations/ko.json +6 -2
  41. package/lib/cjs/translations/nl.json +6 -2
  42. package/lib/cjs/translations/pl.json +6 -2
  43. package/lib/cjs/translations/pt.json +6 -2
  44. package/lib/cjs/translations/sv.json +6 -2
  45. package/lib/cjs/translations/tr.json +6 -2
  46. package/lib/cjs/translations/vi.json +6 -2
  47. package/lib/cjs/translations/zh.json +6 -2
  48. package/lib/cjs/utils/cronTabScheduler.js +8 -5
  49. package/lib/cjs/utils/cronTabScheduler.js.map +1 -1
  50. package/lib/cjs/utils/datesIntersects.js +3 -4
  51. package/lib/cjs/utils/datesIntersects.js.map +1 -1
  52. package/lib/cjs/utils/formatDate.js +3 -5
  53. package/lib/cjs/utils/formatDate.js.map +1 -1
  54. package/lib/cjs/utils/includesDate.js +2 -3
  55. package/lib/cjs/utils/includesDate.js.map +1 -1
  56. package/lib/cjs/utils/isBetweenPlugin.js +21 -0
  57. package/lib/cjs/utils/isBetweenPlugin.js.map +1 -0
  58. package/lib/cjs/utils/shortDateRangeFormat.js +2 -2
  59. package/lib/cjs/utils/shortDateRangeFormat.js.map +1 -1
  60. package/lib/es6/DatePicker.js +22 -28
  61. package/lib/es6/DatePicker.js.map +1 -1
  62. package/lib/es6/DateRangeComparator.js +23 -27
  63. package/lib/es6/DateRangeComparator.js.map +1 -1
  64. package/lib/es6/DateRangePicker.js +13 -17
  65. package/lib/es6/DateRangePicker.js.map +1 -1
  66. package/lib/es6/MonthDateRangeComparator.js +28 -32
  67. package/lib/es6/MonthDateRangeComparator.js.map +1 -1
  68. package/lib/es6/MonthPicker.js +13 -17
  69. package/lib/es6/MonthPicker.js.map +1 -1
  70. package/lib/es6/MonthRangePicker.js +14 -18
  71. package/lib/es6/MonthRangePicker.js.map +1 -1
  72. package/lib/es6/components/ButtonTrigger.js +5 -5
  73. package/lib/es6/components/ButtonTrigger.js.map +1 -1
  74. package/lib/es6/components/Calendar.js +100 -112
  75. package/lib/es6/components/Calendar.js.map +1 -1
  76. package/lib/es6/components/DateRangeComparatorAbstract.js +120 -101
  77. package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
  78. package/lib/es6/components/InputTrigger.js +173 -180
  79. package/lib/es6/components/InputTrigger.js.map +1 -1
  80. package/lib/es6/components/PickerAbstract.js +58 -55
  81. package/lib/es6/components/PickerAbstract.js.map +1 -1
  82. package/lib/es6/components/RangePickerAbstract.js +94 -71
  83. package/lib/es6/components/RangePickerAbstract.js.map +1 -1
  84. package/lib/es6/components/index.js +35 -38
  85. package/lib/es6/components/index.js.map +1 -1
  86. package/lib/es6/index.d.js.map +1 -1
  87. package/lib/es6/index.js.map +1 -1
  88. package/lib/es6/style/calendar.shadow.css +40 -42
  89. package/lib/es6/style/date-picker.shadow.css +15 -16
  90. package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
  91. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  92. package/lib/es6/translations/de.json +6 -2
  93. package/lib/es6/translations/es.json +6 -2
  94. package/lib/es6/translations/fr.json +6 -2
  95. package/lib/es6/translations/it.json +6 -2
  96. package/lib/es6/translations/ja.json +6 -2
  97. package/lib/es6/translations/ko.json +6 -2
  98. package/lib/es6/translations/nl.json +6 -2
  99. package/lib/es6/translations/pl.json +6 -2
  100. package/lib/es6/translations/pt.json +6 -2
  101. package/lib/es6/translations/sv.json +6 -2
  102. package/lib/es6/translations/tr.json +6 -2
  103. package/lib/es6/translations/vi.json +6 -2
  104. package/lib/es6/translations/zh.json +6 -2
  105. package/lib/es6/utils/cronTabScheduler.js +7 -4
  106. package/lib/es6/utils/cronTabScheduler.js.map +1 -1
  107. package/lib/es6/utils/datesIntersects.js +1 -1
  108. package/lib/es6/utils/datesIntersects.js.map +1 -1
  109. package/lib/es6/utils/formatDate.js.map +1 -1
  110. package/lib/es6/utils/includesDate.js.map +1 -1
  111. package/lib/es6/utils/isBetweenPlugin.js +16 -0
  112. package/lib/es6/utils/isBetweenPlugin.js.map +1 -0
  113. package/lib/es6/utils/shortDateRangeFormat.js +1 -1
  114. package/lib/es6/utils/shortDateRangeFormat.js.map +1 -1
  115. package/lib/esm/DatePicker.mjs +27 -33
  116. package/lib/esm/DateRangeComparator.mjs +26 -30
  117. package/lib/esm/DateRangePicker.mjs +17 -21
  118. package/lib/esm/MonthDateRangeComparator.mjs +31 -35
  119. package/lib/esm/MonthPicker.mjs +16 -20
  120. package/lib/esm/MonthRangePicker.mjs +18 -22
  121. package/lib/esm/components/ButtonTrigger.mjs +5 -5
  122. package/lib/esm/components/Calendar.mjs +103 -115
  123. package/lib/esm/components/DateRangeComparatorAbstract.mjs +105 -89
  124. package/lib/esm/components/InputTrigger.mjs +143 -181
  125. package/lib/esm/components/PickerAbstract.mjs +61 -62
  126. package/lib/esm/components/RangePickerAbstract.mjs +94 -73
  127. package/lib/esm/components/index.mjs +29 -33
  128. package/lib/esm/style/calendar.shadow.css +40 -42
  129. package/lib/esm/style/date-picker.shadow.css +15 -16
  130. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
  131. package/lib/esm/translations/de.json.mjs +18 -6
  132. package/lib/esm/translations/es.json.mjs +18 -6
  133. package/lib/esm/translations/fr.json.mjs +18 -6
  134. package/lib/esm/translations/it.json.mjs +18 -6
  135. package/lib/esm/translations/ja.json.mjs +18 -6
  136. package/lib/esm/translations/ko.json.mjs +18 -6
  137. package/lib/esm/translations/nl.json.mjs +18 -6
  138. package/lib/esm/translations/pl.json.mjs +18 -6
  139. package/lib/esm/translations/pt.json.mjs +18 -6
  140. package/lib/esm/translations/sv.json.mjs +18 -6
  141. package/lib/esm/translations/tr.json.mjs +18 -6
  142. package/lib/esm/translations/vi.json.mjs +18 -6
  143. package/lib/esm/translations/zh.json.mjs +18 -6
  144. package/lib/esm/utils/cronTabScheduler.mjs +4 -4
  145. package/lib/esm/utils/datesIntersects.mjs +1 -1
  146. package/lib/esm/utils/isBetweenPlugin.mjs +13 -0
  147. package/lib/esm/utils/shortDateRangeFormat.mjs +1 -2
  148. package/lib/types/index.d.ts +140 -171
  149. package/package.json +16 -16
@@ -0,0 +1,13 @@
1
+ const isBetween = (function(_o, c, d) {
2
+ c.prototype.isBetween = function(a, b, u, i) {
3
+ var dA = d(a);
4
+ var dB = d(b);
5
+ i = i || "()";
6
+ var dAi = i[0] === "(";
7
+ var dBi = i[1] === ")";
8
+ return (dAi ? this.isAfter(dA, u) : !this.isBefore(dA, u)) && (dBi ? this.isBefore(dB, u) : !this.isAfter(dB, u)) || (dAi ? this.isBefore(dA, u) : !this.isAfter(dA, u)) && (dBi ? this.isAfter(dB, u) : !this.isBefore(dB, u));
9
+ };
10
+ });
11
+ export {
12
+ isBetween as default
13
+ };
@@ -44,8 +44,7 @@ function shortDateRangeFormat(dates, _ref) {
44
44
  }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getFullYear());
45
45
  }
46
46
  if (isSimilarYear) {
47
- options.year;
48
- var newOptions = _objectWithoutProperties(options, _excluded2);
47
+ var _year = options.year, newOptions = _objectWithoutProperties(options, _excluded2);
49
48
  if (getDayJSLocale(locale) === "en") {
50
49
  return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), "-").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), ", ").concat(normalizeDates[0].getFullYear());
51
50
  }
@@ -1,17 +1,21 @@
1
- import React, { ChangeEvent, ComponentProps } from 'react';
2
- import dayjs from 'dayjs';
3
- import { Flex, Box, BoxProps } from '@semcore/flex-box';
4
- import { UnknownProperties, Intergalactic, PropGetterFn } from '@semcore/core';
5
- import Button, { ButtonProps } from '@semcore/button';
6
- import Divider from '@semcore/divider';
7
- import { DropdownProps, DropdownTriggerProps } from '@semcore/dropdown';
8
- import { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
9
- import BaseTrigger, { BaseTriggerProps } from '@semcore/base-trigger';
10
- import Input, { InputProps, InputValueProps } from '@semcore/input';
11
- import { InputMaskValueProps } from '@semcore/input-mask';
12
- import Checkbox from '@semcore/checkbox';
13
- import { TooltipProps } from '@semcore/tooltip';
14
- import Popper from '@semcore/popper';
1
+ import type { Flex, Box, BoxProps } from '@semcore/base-components';
2
+ import type Popper from '@semcore/base-components';
3
+ import type { BaseTriggerProps } from '@semcore/base-trigger';
4
+ import type BaseTrigger from '@semcore/base-trigger';
5
+ import type { ButtonProps } from '@semcore/button';
6
+ import type Button from '@semcore/button';
7
+ import type Checkbox from '@semcore/checkbox';
8
+ import type { UnknownProperties, Intergalactic, PropGetterFn } from '@semcore/core';
9
+ import type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';
10
+ import type Divider from '@semcore/divider';
11
+ import type { DropdownProps, DropdownTriggerProps } from '@semcore/dropdown';
12
+ import type { InputProps, InputValueProps } from '@semcore/input';
13
+ import type Input from '@semcore/input';
14
+ import type { InputMaskValueProps } from '@semcore/input-mask';
15
+ import type { TooltipProps } from '@semcore/tooltip';
16
+ import type dayjs from 'dayjs';
17
+ import type { ChangeEvent } from 'react';
18
+ import type React from 'react';
15
19
 
16
20
  export type DateConstructorParams = string | number | Date;
17
21
 
@@ -21,8 +25,6 @@ export type DateConstructorParams = string | number | Date;
21
25
  * */
22
26
  export type DisabledDates = (DateConstructorParams | (DateConstructorParams | false)[] | string)[];
23
27
 
24
- /** @deprecated */
25
- export interface ICalendarProps extends CalendarProps, UnknownProperties {}
26
28
  export type CalendarProps = BoxProps & {
27
29
  /**
28
30
  * Locale for displaying the days of a week and months, to be transferred to `Intl`
@@ -33,13 +35,9 @@ export type CalendarProps = BoxProps & {
33
35
  * Array of dates blocked for selection
34
36
  */
35
37
  disabled?: DisabledDates;
36
- /**
37
- * @ignore
38
- * */
38
+ /** Internal */
39
39
  highlighted?: DateConstructorParams[];
40
- /**
41
- * @ignore
42
- * */
40
+ /** Internal */
43
41
  onHighlightedChange?: (date: Date[]) => void;
44
42
  /**
45
43
  * The selected date, accepts everything which is accepted by `new Date()`
@@ -54,40 +52,43 @@ export type CalendarProps = BoxProps & {
54
52
  * @default new Date()
55
53
  * */
56
54
  displayedPeriod?: Date;
57
-
55
+ /** Controls whether to render dates from previous/next months */
58
56
  renderOutdated?: boolean;
59
57
  };
60
58
 
61
- /** @deprecated */
62
- export interface ICalendarDaysContext extends CalendarDaysContext, UnknownProperties {}
63
59
  export type CalendarDaysContext = {
64
60
  days: CalendarUnitProps[];
65
61
  };
66
62
 
67
- /** @deprecated */
68
- export interface ICalendarMonthsContext extends CalendarMonthsContext, UnknownProperties {}
69
63
  export type CalendarMonthsContext = {
70
64
  months: CalendarUnitProps[];
71
65
  };
72
66
 
73
- /** @deprecated */
74
- export interface ICalendarUnitProps extends CalendarUnitProps, UnknownProperties {}
75
67
  export type CalendarUnitProps = BoxProps & {
68
+ /** Indicates if the calendar unit is part of a selected date range */
76
69
  selected?: boolean;
70
+ /** Marks units from previous/next months that appear in the current month view */
77
71
  outdated?: boolean;
72
+ /** Prevents interaction with the unit */
78
73
  disabled?: boolean;
74
+ /** Highlights the current date */
79
75
  today?: boolean;
76
+ /** Marks the beginning of a selected date range */
80
77
  startSelected?: boolean;
78
+ /** Marks the end of a selected date range */
81
79
  endSelected?: boolean;
80
+ /** Shows preview highlighting during range selection */
82
81
  highlighted?: boolean;
82
+ /** Marks the start of a highlighted range */
83
83
  startHighlighted?: boolean;
84
+ /** Marks the end of a highlighted range */
84
85
  endHighlighted?: boolean;
86
+ /** The actual Date object this unit represents */
85
87
  date?: Date;
88
+ /** Content to display within the unit (typically the day number) */
86
89
  children?: React.ReactNode;
87
90
  };
88
91
 
89
- /** @deprecated */
90
- export interface ICalendarContext extends CalendarContext, UnknownProperties {}
91
92
  export type CalendarContext = {
92
93
  getUnitProps: PropGetterFn;
93
94
  };
@@ -101,137 +102,129 @@ declare const Calendar: Intergalactic.Component<
101
102
  Unit: Intergalactic.Component<'div', CalendarUnitProps>;
102
103
  };
103
104
 
104
- /** @deprecated */
105
- export interface IDatePickerProps extends DatePickerProps, UnknownProperties {}
106
105
  export type DatePickerProps = Intergalactic.InternalTypings.EfficientOmit<
107
106
  DropdownProps,
108
107
  'disabled'
109
108
  > &
110
- WithI18nEnhanceProps & {
111
- /**
109
+ WithI18nEnhanceProps & {
110
+ /**
112
111
  * The selected date, accepts everything which is accepted by `new Date()`
113
112
  * */
114
- value?: DateConstructorParams;
115
- /**
113
+ value?: DateConstructorParams;
114
+ /**
116
115
  * To be activated upon selecting the date
117
116
  * */
118
- onChange?: (date: Date) => void;
119
- /**
117
+ onChange?: (date: Date) => void;
118
+ /**
120
119
  * Array of dates blocked for selection
121
120
  * */
122
- disabled?: (DateConstructorParams | (DateConstructorParams | false)[] | string)[];
123
- /**
121
+ disabled?: (DateConstructorParams | (DateConstructorParams | false)[] | string)[];
122
+ /**
124
123
  * Error message when user attempts to input a disabled date
125
124
  * */
126
- disabledErrorText?: ((attemptedDate: Date) => string) | string | null;
127
- /**
125
+ disabledErrorText?: ((attemptedDate: Date) => string) | string | null;
126
+ /**
128
127
  * Date for showing the necessary month
129
128
  * @default new Date()
130
129
  * */
131
- displayedPeriod?: DateConstructorParams;
132
- /**
130
+ displayedPeriod?: DateConstructorParams;
131
+ /**
133
132
  * To be activated upon changing the current shown month
134
133
  * */
135
- onDisplayedPeriodChange?: (date: Date) => void;
136
- /**
134
+ onDisplayedPeriodChange?: (date: Date) => void;
135
+ /**
137
136
  * Component size
138
137
  * @default m
139
138
  */
140
- size?: 'm' | 'l';
141
- /**
139
+ size?: 'm' | 'l';
140
+ /**
142
141
  * The selected date, accepts everything which is accepted by `new Date()`
143
142
  * */
144
- highlighted?: DateConstructorParams[];
145
- /**
143
+ highlighted?: DateConstructorParams[];
144
+ /**
146
145
  * Default value selected date, accepts everything which is accepted by `new Date()`
147
146
  * */
148
- defaultValue?: DateConstructorParams;
149
- /**
147
+ defaultValue?: DateConstructorParams;
148
+ /**
150
149
  * Default value date for showing the necessary month
151
150
  * */
152
- defaultDisplayedPeriod?: DateConstructorParams;
153
- /**
151
+ defaultDisplayedPeriod?: DateConstructorParams;
152
+ /**
154
153
  * Default value selected date, accepts everything which is accepted by `new Date()`
155
154
  * */
156
- defaultHighlighted?: DateConstructorParams[];
157
- };
155
+ defaultHighlighted?: DateConstructorParams[];
156
+ };
158
157
 
159
- /** @deprecated */
160
- export interface IDateRangePickerProps extends DateRangePickerProps, UnknownProperties {}
161
158
  export type DateRangePickerProps = Intergalactic.InternalTypings.EfficientOmit<
162
159
  DropdownProps,
163
160
  'disabled'
164
161
  > &
165
- WithI18nEnhanceProps & {
166
- /**
162
+ WithI18nEnhanceProps & {
163
+ /**
167
164
  * The selected date, accepts everything which is accepted by `new Date()`
168
165
  * */
169
- value?: DateConstructorParams[];
170
- /**
166
+ value?: DateConstructorParams[];
167
+ /**
171
168
  * Default value selected date, accepts everything which is accepted by `new Date()`
172
169
  * */
173
- defaultValue?: DateConstructorParams[];
174
- /**
170
+ defaultValue?: DateConstructorParams[];
171
+ /**
175
172
  * Default value date for showing the necessary month
176
173
  * */
177
- defaultDisplayedPeriod?: DateConstructorParams;
178
- /**
174
+ defaultDisplayedPeriod?: DateConstructorParams;
175
+ /**
179
176
  * Default value selected date, accepts everything which is accepted by `new Date()`
180
177
  * */
181
- defaultHighlighted?: DateConstructorParams[];
182
- /**
178
+ defaultHighlighted?: DateConstructorParams[];
179
+ /**
183
180
  * To be activated upon selecting the date
184
181
  * */
185
- onChange?: (date: Date[]) => void;
186
- /**
182
+ onChange?: (date: Date[]) => void;
183
+ /**
187
184
  * Array of dates blocked for selection
188
185
  * */
189
- disabled?: (DateConstructorParams | (DateConstructorParams | false)[] | string)[];
190
- /**
186
+ disabled?: (DateConstructorParams | (DateConstructorParams | false)[] | string)[];
187
+ /**
191
188
  * Error message when user attempts to input a disabled date
192
189
  * */
193
- disabledErrorText?: ((attemptedDate: Date) => string) | string | null;
194
- /**
190
+ disabledErrorText?: ((attemptedDate: Date) => string) | string | null;
191
+ /**
195
192
  * Date for showing the necessary month
196
193
  * @default new Date()
197
194
  * */
198
- displayedPeriod?: DateConstructorParams;
199
- /**
195
+ displayedPeriod?: DateConstructorParams;
196
+ /**
200
197
  * To be activated upon changing the current shown month
201
198
  * */
202
- onDisplayedPeriodChange?: (date: Date) => void;
203
- /**
199
+ onDisplayedPeriodChange?: (date: Date) => void;
200
+ /**
204
201
  * The selected date, accepts everything which is accepted by `new Date()`
205
202
  * */
206
- highlighted?: DateConstructorParams[];
207
- /**
203
+ highlighted?: DateConstructorParams[];
204
+ /**
208
205
  * Remove the 'Reset' button
209
206
  * */
210
- unclearable?: boolean;
211
- /**
207
+ unclearable?: boolean;
208
+ /**
212
209
  * To be activated upon selecting the date
213
210
  * */
214
- onHighlightedChange?: (date: Date[]) => void;
215
- /**
211
+ onHighlightedChange?: (date: Date[]) => void;
212
+ /**
216
213
  * Intermediate value between `highlighted` and `value` that user see before explicitly applying it.
217
214
  */
218
- preselectedValue?: DateConstructorParams[];
219
- /**
215
+ preselectedValue?: DateConstructorParams[];
216
+ /**
220
217
  * Normally called when user preselects a date range and when user applies this range.
221
218
  */
222
- onPreselectedValueChange?: (date: Date[]) => void;
223
- /**
219
+ onPreselectedValueChange?: (date: Date[]) => void;
220
+ /**
224
221
  * Array of periods
225
222
  * [{value: [new Date(), new Date()], children: "Today"}]
226
223
  * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month
227
224
  * */
228
- periods?: (ButtonProps & { value: Date[] })[];
229
- };
225
+ periods?: (ButtonProps & { value: Date[] })[];
226
+ };
230
227
 
231
- /** @deprecated */
232
- export interface IDateRangePickerPeriodProps
233
- extends DateRangePickerPeriodProps,
234
- UnknownProperties {}
235
228
  export type DateRangePickerPeriodProps = BoxProps & {
236
229
  /**
237
230
  * Current selected period
@@ -257,8 +250,6 @@ export type DateRangePickerPeriodProps = BoxProps & {
257
250
  periods?: (ButtonProps & { value: Date[] })[];
258
251
  };
259
252
 
260
- /** @deprecated */
261
- export interface IDatePickerContext extends DatePickerContext, UnknownProperties {}
262
253
  export type DatePickerContext = {
263
254
  getTriggerProps: PropGetterFn;
264
255
  getPopperProps: PropGetterFn;
@@ -270,10 +261,6 @@ export type DatePickerContext = {
270
261
  getTodayProps: PropGetterFn;
271
262
  };
272
263
 
273
- /** @deprecated */
274
- export interface IAbstractDatePickerHandlers
275
- extends AbstractDatePickerHandlers,
276
- UnknownProperties {}
277
264
  export type AbstractDatePickerHandlers = {
278
265
  displayedPeriod: (value: DateConstructorParams) => void;
279
266
  visible: (index: boolean) => void;
@@ -281,14 +268,10 @@ export type AbstractDatePickerHandlers = {
281
268
  value: (index: DateConstructorParams) => void;
282
269
  };
283
270
 
284
- /** @deprecated */
285
- export interface IDatePickerHandlers extends DatePickerHandlers, UnknownProperties {}
286
271
  export type DatePickerHandlers = {
287
272
  visible: (index: boolean) => void;
288
273
  };
289
274
 
290
- /** @deprecated */
291
- export interface IInputTriggerProps extends InputTriggerProps, UnknownProperties {}
292
275
  export type BaseInputTriggerProps = InputProps &
293
276
  TooltipProps & {
294
277
  /**
@@ -311,24 +294,16 @@ export type RangeInputTriggerProps = BaseInputTriggerProps & {
311
294
  onChange?: (date: Date[], event: ChangeEvent) => void;
312
295
  };
313
296
 
314
- /** @deprecated */
315
- export interface ISingleDateInputProps extends SingleDateInputProps, UnknownProperties {}
316
297
  export type SingleDateInputProps = InputTriggerProps & {};
317
298
 
318
- /** @deprecated */
319
- export interface IDateRangeProps extends DateRangeProps, UnknownProperties {}
320
299
  export type DateRangeProps = RangeInputTriggerProps & {};
321
300
 
322
- /** @deprecated */
323
- export interface IDatePickerMaskedInputProps
324
- extends DatePickerMaskedInputProps,
325
- UnknownProperties {}
326
301
  export type DatePickerMaskedInputProps = {
327
302
  date?: Date;
328
303
  onDateChange?: (date: Date, event: ChangeEvent) => void;
329
304
  onDisplayedPeriodChange?: (date: Date) => void;
330
305
  locale?: string;
331
- parts?: { year: Boolean; month: Boolean; day: Boolean };
306
+ parts?: { year: boolean; month: boolean; day: boolean };
332
307
  disabledDates?: (Date | (Date | false)[] | string)[];
333
308
  };
334
309
 
@@ -386,8 +361,6 @@ declare const DatePicker: Intergalactic.Component<
386
361
  subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;
387
362
  };
388
363
 
389
- /** @deprecated */
390
- export interface IDateRangePickerContext extends DateRangePickerContext, UnknownProperties {}
391
364
  export type DateRangePickerContext = {
392
365
  getTriggerProps: PropGetterFn;
393
366
  getPopperProps: PropGetterFn;
@@ -424,8 +397,6 @@ declare const DateRangePicker: Intergalactic.Component<
424
397
  subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;
425
398
  };
426
399
 
427
- /** @deprecated */
428
- export interface IMonthPickerContext extends MonthPickerContext, UnknownProperties {}
429
400
  export type MonthPickerContext = {
430
401
  getTriggerProps: PropGetterFn;
431
402
  getPopperProps: PropGetterFn;
@@ -458,8 +429,6 @@ declare const MonthPicker: Intergalactic.Component<
458
429
  subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;
459
430
  };
460
431
 
461
- /** @deprecated */
462
- export interface IMonthRangePickerContext extends MonthRangePickerContext, UnknownProperties {}
463
432
  export type MonthRangePickerContext = {
464
433
  getTriggerProps: PropGetterFn;
465
434
  getPopperProps: PropGetterFn;
@@ -506,106 +475,106 @@ export type DateRangeComparatorProps = Intergalactic.InternalTypings.EfficientOm
506
475
  DropdownProps,
507
476
  'disabled'
508
477
  > &
509
- WithI18nEnhanceProps & {
510
- /**
478
+ WithI18nEnhanceProps & {
479
+ /**
511
480
  * Selected date ranges
512
481
  * */
513
- value?: DateRangeComparatorValue;
514
- /**
482
+ value?: DateRangeComparatorValue;
483
+ /**
515
484
  * Default value for selected date ranges
516
485
  * */
517
- defaultValue?: DateRangeComparatorValue;
518
- /**
486
+ defaultValue?: DateRangeComparatorValue;
487
+ /**
519
488
  * Default value date for showing the necessary month
520
489
  * */
521
- defaultDisplayedPeriod?: DateConstructorParams;
522
- /**
490
+ defaultDisplayedPeriod?: DateConstructorParams;
491
+ /**
523
492
  * Default value selected date, accepts everything which is accepted by `new Date()`
524
493
  * */
525
- defaultHighlighted?: DateConstructorParams[];
526
- /**
494
+ defaultHighlighted?: DateConstructorParams[];
495
+ /**
527
496
  * Called with selected date when user clicks `Apply` button.
528
497
  * */
529
- onChange?: (ranges: {
530
- value?: DateConstructorParams[];
531
- compare?: DateConstructorParams[];
532
- }) => void;
533
- /**
498
+ onChange?: (ranges: {
499
+ value?: DateConstructorParams[];
500
+ compare?: DateConstructorParams[];
501
+ }) => void;
502
+ /**
534
503
  * Array of dates blocked for selection
535
504
  * */
536
- disabled?: (DateConstructorParams | (DateConstructorParams | false)[] | string)[];
537
- /**
505
+ disabled?: (DateConstructorParams | (DateConstructorParams | false)[] | string)[];
506
+ /**
538
507
  * Error message when user attempts to input a disabled date
539
508
  * */
540
- disabledErrorText?: ((attemptedDate: Date) => string) | string | null;
541
- /**
509
+ disabledErrorText?: ((attemptedDate: Date) => string) | string | null;
510
+ /**
542
511
  * Date for showing the necessary month
543
512
  * @default new Date()
544
513
  * */
545
- displayedPeriod?: DateConstructorParams;
546
- /**
514
+ displayedPeriod?: DateConstructorParams;
515
+ /**
547
516
  * To be activated upon changing the current shown month
548
517
  * */
549
- onDisplayedPeriodChange?: (date: Date) => void;
550
- /**
518
+ onDisplayedPeriodChange?: (date: Date) => void;
519
+ /**
551
520
  * The selected date, accepts everything which is accepted by `new Date()`
552
521
  * */
553
- highlighted?: DateConstructorParams[];
554
- /**
522
+ highlighted?: DateConstructorParams[];
523
+ /**
555
524
  * To be activated upon selecting the date
556
525
  * */
557
- onHighlightedChange?: (date: Date[]) => void;
558
- /**
526
+ onHighlightedChange?: (date: Date[]) => void;
527
+ /**
559
528
  * The selected date, accepts everything which is accepted by `new Date()`
560
529
  * */
561
- compareHighlighted?: DateConstructorParams[];
562
- /**
530
+ compareHighlighted?: DateConstructorParams[];
531
+ /**
563
532
  * To be activated upon selecting the date
564
533
  * */
565
- onCompareHighlightedChange?: (date: Date[]) => void;
566
- /**
534
+ onCompareHighlightedChange?: (date: Date[]) => void;
535
+ /**
567
536
  * Intermediate value between `highlighted` and `value` that user see before explicitly applying it.
568
537
  */
569
- preselectedValue?: DateConstructorParams[];
570
- /**
538
+ preselectedValue?: DateConstructorParams[];
539
+ /**
571
540
  * Normally called when user preselects a date range and when user applies this range.
572
541
  */
573
- onPreselectedValueChange?: (date: Date[]) => void;
574
- /**
542
+ onPreselectedValueChange?: (date: Date[]) => void;
543
+ /**
575
544
  * Intermediate value between `compareHighlighted` and `compare` that user see before explicitly applying it.
576
545
  */
577
- preselectedCompare?: DateConstructorParams[];
578
- /**
546
+ preselectedCompare?: DateConstructorParams[];
547
+ /**
579
548
  * Normally called when user preselects a compare range and when user applies ranges.
580
549
  */
581
- onPreselectedCompareChange?: (date: Date[]) => void;
582
- /**
550
+ onPreselectedCompareChange?: (date: Date[]) => void;
551
+ /**
583
552
  * Controls that compare range input is enabled.
584
553
  */
585
- compareToggle?: boolean;
586
- /**
554
+ compareToggle?: boolean;
555
+ /**
587
556
  * Toggles when compare range input enables or disables.
588
557
  */
589
- onCompareToggleChange?: (compareToggle: boolean) => void;
590
- /**
558
+ onCompareToggleChange?: (compareToggle: boolean) => void;
559
+ /**
591
560
  * Controls which date range is focused.
592
561
  */
593
- focusedRange?: DateRangeComparatorFocusRange;
594
- /**
562
+ focusedRange?: DateRangeComparatorFocusRange;
563
+ /**
595
564
  * Called when user focuses or is focused on some of the date ranges.
596
565
  */
597
- onFocusedRangeChange?: (focusedRange: DateRangeComparatorFocusRange) => void;
598
- /**
566
+ onFocusedRangeChange?: (focusedRange: DateRangeComparatorFocusRange) => void;
567
+ /**
599
568
  * Remove the 'Reset' button
600
569
  * */
601
- unclearable?: boolean;
602
- /**
570
+ unclearable?: boolean;
571
+ /**
603
572
  * Array of periods
604
573
  * [{value: [new Date(), new Date()], children: "Today"}]
605
574
  * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month
606
575
  * */
607
- periods?: (ButtonProps & { value: Date[] })[];
608
- };
576
+ periods?: (ButtonProps & { value: Date[] })[];
577
+ };
609
578
 
610
579
  export type DateRangeComparatorContext = {
611
580
  getTriggerProps: PropGetterFn;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/date-picker",
3
3
  "description": "Semrush DatePicker Component",
4
- "version": "4.57.2-prerelease.0",
4
+ "version": "4.58.0-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,24 +14,24 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/utils": "4.48.5-prerelease.0",
18
- "@semcore/base-trigger": "4.53.2-prerelease.0",
19
- "@semcore/button": "5.43.3-prerelease.0",
20
- "@semcore/divider": "4.40.4-prerelease.0",
21
- "@semcore/dropdown": "4.43.4-prerelease.0",
22
- "@semcore/flex-box": "5.41.4-prerelease.0",
23
- "@semcore/icon": "4.62.1-prerelease.0",
24
- "@semcore/input": "4.42.4-prerelease.0",
25
- "@semcore/input-mask": "5.43.4-prerelease.0",
26
- "@semcore/neighbor-location": "4.40.4-prerelease.0",
27
- "@semcore/typography": "5.53.2-prerelease.0",
28
- "@semcore/checkbox": "7.44.4-prerelease.0",
29
- "@semcore/popper": "5.46.4-prerelease.0",
30
- "@semcore/tooltip": "6.49.4-prerelease.0",
17
+ "@semcore/utils": "4.49.0-prerelease.0",
18
+ "@semcore/base-trigger": "4.54.0-prerelease.0",
19
+ "@semcore/button": "5.44.0-prerelease.0",
20
+ "@semcore/divider": "4.41.0-prerelease.0",
21
+ "@semcore/dropdown": "4.44.0-prerelease.0",
22
+ "@semcore/flex-box": "5.42.0-prerelease.0",
23
+ "@semcore/icon": "4.63.0-prerelease.0",
24
+ "@semcore/input": "4.43.0-prerelease.0",
25
+ "@semcore/input-mask": "5.44.0-prerelease.0",
26
+ "@semcore/neighbor-location": "4.41.0-prerelease.0",
27
+ "@semcore/typography": "5.54.0-prerelease.0",
28
+ "@semcore/checkbox": "7.45.0-prerelease.0",
29
+ "@semcore/popper": "5.47.0-prerelease.0",
30
+ "@semcore/tooltip": "6.50.0-prerelease.0",
31
31
  "dayjs": "1.8.36"
32
32
  },
33
33
  "peerDependencies": {
34
- "@semcore/core": "^2.39.4-prerelease.0",
34
+ "@semcore/core": "^2.40.0-prerelease.0",
35
35
  "react": "16.8 - 18",
36
36
  "react-dom": "16.8 - 18"
37
37
  },