@mtes-mct/monitor-ui 23.1.0 → 23.1.1
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
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [23.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v23.0.0...v23.1.0) (2024-09-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **fields:** add unit prop to NumberInput ([5773587](https://github.com/MTES-MCT/monitor-ui/commit/5773587eb738e6eb8672ede9dc348dd430070acb))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **fields:** re-add missing hasError passed prop within NumberInput ([2a3e6fb](https://github.com/MTES-MCT/monitor-ui/commit/2a3e6fb76dc1b23a09b0346695d623f6f2e719bf))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Buid System & Dependencies
|
|
15
|
+
|
|
16
|
+
* **dev-deps:** bump date-fns from 3.6.0 to 4.0.0 ([0490c87](https://github.com/MTES-MCT/monitor-ui/commit/0490c87f2e0b7842719619c25a28d8da3510c92d))
|
|
17
|
+
* **dev-deps:** bump rollup in /e2e/release/sample ([d129438](https://github.com/MTES-MCT/monitor-ui/commit/d1294389097d528637c481ada8ea9ad1514f2640))
|
|
18
|
+
* **dev-deps:** bump the all-non-major-dependencies group ([949f672](https://github.com/MTES-MCT/monitor-ui/commit/949f6720e532f2e91222fe20352330ed270ea17e))
|
|
19
|
+
* **dev-deps:** bump the all-non-major-dependencies group across 1 directory with 4 updates ([5de56bd](https://github.com/MTES-MCT/monitor-ui/commit/5de56bd3f1da2832c7302c4db549fe5387aca01a))
|
|
20
|
+
* **dev-deps:** bump vite from 5.4.3 to 5.4.6 in /e2e/release/sample ([7dd2268](https://github.com/MTES-MCT/monitor-ui/commit/7dd2268c1c3eced211027447da3c6c4139510a79))
|
|
21
|
+
|
|
1
22
|
## [23.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v22.1.0...v23.0.0) (2024-09-12)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InputHTMLAttributes } from 'react';
|
|
2
2
|
import type { Promisable } from 'type-fest';
|
|
3
|
-
export type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'maxLength' | 'onInput' | 'pattern' | 'type'> & {
|
|
3
|
+
export type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'max' | 'maxLength' | 'min' | 'onInput' | 'pattern' | 'type'> & {
|
|
4
4
|
isLight: boolean;
|
|
5
5
|
max?: number;
|
|
6
6
|
min?: number;
|
|
@@ -17,7 +17,7 @@ export type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'defa
|
|
|
17
17
|
onPrevious?: (() => Promisable<void>) | undefined;
|
|
18
18
|
size: number;
|
|
19
19
|
};
|
|
20
|
-
export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "pattern" | "type" | "onInput" | "defaultValue" | "maxLength"> & {
|
|
20
|
+
export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onInput" | "defaultValue" | "maxLength"> & {
|
|
21
21
|
isLight: boolean;
|
|
22
22
|
max?: number;
|
|
23
23
|
min?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../src/fields/DateRangePicker/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAA;AAKd,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,mBAAmB,CAAC,gBAAgB,CAAC,EAC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Lb,OAAO;UACV,MAAM;UACN,MAAM;UACN,MAAM;IACZ,wEAAwE;aAC/D,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS;IAC7C,6DAA6D;eAClD,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS;mBAChC,CAAC,kBAAkB,EAAE,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC;cACtD,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS;IAC/D,+FAA+F;aACtF,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS;IAC7C,gGAAgG;iBACnF,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS;UAC3C,MAAM;oDAgL2C,CAAA"}
|
package/fields/Select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/fields/Select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/fields/Select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAsC,KAAK,iBAAiB,IAAI,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAS9G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,WAAW,CAAC,WAAW,SAAS,eAAe,GAAG,MAAM,IAAI,IAAI,CAC1E,uBAAuB,CAAC,GAAG,CAAC,EAC1B,IAAI,GACJ,WAAW,GACX,MAAM,GACN,cAAc,GACd,IAAI,GACJ,UAAU,GACV,gBAAgB,GAChB,aAAa,GACb,OAAO,GACP,UAAU,CACb,GAAG;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,EACL,GAAG,aAAa,EACjB,EAAE,WAAW,CAAC,WAAW,CAAC,2CA6I1B"}
|
package/index.js
CHANGED
|
@@ -53763,15 +53763,16 @@ const PrimaryText = styled.span`
|
|
|
53763
53763
|
color: ${(p)=>p.theme.color.gunMetal};
|
|
53764
53764
|
font-size: 13px;
|
|
53765
53765
|
line-height: 1.3846;
|
|
53766
|
-
padding:
|
|
53766
|
+
padding: 2px 8px 6px;
|
|
53767
53767
|
overflow: hidden;
|
|
53768
53768
|
text-overflow: ellipsis;
|
|
53769
53769
|
white-space: nowrap;
|
|
53770
53770
|
`;
|
|
53771
53771
|
const PrimaryIconButton = styled(IconButton)`
|
|
53772
53772
|
background-color: ${(p)=>p.theme.color.lightGray};
|
|
53773
|
+
line-height: 18px;
|
|
53773
53774
|
margin-left: 1px;
|
|
53774
|
-
padding:
|
|
53775
|
+
padding: 2px 8px 6px;
|
|
53775
53776
|
|
|
53776
53777
|
:hover,
|
|
53777
53778
|
&._hover {
|
|
@@ -66318,7 +66319,7 @@ function NumberInputWithRef({ isLight, max, min, name, onBack, onBlur, onFilled,
|
|
|
66318
66319
|
return;
|
|
66319
66320
|
}
|
|
66320
66321
|
const valueAsNumber = Number(inputRef.current.value);
|
|
66321
|
-
if (Number.isNaN(valueAsNumber) || valueAsNumber < min || valueAsNumber > max) {
|
|
66322
|
+
if (Number.isNaN(valueAsNumber) || min !== undefined && valueAsNumber < min || max !== undefined && valueAsNumber > max) {
|
|
66322
66323
|
onFormatError(true);
|
|
66323
66324
|
return;
|
|
66324
66325
|
}
|
|
@@ -69307,6 +69308,28 @@ function Select({ className, customSearch, customSearchMinQueryLength = 1, disab
|
|
|
69307
69308
|
controlledRsuiteData,
|
|
69308
69309
|
rsuiteData
|
|
69309
69310
|
]);
|
|
69311
|
+
const listProps = useMemo(()=>originalProps.virtualized ? {
|
|
69312
|
+
onItemsRendered: lodashExports.debounce(()=>{
|
|
69313
|
+
if (!boxRef.current) {
|
|
69314
|
+
return;
|
|
69315
|
+
}
|
|
69316
|
+
const divs = boxRef.current.querySelectorAll(`#${originalProps.name}-listbox div`);
|
|
69317
|
+
const targetDiv = divs[2];
|
|
69318
|
+
/**
|
|
69319
|
+
* Reset the 'pointer-events' style
|
|
69320
|
+
* @see:
|
|
69321
|
+
* https://github.com/MTES-MCT/monitorfish/issues/3211
|
|
69322
|
+
* https://github.com/bvaughn/react-window/issues/128
|
|
69323
|
+
*/ if (targetDiv) {
|
|
69324
|
+
requestAnimationFrame(()=>{
|
|
69325
|
+
targetDiv.style.pointerEvents = 'auto';
|
|
69326
|
+
});
|
|
69327
|
+
}
|
|
69328
|
+
}, 300)
|
|
69329
|
+
} : {}, [
|
|
69330
|
+
originalProps.virtualized,
|
|
69331
|
+
originalProps.name
|
|
69332
|
+
]);
|
|
69310
69333
|
useFieldUndefineEffect(isUndefinedWhenDisabled && disabled, onChange);
|
|
69311
69334
|
useEffect(()=>{
|
|
69312
69335
|
forceUpdate();
|
|
@@ -69341,6 +69364,7 @@ function Select({ className, customSearch, customSearchMinQueryLength = 1, disab
|
|
|
69341
69364
|
disabled: disabled,
|
|
69342
69365
|
disabledItemValues: disabledItemValues,
|
|
69343
69366
|
id: originalProps.name,
|
|
69367
|
+
listProps: listProps,
|
|
69344
69368
|
onChange: handleChange,
|
|
69345
69369
|
onSearch: handleSearch,
|
|
69346
69370
|
// `as any` because we customized `ItemDataType` type by adding `optionValue`,
|
|
@@ -73999,7 +74023,7 @@ function RowCheckbox({ onChange, ...nativeProps }) {
|
|
|
73999
74023
|
onChange
|
|
74000
74024
|
]);
|
|
74001
74025
|
return /*#__PURE__*/ jsx(RestyledRsuiteCheckbox, {
|
|
74002
|
-
$isChecked: nativeProps.checked || nativeProps.indeterminate,
|
|
74026
|
+
$isChecked: !!nativeProps.checked || !!nativeProps.indeterminate,
|
|
74003
74027
|
$isDisabled: nativeProps.disabled,
|
|
74004
74028
|
$isReadOnly: nativeProps.readOnly,
|
|
74005
74029
|
...nativeProps,
|
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": "23.1.
|
|
4
|
+
"version": "23.1.1",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|