@alfalab/core-components-date-range-input 4.0.0 → 4.1.0-snapshot-92b8690
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-range-input/index.css +6 -6
- package/components/date-range-input/index.module.css.js +1 -1
- package/components/date-range-input/index.module.css.js.map +1 -1
- package/dynamic-mixins/Component.responsive.d.ts +19 -0
- package/dynamic-mixins/Component.responsive.js +26 -0
- package/dynamic-mixins/Component.responsive.js.map +1 -0
- package/dynamic-mixins/components/date-range-input/Component.d.ts +114 -0
- package/dynamic-mixins/components/date-range-input/Component.js +225 -0
- package/dynamic-mixins/components/date-range-input/Component.js.map +1 -0
- package/dynamic-mixins/components/date-range-input/index.css +33 -0
- package/dynamic-mixins/components/date-range-input/index.d.ts +1 -0
- package/dynamic-mixins/components/date-range-input/index.js +10 -0
- package/dynamic-mixins/components/date-range-input/index.js.map +1 -0
- package/dynamic-mixins/components/date-range-input/index.module.css.js +8 -0
- package/dynamic-mixins/components/date-range-input/index.module.css.js.map +1 -0
- package/dynamic-mixins/desktop/Component.desktop.d.ts +8 -0
- package/dynamic-mixins/desktop/Component.desktop.js +22 -0
- package/dynamic-mixins/desktop/Component.desktop.js.map +1 -0
- package/dynamic-mixins/desktop/index.d.ts +1 -0
- package/dynamic-mixins/desktop/index.js +10 -0
- package/dynamic-mixins/desktop/index.js.map +1 -0
- package/dynamic-mixins/index.d.ts +2 -0
- package/dynamic-mixins/index.js +10 -0
- package/dynamic-mixins/index.js.map +1 -0
- package/dynamic-mixins/mobile/Component.mobile.d.ts +8 -0
- package/dynamic-mixins/mobile/Component.mobile.js +22 -0
- package/dynamic-mixins/mobile/Component.mobile.js.map +1 -0
- package/dynamic-mixins/mobile/index.d.ts +1 -0
- package/dynamic-mixins/mobile/index.js +10 -0
- package/dynamic-mixins/mobile/index.js.map +1 -0
- package/dynamic-mixins/utils/format.d.ts +7 -0
- package/dynamic-mixins/utils/format.js +104 -0
- package/dynamic-mixins/utils/format.js.map +1 -0
- package/dynamic-mixins/utils/index.d.ts +1 -0
- package/dynamic-mixins/utils/index.js +16 -0
- package/dynamic-mixins/utils/index.js.map +1 -0
- package/esm/components/date-range-input/index.css +6 -6
- package/esm/components/date-range-input/index.module.css.js +1 -1
- package/esm/components/date-range-input/index.module.css.js.map +1 -1
- package/modern/components/date-range-input/index.css +6 -6
- package/modern/components/date-range-input/index.module.css.js +1 -1
- package/modern/components/date-range-input/index.module.css.js.map +1 -1
- package/moderncssm/components/date-range-input/index.module.css +8 -0
- package/package.json +8 -8
- package/src/components/date-range-input/index.module.css +1 -1
|
@@ -10,24 +10,24 @@
|
|
|
10
10
|
--calendar-width: 344px;
|
|
11
11
|
} :root {
|
|
12
12
|
--calendar-popover-border-radius: var(--border-radius-8);
|
|
13
|
-
} .date-range-
|
|
13
|
+
} .date-range-input__component_1gqpn {
|
|
14
14
|
display: inline-block;
|
|
15
15
|
outline: none;
|
|
16
16
|
position: relative;
|
|
17
|
-
} .date-range-
|
|
17
|
+
} .date-range-input__calendarContainer_1gqpn {
|
|
18
18
|
display: inline-block;
|
|
19
19
|
box-sizing: border-box;
|
|
20
20
|
border-radius: var(--calendar-popover-border-radius);
|
|
21
21
|
border: 1px solid var(--color-light-neutral-300)
|
|
22
|
-
} @media (max-width: 374px) { .date-range-
|
|
22
|
+
} @media (max-width: 374px) { .date-range-input__calendarContainer_1gqpn {
|
|
23
23
|
width: 100%;
|
|
24
24
|
min-width: 288px
|
|
25
25
|
}
|
|
26
|
-
} .date-range-
|
|
26
|
+
} .date-range-input__calendarResponsive_1gqpn {
|
|
27
27
|
width: var(--calendar-width);
|
|
28
|
-
} .date-range-
|
|
28
|
+
} .date-range-input__block_1gqpn {
|
|
29
29
|
width: 100%;
|
|
30
|
-
} .date-range-
|
|
30
|
+
} .date-range-input__calendarIcon_1gqpn {
|
|
31
31
|
margin-right: var(--gap-12-neg);
|
|
32
32
|
height: 100%;
|
|
33
33
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"date-range-
|
|
5
|
+
var styles = {"component":"date-range-input__component_1gqpn","calendarContainer":"date-range-input__calendarContainer_1gqpn","calendarResponsive":"date-range-input__calendarResponsive_1gqpn","block":"date-range-input__block_1gqpn","calendarIcon":"date-range-input__calendarIcon_1gqpn"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/date-range-input/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../../../../calendar/src/vars.css';\n\n:root {\n --calendar-popover-border-radius: var(--border-radius-8);\n}\n\n.component {\n display: inline-block;\n outline: none;\n position: relative;\n}\n\n.calendarContainer {\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--calendar-popover-border-radius);\n border: 1px solid var(--color-light-neutral-300);\n\n @media (max-width: 374px) {\n width: 100%;\n min-width: 288px;\n }\n}\n\n.calendarResponsive {\n width: var(--calendar-width);\n}\n\n.block {\n width: 100%;\n}\n\n.calendarIcon {\n margin-right: var(--gap-12-neg);\n height: 100%;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,OAAO,CAAC,+BAA+B,CAAC,cAAc,CAAC,sCAAsC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/date-range-input/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n@import '../../../../calendar/src/vars.css';\n\n:root {\n --calendar-popover-border-radius: var(--border-radius-8);\n}\n\n.component {\n display: inline-block;\n outline: none;\n position: relative;\n}\n\n.calendarContainer {\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--calendar-popover-border-radius);\n border: 1px solid var(--color-light-neutral-300);\n\n @media (max-width: 374px) {\n width: 100%;\n min-width: 288px;\n }\n}\n\n.calendarResponsive {\n width: var(--calendar-width);\n}\n\n.block {\n width: 100%;\n}\n\n.calendarIcon {\n margin-right: var(--gap-12-neg);\n height: 100%;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,OAAO,CAAC,+BAA+B,CAAC,cAAc,CAAC,sCAAsC,CAAC;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConditionalProps, DateRangeInputProps } from './components/date-range-input';
|
|
3
|
+
export declare type DateRangeInputResponsiveProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose' | 'InputComponent'> & ConditionalProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
6
|
+
* @default 1024
|
|
7
|
+
*/
|
|
8
|
+
breakpoint?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Версия, которая будет использоваться при серверном рендеринге
|
|
11
|
+
*/
|
|
12
|
+
client?: 'desktop' | 'mobile';
|
|
13
|
+
};
|
|
14
|
+
export declare type DateRangeInputMedia = 'desktop' | 'mobile';
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* use UniversalDateInput instead
|
|
18
|
+
*/
|
|
19
|
+
export declare const DateRangeInputResponsive: React.ForwardRefExoticComponent<DateRangeInputResponsiveProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var dynamicMixins = require('@alfalab/core-components-mq/dynamic-mixins');
|
|
8
|
+
var Component_desktop = require('./desktop/Component.desktop.js');
|
|
9
|
+
var Component_mobile = require('./mobile/Component.mobile.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* use UniversalDateInput instead
|
|
18
|
+
*/
|
|
19
|
+
var DateRangeInputResponsive = React.forwardRef(function (_a, ref) {
|
|
20
|
+
var breakpoint = _a.breakpoint, client = _a.client, restProps = tslib.__rest(_a, ["breakpoint", "client"]);
|
|
21
|
+
var isDesktop = dynamicMixins.useIsDesktop(breakpoint, client === 'desktop');
|
|
22
|
+
return isDesktop ? (React__default.default.createElement(Component_desktop.DateRangeInputDesktop, tslib.__assign({}, restProps, { ref: ref }))) : (React__default.default.createElement(Component_mobile.DateRangeInputMobile, tslib.__assign({}, restProps, { ref: ref })));
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.DateRangeInputResponsive = DateRangeInputResponsive;
|
|
26
|
+
//# sourceMappingURL=Component.responsive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.responsive.js","sources":["../src/Component.responsive.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { InputProps } from '@alfalab/core-components-input';\nimport { useIsDesktop } from '@alfalab/core-components-mq';\n\nimport { ConditionalProps, DateRangeInputProps } from './components/date-range-input';\nimport { DateRangeInputDesktop } from './desktop';\nimport { DateRangeInputMobile } from './mobile';\n\nexport type DateRangeInputResponsiveProps = Omit<\n DateRangeInputProps,\n 'view' | 'picker' | 'onClose' | 'InputComponent'\n> &\n ConditionalProps & {\n /**\n * Контрольная точка, с нее начинается desktop версия\n * @default 1024\n */\n breakpoint?: number;\n\n /**\n * Версия, которая будет использоваться при серверном рендеринге\n */\n client?: 'desktop' | 'mobile';\n };\n\nexport type DateRangeInputMedia = 'desktop' | 'mobile';\n\n/**\n * @deprecated\n * use UniversalDateInput instead\n */\nexport const DateRangeInputResponsive = forwardRef<HTMLInputElement, DateRangeInputResponsiveProps>(\n ({ breakpoint, client, ...restProps }, ref) => {\n const isDesktop = useIsDesktop(breakpoint, client === 'desktop');\n\n return isDesktop ? (\n <DateRangeInputDesktop {...restProps} ref={ref} />\n ) : (\n <DateRangeInputMobile {...restProps} ref={ref} />\n );\n },\n);\n"],"names":["forwardRef","__rest","useIsDesktop","React","DateRangeInputDesktop","__assign","DateRangeInputMobile"],"mappings":";;;;;;;;;;;;;;AA6BA;;;AAGG;IACU,wBAAwB,GAAGA,gBAAU,CAC9C,UAAC,EAAoC,EAAE,GAAG,EAAA;IAAvC,IAAA,UAAU,gBAAA,EAAE,MAAM,YAAA,EAAK,SAAS,GAAlCC,YAAA,CAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,CAAoC,CAAF;IAC/B,IAAM,SAAS,GAAGC,0BAAY,CAAC,UAAU,EAAE,MAAM,KAAK,SAAS,CAAC;AAEhE,IAAA,OAAO,SAAS,IACZC,sBAAA,CAAA,aAAA,CAACC,uCAAqB,EAAAC,cAAA,CAAA,EAAA,EAAK,SAAS,EAAA,EAAE,GAAG,EAAE,GAAG,EAAA,CAAA,CAAI,KAElDF,sBAAA,CAAA,aAAA,CAACG,qCAAoB,EAAAD,cAAA,CAAA,EAAA,EAAK,SAAS,EAAA,EAAE,GAAG,EAAE,GAAG,EAAA,CAAA,CAAI,CACpD;AACL,CAAC;;;;"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React, { ChangeEvent, ElementType } from 'react';
|
|
2
|
+
import type { CalendarDesktopProps } from '@alfalab/core-components-calendar/desktop';
|
|
3
|
+
import type { CalendarMobileProps } from '@alfalab/core-components-calendar/mobile';
|
|
4
|
+
import { InputProps } from '@alfalab/core-components-input';
|
|
5
|
+
import { PopoverProps } from '@alfalab/core-components-popover';
|
|
6
|
+
export declare type ConditionalProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Обработчик изменения значения
|
|
9
|
+
*/
|
|
10
|
+
picker: true;
|
|
11
|
+
/**
|
|
12
|
+
* Обработчик закрытия календаря
|
|
13
|
+
*/
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
} | {
|
|
16
|
+
picker?: false;
|
|
17
|
+
onClose?: never;
|
|
18
|
+
};
|
|
19
|
+
export declare type DateRangeInputProps = Omit<InputProps, 'onChange'> & ConditionalProps & {
|
|
20
|
+
/**
|
|
21
|
+
* Дополнительный класс
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Дополнительный класс для инпута
|
|
26
|
+
*/
|
|
27
|
+
inputClassName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Дополнительный класс для поповера
|
|
30
|
+
*/
|
|
31
|
+
popoverClassName?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Обработчик изменения значения
|
|
34
|
+
*/
|
|
35
|
+
onChange?: (payload: {
|
|
36
|
+
dateFrom?: Date;
|
|
37
|
+
dateTo?: Date;
|
|
38
|
+
value: string;
|
|
39
|
+
}, event?: ChangeEvent<HTMLInputElement>) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Обработчик окончания ввода
|
|
42
|
+
*/
|
|
43
|
+
onComplete?: (payload: {
|
|
44
|
+
dateFrom: Date;
|
|
45
|
+
dateTo: Date;
|
|
46
|
+
value: string;
|
|
47
|
+
}, event?: ChangeEvent<HTMLInputElement>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Компонент календаря
|
|
50
|
+
*/
|
|
51
|
+
Calendar?: ElementType;
|
|
52
|
+
/**
|
|
53
|
+
* Доп. пропсы для календаря
|
|
54
|
+
*/
|
|
55
|
+
calendarProps?: (CalendarDesktopProps & Record<string, unknown>) | (CalendarMobileProps & Record<string, unknown>);
|
|
56
|
+
/**
|
|
57
|
+
* Месяц в календаре по умолчанию (timestamp)
|
|
58
|
+
*/
|
|
59
|
+
defaultMonth?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Минимальная дата, доступная для выбора (timestamp)
|
|
62
|
+
*/
|
|
63
|
+
minDate?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Максимальная дата, доступная для выбора (timestamp)
|
|
66
|
+
*/
|
|
67
|
+
maxDate?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Список событий
|
|
70
|
+
*/
|
|
71
|
+
events?: Array<Date | number>;
|
|
72
|
+
/**
|
|
73
|
+
* Список выходных
|
|
74
|
+
*/
|
|
75
|
+
offDays?: Array<Date | number>;
|
|
76
|
+
/**
|
|
77
|
+
* Состояние открытия по умолчанию
|
|
78
|
+
*/
|
|
79
|
+
defaultOpen?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Позиционирование поповера с календарем
|
|
82
|
+
*/
|
|
83
|
+
popoverPosition?: PopoverProps['position'];
|
|
84
|
+
/**
|
|
85
|
+
* z-index Popover
|
|
86
|
+
*/
|
|
87
|
+
zIndexPopover?: PopoverProps['zIndex'];
|
|
88
|
+
/**
|
|
89
|
+
* Запрещает поповеру менять свою позицию.
|
|
90
|
+
* Например, если места снизу недостаточно, то он все равно будет показан снизу
|
|
91
|
+
*/
|
|
92
|
+
preventFlip?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Календарь будет принимать ширину инпута
|
|
95
|
+
*/
|
|
96
|
+
useAnchorWidth?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Растягивает компонент на ширину контейнера
|
|
99
|
+
*/
|
|
100
|
+
block?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
103
|
+
*/
|
|
104
|
+
view?: 'desktop' | 'mobile';
|
|
105
|
+
/**
|
|
106
|
+
* Компонент инпута
|
|
107
|
+
*/
|
|
108
|
+
InputComponent?: ElementType;
|
|
109
|
+
/**
|
|
110
|
+
* Запретить ввод с клавиатуры
|
|
111
|
+
*/
|
|
112
|
+
disableUserInput?: boolean;
|
|
113
|
+
};
|
|
114
|
+
export declare const DateRangeInput: React.ForwardRefExoticComponent<DateRangeInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var mergeRefs = require('react-merge-refs');
|
|
8
|
+
var cn = require('classnames');
|
|
9
|
+
var dateFnsIsValid = require('date-fns/isValid');
|
|
10
|
+
var startOfMonth = require('date-fns/startOfMonth');
|
|
11
|
+
var shared = require('@alfalab/core-components-calendar/dynamic-mixins/shared');
|
|
12
|
+
var dynamicMixins = require('@alfalab/core-components-icon-button/dynamic-mixins');
|
|
13
|
+
var dynamicMixins$1 = require('@alfalab/core-components-popover/dynamic-mixins');
|
|
14
|
+
var hooks = require('@alfalab/hooks');
|
|
15
|
+
var CalendarMIcon = require('@alfalab/icons-glyph/CalendarMIcon');
|
|
16
|
+
var format = require('../../utils/format.js');
|
|
17
|
+
var index_module = require('./index.module.css.js');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
|
+
|
|
21
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
22
|
+
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
23
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
24
|
+
var dateFnsIsValid__default = /*#__PURE__*/_interopDefaultCompat(dateFnsIsValid);
|
|
25
|
+
var startOfMonth__default = /*#__PURE__*/_interopDefaultCompat(startOfMonth);
|
|
26
|
+
|
|
27
|
+
var DateRangeInput = React__default.default.forwardRef(function (_a, ref) {
|
|
28
|
+
var _b, _c;
|
|
29
|
+
var _d;
|
|
30
|
+
var className = _a.className, inputClassName = _a.inputClassName, popoverClassName = _a.popoverClassName, disabled = _a.disabled, readOnly = _a.readOnly, _e = _a.disableUserInput, disableUserInput = _e === void 0 ? false : _e, picker = _a.picker, _f = _a.defaultValue, defaultValue = _f === void 0 ? '' : _f, propValue = _a.value, onChange = _a.onChange, onComplete = _a.onComplete, onClose = _a.onClose, rightAddons = _a.rightAddons, useAnchorWidth = _a.useAnchorWidth, block = _a.block, _g = _a.popoverPosition, popoverPosition = _g === void 0 ? 'bottom-start' : _g, zIndexPopover = _a.zIndexPopover, preventFlip = _a.preventFlip, InputComponent = _a.InputComponent, Calendar = _a.Calendar, _h = _a.calendarProps, calendarProps = _h === void 0 ? {} : _h, defaultMonth = _a.defaultMonth, _j = _a.minDate, minDate = _j === void 0 ? calendarProps.minDate : _j, _k = _a.maxDate, maxDate = _k === void 0 ? calendarProps.maxDate : _k, _l = _a.offDays, offDays = _l === void 0 ? calendarProps.offDays || [] : _l, _m = _a.events, events = _m === void 0 ? calendarProps.events || [] : _m, _o = _a.defaultOpen, defaultOpen = _o === void 0 ? false : _o, _p = _a.view, view = _p === void 0 ? 'desktop' : _p, restProps = tslib.__rest(_a, ["className", "inputClassName", "popoverClassName", "disabled", "readOnly", "disableUserInput", "picker", "defaultValue", "value", "onChange", "onComplete", "onClose", "rightAddons", "useAnchorWidth", "block", "popoverPosition", "zIndexPopover", "preventFlip", "InputComponent", "Calendar", "calendarProps", "defaultMonth", "minDate", "maxDate", "offDays", "events", "defaultOpen", "view"]);
|
|
31
|
+
var inputRef = React.useRef(null);
|
|
32
|
+
var iconRef = React.useRef(null);
|
|
33
|
+
var calendarRef = React.useRef(null);
|
|
34
|
+
var _q = React.useState(propValue || defaultValue), value = _q[0], setValue = _q[1];
|
|
35
|
+
var _r = React.useState(defaultOpen), open = _r[0], setOpen = _r[1];
|
|
36
|
+
var inputDisabled = disabled || readOnly;
|
|
37
|
+
var calendarResponsive = (_d = calendarProps === null || calendarProps === void 0 ? void 0 : calendarProps.responsive) !== null && _d !== void 0 ? _d : true;
|
|
38
|
+
var _s = shared.usePeriod({ onPeriodChange: handlePeriodChange }), selectedFrom = _s.selectedFrom, selectedTo = _s.selectedTo, updatePeriod = _s.updatePeriod, resetPeriod = _s.resetPeriod, setStart = _s.setStart, setEnd = _s.setEnd;
|
|
39
|
+
React.useEffect(function () {
|
|
40
|
+
if (value) {
|
|
41
|
+
setCalendarPeriod(getDates(value));
|
|
42
|
+
}
|
|
43
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
+
}, []);
|
|
45
|
+
React.useEffect(function () {
|
|
46
|
+
setValue(function (prevValue) {
|
|
47
|
+
if (selectedFrom && selectedTo) {
|
|
48
|
+
var from = format.parseTimestampToDate(selectedFrom);
|
|
49
|
+
var to = format.parseTimestampToDate(selectedTo);
|
|
50
|
+
return "".concat(from, " - ").concat(to);
|
|
51
|
+
}
|
|
52
|
+
if (selectedFrom && prevValue.length < format.DATE_FORMAT.length) {
|
|
53
|
+
return format.parseTimestampToDate(selectedFrom);
|
|
54
|
+
}
|
|
55
|
+
return prevValue;
|
|
56
|
+
});
|
|
57
|
+
}, [selectedFrom, selectedTo]);
|
|
58
|
+
hooks.useDidUpdateEffect(function () {
|
|
59
|
+
var newPropValue = propValue || '';
|
|
60
|
+
setValue(function (prevValue) {
|
|
61
|
+
if (prevValue === newPropValue) {
|
|
62
|
+
return prevValue;
|
|
63
|
+
}
|
|
64
|
+
var dates = getDates(newPropValue);
|
|
65
|
+
setCalendarPeriod(dates);
|
|
66
|
+
return dates.formattedValue;
|
|
67
|
+
});
|
|
68
|
+
}, [propValue]);
|
|
69
|
+
function getDates(val) {
|
|
70
|
+
var formattedValue = format.format(val);
|
|
71
|
+
var dateArr = formattedValue.split('-').map(function (v) { return v.trim(); });
|
|
72
|
+
var dateFrom = dateArr[0] ? format.parseDateString(dateArr[0]) : undefined;
|
|
73
|
+
var dateTo = dateArr[1] ? format.parseDateString(dateArr[1]) : undefined;
|
|
74
|
+
return { formattedValue: formattedValue, dateFrom: dateFrom, dateTo: dateTo, dateArr: dateArr };
|
|
75
|
+
}
|
|
76
|
+
function setCalendarPeriod(_a) {
|
|
77
|
+
var dateFrom = _a.dateFrom, dateTo = _a.dateTo;
|
|
78
|
+
setStart(dateFrom === null || dateFrom === void 0 ? void 0 : dateFrom.getTime());
|
|
79
|
+
setEnd(dateTo === null || dateTo === void 0 ? void 0 : dateTo.getTime());
|
|
80
|
+
}
|
|
81
|
+
function handlePeriodChange(from, to) {
|
|
82
|
+
if (from && !to && value.length === format.DATE_MASK.length) {
|
|
83
|
+
setValue(format.parseTimestampToDate(from));
|
|
84
|
+
}
|
|
85
|
+
else if ((!from && !to && value.length === format.DATE_FORMAT.length) ||
|
|
86
|
+
(from === to && value.length === format.DATE_MASK.length)) {
|
|
87
|
+
setValue('');
|
|
88
|
+
}
|
|
89
|
+
var dateFrom = from ? new Date(from) : undefined;
|
|
90
|
+
var dateTo = to ? new Date(to) : undefined;
|
|
91
|
+
var newValue = [from, to].filter(Boolean)
|
|
92
|
+
.map(function (timestamp) { return format.parseTimestampToDate(timestamp); })
|
|
93
|
+
.join(' - ');
|
|
94
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
95
|
+
dateFrom: dateFrom,
|
|
96
|
+
dateTo: dateTo,
|
|
97
|
+
value: newValue,
|
|
98
|
+
});
|
|
99
|
+
if (dateFrom && dateTo) {
|
|
100
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete({
|
|
101
|
+
dateFrom: dateFrom,
|
|
102
|
+
dateTo: dateTo,
|
|
103
|
+
value: newValue,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
var handleInputWrapperFocus = function (event) {
|
|
108
|
+
if (view === 'desktop') {
|
|
109
|
+
if (picker) {
|
|
110
|
+
setOpen(true);
|
|
111
|
+
}
|
|
112
|
+
if (!open && event.target.tagName !== 'INPUT' && calendarRef.current) {
|
|
113
|
+
calendarRef.current.focus();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var handleBlur = function (event) {
|
|
118
|
+
var _a, _b, _c;
|
|
119
|
+
if (view === 'desktop') {
|
|
120
|
+
var target = (event.relatedTarget || document.activeElement);
|
|
121
|
+
if (((_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) === false &&
|
|
122
|
+
((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.contains(target)) === false &&
|
|
123
|
+
((_c = iconRef.current) === null || _c === void 0 ? void 0 : _c.contains(target)) === false) {
|
|
124
|
+
setOpen(false);
|
|
125
|
+
if (onClose) {
|
|
126
|
+
onClose();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// eslint-disable-next-line complexity
|
|
132
|
+
var handleChange = function (event) {
|
|
133
|
+
var _a, _b;
|
|
134
|
+
var newValue = event.target.value;
|
|
135
|
+
if (newValue.length > format.DATE_MASK.length)
|
|
136
|
+
return;
|
|
137
|
+
// Позволяем вводить только цифры, точки, дефис и пробелы
|
|
138
|
+
if (/[^\d. -]/.test(newValue)) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
var dots = newValue.match(/\./g);
|
|
142
|
+
var hyphen = newValue.match(/\-/g);
|
|
143
|
+
// Не даем вводить больше, чем 4 точки и 1 дефис
|
|
144
|
+
if ((dots && dots.length > 4) || (hyphen && hyphen.length > 1)) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
var _c = getDates(newValue), formattedValue = _c.formattedValue, dateFrom = _c.dateFrom, dateTo = _c.dateTo, dateArr = _c.dateArr;
|
|
148
|
+
if (!dateFrom && !dateTo) {
|
|
149
|
+
resetPeriod();
|
|
150
|
+
}
|
|
151
|
+
else if (selectedFrom && formattedValue.length < format.DATE_FORMAT.length) {
|
|
152
|
+
setStart();
|
|
153
|
+
}
|
|
154
|
+
else if (selectedFrom && selectedTo) {
|
|
155
|
+
setEnd();
|
|
156
|
+
}
|
|
157
|
+
else if (dateFrom &&
|
|
158
|
+
dateFnsIsValid__default.default(dateFrom) &&
|
|
159
|
+
((_a = dateArr[0]) === null || _a === void 0 ? void 0 : _a.length) === format.DATE_FORMAT.length &&
|
|
160
|
+
dateFrom.getTime() !== selectedFrom) {
|
|
161
|
+
setStart(dateFrom.getTime());
|
|
162
|
+
}
|
|
163
|
+
else if (dateTo &&
|
|
164
|
+
dateFnsIsValid__default.default(dateTo) &&
|
|
165
|
+
((_b = dateArr[1]) === null || _b === void 0 ? void 0 : _b.length) === format.DATE_FORMAT.length &&
|
|
166
|
+
dateTo.getTime() !== selectedTo) {
|
|
167
|
+
setEnd(dateTo.getTime());
|
|
168
|
+
}
|
|
169
|
+
setValue(formattedValue);
|
|
170
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({ dateFrom: dateFrom, dateTo: dateTo, value: formattedValue }, event);
|
|
171
|
+
if (format.isCompleteDateInput(formattedValue)) {
|
|
172
|
+
var valid = format.isValid(formattedValue, dateArr[0], dateArr[1]);
|
|
173
|
+
if (!valid)
|
|
174
|
+
return;
|
|
175
|
+
if (dateFrom && dateTo) {
|
|
176
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete({ dateFrom: dateFrom, dateTo: dateTo, value: formattedValue }, event);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
var handleCalendarClose = function () {
|
|
181
|
+
if (view === 'mobile' && onClose) {
|
|
182
|
+
onClose();
|
|
183
|
+
}
|
|
184
|
+
setOpen(false);
|
|
185
|
+
};
|
|
186
|
+
var handleClear = function () {
|
|
187
|
+
setValue('');
|
|
188
|
+
resetPeriod();
|
|
189
|
+
};
|
|
190
|
+
var handleCalendarChange = function (date) {
|
|
191
|
+
updatePeriod(date);
|
|
192
|
+
};
|
|
193
|
+
var handleCalendarWrapperMouseDown = function (event) {
|
|
194
|
+
// Не дает инпуту терять фокус при выборе даты
|
|
195
|
+
event.preventDefault();
|
|
196
|
+
};
|
|
197
|
+
var handleIconButtonClick = function () {
|
|
198
|
+
if (!open)
|
|
199
|
+
setOpen(true);
|
|
200
|
+
if (view === 'desktop' && inputRef.current) {
|
|
201
|
+
inputRef.current.focus();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
var renderCalendar = function () {
|
|
205
|
+
var activeMonth = (selectedTo && startOfMonth__default.default(selectedTo)) ||
|
|
206
|
+
(selectedFrom && startOfMonth__default.default(selectedFrom));
|
|
207
|
+
return Calendar ? (
|
|
208
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
209
|
+
React__default.default.createElement("div", { onMouseDown: handleCalendarWrapperMouseDown },
|
|
210
|
+
React__default.default.createElement(Calendar, tslib.__assign({}, calendarProps, { responsive: calendarResponsive, open: open, onClose: handleCalendarClose, ref: calendarRef, defaultMonth: activeMonth || defaultMonth, selectedFrom: selectedFrom, selectedTo: selectedTo, onChange: handleCalendarChange, minDate: minDate, maxDate: maxDate, offDays: offDays, events: events })))) : null;
|
|
211
|
+
};
|
|
212
|
+
return (React__default.default.createElement("div", { className: cn__default.default(index_module.component, className, (_b = {},
|
|
213
|
+
_b[index_module.block] = block,
|
|
214
|
+
_b)), onFocus: inputDisabled ? undefined : handleInputWrapperFocus, onBlur: handleBlur },
|
|
215
|
+
InputComponent ? (React__default.default.createElement(InputComponent, tslib.__assign({ autoComplete: picker ? 'off' : undefined }, restProps, { block: block, ref: mergeRefs__default.default([ref, inputRef]), value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, className: inputClassName, onClear: handleClear, disableUserInput: disableUserInput, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
216
|
+
rightAddons,
|
|
217
|
+
picker && (React__default.default.createElement(dynamicMixins.IconButton, { className: index_module.calendarIcon, ref: iconRef, onClick: inputDisabled ? undefined : handleIconButtonClick, icon: CalendarMIcon.CalendarMIcon, size: 's' }))) }))) : null,
|
|
218
|
+
picker &&
|
|
219
|
+
(view === 'desktop' ? (React__default.default.createElement(dynamicMixins$1.Popover, { open: open, useAnchorWidth: useAnchorWidth, anchorElement: inputRef.current, popperClassName: cn__default.default(index_module.calendarContainer, (_c = {},
|
|
220
|
+
_c[index_module.calendarResponsive] = calendarResponsive,
|
|
221
|
+
_c)), className: popoverClassName, position: popoverPosition, offset: [0, 8], withTransition: false, preventFlip: preventFlip, zIndex: zIndexPopover }, renderCalendar())) : (renderCalendar()))));
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
exports.DateRangeInput = DateRangeInput;
|
|
225
|
+
//# sourceMappingURL=Component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/date-range-input/Component.tsx"],"sourcesContent":["/* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */\nimport React, {\n ChangeEvent,\n ElementType,\n FocusEvent,\n MouseEvent,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\nimport dateFnsIsValid from 'date-fns/isValid';\nimport startOfMonth from 'date-fns/startOfMonth';\n\nimport type { CalendarDesktopProps } from '@alfalab/core-components-calendar/desktop';\nimport type { CalendarMobileProps } from '@alfalab/core-components-calendar/mobile';\nimport { usePeriod } from '@alfalab/core-components-calendar/shared';\nimport { IconButton } from '@alfalab/core-components-icon-button';\nimport { InputProps } from '@alfalab/core-components-input';\nimport { Popover, PopoverProps } from '@alfalab/core-components-popover';\nimport { useDidUpdateEffect } from '@alfalab/hooks';\nimport { CalendarMIcon } from '@alfalab/icons-glyph/CalendarMIcon';\n\nimport {\n DATE_FORMAT,\n DATE_MASK,\n format,\n isCompleteDateInput,\n isValid,\n parseDateString,\n parseTimestampToDate,\n} from '../../utils';\n\nimport styles from './index.module.css';\n\nexport type ConditionalProps =\n | {\n /**\n * Обработчик изменения значения\n */\n picker: true;\n\n /**\n * Обработчик закрытия календаря\n */\n onClose?: () => void;\n }\n | { picker?: false; onClose?: never };\n\nexport type DateRangeInputProps = Omit<InputProps, 'onChange'> &\n ConditionalProps & {\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для инпута\n */\n inputClassName?: string;\n\n /**\n * Дополнительный класс для поповера\n */\n popoverClassName?: string;\n\n /**\n * Обработчик изменения значения\n */\n onChange?: (\n payload: { dateFrom?: Date; dateTo?: Date; value: string },\n event?: ChangeEvent<HTMLInputElement>,\n ) => void;\n\n /**\n * Обработчик окончания ввода\n */\n onComplete?: (\n payload: { dateFrom: Date; dateTo: Date; value: string },\n event?: ChangeEvent<HTMLInputElement>,\n ) => void;\n\n /**\n * Компонент календаря\n */\n Calendar?: ElementType;\n\n /**\n * Доп. пропсы для календаря\n */\n calendarProps?:\n | (CalendarDesktopProps & Record<string, unknown>)\n | (CalendarMobileProps & Record<string, unknown>);\n\n /**\n * Месяц в календаре по умолчанию (timestamp)\n */\n defaultMonth?: number;\n\n /**\n * Минимальная дата, доступная для выбора (timestamp)\n */\n minDate?: number;\n\n /**\n * Максимальная дата, доступная для выбора (timestamp)\n */\n maxDate?: number;\n\n /**\n * Список событий\n */\n events?: Array<Date | number>;\n\n /**\n * Список выходных\n */\n offDays?: Array<Date | number>;\n\n /**\n * Состояние открытия по умолчанию\n */\n defaultOpen?: boolean;\n\n /**\n * Позиционирование поповера с календарем\n */\n popoverPosition?: PopoverProps['position'];\n\n /**\n * z-index Popover\n */\n zIndexPopover?: PopoverProps['zIndex'];\n\n /**\n * Запрещает поповеру менять свою позицию.\n * Например, если места снизу недостаточно, то он все равно будет показан снизу\n */\n preventFlip?: boolean;\n\n /**\n * Календарь будет принимать ширину инпута\n */\n useAnchorWidth?: boolean;\n\n /**\n * Растягивает компонент на ширину контейнера\n */\n block?: boolean;\n\n /**\n * Отображение компонента в мобильном или десктопном виде\n */\n view?: 'desktop' | 'mobile';\n\n /**\n * Компонент инпута\n */\n InputComponent?: ElementType;\n\n /**\n * Запретить ввод с клавиатуры\n */\n disableUserInput?: boolean;\n };\n\ntype GetDatesRet = { formattedValue: string; dateFrom?: Date; dateTo?: Date; dateArr: string[] };\n\nexport const DateRangeInput = React.forwardRef<HTMLInputElement, DateRangeInputProps>(\n (\n {\n className,\n inputClassName,\n popoverClassName,\n disabled,\n readOnly,\n disableUserInput = false,\n picker,\n defaultValue = '',\n value: propValue,\n onChange,\n onComplete,\n onClose,\n rightAddons,\n useAnchorWidth,\n block,\n popoverPosition = 'bottom-start',\n zIndexPopover,\n preventFlip,\n InputComponent,\n Calendar,\n calendarProps = {},\n defaultMonth,\n minDate = calendarProps.minDate,\n maxDate = calendarProps.maxDate,\n offDays = calendarProps.offDays || [],\n events = calendarProps.events || [],\n defaultOpen = false,\n view = 'desktop',\n ...restProps\n },\n ref,\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const iconRef = useRef<HTMLButtonElement>(null);\n const calendarRef = useRef<HTMLDivElement>(null);\n\n const [value, setValue] = useState(propValue || defaultValue);\n const [open, setOpen] = useState(defaultOpen);\n\n const inputDisabled = disabled || readOnly;\n\n const calendarResponsive = calendarProps?.responsive ?? true;\n\n const { selectedFrom, selectedTo, updatePeriod, resetPeriod, setStart, setEnd } = usePeriod(\n { onPeriodChange: handlePeriodChange },\n );\n\n useEffect(() => {\n if (value) {\n setCalendarPeriod(getDates(value));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n setValue((prevValue) => {\n if (selectedFrom && selectedTo) {\n const from = parseTimestampToDate(selectedFrom);\n const to = parseTimestampToDate(selectedTo);\n\n return `${from} - ${to}`;\n }\n if (selectedFrom && prevValue.length < DATE_FORMAT.length) {\n return parseTimestampToDate(selectedFrom);\n }\n\n return prevValue;\n });\n }, [selectedFrom, selectedTo]);\n\n useDidUpdateEffect(() => {\n const newPropValue = propValue || '';\n\n setValue((prevValue) => {\n if (prevValue === newPropValue) {\n return prevValue;\n }\n\n const dates = getDates(newPropValue);\n\n setCalendarPeriod(dates);\n\n return dates.formattedValue;\n });\n }, [propValue]);\n\n function getDates(val: string): GetDatesRet {\n const formattedValue = format(val);\n\n const dateArr = formattedValue.split('-').map((v) => v.trim());\n const dateFrom = dateArr[0] ? parseDateString(dateArr[0]) : undefined;\n const dateTo = dateArr[1] ? parseDateString(dateArr[1]) : undefined;\n\n return { formattedValue, dateFrom, dateTo, dateArr };\n }\n\n function setCalendarPeriod({ dateFrom, dateTo }: GetDatesRet) {\n setStart(dateFrom?.getTime());\n setEnd(dateTo?.getTime());\n }\n\n function handlePeriodChange(from?: number, to?: number) {\n if (from && !to && value.length === DATE_MASK.length) {\n setValue(parseTimestampToDate(from));\n } else if (\n (!from && !to && value.length === DATE_FORMAT.length) ||\n (from === to && value.length === DATE_MASK.length)\n ) {\n setValue('');\n }\n\n const dateFrom = from ? new Date(from) : undefined;\n const dateTo = to ? new Date(to) : undefined;\n\n const newValue = ([from, to].filter(Boolean) as number[])\n .map((timestamp) => parseTimestampToDate(timestamp))\n .join(' - ');\n\n onChange?.({\n dateFrom,\n dateTo,\n value: newValue,\n });\n\n if (dateFrom && dateTo) {\n onComplete?.({\n dateFrom,\n dateTo,\n value: newValue,\n });\n }\n }\n\n const handleInputWrapperFocus = (event: FocusEvent<HTMLDivElement>) => {\n if (view === 'desktop') {\n if (picker) {\n setOpen(true);\n }\n\n if (!open && event.target.tagName !== 'INPUT' && calendarRef.current) {\n calendarRef.current.focus();\n }\n }\n };\n\n const handleBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (view === 'desktop') {\n const target = (event.relatedTarget || document.activeElement) as HTMLElement;\n\n if (\n calendarRef.current?.contains(target) === false &&\n inputRef.current?.contains(target) === false &&\n iconRef.current?.contains(target) === false\n ) {\n setOpen(false);\n\n if (onClose) {\n onClose();\n }\n }\n }\n };\n\n // eslint-disable-next-line complexity\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const { value: newValue } = event.target;\n\n if (newValue.length > DATE_MASK.length) return;\n\n // Позволяем вводить только цифры, точки, дефис и пробелы\n if (/[^\\d. -]/.test(newValue)) {\n return;\n }\n\n const dots = newValue.match(/\\./g);\n const hyphen = newValue.match(/\\-/g);\n\n // Не даем вводить больше, чем 4 точки и 1 дефис\n if ((dots && dots.length > 4) || (hyphen && hyphen.length > 1)) {\n return;\n }\n\n const { formattedValue, dateFrom, dateTo, dateArr } = getDates(newValue);\n\n if (!dateFrom && !dateTo) {\n resetPeriod();\n } else if (selectedFrom && formattedValue.length < DATE_FORMAT.length) {\n setStart();\n } else if (selectedFrom && selectedTo) {\n setEnd();\n } else if (\n dateFrom &&\n dateFnsIsValid(dateFrom) &&\n dateArr[0]?.length === DATE_FORMAT.length &&\n dateFrom.getTime() !== selectedFrom\n ) {\n setStart(dateFrom.getTime());\n } else if (\n dateTo &&\n dateFnsIsValid(dateTo) &&\n dateArr[1]?.length === DATE_FORMAT.length &&\n dateTo.getTime() !== selectedTo\n ) {\n setEnd(dateTo.getTime());\n }\n\n setValue(formattedValue);\n\n onChange?.({ dateFrom, dateTo, value: formattedValue }, event);\n\n if (isCompleteDateInput(formattedValue)) {\n const valid = isValid(formattedValue, dateArr[0], dateArr[1]);\n\n if (!valid) return;\n\n if (dateFrom && dateTo) {\n onComplete?.({ dateFrom, dateTo, value: formattedValue }, event);\n }\n }\n };\n\n const handleCalendarClose = () => {\n if (view === 'mobile' && onClose) {\n onClose();\n }\n\n setOpen(false);\n };\n\n const handleClear = () => {\n setValue('');\n resetPeriod();\n };\n\n const handleCalendarChange = (date?: number) => {\n updatePeriod(date);\n };\n\n const handleCalendarWrapperMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n // Не дает инпуту терять фокус при выборе даты\n event.preventDefault();\n };\n\n const handleIconButtonClick = () => {\n if (!open) setOpen(true);\n\n if (view === 'desktop' && inputRef.current) {\n inputRef.current.focus();\n }\n };\n\n const renderCalendar = () => {\n const activeMonth =\n (selectedTo && startOfMonth(selectedTo)) ||\n (selectedFrom && startOfMonth(selectedFrom));\n\n return Calendar ? (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div onMouseDown={handleCalendarWrapperMouseDown}>\n <Calendar\n {...calendarProps}\n responsive={calendarResponsive}\n open={open}\n onClose={handleCalendarClose}\n ref={calendarRef}\n defaultMonth={activeMonth || defaultMonth}\n selectedFrom={selectedFrom}\n selectedTo={selectedTo}\n onChange={handleCalendarChange}\n minDate={minDate}\n maxDate={maxDate}\n offDays={offDays}\n events={events}\n />\n </div>\n ) : null;\n };\n\n return (\n <div\n className={cn(styles.component, className, {\n [styles.block]: block,\n })}\n onFocus={inputDisabled ? undefined : handleInputWrapperFocus}\n onBlur={handleBlur}\n >\n {InputComponent ? (\n <InputComponent\n autoComplete={picker ? 'off' : undefined}\n {...restProps}\n block={block}\n ref={mergeRefs([ref, inputRef])}\n value={value}\n onChange={handleChange}\n disabled={disabled}\n readOnly={readOnly}\n className={inputClassName}\n onClear={handleClear}\n disableUserInput={disableUserInput}\n rightAddons={\n <React.Fragment>\n {rightAddons}\n {picker && (\n <IconButton\n className={styles.calendarIcon}\n ref={iconRef}\n onClick={inputDisabled ? undefined : handleIconButtonClick}\n icon={CalendarMIcon}\n size='s'\n />\n )}\n </React.Fragment>\n }\n />\n ) : null}\n {picker &&\n (view === 'desktop' ? (\n <Popover\n open={open}\n useAnchorWidth={useAnchorWidth}\n anchorElement={inputRef.current as HTMLElement}\n popperClassName={cn(styles.calendarContainer, {\n [styles.calendarResponsive]: calendarResponsive,\n })}\n className={popoverClassName}\n position={popoverPosition}\n offset={[0, 8]}\n withTransition={false}\n preventFlip={preventFlip}\n zIndex={zIndexPopover}\n >\n {renderCalendar()}\n </Popover>\n ) : (\n renderCalendar()\n ))}\n </div>\n );\n },\n);\n"],"names":["React","__rest","useRef","useState","usePeriod","useEffect","parseTimestampToDate","DATE_FORMAT","useDidUpdateEffect","format","parseDateString","DATE_MASK","dateFnsIsValid","isCompleteDateInput","isValid","startOfMonth","__assign","cn","styles","mergeRefs","IconButton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eb;
|
|
3
|
+
} :root {
|
|
4
|
+
--border-radius-m: 8px;
|
|
5
|
+
--border-radius-8: var(--border-radius-m);
|
|
6
|
+
} :root {
|
|
7
|
+
--gap-s-neg: -12px;
|
|
8
|
+
--gap-12-neg: var(--gap-s-neg);
|
|
9
|
+
} :root {
|
|
10
|
+
--calendar-width: 344px;
|
|
11
|
+
} :root {
|
|
12
|
+
--calendar-popover-border-radius: var(--border-radius-8);
|
|
13
|
+
} .date-range-input__component_1gqpn {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
outline: none;
|
|
16
|
+
position: relative;
|
|
17
|
+
} .date-range-input__calendarContainer_1gqpn {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
border-radius: var(--calendar-popover-border-radius);
|
|
21
|
+
border: 1px solid var(--color-light-neutral-300)
|
|
22
|
+
} @media (max-width: 374px) { .date-range-input__calendarContainer_1gqpn {
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-width: 288px
|
|
25
|
+
}
|
|
26
|
+
} .date-range-input__calendarResponsive_1gqpn {
|
|
27
|
+
width: var(--calendar-width);
|
|
28
|
+
} .date-range-input__block_1gqpn {
|
|
29
|
+
width: 100%;
|
|
30
|
+
} .date-range-input__calendarIcon_1gqpn {
|
|
31
|
+
margin-right: var(--gap-12-neg);
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('./index.css');
|
|
4
|
+
|
|
5
|
+
var styles = {"component":"date-range-input__component_1gqpn","calendarContainer":"date-range-input__calendarContainer_1gqpn","calendarResponsive":"date-range-input__calendarResponsive_1gqpn","block":"date-range-input__block_1gqpn","calendarIcon":"date-range-input__calendarIcon_1gqpn"};
|
|
6
|
+
|
|
7
|
+
module.exports = styles;
|
|
8
|
+
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/date-range-input/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n@import '../../../../calendar/src/vars.css';\n\n:root {\n --calendar-popover-border-radius: var(--border-radius-8);\n}\n\n.component {\n display: inline-block;\n outline: none;\n position: relative;\n}\n\n.calendarContainer {\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--calendar-popover-border-radius);\n border: 1px solid var(--color-light-neutral-300);\n\n @media (max-width: 374px) {\n width: 100%;\n min-width: 288px;\n }\n}\n\n.calendarResponsive {\n width: var(--calendar-width);\n}\n\n.block {\n width: 100%;\n}\n\n.calendarIcon {\n margin-right: var(--gap-12-neg);\n height: 100%;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,OAAO,CAAC,+BAA+B,CAAC,cAAc,CAAC,sCAAsC,CAAC;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConditionalProps, DateRangeInputProps } from '../components/date-range-input';
|
|
3
|
+
export declare type DateRangeInputDesktopProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose' | 'InputComponent'> & ConditionalProps;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* use UniversalDateInput instead
|
|
7
|
+
*/
|
|
8
|
+
export declare const DateRangeInputDesktop: React.ForwardRefExoticComponent<DateRangeInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var desktop = require('@alfalab/core-components-calendar/dynamic-mixins/desktop');
|
|
8
|
+
var desktop$1 = require('@alfalab/core-components-input/dynamic-mixins/desktop');
|
|
9
|
+
var Component = require('../components/date-range-input/Component.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* use UniversalDateInput instead
|
|
18
|
+
*/
|
|
19
|
+
var DateRangeInputDesktop = React.forwardRef(function (props, ref) { return (React__default.default.createElement(Component.DateRangeInput, tslib.__assign({ InputComponent: desktop$1.InputDesktop, Calendar: desktop.CalendarDesktop }, props, { ref: ref }))); });
|
|
20
|
+
|
|
21
|
+
exports.DateRangeInputDesktop = DateRangeInputDesktop;
|
|
22
|
+
//# sourceMappingURL=Component.desktop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.desktop.js","sources":["../../src/desktop/Component.desktop.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { CalendarDesktop } from '@alfalab/core-components-calendar/desktop';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { InputProps } from '@alfalab/core-components-input';\nimport { InputDesktop } from '@alfalab/core-components-input/desktop';\n\nimport {\n ConditionalProps,\n DateRangeInput,\n DateRangeInputProps,\n} from '../components/date-range-input';\n\nexport type DateRangeInputDesktopProps = Omit<\n DateRangeInputProps,\n 'view' | 'picker' | 'onClose' | 'InputComponent'\n> &\n ConditionalProps;\n\n/**\n * @deprecated\n * use UniversalDateInput instead\n */\nexport const DateRangeInputDesktop = forwardRef<HTMLInputElement, DateRangeInputDesktopProps>(\n (props, ref) => (\n <DateRangeInput\n InputComponent={InputDesktop}\n Calendar={CalendarDesktop}\n {...props}\n ref={ref}\n />\n ),\n);\n"],"names":["forwardRef","React","DateRangeInput","__assign","InputDesktop","CalendarDesktop"],"mappings":";;;;;;;;;;;;;;AAmBA;;;AAGG;AACI,IAAM,qBAAqB,GAAGA,gBAAU,CAC3C,UAAC,KAAK,EAAE,GAAG,EAAK,EAAA,QACZC,sBAAA,CAAA,aAAA,CAACC,wBAAc,EACXC,cAAA,CAAA,EAAA,cAAc,EAAEC,sBAAY,EAC5B,QAAQ,EAAEC,uBAAe,IACrB,KAAK,EAAA,EACT,GAAG,EAAE,GAAG,EACV,CAAA,CAAA,EANU,EAOf;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component.desktop';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Component_desktop = require('./Component.desktop.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.DateRangeInputDesktop = Component_desktop.DateRangeInputDesktop;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Component_responsive = require('./Component.responsive.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.DateRangeInput = Component_responsive.DateRangeInputResponsive;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConditionalProps, DateRangeInputProps } from '../components/date-range-input';
|
|
3
|
+
export declare type DateRangeInputMobileProps = Omit<DateRangeInputProps, 'view' | 'picker' | 'onClose' | 'InputComponent'> & ConditionalProps;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* use UniversalDateInput instead
|
|
7
|
+
*/
|
|
8
|
+
export declare const DateRangeInputMobile: React.ForwardRefExoticComponent<DateRangeInputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var mobile = require('@alfalab/core-components-calendar/dynamic-mixins/mobile');
|
|
8
|
+
var mobile$1 = require('@alfalab/core-components-input/dynamic-mixins/mobile');
|
|
9
|
+
var Component = require('../components/date-range-input/Component.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* use UniversalDateInput instead
|
|
18
|
+
*/
|
|
19
|
+
var DateRangeInputMobile = React.forwardRef(function (props, ref) { return (React__default.default.createElement(Component.DateRangeInput, tslib.__assign({ InputComponent: mobile$1.InputMobile, Calendar: mobile.CalendarMobile, view: 'mobile' }, props, { ref: ref }))); });
|
|
20
|
+
|
|
21
|
+
exports.DateRangeInputMobile = DateRangeInputMobile;
|
|
22
|
+
//# sourceMappingURL=Component.mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.mobile.js","sources":["../../src/mobile/Component.mobile.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { CalendarMobile } from '@alfalab/core-components-calendar/mobile';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { InputProps } from '@alfalab/core-components-input';\nimport { InputMobile } from '@alfalab/core-components-input/mobile';\n\nimport {\n ConditionalProps,\n DateRangeInput,\n DateRangeInputProps,\n} from '../components/date-range-input';\n\nexport type DateRangeInputMobileProps = Omit<\n DateRangeInputProps,\n 'view' | 'picker' | 'onClose' | 'InputComponent'\n> &\n ConditionalProps;\n\n/**\n * @deprecated\n * use UniversalDateInput instead\n */\nexport const DateRangeInputMobile = forwardRef<HTMLInputElement, DateRangeInputMobileProps>(\n (props, ref) => (\n <DateRangeInput\n InputComponent={InputMobile}\n Calendar={CalendarMobile}\n view='mobile'\n {...props}\n ref={ref}\n />\n ),\n);\n"],"names":["forwardRef","React","DateRangeInput","__assign","InputMobile","CalendarMobile"],"mappings":";;;;;;;;;;;;;;AAmBA;;;AAGG;AACU,IAAA,oBAAoB,GAAGA,gBAAU,CAC1C,UAAC,KAAK,EAAE,GAAG,IAAK,QACZC,qCAACC,wBAAc,EAAAC,cAAA,CAAA,EACX,cAAc,EAAEC,oBAAW,EAC3B,QAAQ,EAAEC,qBAAc,EACxB,IAAI,EAAC,QAAQ,EACT,EAAA,KAAK,EACT,EAAA,GAAG,EAAE,GAAG,EAAA,CAAA,CACV,EAPU,EAQf;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component.mobile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DATE_FORMAT = "dd.MM.yyyy";
|
|
2
|
+
export declare const DATE_MASK: (string | RegExp)[];
|
|
3
|
+
export declare const isCompleteDateInput: (input: string) => boolean;
|
|
4
|
+
export declare const parseDateString: (value: string, dateFormat?: string) => Date;
|
|
5
|
+
export declare const isValid: (inputValue: string, dateFrom: string, dateTo: string) => boolean;
|
|
6
|
+
export declare const format: (value: string) => string;
|
|
7
|
+
export declare const parseTimestampToDate: (timestamp: number) => string;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dateFnsIsValid = require('date-fns/isValid');
|
|
6
|
+
var parse = require('date-fns/parse');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var dateFnsIsValid__default = /*#__PURE__*/_interopDefaultCompat(dateFnsIsValid);
|
|
11
|
+
var parse__default = /*#__PURE__*/_interopDefaultCompat(parse);
|
|
12
|
+
|
|
13
|
+
/* eslint-disable no-useless-escape */
|
|
14
|
+
var DATE_FORMAT = 'dd.MM.yyyy';
|
|
15
|
+
var DATE_MASK = [
|
|
16
|
+
/\d/,
|
|
17
|
+
/\d/,
|
|
18
|
+
'.',
|
|
19
|
+
/\d/,
|
|
20
|
+
/\d/,
|
|
21
|
+
'.',
|
|
22
|
+
/\d/,
|
|
23
|
+
/\d/,
|
|
24
|
+
/\d/,
|
|
25
|
+
/\d/,
|
|
26
|
+
' ',
|
|
27
|
+
'-',
|
|
28
|
+
' ',
|
|
29
|
+
/\d/,
|
|
30
|
+
/\d/,
|
|
31
|
+
'.',
|
|
32
|
+
/\d/,
|
|
33
|
+
/\d/,
|
|
34
|
+
'.',
|
|
35
|
+
/\d/,
|
|
36
|
+
/\d/,
|
|
37
|
+
/\d/,
|
|
38
|
+
/\d/,
|
|
39
|
+
];
|
|
40
|
+
var isCompleteDateInput = function (input) { return input.length === DATE_MASK.length; };
|
|
41
|
+
var parseDateString = function (value, dateFormat) {
|
|
42
|
+
if (dateFormat === void 0) { dateFormat = DATE_FORMAT; }
|
|
43
|
+
return parse__default.default(value, dateFormat, new Date());
|
|
44
|
+
};
|
|
45
|
+
var isValid = function (inputValue, dateFrom, dateTo) {
|
|
46
|
+
return !inputValue ||
|
|
47
|
+
(isCompleteDateInput(inputValue) &&
|
|
48
|
+
dateFnsIsValid__default.default(parseDateString(dateFrom)) &&
|
|
49
|
+
dateFnsIsValid__default.default(parseDateString(dateTo)));
|
|
50
|
+
};
|
|
51
|
+
var format = function (value) {
|
|
52
|
+
return value
|
|
53
|
+
.replace(/^(\d\d)(\d)$/, '$1.$2') // 121 => 12.1
|
|
54
|
+
.replace(/^(\d\d)\.(\d\d)(\d)$/, '$1.$2.$3') // 12.122 => 12.12.2
|
|
55
|
+
.replace(/^(\d\d)\d\.(.*)/, '$1.$2') // 123.12.2005 => 12.12.2005
|
|
56
|
+
.replace(/^(\d\d\.\d\d)\d\.(.*)/, '$1.$2') // 12.123.2005 => 12.12.2005
|
|
57
|
+
.replace(/\.$/, '') // 12. => 12
|
|
58
|
+
.replace(/\ $/, '') // 1 2 => 12
|
|
59
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d)(\d) - (\d.*)/, '$1 - $3') // 12.12.20051 - 12.12.200 => 12.12.2005 - 12.12.200
|
|
60
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) (\d)- (\d.*)/, '$1 - $3') // 12.12.2005 1- 12.12.200 => 12.12.2005 - 12.12.200
|
|
61
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) -(\d) (\d.*)/, '$1 - $3') // 12.12.2005 -1 12.12.200 => 12.12.2005 - 12.12.200
|
|
62
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) - (\d)(\d\d.\d\d.\d\d\d)/, '$1 - $3') // 12.12.2005 - 112.12.200 => 12.12.2005 - 12.12.200
|
|
63
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) - (\d)(\d\d.\d.\d\d\d\d)/, '$1 - $3') // 12.12.2005 - 112.1.2001 => 12.12.2005 - 12.1.2001
|
|
64
|
+
.replace(/^(\d\d\.\d\d)(\d\d\d\d)/, '$1.$2') // 12.122005 => 12.12.2005
|
|
65
|
+
.replace(/^(\d\d)(\d\d\.\d\d\d\d)/, '$1.$2') // 1212.2005 => 12.12.2005
|
|
66
|
+
.replace(/^(\d\d)(\d.*)/, '$1.$2') // 1212 => 12.12
|
|
67
|
+
.replace(/^(\d\d.\d\d)(\d.*)/, '$1.$2') // 12.122 => 12.12.2
|
|
68
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d)(\d)/, '$1 - $2') // 12.12.20056 => 12.12.2005 - 6
|
|
69
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) - (\d\d)(\d)/, '$1 - $2.$3') // 12.12.2005 - 123 => 12.12.2005 - 12.3
|
|
70
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) - (\d\d).(\d\d)(\d)/, '$1 - $2.$3.$4') // 12.12.2005 - 12.123 => 12.12.2005 - 12.12.3
|
|
71
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d)- (\d.*)/, '$1 - $2') // 12.12.2005- 12.12.2005 => 12.12.2005 - 12.12.2005
|
|
72
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) -(\d.*)/, '$1 - $2') // 12.12.2005 -12.12.2005 => 12.12.2005 - 12.12.2005
|
|
73
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) -/, '$1') // 12.12.2005 - => 12.12.2005
|
|
74
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) (\d.*)/, '$1 - $2') // 12.12.2005 12.12.2005 => 12.12.2005 - 12.12.2005
|
|
75
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d) {2}(\d.*)/, '$1 - $2') // 12.12.2005 12.12.2005 => 12.12.2005 - 12.12.2005
|
|
76
|
+
.replace(/^(\d\d\.\d\d\.\d\d\d\d)-/, '$1') // 12.12.2005- => 12.12.2005
|
|
77
|
+
.replace(/^(\d\.\d\d\.\d\d\d\d)([0-9]*)/, '$1') // 1.12.2005123123 => 1.12.2005
|
|
78
|
+
.replace(/^(\d\d\.\d\.\d\d\d\d)([0-9]*)/, '$1') // 01.2.20055125125 => 01.2.2005
|
|
79
|
+
.replace(/^(\d)\.(\d\d)([0-9]*)\.(\d\d\d\d)/, '$1.$2.$4') // 1.123123.2005 => 1.12.2005
|
|
80
|
+
.replace(/^(\d\.\d\.\d\d\d\d)([0-9]*)/, '$1') // 1.2.20055125125 => 1.2.2005
|
|
81
|
+
.replace(/^()\.(\d)\.(\d\d\d\d)([0-9]*)/, '$1.$2.$3');
|
|
82
|
+
}; // .2.2005123123 => .2.2005
|
|
83
|
+
var parseTimestampToDate = function (timestamp) {
|
|
84
|
+
var date = new Date(timestamp);
|
|
85
|
+
var year = date.getFullYear();
|
|
86
|
+
var month = date.getMonth() + 1;
|
|
87
|
+
var day = date.getDate();
|
|
88
|
+
if (month < 10) {
|
|
89
|
+
month = "0".concat(month);
|
|
90
|
+
}
|
|
91
|
+
if (day < 10) {
|
|
92
|
+
day = "0".concat(day);
|
|
93
|
+
}
|
|
94
|
+
return "".concat(day, ".").concat(month, ".").concat(year);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.DATE_FORMAT = DATE_FORMAT;
|
|
98
|
+
exports.DATE_MASK = DATE_MASK;
|
|
99
|
+
exports.format = format;
|
|
100
|
+
exports.isCompleteDateInput = isCompleteDateInput;
|
|
101
|
+
exports.isValid = isValid;
|
|
102
|
+
exports.parseDateString = parseDateString;
|
|
103
|
+
exports.parseTimestampToDate = parseTimestampToDate;
|
|
104
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sources":["../../src/utils/format.ts"],"sourcesContent":["/* eslint-disable no-useless-escape */\n\nimport dateFnsIsValid from 'date-fns/isValid';\nimport parse from 'date-fns/parse';\n\nexport const DATE_FORMAT = 'dd.MM.yyyy';\nexport const DATE_MASK = [\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n ' ',\n '-',\n ' ',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n];\n\nexport const isCompleteDateInput = (input: string) => input.length === DATE_MASK.length;\n\nexport const parseDateString = (value: string, dateFormat = DATE_FORMAT) =>\n parse(value, dateFormat, new Date());\n\nexport const isValid = (inputValue: string, dateFrom: string, dateTo: string) =>\n !inputValue ||\n (isCompleteDateInput(inputValue) &&\n dateFnsIsValid(parseDateString(dateFrom)) &&\n dateFnsIsValid(parseDateString(dateTo)));\n\nexport const format = (value: string): string =>\n value\n .replace(/^(\\d\\d)(\\d)$/, '$1.$2') // 121 => 12.1\n .replace(/^(\\d\\d)\\.(\\d\\d)(\\d)$/, '$1.$2.$3') // 12.122 => 12.12.2\n .replace(/^(\\d\\d)\\d\\.(.*)/, '$1.$2') // 123.12.2005 => 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d)\\d\\.(.*)/, '$1.$2') // 12.123.2005 => 12.12.2005\n .replace(/\\.$/, '') // 12. => 12\n .replace(/\\ $/, '') // 1 2 => 12\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d)(\\d) - (\\d.*)/, '$1 - $3') // 12.12.20051 - 12.12.200 => 12.12.2005 - 12.12.200\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) (\\d)- (\\d.*)/, '$1 - $3') // 12.12.2005 1- 12.12.200 => 12.12.2005 - 12.12.200\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) -(\\d) (\\d.*)/, '$1 - $3') // 12.12.2005 -1 12.12.200 => 12.12.2005 - 12.12.200\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) - (\\d)(\\d\\d.\\d\\d.\\d\\d\\d)/, '$1 - $3') // 12.12.2005 - 112.12.200 => 12.12.2005 - 12.12.200\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) - (\\d)(\\d\\d.\\d.\\d\\d\\d\\d)/, '$1 - $3') // 12.12.2005 - 112.1.2001 => 12.12.2005 - 12.1.2001\n .replace(/^(\\d\\d\\.\\d\\d)(\\d\\d\\d\\d)/, '$1.$2') // 12.122005 => 12.12.2005\n .replace(/^(\\d\\d)(\\d\\d\\.\\d\\d\\d\\d)/, '$1.$2') // 1212.2005 => 12.12.2005\n .replace(/^(\\d\\d)(\\d.*)/, '$1.$2') // 1212 => 12.12\n .replace(/^(\\d\\d.\\d\\d)(\\d.*)/, '$1.$2') // 12.122 => 12.12.2\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d)(\\d)/, '$1 - $2') // 12.12.20056 => 12.12.2005 - 6\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) - (\\d\\d)(\\d)/, '$1 - $2.$3') // 12.12.2005 - 123 => 12.12.2005 - 12.3\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) - (\\d\\d).(\\d\\d)(\\d)/, '$1 - $2.$3.$4') // 12.12.2005 - 12.123 => 12.12.2005 - 12.12.3\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d)- (\\d.*)/, '$1 - $2') // 12.12.2005- 12.12.2005 => 12.12.2005 - 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) -(\\d.*)/, '$1 - $2') // 12.12.2005 -12.12.2005 => 12.12.2005 - 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) -/, '$1') // 12.12.2005 - => 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) (\\d.*)/, '$1 - $2') // 12.12.2005 12.12.2005 => 12.12.2005 - 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d) {2}(\\d.*)/, '$1 - $2') // 12.12.2005 12.12.2005 => 12.12.2005 - 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d)-/, '$1') // 12.12.2005- => 12.12.2005\n .replace(/^(\\d\\.\\d\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 1.12.2005123123 => 1.12.2005\n .replace(/^(\\d\\d\\.\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 01.2.20055125125 => 01.2.2005\n .replace(/^(\\d)\\.(\\d\\d)([0-9]*)\\.(\\d\\d\\d\\d)/, '$1.$2.$4') // 1.123123.2005 => 1.12.2005\n .replace(/^(\\d\\.\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 1.2.20055125125 => 1.2.2005\n .replace(/^()\\.(\\d)\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3'); // .2.2005123123 => .2.2005\n\nexport const parseTimestampToDate = (timestamp: number): string => {\n const date = new Date(timestamp);\n const year = date.getFullYear();\n\n let month: number | string = date.getMonth() + 1;\n let day: number | string = date.getDate();\n\n if (month < 10) {\n month = `0${month}`;\n }\n if (day < 10) {\n day = `0${day}`;\n }\n\n return `${day}.${month}.${year}`;\n};\n"],"names":["parse","dateFnsIsValid"],"mappings":";;;;;;;;;;;;AAAA;AAKO,IAAM,WAAW,GAAG;AACd,IAAA,SAAS,GAAG;IACrB,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;;AAGK,IAAA,mBAAmB,GAAG,UAAC,KAAa,EAAK,EAAA,OAAA,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,CAAA;AAE1E,IAAA,eAAe,GAAG,UAAC,KAAa,EAAE,UAAwB,EAAA;AAAxB,IAAA,IAAA,UAAA,KAAA,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AAI,KAAK,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAE;AACpC;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './format';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var format = require('./format.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.DATE_FORMAT = format.DATE_FORMAT;
|
|
10
|
+
exports.DATE_MASK = format.DATE_MASK;
|
|
11
|
+
exports.format = format.format;
|
|
12
|
+
exports.isCompleteDateInput = format.isCompleteDateInput;
|
|
13
|
+
exports.isValid = format.isValid;
|
|
14
|
+
exports.parseDateString = format.parseDateString;
|
|
15
|
+
exports.parseTimestampToDate = format.parseTimestampToDate;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -10,24 +10,24 @@
|
|
|
10
10
|
--calendar-width: 344px;
|
|
11
11
|
} :root {
|
|
12
12
|
--calendar-popover-border-radius: var(--border-radius-8);
|
|
13
|
-
} .date-range-
|
|
13
|
+
} .date-range-input__component_1gqpn {
|
|
14
14
|
display: inline-block;
|
|
15
15
|
outline: none;
|
|
16
16
|
position: relative;
|
|
17
|
-
} .date-range-
|
|
17
|
+
} .date-range-input__calendarContainer_1gqpn {
|
|
18
18
|
display: inline-block;
|
|
19
19
|
box-sizing: border-box;
|
|
20
20
|
border-radius: var(--calendar-popover-border-radius);
|
|
21
21
|
border: 1px solid var(--color-light-neutral-300)
|
|
22
|
-
} @media (max-width: 374px) { .date-range-
|
|
22
|
+
} @media (max-width: 374px) { .date-range-input__calendarContainer_1gqpn {
|
|
23
23
|
width: 100%;
|
|
24
24
|
min-width: 288px
|
|
25
25
|
}
|
|
26
|
-
} .date-range-
|
|
26
|
+
} .date-range-input__calendarResponsive_1gqpn {
|
|
27
27
|
width: var(--calendar-width);
|
|
28
|
-
} .date-range-
|
|
28
|
+
} .date-range-input__block_1gqpn {
|
|
29
29
|
width: 100%;
|
|
30
|
-
} .date-range-
|
|
30
|
+
} .date-range-input__calendarIcon_1gqpn {
|
|
31
31
|
margin-right: var(--gap-12-neg);
|
|
32
32
|
height: 100%;
|
|
33
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"component":"date-range-
|
|
3
|
+
var styles = {"component":"date-range-input__component_1gqpn","calendarContainer":"date-range-input__calendarContainer_1gqpn","calendarResponsive":"date-range-input__calendarResponsive_1gqpn","block":"date-range-input__block_1gqpn","calendarIcon":"date-range-input__calendarIcon_1gqpn"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/date-range-input/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../../../../calendar/src/vars.css';\n\n:root {\n --calendar-popover-border-radius: var(--border-radius-8);\n}\n\n.component {\n display: inline-block;\n outline: none;\n position: relative;\n}\n\n.calendarContainer {\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--calendar-popover-border-radius);\n border: 1px solid var(--color-light-neutral-300);\n\n @media (max-width: 374px) {\n width: 100%;\n min-width: 288px;\n }\n}\n\n.calendarResponsive {\n width: var(--calendar-width);\n}\n\n.block {\n width: 100%;\n}\n\n.calendarIcon {\n margin-right: var(--gap-12-neg);\n height: 100%;\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,OAAO,CAAC,+BAA+B,CAAC,cAAc,CAAC,sCAAsC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/date-range-input/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n@import '../../../../calendar/src/vars.css';\n\n:root {\n --calendar-popover-border-radius: var(--border-radius-8);\n}\n\n.component {\n display: inline-block;\n outline: none;\n position: relative;\n}\n\n.calendarContainer {\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--calendar-popover-border-radius);\n border: 1px solid var(--color-light-neutral-300);\n\n @media (max-width: 374px) {\n width: 100%;\n min-width: 288px;\n }\n}\n\n.calendarResponsive {\n width: var(--calendar-width);\n}\n\n.block {\n width: 100%;\n}\n\n.calendarIcon {\n margin-right: var(--gap-12-neg);\n height: 100%;\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,OAAO,CAAC,+BAA+B,CAAC,cAAc,CAAC,sCAAsC,CAAC;;;;"}
|
|
@@ -10,24 +10,24 @@
|
|
|
10
10
|
--calendar-width: 344px;
|
|
11
11
|
} :root {
|
|
12
12
|
--calendar-popover-border-radius: var(--border-radius-8);
|
|
13
|
-
} .date-range-
|
|
13
|
+
} .date-range-input__component_1gqpn {
|
|
14
14
|
display: inline-block;
|
|
15
15
|
outline: none;
|
|
16
16
|
position: relative;
|
|
17
|
-
} .date-range-
|
|
17
|
+
} .date-range-input__calendarContainer_1gqpn {
|
|
18
18
|
display: inline-block;
|
|
19
19
|
box-sizing: border-box;
|
|
20
20
|
border-radius: var(--calendar-popover-border-radius);
|
|
21
21
|
border: 1px solid var(--color-light-neutral-300)
|
|
22
|
-
} @media (max-width: 374px) { .date-range-
|
|
22
|
+
} @media (max-width: 374px) { .date-range-input__calendarContainer_1gqpn {
|
|
23
23
|
width: 100%;
|
|
24
24
|
min-width: 288px
|
|
25
25
|
}
|
|
26
|
-
} .date-range-
|
|
26
|
+
} .date-range-input__calendarResponsive_1gqpn {
|
|
27
27
|
width: var(--calendar-width);
|
|
28
|
-
} .date-range-
|
|
28
|
+
} .date-range-input__block_1gqpn {
|
|
29
29
|
width: 100%;
|
|
30
|
-
} .date-range-
|
|
30
|
+
} .date-range-input__calendarIcon_1gqpn {
|
|
31
31
|
margin-right: var(--gap-12-neg);
|
|
32
32
|
height: 100%;
|
|
33
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"date-range-
|
|
3
|
+
const styles = {"component":"date-range-input__component_1gqpn","calendarContainer":"date-range-input__calendarContainer_1gqpn","calendarResponsive":"date-range-input__calendarResponsive_1gqpn","block":"date-range-input__block_1gqpn","calendarIcon":"date-range-input__calendarIcon_1gqpn"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/date-range-input/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../../../../calendar/src/vars.css';\n\n:root {\n --calendar-popover-border-radius: var(--border-radius-8);\n}\n\n.component {\n display: inline-block;\n outline: none;\n position: relative;\n}\n\n.calendarContainer {\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--calendar-popover-border-radius);\n border: 1px solid var(--color-light-neutral-300);\n\n @media (max-width: 374px) {\n width: 100%;\n min-width: 288px;\n }\n}\n\n.calendarResponsive {\n width: var(--calendar-width);\n}\n\n.block {\n width: 100%;\n}\n\n.calendarIcon {\n margin-right: var(--gap-12-neg);\n height: 100%;\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,OAAO,CAAC,+BAA+B,CAAC,cAAc,CAAC,sCAAsC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/date-range-input/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n@import '../../../../calendar/src/vars.css';\n\n:root {\n --calendar-popover-border-radius: var(--border-radius-8);\n}\n\n.component {\n display: inline-block;\n outline: none;\n position: relative;\n}\n\n.calendarContainer {\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--calendar-popover-border-radius);\n border: 1px solid var(--color-light-neutral-300);\n\n @media (max-width: 374px) {\n width: 100%;\n min-width: 288px;\n }\n}\n\n.calendarResponsive {\n width: var(--calendar-width);\n}\n\n.block {\n width: 100%;\n}\n\n.calendarIcon {\n margin-right: var(--gap-12-neg);\n height: 100%;\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,OAAO,CAAC,+BAA+B,CAAC,cAAc,CAAC,sCAAsC,CAAC;;;;"}
|
|
@@ -1,32 +1,40 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--calendar-width: 344px;
|
|
3
3
|
}
|
|
4
|
+
|
|
4
5
|
:root {
|
|
5
6
|
--calendar-popover-border-radius: var(--border-radius-8);
|
|
6
7
|
}
|
|
8
|
+
|
|
7
9
|
.component {
|
|
8
10
|
display: inline-block;
|
|
9
11
|
outline: none;
|
|
10
12
|
position: relative;
|
|
11
13
|
}
|
|
14
|
+
|
|
12
15
|
.calendarContainer {
|
|
13
16
|
display: inline-block;
|
|
14
17
|
box-sizing: border-box;
|
|
15
18
|
border-radius: var(--calendar-popover-border-radius);
|
|
16
19
|
border: 1px solid var(--color-light-neutral-300)
|
|
17
20
|
}
|
|
21
|
+
|
|
18
22
|
@media (max-width: 374px) {
|
|
23
|
+
|
|
19
24
|
.calendarContainer {
|
|
20
25
|
width: 100%;
|
|
21
26
|
min-width: 288px
|
|
22
27
|
}
|
|
23
28
|
}
|
|
29
|
+
|
|
24
30
|
.calendarResponsive {
|
|
25
31
|
width: var(--calendar-width);
|
|
26
32
|
}
|
|
33
|
+
|
|
27
34
|
.block {
|
|
28
35
|
width: 100%;
|
|
29
36
|
}
|
|
37
|
+
|
|
30
38
|
.calendarIcon {
|
|
31
39
|
margin-right: var(--gap-12-neg);
|
|
32
40
|
height: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-date-range-input",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0-snapshot-92b8690",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"module": "./esm/index.js",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@alfalab/core-components-calendar": "
|
|
14
|
-
"@alfalab/core-components-icon-button": "
|
|
15
|
-
"@alfalab/core-components-input": "
|
|
16
|
-
"@alfalab/core-components-mq": "
|
|
17
|
-
"@alfalab/core-components-popover": "
|
|
13
|
+
"@alfalab/core-components-calendar": "8.1.0-snapshot-92b8690",
|
|
14
|
+
"@alfalab/core-components-icon-button": "7.1.0-snapshot-92b8690",
|
|
15
|
+
"@alfalab/core-components-input": "16.1.0-snapshot-92b8690",
|
|
16
|
+
"@alfalab/core-components-mq": "5.1.0-snapshot-92b8690",
|
|
17
|
+
"@alfalab/core-components-popover": "7.1.0-snapshot-92b8690",
|
|
18
18
|
"@alfalab/hooks": "^1.13.1",
|
|
19
19
|
"@alfalab/icons-glyph": "^2.210.0",
|
|
20
20
|
"classnames": "^2.5.1",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"access": "public",
|
|
31
31
|
"directory": "dist"
|
|
32
32
|
},
|
|
33
|
-
"themesVersion": "14.
|
|
34
|
-
"varsVersion": "10.
|
|
33
|
+
"themesVersion": "14.1.0-snapshot-92b8690",
|
|
34
|
+
"varsVersion": "10.1.0-snapshot-92b8690"
|
|
35
35
|
}
|