@true-engineering/true-react-common-ui-kit 3.51.0 → 3.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,12 @@
12
12
 
13
13
  # Release Notes
14
14
 
15
+ ## 3.52.0
16
+
17
+ ### Changes
18
+
19
+ - **DatePicker**: Теперь в качестве локали принимается так же строка "ru" | "en"
20
+
15
21
  ## 3.51.0
16
22
 
17
23
  ### Changes
@@ -32,6 +38,7 @@
32
38
  - **Input**: Добавлено обрезание лейбла многоточием. HTML-структура поменялась с `inputWrapper > input` на `inputWrapper > inputWithLabelWrapper > input`.
33
39
 
34
40
  Это также повлияло на все компоненты, использующие **Input**:
41
+
35
42
  - **DateInput**
36
43
  - **NumberInput**
37
44
  - **PhoneInput**
@@ -3,11 +3,11 @@ import ReactDatePicker from 'react-datepicker';
3
3
  import 'react-datepicker/dist/react-datepicker.css';
4
4
  import { ICommonProps } from '../../types';
5
5
  import { IDateInputProps } from '../DateInput';
6
- import { IDatePickerBaseProps, IRange } from './types';
6
+ import { IDatePickerBaseProps, IDatePickerLocale, IRange } from './types';
7
7
  import { IDatePickerStyles } from './DatePicker.styles';
8
8
  export interface IDatePickerProps extends IDatePickerBaseProps, ICommonProps<IDatePickerStyles> {
9
9
  selectedDate?: Date | null;
10
- locale: Locale;
10
+ locale: IDatePickerLocale;
11
11
  months?: string[];
12
12
  /** @default 'dd.MM.yyyy' */
13
13
  dateFormat?: string;
@@ -1,3 +1,6 @@
1
+ import { type Locale } from 'date-fns';
2
+ import { IDatePickerLocale } from './types';
1
3
  export declare const getDateFormatter: (dateFormat: string) => (date?: Date | null) => string;
2
4
  export declare const getDateValueParser: (dateFormat: string) => (value: string) => Date | null;
3
5
  export declare const areDatesEquals: (date1?: Date | null, date2?: Date | null) => boolean;
6
+ export declare const preparateDatePickerLocale: (locale: IDatePickerLocale) => Locale;
@@ -1,4 +1,6 @@
1
1
  import { ReactDatePickerProps } from 'react-datepicker';
2
- import { IDateInputProps } from '../DateInput';
2
+ import { type Locale } from 'date-fns';
3
+ import { type IDateInputProps } from '../DateInput';
3
4
  export type IRange = [Date | null, Date | null] | null;
5
+ export type IDatePickerLocale = 'ru' | 'en' | Locale;
4
6
  export type IDatePickerBaseProps = Pick<ReactDatePickerProps, 'startDate' | 'endDate' | 'minDate' | 'maxDate' | 'allowSameDay' | 'disabledKeyboardNavigation' | 'monthsShown' | 'popperModifiers' | 'popperPlacement' | 'filterDate' | 'dayClassName' | 'calendarContainer' | 'onCalendarOpen' | 'onCalendarClose' | 'onYearChange' | 'onMonthChange' | 'focusSelectedMonth' | 'shouldCloseOnSelect' | 'showPreviousMonths' | 'todayButton' | 'renderCustomHeader' | 'customInputRef' | 'preventOpenOnFocus' | 'strictParsing' | 'highlightDates' | 'fixedHeight' | 'excludeScrollbar'> & Omit<IDateInputProps, 'date' | 'startDate' | 'endDate' | 'isRange' | 'isActive' | 'iconType' | 'maxLength' | 'onChange' | 'onClick' | 'tweakStyles'>;