@bbl-digital/snorre 3.1.46 → 3.1.48
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +173 -138
- package/esm/core/Modal/ActionButtons/index.js +38 -0
- package/esm/core/Modal/index.js +5 -3
- package/esm/enums/ModifierKey.js +13 -0
- package/esm/layout/Menu/AppPicker/styles.js +7 -5
- package/lib/core/Modal/ActionButtons/index.d.ts +10 -0
- package/lib/core/Modal/ActionButtons/index.d.ts.map +1 -0
- package/lib/core/Modal/ActionButtons/index.js +38 -0
- package/lib/core/Modal/index.d.ts +9 -2
- package/lib/core/Modal/index.d.ts.map +1 -1
- package/lib/core/Modal/index.js +5 -3
- package/lib/enums/ModifierKey.d.ts +12 -0
- package/lib/enums/ModifierKey.d.ts.map +1 -0
- package/lib/enums/ModifierKey.js +13 -0
- package/lib/layout/Menu/AppPicker/styles.d.ts.map +1 -1
- package/lib/layout/Menu/AppPicker/styles.js +7 -5
- package/package.json +1 -1
- package/esm/core/Autocomplete/index.d.js +0 -1
- package/esm/core/DatepickerRange/YearMonthForm.js +0 -56
- package/lib/core/Autocomplete/index.d.js +0 -1
- package/lib/core/DatepickerRange/YearMonthForm.d.ts +0 -10
- package/lib/core/DatepickerRange/YearMonthForm.d.ts.map +0 -1
- package/lib/core/DatepickerRange/YearMonthForm.js +0 -56
@@ -1,56 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { MONTHS } from '../../utils/dates';
|
3
|
-
import { StyledSelect, Div } from './styles';
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
6
|
-
|
7
|
-
const YearMonthForm = ({
|
8
|
-
onChange,
|
9
|
-
date,
|
10
|
-
fromDate,
|
11
|
-
toDate
|
12
|
-
}) => {
|
13
|
-
const months = MONTHS;
|
14
|
-
const years = [];
|
15
|
-
|
16
|
-
for (let i = fromDate.getFullYear(); i <= toDate.getFullYear(); i += 1) {
|
17
|
-
years.push(i);
|
18
|
-
}
|
19
|
-
|
20
|
-
const changeMonth = e => {
|
21
|
-
let newDate = date;
|
22
|
-
newDate.setMonth(e.target.value);
|
23
|
-
if (newDate > toDate) newDate = toDate;
|
24
|
-
onChange(newDate);
|
25
|
-
};
|
26
|
-
|
27
|
-
const changeYear = e => {
|
28
|
-
let newDate = date;
|
29
|
-
newDate.setFullYear(e.target.value);
|
30
|
-
if (newDate > toDate) newDate = toDate;
|
31
|
-
onChange(newDate);
|
32
|
-
};
|
33
|
-
|
34
|
-
return /*#__PURE__*/_jsxs(Div, {
|
35
|
-
className: "DayPicker-Caption",
|
36
|
-
children: [/*#__PURE__*/_jsx(StyledSelect, {
|
37
|
-
name: "month",
|
38
|
-
onChange: changeMonth,
|
39
|
-
value: date.getMonth(),
|
40
|
-
children: months.map((month, i) => /*#__PURE__*/_jsx("option", {
|
41
|
-
value: i,
|
42
|
-
children: month
|
43
|
-
}, month))
|
44
|
-
}), /*#__PURE__*/_jsx(StyledSelect, {
|
45
|
-
name: "year",
|
46
|
-
onChange: changeYear,
|
47
|
-
value: date.getFullYear(),
|
48
|
-
children: years.map(year => /*#__PURE__*/_jsx("option", {
|
49
|
-
value: year,
|
50
|
-
children: year
|
51
|
-
}, year))
|
52
|
-
})]
|
53
|
-
});
|
54
|
-
};
|
55
|
-
|
56
|
-
export default YearMonthForm;
|