@terraware/web-components 2.12.9-rc.2 → 2.12.9-rc.3
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.
@@ -2,7 +2,13 @@ import React, { KeyboardEventHandler } from 'react';
|
|
2
2
|
import { DateTime } from 'luxon';
|
3
3
|
import './styles.scss';
|
4
4
|
import { DateType } from '../../utils/date';
|
5
|
-
|
5
|
+
/**
|
6
|
+
* TODO: remove support for JS Date in DatePickerDateType once
|
7
|
+
* clients have moved to only using DateTime objects in input props
|
8
|
+
* and callback arguments.
|
9
|
+
* export type DatePickerDateType = Exclude<DateType, Date> | null;
|
10
|
+
*/
|
11
|
+
export type DatePickerDateType = DateType | null;
|
6
12
|
export interface Props {
|
7
13
|
'aria-label': string;
|
8
14
|
autoFocus?: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAI9D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAW,MAAM,kBAAkB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAI9D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAW,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5C,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B;AAYD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAqE5D"}
|
@@ -15,15 +15,19 @@ var _AdapterLuxon = require("@mui/x-date-pickers/AdapterLuxon");
|
|
15
15
|
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
16
16
|
require("./styles.scss");
|
17
17
|
var _date = require("../../utils/date");
|
18
|
+
/**
|
19
|
+
* TODO: remove support for JS Date in DatePickerDateType once
|
20
|
+
* clients have moved to only using DateTime objects in input props
|
21
|
+
* and callback arguments.
|
22
|
+
* export type DatePickerDateType = Exclude<DateType, Date> | null;
|
23
|
+
*/
|
24
|
+
|
18
25
|
var initializeDate = function initializeDate(value, defaultTimeZone) {
|
19
26
|
if (!value) {
|
20
27
|
return null;
|
21
28
|
}
|
22
|
-
|
23
|
-
|
24
|
-
return date !== null && date !== void 0 && date.isValid ? date : null;
|
25
|
-
}
|
26
|
-
return value;
|
29
|
+
var date = (0, _date.getDate)(value, defaultTimeZone);
|
30
|
+
return date !== null && date !== void 0 && date.isValid ? date : null;
|
27
31
|
};
|
28
32
|
function DatePicker(props) {
|
29
33
|
var _props$locale;
|