@alfalab/core-components-date-time-input 2.1.3 → 2.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-27749cf7.d.ts} +47 -3
- package/{Component.js → Component-27749cf7.js} +22 -23
- 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/date-time-input/Component.d.ts +0 -0
- package/components/date-time-input/Component.js +18 -0
- package/{esm → components/date-time-input}/index.css +6 -6
- package/components/date-time-input/index.d.ts +1 -0
- package/components/date-time-input/index.js +18 -0
- package/cssm/{Component.d.ts → Component-d6110aa7.d.ts} +47 -3
- package/cssm/{Component.js → Component-d6110aa7.js} +24 -24
- 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/date-time-input/Component.d.ts +0 -0
- package/cssm/components/date-time-input/Component.js +19 -0
- package/cssm/components/date-time-input/index.d.ts +1 -0
- package/cssm/components/date-time-input/index.js +19 -0
- package/cssm/{index.module.css → components/date-time-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 +7 -4
- 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/format.js +8 -3
- package/desktop.d.ts +2 -0
- package/desktop.js +19 -0
- package/{modern/Component.d.ts → esm/Component-e82a534f.d.ts} +47 -3
- package/esm/{Component.js → Component-e82a534f.js} +8 -16
- 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/date-time-input/Component.d.ts +0 -0
- package/esm/components/date-time-input/Component.js +12 -0
- package/{index.css → esm/components/date-time-input/index.css} +6 -6
- package/esm/components/date-time-input/index.d.ts +1 -0
- package/esm/components/date-time-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 +5 -2
- 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/index.d.ts +1 -1
- package/index.js +6 -3
- 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/date-time-input/Component.d.ts} +13 -2
- package/modern/{Component.js → components/date-time-input/Component.js} +5 -11
- package/modern/{index.css → components/date-time-input/index.css} +6 -6
- package/modern/components/date-time-input/index.d.ts +1 -0
- package/modern/components/date-time-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 +5 -2
- 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/package.json +5 -5
- package/responsive.d.ts +2 -0
- package/responsive.js +22 -0
- package/utils/format.js +8 -3
|
@@ -4,6 +4,39 @@ import { ChangeEvent, ElementType } from "react";
|
|
|
4
4
|
import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
|
|
5
5
|
import { InputProps } from "@alfalab/core-components-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 DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
8
41
|
/**
|
|
9
42
|
* Дополнительный класс
|
|
@@ -38,7 +71,7 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
|
38
71
|
/**
|
|
39
72
|
* Компонент календаря
|
|
40
73
|
*/
|
|
41
|
-
Calendar?: ElementType
|
|
74
|
+
Calendar?: ElementType;
|
|
42
75
|
/**
|
|
43
76
|
* Доп. пропсы для календаря
|
|
44
77
|
*/
|
|
@@ -88,6 +121,10 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
|
88
121
|
* Растягивает компонент на ширину контейнера
|
|
89
122
|
*/
|
|
90
123
|
block?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
126
|
+
*/
|
|
127
|
+
view?: 'desktop' | 'mobile';
|
|
91
128
|
};
|
|
92
129
|
declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
|
|
93
130
|
/**
|
|
@@ -123,12 +160,15 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
123
160
|
/**
|
|
124
161
|
* Компонент календаря
|
|
125
162
|
*/
|
|
126
|
-
Calendar?: React.ElementType<
|
|
163
|
+
Calendar?: React.ElementType<any> | undefined;
|
|
127
164
|
/**
|
|
128
165
|
* Доп. пропсы для календаря
|
|
129
166
|
*/
|
|
130
167
|
calendarProps?: (CalendarProps & Record<string, unknown>) | (CalendarProps & {
|
|
131
168
|
open: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Дополнительный класс для поповера
|
|
171
|
+
*/
|
|
132
172
|
title?: string | undefined;
|
|
133
173
|
onClose?: (() => void) | undefined;
|
|
134
174
|
yearsAmount?: number | undefined;
|
|
@@ -180,5 +220,9 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
180
220
|
* Растягивает компонент на ширину контейнера
|
|
181
221
|
*/
|
|
182
222
|
block?: boolean | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
225
|
+
*/
|
|
226
|
+
view?: "desktop" | "mobile" | undefined;
|
|
183
227
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
184
|
-
export { DateTimeInputProps, DateTimeInput };
|
|
228
|
+
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, DateTimeInputProps, DateTimeInput };
|
|
@@ -7,11 +7,14 @@ var coreComponentsCalendar = require('@alfalab/core-components-calendar');
|
|
|
7
7
|
var coreComponentsIconButton = require('@alfalab/core-components-icon-button');
|
|
8
8
|
var coreComponentsInput = require('@alfalab/core-components-input');
|
|
9
9
|
var coreComponentsPopover = require('@alfalab/core-components-popover');
|
|
10
|
-
var hooks = require('@alfalab/hooks');
|
|
11
10
|
var CalendarMIcon = require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
11
|
var utils_format = require('./utils/format.js');
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
|
+
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
17
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
15
18
|
|
|
16
19
|
/******************************************************************************
|
|
17
20
|
Copyright (c) Microsoft Corporation.
|
|
@@ -27,8 +30,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
27
30
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
31
|
PERFORMANCE OF THIS SOFTWARE.
|
|
29
32
|
***************************************************************************** */
|
|
30
|
-
|
|
31
|
-
__assign = Object.assign || function __assign(t) {
|
|
33
|
+
exports.__assign = function () {
|
|
34
|
+
exports.__assign = Object.assign || function __assign(t) {
|
|
32
35
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
36
|
s = arguments[i];
|
|
34
37
|
for (var p in s)
|
|
@@ -37,7 +40,7 @@ var __assign = function () {
|
|
|
37
40
|
}
|
|
38
41
|
return t;
|
|
39
42
|
};
|
|
40
|
-
return __assign.apply(this, arguments);
|
|
43
|
+
return exports.__assign.apply(this, arguments);
|
|
41
44
|
};
|
|
42
45
|
function __rest(s, e) {
|
|
43
46
|
var t = {};
|
|
@@ -52,25 +55,20 @@ function __rest(s, e) {
|
|
|
52
55
|
return t;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
var styles = {"component":"date-time-
|
|
56
|
-
require('./index.css')
|
|
58
|
+
var styles = {"component":"date-time-input__component_1u4x2","calendarContainer":"date-time-input__calendarContainer_1u4x2","calendarResponsive":"date-time-input__calendarResponsive_1u4x2","block":"date-time-input__block_1u4x2"};
|
|
59
|
+
require('./components/date-time-input/index.css')
|
|
57
60
|
|
|
58
61
|
/* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
|
|
59
|
-
var DateTimeInput =
|
|
62
|
+
var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
|
|
60
63
|
var _b, _c;
|
|
61
64
|
var _d;
|
|
62
|
-
var className = _a.className, inputClassName = _a.inputClassName, popoverClassName = _a.popoverClassName, disabled = _a.disabled, readOnly = _a.readOnly, picker = _a.picker, _e = _a.defaultValue, defaultValue = _e === void 0 ? '' : _e, propValue = _a.value, onChange = _a.onChange, onComplete = _a.onComplete, rightAddons = _a.rightAddons, useAnchorWidth = _a.useAnchorWidth, block = _a.block, _f = _a.popoverPosition, popoverPosition = _f === void 0 ? 'bottom-start' : _f, zIndexPopover = _a.zIndexPopover, preventFlip = _a.preventFlip, _g = _a.Calendar, Calendar = _g === void 0 ? coreComponentsCalendar.Calendar : _g, _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, error = _a.error, restProps = __rest(_a, ["className", "inputClassName", "popoverClassName", "disabled", "readOnly", "picker", "defaultValue", "value", "onChange", "onComplete", "rightAddons", "useAnchorWidth", "block", "popoverPosition", "zIndexPopover", "preventFlip", "Calendar", "calendarProps", "defaultMonth", "minDate", "maxDate", "offDays", "events", "defaultOpen", "error"]);
|
|
63
|
-
var view = hooks.useMedia([
|
|
64
|
-
['mobile', '(max-width: 1023px)'],
|
|
65
|
-
['desktop', '(min-width: 1024px)'],
|
|
66
|
-
], 'desktop')[0];
|
|
65
|
+
var className = _a.className, inputClassName = _a.inputClassName, popoverClassName = _a.popoverClassName, disabled = _a.disabled, readOnly = _a.readOnly, picker = _a.picker, _e = _a.defaultValue, defaultValue = _e === void 0 ? '' : _e, propValue = _a.value, onChange = _a.onChange, onComplete = _a.onComplete, rightAddons = _a.rightAddons, useAnchorWidth = _a.useAnchorWidth, block = _a.block, _f = _a.popoverPosition, popoverPosition = _f === void 0 ? 'bottom-start' : _f, zIndexPopover = _a.zIndexPopover, preventFlip = _a.preventFlip, _g = _a.Calendar, Calendar = _g === void 0 ? coreComponentsCalendar.Calendar : _g, _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, error = _a.error, _p = _a.view, view = _p === void 0 ? 'desktop' : _p, restProps = __rest(_a, ["className", "inputClassName", "popoverClassName", "disabled", "readOnly", "picker", "defaultValue", "value", "onChange", "onComplete", "rightAddons", "useAnchorWidth", "block", "popoverPosition", "zIndexPopover", "preventFlip", "Calendar", "calendarProps", "defaultMonth", "minDate", "maxDate", "offDays", "events", "defaultOpen", "error", "view"]);
|
|
67
66
|
var inputRef = React.useRef(null);
|
|
68
67
|
var calendarRef = React.useRef(null);
|
|
69
|
-
var
|
|
70
|
-
var
|
|
68
|
+
var _q = React.useState(propValue || defaultValue), value = _q[0], setValue = _q[1];
|
|
69
|
+
var _r = React.useState(false), open = _r[0], setOpen = _r[1];
|
|
71
70
|
var calendarValue = value ? utils_format.getDateWithoutTime(value).getTime() : undefined;
|
|
72
71
|
var inputDisabled = disabled || readOnly;
|
|
73
|
-
var CalendarComponent = view === 'desktop' ? Calendar : coreComponentsCalendar.CalendarMobile;
|
|
74
72
|
var calendarResponsive = (_d = calendarProps === null || calendarProps === void 0 ? void 0 : calendarProps.responsive) !== null && _d !== void 0 ? _d : true;
|
|
75
73
|
React.useEffect(function () {
|
|
76
74
|
setOpen(defaultOpen);
|
|
@@ -156,17 +154,18 @@ var DateTimeInput = React.forwardRef(function (_a, ref) {
|
|
|
156
154
|
};
|
|
157
155
|
var renderCalendar = function () { return (
|
|
158
156
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return (
|
|
157
|
+
React__default.default.createElement("div", { onMouseDown: handleCalendarWrapperMouseDown },
|
|
158
|
+
React__default.default.createElement(Calendar, exports.__assign({}, calendarProps, { responsive: calendarResponsive, open: open, onClose: handleCalendarClose, ref: calendarRef, defaultMonth: defaultMonth, value: checkInputValueIsValid(value) ? calendarValue : undefined, onChange: handleCalendarChange, minDate: minDate, maxDate: maxDate, offDays: offDays, events: events })))); };
|
|
159
|
+
return (React__default.default.createElement("div", { className: cn__default.default(styles.component, className, (_b = {},
|
|
162
160
|
_b[styles.block] = block,
|
|
163
161
|
_b)), onClick: inputDisabled ? undefined : handleInputWrapperClick, onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
164
|
-
|
|
162
|
+
React__default.default.createElement(coreComponentsInput.Input, exports.__assign({}, restProps, { block: block, ref: mergeRefs__default.default([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
165
163
|
rightAddons,
|
|
166
|
-
picker && (
|
|
167
|
-
picker && (
|
|
164
|
+
picker && (React__default.default.createElement(coreComponentsIconButton.IconButton, { onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon.CalendarMIcon, size: 'xxs' }))) })),
|
|
165
|
+
picker && (React__default.default.createElement(coreComponentsPopover.Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn__default.default(styles.calendarContainer, (_c = {},
|
|
168
166
|
_c[styles.calendarResponsive] = calendarResponsive,
|
|
169
167
|
_c)), className: popoverClassName, position: popoverPosition, offset: [0, 8], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar()))));
|
|
170
168
|
});
|
|
171
169
|
|
|
172
170
|
exports.DateTimeInput = DateTimeInput;
|
|
171
|
+
exports.__rest = __rest;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DateTimeInputProps } from "./Component-27749cf7";
|
|
3
|
+
type DateTimeInputDesktopProps = Omit<DateTimeInputProps, 'view'>;
|
|
4
|
+
declare const DateTimeInputDesktop: FC<DateTimeInputDesktopProps>;
|
|
5
|
+
export { DateTimeInputDesktopProps, DateTimeInputDesktop };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dateTimeInput_Component = require('./Component-27749cf7.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-icon-button');
|
|
9
|
+
require('@alfalab/core-components-input');
|
|
10
|
+
require('@alfalab/core-components-popover');
|
|
11
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
|
+
require('./utils/format.js');
|
|
13
|
+
require('date-fns/isValid');
|
|
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 DateTimeInputDesktop = function (props) { return (React__default.default.createElement(components_dateTimeInput_Component.DateTimeInput, components_dateTimeInput_Component.__assign({}, props))); };
|
|
21
|
+
|
|
22
|
+
exports.DateTimeInputDesktop = DateTimeInputDesktop;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DateTimeInputProps } from "./Component-27749cf7";
|
|
3
|
+
type DateTimeInputMobileProps = Omit<DateTimeInputProps, 'view'>;
|
|
4
|
+
declare const DateTimeInputMobile: FC<DateTimeInputMobileProps>;
|
|
5
|
+
export { DateTimeInputMobileProps, DateTimeInputMobile };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dateTimeInput_Component = require('./Component-27749cf7.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-icon-button');
|
|
9
|
+
require('@alfalab/core-components-input');
|
|
10
|
+
require('@alfalab/core-components-popover');
|
|
11
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
|
+
require('./utils/format.js');
|
|
13
|
+
require('date-fns/isValid');
|
|
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 DateTimeInputMobile = function (props) { return (React__default.default.createElement(components_dateTimeInput_Component.DateTimeInput, components_dateTimeInput_Component.__assign({ Calendar: coreComponentsCalendar.CalendarMobile, view: 'mobile' }, props))); };
|
|
21
|
+
|
|
22
|
+
exports.DateTimeInputMobile = DateTimeInputMobile;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DateTimeInputProps } from "./Component-27749cf7";
|
|
3
|
+
type DateTimeInputResponsiveProps = Omit<DateTimeInputProps, 'view'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
6
|
+
* @default 1024
|
|
7
|
+
*/
|
|
8
|
+
breakpoint?: number;
|
|
9
|
+
};
|
|
10
|
+
type DateTimeInputMedia = 'desktop' | 'mobile';
|
|
11
|
+
declare const DateTimeInputResponsive: FC<DateTimeInputResponsiveProps>;
|
|
12
|
+
export { DateTimeInputResponsiveProps, DateTimeInputMedia, DateTimeInputResponsive };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dateTimeInput_Component = require('./Component-27749cf7.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-icon-button');
|
|
12
|
+
require('@alfalab/core-components-input');
|
|
13
|
+
require('@alfalab/core-components-popover');
|
|
14
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
15
|
+
require('./utils/format.js');
|
|
16
|
+
require('date-fns/isValid');
|
|
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 DateTimeInputResponsive = function (_a) {
|
|
24
|
+
var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = components_dateTimeInput_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.DateTimeInputDesktop, components_dateTimeInput_Component.__assign({}, restProps))) : (React__default.default.createElement(Component_mobile.DateTimeInputMobile, components_dateTimeInput_Component.__assign({}, restProps)));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.DateTimeInputResponsive = DateTimeInputResponsive;
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dateTimeInput_Component = require('../../Component-27749cf7.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('react-merge-refs');
|
|
6
|
+
require('classnames');
|
|
7
|
+
require('@alfalab/core-components-calendar');
|
|
8
|
+
require('@alfalab/core-components-icon-button');
|
|
9
|
+
require('@alfalab/core-components-input');
|
|
10
|
+
require('@alfalab/core-components-popover');
|
|
11
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
|
+
require('../../utils/format.js');
|
|
13
|
+
require('date-fns/isValid');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.DateTimeInput = components_dateTimeInput_Component.DateTimeInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1e3mm */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -39,26 +39,26 @@
|
|
|
39
39
|
:root {
|
|
40
40
|
--calendar-popover-border-radius: 0 0 var(--border-radius-s) var(--border-radius-s);
|
|
41
41
|
}
|
|
42
|
-
.date-time-
|
|
42
|
+
.date-time-input__component_1u4x2 {
|
|
43
43
|
display: inline-block;
|
|
44
44
|
outline: none;
|
|
45
45
|
position: relative;
|
|
46
46
|
}
|
|
47
|
-
.date-time-
|
|
47
|
+
.date-time-input__calendarContainer_1u4x2 {
|
|
48
48
|
display: inline-block;
|
|
49
49
|
box-sizing: border-box;
|
|
50
50
|
border-radius: var(--calendar-popover-border-radius)
|
|
51
51
|
}
|
|
52
52
|
@media (max-width: 374px) {
|
|
53
|
-
.date-time-
|
|
53
|
+
.date-time-input__calendarContainer_1u4x2 {
|
|
54
54
|
width: 100%;
|
|
55
55
|
min-width: 288px
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
.date-time-
|
|
58
|
+
.date-time-input__calendarResponsive_1u4x2 {
|
|
59
59
|
width: var(--calendar-width);
|
|
60
60
|
padding: 0 var(--gap-m);
|
|
61
61
|
}
|
|
62
|
-
.date-time-
|
|
62
|
+
.date-time-input__block_1u4x2 {
|
|
63
63
|
width: 100%;
|
|
64
64
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../Component-27749cf7";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dateTimeInput_Component = require('../../Component-27749cf7.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('react-merge-refs');
|
|
6
|
+
require('classnames');
|
|
7
|
+
require('@alfalab/core-components-calendar');
|
|
8
|
+
require('@alfalab/core-components-icon-button');
|
|
9
|
+
require('@alfalab/core-components-input');
|
|
10
|
+
require('@alfalab/core-components-popover');
|
|
11
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
|
+
require('../../utils/format.js');
|
|
13
|
+
require('date-fns/isValid');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.DateTimeInput = components_dateTimeInput_Component.DateTimeInput;
|
|
@@ -4,6 +4,39 @@ import { ChangeEvent, ElementType } from "react";
|
|
|
4
4
|
import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
|
|
5
5
|
import { InputProps } from "@alfalab/core-components-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 DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
8
41
|
/**
|
|
9
42
|
* Дополнительный класс
|
|
@@ -38,7 +71,7 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
|
38
71
|
/**
|
|
39
72
|
* Компонент календаря
|
|
40
73
|
*/
|
|
41
|
-
Calendar?: ElementType
|
|
74
|
+
Calendar?: ElementType;
|
|
42
75
|
/**
|
|
43
76
|
* Доп. пропсы для календаря
|
|
44
77
|
*/
|
|
@@ -88,6 +121,10 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
|
88
121
|
* Растягивает компонент на ширину контейнера
|
|
89
122
|
*/
|
|
90
123
|
block?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
126
|
+
*/
|
|
127
|
+
view?: 'desktop' | 'mobile';
|
|
91
128
|
};
|
|
92
129
|
declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
|
|
93
130
|
/**
|
|
@@ -123,12 +160,15 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
123
160
|
/**
|
|
124
161
|
* Компонент календаря
|
|
125
162
|
*/
|
|
126
|
-
Calendar?: React.ElementType<
|
|
163
|
+
Calendar?: React.ElementType<any> | undefined;
|
|
127
164
|
/**
|
|
128
165
|
* Доп. пропсы для календаря
|
|
129
166
|
*/
|
|
130
167
|
calendarProps?: (CalendarProps & Record<string, unknown>) | (CalendarProps & {
|
|
131
168
|
open: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Дополнительный класс для поповера
|
|
171
|
+
*/
|
|
132
172
|
title?: string | undefined;
|
|
133
173
|
onClose?: (() => void) | undefined;
|
|
134
174
|
yearsAmount?: number | undefined;
|
|
@@ -180,5 +220,9 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
180
220
|
* Растягивает компонент на ширину контейнера
|
|
181
221
|
*/
|
|
182
222
|
block?: boolean | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
225
|
+
*/
|
|
226
|
+
view?: "desktop" | "mobile" | undefined;
|
|
183
227
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
184
|
-
export { DateTimeInputProps, DateTimeInput };
|
|
228
|
+
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, DateTimeInputProps, DateTimeInput };
|
|
@@ -7,12 +7,16 @@ var coreComponentsCalendar = require('@alfalab/core-components-calendar/cssm');
|
|
|
7
7
|
var coreComponentsIconButton = require('@alfalab/core-components-icon-button/cssm');
|
|
8
8
|
var coreComponentsInput = require('@alfalab/core-components-input/cssm');
|
|
9
9
|
var coreComponentsPopover = require('@alfalab/core-components-popover/cssm');
|
|
10
|
-
var hooks = require('@alfalab/hooks');
|
|
11
10
|
var CalendarMIcon = require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
11
|
var utils_format = require('./utils/format.js');
|
|
13
|
-
var styles = require('./index.module.css');
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
var styles = require('./components/date-time-input/index.module.css');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
17
|
+
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
18
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
19
|
+
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
16
20
|
|
|
17
21
|
/******************************************************************************
|
|
18
22
|
Copyright (c) Microsoft Corporation.
|
|
@@ -28,8 +32,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
28
32
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
29
33
|
PERFORMANCE OF THIS SOFTWARE.
|
|
30
34
|
***************************************************************************** */
|
|
31
|
-
|
|
32
|
-
__assign = Object.assign || function __assign(t) {
|
|
35
|
+
exports.__assign = function () {
|
|
36
|
+
exports.__assign = Object.assign || function __assign(t) {
|
|
33
37
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
34
38
|
s = arguments[i];
|
|
35
39
|
for (var p in s)
|
|
@@ -38,7 +42,7 @@ var __assign = function () {
|
|
|
38
42
|
}
|
|
39
43
|
return t;
|
|
40
44
|
};
|
|
41
|
-
return __assign.apply(this, arguments);
|
|
45
|
+
return exports.__assign.apply(this, arguments);
|
|
42
46
|
};
|
|
43
47
|
function __rest(s, e) {
|
|
44
48
|
var t = {};
|
|
@@ -54,21 +58,16 @@ function __rest(s, e) {
|
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
/* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
|
|
57
|
-
var DateTimeInput =
|
|
61
|
+
var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
|
|
58
62
|
var _b, _c;
|
|
59
63
|
var _d;
|
|
60
|
-
var className = _a.className, inputClassName = _a.inputClassName, popoverClassName = _a.popoverClassName, disabled = _a.disabled, readOnly = _a.readOnly, picker = _a.picker, _e = _a.defaultValue, defaultValue = _e === void 0 ? '' : _e, propValue = _a.value, onChange = _a.onChange, onComplete = _a.onComplete, rightAddons = _a.rightAddons, useAnchorWidth = _a.useAnchorWidth, block = _a.block, _f = _a.popoverPosition, popoverPosition = _f === void 0 ? 'bottom-start' : _f, zIndexPopover = _a.zIndexPopover, preventFlip = _a.preventFlip, _g = _a.Calendar, Calendar = _g === void 0 ? coreComponentsCalendar.Calendar : _g, _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, error = _a.error, restProps = __rest(_a, ["className", "inputClassName", "popoverClassName", "disabled", "readOnly", "picker", "defaultValue", "value", "onChange", "onComplete", "rightAddons", "useAnchorWidth", "block", "popoverPosition", "zIndexPopover", "preventFlip", "Calendar", "calendarProps", "defaultMonth", "minDate", "maxDate", "offDays", "events", "defaultOpen", "error"]);
|
|
61
|
-
var view = hooks.useMedia([
|
|
62
|
-
['mobile', '(max-width: 1023px)'],
|
|
63
|
-
['desktop', '(min-width: 1024px)'],
|
|
64
|
-
], 'desktop')[0];
|
|
64
|
+
var className = _a.className, inputClassName = _a.inputClassName, popoverClassName = _a.popoverClassName, disabled = _a.disabled, readOnly = _a.readOnly, picker = _a.picker, _e = _a.defaultValue, defaultValue = _e === void 0 ? '' : _e, propValue = _a.value, onChange = _a.onChange, onComplete = _a.onComplete, rightAddons = _a.rightAddons, useAnchorWidth = _a.useAnchorWidth, block = _a.block, _f = _a.popoverPosition, popoverPosition = _f === void 0 ? 'bottom-start' : _f, zIndexPopover = _a.zIndexPopover, preventFlip = _a.preventFlip, _g = _a.Calendar, Calendar = _g === void 0 ? coreComponentsCalendar.Calendar : _g, _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, error = _a.error, _p = _a.view, view = _p === void 0 ? 'desktop' : _p, restProps = __rest(_a, ["className", "inputClassName", "popoverClassName", "disabled", "readOnly", "picker", "defaultValue", "value", "onChange", "onComplete", "rightAddons", "useAnchorWidth", "block", "popoverPosition", "zIndexPopover", "preventFlip", "Calendar", "calendarProps", "defaultMonth", "minDate", "maxDate", "offDays", "events", "defaultOpen", "error", "view"]);
|
|
65
65
|
var inputRef = React.useRef(null);
|
|
66
66
|
var calendarRef = React.useRef(null);
|
|
67
|
-
var
|
|
68
|
-
var
|
|
67
|
+
var _q = React.useState(propValue || defaultValue), value = _q[0], setValue = _q[1];
|
|
68
|
+
var _r = React.useState(false), open = _r[0], setOpen = _r[1];
|
|
69
69
|
var calendarValue = value ? utils_format.getDateWithoutTime(value).getTime() : undefined;
|
|
70
70
|
var inputDisabled = disabled || readOnly;
|
|
71
|
-
var CalendarComponent = view === 'desktop' ? Calendar : coreComponentsCalendar.CalendarMobile;
|
|
72
71
|
var calendarResponsive = (_d = calendarProps === null || calendarProps === void 0 ? void 0 : calendarProps.responsive) !== null && _d !== void 0 ? _d : true;
|
|
73
72
|
React.useEffect(function () {
|
|
74
73
|
setOpen(defaultOpen);
|
|
@@ -154,17 +153,18 @@ var DateTimeInput = React.forwardRef(function (_a, ref) {
|
|
|
154
153
|
};
|
|
155
154
|
var renderCalendar = function () { return (
|
|
156
155
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
_b[
|
|
156
|
+
React__default.default.createElement("div", { onMouseDown: handleCalendarWrapperMouseDown },
|
|
157
|
+
React__default.default.createElement(Calendar, exports.__assign({}, calendarProps, { responsive: calendarResponsive, open: open, onClose: handleCalendarClose, ref: calendarRef, defaultMonth: defaultMonth, value: checkInputValueIsValid(value) ? calendarValue : undefined, onChange: handleCalendarChange, minDate: minDate, maxDate: maxDate, offDays: offDays, events: events })))); };
|
|
158
|
+
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, className, (_b = {},
|
|
159
|
+
_b[styles__default.default.block] = block,
|
|
161
160
|
_b)), onClick: inputDisabled ? undefined : handleInputWrapperClick, onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
162
|
-
|
|
161
|
+
React__default.default.createElement(coreComponentsInput.Input, exports.__assign({}, restProps, { block: block, ref: mergeRefs__default.default([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
163
162
|
rightAddons,
|
|
164
|
-
picker && (
|
|
165
|
-
picker && (
|
|
166
|
-
_c[
|
|
163
|
+
picker && (React__default.default.createElement(coreComponentsIconButton.IconButton, { onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon.CalendarMIcon, size: 'xxs' }))) })),
|
|
164
|
+
picker && (React__default.default.createElement(coreComponentsPopover.Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn__default.default(styles__default.default.calendarContainer, (_c = {},
|
|
165
|
+
_c[styles__default.default.calendarResponsive] = calendarResponsive,
|
|
167
166
|
_c)), className: popoverClassName, position: popoverPosition, offset: [0, 8], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar()))));
|
|
168
167
|
});
|
|
169
168
|
|
|
170
169
|
exports.DateTimeInput = DateTimeInput;
|
|
170
|
+
exports.__rest = __rest;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DateTimeInputProps } from "./Component-d6110aa7";
|
|
3
|
+
type DateTimeInputDesktopProps = Omit<DateTimeInputProps, 'view'>;
|
|
4
|
+
declare const DateTimeInputDesktop: FC<DateTimeInputDesktopProps>;
|
|
5
|
+
export { DateTimeInputDesktopProps, DateTimeInputDesktop };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dateTimeInput_Component = require('./Component-d6110aa7.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
require('react-merge-refs');
|
|
6
|
+
require('classnames');
|
|
7
|
+
require('@alfalab/core-components-calendar/cssm');
|
|
8
|
+
require('@alfalab/core-components-icon-button/cssm');
|
|
9
|
+
require('@alfalab/core-components-input/cssm');
|
|
10
|
+
require('@alfalab/core-components-popover/cssm');
|
|
11
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
|
+
require('./utils/format.js');
|
|
13
|
+
require('date-fns/isValid');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
require('./components/date-time-input/index.module.css');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
18
|
+
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
20
|
+
|
|
21
|
+
var DateTimeInputDesktop = function (props) { return (React__default.default.createElement(components_dateTimeInput_Component.DateTimeInput, components_dateTimeInput_Component.__assign({}, props))); };
|
|
22
|
+
|
|
23
|
+
exports.DateTimeInputDesktop = DateTimeInputDesktop;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DateTimeInputProps } from "./Component-d6110aa7";
|
|
3
|
+
type DateTimeInputMobileProps = Omit<DateTimeInputProps, 'view'>;
|
|
4
|
+
declare const DateTimeInputMobile: FC<DateTimeInputMobileProps>;
|
|
5
|
+
export { DateTimeInputMobileProps, DateTimeInputMobile };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dateTimeInput_Component = require('./Component-d6110aa7.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var coreComponentsCalendar = require('@alfalab/core-components-calendar/cssm');
|
|
6
|
+
require('react-merge-refs');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('@alfalab/core-components-icon-button/cssm');
|
|
9
|
+
require('@alfalab/core-components-input/cssm');
|
|
10
|
+
require('@alfalab/core-components-popover/cssm');
|
|
11
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
12
|
+
require('./utils/format.js');
|
|
13
|
+
require('date-fns/isValid');
|
|
14
|
+
require('date-fns/parse');
|
|
15
|
+
require('./components/date-time-input/index.module.css');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
18
|
+
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
20
|
+
|
|
21
|
+
var DateTimeInputMobile = function (props) { return (React__default.default.createElement(components_dateTimeInput_Component.DateTimeInput, components_dateTimeInput_Component.__assign({ Calendar: coreComponentsCalendar.CalendarMobile, view: 'mobile' }, props))); };
|
|
22
|
+
|
|
23
|
+
exports.DateTimeInputMobile = DateTimeInputMobile;
|