@mtes-mct/monitor-ui 24.21.2 → 24.21.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.
- package/CHANGELOG.md +6 -0
- package/fields/CoordinatesInput/DDCoordinatesInput.d.ts.map +1 -1
- package/index.js +17 -23
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [24.21.2](https://github.com/MTES-MCT/monitor-ui/compare/v24.21.1...v24.21.2) (2025-06-10)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **icons:** fix PointsCloud color ([9b7950f](https://github.com/MTES-MCT/monitor-ui/commit/9b7950f65686f932c31a5533657603dc98622e5b))
|
|
6
|
+
|
|
1
7
|
## [24.21.1](https://github.com/MTES-MCT/monitor-ui/compare/v24.21.0...v24.21.1) (2025-06-10)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DDCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DDCoordinatesInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAI1D,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,QAAQ,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;IAC5D,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAcD,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"DDCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DDCoordinatesInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAI1D,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,QAAQ,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;IAC5D,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAcD,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,uBAAuB,2CAgF9G"}
|
package/index.js
CHANGED
|
@@ -56635,10 +56635,16 @@ function toControlledValue(value) {
|
|
|
56635
56635
|
return value ? `${value}` : undefined;
|
|
56636
56636
|
}
|
|
56637
56637
|
function DDCoordinatesInput({ coordinates, disabled, name, onChange, readOnly }) {
|
|
56638
|
-
const [latitude, setLatitude] = useState();
|
|
56639
|
-
const [longitude, setLongitude] = useState();
|
|
56638
|
+
const [latitude, setLatitude] = useState(coordinates?.[0]?.toString());
|
|
56639
|
+
const [longitude, setLongitude] = useState(coordinates?.[1]?.toString());
|
|
56640
56640
|
const [latitudeError, setLatitudeError] = useState(undefined);
|
|
56641
56641
|
const [longitudeError, setLongitudeError] = useState(undefined);
|
|
56642
|
+
useEffect(()=>{
|
|
56643
|
+
setLatitude(coordinates?.[0]?.toString());
|
|
56644
|
+
setLongitude(coordinates?.[1]?.toString());
|
|
56645
|
+
}, [
|
|
56646
|
+
coordinates
|
|
56647
|
+
]);
|
|
56642
56648
|
const handleLatitudeChange = (value)=>{
|
|
56643
56649
|
setLatitudeError(undefined);
|
|
56644
56650
|
setLatitude(value);
|
|
@@ -56679,18 +56685,6 @@ function DDCoordinatesInput({ coordinates, disabled, name, onChange, readOnly })
|
|
|
56679
56685
|
onChange(undefined);
|
|
56680
56686
|
}
|
|
56681
56687
|
};
|
|
56682
|
-
const formattedLatitude = ()=>{
|
|
56683
|
-
if (latitude) {
|
|
56684
|
-
return toControlledValue(latitude);
|
|
56685
|
-
}
|
|
56686
|
-
return toControlledValue(coordinates?.[0]);
|
|
56687
|
-
};
|
|
56688
|
-
const formattedLongitude = ()=>{
|
|
56689
|
-
if (longitude) {
|
|
56690
|
-
return toControlledValue(longitude);
|
|
56691
|
-
}
|
|
56692
|
-
return toControlledValue(coordinates?.[1]);
|
|
56693
|
-
};
|
|
56694
56688
|
return /*#__PURE__*/ jsxs(Box$9, {
|
|
56695
56689
|
children: [
|
|
56696
56690
|
/*#__PURE__*/ jsx(DDInput, {
|
|
@@ -56700,7 +56694,7 @@ function DDCoordinatesInput({ coordinates, disabled, name, onChange, readOnly })
|
|
|
56700
56694
|
onChange: (e)=>handleLatitudeChange(e.target.value),
|
|
56701
56695
|
placeholder: "Latitude",
|
|
56702
56696
|
readOnly: readOnly,
|
|
56703
|
-
value:
|
|
56697
|
+
value: toControlledValue(latitude) ?? ''
|
|
56704
56698
|
}),
|
|
56705
56699
|
/*#__PURE__*/ jsx(DDInput, {
|
|
56706
56700
|
"data-cy": "coordinates-dd-input-lon",
|
|
@@ -56709,7 +56703,7 @@ function DDCoordinatesInput({ coordinates, disabled, name, onChange, readOnly })
|
|
|
56709
56703
|
onChange: (e)=>handleLongitudeChange(e.target.value),
|
|
56710
56704
|
placeholder: "Longitude",
|
|
56711
56705
|
readOnly: readOnly,
|
|
56712
|
-
value:
|
|
56706
|
+
value: toControlledValue(longitude) ?? ''
|
|
56713
56707
|
}),
|
|
56714
56708
|
/*#__PURE__*/ jsx(CoordinatesType$2, {
|
|
56715
56709
|
children: "(DD)"
|
|
@@ -67032,9 +67026,9 @@ function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled, name, o
|
|
|
67032
67026
|
function completeCoordinates(mask) {
|
|
67033
67027
|
setError('');
|
|
67034
67028
|
// eslint-disable-next-line no-underscore-dangle
|
|
67035
|
-
const latitude = mask._unmaskedValue.substring(0,
|
|
67029
|
+
const latitude = mask._unmaskedValue.substring(0, 8);
|
|
67036
67030
|
// eslint-disable-next-line no-underscore-dangle
|
|
67037
|
-
const longitude = mask._unmaskedValue.substring(
|
|
67031
|
+
const longitude = mask._unmaskedValue.substring(8, mask._unmaskedValue.length);
|
|
67038
67032
|
const NS = latitude[latitude.length - 1].toUpperCase();
|
|
67039
67033
|
if (![
|
|
67040
67034
|
'N',
|
|
@@ -67049,7 +67043,7 @@ function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled, name, o
|
|
|
67049
67043
|
return;
|
|
67050
67044
|
}
|
|
67051
67045
|
const latitudeMinutes = parseInt(latitude.substring(2, 4), 10);
|
|
67052
|
-
const latitudeSeconds = parseInt(latitude.substring(4,
|
|
67046
|
+
const latitudeSeconds = parseInt(latitude.substring(4, 7), 10);
|
|
67053
67047
|
const EW = longitude[longitude.length - 1].toUpperCase();
|
|
67054
67048
|
if (![
|
|
67055
67049
|
'E',
|
|
@@ -67064,9 +67058,9 @@ function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled, name, o
|
|
|
67064
67058
|
return;
|
|
67065
67059
|
}
|
|
67066
67060
|
const longitudeMinutes = parseInt(longitude.substring(3, 5), 10);
|
|
67067
|
-
const longitudeSeconds = parseInt(longitude.substring(5,
|
|
67068
|
-
const dLatitude = dmsToDecimal(latitudeDegrees, latitudeMinutes + 10 ** -
|
|
67069
|
-
const dLongitude = dmsToDecimal(longitudeDegrees, longitudeMinutes + 10 ** -
|
|
67061
|
+
const longitudeSeconds = parseInt(longitude.substring(5, 8), 10);
|
|
67062
|
+
const dLatitude = dmsToDecimal(latitudeDegrees, latitudeMinutes + 10 ** -3 * latitudeSeconds, 0, NS, 6);
|
|
67063
|
+
const dLongitude = dmsToDecimal(longitudeDegrees, longitudeMinutes + 10 ** -3 * longitudeSeconds, 0, EW, 6);
|
|
67070
67064
|
if (isNumeric(dLatitude) && isNumeric(dLongitude)) {
|
|
67071
67065
|
onChange([
|
|
67072
67066
|
dLatitude,
|
|
@@ -67082,7 +67076,7 @@ function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled, name, o
|
|
|
67082
67076
|
"data-cy": "dmd-coordinates-input",
|
|
67083
67077
|
disabled: disabled,
|
|
67084
67078
|
lazy: false,
|
|
67085
|
-
mask: "00° 00.
|
|
67079
|
+
mask: "00° 00.000′ a 000° 00.000′ a",
|
|
67086
67080
|
name: name,
|
|
67087
67081
|
// @ts-ignore
|
|
67088
67082
|
onAccept: (_, mask)=>setValue(mask.value),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtes-mct/monitor-ui",
|
|
3
3
|
"description": "Common React components, hooks, utilities and CSS stylesheets for MonitorFish, MonitorEnv and RapportNav.",
|
|
4
|
-
"version": "24.21.
|
|
4
|
+
"version": "24.21.3",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|