@bbl-digital/snorre 3.0.16 → 3.0.19
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/dist/bundle.js +66 -27
- package/esm/core/Autocomplete/index.js +4 -0
- package/esm/core/BoxedTable/DraggableRow/index.js +15 -9
- package/esm/core/BoxedTable/DraggableRow/styles.js +35 -7
- package/esm/core/BoxedTable/styles.js +11 -11
- package/esm/core/SimpleLineChart/index.js +3 -1
- package/esm/enums/ModifierKey.js +13 -0
- package/lib/core/Autocomplete/index.d.ts.map +1 -1
- package/lib/core/Autocomplete/index.interfaces.d.ts +2 -0
- package/lib/core/Autocomplete/index.interfaces.d.ts.map +1 -1
- package/lib/core/Autocomplete/index.js +4 -0
- package/lib/core/BoxedTable/DraggableRow/index.d.ts +2 -0
- package/lib/core/BoxedTable/DraggableRow/index.d.ts.map +1 -1
- package/lib/core/BoxedTable/DraggableRow/index.js +15 -9
- package/lib/core/BoxedTable/DraggableRow/styles.d.ts +8 -0
- package/lib/core/BoxedTable/DraggableRow/styles.d.ts.map +1 -1
- package/lib/core/BoxedTable/DraggableRow/styles.js +35 -7
- package/lib/core/BoxedTable/styles.d.ts.map +1 -1
- package/lib/core/BoxedTable/styles.js +11 -11
- package/lib/core/SimpleLineChart/index.d.ts +2 -0
- package/lib/core/SimpleLineChart/index.d.ts.map +1 -1
- package/lib/core/SimpleLineChart/index.js +3 -1
- 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/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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export let ModifierKey;
|
|
2
|
+
|
|
3
|
+
(function (ModifierKey) {
|
|
4
|
+
ModifierKey["enter"] = "Enter";
|
|
5
|
+
ModifierKey["tab"] = "Tab";
|
|
6
|
+
ModifierKey["space"] = " ";
|
|
7
|
+
ModifierKey["escape"] = "Escape";
|
|
8
|
+
ModifierKey["shift"] = "Shift";
|
|
9
|
+
ModifierKey["right"] = "ArrowRight";
|
|
10
|
+
ModifierKey["left"] = "ArrowLeft";
|
|
11
|
+
ModifierKey["up"] = "ArrowUp";
|
|
12
|
+
ModifierKey["down"] = "ArrowDown";
|
|
13
|
+
})(ModifierKey || (ModifierKey = {}));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"YearMonthForm.d.ts","sourceRoot":"","sources":["../../../src/packages/core/DatepickerRange/YearMonthForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,MAAM;IACd,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAA;IAC3B,QAAQ,EAAE,IAAI,CAAA;IACd,MAAM,EAAE,IAAI,CAAA;CACb;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAmDnC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -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;
|