@mtes-mct/monitor-ui 24.19.1 → 24.20.0
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 +12 -0
- package/fields/CheckTreePicker/RsuiteCheckTreePickerBox.d.ts.map +1 -1
- package/fields/CheckTreePicker/index.d.ts.map +1 -1
- package/fields/CheckTreePicker/utils.d.ts +1 -0
- package/fields/CheckTreePicker/utils.d.ts.map +1 -1
- package/index.js +64 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [24.19.1](https://github.com/MTES-MCT/monitor-ui/compare/v24.19.0...v24.19.1) (2025-06-02)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **utils:** fix unnecessary variable ([cfb9b01](https://github.com/MTES-MCT/monitor-ui/commit/cfb9b01bdf93cc2b71a0802e389b99c720417848))
|
|
6
|
+
* **utils:** remove unecessary console warn ([d9a09e9](https://github.com/MTES-MCT/monitor-ui/commit/d9a09e9fd0a45479fed00e30aa57f748968a974a))
|
|
7
|
+
|
|
8
|
+
### Buid System & Dependencies
|
|
9
|
+
|
|
10
|
+
* **deps:** upgrade cypress peer deps ([e3a6ab7](https://github.com/MTES-MCT/monitor-ui/commit/e3a6ab76df4cdccdf4768f95b9e9e8a08a033541))
|
|
11
|
+
* **dev-deps:** bump the all-non-major-dependencies group ([ae037e7](https://github.com/MTES-MCT/monitor-ui/commit/ae037e7e1dd5145b87b501d302f78c86884b7a58))
|
|
12
|
+
|
|
1
13
|
## [24.19.0](https://github.com/MTES-MCT/monitor-ui/compare/v24.18.2...v24.19.0) (2025-05-29)
|
|
2
14
|
|
|
3
15
|
### Features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RsuiteCheckTreePickerBox.d.ts","sourceRoot":"","sources":["../../../src/fields/CheckTreePicker/RsuiteCheckTreePickerBox.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAEvE,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"RsuiteCheckTreePickerBox.d.ts","sourceRoot":"","sources":["../../../src/fields/CheckTreePicker/RsuiteCheckTreePickerBox.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAEvE,eAAO,MAAM,wBAAwB,gQA8TpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/CheckTreePicker/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,oBAAoB,IAAI,0BAA0B,EACxD,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/CheckTreePicker/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,oBAAoB,IAAI,0BAA0B,EACxD,MAAM,QAAQ,CAAA;AAaf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,0BAA0B,EAC1B,IAAI,GAAG,WAAW,GAAG,MAAM,GAAG,cAAc,GAAG,IAAI,GAAG,UAAU,GAAG,gBAAgB,GAAG,OAAO,CAC9F,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,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,GAAG,EAAE,GAAG,SAAS,KAAK,UAAU,CAAC,IAAI,CAAC,CAAA;IAC7D,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,KAAK,CAAC,EAAE,UAAU,EAAE,GAAG,SAAS,CAAA;CACjC,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,WAAwB,EACxB,SAAS,EACT,QAAgB,EAChB,KAAK,EACL,oBAA4B,EAC5B,aAAqB,EACrB,OAAe,EACf,aAAoB,EACpB,UAAkB,EAClB,aAAqB,EACrB,uBAA+B,EAC/B,KAAK,EACL,QAAkB,EAClB,QAAQ,EACR,OAAO,EACP,UAAU,EACV,QAAgB,EAChB,qBAAyC,EACzC,aAA4B,EAC5B,gBAAuB,EACvB,KAAK,EACL,KAAK,EACL,QAAkB,EAClB,GAAG,aAAa,EACjB,EAAE,oBAAoB,2CAoKtB"}
|
|
@@ -2,6 +2,7 @@ import type { TreeOption } from './types';
|
|
|
2
2
|
import type { ValueType } from 'rsuite/esm/CheckTreePicker';
|
|
3
3
|
export declare function fromRsuiteValue(selectedValues: ValueType, allOptions: TreeOption[], childrenKey?: string, valueKey?: string | number, labelKey?: string): TreeOption[] | undefined;
|
|
4
4
|
export declare function getTreeOptionsBySelectedValues(selectedValues: ValueType | undefined, options: TreeOption[], childrenKey?: string, valueKey?: string | number, labelKey?: string): TreeOption[];
|
|
5
|
+
export declare function getParentRsuiteValue(options: TreeOption[] | undefined, valueKey?: string, childrenKey?: string): ValueType;
|
|
5
6
|
export declare function toRsuiteValue(uiValues: TreeOption[] | undefined, childrenKey?: string, valueKey?: string): ValueType | undefined;
|
|
6
7
|
export declare function computeDisabledValues(isMultiSelect: boolean, value: ValueType | undefined, options: TreeOption[], childrenKey?: string, valueKey?: string, labelKey?: string): (string | number)[];
|
|
7
8
|
export declare function getOptionsToDisplay(allOptions: TreeOption[], selectedOptions: TreeOption[], childrenKey?: string, valueKey?: string): TreeOption[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/fields/CheckTreePicker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,wBAAgB,eAAe,CAC7B,cAAc,EAAE,SAAS,EACzB,UAAU,EAAE,UAAU,EAAE,EACxB,WAAW,GAAE,MAAmB,EAChC,QAAQ,GAAE,MAAM,GAAG,MAAgB,EACnC,QAAQ,GAAE,MAAgB,GACzB,UAAU,EAAE,GAAG,SAAS,CAI1B;AAED,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,SAAS,GAAG,SAAS,EACrC,OAAO,EAAE,UAAU,EAAE,EACrB,WAAW,GAAE,MAAmB,EAChC,QAAQ,GAAE,MAAM,GAAG,MAAgB,EACnC,QAAQ,GAAE,MAAgB,GACzB,UAAU,EAAE,CAgCd;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,UAAU,EAAE,GAAG,SAAS,EAClC,WAAW,GAAE,MAAmB,EAChC,QAAQ,GAAE,MAAgB,GACzB,SAAS,GAAG,SAAS,CAcvB;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,OAAO,EACtB,KAAK,EAAE,SAAS,GAAG,SAAS,EAC5B,OAAO,EAAE,UAAU,EAAE,EACrB,WAAW,GAAE,MAAm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,UAAU,EAAE,EAC7B,WAAW,GAAE,MAAmB,EAChC,QAAQ,GAAE,MAAgB,GACzB,UAAU,EAAE,CA0Bd"}
|
package/index.js
CHANGED
|
@@ -55923,7 +55923,6 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
55923
55923
|
}
|
|
55924
55924
|
|
|
55925
55925
|
${(p)=>getCheckPickerInputCss(p)}
|
|
55926
|
-
|
|
55927
55926
|
> .rs-picker-popup {
|
|
55928
55927
|
border: solid 1px ${(p)=>p.theme.color.gainsboro};
|
|
55929
55928
|
border-radius: 0;
|
|
@@ -55967,12 +55966,19 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
55967
55966
|
}
|
|
55968
55967
|
}
|
|
55969
55968
|
}
|
|
55969
|
+
|
|
55970
55970
|
> .rs-check-tree {
|
|
55971
55971
|
padding: 0;
|
|
55972
55972
|
margin: 0;
|
|
55973
55973
|
|
|
55974
55974
|
.rs-check-tree-node {
|
|
55975
55975
|
padding: 0 !important;
|
|
55976
|
+
&:hover {
|
|
55977
|
+
background-color: ${(p)=>p.theme.color.blueYonder25};
|
|
55978
|
+
}
|
|
55979
|
+
}
|
|
55980
|
+
.rs-check-tree-node-expand-icon-wrapper {
|
|
55981
|
+
width: 100%;
|
|
55976
55982
|
}
|
|
55977
55983
|
|
|
55978
55984
|
.rs-check-tree-node-custom-icon {
|
|
@@ -55990,6 +55996,7 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
55990
55996
|
overflow: hidden;
|
|
55991
55997
|
text-overflow: ellipsis;
|
|
55992
55998
|
white-space: nowrap;
|
|
55999
|
+
|
|
55993
56000
|
.rs-check-item-focus {
|
|
55994
56001
|
background-color: transparent;
|
|
55995
56002
|
}
|
|
@@ -56011,6 +56018,7 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
56011
56018
|
|
|
56012
56019
|
> .rs-check-item {
|
|
56013
56020
|
/** !important because it's override by determinate checkbox **/
|
|
56021
|
+
|
|
56014
56022
|
&.rs-checkbox-indeterminate {
|
|
56015
56023
|
&:hover {
|
|
56016
56024
|
.rs-checkbox-inner {
|
|
@@ -56020,25 +56028,30 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
56020
56028
|
}
|
|
56021
56029
|
}
|
|
56022
56030
|
}
|
|
56031
|
+
|
|
56023
56032
|
.rs-checkbox-inner {
|
|
56024
56033
|
&:before {
|
|
56025
56034
|
background-color: ${(p)=>p.theme.color.charcoal} !important;
|
|
56026
56035
|
border: solid 2px ${(p)=>p.theme.color.charcoal} !important;
|
|
56027
56036
|
}
|
|
56037
|
+
|
|
56028
56038
|
&:after {
|
|
56029
56039
|
margin-left: 11px !important;
|
|
56030
56040
|
}
|
|
56031
56041
|
}
|
|
56032
56042
|
}
|
|
56043
|
+
|
|
56033
56044
|
&.rs-checkbox-disabled {
|
|
56034
56045
|
&:hover {
|
|
56035
56046
|
background-color: transparent !important;
|
|
56036
56047
|
}
|
|
56048
|
+
|
|
56037
56049
|
label,
|
|
56038
56050
|
span {
|
|
56039
56051
|
background-color: transparent !important;
|
|
56040
56052
|
color: ${(p)=>p.theme.color.lightGray} !important;
|
|
56041
56053
|
}
|
|
56054
|
+
|
|
56042
56055
|
&:hover {
|
|
56043
56056
|
span:before {
|
|
56044
56057
|
background-color: ${(p)=>p.theme.color.gainsboro} !important;
|
|
@@ -56046,6 +56059,7 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
56046
56059
|
}
|
|
56047
56060
|
}
|
|
56048
56061
|
}
|
|
56062
|
+
|
|
56049
56063
|
> .rs-checkbox-checker {
|
|
56050
56064
|
min-height: auto;
|
|
56051
56065
|
|
|
@@ -56060,15 +56074,18 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
56060
56074
|
> .rs-check-tree-node-label-content {
|
|
56061
56075
|
background-color: initial;
|
|
56062
56076
|
color: initial;
|
|
56063
|
-
padding: 3px 8px 6px
|
|
56077
|
+
padding: 3px 8px 6px 8px;
|
|
56064
56078
|
width: 100%;
|
|
56065
56079
|
}
|
|
56066
56080
|
|
|
56067
56081
|
> .rs-checkbox-wrapper {
|
|
56068
56082
|
height: auto;
|
|
56069
|
-
left:
|
|
56083
|
+
left: 14px;
|
|
56070
56084
|
top: 7px !important;
|
|
56071
|
-
|
|
56085
|
+
|
|
56086
|
+
&:before {
|
|
56087
|
+
border: none;
|
|
56088
|
+
}
|
|
56072
56089
|
|
|
56073
56090
|
> .rs-checkbox-inner {
|
|
56074
56091
|
&:before {
|
|
@@ -56077,6 +56094,7 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
56077
56094
|
border-radius: 0;
|
|
56078
56095
|
margin-left: 8px;
|
|
56079
56096
|
}
|
|
56097
|
+
|
|
56080
56098
|
&:after {
|
|
56081
56099
|
margin-left: 13px;
|
|
56082
56100
|
}
|
|
@@ -56158,21 +56176,47 @@ const RsuiteCheckTreePickerBox = styled.div`
|
|
|
56158
56176
|
}
|
|
56159
56177
|
|
|
56160
56178
|
/* childrens */
|
|
56179
|
+
|
|
56180
|
+
&[aria-level='1'] {
|
|
56181
|
+
> .rs-check-item {
|
|
56182
|
+
> .rs-checkbox-checker {
|
|
56183
|
+
> label {
|
|
56184
|
+
> .rs-check-tree-node-label-content {
|
|
56185
|
+
margin-left: 20px;
|
|
56186
|
+
}
|
|
56187
|
+
|
|
56188
|
+
> .rs-checkbox-wrapper {
|
|
56189
|
+
> .rs-checkbox-inner {
|
|
56190
|
+
&:before {
|
|
56191
|
+
margin-left: -8px;
|
|
56192
|
+
}
|
|
56193
|
+
|
|
56194
|
+
&:after {
|
|
56195
|
+
margin-left: -3px;
|
|
56196
|
+
}
|
|
56197
|
+
}
|
|
56198
|
+
}
|
|
56199
|
+
}
|
|
56200
|
+
}
|
|
56201
|
+
}
|
|
56202
|
+
}
|
|
56203
|
+
|
|
56161
56204
|
&[aria-level='2'] {
|
|
56162
56205
|
> .rs-check-item {
|
|
56163
56206
|
> .rs-checkbox-checker {
|
|
56164
56207
|
> label {
|
|
56165
56208
|
> .rs-check-tree-node-label-content {
|
|
56166
|
-
|
|
56209
|
+
margin-left: 45px;
|
|
56167
56210
|
}
|
|
56168
56211
|
|
|
56169
56212
|
> .rs-checkbox-wrapper {
|
|
56170
56213
|
> .rs-checkbox-inner {
|
|
56171
56214
|
&:before {
|
|
56172
|
-
margin-left:
|
|
56215
|
+
margin-left: 15px;
|
|
56173
56216
|
}
|
|
56217
|
+
|
|
56174
56218
|
&:after {
|
|
56175
|
-
margin-left:
|
|
56219
|
+
margin-left: 20px;
|
|
56176
56220
|
}
|
|
56177
56221
|
}
|
|
56178
56222
|
}
|
|
@@ -56248,6 +56292,12 @@ function getTreeOptionsBySelectedValues(selectedValues, options, childrenKey = '
|
|
|
56248
56292
|
}
|
|
56249
56293
|
return options.map(getOption).filter((option)=>option !== undefined);
|
|
56250
56294
|
}
|
|
56295
|
+
function getParentRsuiteValue(options, valueKey = 'value', childrenKey = 'children') {
|
|
56296
|
+
if (!options) {
|
|
56297
|
+
return [];
|
|
56298
|
+
}
|
|
56299
|
+
return options.filter((option)=>(option[childrenKey] ?? []).length > 0).flatMap((option)=>option[valueKey]);
|
|
56300
|
+
}
|
|
56251
56301
|
function toRsuiteValue(uiValues, childrenKey = 'children', valueKey = 'value') {
|
|
56252
56302
|
if (!uiValues) {
|
|
56253
56303
|
return undefined;
|
|
@@ -56318,6 +56368,11 @@ function CheckTreePicker({ childrenKey = 'children', className, disabled = false
|
|
|
56318
56368
|
forceUpdate
|
|
56319
56369
|
]);
|
|
56320
56370
|
const [disabledValues, setDisabledValues] = useState([]);
|
|
56371
|
+
const uncheckableValues = useMemo(()=>getParentRsuiteValue(options, valueKey, childrenKey), [
|
|
56372
|
+
options,
|
|
56373
|
+
childrenKey,
|
|
56374
|
+
valueKey
|
|
56375
|
+
]);
|
|
56321
56376
|
const rsuiteValue = useMemo(()=>{
|
|
56322
56377
|
const nextRsuiteValue = toRsuiteValue(value, childrenKey, valueKey);
|
|
56323
56378
|
if (!isMultiSelect && nextRsuiteValue) {
|
|
@@ -56464,6 +56519,7 @@ function CheckTreePicker({ childrenKey = 'children', className, disabled = false
|
|
|
56464
56519
|
});
|
|
56465
56520
|
},
|
|
56466
56521
|
size: originalProps.size ?? 'sm',
|
|
56522
|
+
uncheckableItemValues: uncheckableValues,
|
|
56467
56523
|
value: rsuiteValue ?? [],
|
|
56468
56524
|
valueKey: valueKey,
|
|
56469
56525
|
...originalProps
|
|
@@ -56494,6 +56550,7 @@ const StyledButton = styled(Button)`
|
|
|
56494
56550
|
|
|
56495
56551
|
> .Element-IconBox {
|
|
56496
56552
|
margin-right: 0px;
|
|
56553
|
+
|
|
56497
56554
|
> svg {
|
|
56498
56555
|
height: 10px;
|
|
56499
56556
|
width: 10px;
|
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.
|
|
4
|
+
"version": "24.20.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|