@ozen-ui/kit 0.47.2 → 0.48.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/DatePicker/package.json +5 -0
- package/__inner__/cjs/components/Autocomplete/Autocomplete.js +57 -63
- package/__inner__/cjs/components/Autocomplete/helper.d.ts +6 -0
- package/__inner__/cjs/components/Autocomplete/types.d.ts +1 -1
- package/__inner__/cjs/components/Calendar/types.d.ts +1 -1
- package/__inner__/cjs/components/DatePicker/DatePicker.css +11 -0
- package/__inner__/cjs/components/DatePicker/DatePicker.d.ts +39 -0
- package/__inner__/cjs/components/DatePicker/DatePicker.js +160 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/DateInput.d.ts +6 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/DateInput.js +14 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.d.ts +2 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.js +20 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/utils/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/components/DateInput/utils/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.d.ts +8 -0
- package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.js +26 -0
- package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/components/index.d.ts +2 -0
- package/__inner__/cjs/components/DatePicker/components/index.js +5 -0
- package/__inner__/cjs/components/DatePicker/constants.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/constants.js +4 -0
- package/__inner__/cjs/components/DatePicker/index.d.ts +2 -0
- package/__inner__/cjs/components/DatePicker/index.js +5 -0
- package/__inner__/cjs/components/DatePicker/types.d.ts +52 -0
- package/__inner__/cjs/components/DatePicker/types.js +2 -0
- package/__inner__/cjs/components/DatePicker/utils/formatDateToString/formatDateToString.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/utils/formatDateToString/formatDateToString.js +13 -0
- package/__inner__/cjs/components/DatePicker/utils/formatDateToString/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/utils/formatDateToString/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/formatStringToDate.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/formatStringToDate.js +13 -0
- package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/utils/index.d.ts +5 -0
- package/__inner__/cjs/components/DatePicker/utils/index.js +8 -0
- package/__inner__/cjs/components/DatePicker/utils/isInExclude/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/utils/isInExclude/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/utils/isInExclude/isInExclude.d.ts +2 -0
- package/__inner__/cjs/components/DatePicker/utils/isInExclude/isInExclude.js +14 -0
- package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/isOutOfRange.d.ts +2 -0
- package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/isOutOfRange.js +11 -0
- package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/index.d.ts +1 -0
- package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/index.js +4 -0
- package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.d.ts +5 -0
- package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.js +10 -0
- package/__inner__/cjs/components/Input/Input.css +0 -1
- package/__inner__/cjs/components/Input/Input.js +1 -1
- package/__inner__/cjs/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/cjs/locale/locale.js +12 -0
- package/__inner__/esm/components/Autocomplete/Autocomplete.js +57 -63
- package/__inner__/esm/components/Autocomplete/helper.d.ts +6 -0
- package/__inner__/esm/components/Autocomplete/types.d.ts +1 -1
- package/__inner__/esm/components/Calendar/types.d.ts +1 -1
- package/__inner__/esm/components/DatePicker/DatePicker.css +11 -0
- package/__inner__/esm/components/DatePicker/DatePicker.d.ts +39 -0
- package/__inner__/esm/components/DatePicker/DatePicker.js +157 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/DateInput.d.ts +6 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/DateInput.js +11 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/index.js +1 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.d.ts +2 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.js +15 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/index.js +1 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/utils/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/components/DateInput/utils/index.js +1 -0
- package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.d.ts +8 -0
- package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.js +22 -0
- package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/index.js +1 -0
- package/__inner__/esm/components/DatePicker/components/index.d.ts +2 -0
- package/__inner__/esm/components/DatePicker/components/index.js +2 -0
- package/__inner__/esm/components/DatePicker/constants.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/constants.js +1 -0
- package/__inner__/esm/components/DatePicker/index.d.ts +2 -0
- package/__inner__/esm/components/DatePicker/index.js +2 -0
- package/__inner__/esm/components/DatePicker/types.d.ts +52 -0
- package/__inner__/esm/components/DatePicker/types.js +1 -0
- package/__inner__/esm/components/DatePicker/utils/formatDateToString/formatDateToString.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/utils/formatDateToString/formatDateToString.js +9 -0
- package/__inner__/esm/components/DatePicker/utils/formatDateToString/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/utils/formatDateToString/index.js +1 -0
- package/__inner__/esm/components/DatePicker/utils/formatStringToDate/formatStringToDate.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/utils/formatStringToDate/formatStringToDate.js +9 -0
- package/__inner__/esm/components/DatePicker/utils/formatStringToDate/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/utils/formatStringToDate/index.js +1 -0
- package/__inner__/esm/components/DatePicker/utils/index.d.ts +5 -0
- package/__inner__/esm/components/DatePicker/utils/index.js +5 -0
- package/__inner__/esm/components/DatePicker/utils/isInExclude/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/utils/isInExclude/index.js +1 -0
- package/__inner__/esm/components/DatePicker/utils/isInExclude/isInExclude.d.ts +2 -0
- package/__inner__/esm/components/DatePicker/utils/isInExclude/isInExclude.js +10 -0
- package/__inner__/esm/components/DatePicker/utils/isOutOfRange/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/utils/isOutOfRange/index.js +1 -0
- package/__inner__/esm/components/DatePicker/utils/isOutOfRange/isOutOfRange.d.ts +2 -0
- package/__inner__/esm/components/DatePicker/utils/isOutOfRange/isOutOfRange.js +7 -0
- package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/index.d.ts +1 -0
- package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/index.js +1 -0
- package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.d.ts +5 -0
- package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.js +7 -0
- package/__inner__/esm/components/Input/Input.css +0 -1
- package/__inner__/esm/components/Input/Input.js +1 -1
- package/__inner__/esm/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/esm/locale/locale.js +12 -0
- package/package.json +4 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ChangeEvent } from 'react';
|
|
2
|
+
import type { CalendarBaseProps, CalendarOnChange } from '../Calendar';
|
|
3
|
+
import type { InputProps } from '../Input';
|
|
4
|
+
import type { PopoverBaseProps } from '../Popover';
|
|
5
|
+
export type DatePickerOnChange = CalendarOnChange;
|
|
6
|
+
export type DatePickerOnInputChange = (e: ChangeEvent<HTMLInputElement> | null, value: string) => void;
|
|
7
|
+
export type DatePickerPropOnError = (props: {
|
|
8
|
+
type: 'outOfRange';
|
|
9
|
+
inputValue?: string;
|
|
10
|
+
value?: Date | null;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'inExclude';
|
|
13
|
+
inputValue?: string;
|
|
14
|
+
value?: Date | null;
|
|
15
|
+
}) => void;
|
|
16
|
+
type DatePickerOpenControlledProps = {
|
|
17
|
+
/** Текущее состояние списка. Если `true`, список отображается. */
|
|
18
|
+
open?: boolean;
|
|
19
|
+
/** Состояние открытие по умолчанию (неконтролируемый компонент) */
|
|
20
|
+
defaultOpen?: never;
|
|
21
|
+
};
|
|
22
|
+
type DatePickerOpenUncontrolledProps = {
|
|
23
|
+
/** Текущее состояние списка. Если `true`, список отображается. */
|
|
24
|
+
open?: never;
|
|
25
|
+
/** Состояние открытие по умолчанию (неконтролируемый компонент) */
|
|
26
|
+
defaultOpen?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type DatePickerProps = {
|
|
29
|
+
/** Выбранная дата */
|
|
30
|
+
value?: Date | null;
|
|
31
|
+
/** Выбранная дата по умолчанию (неконтролируемое состояние) */
|
|
32
|
+
defaultValue?: Date | null;
|
|
33
|
+
/** Функция обратного вызова, которая будет вызвана при выборе значения */
|
|
34
|
+
onChange?: DatePickerOnChange;
|
|
35
|
+
/** Введённое значение в текстовом поле */
|
|
36
|
+
onInputChange?: DatePickerOnInputChange;
|
|
37
|
+
/** Функция обратного вызова, которая будет вызвана когда компонент запрашивает закрытие */
|
|
38
|
+
onClose?: () => void;
|
|
39
|
+
/** Функция обратного вызова, которая будет вызвана когда компонент запрашивает открытие */
|
|
40
|
+
onOpen?: () => void;
|
|
41
|
+
/** Свойства компонента Calendar */
|
|
42
|
+
calendarProps?: CalendarBaseProps;
|
|
43
|
+
/** Свойства компонента Popover */
|
|
44
|
+
popoverProps?: PopoverBaseProps;
|
|
45
|
+
/** Текст для кнопки очистки поля */
|
|
46
|
+
clearText?: string;
|
|
47
|
+
/** Если {true}, то не отображает кнопку закрытия */
|
|
48
|
+
disableClearButton?: boolean;
|
|
49
|
+
/** Функция обратно вызова, которая сработает если пользователь ввёл дату с ошибкой */
|
|
50
|
+
onError?: DatePickerPropOnError;
|
|
51
|
+
} & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'defaultValue' | 'onError'> & Pick<CalendarBaseProps, 'minDate' | 'maxDate' | 'exclude' | 'offsetDate'> & Pick<InputProps, 'label' | 'hint' | 'onKeyDown' | 'size' | 'error' | 'required' | 'fullWidth' | 'disabled' | 'renderLeft' | 'renderRight' | 'placeholder' | 'inputProps'> & (DatePickerOpenControlledProps | DatePickerOpenUncontrolledProps);
|
|
52
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatDateToString: (date: Date | undefined | null) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatDateToString = void 0;
|
|
4
|
+
var formatDateToString = function (date) {
|
|
5
|
+
if (!date) {
|
|
6
|
+
return '';
|
|
7
|
+
}
|
|
8
|
+
var year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date);
|
|
9
|
+
var month = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(date);
|
|
10
|
+
var day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date);
|
|
11
|
+
return "".concat(day, ".").concat(month, ".").concat(year);
|
|
12
|
+
};
|
|
13
|
+
exports.formatDateToString = formatDateToString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './formatDateToString';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatStringToDate: (value: string) => Date | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatStringToDate = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var utils_1 = require("../../components/DateInput/utils");
|
|
6
|
+
var formatStringToDate = function (value) {
|
|
7
|
+
var _a = tslib_1.__read(value.split('.'), 3), date = _a[0], month = _a[1], year = _a[2];
|
|
8
|
+
if (!(date && month && year) || !(0, utils_1.isCompleted)(value)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return new Date(+year, +month - 1, +date);
|
|
12
|
+
};
|
|
13
|
+
exports.formatStringToDate = formatStringToDate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './formatStringToDate';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./matchCalendarSizeToFormElement"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./formatDateToString"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./formatStringToDate"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./isOutOfRange"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./isInExclude"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './isInExclude';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isInExclude = void 0;
|
|
4
|
+
var isInExclude = function (_a) {
|
|
5
|
+
var _b, _c;
|
|
6
|
+
var exclude = _a.exclude, value = _a.value;
|
|
7
|
+
if (!exclude || !value) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
return (!!(exclude.date &&
|
|
11
|
+
!((_b = exclude.date) === null || _b === void 0 ? void 0 : _b.every(function (date) { return date.getTime() !== value.getTime(); }))) ||
|
|
12
|
+
!!(exclude.day && !((_c = exclude.day) === null || _c === void 0 ? void 0 : _c.every(function (date) { return date !== value.getDay(); }))));
|
|
13
|
+
};
|
|
14
|
+
exports.isInExclude = isInExclude;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './isOutOfRange';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isOutOfRange = void 0;
|
|
4
|
+
var isOutOfRange = function (_a) {
|
|
5
|
+
var minDate = _a.minDate, maxDate = _a.maxDate, value = _a.value;
|
|
6
|
+
if (!minDate || !maxDate || !value) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return (minDate.getTime() > (value === null || value === void 0 ? void 0 : value.getTime()) || maxDate.getTime() < (value === null || value === void 0 ? void 0 : value.getTime()));
|
|
10
|
+
};
|
|
11
|
+
exports.isOutOfRange = isOutOfRange;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './matchCalendarSizeToFormElement';
|
|
@@ -41,7 +41,7 @@ exports.Input = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
return (react_1.default.createElement(FieldControl_1.FieldControl, tslib_1.__assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { ref: ref, className: (0, exports.cnInput)({}, [className]) }),
|
|
44
|
-
react_1.default.createElement("label", tslib_1.__assign({}, bodyProps, { className: (0, exports.cnInput)('Body'), ref: (0, useMultiRef_1.useMultiRef)([bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref, bodyInnerRef]) }),
|
|
44
|
+
react_1.default.createElement("label", tslib_1.__assign({}, bodyProps, { className: (0, exports.cnInput)('Body', [bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.className]), ref: (0, useMultiRef_1.useMultiRef)([bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref, bodyInnerRef]) }),
|
|
45
45
|
react_1.default.createElement(FieldIcon_1.FieldIcon, { icon: renderLeft }),
|
|
46
46
|
react_1.default.createElement("div", { className: (0, exports.cnInput)('FieldContainer') },
|
|
47
47
|
react_1.default.createElement(FieldLabel_1.FieldLabel, tslib_1.__assign({}, labelProps, { ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref), className: labelProps === null || labelProps === void 0 ? void 0 : labelProps.className }), label),
|
|
@@ -15,6 +15,7 @@ import type { ChipProps as ChiPropsNext } from '../ChipNext';
|
|
|
15
15
|
import type { CollapseProps } from '../Collapse';
|
|
16
16
|
import type { ContainerProps } from '../Container';
|
|
17
17
|
import type { DataListProps } from '../DataList';
|
|
18
|
+
import type { DatePickerProps } from '../DatePicker';
|
|
18
19
|
import type { DialogProps } from '../Dialog';
|
|
19
20
|
import type { DividerProps } from '../Divider';
|
|
20
21
|
import type { DrawerProps } from '../Drawer';
|
|
@@ -86,6 +87,7 @@ export type Theme = {
|
|
|
86
87
|
Container?: Partial<ContainerProps>;
|
|
87
88
|
DataList?: Partial<DataListProps>;
|
|
88
89
|
Dialog?: Partial<DialogProps>;
|
|
90
|
+
DatePicker?: Partial<DatePickerProps>;
|
|
89
91
|
Divider?: Partial<DividerProps>;
|
|
90
92
|
Drawer?: Partial<DrawerProps>;
|
|
91
93
|
FieldControl?: Partial<FieldControlProps>;
|
|
@@ -68,6 +68,10 @@ exports.ruRU = {
|
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
},
|
|
71
|
+
DatePicker: {
|
|
72
|
+
clearText: 'Очистить',
|
|
73
|
+
placeholder: 'ДД.ММ.ГГГГ',
|
|
74
|
+
},
|
|
71
75
|
},
|
|
72
76
|
};
|
|
73
77
|
exports.kkKZ = {
|
|
@@ -136,6 +140,10 @@ exports.kkKZ = {
|
|
|
136
140
|
},
|
|
137
141
|
},
|
|
138
142
|
},
|
|
143
|
+
DatePicker: {
|
|
144
|
+
clearText: 'Тазалау',
|
|
145
|
+
placeholder: 'КК.АА.ЖЖЖЖ',
|
|
146
|
+
},
|
|
139
147
|
},
|
|
140
148
|
};
|
|
141
149
|
exports.enUS = {
|
|
@@ -205,5 +213,9 @@ exports.enUS = {
|
|
|
205
213
|
},
|
|
206
214
|
},
|
|
207
215
|
},
|
|
216
|
+
DatePicker: {
|
|
217
|
+
clearText: 'Clear',
|
|
218
|
+
placeholder: 'DD.MM.YYYY',
|
|
219
|
+
},
|
|
208
220
|
},
|
|
209
221
|
};
|
|
@@ -2,6 +2,7 @@ import { __assign, __read, __rest, __spreadArray } from "tslib";
|
|
|
2
2
|
import './Autocomplete.css';
|
|
3
3
|
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { useControlled } from '../../hooks/useControlled';
|
|
5
|
+
import { useMultiRef } from '../../hooks/useMultiRef';
|
|
5
6
|
import { useMutableRef } from '../../hooks/useMutableRef';
|
|
6
7
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
7
8
|
import { cn } from '../../utils/classname';
|
|
@@ -17,8 +18,10 @@ function AutocompleteRender(inProps, ref) {
|
|
|
17
18
|
props: inProps,
|
|
18
19
|
name: 'Autocomplete',
|
|
19
20
|
});
|
|
20
|
-
var _a = withDefaultGetters(props), _b = _a.disabled, disabled = _b === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLED : _b, _c = _a.required, required = _c === void 0 ? AUTOCOMPLETE_DEFAULT_REQUIRED : _c, _d = _a.autoFocus, autoFocus = _d === void 0 ? AUTOCOMPLETE_DEFAULT_AUTOFOCUS : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? AUTOCOMPLETE_DEFAULT_FULLWIDTH : _e, _f = _a.size, size = _f === void 0 ? AUTOCOMPLETE_DEFAULT_SIZE : _f, _g = _a.allowCustomValue, allowCustomValue = _g === void 0 ? AUTOCOMPLETE_DEFAULT_ALLOW_CUSTOM_VALUE : _g, _h = _a.disableShowChevron, disableShowChevron = _h === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_CHEVRON : _h, _j = _a.disableClearButton, disableClearButton = _j === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLEAR_BUTTON : _j, _k = _a.disableShowEmptyOptionsList, disableShowEmptyOptionsList = _k === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_EMPTY_OPTIONS_LIST : _k, _l = _a.disableCloseOnSelect, disableCloseOnSelect = _l === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLOSE_ON_SELECT : _l, _m = _a.renderInput, renderInput = _m === void 0 ? function (props) { return React.createElement(Input, __assign({}, props, { ref: ref })); } : _m, searchFunctionProp = _a.searchFunction, renderOptionProp = _a.renderOption, inputValueProp = _a.inputValue, className = _a.className, valueProp = _a.value, options = _a.options, defaultValue = _a.defaultValue, error = _a.error, onChange = _a.onChange, onInputChange = _a.onInputChange, label = _a.label, placeholder = _a.placeholder, renderLeft = _a.renderLeft, renderRight = _a.renderRight, hint = _a.hint, getOptionKey = _a.getOptionKey, getOptionLabel = _a.getOptionLabel, getOptionDisabled = _a.getOptionDisabled, dataListProps = _a.dataListProps, onCloseProp = _a.onClose, onOpenProp = _a.onOpen, openProp = _a.open, defaultOpen = _a.defaultOpen, loading = _a.loading, inputProps = _a.inputProps, onKeyDown = _a.onKeyDown, noOptionsText = _a.noOptionsText, clearText = _a.clearText, openText = _a.openText, loadingText = _a.loadingText, closeText = _a.closeText, other = __rest(_a, ["disabled", "required", "autoFocus", "fullWidth", "size", "allowCustomValue", "disableShowChevron", "disableClearButton", "disableShowEmptyOptionsList", "disableCloseOnSelect", "renderInput", "searchFunction", "renderOption", "inputValue", "className", "value", "options", "defaultValue", "error", "onChange", "onInputChange", "label", "placeholder", "renderLeft", "renderRight", "hint", "getOptionKey", "getOptionLabel", "getOptionDisabled", "dataListProps", "onClose", "onOpen", "open", "defaultOpen", "loading", "inputProps", "onKeyDown", "noOptionsText", "clearText", "openText", "loadingText", "closeText"]);
|
|
21
|
+
var _a = withDefaultGetters(props), _b = _a.disabled, disabled = _b === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLED : _b, _c = _a.required, required = _c === void 0 ? AUTOCOMPLETE_DEFAULT_REQUIRED : _c, _d = _a.autoFocus, autoFocus = _d === void 0 ? AUTOCOMPLETE_DEFAULT_AUTOFOCUS : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? AUTOCOMPLETE_DEFAULT_FULLWIDTH : _e, _f = _a.size, size = _f === void 0 ? AUTOCOMPLETE_DEFAULT_SIZE : _f, _g = _a.allowCustomValue, allowCustomValue = _g === void 0 ? AUTOCOMPLETE_DEFAULT_ALLOW_CUSTOM_VALUE : _g, _h = _a.disableShowChevron, disableShowChevron = _h === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_CHEVRON : _h, _j = _a.disableClearButton, disableClearButton = _j === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLEAR_BUTTON : _j, _k = _a.disableShowEmptyOptionsList, disableShowEmptyOptionsList = _k === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_EMPTY_OPTIONS_LIST : _k, _l = _a.disableCloseOnSelect, disableCloseOnSelect = _l === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLOSE_ON_SELECT : _l, _m = _a.renderInput, renderInput = _m === void 0 ? function (props) { return React.createElement(Input, __assign({}, props, { ref: ref })); } : _m, searchFunctionProp = _a.searchFunction, renderOptionProp = _a.renderOption, inputValueProp = _a.inputValue, className = _a.className, valueProp = _a.value, options = _a.options, defaultValue = _a.defaultValue, error = _a.error, onChange = _a.onChange, onInputChange = _a.onInputChange, label = _a.label, placeholder = _a.placeholder, renderLeft = _a.renderLeft, renderRight = _a.renderRight, hint = _a.hint, getOptionKey = _a.getOptionKey, getOptionLabel = _a.getOptionLabel, getOptionDisabled = _a.getOptionDisabled, dataListProps = _a.dataListProps, onCloseProp = _a.onClose, onOpenProp = _a.onOpen, openProp = _a.open, defaultOpen = _a.defaultOpen, loading = _a.loading, inputProps = _a.inputProps, bodyProps = _a.bodyProps, onKeyDown = _a.onKeyDown, noOptionsText = _a.noOptionsText, clearText = _a.clearText, openText = _a.openText, loadingText = _a.loadingText, closeText = _a.closeText, other = __rest(_a, ["disabled", "required", "autoFocus", "fullWidth", "size", "allowCustomValue", "disableShowChevron", "disableClearButton", "disableShowEmptyOptionsList", "disableCloseOnSelect", "renderInput", "searchFunction", "renderOption", "inputValue", "className", "value", "options", "defaultValue", "error", "onChange", "onInputChange", "label", "placeholder", "renderLeft", "renderRight", "hint", "getOptionKey", "getOptionLabel", "getOptionDisabled", "dataListProps", "onClose", "onOpen", "open", "defaultOpen", "loading", "inputProps", "bodyProps", "onKeyDown", "noOptionsText", "clearText", "openText", "loadingText", "closeText"]);
|
|
21
22
|
var anchorRef = useRef(null);
|
|
23
|
+
var lastInputValue = useRef('');
|
|
24
|
+
var inputBodyRef = useMultiRef([anchorRef, bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref]);
|
|
22
25
|
var _o = __read(useControlled({
|
|
23
26
|
value: inputValueProp,
|
|
24
27
|
defaultValue: '',
|
|
@@ -51,47 +54,43 @@ function AutocompleteRender(inProps, ref) {
|
|
|
51
54
|
var showNoOptions = !hasOptions && !loading;
|
|
52
55
|
var showLoading = !hasOptions && !!loading;
|
|
53
56
|
var _s = __read(useState(undefined), 2), search = _s[0], setSearch = _s[1];
|
|
54
|
-
|
|
57
|
+
var changeInputValue = function (e, value) {
|
|
58
|
+
var _a;
|
|
59
|
+
setInputValue(value);
|
|
60
|
+
(_a = savedOnInputChange.current) === null || _a === void 0 ? void 0 : _a.call(savedOnInputChange, e, value);
|
|
61
|
+
};
|
|
62
|
+
var callOnChange = function (e, value) {
|
|
63
|
+
var inputValue = value ? getOptionLabel(value) : '';
|
|
64
|
+
setValueState(value);
|
|
65
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e, value);
|
|
66
|
+
changeInputValue(null, inputValue);
|
|
67
|
+
};
|
|
68
|
+
/** Эффект – фильтрация списка при изменении опций */
|
|
55
69
|
useEffect(function () {
|
|
56
|
-
if (!open)
|
|
70
|
+
if (!open)
|
|
57
71
|
return;
|
|
58
|
-
}
|
|
59
72
|
setFilteredOptions(search ? search(options) : __spreadArray([], __read(options), false));
|
|
60
73
|
}, [search, options, open, searchFunctionProp]);
|
|
61
74
|
/** Эффект – синхронизируем значение текстового поля со значением в списке */
|
|
62
75
|
useEffect(function () {
|
|
63
|
-
var _a
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
(
|
|
76
|
+
var _a;
|
|
77
|
+
if (allowCustomValue)
|
|
78
|
+
return;
|
|
79
|
+
lastInputValue.current = valueState
|
|
80
|
+
? (_a = savedGetOptionLabel.current) === null || _a === void 0 ? void 0 : _a.call(savedGetOptionLabel, valueState)
|
|
81
|
+
: '';
|
|
82
|
+
if (lastInputValue.current !== inputValue) {
|
|
83
|
+
changeInputValue(null, lastInputValue.current);
|
|
71
84
|
}
|
|
72
|
-
}, [valueState]);
|
|
85
|
+
}, [valueState, allowCustomValue]);
|
|
73
86
|
/** Эффект – автофокусировка в текстовом поле */
|
|
74
87
|
useEffect(function () {
|
|
75
88
|
var _a;
|
|
76
|
-
if (autoFocus)
|
|
89
|
+
if (autoFocus)
|
|
77
90
|
(_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
78
|
-
}
|
|
79
91
|
}, [autoFocus]);
|
|
80
|
-
/**
|
|
81
|
-
var
|
|
82
|
-
var _a;
|
|
83
|
-
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
84
|
-
if (allowCustomValue) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
var value = valueState ? getOptionLabel(valueState) : '';
|
|
88
|
-
if (inputValue !== value) {
|
|
89
|
-
setInputValue(value);
|
|
90
|
-
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(null, value);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
/** Ждем выполнения анимации на закрытие и делаем сброс */
|
|
94
|
-
var onExited = function () {
|
|
92
|
+
/** Ждём выполнения анимации на закрытие и делаем сброс функции фильтрации */
|
|
93
|
+
var handleExited = function () {
|
|
95
94
|
var _a;
|
|
96
95
|
setSearch(undefined);
|
|
97
96
|
(_a = dataListProps === null || dataListProps === void 0 ? void 0 : dataListProps.onExited) === null || _a === void 0 ? void 0 : _a.call(dataListProps);
|
|
@@ -110,21 +109,26 @@ function AutocompleteRender(inProps, ref) {
|
|
|
110
109
|
var handleToggle = function () {
|
|
111
110
|
if (disabled)
|
|
112
111
|
return;
|
|
113
|
-
if (open)
|
|
112
|
+
if (open)
|
|
114
113
|
handleClose();
|
|
115
|
-
|
|
116
|
-
else {
|
|
114
|
+
else
|
|
117
115
|
handleOpen();
|
|
118
|
-
}
|
|
119
116
|
};
|
|
120
117
|
/** Очистка поля */
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
setInputValue('');
|
|
124
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(e, null);
|
|
125
|
-
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(null, '');
|
|
118
|
+
var handleClear = function (e) {
|
|
119
|
+
callOnChange(e, null);
|
|
126
120
|
setSearch(undefined);
|
|
127
121
|
};
|
|
122
|
+
/** Актуализация значения текстового поля после его покидания */
|
|
123
|
+
var handleBlur = function (e) {
|
|
124
|
+
var _a;
|
|
125
|
+
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
126
|
+
if (allowCustomValue)
|
|
127
|
+
return;
|
|
128
|
+
if (inputValue !== lastInputValue.current) {
|
|
129
|
+
changeInputValue(null, lastInputValue.current);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
128
132
|
/** Открытие списка по клику на текстовом поле */
|
|
129
133
|
var handleClickOnInput = function (e) {
|
|
130
134
|
var _a;
|
|
@@ -132,49 +136,39 @@ function AutocompleteRender(inProps, ref) {
|
|
|
132
136
|
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onClick) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
133
137
|
};
|
|
134
138
|
/** Управление элементом контроля через клавиатуру */
|
|
135
|
-
var handleKeyDown = function (
|
|
136
|
-
if (isKeys(
|
|
137
|
-
|
|
139
|
+
var handleKeyDown = function (e) {
|
|
140
|
+
if (isKeys(e, ['ArrowDown', 'ArrowUp']) && !open) {
|
|
141
|
+
e.preventDefault();
|
|
138
142
|
handleToggle();
|
|
139
143
|
}
|
|
140
|
-
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(
|
|
144
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
141
145
|
};
|
|
142
146
|
/** Событие ввода значения в текстовом поле */
|
|
143
147
|
var handleChangeInput = function (e) {
|
|
144
148
|
var value = e.target.value;
|
|
145
149
|
// Открываем список при вводе первого символа (при условии, что список еще не открыт)
|
|
146
|
-
if (value.length && !open)
|
|
150
|
+
if (value.length && !open)
|
|
147
151
|
handleOpen();
|
|
152
|
+
if (value) {
|
|
153
|
+
changeInputValue(e, value);
|
|
148
154
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
setValueState(null);
|
|
152
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(e, null);
|
|
155
|
+
else {
|
|
156
|
+
callOnChange(e, null);
|
|
153
157
|
}
|
|
154
|
-
// Назначаем значение
|
|
155
|
-
setInputValue(value);
|
|
156
|
-
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(e, value);
|
|
157
158
|
// Задаем функцию фильтрации
|
|
158
159
|
setSearch(function () { return function (options) { return searchFunction(__spreadArray([], __read(options), false), value); }; });
|
|
159
160
|
};
|
|
160
161
|
/** Событие выбора значения из раскрывающегося списка */
|
|
161
|
-
var handleChangeDataList = function (
|
|
162
|
+
var handleChangeDataList = function (e, _a) {
|
|
162
163
|
var value = _a.value;
|
|
163
164
|
var selectedOption = filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.find(function (option) { return (getOptionKey === null || getOptionKey === void 0 ? void 0 : getOptionKey(option)) === value; });
|
|
164
|
-
|
|
165
|
-
var newInputValue = getOptionLabel(selectedOption);
|
|
166
|
-
setValueState(selectedOption);
|
|
167
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(event, selectedOption);
|
|
168
|
-
setInputValue(newInputValue);
|
|
169
|
-
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(null, newInputValue);
|
|
170
|
-
}
|
|
165
|
+
callOnChange(e, selectedOption || null);
|
|
171
166
|
// Закрываем список после выбора
|
|
172
|
-
if (!disableCloseOnSelect)
|
|
167
|
+
if (!disableCloseOnSelect)
|
|
173
168
|
handleClose();
|
|
174
|
-
}
|
|
175
169
|
};
|
|
176
170
|
/** Отображение текстового поля */
|
|
177
|
-
var input = renderInput(__assign(__assign({ size: size, hint: hint, disabled: disabled, label: label, required: required, error: error, fullWidth: fullWidth, placeholder: placeholder, renderLeft: renderLeft }, other), { renderRight: (React.createElement(AutocompleteRenderRight, { open: open, size: size, disabled: disabled, clearText: clearText, closeText: closeText, openText: openText, hasValue: !!inputValue, onClear:
|
|
171
|
+
var input = renderInput(__assign(__assign({ size: size, hint: hint, disabled: disabled, label: label, required: required, error: error, fullWidth: fullWidth, placeholder: placeholder, renderLeft: renderLeft }, other), { renderRight: (React.createElement(AutocompleteRenderRight, { open: open, size: size, disabled: disabled, clearText: clearText, closeText: closeText, openText: openText, hasValue: !!inputValue, onClear: handleClear, onOpen: handleToggle, renderRight: renderRight, disableShowChevron: disableShowChevron, disableClearButton: disableClearButton })), onChange: handleChangeInput, onKeyDown: handleKeyDown, value: inputValue || '', inputProps: __assign(__assign({}, inputProps), { onBlur: handleBlur, onClick: handleClickOnInput }), bodyProps: __assign(__assign({ 'aria-expanded': open }, bodyProps), { ref: inputBodyRef }), className: cnAutocomplete({ size: size, hasChevron: !disableShowChevron }, [
|
|
178
172
|
className,
|
|
179
173
|
]), ref: ref }));
|
|
180
174
|
/** Отображение опций */
|
|
@@ -191,7 +185,7 @@ function AutocompleteRender(inProps, ref) {
|
|
|
191
185
|
});
|
|
192
186
|
return (React.createElement(React.Fragment, null,
|
|
193
187
|
input,
|
|
194
|
-
React.createElement(DataList, __assign({ size: size, equalAnchorWidth: true, offset: [0, 4], placement: "bottom-start" }, dataListProps, { open: open,
|
|
188
|
+
React.createElement(DataList, __assign({ size: size, equalAnchorWidth: true, offset: [0, 4], placement: "bottom-start" }, dataListProps, { open: open, onClose: handleClose, anchorRef: anchorRef, onExited: handleExited, selected: dataListValue, onSelect: handleChangeDataList, listProps: __assign({ role: 'listbox' }, dataListProps === null || dataListProps === void 0 ? void 0 : dataListProps.listProps) }),
|
|
195
189
|
renderOptions,
|
|
196
190
|
!disableShowEmptyOptionsList && (React.createElement(AutocompleteNoOptions, { showNoOptions: showNoOptions, noOptionsText: noOptionsText })),
|
|
197
191
|
React.createElement(AutocompleteLoading, { showLoading: showLoading, loadingText: loadingText, size: size }))));
|
|
@@ -80,6 +80,9 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
80
80
|
} & {
|
|
81
81
|
'data-testid'?: string | undefined;
|
|
82
82
|
}) | undefined;
|
|
83
|
+
bodyProps?: (Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
84
|
+
ref?: ((instance: HTMLLabelElement | null) => void) | import("react").RefObject<HTMLLabelElement> | null | undefined;
|
|
85
|
+
}) | undefined;
|
|
83
86
|
hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
|
|
84
87
|
} & {
|
|
85
88
|
open?: boolean | undefined;
|
|
@@ -177,6 +180,9 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
177
180
|
} & {
|
|
178
181
|
'data-testid'?: string | undefined;
|
|
179
182
|
}) | undefined;
|
|
183
|
+
bodyProps?: (Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
184
|
+
ref?: ((instance: HTMLLabelElement | null) => void) | import("react").RefObject<HTMLLabelElement> | null | undefined;
|
|
185
|
+
}) | undefined;
|
|
180
186
|
hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
|
|
181
187
|
} & {
|
|
182
188
|
open?: undefined;
|
|
@@ -31,7 +31,7 @@ type AutocompleteOpenUncontrolledProps = {
|
|
|
31
31
|
/** Состояние открытие по умолчанию (неконтролируемый компонент) */
|
|
32
32
|
defaultOpen?: boolean;
|
|
33
33
|
};
|
|
34
|
-
type AutocompleteInputProps = Pick<InputProps, 'placeholder' | 'autoFocus' | 'fullWidth' | 'disabled' | 'label' | 'required' | 'style' | 'error' | 'hint' | 'renderLeft' | 'renderRight' | 'className' | 'inputProps' | 'hintProps' | 'onKeyDown'>;
|
|
34
|
+
type AutocompleteInputProps = Pick<InputProps, 'placeholder' | 'autoFocus' | 'fullWidth' | 'disabled' | 'label' | 'required' | 'style' | 'error' | 'hint' | 'renderLeft' | 'renderRight' | 'className' | 'inputProps' | 'hintProps' | 'bodyProps' | 'onKeyDown'>;
|
|
35
35
|
type AutocompleteDataListProps = Partial<Omit<DataListProps, 'onClose' | 'open' | 'anchorRef' | 'multiple' | 'selected' | 'onSelect'>>;
|
|
36
36
|
export type AutocompleteProps<OPTION = AutocompleteDefaultOption> = {
|
|
37
37
|
/** Список вариантов выбора (опции) */
|
|
@@ -6,7 +6,7 @@ import type { CALENDAR_DEFAULT_AS } from './constants';
|
|
|
6
6
|
export declare const calendarStepVariant: readonly ["days", "months", "years"];
|
|
7
7
|
export declare const calendarSizeVariant: readonly ["s", "m", "l"];
|
|
8
8
|
export type CalendarStepVariant = (typeof calendarStepVariant)[number];
|
|
9
|
-
export type CalendarOnChange = (date: Date) => void;
|
|
9
|
+
export type CalendarOnChange = (date: Date | null) => void;
|
|
10
10
|
export type CalendarOnOffsetDateChange = (date: Date) => void;
|
|
11
11
|
export type CalendarSizeVariant = (typeof calendarSizeVariant)[number];
|
|
12
12
|
export type CalendarExclude = DPExcludeConfig;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import './DatePicker.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { CalendarOnChange } from '../Calendar';
|
|
4
|
+
export declare const cnDatePicker: import("@bem-react/classname").ClassNameFormatter;
|
|
5
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<(Omit<{
|
|
6
|
+
value?: Date | null | undefined;
|
|
7
|
+
defaultValue?: Date | null | undefined;
|
|
8
|
+
onChange?: CalendarOnChange | undefined;
|
|
9
|
+
onInputChange?: import("./types").DatePickerOnInputChange | undefined;
|
|
10
|
+
onClose?: (() => void) | undefined;
|
|
11
|
+
onOpen?: (() => void) | undefined;
|
|
12
|
+
calendarProps?: import("../Calendar").CalendarBaseProps | undefined;
|
|
13
|
+
popoverProps?: import("../Popover").PopoverBaseProps | undefined;
|
|
14
|
+
clearText?: string | undefined;
|
|
15
|
+
disableClearButton?: boolean | undefined;
|
|
16
|
+
onError?: import("./types").DatePickerPropOnError | undefined;
|
|
17
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
18
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
19
|
+
}, "defaultValue" | "onChange" | "onError"> & Pick<import("../Calendar").CalendarBaseProps, "exclude" | "offsetDate" | "minDate" | "maxDate"> & Pick<import("../Input").InputProps, "label" | "onKeyDown" | "disabled" | "placeholder" | "required" | "size" | "error" | "fullWidth" | "hint" | "renderLeft" | "renderRight" | "inputProps"> & {
|
|
20
|
+
open?: boolean | undefined;
|
|
21
|
+
defaultOpen?: undefined;
|
|
22
|
+
}, "ref"> | Omit<{
|
|
23
|
+
value?: Date | null | undefined;
|
|
24
|
+
defaultValue?: Date | null | undefined;
|
|
25
|
+
onChange?: CalendarOnChange | undefined;
|
|
26
|
+
onInputChange?: import("./types").DatePickerOnInputChange | undefined;
|
|
27
|
+
onClose?: (() => void) | undefined;
|
|
28
|
+
onOpen?: (() => void) | undefined;
|
|
29
|
+
calendarProps?: import("../Calendar").CalendarBaseProps | undefined;
|
|
30
|
+
popoverProps?: import("../Popover").PopoverBaseProps | undefined;
|
|
31
|
+
clearText?: string | undefined;
|
|
32
|
+
disableClearButton?: boolean | undefined;
|
|
33
|
+
onError?: import("./types").DatePickerPropOnError | undefined;
|
|
34
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
35
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
36
|
+
}, "defaultValue" | "onChange" | "onError"> & Pick<import("../Calendar").CalendarBaseProps, "exclude" | "offsetDate" | "minDate" | "maxDate"> & Pick<import("../Input").InputProps, "label" | "onKeyDown" | "disabled" | "placeholder" | "required" | "size" | "error" | "fullWidth" | "hint" | "renderLeft" | "renderRight" | "inputProps"> & {
|
|
37
|
+
open?: undefined;
|
|
38
|
+
defaultOpen?: boolean | undefined;
|
|
39
|
+
}, "ref">) & React.RefAttributes<HTMLDivElement>>;
|