@bbl-digital/snorre 2.2.6 → 2.2.7

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 CHANGED
@@ -25435,14 +25435,16 @@
25435
25435
  }
25436
25436
 
25437
25437
  const changeMonth = e => {
25438
- const newDate = date;
25438
+ let newDate = date;
25439
25439
  newDate.setMonth(e.target.value);
25440
+ if (newDate > toDate) newDate = toDate;
25440
25441
  onChange(newDate);
25441
25442
  };
25442
25443
 
25443
25444
  const changeYear = e => {
25444
- const newDate = date;
25445
+ let newDate = date;
25445
25446
  newDate.setFullYear(e.target.value);
25447
+ if (newDate > toDate) newDate = toDate;
25446
25448
  onChange(newDate);
25447
25449
  };
25448
25450
 
@@ -18,14 +18,16 @@ const YearMonthForm = ({
18
18
  }
19
19
 
20
20
  const changeMonth = e => {
21
- const newDate = date;
21
+ let newDate = date;
22
22
  newDate.setMonth(e.target.value);
23
+ if (newDate > toDate) newDate = toDate;
23
24
  onChange(newDate);
24
25
  };
25
26
 
26
27
  const changeYear = e => {
27
- const newDate = date;
28
+ let newDate = date;
28
29
  newDate.setFullYear(e.target.value);
30
+ if (newDate > toDate) newDate = toDate;
29
31
  onChange(newDate);
30
32
  };
31
33
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Datepicker/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAsC,MAAM,OAAO,CAAA;AAc1D,UAAU,MAAM;IACd,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,0BAA0B;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,2BAA2B;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAID,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CA8EhC,CAAA;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Datepicker/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAsC,MAAM,OAAO,CAAA;AAc1D,UAAU,MAAM;IACd,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAA;IAC/B,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,0BAA0B;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,2BAA2B;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAID,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CA8EhC,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"yearMonthForm.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Datepicker/yearMonthForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,MAAM;IACd,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IAC5B,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;CACd;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CA+CnC,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"yearMonthForm.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Datepicker/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,CAqDnC,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -18,14 +18,16 @@ const YearMonthForm = ({
18
18
  }
19
19
 
20
20
  const changeMonth = e => {
21
- const newDate = date;
21
+ let newDate = date;
22
22
  newDate.setMonth(e.target.value);
23
+ if (newDate > toDate) newDate = toDate;
23
24
  onChange(newDate);
24
25
  };
25
26
 
26
27
  const changeYear = e => {
27
- const newDate = date;
28
+ let newDate = date;
28
29
  newDate.setFullYear(e.target.value);
30
+ if (newDate > toDate) newDate = toDate;
29
31
  onChange(newDate);
30
32
  };
31
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",