@bbl-digital/snorre 3.1.55 → 3.1.57
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +68 -42
- package/esm/core/ImageCarousel/index.js +70 -0
- package/esm/core/ImageCarousel/styles.js +58 -0
- package/esm/core/InfoButton/index.js +2 -1
- package/esm/core/InfoButton/styles.js +13 -13
- package/esm/core/Select/index.js +16 -2
- package/esm/core/Select/styles.js +37 -24
- package/esm/enums/ModifierKey.js +13 -0
- package/lib/core/ImageCarousel/index.d.ts +11 -0
- package/lib/core/ImageCarousel/index.d.ts.map +1 -0
- package/lib/core/ImageCarousel/index.js +70 -0
- package/lib/core/ImageCarousel/styles.d.ts +26 -0
- package/lib/core/ImageCarousel/styles.d.ts.map +1 -0
- package/lib/core/ImageCarousel/styles.js +58 -0
- package/lib/core/InfoButton/index.d.ts +2 -0
- package/lib/core/InfoButton/index.d.ts.map +1 -1
- package/lib/core/InfoButton/index.js +2 -1
- package/lib/core/InfoButton/styles.d.ts.map +1 -1
- package/lib/core/InfoButton/styles.js +13 -13
- package/lib/core/Select/index.d.ts +4 -0
- package/lib/core/Select/index.d.ts.map +1 -1
- package/lib/core/Select/index.js +16 -2
- package/lib/core/Select/styles.d.ts +3 -0
- package/lib/core/Select/styles.d.ts.map +1 -1
- package/lib/core/Select/styles.js +37 -24
- 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;
|