@alfalab/core-components-date-range-input 3.0.10 → 3.0.12
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-72308007.d.ts → Component-10db897e.d.ts} +2 -2
- package/Component-89f0cb07.d.ts +38 -0
- package/{cssm/Component-8b5756fe.d.ts → Component-b5b4c59f.d.ts} +4 -3
- package/Component.desktop-0aa4e915.d.ts +5 -0
- package/Component.desktop-785df74d.d.ts +6 -0
- package/{esm/Component.desktop-8b5756fe.d.ts → Component.desktop-b5b4c59f.d.ts} +13 -5
- package/Component.desktop.js +1 -1
- package/Component.mobile-16b1285a.d.ts +5 -0
- package/Component.mobile-d7e9f69d.d.ts +6 -0
- package/Component.mobile-ebda875c.d.ts +5 -4
- package/Component.mobile.js +1 -1
- package/Component.responsive-0aa4e915.d.ts +5 -0
- package/Component.responsive-785df74d.d.ts +26 -0
- package/Component.responsive.js +1 -1
- package/components/date-range-input/Component.js +10 -8
- package/components/date-range-input/index.css +7 -7
- package/components/date-range-input/index.js +1 -1
- package/{Component-72308007.d.ts → cssm/Component-10db897e.d.ts} +2 -2
- package/cssm/Component-89f0cb07.d.ts +38 -0
- package/{esm/Component-8b5756fe.d.ts → cssm/Component-b5b4c59f.d.ts} +4 -3
- package/cssm/Component.desktop-0aa4e915.d.ts +5 -0
- package/cssm/Component.desktop-785df74d.d.ts +6 -0
- package/{Component.desktop-8b5756fe.d.ts → cssm/Component.desktop-b5b4c59f.d.ts} +13 -5
- package/cssm/Component.desktop.js +1 -1
- package/cssm/Component.mobile-16b1285a.d.ts +5 -0
- package/cssm/Component.mobile-d7e9f69d.d.ts +6 -0
- package/cssm/Component.mobile-ebda875c.d.ts +5 -4
- package/cssm/Component.mobile.js +1 -1
- package/cssm/Component.responsive-0aa4e915.d.ts +5 -0
- package/cssm/Component.responsive-785df74d.d.ts +26 -0
- package/cssm/Component.responsive.js +1 -1
- package/cssm/components/date-range-input/Component.js +9 -7
- package/cssm/components/date-range-input/index.js +1 -1
- package/cssm/desktop-63dec22f.d.ts +1 -1
- package/cssm/desktop-69921c40.d.ts +2 -0
- package/cssm/desktop.js +1 -1
- package/{esm/index-72308007.d.ts → cssm/index-10db897e.d.ts} +1 -5
- package/{Component.responsive-2e2b2125.d.ts → cssm/index-3109f463.d.ts} +1 -5
- package/cssm/index-89f0cb07.d.ts +2 -0
- package/cssm/index-f034f741.d.ts +1 -1
- package/cssm/index.js +1 -1
- package/cssm/mobile-c219f8ca.d.ts +1 -1
- package/cssm/mobile.js +1 -1
- package/{esm/types-83e2bd9e.d.ts → cssm/types-1c79e231.d.ts} +1 -1
- package/{modern/typings-9211a437.d.ts → cssm/typings-89f0cb07.d.ts} +5 -7
- package/desktop-63dec22f.d.ts +1 -1
- package/desktop-69921c40.d.ts +2 -0
- package/desktop.js +1 -1
- package/esm/Component-10db897e.d.ts +297 -0
- package/esm/Component-89f0cb07.d.ts +38 -0
- package/{Component-8b5756fe.d.ts → esm/Component-b5b4c59f.d.ts} +4 -3
- package/esm/Component.desktop-0aa4e915.d.ts +5 -0
- package/esm/Component.desktop-785df74d.d.ts +6 -0
- package/{cssm/Component.desktop-8b5756fe.d.ts → esm/Component.desktop-b5b4c59f.d.ts} +14 -13
- package/esm/Component.desktop.js +1 -1
- package/esm/Component.mobile-89f0cb07.d.ts +5 -0
- package/esm/Component.mobile-d7e9f69d.d.ts +6 -0
- package/esm/Component.mobile-ebda875c.d.ts +5 -4
- package/esm/Component.mobile.js +1 -1
- package/esm/Component.responsive-0aa4e915.d.ts +5 -0
- package/esm/Component.responsive-785df74d.d.ts +26 -0
- package/esm/Component.responsive.js +1 -1
- package/esm/components/date-range-input/Component.js +7 -6
- package/esm/components/date-range-input/index.css +7 -7
- package/esm/components/date-range-input/index.js +1 -1
- package/esm/desktop-63dec22f.d.ts +1 -1
- package/esm/desktop-69921c40.d.ts +2 -0
- package/esm/desktop.js +1 -1
- package/{index-72308007.d.ts → esm/index-10db897e.d.ts} +1 -5
- package/{cssm/Component.responsive-2e2b2125.d.ts → esm/index-3109f463.d.ts} +1 -5
- package/esm/index-89f0cb07.d.ts +2 -0
- package/esm/index-ebda875c.d.ts +1 -34
- package/esm/index-f034f741.d.ts +5 -2
- package/esm/index.js +1 -1
- package/esm/mobile-c219f8ca.d.ts +1 -1
- package/esm/mobile.js +1 -1
- package/{cssm/types-83e2bd9e.d.ts → esm/types-1c79e231.d.ts} +1 -1
- package/{typings-9211a437.d.ts → esm/typings-89f0cb07.d.ts} +5 -7
- package/{cssm/index-72308007.d.ts → index-10db897e.d.ts} +1 -5
- package/{modern/Component.responsive-2e2b2125.d.ts → index-3109f463.d.ts} +1 -5
- package/index-89f0cb07.d.ts +2 -0
- package/index-f034f741.d.ts +1 -1
- package/index.js +1 -1
- package/mobile-c219f8ca.d.ts +1 -1
- package/mobile.js +1 -1
- package/{cssm/Component-72308007.d.ts → modern/Component-10db897e.d.ts} +2 -2
- package/modern/Component-89f0cb07.d.ts +38 -0
- package/modern/{Component-8b5756fe.d.ts → Component-b5b4c59f.d.ts} +4 -3
- package/modern/Component.desktop-0aa4e915.d.ts +5 -0
- package/modern/Component.desktop-785df74d.d.ts +6 -0
- package/modern/{Component.desktop-8b5756fe.d.ts → Component.desktop-b5b4c59f.d.ts} +13 -5
- package/modern/Component.desktop.js +1 -1
- package/modern/Component.mobile-16b1285a.d.ts +5 -0
- package/modern/Component.mobile-d7e9f69d.d.ts +6 -0
- package/modern/Component.mobile-ebda875c.d.ts +5 -4
- package/modern/Component.mobile.js +1 -1
- package/modern/Component.responsive-0aa4e915.d.ts +5 -0
- package/modern/Component.responsive-785df74d.d.ts +26 -0
- package/modern/Component.responsive.js +1 -1
- package/modern/components/date-range-input/Component.js +7 -6
- package/modern/components/date-range-input/index.css +7 -7
- package/modern/components/date-range-input/index.js +1 -1
- package/modern/desktop-63dec22f.d.ts +1 -1
- package/modern/desktop-69921c40.d.ts +2 -0
- package/modern/desktop.js +1 -1
- package/modern/{index-72308007.d.ts → index-10db897e.d.ts} +1 -5
- package/{esm/Component.responsive-2e2b2125.d.ts → modern/index-3109f463.d.ts} +1 -5
- package/modern/index-89f0cb07.d.ts +2 -0
- package/modern/index-f034f741.d.ts +1 -1
- package/modern/index.js +1 -1
- package/modern/mobile-c219f8ca.d.ts +1 -1
- package/modern/mobile.js +1 -1
- package/modern/{types-83e2bd9e.d.ts → types-1c79e231.d.ts} +1 -1
- package/{esm/typings-9211a437.d.ts → modern/typings-89f0cb07.d.ts} +5 -7
- package/package.json +4 -4
- package/src/components/date-range-input/Component.tsx +23 -19
- package/{types-83e2bd9e.d.ts → types-1c79e231.d.ts} +1 -1
- package/{cssm/typings-9211a437.d.ts → typings-89f0cb07.d.ts} +5 -7
- package/Component.desktop-2e2b2125.d.ts +0 -6
- package/Component.mobile-755fbaa3.d.ts +0 -6
- package/cssm/Component.desktop-2e2b2125.d.ts +0 -6
- package/cssm/Component.mobile-755fbaa3.d.ts +0 -6
- package/cssm/index-9211a437.d.ts +0 -2
- package/esm/Component.desktop-2e2b2125.d.ts +0 -6
- package/esm/Component.mobile-755fbaa3.d.ts +0 -6
- package/esm/index-9211a437.d.ts +0 -2
- package/index-9211a437.d.ts +0 -2
- package/modern/Component-72308007.d.ts +0 -6
- package/modern/Component.desktop-2e2b2125.d.ts +0 -6
- package/modern/Component.mobile-755fbaa3.d.ts +0 -6
- package/modern/index-9211a437.d.ts +0 -2
- /package/{Component-63dec22f.d.ts → Component-69921c40.d.ts} +0 -0
- /package/cssm/{Component-63dec22f.d.ts → Component-69921c40.d.ts} +0 -0
- /package/esm/{Component-63dec22f.d.ts → Component-69921c40.d.ts} +0 -0
- /package/modern/{Component-63dec22f.d.ts → Component-69921c40.d.ts} +0 -0
|
@@ -8,8 +8,8 @@ import '@alfalab/core-components-input/esm/desktop';
|
|
|
8
8
|
import './components/date-range-input/Component.js';
|
|
9
9
|
import 'react-merge-refs';
|
|
10
10
|
import 'classnames';
|
|
11
|
-
import 'date-fns';
|
|
12
11
|
import 'date-fns/isValid';
|
|
12
|
+
import 'date-fns/startOfMonth';
|
|
13
13
|
import '@alfalab/core-components-calendar/esm/shared';
|
|
14
14
|
import '@alfalab/core-components-icon-button/esm';
|
|
15
15
|
import '@alfalab/core-components-popover/esm';
|
|
@@ -2,8 +2,8 @@ import { __rest, __assign } from 'tslib';
|
|
|
2
2
|
import React, { useRef, useState, useEffect } from 'react';
|
|
3
3
|
import mergeRefs from 'react-merge-refs';
|
|
4
4
|
import cn from 'classnames';
|
|
5
|
-
import { startOfMonth } from 'date-fns';
|
|
6
5
|
import dateFnsIsValid from 'date-fns/isValid';
|
|
6
|
+
import startOfMonth from 'date-fns/startOfMonth';
|
|
7
7
|
import { usePeriod } from '@alfalab/core-components-calendar/esm/shared';
|
|
8
8
|
import { IconButton } from '@alfalab/core-components-icon-button/esm';
|
|
9
9
|
import { Popover } from '@alfalab/core-components-popover/esm';
|
|
@@ -12,7 +12,7 @@ import { CalendarMIcon } from '@alfalab/icons-glyph/CalendarMIcon';
|
|
|
12
12
|
import { parseTimestampToDate, DATE_FORMAT, format, parseDateString, DATE_MASK, isCompleteDateInput, isValid } from '../../utils/format.js';
|
|
13
13
|
import 'date-fns/parse';
|
|
14
14
|
|
|
15
|
-
var styles = {"component":"date-range-
|
|
15
|
+
var styles = {"component":"date-range-input__component_1hqhh","calendarContainer":"date-range-input__calendarContainer_1hqhh","calendarResponsive":"date-range-input__calendarResponsive_1hqhh","block":"date-range-input__block_1hqhh","calendarIcon":"date-range-input__calendarIcon_1hqhh"};
|
|
16
16
|
require('./index.css')
|
|
17
17
|
|
|
18
18
|
var DateRangeInput = React.forwardRef(function (_a, ref) {
|
|
@@ -203,12 +203,13 @@ var DateRangeInput = React.forwardRef(function (_a, ref) {
|
|
|
203
203
|
return (React.createElement("div", { className: cn(styles.component, className, (_b = {},
|
|
204
204
|
_b[styles.block] = block,
|
|
205
205
|
_b)), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
206
|
-
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, rightAddons: React.createElement(React.Fragment, null,
|
|
206
|
+
InputComponent ? (React.createElement(InputComponent, __assign({ autoComplete: picker ? 'off' : undefined }, restProps, { block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, disableUserInput: disableUserInput, rightAddons: React.createElement(React.Fragment, null,
|
|
207
207
|
rightAddons,
|
|
208
208
|
picker && (React.createElement(IconButton, { className: styles.calendarIcon, ref: iconRef, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 's' }))) }))) : null,
|
|
209
|
-
picker &&
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
picker &&
|
|
210
|
+
(view === 'desktop' ? (React.createElement(Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn(styles.calendarContainer, (_c = {},
|
|
211
|
+
_c[styles.calendarResponsive] = calendarResponsive,
|
|
212
|
+
_c)), className: popoverClassName, position: popoverPosition, offset: [0, 8], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar())) : (renderCalendar()))));
|
|
212
213
|
});
|
|
213
214
|
|
|
214
215
|
export { DateRangeInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1vwf3 */
|
|
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-range-
|
|
44
|
+
} .date-range-input__component_1hqhh {
|
|
45
45
|
display: inline-block;
|
|
46
46
|
outline: none;
|
|
47
47
|
position: relative;
|
|
48
|
-
} .date-range-
|
|
48
|
+
} .date-range-input__calendarContainer_1hqhh {
|
|
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-range-
|
|
53
|
+
} @media (max-width: 374px) { .date-range-input__calendarContainer_1hqhh {
|
|
54
54
|
width: 100%;
|
|
55
55
|
min-width: 288px
|
|
56
56
|
}
|
|
57
|
-
} .date-range-
|
|
57
|
+
} .date-range-input__calendarResponsive_1hqhh {
|
|
58
58
|
width: var(--calendar-width);
|
|
59
|
-
} .date-range-
|
|
59
|
+
} .date-range-input__block_1hqhh {
|
|
60
60
|
width: 100%;
|
|
61
|
-
} .date-range-
|
|
61
|
+
} .date-range-input__calendarIcon_1hqhh {
|
|
62
62
|
margin-right: var(--gap-s-neg);
|
|
63
63
|
height: 100%;
|
|
64
64
|
}
|
|
@@ -3,8 +3,8 @@ import 'tslib';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react-merge-refs';
|
|
5
5
|
import 'classnames';
|
|
6
|
-
import 'date-fns';
|
|
7
6
|
import 'date-fns/isValid';
|
|
7
|
+
import 'date-fns/startOfMonth';
|
|
8
8
|
import '@alfalab/core-components-calendar/esm/shared';
|
|
9
9
|
import '@alfalab/core-components-icon-button/esm';
|
|
10
10
|
import '@alfalab/core-components-popover/esm';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Component.desktop-
|
|
1
|
+
export * from "./Component.desktop-b5b4c59f";
|
|
2
2
|
export {};
|
package/esm/desktop.js
CHANGED
|
@@ -6,8 +6,8 @@ import '@alfalab/core-components-input/esm/desktop';
|
|
|
6
6
|
import './components/date-range-input/Component.js';
|
|
7
7
|
import 'react-merge-refs';
|
|
8
8
|
import 'classnames';
|
|
9
|
-
import 'date-fns';
|
|
10
9
|
import 'date-fns/isValid';
|
|
10
|
+
import 'date-fns/startOfMonth';
|
|
11
11
|
import '@alfalab/core-components-calendar/esm/shared';
|
|
12
12
|
import '@alfalab/core-components-icon-button/esm';
|
|
13
13
|
import '@alfalab/core-components-popover/esm';
|
|
@@ -10,10 +10,6 @@ declare function easeInOutQuad(x: number): number;
|
|
|
10
10
|
declare const easingFns: {
|
|
11
11
|
easeInOutQuad: typeof easeInOutQuad;
|
|
12
12
|
};
|
|
13
|
-
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
14
|
-
declare const inputUtils: {
|
|
15
|
-
disableUserInput: typeof disableUserInput;
|
|
16
|
-
};
|
|
17
13
|
/**
|
|
18
14
|
* Возвращает true, если значение равно null или undefined
|
|
19
15
|
*/
|
|
@@ -51,4 +47,4 @@ declare const maskUtils: {
|
|
|
51
47
|
prefixPostprocessor: typeof prefixPostprocessor;
|
|
52
48
|
caretGuard: typeof caretGuard;
|
|
53
49
|
};
|
|
54
|
-
export { isClient, getDataTestId, createPaddingStyle, easingFns,
|
|
50
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, fnUtils, maskUtils };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
1
|
import { FC, ReactNode } from "react";
|
|
4
|
-
import { ButtonProps } from "./typings-9211a437";
|
|
5
2
|
type MqProps = {
|
|
6
3
|
/**
|
|
7
4
|
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
@@ -62,5 +59,4 @@ declare const _exports: {
|
|
|
62
59
|
"--desktop-xl": string;
|
|
63
60
|
"--desktop": string;
|
|
64
61
|
};
|
|
65
|
-
|
|
66
|
-
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported, Button };
|
|
62
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported };
|
package/esm/index-ebda875c.d.ts
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
import { ButtonHTMLAttributes, ElementType, FC } from "react";
|
|
4
|
-
interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
-
/**
|
|
6
|
-
* Вид компонента
|
|
7
|
-
*/
|
|
8
|
-
view: "desktop" | "mobile";
|
|
9
|
-
/**
|
|
10
|
-
* Дополнительный класс
|
|
11
|
-
*/
|
|
12
|
-
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Позиция крестика
|
|
15
|
-
*/
|
|
16
|
-
align?: "left" | "right";
|
|
17
|
-
/**
|
|
18
|
-
* Фиксирует крестик
|
|
19
|
-
*/
|
|
20
|
-
sticky?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Иконка
|
|
23
|
-
*/
|
|
24
|
-
icon?: ElementType;
|
|
25
|
-
/**
|
|
26
|
-
* Идентификатор для систем автоматизированного тестирования
|
|
27
|
-
*/
|
|
28
|
-
dataTestId?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Коллбэк закрытия.
|
|
31
|
-
*/
|
|
32
|
-
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
|
|
33
|
-
}
|
|
34
|
-
declare const Closer: FC<CloserProps>;
|
|
35
|
-
export { CloserProps, Closer };
|
|
2
|
+
export * from "./Component-10db897e";
|
package/esm/index-f034f741.d.ts
CHANGED
|
@@ -76,5 +76,8 @@ type PeriodSliderProps = {
|
|
|
76
76
|
dataTestId?: string;
|
|
77
77
|
};
|
|
78
78
|
declare const PeriodSlider: FC<PeriodSliderProps>;
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
declare const shiftValues: (valueFrom: Date, valueTo: Date, periodType: PeriodType, direction: "prev" | "next") => {
|
|
80
|
+
valueFrom: Date;
|
|
81
|
+
valueTo: Date;
|
|
82
|
+
};
|
|
83
|
+
export { PeriodType, PeriodSliderProps, PeriodSlider, shiftValues };
|
package/esm/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import '@alfalab/core-components-input/esm/desktop';
|
|
|
8
8
|
import './components/date-range-input/Component.js';
|
|
9
9
|
import 'react-merge-refs';
|
|
10
10
|
import 'classnames';
|
|
11
|
-
import 'date-fns';
|
|
12
11
|
import 'date-fns/isValid';
|
|
12
|
+
import 'date-fns/startOfMonth';
|
|
13
13
|
import '@alfalab/core-components-calendar/esm/shared';
|
|
14
14
|
import '@alfalab/core-components-icon-button/esm';
|
|
15
15
|
import '@alfalab/core-components-popover/esm';
|
package/esm/mobile-c219f8ca.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Component-
|
|
1
|
+
export * from "./Component-b5b4c59f";
|
package/esm/mobile.js
CHANGED
|
@@ -6,8 +6,8 @@ import '@alfalab/core-components-input/esm/mobile';
|
|
|
6
6
|
import './components/date-range-input/Component.js';
|
|
7
7
|
import 'react-merge-refs';
|
|
8
8
|
import 'classnames';
|
|
9
|
-
import 'date-fns';
|
|
10
9
|
import 'date-fns/isValid';
|
|
10
|
+
import 'date-fns/startOfMonth';
|
|
11
11
|
import '@alfalab/core-components-calendar/esm/shared';
|
|
12
12
|
import '@alfalab/core-components-icon-button/esm';
|
|
13
13
|
import '@alfalab/core-components-popover/esm';
|
|
@@ -69,6 +69,8 @@ type ComponentProps = {
|
|
|
69
69
|
* Дочерние элементы.
|
|
70
70
|
*/
|
|
71
71
|
children?: ReactNode;
|
|
72
|
+
};
|
|
73
|
+
type PrivateButtonProps = {
|
|
72
74
|
/**
|
|
73
75
|
* Основные стили компонента.
|
|
74
76
|
*/
|
|
@@ -80,16 +82,12 @@ type ComponentProps = {
|
|
|
80
82
|
*/
|
|
81
83
|
colorStylesMap: StyleColors;
|
|
82
84
|
};
|
|
83
|
-
type
|
|
84
|
-
type
|
|
85
|
-
type BaseButtonProps = Partial<AnchorBaseButtonProps | NativeBaseButtonProps>;
|
|
86
|
-
type AnchorButtonProps = Omit<BaseButtonProps, 'styles' | 'colorStylesMap'> & AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
87
|
-
type NativeButtonProps = Omit<BaseButtonProps, 'styles' | 'colorStylesMap'> & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
88
|
-
type ButtonProps = Partial<AnchorButtonProps | NativeButtonProps> & {
|
|
85
|
+
type CommonButtonProps = ComponentProps & Partial<AnchorHTMLAttributes<HTMLAnchorElement> | ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
86
|
+
type ButtonProps = CommonButtonProps & {
|
|
89
87
|
/**
|
|
90
88
|
* Контрольная точка, с нее начинается desktop версия
|
|
91
89
|
* @default 1024
|
|
92
90
|
*/
|
|
93
91
|
breakpoint?: number;
|
|
94
92
|
};
|
|
95
|
-
export { StyleColors, ComponentProps,
|
|
93
|
+
export { StyleColors, ComponentProps, PrivateButtonProps, CommonButtonProps, ButtonProps };
|
|
@@ -10,10 +10,6 @@ declare function easeInOutQuad(x: number): number;
|
|
|
10
10
|
declare const easingFns: {
|
|
11
11
|
easeInOutQuad: typeof easeInOutQuad;
|
|
12
12
|
};
|
|
13
|
-
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
14
|
-
declare const inputUtils: {
|
|
15
|
-
disableUserInput: typeof disableUserInput;
|
|
16
|
-
};
|
|
17
13
|
/**
|
|
18
14
|
* Возвращает true, если значение равно null или undefined
|
|
19
15
|
*/
|
|
@@ -51,4 +47,4 @@ declare const maskUtils: {
|
|
|
51
47
|
prefixPostprocessor: typeof prefixPostprocessor;
|
|
52
48
|
caretGuard: typeof caretGuard;
|
|
53
49
|
};
|
|
54
|
-
export { isClient, getDataTestId, createPaddingStyle, easingFns,
|
|
50
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, fnUtils, maskUtils };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
1
|
import { FC, ReactNode } from "react";
|
|
4
|
-
import { ButtonProps } from "./typings-9211a437";
|
|
5
2
|
type MqProps = {
|
|
6
3
|
/**
|
|
7
4
|
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
@@ -62,5 +59,4 @@ declare const _exports: {
|
|
|
62
59
|
"--desktop-xl": string;
|
|
63
60
|
"--desktop": string;
|
|
64
61
|
};
|
|
65
|
-
|
|
66
|
-
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported, Button };
|
|
62
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported };
|
package/index-f034f741.d.ts
CHANGED
|
@@ -77,4 +77,4 @@ type PeriodSliderProps = {
|
|
|
77
77
|
};
|
|
78
78
|
declare const PeriodSlider: FC<PeriodSliderProps>;
|
|
79
79
|
export { PeriodType, PeriodSliderProps, PeriodSlider };
|
|
80
|
-
export { shiftValues } from "./Component.desktop-
|
|
80
|
+
export { shiftValues } from "./Component.desktop-b5b4c59f";
|
package/index.js
CHANGED
|
@@ -12,8 +12,8 @@ require('@alfalab/core-components-input/desktop');
|
|
|
12
12
|
require('./components/date-range-input/Component.js');
|
|
13
13
|
require('react-merge-refs');
|
|
14
14
|
require('classnames');
|
|
15
|
-
require('date-fns');
|
|
16
15
|
require('date-fns/isValid');
|
|
16
|
+
require('date-fns/startOfMonth');
|
|
17
17
|
require('@alfalab/core-components-calendar/shared');
|
|
18
18
|
require('@alfalab/core-components-icon-button');
|
|
19
19
|
require('@alfalab/core-components-popover');
|
package/mobile-c219f8ca.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Component-
|
|
1
|
+
export * from "./Component-b5b4c59f";
|
package/mobile.js
CHANGED
|
@@ -10,8 +10,8 @@ require('@alfalab/core-components-input/mobile');
|
|
|
10
10
|
require('./components/date-range-input/Component.js');
|
|
11
11
|
require('react-merge-refs');
|
|
12
12
|
require('classnames');
|
|
13
|
-
require('date-fns');
|
|
14
13
|
require('date-fns/isValid');
|
|
14
|
+
require('date-fns/startOfMonth');
|
|
15
15
|
require('@alfalab/core-components-calendar/shared');
|
|
16
16
|
require('@alfalab/core-components-icon-button');
|
|
17
17
|
require('@alfalab/core-components-popover');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { NavigationBarProps } from "./types-
|
|
3
|
+
import { NavigationBarProps } from "./types-1c79e231";
|
|
4
4
|
declare const NavigationBar: React.ForwardRefExoticComponent<NavigationBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
export * from "./Component-
|
|
5
|
+
export * from "./Component-69921c40";
|
|
6
6
|
export { NavigationBar };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
import { CommonButtonProps, PrivateButtonProps } from "./typings-89f0cb07";
|
|
5
|
+
type SpinnerProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Управление видимостью компонента
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Размер компонента
|
|
12
|
+
*/
|
|
13
|
+
size?: "xs" | "s" | "m";
|
|
14
|
+
/**
|
|
15
|
+
* Дополнительный класс
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Идентификатор компонента в DOM
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
24
|
+
*/
|
|
25
|
+
dataTestId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Палитра, в контексте которой используется спиннер
|
|
28
|
+
*/
|
|
29
|
+
colors?: "default" | "inverted";
|
|
30
|
+
};
|
|
31
|
+
declare const Spinner: FC<SpinnerProps>;
|
|
32
|
+
/**
|
|
33
|
+
* Минимальное время отображения лоадера - 500мс,
|
|
34
|
+
* чтобы при быстрых ответах от сервера кнопка не «моргала».
|
|
35
|
+
*/
|
|
36
|
+
declare const LOADER_MIN_DISPLAY_INTERVAL = 500;
|
|
37
|
+
declare const BaseButton: React.ForwardRefExoticComponent<(CommonButtonProps & PrivateButtonProps) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
38
|
+
export { SpinnerProps, Spinner, LOADER_MIN_DISPLAY_INTERVAL, BaseButton };
|
|
@@ -4,8 +4,8 @@ import React from "react";
|
|
|
4
4
|
import { ReactNode, FC, KeyboardEvent, MouseEvent, MutableRefObject, Ref, RefObject } from "react";
|
|
5
5
|
import { TransitionProps } from "react-transition-group/Transition";
|
|
6
6
|
import { CSSTransitionClassNames } from "react-transition-group/CSSTransition";
|
|
7
|
-
import { NavigationBarProps } from "./types-
|
|
8
|
-
import { CalendarDesktopProps } from "./Component.desktop-
|
|
7
|
+
import { NavigationBarProps } from "./types-1c79e231";
|
|
8
|
+
import { CalendarDesktopProps } from "./Component.desktop-b5b4c59f";
|
|
9
9
|
type BackdropProps = Partial<TransitionProps> & {
|
|
10
10
|
/**
|
|
11
11
|
* Прозрачный бэкдроп
|
|
@@ -383,6 +383,7 @@ declare const CalendarMobile: React.ForwardRefExoticComponent<CalendarDesktopPro
|
|
|
383
383
|
*/
|
|
384
384
|
allowSelectionFromEmptyRange?: boolean | undefined;
|
|
385
385
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
386
|
-
export
|
|
386
|
+
export { ButtonMobile } from "./Component.mobile-16b1285a";
|
|
387
|
+
export type { CommonButtonProps as ButtonMobileProps } from "./typings-89f0cb07";
|
|
387
388
|
export { ModalMobile, ModalMobileProps, Content, ResponsiveContext, Modal, ModalContext, stackingOrder, StackingContext, StackProps, Stack, PORTAL_CONTAINER_ATTRIBUTE, getDefaultPortalContainer, setRef, getModalStore, GlobalStore, CalendarMobileProps, CalendarMobile };
|
|
388
389
|
export type { SavedStyle };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CommonButtonProps } from "./typings-89f0cb07";
|
|
4
|
+
declare const ButtonDesktop: React.ForwardRefExoticComponent<CommonButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
5
|
+
export { ButtonDesktop };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlDesktopProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'>;
|
|
5
|
+
declare const FormControlDesktop: React.ForwardRefExoticComponent<FormControlDesktopProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { FormControlDesktopProps, FormControlDesktop };
|
|
@@ -16,6 +16,10 @@ type HeaderProps = {
|
|
|
16
16
|
* Дочерние элементы.
|
|
17
17
|
*/
|
|
18
18
|
children?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Дополнительный класс
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
19
23
|
};
|
|
20
24
|
declare const Header: FC<HeaderProps>;
|
|
21
25
|
type MonthYearHeaderProps = {
|
|
@@ -79,10 +83,6 @@ type YearsTableProps = {
|
|
|
79
83
|
* Доп. пропсы для переданного года
|
|
80
84
|
*/
|
|
81
85
|
getYearProps: (year: Date) => Record<string, unknown>;
|
|
82
|
-
/**
|
|
83
|
-
* Обработчик скролла
|
|
84
|
-
*/
|
|
85
|
-
onScroll: (scrollTop: number) => void;
|
|
86
86
|
/**
|
|
87
87
|
* Должен ли календарь подстраиваться под ширину родителя.
|
|
88
88
|
*/
|
|
@@ -94,6 +94,14 @@ type CalendarDesktopProps = {
|
|
|
94
94
|
* Дополнительный класс
|
|
95
95
|
*/
|
|
96
96
|
className?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Дополнительный класс шапки десктопного календаря
|
|
99
|
+
*/
|
|
100
|
+
headerClassName?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Дополнительный класс контента десктопного календаря
|
|
103
|
+
*/
|
|
104
|
+
contentClassName?: string;
|
|
97
105
|
/**
|
|
98
106
|
* Вид по умолчанию (выбор дней, месяцев, лет)
|
|
99
107
|
*/
|
|
@@ -194,4 +202,4 @@ type CalendarDesktopProps = {
|
|
|
194
202
|
};
|
|
195
203
|
declare const CalendarDesktop: React.ForwardRefExoticComponent<CalendarDesktopProps & React.RefAttributes<HTMLDivElement>>;
|
|
196
204
|
export { HeaderProps, Header, MonthYearHeaderProps, MonthYearHeader, MonthsTableProps, MonthsTable, formatPeriod, getYearSelectorValue, shiftValues, YearsTableProps, YearsTable, CalendarDesktopProps, CalendarDesktop };
|
|
197
|
-
export * from "./Component-
|
|
205
|
+
export * from "./Component-69921c40";
|
|
@@ -4,8 +4,8 @@ import { InputDesktop } from '@alfalab/core-components-input/modern/desktop';
|
|
|
4
4
|
import { DateRangeInput } from './components/date-range-input/Component.js';
|
|
5
5
|
import 'react-merge-refs';
|
|
6
6
|
import 'classnames';
|
|
7
|
-
import 'date-fns';
|
|
8
7
|
import 'date-fns/isValid';
|
|
8
|
+
import 'date-fns/startOfMonth';
|
|
9
9
|
import '@alfalab/core-components-calendar/modern/shared';
|
|
10
10
|
import '@alfalab/core-components-icon-button/modern';
|
|
11
11
|
import '@alfalab/core-components-popover/modern';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CommonButtonProps } from "./typings-89f0cb07";
|
|
4
|
+
declare const ButtonMobile: React.ForwardRefExoticComponent<CommonButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
5
|
+
export { ButtonMobile };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlMobileProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'>;
|
|
5
|
+
declare const FormControlMobile: React.ForwardRefExoticComponent<FormControlMobileProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { FormControlMobileProps, FormControlMobile };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
5
|
-
declare const
|
|
6
|
-
export
|
|
3
|
+
import { BaseInputProps } from "./index-ebda875c";
|
|
4
|
+
type InputMobileProps = Omit<BaseInputProps, 'FormControlComponent' | 'colorStyles'>;
|
|
5
|
+
declare const InputMobile: React.ForwardRefExoticComponent<InputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export * from "./Component.mobile-d7e9f69d";
|
|
7
|
+
export { InputMobileProps, InputMobile };
|
|
@@ -4,8 +4,8 @@ import { InputMobile } from '@alfalab/core-components-input/modern/mobile';
|
|
|
4
4
|
import { DateRangeInput } from './components/date-range-input/Component.js';
|
|
5
5
|
import 'react-merge-refs';
|
|
6
6
|
import 'classnames';
|
|
7
|
-
import 'date-fns';
|
|
8
7
|
import 'date-fns/isValid';
|
|
8
|
+
import 'date-fns/startOfMonth';
|
|
9
9
|
import '@alfalab/core-components-calendar/modern/shared';
|
|
10
10
|
import '@alfalab/core-components-icon-button/modern';
|
|
11
11
|
import '@alfalab/core-components-popover/modern';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
7
|
+
* @default 1024
|
|
8
|
+
*/
|
|
9
|
+
breakpoint?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
12
|
+
*/
|
|
13
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
14
|
+
};
|
|
15
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
|
|
16
|
+
/**
|
|
17
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
18
|
+
* @default 1024
|
|
19
|
+
*/
|
|
20
|
+
breakpoint?: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
23
|
+
*/
|
|
24
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
25
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export { FormControlProps, FormControl };
|
|
@@ -7,8 +7,8 @@ import '@alfalab/core-components-input/modern/desktop';
|
|
|
7
7
|
import './components/date-range-input/Component.js';
|
|
8
8
|
import 'react-merge-refs';
|
|
9
9
|
import 'classnames';
|
|
10
|
-
import 'date-fns';
|
|
11
10
|
import 'date-fns/isValid';
|
|
11
|
+
import 'date-fns/startOfMonth';
|
|
12
12
|
import '@alfalab/core-components-calendar/modern/shared';
|
|
13
13
|
import '@alfalab/core-components-icon-button/modern';
|
|
14
14
|
import '@alfalab/core-components-popover/modern';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import mergeRefs from 'react-merge-refs';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
-
import { startOfMonth } from 'date-fns';
|
|
5
4
|
import dateFnsIsValid from 'date-fns/isValid';
|
|
5
|
+
import startOfMonth from 'date-fns/startOfMonth';
|
|
6
6
|
import { usePeriod } from '@alfalab/core-components-calendar/modern/shared';
|
|
7
7
|
import { IconButton } from '@alfalab/core-components-icon-button/modern';
|
|
8
8
|
import { Popover } from '@alfalab/core-components-popover/modern';
|
|
@@ -11,7 +11,7 @@ import { CalendarMIcon } from '@alfalab/icons-glyph/CalendarMIcon';
|
|
|
11
11
|
import { parseTimestampToDate, DATE_FORMAT, format, parseDateString, DATE_MASK, isCompleteDateInput, isValid } from '../../utils/format.js';
|
|
12
12
|
import 'date-fns/parse';
|
|
13
13
|
|
|
14
|
-
const styles = {"component":"date-range-
|
|
14
|
+
const styles = {"component":"date-range-input__component_1hqhh","calendarContainer":"date-range-input__calendarContainer_1hqhh","calendarResponsive":"date-range-input__calendarResponsive_1hqhh","block":"date-range-input__block_1hqhh","calendarIcon":"date-range-input__calendarIcon_1hqhh"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
/* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
|
|
@@ -197,12 +197,13 @@ const DateRangeInput = React.forwardRef(({ className, inputClassName, popoverCla
|
|
|
197
197
|
return (React.createElement("div", { className: cn(styles.component, className, {
|
|
198
198
|
[styles.block]: block,
|
|
199
199
|
}), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
200
|
-
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, rightAddons: React.createElement(React.Fragment, null,
|
|
200
|
+
InputComponent ? (React.createElement(InputComponent, { autoComplete: picker ? 'off' : undefined, ...restProps, block: block, ref: mergeRefs([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, disableUserInput: disableUserInput, rightAddons: React.createElement(React.Fragment, null,
|
|
201
201
|
rightAddons,
|
|
202
202
|
picker && (React.createElement(IconButton, { className: styles.calendarIcon, ref: iconRef, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon, size: 's' }))) })) : null,
|
|
203
|
-
picker &&
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
picker &&
|
|
204
|
+
(view === 'desktop' ? (React.createElement(Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn(styles.calendarContainer, {
|
|
205
|
+
[styles.calendarResponsive]: calendarResponsive,
|
|
206
|
+
}), className: popoverClassName, position: popoverPosition, offset: [0, 8], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar())) : (renderCalendar()))));
|
|
206
207
|
});
|
|
207
208
|
|
|
208
209
|
export { DateRangeInput };
|