@mtes-mct/monitor-ui 23.0.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 +40 -0
- package/fields/DateRangePicker/NumberInput.d.ts +2 -2
- package/fields/DateRangePicker/NumberInput.d.ts.map +1 -1
- package/fields/NumberInput.d.ts +2 -1
- package/fields/NumberInput.d.ts.map +1 -1
- package/fields/Select.d.ts.map +1 -1
- package/index.js +101 -25
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
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
|
+
|
|
22
|
+
## [23.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v22.1.0...v23.0.0) (2024-09-12)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### ⚠ BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* **elements:** - `disabled` is renamed `$isDisabled` in `Legend` props.
|
|
28
|
+
- `hasError` is renamed `$hasError` in `Legend` props.
|
|
29
|
+
- `isHidden` is renamed `$isHidden` in `Legend` props.
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **elements:** prefix styled component props in Legend ([ef4284a](https://github.com/MTES-MCT/monitor-ui/commit/ef4284a50dee68cdb6c65308d2ae42da2798efdf))
|
|
34
|
+
* **fields:** prefix styled components props in DateRangePicker ([3572267](https://github.com/MTES-MCT/monitor-ui/commit/3572267c6e285d87f7c9efd006bf7c0daf592a5e))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Buid System & Dependencies
|
|
38
|
+
|
|
39
|
+
* **deps:** bump express from 4.19.2 to 4.21.0 ([46d1134](https://github.com/MTES-MCT/monitor-ui/commit/46d113401e48191f59f9c8e309761ba2e44ccbb0))
|
|
40
|
+
|
|
1
41
|
## [22.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v22.0.1...v22.1.0) (2024-09-12)
|
|
2
42
|
|
|
3
43
|
|
|
@@ -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,EACrC,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,
|
|
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,gBAAg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M,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/NumberInput.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | '
|
|
|
14
14
|
name: string;
|
|
15
15
|
onChange?: (nextValue: number | undefined) => Promisable<void>;
|
|
16
16
|
readOnly?: boolean | undefined;
|
|
17
|
+
unit?: string | undefined;
|
|
17
18
|
value?: number | undefined;
|
|
18
19
|
};
|
|
19
|
-
export declare function NumberInput({ areArrowsHidden, className, disabled, error, isErrorMessageHidden, isLabelHidden, isLight, isRequired, isTransparent, isUndefinedWhenDisabled, label, name, onBlur, onChange, onFocus, readOnly, style, value, ...originalProps }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function NumberInput({ areArrowsHidden, className, disabled, error, isErrorMessageHidden, isLabelHidden, isLight, isRequired, isTransparent, isUndefinedWhenDisabled, label, name, onBlur, onChange, onFocus, readOnly, style, unit, value, ...originalProps }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
//# sourceMappingURL=NumberInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../src/fields/NumberInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAA;AAiB/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,cAAc,GAAG,IAAI,GAAG,UAAU,GAAG,MAAM,GAA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@@ -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;IACF,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAA;IAChD,+EAA+E;IAC/E,0BAA0B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,uBAAuB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,GAAG,SAAS,KAAK,UAAU,CAAC,IAAI,CAAC,CAAA;IACnE,cAAc,CAAC,EAAE,MAAM,WAAW,GAAG,SAAS,CAAA;IAC9C,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;CAChC,CAAA;AACD,wBAAgB,MAAM,CAAC,WAAW,SAAS,eAAe,GAAG,MAAM,EAAE,EACnE,SAAS,EACT,YAAY,EACZ,0BAA8B,EAC9B,QAAgB,EAChB,KAAK,EACL,WAAkB,EAClB,oBAA4B,EAC5B,aAAqB,EACrB,OAAe,EACf,UAAkB,EAClB,aAAqB,EACrB,uBAA+B,EAC/B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,cAAc,EACd,UAAU,EACV,QAAgB,EAChB,UAAkB,EAClB,KAAK,EACL,KAAK,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
|
}
|
|
@@ -68598,7 +68599,7 @@ const Link = styled.a`
|
|
|
68598
68599
|
}
|
|
68599
68600
|
`;
|
|
68600
68601
|
|
|
68601
|
-
function NumberInput({ areArrowsHidden = false, className, disabled = false, error, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isRequired = false, isTransparent = false, isUndefinedWhenDisabled = false, label, name, onBlur, onChange, onFocus, readOnly = false, style, value, ...originalProps }) {
|
|
68602
|
+
function NumberInput({ areArrowsHidden = false, className, disabled = false, error, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isRequired = false, isTransparent = false, isUndefinedWhenDisabled = false, label, name, onBlur, onChange, onFocus, readOnly = false, style, unit, value, ...originalProps }) {
|
|
68602
68603
|
// eslint-disable-next-line no-null/no-null
|
|
68603
68604
|
const inputRef = useRef(null);
|
|
68604
68605
|
const controlledClassname = useMemo(()=>classnames('Field-NumberInput', className), [
|
|
@@ -68645,6 +68646,24 @@ function NumberInput({ areArrowsHidden = false, className, disabled = false, err
|
|
|
68645
68646
|
preventWheelEvent
|
|
68646
68647
|
]);
|
|
68647
68648
|
useFieldUndefineEffect(isUndefinedWhenDisabled && !!disabled, onChange);
|
|
68649
|
+
const commonInputProps = {
|
|
68650
|
+
$areArrowsHidden: areArrowsHidden,
|
|
68651
|
+
$hasError: hasError,
|
|
68652
|
+
$isDisabled: disabled,
|
|
68653
|
+
$isLight: isLight,
|
|
68654
|
+
$isReadOnly: readOnly,
|
|
68655
|
+
$isTransparent: isTransparent,
|
|
68656
|
+
disabled,
|
|
68657
|
+
id: name,
|
|
68658
|
+
onBlur: handleBlur,
|
|
68659
|
+
onChange: handleChange,
|
|
68660
|
+
onFocus: handleFocus,
|
|
68661
|
+
readOnly,
|
|
68662
|
+
ref: inputRef,
|
|
68663
|
+
type: 'number',
|
|
68664
|
+
value: value ?? '',
|
|
68665
|
+
...originalProps
|
|
68666
|
+
};
|
|
68648
68667
|
return /*#__PURE__*/ jsxs(Field$2, {
|
|
68649
68668
|
className: controlledClassname,
|
|
68650
68669
|
style: style,
|
|
@@ -68656,23 +68675,21 @@ function NumberInput({ areArrowsHidden = false, className, disabled = false, err
|
|
|
68656
68675
|
htmlFor: name,
|
|
68657
68676
|
children: label
|
|
68658
68677
|
}),
|
|
68659
|
-
/*#__PURE__*/ jsx(
|
|
68660
|
-
|
|
68661
|
-
|
|
68678
|
+
!unit && /*#__PURE__*/ jsx(InputWithoutUnit, {
|
|
68679
|
+
...commonInputProps
|
|
68680
|
+
}, key),
|
|
68681
|
+
!!unit && /*#__PURE__*/ jsxs(InputBoxWithUnit, {
|
|
68662
68682
|
$hasError: hasError,
|
|
68663
68683
|
$isDisabled: disabled,
|
|
68664
68684
|
$isLight: isLight,
|
|
68665
68685
|
$isReadOnly: readOnly,
|
|
68666
68686
|
$isTransparent: isTransparent,
|
|
68667
|
-
|
|
68668
|
-
|
|
68669
|
-
|
|
68670
|
-
|
|
68671
|
-
|
|
68672
|
-
|
|
68673
|
-
type: "number",
|
|
68674
|
-
value: value ?? '',
|
|
68675
|
-
...originalProps
|
|
68687
|
+
children: [
|
|
68688
|
+
/*#__PURE__*/ jsx(InputWithUnit, {
|
|
68689
|
+
...commonInputProps
|
|
68690
|
+
}),
|
|
68691
|
+
unit
|
|
68692
|
+
]
|
|
68676
68693
|
}, key),
|
|
68677
68694
|
!isErrorMessageHidden && hasError && /*#__PURE__*/ jsx(FieldError, {
|
|
68678
68695
|
children: controlledError
|
|
@@ -68680,9 +68697,7 @@ function NumberInput({ areArrowsHidden = false, className, disabled = false, err
|
|
|
68680
68697
|
]
|
|
68681
68698
|
});
|
|
68682
68699
|
}
|
|
68683
|
-
const
|
|
68684
|
-
background-color: ${getFieldBackgroundColorFactory()};
|
|
68685
|
-
border: solid 1px ${getFieldBorderColorFactoryForState('default')};
|
|
68700
|
+
const BaseInput = styled(Input)`
|
|
68686
68701
|
border-radius: 0;
|
|
68687
68702
|
color: ${(p)=>p.theme.color.gunMetal};
|
|
68688
68703
|
${(p)=>p.$isReadOnly && `cursor: default;`}
|
|
@@ -68707,9 +68722,6 @@ const StyledInput = styled(Input)`
|
|
|
68707
68722
|
}
|
|
68708
68723
|
|
|
68709
68724
|
&:hover {
|
|
68710
|
-
background-color: ${getFieldBackgroundColorFactory()};
|
|
68711
|
-
border: solid 1px ${getFieldBorderColorFactoryForState('hover')} !important;
|
|
68712
|
-
|
|
68713
68725
|
&::placeholder {
|
|
68714
68726
|
color: ${getFieldPlaceholderColorFactoryForState('hover')};
|
|
68715
68727
|
}
|
|
@@ -68717,8 +68729,6 @@ const StyledInput = styled(Input)`
|
|
|
68717
68729
|
|
|
68718
68730
|
&:active,
|
|
68719
68731
|
&:focus {
|
|
68720
|
-
background-color: ${getFieldBackgroundColorFactory()};
|
|
68721
|
-
border: solid 1px ${getFieldBorderColorFactoryForState('focus')} !important;
|
|
68722
68732
|
outline: 0;
|
|
68723
68733
|
|
|
68724
68734
|
&::placeholder {
|
|
@@ -68726,6 +68736,49 @@ const StyledInput = styled(Input)`
|
|
|
68726
68736
|
}
|
|
68727
68737
|
}
|
|
68728
68738
|
`;
|
|
68739
|
+
const InputWithoutUnit = styled(BaseInput)`
|
|
68740
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68741
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('default')};
|
|
68742
|
+
|
|
68743
|
+
&:hover {
|
|
68744
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68745
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('hover')} !important;
|
|
68746
|
+
}
|
|
68747
|
+
|
|
68748
|
+
&:active,
|
|
68749
|
+
&:focus {
|
|
68750
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68751
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('focus')} !important;
|
|
68752
|
+
}
|
|
68753
|
+
`;
|
|
68754
|
+
const InputBoxWithUnit = styled.div`
|
|
68755
|
+
align-items: center;
|
|
68756
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68757
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('default')};
|
|
68758
|
+
color: ${(p)=>p.theme.color.slateGray};
|
|
68759
|
+
display: flex;
|
|
68760
|
+
font-size: 13px;
|
|
68761
|
+
line-height: 19px;
|
|
68762
|
+
padding-right: 8px;
|
|
68763
|
+
user-select: none;
|
|
68764
|
+
width: 100%;
|
|
68765
|
+
|
|
68766
|
+
&:hover {
|
|
68767
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68768
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('hover')} !important;
|
|
68769
|
+
}
|
|
68770
|
+
|
|
68771
|
+
&:active,
|
|
68772
|
+
&:focus {
|
|
68773
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68774
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('focus')} !important;
|
|
68775
|
+
}
|
|
68776
|
+
`;
|
|
68777
|
+
const InputWithUnit = styled(BaseInput)`
|
|
68778
|
+
background-color: transparent;
|
|
68779
|
+
border: none;
|
|
68780
|
+
flex-grow: 1;
|
|
68781
|
+
`;
|
|
68729
68782
|
|
|
68730
68783
|
const PADDING = {
|
|
68731
68784
|
[Size.LARGE]: '8px 16px 10px',
|
|
@@ -69255,6 +69308,28 @@ function Select({ className, customSearch, customSearchMinQueryLength = 1, disab
|
|
|
69255
69308
|
controlledRsuiteData,
|
|
69256
69309
|
rsuiteData
|
|
69257
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
|
+
]);
|
|
69258
69333
|
useFieldUndefineEffect(isUndefinedWhenDisabled && disabled, onChange);
|
|
69259
69334
|
useEffect(()=>{
|
|
69260
69335
|
forceUpdate();
|
|
@@ -69289,6 +69364,7 @@ function Select({ className, customSearch, customSearchMinQueryLength = 1, disab
|
|
|
69289
69364
|
disabled: disabled,
|
|
69290
69365
|
disabledItemValues: disabledItemValues,
|
|
69291
69366
|
id: originalProps.name,
|
|
69367
|
+
listProps: listProps,
|
|
69292
69368
|
onChange: handleChange,
|
|
69293
69369
|
onSearch: handleSearch,
|
|
69294
69370
|
// `as any` because we customized `ItemDataType` type by adding `optionValue`,
|
|
@@ -73947,7 +74023,7 @@ function RowCheckbox({ onChange, ...nativeProps }) {
|
|
|
73947
74023
|
onChange
|
|
73948
74024
|
]);
|
|
73949
74025
|
return /*#__PURE__*/ jsx(RestyledRsuiteCheckbox, {
|
|
73950
|
-
$isChecked: nativeProps.checked || nativeProps.indeterminate,
|
|
74026
|
+
$isChecked: !!nativeProps.checked || !!nativeProps.indeterminate,
|
|
73951
74027
|
$isDisabled: nativeProps.disabled,
|
|
73952
74028
|
$isReadOnly: nativeProps.readOnly,
|
|
73953
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.
|
|
4
|
+
"version": "23.1.1",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|