@alfalab/core-components-date-time-input 1.1.4 → 2.0.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/Component.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ChangeEvent, ElementType } from "react";
4
+ import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
4
5
  import { InputProps } from "@alfalab/core-components-input";
5
- import { CalendarProps, CalendarMobileProps } from "@alfalab/core-components-calendar";
6
6
  import { PopoverProps } from "@alfalab/core-components-popover";
7
7
  type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
8
8
  /**
@@ -89,7 +89,7 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
89
89
  */
90
90
  block?: boolean;
91
91
  };
92
- declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "size" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
92
+ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
93
93
  /**
94
94
  * Дополнительный класс
95
95
  */
@@ -109,21 +109,21 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
109
109
  /**
110
110
  * Обработчик изменения значения
111
111
  */
112
- onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
112
+ onChange?: ((event: ChangeEvent<HTMLInputElement>, payload: {
113
113
  date: Date;
114
114
  value: string;
115
115
  }) => void) | undefined;
116
116
  /**
117
117
  * Обработчик окончания ввода
118
118
  */
119
- onComplete?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
119
+ onComplete?: ((event: ChangeEvent<HTMLInputElement>, payload: {
120
120
  date: Date;
121
121
  value: string;
122
122
  }) => void) | undefined;
123
123
  /**
124
124
  * Компонент календаря
125
125
  */
126
- Calendar?: React.ComponentClass<CalendarProps, any> | React.FunctionComponent<CalendarProps> | undefined;
126
+ Calendar?: React.ElementType<CalendarProps> | undefined;
127
127
  /**
128
128
  * Доп. пропсы для календаря
129
129
  */
@@ -162,11 +162,11 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
162
162
  /**
163
163
  * Позиционирование поповера с календарем
164
164
  */
165
- popoverPosition?: "right" | "left" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined;
165
+ popoverPosition?: PopoverProps['position'];
166
166
  /**
167
167
  * z-index Popover
168
168
  */
169
- zIndexPopover?: number | undefined;
169
+ zIndexPopover?: PopoverProps['zIndex'];
170
170
  /**
171
171
  * Запрещает поповеру менять свою позицию.
172
172
  * Например, если места снизу недостаточно,то он все равно будет показан снизу
package/Component.js CHANGED
@@ -3,25 +3,25 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var cn = require('classnames');
7
6
  var mergeRefs = require('react-merge-refs');
8
- var hooks = require('@alfalab/hooks');
9
- var coreComponentsInput = require('@alfalab/core-components-input');
7
+ var cn = require('classnames');
10
8
  var coreComponentsCalendar = require('@alfalab/core-components-calendar');
11
- var coreComponentsPopover = require('@alfalab/core-components-popover');
12
9
  var coreComponentsIconButton = require('@alfalab/core-components-icon-button');
10
+ var coreComponentsInput = require('@alfalab/core-components-input');
11
+ var coreComponentsPopover = require('@alfalab/core-components-popover');
12
+ var hooks = require('@alfalab/hooks');
13
13
  var CalendarMIcon = require('@alfalab/icons-glyph/CalendarMIcon');
14
- require('date-fns/parse');
15
14
  require('date-fns/isValid');
15
+ require('date-fns/parse');
16
16
  var utils_format = require('./utils/format.js');
17
17
 
18
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
19
 
20
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
- var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
22
21
  var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
22
+ var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
23
23
 
24
- /*! *****************************************************************************
24
+ /******************************************************************************
25
25
  Copyright (c) Microsoft Corporation.
26
26
 
27
27
  Permission to use, copy, modify, and/or distribute this software for any
@@ -60,7 +60,7 @@ function __rest(s, e) {
60
60
  return t;
61
61
  }
62
62
 
63
- var styles = {"component":"date-time-input__component_1nnw3","calendarContainer":"date-time-input__calendarContainer_1nnw3","calendarResponsive":"date-time-input__calendarResponsive_1nnw3","block":"date-time-input__block_1nnw3"};
63
+ var styles = {"component":"date-time-input__component_ff8p7","calendarContainer":"date-time-input__calendarContainer_ff8p7","calendarResponsive":"date-time-input__calendarResponsive_ff8p7","block":"date-time-input__block_ff8p7"};
64
64
  require('./index.css')
65
65
 
66
66
  /* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ChangeEvent, ElementType } from "react";
4
+ import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
4
5
  import { InputProps } from "@alfalab/core-components-input";
5
- import { CalendarProps, CalendarMobileProps } from "@alfalab/core-components-calendar";
6
6
  import { PopoverProps } from "@alfalab/core-components-popover";
7
7
  type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
8
8
  /**
@@ -89,7 +89,7 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
89
89
  */
90
90
  block?: boolean;
91
91
  };
92
- declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "size" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
92
+ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
93
93
  /**
94
94
  * Дополнительный класс
95
95
  */
@@ -109,21 +109,21 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
109
109
  /**
110
110
  * Обработчик изменения значения
111
111
  */
112
- onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
112
+ onChange?: ((event: ChangeEvent<HTMLInputElement>, payload: {
113
113
  date: Date;
114
114
  value: string;
115
115
  }) => void) | undefined;
116
116
  /**
117
117
  * Обработчик окончания ввода
118
118
  */
119
- onComplete?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
119
+ onComplete?: ((event: ChangeEvent<HTMLInputElement>, payload: {
120
120
  date: Date;
121
121
  value: string;
122
122
  }) => void) | undefined;
123
123
  /**
124
124
  * Компонент календаря
125
125
  */
126
- Calendar?: React.ComponentClass<CalendarProps, any> | React.FunctionComponent<CalendarProps> | undefined;
126
+ Calendar?: React.ElementType<CalendarProps> | undefined;
127
127
  /**
128
128
  * Доп. пропсы для календаря
129
129
  */
@@ -162,11 +162,11 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
162
162
  /**
163
163
  * Позиционирование поповера с календарем
164
164
  */
165
- popoverPosition?: "right" | "left" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined;
165
+ popoverPosition?: PopoverProps['position'];
166
166
  /**
167
167
  * z-index Popover
168
168
  */
169
- zIndexPopover?: number | undefined;
169
+ zIndexPopover?: PopoverProps['zIndex'];
170
170
  /**
171
171
  * Запрещает поповеру менять свою позицию.
172
172
  * Например, если места снизу недостаточно,то он все равно будет показан снизу
package/cssm/Component.js CHANGED
@@ -3,27 +3,27 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var cn = require('classnames');
7
6
  var mergeRefs = require('react-merge-refs');
8
- var hooks = require('@alfalab/hooks');
9
- var coreComponentsInput = require('@alfalab/core-components-input/cssm');
7
+ var cn = require('classnames');
10
8
  var coreComponentsCalendar = require('@alfalab/core-components-calendar/cssm');
11
- var coreComponentsPopover = require('@alfalab/core-components-popover/cssm');
12
9
  var coreComponentsIconButton = require('@alfalab/core-components-icon-button/cssm');
10
+ var coreComponentsInput = require('@alfalab/core-components-input/cssm');
11
+ var coreComponentsPopover = require('@alfalab/core-components-popover/cssm');
12
+ var hooks = require('@alfalab/hooks');
13
13
  var CalendarMIcon = require('@alfalab/icons-glyph/CalendarMIcon');
14
- require('date-fns/parse');
15
14
  require('date-fns/isValid');
15
+ require('date-fns/parse');
16
16
  var utils_format = require('./utils/format.js');
17
17
  var styles = require('./index.module.css');
18
18
 
19
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
20
 
21
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
- var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
23
22
  var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
23
+ var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
24
24
  var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
25
25
 
26
- /*! *****************************************************************************
26
+ /******************************************************************************
27
27
  Copyright (c) Microsoft Corporation.
28
28
 
29
29
  Permission to use, copy, modify, and/or distribute this software for any
package/cssm/index.js CHANGED
@@ -4,16 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var Component = require('./Component.js');
6
6
  require('react');
7
- require('classnames');
8
7
  require('react-merge-refs');
9
- require('@alfalab/hooks');
10
- require('@alfalab/core-components-input/cssm');
8
+ require('classnames');
11
9
  require('@alfalab/core-components-calendar/cssm');
12
- require('@alfalab/core-components-popover/cssm');
13
10
  require('@alfalab/core-components-icon-button/cssm');
11
+ require('@alfalab/core-components-input/cssm');
12
+ require('@alfalab/core-components-popover/cssm');
13
+ require('@alfalab/hooks');
14
14
  require('@alfalab/icons-glyph/CalendarMIcon');
15
- require('date-fns/parse');
16
15
  require('date-fns/isValid');
16
+ require('date-fns/parse');
17
17
  require('./utils/format.js');
18
18
  require('./index.module.css');
19
19
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var parse = require('date-fns/parse');
6
5
  var dateFnsIsValid = require('date-fns/isValid');
6
+ var parse = require('date-fns/parse');
7
7
 
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
10
- var parse__default = /*#__PURE__*/_interopDefaultLegacy(parse);
11
10
  var dateFnsIsValid__default = /*#__PURE__*/_interopDefaultLegacy(dateFnsIsValid);
11
+ var parse__default = /*#__PURE__*/_interopDefaultLegacy(parse);
12
12
 
13
13
  /* eslint-disable no-useless-escape */
14
14
  var DATE_FORMAT = 'dd.MM.yyyy';
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('date-fns/parse');
6
5
  require('date-fns/isValid');
6
+ require('date-fns/parse');
7
7
  var utils_format = require('./format.js');
8
8
 
9
9
 
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ChangeEvent, ElementType } from "react";
4
+ import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
4
5
  import { InputProps } from "@alfalab/core-components-input";
5
- import { CalendarProps, CalendarMobileProps } from "@alfalab/core-components-calendar";
6
6
  import { PopoverProps } from "@alfalab/core-components-popover";
7
7
  type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
8
8
  /**
@@ -89,7 +89,7 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
89
89
  */
90
90
  block?: boolean;
91
91
  };
92
- declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "size" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
92
+ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
93
93
  /**
94
94
  * Дополнительный класс
95
95
  */
@@ -109,21 +109,21 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
109
109
  /**
110
110
  * Обработчик изменения значения
111
111
  */
112
- onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
112
+ onChange?: ((event: ChangeEvent<HTMLInputElement>, payload: {
113
113
  date: Date;
114
114
  value: string;
115
115
  }) => void) | undefined;
116
116
  /**
117
117
  * Обработчик окончания ввода
118
118
  */
119
- onComplete?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
119
+ onComplete?: ((event: ChangeEvent<HTMLInputElement>, payload: {
120
120
  date: Date;
121
121
  value: string;
122
122
  }) => void) | undefined;
123
123
  /**
124
124
  * Компонент календаря
125
125
  */
126
- Calendar?: React.ComponentClass<CalendarProps, any> | React.FunctionComponent<CalendarProps> | undefined;
126
+ Calendar?: React.ElementType<CalendarProps> | undefined;
127
127
  /**
128
128
  * Доп. пропсы для календаря
129
129
  */
@@ -162,11 +162,11 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
162
162
  /**
163
163
  * Позиционирование поповера с календарем
164
164
  */
165
- popoverPosition?: "right" | "left" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined;
165
+ popoverPosition?: PopoverProps['position'];
166
166
  /**
167
167
  * z-index Popover
168
168
  */
169
- zIndexPopover?: number | undefined;
169
+ zIndexPopover?: PopoverProps['zIndex'];
170
170
  /**
171
171
  * Запрещает поповеру менять свою позицию.
172
172
  * Например, если места снизу недостаточно,то он все равно будет показан снизу
package/esm/Component.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import React, { useRef, useState, useEffect } from 'react';
2
- import cn from 'classnames';
3
2
  import mergeRefs from 'react-merge-refs';
4
- import { useMedia } from '@alfalab/hooks';
5
- import { Input } from '@alfalab/core-components-input/esm';
3
+ import cn from 'classnames';
6
4
  import { CalendarMobile, dateInLimits, Calendar } from '@alfalab/core-components-calendar/esm';
7
- import { Popover } from '@alfalab/core-components-popover/esm';
8
5
  import { IconButton } from '@alfalab/core-components-icon-button/esm';
6
+ import { Input } from '@alfalab/core-components-input/esm';
7
+ import { Popover } from '@alfalab/core-components-popover/esm';
8
+ import { useMedia } from '@alfalab/hooks';
9
9
  import { CalendarMIcon } from '@alfalab/icons-glyph/CalendarMIcon';
10
- import 'date-fns/parse';
11
10
  import 'date-fns/isValid';
11
+ import 'date-fns/parse';
12
12
  import { getDateWithoutTime, setTimeToDate, DATE_MASK, format, getFullDateTime, isCompleteDateInput, isValid, parseTimestampToDate } from './utils/format.js';
13
13
 
14
- /*! *****************************************************************************
14
+ /******************************************************************************
15
15
  Copyright (c) Microsoft Corporation.
16
16
 
17
17
  Permission to use, copy, modify, and/or distribute this software for any
@@ -50,7 +50,7 @@ function __rest(s, e) {
50
50
  return t;
51
51
  }
52
52
 
53
- var styles = {"component":"date-time-input__component_1nnw3","calendarContainer":"date-time-input__calendarContainer_1nnw3","calendarResponsive":"date-time-input__calendarResponsive_1nnw3","block":"date-time-input__block_1nnw3"};
53
+ var styles = {"component":"date-time-input__component_ff8p7","calendarContainer":"date-time-input__calendarContainer_ff8p7","calendarResponsive":"date-time-input__calendarResponsive_ff8p7","block":"date-time-input__block_ff8p7"};
54
54
  require('./index.css')
55
55
 
56
56
  /* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7zgp1 */
1
+ /* hash: tnwzk */
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-input__component_1nnw3 {
42
+ .date-time-input__component_ff8p7 {
43
43
  display: inline-block;
44
44
  outline: none;
45
45
  position: relative;
46
46
  }
47
- .date-time-input__calendarContainer_1nnw3 {
47
+ .date-time-input__calendarContainer_ff8p7 {
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-input__calendarContainer_1nnw3 {
53
+ .date-time-input__calendarContainer_ff8p7 {
54
54
  width: 100%;
55
55
  min-width: 288px
56
56
  }
57
57
  }
58
- .date-time-input__calendarResponsive_1nnw3 {
58
+ .date-time-input__calendarResponsive_ff8p7 {
59
59
  width: var(--calendar-width);
60
60
  padding: 0 var(--gap-m);
61
61
  }
62
- .date-time-input__block_1nnw3 {
62
+ .date-time-input__block_ff8p7 {
63
63
  width: 100%;
64
64
  }
package/esm/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  export { DateTimeInput } from './Component.js';
2
2
  import 'react';
3
- import 'classnames';
4
3
  import 'react-merge-refs';
5
- import '@alfalab/hooks';
6
- import '@alfalab/core-components-input/esm';
4
+ import 'classnames';
7
5
  import '@alfalab/core-components-calendar/esm';
8
- import '@alfalab/core-components-popover/esm';
9
6
  import '@alfalab/core-components-icon-button/esm';
7
+ import '@alfalab/core-components-input/esm';
8
+ import '@alfalab/core-components-popover/esm';
9
+ import '@alfalab/hooks';
10
10
  import '@alfalab/icons-glyph/CalendarMIcon';
11
- import 'date-fns/parse';
12
11
  import 'date-fns/isValid';
12
+ import 'date-fns/parse';
13
13
  import './utils/format.js';
@@ -1,5 +1,5 @@
1
- import parse from 'date-fns/parse';
2
1
  import dateFnsIsValid from 'date-fns/isValid';
2
+ import parse from 'date-fns/parse';
3
3
 
4
4
  /* eslint-disable no-useless-escape */
5
5
  var DATE_FORMAT = 'dd.MM.yyyy';
@@ -1,3 +1,3 @@
1
- import 'date-fns/parse';
2
1
  import 'date-fns/isValid';
2
+ import 'date-fns/parse';
3
3
  export { DATE_FORMAT, DATE_MASK, format, getDateWithoutTime, getFullDateTime, isCompleteDateInput, isValid, isValidTimeFormat, parseDateString, parseTimestampToDate, setTimeToDate } from './format.js';
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7zgp1 */
1
+ /* hash: tnwzk */
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-input__component_1nnw3 {
42
+ .date-time-input__component_ff8p7 {
43
43
  display: inline-block;
44
44
  outline: none;
45
45
  position: relative;
46
46
  }
47
- .date-time-input__calendarContainer_1nnw3 {
47
+ .date-time-input__calendarContainer_ff8p7 {
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-input__calendarContainer_1nnw3 {
53
+ .date-time-input__calendarContainer_ff8p7 {
54
54
  width: 100%;
55
55
  min-width: 288px
56
56
  }
57
57
  }
58
- .date-time-input__calendarResponsive_1nnw3 {
58
+ .date-time-input__calendarResponsive_ff8p7 {
59
59
  width: var(--calendar-width);
60
60
  padding: 0 var(--gap-m);
61
61
  }
62
- .date-time-input__block_1nnw3 {
62
+ .date-time-input__block_ff8p7 {
63
63
  width: 100%;
64
64
  }
package/index.js CHANGED
@@ -4,16 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var Component = require('./Component.js');
6
6
  require('react');
7
- require('classnames');
8
7
  require('react-merge-refs');
9
- require('@alfalab/hooks');
10
- require('@alfalab/core-components-input');
8
+ require('classnames');
11
9
  require('@alfalab/core-components-calendar');
12
- require('@alfalab/core-components-popover');
13
10
  require('@alfalab/core-components-icon-button');
11
+ require('@alfalab/core-components-input');
12
+ require('@alfalab/core-components-popover');
13
+ require('@alfalab/hooks');
14
14
  require('@alfalab/icons-glyph/CalendarMIcon');
15
- require('date-fns/parse');
16
15
  require('date-fns/isValid');
16
+ require('date-fns/parse');
17
17
  require('./utils/format.js');
18
18
 
19
19
 
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ChangeEvent, ElementType } from "react";
4
+ import { CalendarMobileProps, CalendarProps } from "@alfalab/core-components-calendar";
4
5
  import { InputProps } from "@alfalab/core-components-input";
5
- import { CalendarProps, CalendarMobileProps } from "@alfalab/core-components-calendar";
6
6
  import { PopoverProps } from "@alfalab/core-components-popover";
7
7
  type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
8
8
  /**
@@ -89,7 +89,7 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
89
89
  */
90
90
  block?: boolean;
91
91
  };
92
- declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "size" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
92
+ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
93
93
  /**
94
94
  * Дополнительный класс
95
95
  */
@@ -109,21 +109,21 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
109
109
  /**
110
110
  * Обработчик изменения значения
111
111
  */
112
- onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
112
+ onChange?: ((event: ChangeEvent<HTMLInputElement>, payload: {
113
113
  date: Date;
114
114
  value: string;
115
115
  }) => void) | undefined;
116
116
  /**
117
117
  * Обработчик окончания ввода
118
118
  */
119
- onComplete?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
119
+ onComplete?: ((event: ChangeEvent<HTMLInputElement>, payload: {
120
120
  date: Date;
121
121
  value: string;
122
122
  }) => void) | undefined;
123
123
  /**
124
124
  * Компонент календаря
125
125
  */
126
- Calendar?: React.ComponentClass<CalendarProps, any> | React.FunctionComponent<CalendarProps> | undefined;
126
+ Calendar?: React.ElementType<CalendarProps> | undefined;
127
127
  /**
128
128
  * Доп. пропсы для календаря
129
129
  */
@@ -162,11 +162,11 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Pick<InputProps, "c
162
162
  /**
163
163
  * Позиционирование поповера с календарем
164
164
  */
165
- popoverPosition?: "right" | "left" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined;
165
+ popoverPosition?: PopoverProps['position'];
166
166
  /**
167
167
  * z-index Popover
168
168
  */
169
- zIndexPopover?: number | undefined;
169
+ zIndexPopover?: PopoverProps['zIndex'];
170
170
  /**
171
171
  * Запрещает поповеру менять свою позицию.
172
172
  * Например, если места снизу недостаточно,то он все равно будет показан снизу
@@ -1,17 +1,17 @@
1
1
  import React, { useRef, useState, useEffect } from 'react';
2
- import cn from 'classnames';
3
2
  import mergeRefs from 'react-merge-refs';
4
- import { useMedia } from '@alfalab/hooks';
5
- import { Input } from '@alfalab/core-components-input/modern';
3
+ import cn from 'classnames';
6
4
  import { Calendar, CalendarMobile, dateInLimits } from '@alfalab/core-components-calendar/modern';
7
- import { Popover } from '@alfalab/core-components-popover/modern';
8
5
  import { IconButton } from '@alfalab/core-components-icon-button/modern';
6
+ import { Input } from '@alfalab/core-components-input/modern';
7
+ import { Popover } from '@alfalab/core-components-popover/modern';
8
+ import { useMedia } from '@alfalab/hooks';
9
9
  import { CalendarMIcon } from '@alfalab/icons-glyph/CalendarMIcon';
10
- import 'date-fns/parse';
11
10
  import 'date-fns/isValid';
11
+ import 'date-fns/parse';
12
12
  import { getDateWithoutTime, setTimeToDate, DATE_MASK, format, getFullDateTime, isCompleteDateInput, isValid, parseTimestampToDate } from './utils/format.js';
13
13
 
14
- var styles = {"component":"date-time-input__component_1nnw3","calendarContainer":"date-time-input__calendarContainer_1nnw3","calendarResponsive":"date-time-input__calendarResponsive_1nnw3","block":"date-time-input__block_1nnw3"};
14
+ var styles = {"component":"date-time-input__component_ff8p7","calendarContainer":"date-time-input__calendarContainer_ff8p7","calendarResponsive":"date-time-input__calendarResponsive_ff8p7","block":"date-time-input__block_ff8p7"};
15
15
  require('./index.css')
16
16
 
17
17
  /* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
@@ -113,13 +113,13 @@ const DateTimeInput = React.forwardRef(({ className, inputClassName, popoverClas
113
113
  const renderCalendar = () => (
114
114
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
115
115
  React.createElement("div", { onMouseDown: handleCalendarWrapperMouseDown },
116
- React.createElement(CalendarComponent, Object.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 }))));
116
+ React.createElement(CalendarComponent, { ...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 })));
117
117
  return (React.createElement("div", { className: cn(styles.component, className, {
118
118
  [styles.block]: block,
119
119
  }), onClick: inputDisabled ? undefined : handleInputWrapperClick, onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
120
- React.createElement(Input, Object.assign({}, restProps, { block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, error: error, rightAddons: React.createElement(React.Fragment, null,
120
+ React.createElement(Input, { ...restProps, block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, error: error, rightAddons: React.createElement(React.Fragment, null,
121
121
  rightAddons,
122
- picker && (React.createElement(IconButton, { onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 'xxs' }))) })),
122
+ picker && (React.createElement(IconButton, { onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 'xxs' }))) }),
123
123
  picker && (React.createElement(Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn(styles.calendarContainer, {
124
124
  [styles.calendarResponsive]: calendarResponsive,
125
125
  }), className: popoverClassName, position: popoverPosition, offset: [0, 8], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar()))));
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7zgp1 */
1
+ /* hash: tnwzk */
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-input__component_1nnw3 {
42
+ .date-time-input__component_ff8p7 {
43
43
  display: inline-block;
44
44
  outline: none;
45
45
  position: relative;
46
46
  }
47
- .date-time-input__calendarContainer_1nnw3 {
47
+ .date-time-input__calendarContainer_ff8p7 {
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-input__calendarContainer_1nnw3 {
53
+ .date-time-input__calendarContainer_ff8p7 {
54
54
  width: 100%;
55
55
  min-width: 288px
56
56
  }
57
57
  }
58
- .date-time-input__calendarResponsive_1nnw3 {
58
+ .date-time-input__calendarResponsive_ff8p7 {
59
59
  width: var(--calendar-width);
60
60
  padding: 0 var(--gap-m);
61
61
  }
62
- .date-time-input__block_1nnw3 {
62
+ .date-time-input__block_ff8p7 {
63
63
  width: 100%;
64
64
  }
package/modern/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import 'react';
2
- import 'classnames';
3
2
  import 'react-merge-refs';
4
- import '@alfalab/hooks';
5
- import '@alfalab/core-components-input/modern';
3
+ import 'classnames';
6
4
  import '@alfalab/core-components-calendar/modern';
7
- import '@alfalab/core-components-popover/modern';
8
5
  import '@alfalab/core-components-icon-button/modern';
6
+ import '@alfalab/core-components-input/modern';
7
+ import '@alfalab/core-components-popover/modern';
8
+ import '@alfalab/hooks';
9
9
  import '@alfalab/icons-glyph/CalendarMIcon';
10
- import 'date-fns/parse';
11
10
  import 'date-fns/isValid';
11
+ import 'date-fns/parse';
12
12
  import './utils/format.js';
13
13
  export { DateTimeInput } from './Component.js';
@@ -1,5 +1,5 @@
1
- import parse from 'date-fns/parse';
2
1
  import dateFnsIsValid from 'date-fns/isValid';
2
+ import parse from 'date-fns/parse';
3
3
 
4
4
  /* eslint-disable no-useless-escape */
5
5
  const DATE_FORMAT = 'dd.MM.yyyy';
@@ -1,3 +1,3 @@
1
- import 'date-fns/parse';
2
1
  import 'date-fns/isValid';
2
+ import 'date-fns/parse';
3
3
  export { DATE_FORMAT, DATE_MASK, format, getDateWithoutTime, getFullDateTime, isCompleteDateInput, isValid, isValidTimeFormat, parseDateString, parseTimestampToDate, setTimeToDate } from './format.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-date-time-input",
3
- "version": "1.1.4",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -15,9 +15,9 @@
15
15
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@alfalab/core-components-calendar": "^6.1.8",
19
- "@alfalab/core-components-input": "^10.2.5",
20
- "@alfalab/core-components-icon-button": "^5.0.5",
18
+ "@alfalab/core-components-calendar": "^6.1.9",
19
+ "@alfalab/core-components-input": "^11.0.0",
20
+ "@alfalab/core-components-icon-button": "^6.0.0",
21
21
  "@alfalab/core-components-popover": "^6.0.2",
22
22
  "classnames": "^2.3.1"
23
23
  }
package/utils/format.js CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var parse = require('date-fns/parse');
6
5
  var dateFnsIsValid = require('date-fns/isValid');
6
+ var parse = require('date-fns/parse');
7
7
 
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
10
- var parse__default = /*#__PURE__*/_interopDefaultLegacy(parse);
11
10
  var dateFnsIsValid__default = /*#__PURE__*/_interopDefaultLegacy(dateFnsIsValid);
11
+ var parse__default = /*#__PURE__*/_interopDefaultLegacy(parse);
12
12
 
13
13
  /* eslint-disable no-useless-escape */
14
14
  var DATE_FORMAT = 'dd.MM.yyyy';
package/utils/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('date-fns/parse');
6
5
  require('date-fns/isValid');
6
+ require('date-fns/parse');
7
7
  var utils_format = require('./format.js');
8
8
 
9
9