@alfalab/core-components-date-range-input 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm/Component.d.ts → Component-105ad648.d.ts} +46 -5
- package/{Component.js → Component-105ad648.js} +25 -33
- package/Component.desktop.d.ts +5 -0
- package/Component.desktop.js +22 -0
- package/Component.mobile.d.ts +5 -0
- package/Component.mobile.js +22 -0
- package/Component.responsive.d.ts +12 -0
- package/Component.responsive.js +32 -0
- package/components/date-range-input/Component.d.ts +0 -0
- package/components/date-range-input/Component.js +18 -0
- package/{esm → components/date-range-input}/index.css +6 -6
- package/components/date-range-input/index.d.ts +1 -0
- package/components/date-range-input/index.js +18 -0
- package/cssm/{Component.d.ts → Component-a4cfbf46.d.ts} +46 -5
- package/cssm/{Component.js → Component-a4cfbf46.js} +27 -35
- package/cssm/Component.desktop.d.ts +5 -0
- package/cssm/Component.desktop.js +23 -0
- package/cssm/Component.mobile.d.ts +5 -0
- package/cssm/Component.mobile.js +23 -0
- package/cssm/Component.responsive.d.ts +12 -0
- package/cssm/Component.responsive.js +33 -0
- package/cssm/components/date-range-input/Component.d.ts +0 -0
- package/cssm/components/date-range-input/Component.js +19 -0
- package/cssm/components/date-range-input/index.d.ts +1 -0
- package/cssm/components/date-range-input/index.js +19 -0
- package/cssm/{index.module.css → components/date-range-input/index.module.css} +0 -0
- package/cssm/desktop.d.ts +2 -0
- package/cssm/desktop.js +20 -0
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +8 -7
- package/cssm/mobile.d.ts +2 -0
- package/cssm/mobile.js +20 -0
- package/cssm/responsive.d.ts +2 -0
- package/cssm/responsive.js +23 -0
- package/cssm/utils/format.js +9 -11
- package/cssm/utils/index.js +1 -3
- package/desktop.d.ts +2 -0
- package/desktop.js +19 -0
- package/{modern/Component.d.ts → esm/Component-e59830f5.d.ts} +46 -5
- package/esm/{Component.js → Component-e59830f5.js} +10 -17
- package/esm/Component.desktop.d.ts +5 -0
- package/esm/Component.desktop.js +16 -0
- package/esm/Component.mobile.d.ts +5 -0
- package/esm/Component.mobile.js +16 -0
- package/esm/Component.responsive.d.ts +12 -0
- package/esm/Component.responsive.js +26 -0
- package/esm/components/date-range-input/Component.d.ts +0 -0
- package/esm/components/date-range-input/Component.js +12 -0
- package/{index.css → esm/components/date-range-input/index.css} +6 -6
- package/esm/components/date-range-input/index.d.ts +1 -0
- package/esm/components/date-range-input/index.js +12 -0
- package/esm/desktop.d.ts +2 -0
- package/esm/desktop.js +13 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +6 -3
- package/esm/mobile.d.ts +2 -0
- package/esm/mobile.js +13 -0
- package/esm/responsive.d.ts +2 -0
- package/esm/responsive.js +16 -0
- package/esm/utils/format.js +3 -3
- package/esm/utils/index.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +7 -6
- package/mobile.d.ts +2 -0
- package/mobile.js +19 -0
- package/modern/Component.desktop.d.ts +5 -0
- package/modern/Component.desktop.js +16 -0
- package/modern/Component.mobile.d.ts +5 -0
- package/modern/Component.mobile.js +16 -0
- package/modern/Component.responsive.d.ts +12 -0
- package/modern/Component.responsive.js +25 -0
- package/{Component.d.ts → modern/components/date-range-input/Component.d.ts} +12 -4
- package/modern/{Component.js → components/date-range-input/Component.js} +5 -11
- package/modern/{index.css → components/date-range-input/index.css} +6 -6
- package/modern/components/date-range-input/index.d.ts +1 -0
- package/modern/components/date-range-input/index.js +12 -0
- package/modern/desktop.d.ts +2 -0
- package/modern/desktop.js +13 -0
- package/modern/index.d.ts +1 -1
- package/modern/index.js +6 -3
- package/modern/mobile.d.ts +2 -0
- package/modern/mobile.js +13 -0
- package/modern/responsive.d.ts +2 -0
- package/modern/responsive.js +16 -0
- package/modern/utils/index.js +1 -1
- package/package.json +5 -5
- package/responsive.d.ts +2 -0
- package/responsive.js +22 -0
- package/utils/format.js +9 -11
- package/utils/index.js +1 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 2v93k */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -39,26 +39,26 @@
|
|
|
39
39
|
:root {
|
|
40
40
|
--calendar-popover-border-radius: 0 0 var(--border-radius-s) var(--border-radius-s);
|
|
41
41
|
}
|
|
42
|
-
.date-range-
|
|
42
|
+
.date-range-input__component_1yhrr {
|
|
43
43
|
display: inline-block;
|
|
44
44
|
outline: none;
|
|
45
45
|
position: relative;
|
|
46
46
|
}
|
|
47
|
-
.date-range-
|
|
47
|
+
.date-range-input__calendarContainer_1yhrr {
|
|
48
48
|
display: inline-block;
|
|
49
49
|
box-sizing: border-box;
|
|
50
50
|
border-radius: var(--calendar-popover-border-radius)
|
|
51
51
|
}
|
|
52
52
|
@media (max-width: 374px) {
|
|
53
|
-
.date-range-
|
|
53
|
+
.date-range-input__calendarContainer_1yhrr {
|
|
54
54
|
width: 100%;
|
|
55
55
|
min-width: 288px
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
.date-range-
|
|
58
|
+
.date-range-input__calendarResponsive_1yhrr {
|
|
59
59
|
width: var(--calendar-width);
|
|
60
60
|
padding: 0 var(--gap-m);
|
|
61
61
|
}
|
|
62
|
-
.date-range-
|
|
62
|
+
.date-range-input__block_1yhrr {
|
|
63
63
|
width: 100%;
|
|
64
64
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { DateRangeInput } from './Component.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react-merge-refs';
|
|
4
|
+
import 'classnames';
|
|
5
|
+
import 'date-fns/isValid';
|
|
6
|
+
import '@alfalab/core-components-calendar/modern';
|
|
7
|
+
import '@alfalab/core-components-icon-button/modern';
|
|
8
|
+
import '@alfalab/core-components-input/modern';
|
|
9
|
+
import '@alfalab/core-components-popover/modern';
|
|
10
|
+
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
11
|
+
import '../../utils/format.js';
|
|
12
|
+
import 'date-fns/parse';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { DateRangeInputDesktop } from './Component.desktop.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import './components/date-range-input/Component.js';
|
|
4
|
+
import 'react-merge-refs';
|
|
5
|
+
import 'classnames';
|
|
6
|
+
import 'date-fns/isValid';
|
|
7
|
+
import '@alfalab/core-components-calendar/modern';
|
|
8
|
+
import '@alfalab/core-components-icon-button/modern';
|
|
9
|
+
import '@alfalab/core-components-input/modern';
|
|
10
|
+
import '@alfalab/core-components-popover/modern';
|
|
11
|
+
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
12
|
+
import './utils/format.js';
|
|
13
|
+
import 'date-fns/parse';
|
package/modern/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { DateRangeInputResponsive as DateRangeInput, DateRangeInputResponsiveProps as DateRangeInputProps } from "./responsive";
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export { DateRangeInputResponsive as DateRangeInput } from './Component.responsive.js';
|
|
1
2
|
import 'react';
|
|
3
|
+
import '@alfalab/hooks';
|
|
4
|
+
import './Component.desktop.js';
|
|
5
|
+
import './components/date-range-input/Component.js';
|
|
2
6
|
import 'react-merge-refs';
|
|
3
7
|
import 'classnames';
|
|
4
8
|
import 'date-fns/isValid';
|
|
@@ -6,8 +10,7 @@ import '@alfalab/core-components-calendar/modern';
|
|
|
6
10
|
import '@alfalab/core-components-icon-button/modern';
|
|
7
11
|
import '@alfalab/core-components-input/modern';
|
|
8
12
|
import '@alfalab/core-components-popover/modern';
|
|
9
|
-
import '@alfalab/hooks';
|
|
10
13
|
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
11
|
-
import 'date-fns/parse';
|
|
12
14
|
import './utils/format.js';
|
|
13
|
-
|
|
15
|
+
import 'date-fns/parse';
|
|
16
|
+
import './Component.mobile.js';
|
package/modern/mobile.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { DateRangeInputMobile } from './Component.mobile.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@alfalab/core-components-calendar/modern';
|
|
4
|
+
import './components/date-range-input/Component.js';
|
|
5
|
+
import 'react-merge-refs';
|
|
6
|
+
import 'classnames';
|
|
7
|
+
import 'date-fns/isValid';
|
|
8
|
+
import '@alfalab/core-components-icon-button/modern';
|
|
9
|
+
import '@alfalab/core-components-input/modern';
|
|
10
|
+
import '@alfalab/core-components-popover/modern';
|
|
11
|
+
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
12
|
+
import './utils/format.js';
|
|
13
|
+
import 'date-fns/parse';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { DateRangeInputResponsive } from './Component.responsive.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@alfalab/hooks';
|
|
4
|
+
import './Component.desktop.js';
|
|
5
|
+
import './components/date-range-input/Component.js';
|
|
6
|
+
import 'react-merge-refs';
|
|
7
|
+
import 'classnames';
|
|
8
|
+
import 'date-fns/isValid';
|
|
9
|
+
import '@alfalab/core-components-calendar/modern';
|
|
10
|
+
import '@alfalab/core-components-icon-button/modern';
|
|
11
|
+
import '@alfalab/core-components-input/modern';
|
|
12
|
+
import '@alfalab/core-components-popover/modern';
|
|
13
|
+
import '@alfalab/icons-glyph/CalendarMIcon';
|
|
14
|
+
import './utils/format.js';
|
|
15
|
+
import 'date-fns/parse';
|
|
16
|
+
import './Component.mobile.js';
|
package/modern/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
export { DATE_FORMAT, DATE_MASK, format, isCompleteDateInput, isValid, parseDateString, parseTimestampToDate } from './format.js';
|
|
1
2
|
import 'date-fns/isValid';
|
|
2
3
|
import 'date-fns/parse';
|
|
3
|
-
export { DATE_FORMAT, DATE_MASK, format, isCompleteDateInput, isValid, parseDateString, parseTimestampToDate } from './format.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-date-range-input",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alfalab/core-components-input": "^11.1.
|
|
19
|
-
"@alfalab/core-components-icon-button": "^6.0.
|
|
20
|
-
"@alfalab/core-components-calendar": "^6.
|
|
21
|
-
"@alfalab/core-components-popover": "^6.0.
|
|
18
|
+
"@alfalab/core-components-input": "^11.1.1",
|
|
19
|
+
"@alfalab/core-components-icon-button": "^6.0.2",
|
|
20
|
+
"@alfalab/core-components-calendar": "^6.2.0",
|
|
21
|
+
"@alfalab/core-components-popover": "^6.0.5",
|
|
22
22
|
"classnames": "^2.3.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/responsive.d.ts
ADDED
package/responsive.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Component_responsive = require('./Component.responsive.js');
|
|
4
|
+
require('./Component-105ad648.js');
|
|
5
|
+
require('react');
|
|
6
|
+
require('react-merge-refs');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('date-fns/isValid');
|
|
9
|
+
require('@alfalab/core-components-calendar');
|
|
10
|
+
require('@alfalab/core-components-icon-button');
|
|
11
|
+
require('@alfalab/core-components-input');
|
|
12
|
+
require('@alfalab/core-components-popover');
|
|
13
|
+
require('@alfalab/icons-glyph/CalendarMIcon');
|
|
14
|
+
require('./utils/format.js');
|
|
15
|
+
require('date-fns/parse');
|
|
16
|
+
require('@alfalab/hooks');
|
|
17
|
+
require('./Component.desktop.js');
|
|
18
|
+
require('./Component.mobile.js');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.DateRangeInputResponsive = Component_responsive.DateRangeInputResponsive;
|
package/utils/format.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var dateFnsIsValid = require('date-fns/isValid');
|
|
6
4
|
var parse = require('date-fns/parse');
|
|
7
5
|
|
|
8
|
-
function
|
|
6
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
7
|
|
|
10
|
-
var dateFnsIsValid__default = /*#__PURE__*/
|
|
11
|
-
var parse__default = /*#__PURE__*/
|
|
8
|
+
var dateFnsIsValid__default = /*#__PURE__*/_interopDefaultCompat(dateFnsIsValid);
|
|
9
|
+
var parse__default = /*#__PURE__*/_interopDefaultCompat(parse);
|
|
12
10
|
|
|
13
11
|
/* eslint-disable no-useless-escape */
|
|
14
12
|
var DATE_FORMAT = 'dd.MM.yyyy';
|
|
@@ -40,13 +38,13 @@ var DATE_MASK = [
|
|
|
40
38
|
var isCompleteDateInput = function (input) { return input.length === DATE_MASK.length; };
|
|
41
39
|
var parseDateString = function (value, dateFormat) {
|
|
42
40
|
if (dateFormat === void 0) { dateFormat = DATE_FORMAT; }
|
|
43
|
-
return parse__default
|
|
41
|
+
return parse__default.default(value, dateFormat, new Date());
|
|
44
42
|
};
|
|
45
43
|
var isValid = function (inputValue, dateFrom, dateTo) {
|
|
46
44
|
return !inputValue ||
|
|
47
45
|
(isCompleteDateInput(inputValue) &&
|
|
48
|
-
dateFnsIsValid__default
|
|
49
|
-
dateFnsIsValid__default
|
|
46
|
+
dateFnsIsValid__default.default(parseDateString(dateFrom)) &&
|
|
47
|
+
dateFnsIsValid__default.default(parseDateString(dateTo)));
|
|
50
48
|
};
|
|
51
49
|
var format = function (value) {
|
|
52
50
|
return value
|
|
@@ -81,12 +79,12 @@ var parseTimestampToDate = function (timestamp) {
|
|
|
81
79
|
var month = date.getMonth() + 1;
|
|
82
80
|
var day = date.getDate();
|
|
83
81
|
if (month < 10) {
|
|
84
|
-
month = "0"
|
|
82
|
+
month = "0".concat(month);
|
|
85
83
|
}
|
|
86
84
|
if (day < 10) {
|
|
87
|
-
day = "0"
|
|
85
|
+
day = "0".concat(day);
|
|
88
86
|
}
|
|
89
|
-
return day
|
|
87
|
+
return "".concat(day, ".").concat(month, ".").concat(year);
|
|
90
88
|
};
|
|
91
89
|
|
|
92
90
|
exports.DATE_FORMAT = DATE_FORMAT;
|
package/utils/index.js
CHANGED