@alfalab/core-components-calendar-input 8.1.2 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm/Component.d.ts → Component-98dcf994.d.ts} +45 -6
- package/{Component.js → Component-98dcf994.js} +19 -29
- package/Component.desktop.d.ts +5 -0
- package/Component.desktop.js +22 -0
- package/Component.mobile.d.ts +5 -0
- package/Component.mobile.js +22 -0
- package/Component.responsive.d.ts +12 -0
- package/Component.responsive.js +32 -0
- package/components/calendar-input/Component.d.ts +0 -0
- package/components/calendar-input/Component.js +18 -0
- package/{esm → components/calendar-input}/index.css +11 -11
- package/components/calendar-input/index.d.ts +1 -0
- package/components/calendar-input/index.js +18 -0
- package/cssm/{Component.d.ts → Component-fde0c12c.d.ts} +45 -6
- package/cssm/{Component.js → Component-fde0c12c.js} +21 -31
- package/cssm/Component.desktop.d.ts +5 -0
- package/cssm/Component.desktop.js +23 -0
- package/cssm/Component.mobile.d.ts +5 -0
- package/cssm/Component.mobile.js +23 -0
- package/cssm/Component.responsive.d.ts +12 -0
- package/cssm/Component.responsive.js +33 -0
- package/cssm/components/calendar-input/Component.d.ts +0 -0
- package/cssm/components/calendar-input/Component.js +19 -0
- package/cssm/components/calendar-input/index.d.ts +1 -0
- package/cssm/components/calendar-input/index.js +19 -0
- package/cssm/{index.module.css → components/calendar-input/index.module.css} +0 -0
- package/cssm/desktop.d.ts +2 -0
- package/cssm/desktop.js +20 -0
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +8 -7
- package/cssm/mobile.d.ts +2 -0
- package/cssm/mobile.js +20 -0
- package/cssm/responsive.d.ts +2 -0
- package/cssm/responsive.js +23 -0
- package/cssm/utils.js +9 -11
- package/desktop.d.ts +2 -0
- package/desktop.js +19 -0
- package/{modern/Component.d.ts → esm/Component-8d1a1461.d.ts} +45 -6
- package/esm/{Component.js → Component-8d1a1461.js} +8 -17
- package/esm/Component.desktop.d.ts +5 -0
- package/esm/Component.desktop.js +16 -0
- package/esm/Component.mobile.d.ts +5 -0
- package/esm/Component.mobile.js +16 -0
- package/esm/Component.responsive.d.ts +12 -0
- package/esm/Component.responsive.js +26 -0
- package/esm/components/calendar-input/Component.d.ts +0 -0
- package/esm/components/calendar-input/Component.js +12 -0
- package/{index.css → esm/components/calendar-input/index.css} +11 -11
- package/esm/components/calendar-input/index.d.ts +1 -0
- package/esm/components/calendar-input/index.js +12 -0
- package/esm/desktop.d.ts +2 -0
- package/esm/desktop.js +13 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +6 -3
- package/esm/mobile.d.ts +2 -0
- package/esm/mobile.js +13 -0
- package/esm/responsive.d.ts +2 -0
- package/esm/responsive.js +16 -0
- package/esm/utils.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +7 -6
- package/mobile.d.ts +2 -0
- package/mobile.js +19 -0
- package/modern/Component.desktop.d.ts +5 -0
- package/modern/Component.desktop.js +16 -0
- package/modern/Component.mobile.d.ts +5 -0
- package/modern/Component.mobile.js +16 -0
- package/modern/Component.responsive.d.ts +12 -0
- package/modern/Component.responsive.js +25 -0
- package/{Component.d.ts → modern/components/calendar-input/Component.d.ts} +11 -5
- package/modern/{Component.js → components/calendar-input/Component.js} +5 -11
- package/modern/{index.css → components/calendar-input/index.css} +11 -11
- package/modern/components/calendar-input/index.d.ts +1 -0
- package/modern/components/calendar-input/index.js +12 -0
- package/modern/desktop.d.ts +2 -0
- package/modern/desktop.js +13 -0
- package/modern/index.d.ts +1 -1
- package/modern/index.js +6 -3
- package/modern/mobile.d.ts +2 -0
- package/modern/mobile.js +13 -0
- package/modern/responsive.d.ts +2 -0
- package/modern/responsive.js +16 -0
- package/modern/utils.js +2 -2
- package/package.json +4 -4
- package/responsive.d.ts +2 -0
- package/responsive.js +22 -0
- package/utils.js +9 -11
|
@@ -4,6 +4,39 @@ import { ChangeEvent, ElementType, MouseEvent } from "react";
|
|
|
4
4
|
import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
|
|
5
5
|
import { DateInputProps } from "@alfalab/core-components-date-input";
|
|
6
6
|
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
7
|
+
declare function __extends(d: any, b: any): void;
|
|
8
|
+
declare function __rest(s: any, e: any): {};
|
|
9
|
+
declare function __decorate(decorators: any, target: any, key: any, desc: any, ...args: any[]): any;
|
|
10
|
+
declare function __param(paramIndex: any, decorator: any): (target: any, key: any) => void;
|
|
11
|
+
declare function __metadata(metadataKey: any, metadataValue: any): any;
|
|
12
|
+
declare function __awaiter(thisArg: any, _arguments: any, P: any, generator: any): any;
|
|
13
|
+
declare function __generator(thisArg: any, body: any): {
|
|
14
|
+
next: (v: any) => any;
|
|
15
|
+
throw: (v: any) => any;
|
|
16
|
+
return: (v: any) => any;
|
|
17
|
+
};
|
|
18
|
+
declare function __exportStar(m: any, o: any): void;
|
|
19
|
+
declare function __values(o: any): any;
|
|
20
|
+
declare function __read(o: any, n: any): any;
|
|
21
|
+
declare function __spread(...args: any[]): any[];
|
|
22
|
+
declare function __spreadArrays(...args: any[]): any[];
|
|
23
|
+
declare function __spreadArray(to: any, from: any, pack: any, ...args: any[]): any;
|
|
24
|
+
declare function __await(v: any): __await;
|
|
25
|
+
declare class __await {
|
|
26
|
+
constructor(v: any);
|
|
27
|
+
v: any;
|
|
28
|
+
}
|
|
29
|
+
declare function __asyncGenerator(thisArg: any, _arguments: any, generator: any): {};
|
|
30
|
+
declare function __asyncDelegator(o: any): {};
|
|
31
|
+
declare function __asyncValues(o: any): any;
|
|
32
|
+
declare function __makeTemplateObject(cooked: any, raw: any): any;
|
|
33
|
+
declare function __importStar(mod: any): any;
|
|
34
|
+
declare function __importDefault(mod: any): any;
|
|
35
|
+
declare function __classPrivateFieldGet(receiver: any, state: any, kind: any, f: any): any;
|
|
36
|
+
declare function __classPrivateFieldSet(receiver: any, state: any, value: any, kind: any, f: any): any;
|
|
37
|
+
declare function __classPrivateFieldIn(state: any, receiver: any): any;
|
|
38
|
+
declare function __assign(...args: any[]): any;
|
|
39
|
+
declare function __createBinding(o: any, m: any, k: any, k2: any): void;
|
|
7
40
|
type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
|
|
8
41
|
/**
|
|
9
42
|
* Дополнительный класс
|
|
@@ -69,7 +102,7 @@ type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
|
|
|
69
102
|
/**
|
|
70
103
|
* Компонент календаря
|
|
71
104
|
*/
|
|
72
|
-
Calendar?: ElementType
|
|
105
|
+
Calendar?: ElementType;
|
|
73
106
|
/**
|
|
74
107
|
* Обработчик изменения значения
|
|
75
108
|
*/
|
|
@@ -100,6 +133,10 @@ type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
|
|
|
100
133
|
* Календарь будет принимать ширину инпута
|
|
101
134
|
*/
|
|
102
135
|
useAnchorWidth?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
138
|
+
*/
|
|
139
|
+
view?: 'desktop' | 'mobile';
|
|
103
140
|
};
|
|
104
141
|
declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps, "onChange" | "mobileMode"> & {
|
|
105
142
|
/**
|
|
@@ -119,9 +156,7 @@ declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps
|
|
|
119
156
|
*/
|
|
120
157
|
calendarProps?: (CalendarProps & Record<string, unknown>) | (CalendarProps & {
|
|
121
158
|
open: boolean;
|
|
122
|
-
title?: string | undefined;
|
|
123
|
-
* Дополнительный класс для поповера
|
|
124
|
-
*/
|
|
159
|
+
title?: string | undefined;
|
|
125
160
|
onClose?: (() => void) | undefined;
|
|
126
161
|
yearsAmount?: number | undefined;
|
|
127
162
|
hasHeader?: boolean | undefined;
|
|
@@ -175,7 +210,7 @@ declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps
|
|
|
175
210
|
/**
|
|
176
211
|
* Компонент календаря
|
|
177
212
|
*/
|
|
178
|
-
Calendar?: React.ElementType<
|
|
213
|
+
Calendar?: React.ElementType<any> | undefined;
|
|
179
214
|
/**
|
|
180
215
|
* Обработчик изменения значения
|
|
181
216
|
*/
|
|
@@ -206,5 +241,9 @@ declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps
|
|
|
206
241
|
* Календарь будет принимать ширину инпута
|
|
207
242
|
*/
|
|
208
243
|
useAnchorWidth?: boolean | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
246
|
+
*/
|
|
247
|
+
view?: "desktop" | "mobile" | undefined;
|
|
209
248
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
210
|
-
export { CalendarInputProps, CalendarInput };
|
|
249
|
+
export { __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __assign, __createBinding, CalendarInputProps, CalendarInput };
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
var mergeRefs = require('react-merge-refs');
|
|
7
5
|
var cn = require('classnames');
|
|
8
6
|
var coreComponentsCalendar = require('@alfalab/core-components-calendar');
|
|
9
7
|
var coreComponentsDateInput = require('@alfalab/core-components-date-input');
|
|
10
8
|
var coreComponentsPopover = require('@alfalab/core-components-popover');
|
|
11
|
-
var hooks = require('@alfalab/hooks');
|
|
12
9
|
var CalendarMIcon = require('@alfalab/icons-glyph/CalendarMIcon');
|
|
13
|
-
require('date-fns/format');
|
|
14
|
-
require('date-fns/isSameDay');
|
|
15
|
-
require('date-fns/parse');
|
|
16
10
|
var utils = require('./utils.js');
|
|
17
11
|
|
|
18
|
-
function
|
|
12
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
19
13
|
|
|
20
|
-
var React__default = /*#__PURE__*/
|
|
21
|
-
var mergeRefs__default = /*#__PURE__*/
|
|
22
|
-
var cn__default = /*#__PURE__*/
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
+
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
16
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
23
17
|
|
|
24
18
|
/******************************************************************************
|
|
25
19
|
Copyright (c) Microsoft Corporation.
|
|
@@ -35,8 +29,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
35
29
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
36
30
|
PERFORMANCE OF THIS SOFTWARE.
|
|
37
31
|
***************************************************************************** */
|
|
38
|
-
|
|
39
|
-
__assign = Object.assign || function __assign(t) {
|
|
32
|
+
exports.__assign = function () {
|
|
33
|
+
exports.__assign = Object.assign || function __assign(t) {
|
|
40
34
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
41
35
|
s = arguments[i];
|
|
42
36
|
for (var p in s)
|
|
@@ -45,7 +39,7 @@ var __assign = function () {
|
|
|
45
39
|
}
|
|
46
40
|
return t;
|
|
47
41
|
};
|
|
48
|
-
return __assign.apply(this, arguments);
|
|
42
|
+
return exports.__assign.apply(this, arguments);
|
|
49
43
|
};
|
|
50
44
|
function __rest(s, e) {
|
|
51
45
|
var t = {};
|
|
@@ -60,25 +54,20 @@ function __rest(s, e) {
|
|
|
60
54
|
return t;
|
|
61
55
|
}
|
|
62
56
|
|
|
63
|
-
var styles = {"component":"calendar-
|
|
64
|
-
require('./index.css')
|
|
57
|
+
var styles = {"component":"calendar-input__component_wpjcj","block":"calendar-input__block_wpjcj","calendarContainer":"calendar-input__calendarContainer_wpjcj","calendarResponsive":"calendar-input__calendarResponsive_wpjcj","calendarIcon":"calendar-input__calendarIcon_wpjcj","nativeInput":"calendar-input__nativeInput_wpjcj"};
|
|
58
|
+
require('./components/calendar-input/index.css')
|
|
65
59
|
|
|
66
60
|
var CalendarInput = React.forwardRef(function (_a, ref) {
|
|
67
61
|
var _b, _c;
|
|
68
62
|
var _d;
|
|
69
|
-
var _e = _a.block, block = _e === void 0 ? false : _e, className = _a.className
|
|
70
|
-
var view = hooks.useMedia([
|
|
71
|
-
['mobile', '(max-width: 1023px)'],
|
|
72
|
-
['desktop', '(min-width: 1024px)'],
|
|
73
|
-
], 'desktop')[0];
|
|
74
|
-
var CalendarComponent = view === 'desktop' ? Calendar : coreComponentsCalendar.CalendarMobile;
|
|
63
|
+
var _e = _a.block, block = _e === void 0 ? false : _e, className = _a.className; _a.inputClassName; var popoverClassName = _a.popoverClassName, _f = _a.defaultOpen, defaultOpen = _f === void 0 ? false : _f, defaultMonth = _a.defaultMonth, _g = _a.defaultValue, defaultValue = _g === void 0 ? '' : _g, _h = _a.calendarPosition, calendarPosition = _h === void 0 ? 'popover' : _h, value = _a.value, dataTestId = _a.dataTestId, _j = _a.calendarProps, calendarProps = _j === void 0 ? {} : _j, _k = _a.minDate, minDate = _k === void 0 ? calendarProps.minDate : _k, _l = _a.maxDate, maxDate = _l === void 0 ? calendarProps.maxDate : _l, _m = _a.offDays, offDays = _m === void 0 ? calendarProps.offDays || [] : _m, _o = _a.events, events = _o === void 0 ? calendarProps.events || [] : _o, preventFlip = _a.preventFlip, _p = _a.mobileMode, mobileMode = _p === void 0 ? 'popover' : _p, _q = _a.wrapperRef, wrapperRef = _q === void 0 ? null : _q, disabled = _a.disabled, _r = _a.onChange, onChange = _r === void 0 ? function () { return null; } : _r, onInputChange = _a.onInputChange, onCalendarChange = _a.onCalendarChange, onKeyDown = _a.onKeyDown, readOnly = _a.readOnly, _s = _a.Calendar, Calendar = _s === void 0 ? coreComponentsCalendar.Calendar : _s, _t = _a.popoverPosition, popoverPosition = _t === void 0 ? 'bottom-start' : _t, zIndexPopover = _a.zIndexPopover, useAnchorWidth = _a.useAnchorWidth, rightAddons = _a.rightAddons, error = _a.error, _u = _a.view, view = _u === void 0 ? 'desktop' : _u, restProps = __rest(_a, ["block", "className", "inputClassName", "popoverClassName", "defaultOpen", "defaultMonth", "defaultValue", "calendarPosition", "value", "dataTestId", "calendarProps", "minDate", "maxDate", "offDays", "events", "preventFlip", "mobileMode", "wrapperRef", "disabled", "onChange", "onInputChange", "onCalendarChange", "onKeyDown", "readOnly", "Calendar", "popoverPosition", "zIndexPopover", "useAnchorWidth", "rightAddons", "error", "view"]);
|
|
75
64
|
var calendarResponsive = (_d = calendarProps === null || calendarProps === void 0 ? void 0 : calendarProps.responsive) !== null && _d !== void 0 ? _d : true;
|
|
76
65
|
var shouldRenderNative = utils.SUPPORTS_INPUT_TYPE_DATE && mobileMode === 'native';
|
|
77
66
|
var shouldRenderOnlyInput = mobileMode === 'input';
|
|
78
67
|
var shouldRenderStatic = calendarPosition === 'static' && !shouldRenderOnlyInput;
|
|
79
68
|
var shouldRenderPopover = calendarPosition === 'popover' && !shouldRenderNative && !shouldRenderOnlyInput;
|
|
80
|
-
var
|
|
81
|
-
var
|
|
69
|
+
var _v = React.useState(false), open = _v[0], setOpen = _v[1];
|
|
70
|
+
var _w = React.useState(value || defaultValue), inputValue = _w[0], setInputValue = _w[1];
|
|
82
71
|
var calendarValue = inputValue ? coreComponentsDateInput.parseDateString(inputValue).getTime() : undefined;
|
|
83
72
|
var checkInputValueIsValid = React.useCallback(function (newInputValue) {
|
|
84
73
|
if (!newInputValue)
|
|
@@ -170,20 +159,21 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
|
|
|
170
159
|
}, [value]);
|
|
171
160
|
var renderCalendar = function () { return (
|
|
172
161
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
173
|
-
React__default
|
|
174
|
-
React__default
|
|
162
|
+
React__default.default.createElement("div", { onMouseDown: handleCalendarWrapperMouseDown },
|
|
163
|
+
React__default.default.createElement(Calendar, exports.__assign({}, calendarProps, { responsive: calendarResponsive, open: open, onClose: handleCalendarClose, ref: calendarRef, defaultMonth: defaultMonth, value: checkInputValueIsValid(inputValue) ? calendarValue : undefined, onChange: handleCalendarChange, minDate: minDate, maxDate: maxDate, offDays: offDays, events: events })))); };
|
|
175
164
|
return (
|
|
176
165
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
177
|
-
React__default
|
|
166
|
+
React__default.default.createElement("div", { className: cn__default.default(styles.component, className, (_b = {},
|
|
178
167
|
_b[styles.block] = block,
|
|
179
168
|
_b)), tabIndex: -1, onKeyDown: inputDisabled ? undefined : handleKeyDown, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : handleFocus, onBlur: handleBlur, "data-test-id": dataTestId },
|
|
180
|
-
React__default
|
|
169
|
+
React__default.default.createElement(coreComponentsDateInput.DateInput, exports.__assign({}, restProps, { ref: ref, wrapperRef: mergeRefs__default.default([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
181
170
|
rightAddons,
|
|
182
|
-
shouldRenderPopover && (React__default
|
|
171
|
+
shouldRenderPopover && (React__default.default.createElement(CalendarMIcon.CalendarMIcon, { className: styles.calendarIcon }))), onKeyDown: handleInputKeyDown, onChange: handleInputChange, block: true })),
|
|
183
172
|
shouldRenderStatic && renderCalendar(),
|
|
184
|
-
shouldRenderPopover && (React__default
|
|
173
|
+
shouldRenderPopover && (React__default.default.createElement(coreComponentsPopover.Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputWrapperRef.current, popperClassName: cn__default.default(styles.calendarContainer, (_c = {},
|
|
185
174
|
_c[styles.calendarResponsive] = calendarResponsive,
|
|
186
175
|
_c)), className: popoverClassName, position: popoverPosition, offset: [0, 4], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar()))));
|
|
187
176
|
});
|
|
188
177
|
|
|
189
178
|
exports.CalendarInput = CalendarInput;
|
|
179
|
+
exports.__rest = __rest;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarInputProps } from "./Component-98dcf994";
|
|
3
|
+
type CalendarInputDesktopProps = Omit<CalendarInputProps, 'view'>;
|
|
4
|
+
declare const CalendarInputDesktop: FC<CalendarInputDesktopProps>;
|
|
5
|
+
export { CalendarInputDesktopProps, CalendarInputDesktop };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_calendarInput_Component = require('./Component-98dcf994.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
require('react-merge-refs');
|
|
6
|
+
require('classnames');
|
|
7
|
+
require('@alfalab/core-components-calendar');
|
|
8
|
+
require('@alfalab/core-components-date-input');
|
|
9
|
+
require('@alfalab/core-components-popover');
|
|
10
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
11
|
+
require('./utils.js');
|
|
12
|
+
require('date-fns/format');
|
|
13
|
+
require('date-fns/isSameDay');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
|
+
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
19
|
+
|
|
20
|
+
var CalendarInputDesktop = function (props) { return (React__default.default.createElement(components_calendarInput_Component.CalendarInput, components_calendarInput_Component.__assign({}, props))); };
|
|
21
|
+
|
|
22
|
+
exports.CalendarInputDesktop = CalendarInputDesktop;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarInputProps } from "./Component-98dcf994";
|
|
3
|
+
type CalendarInputMobileProps = Omit<CalendarInputProps, 'view'>;
|
|
4
|
+
declare const CalendarInputMobile: FC<CalendarInputMobileProps>;
|
|
5
|
+
export { CalendarInputMobileProps, CalendarInputMobile };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_calendarInput_Component = require('./Component-98dcf994.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var coreComponentsCalendar = require('@alfalab/core-components-calendar');
|
|
6
|
+
require('react-merge-refs');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('@alfalab/core-components-date-input');
|
|
9
|
+
require('@alfalab/core-components-popover');
|
|
10
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
11
|
+
require('./utils.js');
|
|
12
|
+
require('date-fns/format');
|
|
13
|
+
require('date-fns/isSameDay');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
|
+
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
19
|
+
|
|
20
|
+
var CalendarInputMobile = function (props) { return (React__default.default.createElement(components_calendarInput_Component.CalendarInput, components_calendarInput_Component.__assign({ Calendar: coreComponentsCalendar.CalendarMobile, view: 'mobile' }, props))); };
|
|
21
|
+
|
|
22
|
+
exports.CalendarInputMobile = CalendarInputMobile;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarInputProps } from "./Component-98dcf994";
|
|
3
|
+
type CalendarInputResponsiveProps = Omit<CalendarInputProps, 'view'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
6
|
+
* @default 1024
|
|
7
|
+
*/
|
|
8
|
+
breakpoint?: number;
|
|
9
|
+
};
|
|
10
|
+
type CalendarInputMedia = 'desktop' | 'mobile';
|
|
11
|
+
declare const CalendarInputResponsive: FC<CalendarInputResponsiveProps>;
|
|
12
|
+
export { CalendarInputResponsiveProps, CalendarInputMedia, CalendarInputResponsive };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_calendarInput_Component = require('./Component-98dcf994.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var hooks = require('@alfalab/hooks');
|
|
6
|
+
var Component_desktop = require('./Component.desktop.js');
|
|
7
|
+
var Component_mobile = require('./Component.mobile.js');
|
|
8
|
+
require('react-merge-refs');
|
|
9
|
+
require('classnames');
|
|
10
|
+
require('@alfalab/core-components-calendar');
|
|
11
|
+
require('@alfalab/core-components-date-input');
|
|
12
|
+
require('@alfalab/core-components-popover');
|
|
13
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
14
|
+
require('./utils.js');
|
|
15
|
+
require('date-fns/format');
|
|
16
|
+
require('date-fns/isSameDay');
|
|
17
|
+
require('date-fns/parse');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
|
+
|
|
21
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
22
|
+
|
|
23
|
+
var CalendarInputResponsive = function (_a) {
|
|
24
|
+
var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = components_calendarInput_Component.__rest(_a, ["breakpoint"]);
|
|
25
|
+
var view = hooks.useMedia([
|
|
26
|
+
['mobile', "(max-width: ".concat(breakpoint - 1, "px)")],
|
|
27
|
+
['desktop', "(min-width: ".concat(breakpoint, "px)")],
|
|
28
|
+
], 'desktop')[0];
|
|
29
|
+
return view === 'desktop' ? (React__default.default.createElement(Component_desktop.CalendarInputDesktop, components_calendarInput_Component.__assign({}, restProps))) : (React__default.default.createElement(Component_mobile.CalendarInputMobile, components_calendarInput_Component.__assign({}, restProps)));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.CalendarInputResponsive = CalendarInputResponsive;
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_calendarInput_Component = require('../../Component-98dcf994.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('react-merge-refs');
|
|
6
|
+
require('classnames');
|
|
7
|
+
require('@alfalab/core-components-calendar');
|
|
8
|
+
require('@alfalab/core-components-date-input');
|
|
9
|
+
require('@alfalab/core-components-popover');
|
|
10
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
11
|
+
require('../../utils.js');
|
|
12
|
+
require('date-fns/format');
|
|
13
|
+
require('date-fns/isSameDay');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.CalendarInput = components_calendarInput_Component.CalendarInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1yw0a */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-graphic-primary: #0b1f35;
|
|
4
4
|
}
|
|
@@ -44,39 +44,39 @@
|
|
|
44
44
|
--calendar-input-icon-color: var(--color-light-graphic-primary);
|
|
45
45
|
--calendar-input-popover-border-radius: var(--border-radius-m);
|
|
46
46
|
}
|
|
47
|
-
.calendar-
|
|
47
|
+
.calendar-input__component_wpjcj {
|
|
48
48
|
display: inline-block;
|
|
49
49
|
outline: none;
|
|
50
50
|
position: relative;
|
|
51
51
|
}
|
|
52
|
-
.calendar-
|
|
52
|
+
.calendar-input__block_wpjcj {
|
|
53
53
|
width: 100%;
|
|
54
54
|
}
|
|
55
|
-
.calendar-
|
|
55
|
+
.calendar-input__calendarContainer_wpjcj {
|
|
56
56
|
display: inline-block;
|
|
57
57
|
box-sizing: border-box;
|
|
58
58
|
border-radius: var(--calendar-input-popover-border-radius)
|
|
59
59
|
}
|
|
60
60
|
@media (max-width: 374px) {
|
|
61
|
-
.calendar-
|
|
61
|
+
.calendar-input__calendarContainer_wpjcj {
|
|
62
62
|
width: 100%;
|
|
63
63
|
min-width: 288px
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
.calendar-
|
|
66
|
+
.calendar-input__calendarResponsive_wpjcj {
|
|
67
67
|
width: var(--calendar-width);
|
|
68
68
|
padding: 0 var(--gap-m);
|
|
69
69
|
}
|
|
70
|
-
.calendar-
|
|
70
|
+
.calendar-input__calendarIcon_wpjcj {
|
|
71
71
|
width: 24px;
|
|
72
72
|
height: 24px;
|
|
73
73
|
display: block;
|
|
74
74
|
color: var(--calendar-input-icon-color)
|
|
75
75
|
}
|
|
76
|
-
.calendar-
|
|
76
|
+
.calendar-input__calendarIcon_wpjcj:not(:only-child) {
|
|
77
77
|
margin-right: var(--gap-2xs);
|
|
78
78
|
}
|
|
79
|
-
.calendar-
|
|
79
|
+
.calendar-input__nativeInput_wpjcj {
|
|
80
80
|
opacity: 0;
|
|
81
81
|
position: absolute;
|
|
82
82
|
top: 0;
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
appearance: none;
|
|
88
88
|
z-index: 1
|
|
89
89
|
}
|
|
90
|
-
.calendar-
|
|
90
|
+
.calendar-input__nativeInput_wpjcj::-webkit-calendar-picker-indicator {
|
|
91
91
|
display: none;
|
|
92
92
|
}
|
|
93
|
-
.calendar-
|
|
93
|
+
.calendar-input__nativeInput_wpjcj::-webkit-inner-spin-button {
|
|
94
94
|
display: none;
|
|
95
95
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../Component-98dcf994";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_calendarInput_Component = require('../../Component-98dcf994.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('react-merge-refs');
|
|
6
|
+
require('classnames');
|
|
7
|
+
require('@alfalab/core-components-calendar');
|
|
8
|
+
require('@alfalab/core-components-date-input');
|
|
9
|
+
require('@alfalab/core-components-popover');
|
|
10
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
11
|
+
require('../../utils.js');
|
|
12
|
+
require('date-fns/format');
|
|
13
|
+
require('date-fns/isSameDay');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.CalendarInput = components_calendarInput_Component.CalendarInput;
|
|
@@ -4,6 +4,39 @@ import { ChangeEvent, ElementType, MouseEvent } from "react";
|
|
|
4
4
|
import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
|
|
5
5
|
import { DateInputProps } from "@alfalab/core-components-date-input";
|
|
6
6
|
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
7
|
+
declare function __extends(d: any, b: any): void;
|
|
8
|
+
declare function __rest(s: any, e: any): {};
|
|
9
|
+
declare function __decorate(decorators: any, target: any, key: any, desc: any, ...args: any[]): any;
|
|
10
|
+
declare function __param(paramIndex: any, decorator: any): (target: any, key: any) => void;
|
|
11
|
+
declare function __metadata(metadataKey: any, metadataValue: any): any;
|
|
12
|
+
declare function __awaiter(thisArg: any, _arguments: any, P: any, generator: any): any;
|
|
13
|
+
declare function __generator(thisArg: any, body: any): {
|
|
14
|
+
next: (v: any) => any;
|
|
15
|
+
throw: (v: any) => any;
|
|
16
|
+
return: (v: any) => any;
|
|
17
|
+
};
|
|
18
|
+
declare function __exportStar(m: any, o: any): void;
|
|
19
|
+
declare function __values(o: any): any;
|
|
20
|
+
declare function __read(o: any, n: any): any;
|
|
21
|
+
declare function __spread(...args: any[]): any[];
|
|
22
|
+
declare function __spreadArrays(...args: any[]): any[];
|
|
23
|
+
declare function __spreadArray(to: any, from: any, pack: any, ...args: any[]): any;
|
|
24
|
+
declare function __await(v: any): __await;
|
|
25
|
+
declare class __await {
|
|
26
|
+
constructor(v: any);
|
|
27
|
+
v: any;
|
|
28
|
+
}
|
|
29
|
+
declare function __asyncGenerator(thisArg: any, _arguments: any, generator: any): {};
|
|
30
|
+
declare function __asyncDelegator(o: any): {};
|
|
31
|
+
declare function __asyncValues(o: any): any;
|
|
32
|
+
declare function __makeTemplateObject(cooked: any, raw: any): any;
|
|
33
|
+
declare function __importStar(mod: any): any;
|
|
34
|
+
declare function __importDefault(mod: any): any;
|
|
35
|
+
declare function __classPrivateFieldGet(receiver: any, state: any, kind: any, f: any): any;
|
|
36
|
+
declare function __classPrivateFieldSet(receiver: any, state: any, value: any, kind: any, f: any): any;
|
|
37
|
+
declare function __classPrivateFieldIn(state: any, receiver: any): any;
|
|
38
|
+
declare function __assign(...args: any[]): any;
|
|
39
|
+
declare function __createBinding(o: any, m: any, k: any, k2: any): void;
|
|
7
40
|
type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
|
|
8
41
|
/**
|
|
9
42
|
* Дополнительный класс
|
|
@@ -69,7 +102,7 @@ type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
|
|
|
69
102
|
/**
|
|
70
103
|
* Компонент календаря
|
|
71
104
|
*/
|
|
72
|
-
Calendar?: ElementType
|
|
105
|
+
Calendar?: ElementType;
|
|
73
106
|
/**
|
|
74
107
|
* Обработчик изменения значения
|
|
75
108
|
*/
|
|
@@ -100,6 +133,10 @@ type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
|
|
|
100
133
|
* Календарь будет принимать ширину инпута
|
|
101
134
|
*/
|
|
102
135
|
useAnchorWidth?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
138
|
+
*/
|
|
139
|
+
view?: 'desktop' | 'mobile';
|
|
103
140
|
};
|
|
104
141
|
declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps, "onChange" | "mobileMode"> & {
|
|
105
142
|
/**
|
|
@@ -119,9 +156,7 @@ declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps
|
|
|
119
156
|
*/
|
|
120
157
|
calendarProps?: (CalendarProps & Record<string, unknown>) | (CalendarProps & {
|
|
121
158
|
open: boolean;
|
|
122
|
-
title?: string | undefined;
|
|
123
|
-
* Дополнительный класс для поповера
|
|
124
|
-
*/
|
|
159
|
+
title?: string | undefined;
|
|
125
160
|
onClose?: (() => void) | undefined;
|
|
126
161
|
yearsAmount?: number | undefined;
|
|
127
162
|
hasHeader?: boolean | undefined;
|
|
@@ -175,7 +210,7 @@ declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps
|
|
|
175
210
|
/**
|
|
176
211
|
* Компонент календаря
|
|
177
212
|
*/
|
|
178
|
-
Calendar?: React.ElementType<
|
|
213
|
+
Calendar?: React.ElementType<any> | undefined;
|
|
179
214
|
/**
|
|
180
215
|
* Обработчик изменения значения
|
|
181
216
|
*/
|
|
@@ -206,5 +241,9 @@ declare const CalendarInput: React.ForwardRefExoticComponent<Omit<DateInputProps
|
|
|
206
241
|
* Календарь будет принимать ширину инпута
|
|
207
242
|
*/
|
|
208
243
|
useAnchorWidth?: boolean | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
246
|
+
*/
|
|
247
|
+
view?: "desktop" | "mobile" | undefined;
|
|
209
248
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
210
|
-
export { CalendarInputProps, CalendarInput };
|
|
249
|
+
export { __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __assign, __createBinding, CalendarInputProps, CalendarInput };
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
var mergeRefs = require('react-merge-refs');
|
|
7
5
|
var cn = require('classnames');
|
|
8
6
|
var coreComponentsCalendar = require('@alfalab/core-components-calendar/cssm');
|
|
9
7
|
var coreComponentsDateInput = require('@alfalab/core-components-date-input/cssm');
|
|
10
8
|
var coreComponentsPopover = require('@alfalab/core-components-popover/cssm');
|
|
11
|
-
var hooks = require('@alfalab/hooks');
|
|
12
9
|
var CalendarMIcon = require('@alfalab/icons-glyph/CalendarMIcon');
|
|
13
|
-
require('date-fns/format');
|
|
14
|
-
require('date-fns/isSameDay');
|
|
15
|
-
require('date-fns/parse');
|
|
16
10
|
var utils = require('./utils.js');
|
|
17
|
-
var styles = require('./index.module.css');
|
|
11
|
+
var styles = require('./components/calendar-input/index.module.css');
|
|
18
12
|
|
|
19
|
-
function
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
14
|
|
|
21
|
-
var React__default = /*#__PURE__*/
|
|
22
|
-
var mergeRefs__default = /*#__PURE__*/
|
|
23
|
-
var cn__default = /*#__PURE__*/
|
|
24
|
-
var styles__default = /*#__PURE__*/
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
|
+
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
17
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
18
|
+
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
25
19
|
|
|
26
20
|
/******************************************************************************
|
|
27
21
|
Copyright (c) Microsoft Corporation.
|
|
@@ -37,8 +31,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
37
31
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
38
32
|
PERFORMANCE OF THIS SOFTWARE.
|
|
39
33
|
***************************************************************************** */
|
|
40
|
-
|
|
41
|
-
__assign = Object.assign || function __assign(t) {
|
|
34
|
+
exports.__assign = function () {
|
|
35
|
+
exports.__assign = Object.assign || function __assign(t) {
|
|
42
36
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
43
37
|
s = arguments[i];
|
|
44
38
|
for (var p in s)
|
|
@@ -47,7 +41,7 @@ var __assign = function () {
|
|
|
47
41
|
}
|
|
48
42
|
return t;
|
|
49
43
|
};
|
|
50
|
-
return __assign.apply(this, arguments);
|
|
44
|
+
return exports.__assign.apply(this, arguments);
|
|
51
45
|
};
|
|
52
46
|
function __rest(s, e) {
|
|
53
47
|
var t = {};
|
|
@@ -65,19 +59,14 @@ function __rest(s, e) {
|
|
|
65
59
|
var CalendarInput = React.forwardRef(function (_a, ref) {
|
|
66
60
|
var _b, _c;
|
|
67
61
|
var _d;
|
|
68
|
-
var _e = _a.block, block = _e === void 0 ? false : _e, className = _a.className
|
|
69
|
-
var view = hooks.useMedia([
|
|
70
|
-
['mobile', '(max-width: 1023px)'],
|
|
71
|
-
['desktop', '(min-width: 1024px)'],
|
|
72
|
-
], 'desktop')[0];
|
|
73
|
-
var CalendarComponent = view === 'desktop' ? Calendar : coreComponentsCalendar.CalendarMobile;
|
|
62
|
+
var _e = _a.block, block = _e === void 0 ? false : _e, className = _a.className; _a.inputClassName; var popoverClassName = _a.popoverClassName, _f = _a.defaultOpen, defaultOpen = _f === void 0 ? false : _f, defaultMonth = _a.defaultMonth, _g = _a.defaultValue, defaultValue = _g === void 0 ? '' : _g, _h = _a.calendarPosition, calendarPosition = _h === void 0 ? 'popover' : _h, value = _a.value, dataTestId = _a.dataTestId, _j = _a.calendarProps, calendarProps = _j === void 0 ? {} : _j, _k = _a.minDate, minDate = _k === void 0 ? calendarProps.minDate : _k, _l = _a.maxDate, maxDate = _l === void 0 ? calendarProps.maxDate : _l, _m = _a.offDays, offDays = _m === void 0 ? calendarProps.offDays || [] : _m, _o = _a.events, events = _o === void 0 ? calendarProps.events || [] : _o, preventFlip = _a.preventFlip, _p = _a.mobileMode, mobileMode = _p === void 0 ? 'popover' : _p, _q = _a.wrapperRef, wrapperRef = _q === void 0 ? null : _q, disabled = _a.disabled, _r = _a.onChange, onChange = _r === void 0 ? function () { return null; } : _r, onInputChange = _a.onInputChange, onCalendarChange = _a.onCalendarChange, onKeyDown = _a.onKeyDown, readOnly = _a.readOnly, _s = _a.Calendar, Calendar = _s === void 0 ? coreComponentsCalendar.Calendar : _s, _t = _a.popoverPosition, popoverPosition = _t === void 0 ? 'bottom-start' : _t, zIndexPopover = _a.zIndexPopover, useAnchorWidth = _a.useAnchorWidth, rightAddons = _a.rightAddons, error = _a.error, _u = _a.view, view = _u === void 0 ? 'desktop' : _u, restProps = __rest(_a, ["block", "className", "inputClassName", "popoverClassName", "defaultOpen", "defaultMonth", "defaultValue", "calendarPosition", "value", "dataTestId", "calendarProps", "minDate", "maxDate", "offDays", "events", "preventFlip", "mobileMode", "wrapperRef", "disabled", "onChange", "onInputChange", "onCalendarChange", "onKeyDown", "readOnly", "Calendar", "popoverPosition", "zIndexPopover", "useAnchorWidth", "rightAddons", "error", "view"]);
|
|
74
63
|
var calendarResponsive = (_d = calendarProps === null || calendarProps === void 0 ? void 0 : calendarProps.responsive) !== null && _d !== void 0 ? _d : true;
|
|
75
64
|
var shouldRenderNative = utils.SUPPORTS_INPUT_TYPE_DATE && mobileMode === 'native';
|
|
76
65
|
var shouldRenderOnlyInput = mobileMode === 'input';
|
|
77
66
|
var shouldRenderStatic = calendarPosition === 'static' && !shouldRenderOnlyInput;
|
|
78
67
|
var shouldRenderPopover = calendarPosition === 'popover' && !shouldRenderNative && !shouldRenderOnlyInput;
|
|
79
|
-
var
|
|
80
|
-
var
|
|
68
|
+
var _v = React.useState(false), open = _v[0], setOpen = _v[1];
|
|
69
|
+
var _w = React.useState(value || defaultValue), inputValue = _w[0], setInputValue = _w[1];
|
|
81
70
|
var calendarValue = inputValue ? coreComponentsDateInput.parseDateString(inputValue).getTime() : undefined;
|
|
82
71
|
var checkInputValueIsValid = React.useCallback(function (newInputValue) {
|
|
83
72
|
if (!newInputValue)
|
|
@@ -169,20 +158,21 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
|
|
|
169
158
|
}, [value]);
|
|
170
159
|
var renderCalendar = function () { return (
|
|
171
160
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
172
|
-
React__default
|
|
173
|
-
React__default
|
|
161
|
+
React__default.default.createElement("div", { onMouseDown: handleCalendarWrapperMouseDown },
|
|
162
|
+
React__default.default.createElement(Calendar, exports.__assign({}, calendarProps, { responsive: calendarResponsive, open: open, onClose: handleCalendarClose, ref: calendarRef, defaultMonth: defaultMonth, value: checkInputValueIsValid(inputValue) ? calendarValue : undefined, onChange: handleCalendarChange, minDate: minDate, maxDate: maxDate, offDays: offDays, events: events })))); };
|
|
174
163
|
return (
|
|
175
164
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
176
|
-
React__default
|
|
177
|
-
_b[styles__default
|
|
165
|
+
React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, className, (_b = {},
|
|
166
|
+
_b[styles__default.default.block] = block,
|
|
178
167
|
_b)), tabIndex: -1, onKeyDown: inputDisabled ? undefined : handleKeyDown, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : handleFocus, onBlur: handleBlur, "data-test-id": dataTestId },
|
|
179
|
-
React__default
|
|
168
|
+
React__default.default.createElement(coreComponentsDateInput.DateInput, exports.__assign({}, restProps, { ref: ref, wrapperRef: mergeRefs__default.default([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
180
169
|
rightAddons,
|
|
181
|
-
shouldRenderPopover && (React__default
|
|
170
|
+
shouldRenderPopover && (React__default.default.createElement(CalendarMIcon.CalendarMIcon, { className: styles__default.default.calendarIcon }))), onKeyDown: handleInputKeyDown, onChange: handleInputChange, block: true })),
|
|
182
171
|
shouldRenderStatic && renderCalendar(),
|
|
183
|
-
shouldRenderPopover && (React__default
|
|
184
|
-
_c[styles__default
|
|
172
|
+
shouldRenderPopover && (React__default.default.createElement(coreComponentsPopover.Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputWrapperRef.current, popperClassName: cn__default.default(styles__default.default.calendarContainer, (_c = {},
|
|
173
|
+
_c[styles__default.default.calendarResponsive] = calendarResponsive,
|
|
185
174
|
_c)), className: popoverClassName, position: popoverPosition, offset: [0, 4], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar()))));
|
|
186
175
|
});
|
|
187
176
|
|
|
188
177
|
exports.CalendarInput = CalendarInput;
|
|
178
|
+
exports.__rest = __rest;
|