@alfalab/core-components-date-range-input 2.4.1 → 3.0.1
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/Component-50136800.d.ts +6 -0
- package/Component-63dec22f.d.ts +167 -0
- package/Component-72dda473.d.ts +53 -0
- package/Component-8b5756fe.d.ts +388 -0
- package/Component.desktop-2e2b2125.d.ts +6 -0
- package/Component.desktop-8b5756fe.d.ts +197 -0
- package/Component.desktop.d.ts +1 -1
- package/Component.desktop.js +4 -3
- package/Component.mobile-755fbaa3.d.ts +6 -0
- package/Component.mobile-ebda875c.d.ts +6 -0
- package/Component.mobile.d.ts +1 -1
- package/Component.mobile.js +4 -3
- package/Component.responsive-2e2b2125.d.ts +66 -0
- package/Component.responsive.d.ts +1 -1
- package/Component.responsive.js +5 -2
- package/components/date-range-input/Component.d.ts +7 -2
- package/components/date-range-input/Component.js +10 -11
- package/components/date-range-input/index.css +7 -7
- package/components/date-range-input/index.js +1 -2
- package/cssm/Component-50136800.d.ts +6 -0
- package/cssm/Component-63dec22f.d.ts +167 -0
- package/cssm/Component-72dda473.d.ts +53 -0
- package/cssm/Component-8b5756fe.d.ts +388 -0
- package/cssm/Component.desktop-2e2b2125.d.ts +6 -0
- package/cssm/Component.desktop-8b5756fe.d.ts +197 -0
- package/cssm/Component.desktop.d.ts +1 -1
- package/cssm/Component.desktop.js +4 -3
- package/cssm/Component.mobile-755fbaa3.d.ts +6 -0
- package/cssm/Component.mobile-ebda875c.d.ts +6 -0
- package/cssm/Component.mobile.d.ts +1 -1
- package/cssm/Component.mobile.js +4 -3
- package/cssm/Component.responsive-2e2b2125.d.ts +66 -0
- package/cssm/Component.responsive.d.ts +1 -1
- package/cssm/Component.responsive.js +5 -2
- package/cssm/components/date-range-input/Component.d.ts +7 -2
- package/cssm/components/date-range-input/Component.js +9 -10
- package/cssm/components/date-range-input/index.js +1 -2
- package/cssm/desktop-63dec22f.d.ts +2 -0
- package/cssm/desktop.js +3 -2
- package/cssm/index-50136800.d.ts +11 -0
- package/cssm/index-72dda473.d.ts +12 -0
- package/cssm/index-9211a437.d.ts +2 -0
- package/cssm/index-ebda875c.d.ts +35 -0
- package/cssm/index-f034f741.d.ts +80 -0
- package/cssm/index.d.ts +3 -2
- package/cssm/index.js +5 -2
- package/cssm/mobile-c219f8ca.d.ts +1 -0
- package/cssm/mobile.js +3 -2
- package/cssm/types-83e2bd9e.d.ts +113 -0
- package/cssm/typings-5684a67d.d.ts +23 -0
- package/cssm/typings-9211a437.d.ts +95 -0
- package/cssm/useCalendar-5684a67d.d.ts +97 -0
- package/cssm/utils-5684a67d.d.ts +88 -0
- package/desktop-63dec22f.d.ts +2 -0
- package/desktop.js +3 -2
- package/esm/Component-50136800.d.ts +6 -0
- package/esm/Component-63dec22f.d.ts +167 -0
- package/esm/Component-72dda473.d.ts +53 -0
- package/esm/Component-8b5756fe.d.ts +388 -0
- package/esm/Component.desktop-2e2b2125.d.ts +6 -0
- package/esm/Component.desktop-8b5756fe.d.ts +197 -0
- package/esm/Component.desktop.d.ts +1 -1
- package/esm/Component.desktop.js +4 -3
- package/esm/Component.mobile-755fbaa3.d.ts +6 -0
- package/esm/Component.mobile-ebda875c.d.ts +6 -0
- package/esm/Component.mobile.d.ts +1 -1
- package/esm/Component.mobile.js +4 -3
- package/esm/Component.responsive-2e2b2125.d.ts +66 -0
- package/esm/Component.responsive.d.ts +1 -1
- package/esm/Component.responsive.js +5 -2
- package/esm/components/date-range-input/Component.d.ts +7 -2
- package/esm/components/date-range-input/Component.js +10 -11
- package/esm/components/date-range-input/index.css +7 -7
- package/esm/components/date-range-input/index.js +1 -2
- package/esm/desktop-63dec22f.d.ts +2 -0
- package/esm/desktop.js +3 -2
- package/esm/index-50136800.d.ts +11 -0
- package/esm/index-72dda473.d.ts +12 -0
- package/esm/index-9211a437.d.ts +2 -0
- package/esm/index-ebda875c.d.ts +35 -0
- package/esm/index-f034f741.d.ts +80 -0
- package/esm/index.d.ts +3 -2
- package/esm/index.js +5 -2
- package/esm/mobile-c219f8ca.d.ts +1 -0
- package/esm/mobile.js +3 -2
- package/esm/types-83e2bd9e.d.ts +113 -0
- package/esm/typings-5684a67d.d.ts +23 -0
- package/esm/typings-9211a437.d.ts +95 -0
- package/esm/useCalendar-5684a67d.d.ts +97 -0
- package/esm/utils-5684a67d.d.ts +88 -0
- package/index-50136800.d.ts +11 -0
- package/index-72dda473.d.ts +12 -0
- package/index-9211a437.d.ts +2 -0
- package/index-ebda875c.d.ts +35 -0
- package/index-f034f741.d.ts +80 -0
- package/index.d.ts +3 -2
- package/index.js +5 -2
- package/mobile-c219f8ca.d.ts +1 -0
- package/mobile.js +3 -2
- package/modern/Component-50136800.d.ts +6 -0
- package/modern/Component-63dec22f.d.ts +167 -0
- package/modern/Component-72dda473.d.ts +53 -0
- package/modern/Component-8b5756fe.d.ts +388 -0
- package/modern/Component.desktop-2e2b2125.d.ts +6 -0
- package/modern/Component.desktop-8b5756fe.d.ts +197 -0
- package/modern/Component.desktop.d.ts +1 -1
- package/modern/Component.desktop.js +4 -3
- package/modern/Component.mobile-755fbaa3.d.ts +6 -0
- package/modern/Component.mobile-ebda875c.d.ts +6 -0
- package/modern/Component.mobile.d.ts +1 -1
- package/modern/Component.mobile.js +4 -3
- package/modern/Component.responsive-2e2b2125.d.ts +66 -0
- package/modern/Component.responsive.d.ts +1 -1
- package/modern/Component.responsive.js +5 -2
- package/modern/components/date-range-input/Component.d.ts +7 -2
- package/modern/components/date-range-input/Component.js +7 -8
- package/modern/components/date-range-input/index.css +7 -7
- package/modern/components/date-range-input/index.js +1 -2
- package/modern/desktop-63dec22f.d.ts +2 -0
- package/modern/desktop.js +3 -2
- package/modern/index-50136800.d.ts +11 -0
- package/modern/index-72dda473.d.ts +12 -0
- package/modern/index-9211a437.d.ts +2 -0
- package/modern/index-ebda875c.d.ts +35 -0
- package/modern/index-f034f741.d.ts +80 -0
- package/modern/index.d.ts +3 -2
- package/modern/index.js +5 -2
- package/modern/mobile-c219f8ca.d.ts +1 -0
- package/modern/mobile.js +3 -2
- package/modern/types-83e2bd9e.d.ts +113 -0
- package/modern/typings-5684a67d.d.ts +23 -0
- package/modern/typings-9211a437.d.ts +95 -0
- package/modern/useCalendar-5684a67d.d.ts +97 -0
- package/modern/utils-5684a67d.d.ts +88 -0
- package/package.json +28 -5
- package/src/Component.desktop.tsx +29 -0
- package/src/Component.mobile.tsx +30 -0
- package/src/Component.responsive.tsx +41 -0
- package/src/components/date-range-input/Component.tsx +519 -0
- package/src/components/date-range-input/index.module.css +37 -0
- package/src/components/date-range-input/index.ts +1 -0
- package/src/desktop.ts +1 -0
- package/src/index.ts +2 -0
- package/src/mobile.ts +1 -0
- package/src/utils/format.ts +91 -0
- package/src/utils/index.ts +1 -0
- package/types-83e2bd9e.d.ts +113 -0
- package/typings-5684a67d.d.ts +23 -0
- package/typings-9211a437.d.ts +95 -0
- package/useCalendar-5684a67d.d.ts +97 -0
- package/utils-5684a67d.d.ts +88 -0
- package/cssm/responsive.d.ts +0 -2
- package/cssm/responsive.js +0 -27
- package/esm/responsive.d.ts +0 -2
- package/esm/responsive.js +0 -18
- package/modern/responsive.d.ts +0 -2
- package/modern/responsive.js +0 -17
- package/responsive.d.ts +0 -2
- package/responsive.js +0 -26
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ReactNode, MouseEvent } from "react";
|
|
4
|
+
import { SelectorView, Month, DayAddons, View } from "./typings-5684a67d";
|
|
5
|
+
import { PeriodType } from "./index-f034f741";
|
|
6
|
+
type HeaderProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Вид шапки — месяц и год или только месяц
|
|
9
|
+
*/
|
|
10
|
+
view?: SelectorView;
|
|
11
|
+
/**
|
|
12
|
+
* Отображать тень? (нужна при прокрутке)
|
|
13
|
+
*/
|
|
14
|
+
withShadow?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Дочерние элементы.
|
|
17
|
+
*/
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
};
|
|
20
|
+
declare const Header: FC<HeaderProps>;
|
|
21
|
+
type MonthYearHeaderProps = {
|
|
22
|
+
/**
|
|
23
|
+
* Активная дата
|
|
24
|
+
*/
|
|
25
|
+
value?: Date;
|
|
26
|
+
/**
|
|
27
|
+
* Дополнительный класс
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Обработчик нажатия на кнопку месяца
|
|
32
|
+
*/
|
|
33
|
+
onMonthClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Обработчик нажатия на кнопку года
|
|
36
|
+
*/
|
|
37
|
+
onYearClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
40
|
+
*/
|
|
41
|
+
dataTestId?: string;
|
|
42
|
+
};
|
|
43
|
+
declare const MonthYearHeader: FC<MonthYearHeaderProps>;
|
|
44
|
+
type MonthsTableProps = {
|
|
45
|
+
/**
|
|
46
|
+
* Массив месяцев
|
|
47
|
+
*/
|
|
48
|
+
months?: Month[];
|
|
49
|
+
/**
|
|
50
|
+
* Выбранный месяц
|
|
51
|
+
*/
|
|
52
|
+
selectedMonth?: Date;
|
|
53
|
+
/**
|
|
54
|
+
* Доп пропсы для переданного месяца
|
|
55
|
+
*/
|
|
56
|
+
getMonthProps: (day: Month) => Record<string, unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* Должен ли календарь подстраиваться под ширину родителя.
|
|
59
|
+
*/
|
|
60
|
+
responsive?: boolean;
|
|
61
|
+
};
|
|
62
|
+
declare const MonthsTable: FC<MonthsTableProps>;
|
|
63
|
+
declare const formatPeriod: (valueFrom: Date, valueTo: Date, periodType: PeriodType, showCurrentYear?: boolean) => string;
|
|
64
|
+
declare const getYearSelectorValue: (valueFrom: Date | undefined, showCurrentYear: boolean) => number | "";
|
|
65
|
+
declare const shiftValues: (valueFrom: Date, valueTo: Date, periodType: PeriodType, direction: "prev" | "next") => {
|
|
66
|
+
valueFrom: Date;
|
|
67
|
+
valueTo: Date;
|
|
68
|
+
};
|
|
69
|
+
type YearsTableProps = {
|
|
70
|
+
/**
|
|
71
|
+
* Массив лет
|
|
72
|
+
*/
|
|
73
|
+
years?: Date[];
|
|
74
|
+
/**
|
|
75
|
+
* Выбранный год
|
|
76
|
+
*/
|
|
77
|
+
selectedYear?: Date;
|
|
78
|
+
/**
|
|
79
|
+
* Доп. пропсы для переданного года
|
|
80
|
+
*/
|
|
81
|
+
getYearProps: (year: Date) => Record<string, unknown>;
|
|
82
|
+
/**
|
|
83
|
+
* Обработчик скролла
|
|
84
|
+
*/
|
|
85
|
+
onScroll: (scrollTop: number) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Должен ли календарь подстраиваться под ширину родителя.
|
|
88
|
+
*/
|
|
89
|
+
responsive?: boolean;
|
|
90
|
+
};
|
|
91
|
+
declare const YearsTable: FC<YearsTableProps>;
|
|
92
|
+
type CalendarDesktopProps = {
|
|
93
|
+
/**
|
|
94
|
+
* Дополнительный класс
|
|
95
|
+
*/
|
|
96
|
+
className?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Вид по умолчанию (выбор дней, месяцев, лет)
|
|
99
|
+
*/
|
|
100
|
+
defaultView?: View;
|
|
101
|
+
/**
|
|
102
|
+
* Вид шапки — месяц и год или только месяц
|
|
103
|
+
*/
|
|
104
|
+
selectorView?: SelectorView;
|
|
105
|
+
/**
|
|
106
|
+
* Выбранная дата (timestamp)
|
|
107
|
+
*/
|
|
108
|
+
value?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Открытый месяц (timestamp)
|
|
111
|
+
*/
|
|
112
|
+
month?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Месяц, открытый по умолчанию (timestamp)
|
|
115
|
+
*/
|
|
116
|
+
defaultMonth?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Минимальная дата, доступная для выбора (timestamp)
|
|
119
|
+
*/
|
|
120
|
+
minDate?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Максимальная дата, доступная для выбора (timestamp)
|
|
123
|
+
*/
|
|
124
|
+
maxDate?: number;
|
|
125
|
+
/**
|
|
126
|
+
* Начало выделенного периода (timestamp)
|
|
127
|
+
*/
|
|
128
|
+
selectedFrom?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Конец выделенного периода (timestamp)
|
|
131
|
+
*/
|
|
132
|
+
selectedTo?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Индикатор, что выбран полный период
|
|
135
|
+
*/
|
|
136
|
+
rangeComplete?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Список событий
|
|
139
|
+
*/
|
|
140
|
+
events?: Array<Date | number>;
|
|
141
|
+
/**
|
|
142
|
+
* Список отключенных для выбора дней.
|
|
143
|
+
*/
|
|
144
|
+
offDays?: Array<Date | number>;
|
|
145
|
+
/**
|
|
146
|
+
* Список выходных
|
|
147
|
+
*/
|
|
148
|
+
holidays?: Array<Date | number>;
|
|
149
|
+
/**
|
|
150
|
+
* Обработчик изменения месяца (или года)
|
|
151
|
+
*/
|
|
152
|
+
onMonthChange?: (month: number) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Обработчик выбора даты
|
|
155
|
+
*/
|
|
156
|
+
onChange?: (date?: number) => void;
|
|
157
|
+
/**
|
|
158
|
+
* Обработчик нажатия на кнопку месяца
|
|
159
|
+
*/
|
|
160
|
+
onMonthClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
161
|
+
/**
|
|
162
|
+
* Обработчик нажатия на кнопку года
|
|
163
|
+
*/
|
|
164
|
+
onYearClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Обработчик нажатия на период
|
|
167
|
+
*/
|
|
168
|
+
onPeriodClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
171
|
+
*/
|
|
172
|
+
dataTestId?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Нужно ли рендерить шапку календаря
|
|
175
|
+
*/
|
|
176
|
+
hasHeader?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Должен ли календарь подстраиваться под ширину родителя.
|
|
179
|
+
*/
|
|
180
|
+
responsive?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Дополнительный контент под числом
|
|
183
|
+
*/
|
|
184
|
+
dayAddons?: DayAddons[];
|
|
185
|
+
/**
|
|
186
|
+
* Форма ячейки дня
|
|
187
|
+
*/
|
|
188
|
+
shape?: 'rounded' | 'rectangular';
|
|
189
|
+
/**
|
|
190
|
+
* Отображать ли текущий год, если selectorView 'month-only'
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
showCurrentYearSelector?: boolean;
|
|
194
|
+
};
|
|
195
|
+
declare const CalendarDesktop: React.ForwardRefExoticComponent<CalendarDesktopProps & React.RefAttributes<HTMLDivElement>>;
|
|
196
|
+
export { HeaderProps, Header, MonthYearHeaderProps, MonthYearHeader, MonthsTableProps, MonthsTable, formatPeriod, getYearSelectorValue, shiftValues, YearsTableProps, YearsTable, CalendarDesktopProps, CalendarDesktop };
|
|
197
|
+
export * from "./Component-63dec22f";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ConditionalProps, DateRangeInputProps } from "./components/date-range-input/index";
|
|
4
|
-
type DateRangeInputDesktopProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose'> & ConditionalProps;
|
|
4
|
+
type DateRangeInputDesktopProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose' | 'InputComponent'> & ConditionalProps;
|
|
5
5
|
declare const DateRangeInputDesktop: React.ForwardRefExoticComponent<DateRangeInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { DateRangeInputDesktopProps, DateRangeInputDesktop };
|
package/esm/Component.desktop.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { __assign } from 'tslib';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
+
import { CalendarDesktop } from '@alfalab/core-components-calendar/esm/desktop';
|
|
4
|
+
import { InputDesktop } from '@alfalab/core-components-input/esm/desktop';
|
|
3
5
|
import { DateRangeInput } from './components/date-range-input/Component.js';
|
|
4
6
|
import 'react-merge-refs';
|
|
5
7
|
import 'classnames';
|
|
6
8
|
import 'date-fns';
|
|
7
9
|
import 'date-fns/isValid';
|
|
8
|
-
import '@alfalab/core-components-calendar/esm';
|
|
10
|
+
import '@alfalab/core-components-calendar/esm/shared';
|
|
9
11
|
import '@alfalab/core-components-icon-button/esm';
|
|
10
|
-
import '@alfalab/core-components-input/esm';
|
|
11
12
|
import '@alfalab/core-components-popover/esm';
|
|
12
13
|
import '@alfalab/hooks';
|
|
13
14
|
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
14
15
|
import './utils/format.js';
|
|
15
16
|
import 'date-fns/parse';
|
|
16
17
|
|
|
17
|
-
var DateRangeInputDesktop = forwardRef(function (props, ref) { return React.createElement(DateRangeInput, __assign({}, props, { ref: ref })); });
|
|
18
|
+
var DateRangeInputDesktop = forwardRef(function (props, ref) { return (React.createElement(DateRangeInput, __assign({ InputComponent: InputDesktop, Calendar: CalendarDesktop }, props, { ref: ref }))); });
|
|
18
19
|
|
|
19
20
|
export { DateRangeInputDesktop };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AnchorButtonProps, NativeButtonProps } from "./typings-9211a437";
|
|
4
|
+
type ButtonMobileProps = Partial<AnchorButtonProps | NativeButtonProps>;
|
|
5
|
+
declare const ButtonMobile: React.ForwardRefExoticComponent<ButtonMobileProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
6
|
+
export { ButtonMobileProps, ButtonMobile };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlMobileProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'>;
|
|
5
|
+
declare const FormControlMobile: React.ForwardRefExoticComponent<FormControlMobileProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { FormControlMobileProps, FormControlMobile };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ConditionalProps, DateRangeInputProps } from "./components/date-range-input/index";
|
|
4
|
-
type DateRangeInputMobileProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose'> & ConditionalProps;
|
|
4
|
+
type DateRangeInputMobileProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose' | 'InputComponent'> & ConditionalProps;
|
|
5
5
|
declare const DateRangeInputMobile: React.ForwardRefExoticComponent<DateRangeInputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { DateRangeInputMobileProps, DateRangeInputMobile };
|
package/esm/Component.mobile.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { __assign } from 'tslib';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
-
import { CalendarMobile } from '@alfalab/core-components-calendar/esm';
|
|
3
|
+
import { CalendarMobile } from '@alfalab/core-components-calendar/esm/mobile';
|
|
4
|
+
import { InputMobile } from '@alfalab/core-components-input/esm/mobile';
|
|
4
5
|
import { DateRangeInput } from './components/date-range-input/Component.js';
|
|
5
6
|
import 'react-merge-refs';
|
|
6
7
|
import 'classnames';
|
|
7
8
|
import 'date-fns';
|
|
8
9
|
import 'date-fns/isValid';
|
|
10
|
+
import '@alfalab/core-components-calendar/esm/shared';
|
|
9
11
|
import '@alfalab/core-components-icon-button/esm';
|
|
10
|
-
import '@alfalab/core-components-input/esm';
|
|
11
12
|
import '@alfalab/core-components-popover/esm';
|
|
12
13
|
import '@alfalab/hooks';
|
|
13
14
|
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
14
15
|
import './utils/format.js';
|
|
15
16
|
import 'date-fns/parse';
|
|
16
17
|
|
|
17
|
-
var DateRangeInputMobile = forwardRef(function (props, ref) { return React.createElement(DateRangeInput, __assign({ Calendar: CalendarMobile, view: 'mobile' }, props, { ref: ref })); });
|
|
18
|
+
var DateRangeInputMobile = forwardRef(function (props, ref) { return (React.createElement(DateRangeInput, __assign({ InputComponent: InputMobile, Calendar: CalendarMobile, view: 'mobile' }, props, { ref: ref }))); });
|
|
18
19
|
|
|
19
20
|
export { DateRangeInputMobile };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ReactNode } from "react";
|
|
4
|
+
import { ButtonProps } from "./typings-9211a437";
|
|
5
|
+
type MqProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
8
|
+
*/
|
|
9
|
+
query?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Запрос на поддержку тач-событий
|
|
12
|
+
*/
|
|
13
|
+
touch?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Дочерние элементы.
|
|
16
|
+
*/
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Обработчик изменений в совпадении запросов
|
|
20
|
+
*/
|
|
21
|
+
onMatchChange?: (isMatched: boolean) => void;
|
|
22
|
+
};
|
|
23
|
+
declare const Mq: FC<MqProps>;
|
|
24
|
+
/**
|
|
25
|
+
* Хук для медиа запросов.
|
|
26
|
+
* @param query media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
27
|
+
* @param defaultValue Значение по-умолчанию.
|
|
28
|
+
*/
|
|
29
|
+
declare const useMatchMedia: (query: string, defaultValue?: boolean | (() => boolean)) => boolean[];
|
|
30
|
+
/**
|
|
31
|
+
* Возвращает MediaQueryList для заданного media-выражения.
|
|
32
|
+
*
|
|
33
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
34
|
+
*/
|
|
35
|
+
declare function getMatchMedia(queryProp: string): MediaQueryList;
|
|
36
|
+
/**
|
|
37
|
+
* Удаляет MediaQueryList.
|
|
38
|
+
*
|
|
39
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
40
|
+
*/
|
|
41
|
+
declare function releaseMatchMedia(queryProp: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Возвращает `true`, если есть поддержка `Pointer Events`
|
|
44
|
+
*/
|
|
45
|
+
declare function isPointerEventsSupported(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Возвращает `true`, если есть поддержка `Touch Events`
|
|
48
|
+
*/
|
|
49
|
+
declare function isTouchSupported(): boolean;
|
|
50
|
+
declare const _exports: {
|
|
51
|
+
"--mobile-xs": string;
|
|
52
|
+
"--mobile-s": string;
|
|
53
|
+
"--mobile-m": string;
|
|
54
|
+
"--mobile-l": string;
|
|
55
|
+
"--mobile": string;
|
|
56
|
+
"--tablet-s": string;
|
|
57
|
+
"--tablet-m": string;
|
|
58
|
+
"--tablet": string;
|
|
59
|
+
"--desktop-s": string;
|
|
60
|
+
"--desktop-m": string;
|
|
61
|
+
"--desktop-l": string;
|
|
62
|
+
"--desktop-xl": string;
|
|
63
|
+
"--desktop": string;
|
|
64
|
+
};
|
|
65
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
66
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported, Button };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ConditionalProps, DateRangeInputProps } from "./components/date-range-input/index";
|
|
4
|
-
type DateRangeInputResponsiveProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose'> & ConditionalProps & {
|
|
4
|
+
type DateRangeInputResponsiveProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose' | 'InputComponent'> & ConditionalProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -3,18 +3,21 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import { useMedia } from '@alfalab/hooks';
|
|
4
4
|
import { DateRangeInputDesktop } from './Component.desktop.js';
|
|
5
5
|
import { DateRangeInputMobile } from './Component.mobile.js';
|
|
6
|
+
import '@alfalab/core-components-calendar/esm/desktop';
|
|
7
|
+
import '@alfalab/core-components-input/esm/desktop';
|
|
6
8
|
import './components/date-range-input/Component.js';
|
|
7
9
|
import 'react-merge-refs';
|
|
8
10
|
import 'classnames';
|
|
9
11
|
import 'date-fns';
|
|
10
12
|
import 'date-fns/isValid';
|
|
11
|
-
import '@alfalab/core-components-calendar/esm';
|
|
13
|
+
import '@alfalab/core-components-calendar/esm/shared';
|
|
12
14
|
import '@alfalab/core-components-icon-button/esm';
|
|
13
|
-
import '@alfalab/core-components-input/esm';
|
|
14
15
|
import '@alfalab/core-components-popover/esm';
|
|
15
16
|
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
16
17
|
import './utils/format.js';
|
|
17
18
|
import 'date-fns/parse';
|
|
19
|
+
import '@alfalab/core-components-calendar/esm/mobile';
|
|
20
|
+
import '@alfalab/core-components-input/esm/mobile';
|
|
18
21
|
|
|
19
22
|
var DateRangeInputResponsive = forwardRef(function (_a, ref) {
|
|
20
23
|
var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = __rest(_a, ["breakpoint"]);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ChangeEvent, ElementType } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { CalendarDesktopProps } from "../../desktop-63dec22f";
|
|
5
|
+
import { CalendarMobileProps } from "../../mobile-c219f8ca";
|
|
5
6
|
import { InputProps } from "@alfalab/core-components-input";
|
|
6
7
|
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
7
8
|
type ConditionalProps = {
|
|
@@ -53,7 +54,7 @@ type DateRangeInputProps = Omit<InputProps, 'onChange'> & ConditionalProps & {
|
|
|
53
54
|
/**
|
|
54
55
|
* Доп. пропсы для календаря
|
|
55
56
|
*/
|
|
56
|
-
calendarProps?: (
|
|
57
|
+
calendarProps?: (CalendarDesktopProps & Record<string, unknown>) | (CalendarMobileProps & Record<string, unknown>);
|
|
57
58
|
/**
|
|
58
59
|
* Месяц в календаре по умолчанию (timestamp)
|
|
59
60
|
*/
|
|
@@ -103,6 +104,10 @@ type DateRangeInputProps = Omit<InputProps, 'onChange'> & ConditionalProps & {
|
|
|
103
104
|
* Отображение компонента в мобильном или десктопном виде
|
|
104
105
|
*/
|
|
105
106
|
view?: 'desktop' | 'mobile';
|
|
107
|
+
/**
|
|
108
|
+
* Компонент инпута
|
|
109
|
+
*/
|
|
110
|
+
InputComponent?: ElementType;
|
|
106
111
|
/**
|
|
107
112
|
* Запретить ввод с клавиатуры
|
|
108
113
|
*/
|
|
@@ -4,30 +4,29 @@ import mergeRefs from 'react-merge-refs';
|
|
|
4
4
|
import cn from 'classnames';
|
|
5
5
|
import { startOfMonth } from 'date-fns';
|
|
6
6
|
import dateFnsIsValid from 'date-fns/isValid';
|
|
7
|
-
import { usePeriod
|
|
7
|
+
import { usePeriod } from '@alfalab/core-components-calendar/esm/shared';
|
|
8
8
|
import { IconButton } from '@alfalab/core-components-icon-button/esm';
|
|
9
|
-
import { Input } from '@alfalab/core-components-input/esm';
|
|
10
9
|
import { Popover } from '@alfalab/core-components-popover/esm';
|
|
11
10
|
import { useDidUpdateEffect } from '@alfalab/hooks';
|
|
12
11
|
import { CalendarMIcon } from '@alfalab/icons-glyph/CalendarMIcon';
|
|
13
12
|
import { parseTimestampToDate, DATE_FORMAT, format, parseDateString, DATE_MASK, isCompleteDateInput, isValid } from '../../utils/format.js';
|
|
14
13
|
import 'date-fns/parse';
|
|
15
14
|
|
|
16
|
-
var styles = {"component":"date-range-
|
|
15
|
+
var styles = {"component":"date-range-input__component_1c20z","calendarContainer":"date-range-input__calendarContainer_1c20z","calendarResponsive":"date-range-input__calendarResponsive_1c20z","block":"date-range-input__block_1c20z","calendarIcon":"date-range-input__calendarIcon_1c20z"};
|
|
17
16
|
require('./index.css')
|
|
18
17
|
|
|
19
18
|
var DateRangeInput = React.forwardRef(function (_a, ref) {
|
|
20
19
|
var _b, _c;
|
|
21
20
|
var _d;
|
|
22
|
-
var className = _a.className, inputClassName = _a.inputClassName, popoverClassName = _a.popoverClassName, disabled = _a.disabled, readOnly = _a.readOnly, _e = _a.disableUserInput, disableUserInput = _e === void 0 ? false : _e, picker = _a.picker, _f = _a.defaultValue, defaultValue = _f === void 0 ? '' : _f, propValue = _a.value, onChange = _a.onChange, onComplete = _a.onComplete, onClose = _a.onClose, rightAddons = _a.rightAddons, useAnchorWidth = _a.useAnchorWidth, block = _a.block, _g = _a.popoverPosition, popoverPosition = _g === void 0 ? 'bottom-start' : _g, zIndexPopover = _a.zIndexPopover, preventFlip = _a.preventFlip,
|
|
21
|
+
var className = _a.className, inputClassName = _a.inputClassName, popoverClassName = _a.popoverClassName, disabled = _a.disabled, readOnly = _a.readOnly, _e = _a.disableUserInput, disableUserInput = _e === void 0 ? false : _e, picker = _a.picker, _f = _a.defaultValue, defaultValue = _f === void 0 ? '' : _f, propValue = _a.value, onChange = _a.onChange, onComplete = _a.onComplete, onClose = _a.onClose, rightAddons = _a.rightAddons, useAnchorWidth = _a.useAnchorWidth, block = _a.block, _g = _a.popoverPosition, popoverPosition = _g === void 0 ? 'bottom-start' : _g, zIndexPopover = _a.zIndexPopover, preventFlip = _a.preventFlip, InputComponent = _a.InputComponent, Calendar = _a.Calendar, _h = _a.calendarProps, calendarProps = _h === void 0 ? {} : _h, defaultMonth = _a.defaultMonth, _j = _a.minDate, minDate = _j === void 0 ? calendarProps.minDate : _j, _k = _a.maxDate, maxDate = _k === void 0 ? calendarProps.maxDate : _k, _l = _a.offDays, offDays = _l === void 0 ? calendarProps.offDays || [] : _l, _m = _a.events, events = _m === void 0 ? calendarProps.events || [] : _m, _o = _a.defaultOpen, defaultOpen = _o === void 0 ? false : _o, _p = _a.view, view = _p === void 0 ? 'desktop' : _p, restProps = __rest(_a, ["className", "inputClassName", "popoverClassName", "disabled", "readOnly", "disableUserInput", "picker", "defaultValue", "value", "onChange", "onComplete", "onClose", "rightAddons", "useAnchorWidth", "block", "popoverPosition", "zIndexPopover", "preventFlip", "InputComponent", "Calendar", "calendarProps", "defaultMonth", "minDate", "maxDate", "offDays", "events", "defaultOpen", "view"]);
|
|
23
22
|
var inputRef = useRef(null);
|
|
24
23
|
var iconRef = useRef(null);
|
|
25
24
|
var calendarRef = useRef(null);
|
|
26
|
-
var
|
|
27
|
-
var
|
|
25
|
+
var _q = useState(propValue || defaultValue), value = _q[0], setValue = _q[1];
|
|
26
|
+
var _r = useState(defaultOpen), open = _r[0], setOpen = _r[1];
|
|
28
27
|
var inputDisabled = disabled || readOnly;
|
|
29
28
|
var calendarResponsive = (_d = calendarProps === null || calendarProps === void 0 ? void 0 : calendarProps.responsive) !== null && _d !== void 0 ? _d : true;
|
|
30
|
-
var
|
|
29
|
+
var _s = usePeriod({ onPeriodChange: handlePeriodChange }), selectedFrom = _s.selectedFrom, selectedTo = _s.selectedTo, updatePeriod = _s.updatePeriod, resetPeriod = _s.resetPeriod, setStart = _s.setStart, setEnd = _s.setEnd;
|
|
31
30
|
useEffect(function () {
|
|
32
31
|
if (value) {
|
|
33
32
|
setCalendarPeriod(getDates(value));
|
|
@@ -204,17 +203,17 @@ var DateRangeInput = React.forwardRef(function (_a, ref) {
|
|
|
204
203
|
var renderCalendar = function () {
|
|
205
204
|
var activeMonth = (selectedTo && startOfMonth(selectedTo)) ||
|
|
206
205
|
(selectedFrom && startOfMonth(selectedFrom));
|
|
207
|
-
return (
|
|
206
|
+
return Calendar ? (
|
|
208
207
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
209
208
|
React.createElement("div", { onMouseDown: handleCalendarWrapperMouseDown },
|
|
210
|
-
React.createElement(Calendar
|
|
209
|
+
React.createElement(Calendar, __assign({}, calendarProps, { responsive: calendarResponsive, open: open, onClose: handleCalendarClose, ref: calendarRef, defaultMonth: activeMonth || defaultMonth, selectedFrom: selectedFrom, selectedTo: selectedTo, onChange: handleCalendarChange, minDate: minDate, maxDate: maxDate, offDays: offDays, events: events })))) : null;
|
|
211
210
|
};
|
|
212
211
|
return (React.createElement("div", { className: cn(styles.component, className, (_b = {},
|
|
213
212
|
_b[styles.block] = block,
|
|
214
213
|
_b)), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
215
|
-
React.createElement(
|
|
214
|
+
InputComponent ? (React.createElement(InputComponent, __assign({}, restProps, { block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, onKeyDown: handleInputKeyDown, rightAddons: React.createElement(React.Fragment, null,
|
|
216
215
|
rightAddons,
|
|
217
|
-
picker && (React.createElement(IconButton, { className: styles.calendarIcon, ref: iconRef, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 's' }))) })),
|
|
216
|
+
picker && (React.createElement(IconButton, { className: styles.calendarIcon, ref: iconRef, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 's' }))) }))) : null,
|
|
218
217
|
picker && (React.createElement(Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn(styles.calendarContainer, (_c = {},
|
|
219
218
|
_c[styles.calendarResponsive] = calendarResponsive,
|
|
220
219
|
_c)), className: popoverClassName, position: popoverPosition, offset: [0, 8], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar()))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 8gfu6 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -41,24 +41,24 @@
|
|
|
41
41
|
/* marker */
|
|
42
42
|
} :root {
|
|
43
43
|
--calendar-popover-border-radius: var(--border-radius-m);
|
|
44
|
-
} .date-range-
|
|
44
|
+
} .date-range-input__component_1c20z {
|
|
45
45
|
display: inline-block;
|
|
46
46
|
outline: none;
|
|
47
47
|
position: relative;
|
|
48
|
-
} .date-range-
|
|
48
|
+
} .date-range-input__calendarContainer_1c20z {
|
|
49
49
|
display: inline-block;
|
|
50
50
|
box-sizing: border-box;
|
|
51
51
|
border-radius: var(--calendar-popover-border-radius);
|
|
52
52
|
border: 1px solid var(--color-light-border-secondary)
|
|
53
|
-
} @media (max-width: 374px) { .date-range-
|
|
53
|
+
} @media (max-width: 374px) { .date-range-input__calendarContainer_1c20z {
|
|
54
54
|
width: 100%;
|
|
55
55
|
min-width: 288px
|
|
56
56
|
}
|
|
57
|
-
} .date-range-
|
|
57
|
+
} .date-range-input__calendarResponsive_1c20z {
|
|
58
58
|
width: var(--calendar-width);
|
|
59
|
-
} .date-range-
|
|
59
|
+
} .date-range-input__block_1c20z {
|
|
60
60
|
width: 100%;
|
|
61
|
-
} .date-range-
|
|
61
|
+
} .date-range-input__calendarIcon_1c20z {
|
|
62
62
|
margin-right: var(--gap-s-neg);
|
|
63
63
|
height: 100%;
|
|
64
64
|
}
|
|
@@ -5,9 +5,8 @@ import 'react-merge-refs';
|
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import 'date-fns';
|
|
7
7
|
import 'date-fns/isValid';
|
|
8
|
-
import '@alfalab/core-components-calendar/esm';
|
|
8
|
+
import '@alfalab/core-components-calendar/esm/shared';
|
|
9
9
|
import '@alfalab/core-components-icon-button/esm';
|
|
10
|
-
import '@alfalab/core-components-input/esm';
|
|
11
10
|
import '@alfalab/core-components-popover/esm';
|
|
12
11
|
import '@alfalab/hooks';
|
|
13
12
|
import '@alfalab/icons-glyph/CalendarMIcon';
|
package/esm/desktop.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export { DateRangeInputDesktop } from './Component.desktop.js';
|
|
2
2
|
import 'tslib';
|
|
3
3
|
import 'react';
|
|
4
|
+
import '@alfalab/core-components-calendar/esm/desktop';
|
|
5
|
+
import '@alfalab/core-components-input/esm/desktop';
|
|
4
6
|
import './components/date-range-input/Component.js';
|
|
5
7
|
import 'react-merge-refs';
|
|
6
8
|
import 'classnames';
|
|
7
9
|
import 'date-fns';
|
|
8
10
|
import 'date-fns/isValid';
|
|
9
|
-
import '@alfalab/core-components-calendar/esm';
|
|
11
|
+
import '@alfalab/core-components-calendar/esm/shared';
|
|
10
12
|
import '@alfalab/core-components-icon-button/esm';
|
|
11
|
-
import '@alfalab/core-components-input/esm';
|
|
12
13
|
import '@alfalab/core-components-popover/esm';
|
|
13
14
|
import '@alfalab/hooks';
|
|
14
15
|
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PaddingType } from "./index-72dda473";
|
|
4
|
+
declare const isClient: () => boolean;
|
|
5
|
+
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
6
|
+
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
7
|
+
declare function easeInOutQuad(x: number): number;
|
|
8
|
+
declare const easingFns: {
|
|
9
|
+
easeInOutQuad: typeof easeInOutQuad;
|
|
10
|
+
};
|
|
11
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type BackgroundColorType = 'accent' | 'info' | 'attention-muted' | 'positive-muted' | 'negative-muted' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'specialbg-component' | 'specialbg-component-inverted' | 'specialbg-primary-grouped' | 'specialbg-secondary-grouped' | 'specialbg-tertiary-grouped' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
|
|
2
|
+
type BorderColorType = 'accent' | 'key' | 'key-inverted' | 'link' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'underline' | 'underline-inverted' | 'graphic-attention' | 'graphic-link' | 'graphic-negative' | 'graphic-positive' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
|
|
3
|
+
type GraphicColorType = 'accent' | 'link' | 'attention' | 'positive' | 'negative' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'static-light' | 'static-accent' | 'static-dark';
|
|
4
|
+
type ShadowType = 'shadow-xs' | 'shadow-s' | 'shadow-m' | 'shadow-l' | 'shadow-xl' | 'shadow-xs-hard' | 'shadow-s-hard' | 'shadow-m-hard' | 'shadow-l-hard' | 'shadow-xl-hard' | 'shadow-xs-up' | 'shadow-s-up' | 'shadow-m-up' | 'shadow-l-up' | 'shadow-xl-up' | 'shadow-xs-hard-up' | 'shadow-s-hard-up' | 'shadow-m-hard-up' | 'shadow-l-hard-up' | 'shadow-xl-hard-up';
|
|
5
|
+
type GapType = '3xs' | '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl';
|
|
6
|
+
type PaddingType = number | string | {
|
|
7
|
+
top?: number;
|
|
8
|
+
right?: number;
|
|
9
|
+
bottom?: number;
|
|
10
|
+
left?: number;
|
|
11
|
+
};
|
|
12
|
+
export { BackgroundColorType, BorderColorType, GraphicColorType, ShadowType, GapType, PaddingType };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ButtonHTMLAttributes, ElementType, FC } from "react";
|
|
4
|
+
interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Вид компонента
|
|
7
|
+
*/
|
|
8
|
+
view: "desktop" | "mobile";
|
|
9
|
+
/**
|
|
10
|
+
* Дополнительный класс
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Позиция крестика
|
|
15
|
+
*/
|
|
16
|
+
align?: "left" | "right";
|
|
17
|
+
/**
|
|
18
|
+
* Фиксирует крестик
|
|
19
|
+
*/
|
|
20
|
+
sticky?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Иконка
|
|
23
|
+
*/
|
|
24
|
+
icon?: ElementType;
|
|
25
|
+
/**
|
|
26
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
27
|
+
*/
|
|
28
|
+
dataTestId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Коллбэк закрытия.
|
|
31
|
+
*/
|
|
32
|
+
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
|
|
33
|
+
}
|
|
34
|
+
declare const Closer: FC<CloserProps>;
|
|
35
|
+
export { CloserProps, Closer };
|