@terraware/web-components 5.2.8 → 5.2.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,GAAG,EAAE,oBAAoB,EAAY,MAAM,OAAO,CAAC;AAExE,OAAO,EAAO,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,GAAG,EAAE,oBAAoB,EAAY,MAAM,OAAO,CAAC;AAExE,OAAO,EAAO,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAe,MAAM,kBAAkB,CAAC;AAEzD,OAAO,eAAe,CAAC;AAEvB;;;;;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,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC;;;;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,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAYD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA0I5D"}
|
|
@@ -3,7 +3,6 @@ import react, { useState } from "react";
|
|
|
3
3
|
import { Box } from "@mui/material";
|
|
4
4
|
import { DesktopDatePicker, DesktopDateTimePicker, LocalizationProvider } from "@mui/x-date-pickers";
|
|
5
5
|
import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
|
|
6
|
-
import { Settings } from "luxon";
|
|
7
6
|
import { getDate, tz } from "../../utils/date.js";
|
|
8
7
|
import Icon from "../Icon/Icon.js";
|
|
9
8
|
import "./styles.scss";
|
|
@@ -17,7 +16,7 @@ function DatePicker(props) {
|
|
|
17
16
|
const [minDateTime, setMinDateTime] = useState(initializeDate(props.minDate, props.defaultTimeZone));
|
|
18
17
|
const [maxDateTime, setMaxDateTime] = useState(initializeDate(props.maxDate, props.defaultTimeZone));
|
|
19
18
|
const locale = props.locale ?? 'en';
|
|
20
|
-
|
|
19
|
+
const timezone = tz(props.defaultTimeZone);
|
|
21
20
|
react.useEffect(()=>{
|
|
22
21
|
setTemporalValue((prev)=>{
|
|
23
22
|
if (!props.value && prev && !prev.isValid) return prev;
|
|
@@ -63,6 +62,7 @@ function DatePicker(props) {
|
|
|
63
62
|
if (props.onDateChange) props.onDateChange(newValue && newValue.isValid ? newValue : void 0);
|
|
64
63
|
},
|
|
65
64
|
onError: props.onError,
|
|
65
|
+
timezone: timezone,
|
|
66
66
|
slotProps: {
|
|
67
67
|
textField: {
|
|
68
68
|
sx: {
|
|
@@ -106,6 +106,7 @@ function DatePicker(props) {
|
|
|
106
106
|
if (props.onDateChange) props.onDateChange(newValue && newValue.isValid ? newValue : void 0);
|
|
107
107
|
},
|
|
108
108
|
onError: props.onError,
|
|
109
|
+
timezone: timezone,
|
|
109
110
|
slotProps: {
|
|
110
111
|
textField: {
|
|
111
112
|
sx: {
|