@alfalab/core-components-date-time-input 4.0.5 → 4.0.7
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/components/date-time-input/Component.d.ts +1 -6
- package/components/date-time-input/Component.js +2 -8
- package/components/date-time-input/index.css +7 -7
- package/cssm/components/date-time-input/Component.d.ts +1 -6
- package/cssm/components/date-time-input/Component.js +1 -7
- package/{esm/index-2abb571d.d.ts → cssm/index-1a4fbd11.d.ts} +8 -1
- package/esm/components/date-time-input/Component.d.ts +1 -6
- package/esm/components/date-time-input/Component.js +2 -8
- package/esm/components/date-time-input/index.css +7 -7
- package/{index-2abb571d.d.ts → esm/index-1a4fbd11.d.ts} +8 -1
- package/{cssm/index-2abb571d.d.ts → index-1a4fbd11.d.ts} +8 -1
- package/modern/components/date-time-input/Component.d.ts +1 -6
- package/modern/components/date-time-input/Component.js +2 -8
- package/modern/components/date-time-input/index.css +7 -7
- package/modern/{index-2abb571d.d.ts → index-1a4fbd11.d.ts} +8 -1
- package/package.json +4 -4
- package/src/components/date-time-input/Component.tsx +1 -10
- /package/{Component-2abb571d.d.ts → Component-1a4fbd11.d.ts} +0 -0
- /package/cssm/{Component-2abb571d.d.ts → Component-1a4fbd11.d.ts} +0 -0
- /package/esm/{Component-2abb571d.d.ts → Component-1a4fbd11.d.ts} +0 -0
- /package/modern/{Component-2abb571d.d.ts → Component-1a4fbd11.d.ts} +0 -0
|
@@ -144,13 +144,8 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
144
144
|
open: boolean;
|
|
145
145
|
title?: string | undefined;
|
|
146
146
|
onClose?: (() => void) | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Обработчик изменения значения
|
|
149
|
-
*/
|
|
150
147
|
onMonthTitleClick?: ((event: React.MouseEvent<HTMLSpanElement, globalThis.MouseEvent>) => void) | undefined;
|
|
151
|
-
yearsAmount?: number | undefined;
|
|
152
|
-
* Обработчик окончания ввода
|
|
153
|
-
*/
|
|
148
|
+
yearsAmount?: number | undefined;
|
|
154
149
|
hasHeader?: boolean | undefined;
|
|
155
150
|
allowSelectionFromEmptyRange?: boolean | undefined;
|
|
156
151
|
} & Record<string, unknown>) | undefined;
|
|
@@ -21,7 +21,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
21
21
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
22
22
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
23
23
|
|
|
24
|
-
var styles = {"component":"date-time-
|
|
24
|
+
var styles = {"component":"date-time-input__component_1kw0i","calendarContainer":"date-time-input__calendarContainer_1kw0i","calendarResponsive":"date-time-input__calendarResponsive_1kw0i","block":"date-time-input__block_1kw0i","calendarIcon":"date-time-input__calendarIcon_1kw0i"};
|
|
25
25
|
require('./index.css')
|
|
26
26
|
|
|
27
27
|
/* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
|
|
@@ -120,12 +120,6 @@ var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
|
|
|
120
120
|
var handleClear = function () {
|
|
121
121
|
setValue('');
|
|
122
122
|
};
|
|
123
|
-
var handleInputKeyDown = function (event) {
|
|
124
|
-
var isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
|
|
125
|
-
if (disableUserInput && !isCopy && event.key !== 'Tab') {
|
|
126
|
-
event.preventDefault();
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
123
|
var handleCalendarChange = function (date) {
|
|
130
124
|
if (date) {
|
|
131
125
|
var newValue = utils_format.parseTimestampToDate(date);
|
|
@@ -153,7 +147,7 @@ var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
|
|
|
153
147
|
return (React__default.default.createElement("div", { className: cn__default.default(styles.component, className, (_b = {},
|
|
154
148
|
_b[styles.block] = block,
|
|
155
149
|
_b)), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
156
|
-
InputComponent ? (React__default.default.createElement(InputComponent, tslib.__assign({}, restProps, { block: block, ref: mergeRefs__default.default([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear,
|
|
150
|
+
InputComponent ? (React__default.default.createElement(InputComponent, tslib.__assign({}, restProps, { block: block, ref: mergeRefs__default.default([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, disableUserInput: disableUserInput, error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
157
151
|
rightAddons,
|
|
158
152
|
picker && (React__default.default.createElement(coreComponentsIconButton.IconButton, { className: styles.calendarIcon, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon.CalendarMIcon, size: 's' }))) }))) : null,
|
|
159
153
|
picker && (React__default.default.createElement(coreComponentsPopover.Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn__default.default(styles.calendarContainer, (_c = {},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 96023 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -41,24 +41,24 @@
|
|
|
41
41
|
/* marker */
|
|
42
42
|
} :root {
|
|
43
43
|
--calendar-popover-border-radius: var(--border-radius-m);
|
|
44
|
-
} .date-time-
|
|
44
|
+
} .date-time-input__component_1kw0i {
|
|
45
45
|
display: inline-block;
|
|
46
46
|
outline: none;
|
|
47
47
|
position: relative;
|
|
48
|
-
} .date-time-
|
|
48
|
+
} .date-time-input__calendarContainer_1kw0i {
|
|
49
49
|
display: inline-block;
|
|
50
50
|
box-sizing: border-box;
|
|
51
51
|
border-radius: var(--calendar-popover-border-radius);
|
|
52
52
|
border: 1px solid var(--color-light-border-secondary)
|
|
53
|
-
} @media (max-width: 374px) { .date-time-
|
|
53
|
+
} @media (max-width: 374px) { .date-time-input__calendarContainer_1kw0i {
|
|
54
54
|
width: 100%;
|
|
55
55
|
min-width: 288px
|
|
56
56
|
}
|
|
57
|
-
} .date-time-
|
|
57
|
+
} .date-time-input__calendarResponsive_1kw0i {
|
|
58
58
|
width: var(--calendar-width);
|
|
59
|
-
} .date-time-
|
|
59
|
+
} .date-time-input__block_1kw0i {
|
|
60
60
|
width: 100%;
|
|
61
|
-
} .date-time-
|
|
61
|
+
} .date-time-input__calendarIcon_1kw0i {
|
|
62
62
|
margin-right: var(--gap-s-neg);
|
|
63
63
|
height: 100%;
|
|
64
64
|
}
|
|
@@ -144,13 +144,8 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
144
144
|
open: boolean;
|
|
145
145
|
title?: string | undefined;
|
|
146
146
|
onClose?: (() => void) | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Обработчик изменения значения
|
|
149
|
-
*/
|
|
150
147
|
onMonthTitleClick?: ((event: React.MouseEvent<HTMLSpanElement, globalThis.MouseEvent>) => void) | undefined;
|
|
151
|
-
yearsAmount?: number | undefined;
|
|
152
|
-
* Обработчик окончания ввода
|
|
153
|
-
*/
|
|
148
|
+
yearsAmount?: number | undefined;
|
|
154
149
|
hasHeader?: boolean | undefined;
|
|
155
150
|
allowSelectionFromEmptyRange?: boolean | undefined;
|
|
156
151
|
} & Record<string, unknown>) | undefined;
|
|
@@ -119,12 +119,6 @@ var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
|
|
|
119
119
|
var handleClear = function () {
|
|
120
120
|
setValue('');
|
|
121
121
|
};
|
|
122
|
-
var handleInputKeyDown = function (event) {
|
|
123
|
-
var isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
|
|
124
|
-
if (disableUserInput && !isCopy && event.key !== 'Tab') {
|
|
125
|
-
event.preventDefault();
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
122
|
var handleCalendarChange = function (date) {
|
|
129
123
|
if (date) {
|
|
130
124
|
var newValue = utils_format.parseTimestampToDate(date);
|
|
@@ -152,7 +146,7 @@ var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
|
|
|
152
146
|
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, className, (_b = {},
|
|
153
147
|
_b[styles__default.default.block] = block,
|
|
154
148
|
_b)), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
155
|
-
InputComponent ? (React__default.default.createElement(InputComponent, tslib.__assign({}, restProps, { block: block, ref: mergeRefs__default.default([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear,
|
|
149
|
+
InputComponent ? (React__default.default.createElement(InputComponent, tslib.__assign({}, restProps, { block: block, ref: mergeRefs__default.default([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, disableUserInput: disableUserInput, error: error, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
156
150
|
rightAddons,
|
|
157
151
|
picker && (React__default.default.createElement(coreComponentsIconButton.IconButton, { className: styles__default.default.calendarIcon, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon.CalendarMIcon, size: 's' }))) }))) : null,
|
|
158
152
|
picker && (React__default.default.createElement(coreComponentsPopover.Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn__default.default(styles__default.default.calendarContainer, (_c = {},
|
|
@@ -12,4 +12,11 @@ declare function disableUserInput<T>(disabled: boolean | undefined, event: React
|
|
|
12
12
|
declare const inputUtils: {
|
|
13
13
|
disableUserInput: typeof disableUserInput;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Возвращает true, если значение равно null или undefined
|
|
17
|
+
*/
|
|
18
|
+
declare function isNil(value: unknown): boolean;
|
|
19
|
+
declare const fnUtils: {
|
|
20
|
+
isNil: typeof isNil;
|
|
21
|
+
};
|
|
22
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils };
|
|
@@ -144,13 +144,8 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
144
144
|
open: boolean;
|
|
145
145
|
title?: string | undefined;
|
|
146
146
|
onClose?: (() => void) | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Обработчик изменения значения
|
|
149
|
-
*/
|
|
150
147
|
onMonthTitleClick?: ((event: React.MouseEvent<HTMLSpanElement, globalThis.MouseEvent>) => void) | undefined;
|
|
151
|
-
yearsAmount?: number | undefined;
|
|
152
|
-
* Обработчик окончания ввода
|
|
153
|
-
*/
|
|
148
|
+
yearsAmount?: number | undefined;
|
|
154
149
|
hasHeader?: boolean | undefined;
|
|
155
150
|
allowSelectionFromEmptyRange?: boolean | undefined;
|
|
156
151
|
} & Record<string, unknown>) | undefined;
|
|
@@ -11,7 +11,7 @@ import { getDateWithoutTime, DATE_WITH_TIME_LENGTH, format, getFullDateTime, isC
|
|
|
11
11
|
import 'date-fns/isValid';
|
|
12
12
|
import 'date-fns/parse';
|
|
13
13
|
|
|
14
|
-
var styles = {"component":"date-time-
|
|
14
|
+
var styles = {"component":"date-time-input__component_1kw0i","calendarContainer":"date-time-input__calendarContainer_1kw0i","calendarResponsive":"date-time-input__calendarResponsive_1kw0i","block":"date-time-input__block_1kw0i","calendarIcon":"date-time-input__calendarIcon_1kw0i"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
/* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
|
|
@@ -110,12 +110,6 @@ var DateTimeInput = React.forwardRef(function (_a, ref) {
|
|
|
110
110
|
var handleClear = function () {
|
|
111
111
|
setValue('');
|
|
112
112
|
};
|
|
113
|
-
var handleInputKeyDown = function (event) {
|
|
114
|
-
var isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
|
|
115
|
-
if (disableUserInput && !isCopy && event.key !== 'Tab') {
|
|
116
|
-
event.preventDefault();
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
113
|
var handleCalendarChange = function (date) {
|
|
120
114
|
if (date) {
|
|
121
115
|
var newValue = parseTimestampToDate(date);
|
|
@@ -143,7 +137,7 @@ var DateTimeInput = React.forwardRef(function (_a, ref) {
|
|
|
143
137
|
return (React.createElement("div", { className: cn(styles.component, className, (_b = {},
|
|
144
138
|
_b[styles.block] = block,
|
|
145
139
|
_b)), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
146
|
-
InputComponent ? (React.createElement(InputComponent, __assign({}, restProps, { block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear,
|
|
140
|
+
InputComponent ? (React.createElement(InputComponent, __assign({}, restProps, { block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, disableUserInput: disableUserInput, error: error, rightAddons: React.createElement(React.Fragment, null,
|
|
147
141
|
rightAddons,
|
|
148
142
|
picker && (React.createElement(IconButton, { className: styles.calendarIcon, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 's' }))) }))) : null,
|
|
149
143
|
picker && (React.createElement(Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn(styles.calendarContainer, (_c = {},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 96023 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -41,24 +41,24 @@
|
|
|
41
41
|
/* marker */
|
|
42
42
|
} :root {
|
|
43
43
|
--calendar-popover-border-radius: var(--border-radius-m);
|
|
44
|
-
} .date-time-
|
|
44
|
+
} .date-time-input__component_1kw0i {
|
|
45
45
|
display: inline-block;
|
|
46
46
|
outline: none;
|
|
47
47
|
position: relative;
|
|
48
|
-
} .date-time-
|
|
48
|
+
} .date-time-input__calendarContainer_1kw0i {
|
|
49
49
|
display: inline-block;
|
|
50
50
|
box-sizing: border-box;
|
|
51
51
|
border-radius: var(--calendar-popover-border-radius);
|
|
52
52
|
border: 1px solid var(--color-light-border-secondary)
|
|
53
|
-
} @media (max-width: 374px) { .date-time-
|
|
53
|
+
} @media (max-width: 374px) { .date-time-input__calendarContainer_1kw0i {
|
|
54
54
|
width: 100%;
|
|
55
55
|
min-width: 288px
|
|
56
56
|
}
|
|
57
|
-
} .date-time-
|
|
57
|
+
} .date-time-input__calendarResponsive_1kw0i {
|
|
58
58
|
width: var(--calendar-width);
|
|
59
|
-
} .date-time-
|
|
59
|
+
} .date-time-input__block_1kw0i {
|
|
60
60
|
width: 100%;
|
|
61
|
-
} .date-time-
|
|
61
|
+
} .date-time-input__calendarIcon_1kw0i {
|
|
62
62
|
margin-right: var(--gap-s-neg);
|
|
63
63
|
height: 100%;
|
|
64
64
|
}
|
|
@@ -12,4 +12,11 @@ declare function disableUserInput<T>(disabled: boolean | undefined, event: React
|
|
|
12
12
|
declare const inputUtils: {
|
|
13
13
|
disableUserInput: typeof disableUserInput;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Возвращает true, если значение равно null или undefined
|
|
17
|
+
*/
|
|
18
|
+
declare function isNil(value: unknown): boolean;
|
|
19
|
+
declare const fnUtils: {
|
|
20
|
+
isNil: typeof isNil;
|
|
21
|
+
};
|
|
22
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils };
|
|
@@ -12,4 +12,11 @@ declare function disableUserInput<T>(disabled: boolean | undefined, event: React
|
|
|
12
12
|
declare const inputUtils: {
|
|
13
13
|
disableUserInput: typeof disableUserInput;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Возвращает true, если значение равно null или undefined
|
|
17
|
+
*/
|
|
18
|
+
declare function isNil(value: unknown): boolean;
|
|
19
|
+
declare const fnUtils: {
|
|
20
|
+
isNil: typeof isNil;
|
|
21
|
+
};
|
|
22
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils };
|
|
@@ -144,13 +144,8 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
144
144
|
open: boolean;
|
|
145
145
|
title?: string | undefined;
|
|
146
146
|
onClose?: (() => void) | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Обработчик изменения значения
|
|
149
|
-
*/
|
|
150
147
|
onMonthTitleClick?: ((event: React.MouseEvent<HTMLSpanElement, globalThis.MouseEvent>) => void) | undefined;
|
|
151
|
-
yearsAmount?: number | undefined;
|
|
152
|
-
* Обработчик окончания ввода
|
|
153
|
-
*/
|
|
148
|
+
yearsAmount?: number | undefined;
|
|
154
149
|
hasHeader?: boolean | undefined;
|
|
155
150
|
allowSelectionFromEmptyRange?: boolean | undefined;
|
|
156
151
|
} & Record<string, unknown>) | undefined;
|
|
@@ -10,7 +10,7 @@ import { getDateWithoutTime, DATE_WITH_TIME_LENGTH, format, getFullDateTime, isC
|
|
|
10
10
|
import 'date-fns/isValid';
|
|
11
11
|
import 'date-fns/parse';
|
|
12
12
|
|
|
13
|
-
const styles = {"component":"date-time-
|
|
13
|
+
const styles = {"component":"date-time-input__component_1kw0i","calendarContainer":"date-time-input__calendarContainer_1kw0i","calendarResponsive":"date-time-input__calendarResponsive_1kw0i","block":"date-time-input__block_1kw0i","calendarIcon":"date-time-input__calendarIcon_1kw0i"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
/* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
|
|
@@ -106,12 +106,6 @@ const DateTimeInput = React.forwardRef(({ className, inputClassName, popoverClas
|
|
|
106
106
|
const handleClear = () => {
|
|
107
107
|
setValue('');
|
|
108
108
|
};
|
|
109
|
-
const handleInputKeyDown = (event) => {
|
|
110
|
-
const isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
|
|
111
|
-
if (disableUserInput && !isCopy && event.key !== 'Tab') {
|
|
112
|
-
event.preventDefault();
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
109
|
const handleCalendarChange = (date) => {
|
|
116
110
|
if (date) {
|
|
117
111
|
const newValue = parseTimestampToDate(date);
|
|
@@ -137,7 +131,7 @@ const DateTimeInput = React.forwardRef(({ className, inputClassName, popoverClas
|
|
|
137
131
|
return (React.createElement("div", { className: cn(styles.component, className, {
|
|
138
132
|
[styles.block]: block,
|
|
139
133
|
}), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
140
|
-
InputComponent ? (React.createElement(InputComponent, { ...restProps, block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear,
|
|
134
|
+
InputComponent ? (React.createElement(InputComponent, { ...restProps, block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, disableUserInput: disableUserInput, error: error, rightAddons: React.createElement(React.Fragment, null,
|
|
141
135
|
rightAddons,
|
|
142
136
|
picker && (React.createElement(IconButton, { className: styles.calendarIcon, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 's' }))) })) : null,
|
|
143
137
|
picker && (React.createElement(Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn(styles.calendarContainer, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 96023 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -41,24 +41,24 @@
|
|
|
41
41
|
/* marker */
|
|
42
42
|
} :root {
|
|
43
43
|
--calendar-popover-border-radius: var(--border-radius-m);
|
|
44
|
-
} .date-time-
|
|
44
|
+
} .date-time-input__component_1kw0i {
|
|
45
45
|
display: inline-block;
|
|
46
46
|
outline: none;
|
|
47
47
|
position: relative;
|
|
48
|
-
} .date-time-
|
|
48
|
+
} .date-time-input__calendarContainer_1kw0i {
|
|
49
49
|
display: inline-block;
|
|
50
50
|
box-sizing: border-box;
|
|
51
51
|
border-radius: var(--calendar-popover-border-radius);
|
|
52
52
|
border: 1px solid var(--color-light-border-secondary)
|
|
53
|
-
} @media (max-width: 374px) { .date-time-
|
|
53
|
+
} @media (max-width: 374px) { .date-time-input__calendarContainer_1kw0i {
|
|
54
54
|
width: 100%;
|
|
55
55
|
min-width: 288px
|
|
56
56
|
}
|
|
57
|
-
} .date-time-
|
|
57
|
+
} .date-time-input__calendarResponsive_1kw0i {
|
|
58
58
|
width: var(--calendar-width);
|
|
59
|
-
} .date-time-
|
|
59
|
+
} .date-time-input__block_1kw0i {
|
|
60
60
|
width: 100%;
|
|
61
|
-
} .date-time-
|
|
61
|
+
} .date-time-input__calendarIcon_1kw0i {
|
|
62
62
|
margin-right: var(--gap-s-neg);
|
|
63
63
|
height: 100%;
|
|
64
64
|
}
|
|
@@ -12,4 +12,11 @@ declare function disableUserInput<T>(disabled: boolean | undefined, event: React
|
|
|
12
12
|
declare const inputUtils: {
|
|
13
13
|
disableUserInput: typeof disableUserInput;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Возвращает true, если значение равно null или undefined
|
|
17
|
+
*/
|
|
18
|
+
declare function isNil(value: unknown): boolean;
|
|
19
|
+
declare const fnUtils: {
|
|
20
|
+
isNil: typeof isNil;
|
|
21
|
+
};
|
|
22
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-date-time-input",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@alfalab/core-components-calendar": "^7.0.
|
|
39
|
-
"@alfalab/core-components-input": "^12.1.
|
|
40
|
-
"@alfalab/core-components-icon-button": "^6.2.
|
|
38
|
+
"@alfalab/core-components-calendar": "^7.0.5",
|
|
39
|
+
"@alfalab/core-components-input": "^12.1.2",
|
|
40
|
+
"@alfalab/core-components-icon-button": "^6.2.4",
|
|
41
41
|
"@alfalab/core-components-popover": "^6.1.0",
|
|
42
42
|
"@alfalab/hooks": "^1.13.0",
|
|
43
43
|
"@alfalab/icons-glyph": "^2.108.0",
|
|
@@ -4,7 +4,6 @@ import React, {
|
|
|
4
4
|
ChangeEvent,
|
|
5
5
|
ElementType,
|
|
6
6
|
FocusEvent,
|
|
7
|
-
KeyboardEvent,
|
|
8
7
|
MouseEvent,
|
|
9
8
|
useEffect,
|
|
10
9
|
useRef,
|
|
@@ -312,14 +311,6 @@ export const DateTimeInput = React.forwardRef<HTMLInputElement, DateTimeInputPro
|
|
|
312
311
|
setValue('');
|
|
313
312
|
};
|
|
314
313
|
|
|
315
|
-
const handleInputKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
|
|
316
|
-
const isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
|
|
317
|
-
|
|
318
|
-
if (disableUserInput && !isCopy && event.key !== 'Tab') {
|
|
319
|
-
event.preventDefault();
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
|
|
323
314
|
const handleCalendarChange = (date?: number) => {
|
|
324
315
|
if (date) {
|
|
325
316
|
const newValue = parseTimestampToDate(date);
|
|
@@ -382,7 +373,7 @@ export const DateTimeInput = React.forwardRef<HTMLInputElement, DateTimeInputPro
|
|
|
382
373
|
readOnly={readOnly}
|
|
383
374
|
className={inputClassName}
|
|
384
375
|
onClear={handleClear}
|
|
385
|
-
|
|
376
|
+
disableUserInput={disableUserInput}
|
|
386
377
|
error={error}
|
|
387
378
|
rightAddons={
|
|
388
379
|
<React.Fragment>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|