@mtes-mct/monitor-ui 18.4.2 → 18.5.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/elements/Label.d.ts +3 -3
- package/elements/Label.d.ts.map +1 -1
- package/fields/PhoneInput.d.ts.map +1 -1
- package/index.js +31 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [18.4.2](https://github.com/MTES-MCT/monitor-ui/compare/v18.4.1...v18.4.2) (2024-07-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **components:** add tertiary to dropdown ([805e34e](https://github.com/MTES-MCT/monitor-ui/commit/805e34eb2e6a1c8d44e1b9c738f77c8f13186721))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Buid System & Dependencies
|
|
10
|
+
|
|
11
|
+
* **dev-deps:** bump the non-major-dev-dependencies group across 1 directory with 17 updates ([5313127](https://github.com/MTES-MCT/monitor-ui/commit/53131272261e00bbf36e68b8a2e051a6c06a9b86))
|
|
12
|
+
|
|
1
13
|
## [18.4.1](https://github.com/MTES-MCT/monitor-ui/compare/v18.4.0...v18.4.1) (2024-07-02)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/elements/Label.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { LabelHTMLAttributes } from 'react';
|
|
2
2
|
export type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
|
|
3
|
+
$isHidden?: boolean | undefined;
|
|
3
4
|
$isRequired?: boolean | undefined;
|
|
4
5
|
disabled?: boolean | undefined;
|
|
5
6
|
hasError?: boolean | undefined;
|
|
6
|
-
isHidden?: boolean | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, LabelHTMLAttributes<HTMLLabelElement> & {
|
|
9
|
+
$isHidden?: boolean | undefined;
|
|
9
10
|
$isRequired?: boolean | undefined;
|
|
10
11
|
disabled?: boolean | undefined;
|
|
11
12
|
hasError?: boolean | undefined;
|
|
12
|
-
|
|
13
|
-
}, "disabled" | keyof LabelHTMLAttributes<HTMLLabelElement> | "isHidden" | "$isRequired" | "hasError">;
|
|
13
|
+
}, "disabled" | keyof LabelHTMLAttributes<HTMLLabelElement> | "$isHidden" | "$isRequired" | "hasError">;
|
|
14
14
|
//# sourceMappingURL=Label.d.ts.map
|
package/elements/Label.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../src/elements/Label.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAEhD,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAC/D,
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../src/elements/Label.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAEhD,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAC/D,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/B,CAAA;AACD,eAAO,MAAM,KAAK;gBALJ,OAAO,GAAG,SAAS;kBACjB,OAAO,GAAG,SAAS;eACtB,OAAO,GAAG,SAAS;eACnB,OAAO,GAAG,SAAS;uGA4B/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../src/fields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,EAAE,OAAO,CAAA;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,KAAK,UAAU,CAAC,IAAI,CAAC,CAAA;IAC7D,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAA;AAgBvD;;GAEG;AACH,eAAO,MAAM,UAAU,2HAgEtB,CAAA"}
|
package/index.js
CHANGED
|
@@ -54234,7 +54234,6 @@ const Label = styled.label.attrs((props)=>({
|
|
|
54234
54234
|
}))`
|
|
54235
54235
|
color: ${(p)=>// eslint-disable-next-line no-nested-ternary
|
|
54236
54236
|
p.disabled ? p.theme.color.lightGray : p.hasError ? p.theme.color.maximumRed : p.theme.color.slateGray};
|
|
54237
|
-
display: ${(p)=>p.isHidden ? 'none' : 'block'};
|
|
54238
54237
|
font-size: 13px;
|
|
54239
54238
|
line-height: 1.3846;
|
|
54240
54239
|
margin-bottom: 4px;
|
|
@@ -54243,6 +54242,14 @@ const Label = styled.label.attrs((props)=>({
|
|
|
54243
54242
|
content:" *";
|
|
54244
54243
|
color: ${p.theme.color.maximumRed};
|
|
54245
54244
|
}`}
|
|
54245
|
+
${(p)=>p.$isHidden && `
|
|
54246
|
+
position:absolute;
|
|
54247
|
+
left:-10000px;
|
|
54248
|
+
top:auto;
|
|
54249
|
+
width:1px;
|
|
54250
|
+
height:1px;
|
|
54251
|
+
overflow:hidden;
|
|
54252
|
+
`}
|
|
54246
54253
|
`;
|
|
54247
54254
|
|
|
54248
54255
|
const Link$1 = styled.a`
|
|
@@ -55177,10 +55184,10 @@ function CheckPicker({ className, customSearch, customSearchMinQueryLength = 1,
|
|
|
55177
55184
|
style: style,
|
|
55178
55185
|
children: [
|
|
55179
55186
|
/*#__PURE__*/ jsx(Label, {
|
|
55187
|
+
$isHidden: isLabelHidden,
|
|
55180
55188
|
$isRequired: isRequired,
|
|
55181
55189
|
disabled: disabled,
|
|
55182
55190
|
htmlFor: originalProps.name,
|
|
55183
|
-
isHidden: isLabelHidden,
|
|
55184
55191
|
children: label
|
|
55185
55192
|
}),
|
|
55186
55193
|
/*#__PURE__*/ jsx(StyledRsuitePickerBox, {
|
|
@@ -67740,10 +67747,10 @@ function MultiCascader({ className, disabled = false, error, isErrorMessageHidde
|
|
|
67740
67747
|
style: style,
|
|
67741
67748
|
children: [
|
|
67742
67749
|
/*#__PURE__*/ jsx(Label, {
|
|
67750
|
+
$isHidden: isLabelHidden,
|
|
67743
67751
|
$isRequired: isRequired,
|
|
67744
67752
|
disabled: disabled,
|
|
67745
67753
|
htmlFor: originalProps.name,
|
|
67746
|
-
isHidden: isLabelHidden,
|
|
67747
67754
|
children: label
|
|
67748
67755
|
}),
|
|
67749
67756
|
/*#__PURE__*/ jsx(Box$1, {
|
|
@@ -67873,10 +67880,10 @@ function MultiSelect({ className, customSearch, customSearchMinQueryLength = 1,
|
|
|
67873
67880
|
style: style,
|
|
67874
67881
|
children: [
|
|
67875
67882
|
/*#__PURE__*/ jsx(Label, {
|
|
67883
|
+
$isHidden: isLabelHidden,
|
|
67876
67884
|
$isRequired: isRequired,
|
|
67877
67885
|
disabled: disabled,
|
|
67878
67886
|
htmlFor: originalProps.name,
|
|
67879
|
-
isHidden: isLabelHidden,
|
|
67880
67887
|
children: label
|
|
67881
67888
|
}),
|
|
67882
67889
|
/*#__PURE__*/ jsx(Box, {
|
|
@@ -68411,10 +68418,10 @@ function NumberInput({ className, disabled = false, error, isErrorMessageHidden
|
|
|
68411
68418
|
style: style,
|
|
68412
68419
|
children: [
|
|
68413
68420
|
/*#__PURE__*/ jsx(Label, {
|
|
68421
|
+
$isHidden: isLabelHidden,
|
|
68414
68422
|
$isRequired: isRequired,
|
|
68415
68423
|
disabled: disabled,
|
|
68416
68424
|
htmlFor: name,
|
|
68417
|
-
isHidden: isLabelHidden,
|
|
68418
68425
|
children: label
|
|
68419
68426
|
}),
|
|
68420
68427
|
/*#__PURE__*/ jsx(StyledInput, {
|
|
@@ -68557,6 +68564,12 @@ const internationalFormat = {
|
|
|
68557
68564
|
},
|
|
68558
68565
|
mask: '`@@ #[00] 000 000 000 000'
|
|
68559
68566
|
};
|
|
68567
|
+
const internationalFrenchFormat = {
|
|
68568
|
+
definitions: {
|
|
68569
|
+
'@': /0/
|
|
68570
|
+
},
|
|
68571
|
+
mask: '`@@ 00 00 00 00 00'
|
|
68572
|
+
};
|
|
68560
68573
|
const frenchFormat = {
|
|
68561
68574
|
definitions: {
|
|
68562
68575
|
'#': /[1-9]/,
|
|
@@ -68579,10 +68592,10 @@ const defaultFormat = {
|
|
|
68579
68592
|
className: "Field-PhoneInput",
|
|
68580
68593
|
children: [
|
|
68581
68594
|
/*#__PURE__*/ jsx(Label, {
|
|
68595
|
+
$isHidden: isLabelHidden,
|
|
68582
68596
|
$isRequired: isRequired,
|
|
68583
68597
|
disabled: disabled,
|
|
68584
68598
|
htmlFor: name,
|
|
68585
|
-
isHidden: isLabelHidden,
|
|
68586
68599
|
children: label
|
|
68587
68600
|
}),
|
|
68588
68601
|
/*#__PURE__*/ jsx(StyledIMaskInput, {
|
|
@@ -68593,18 +68606,22 @@ const defaultFormat = {
|
|
|
68593
68606
|
$isTransparent: isTransparent,
|
|
68594
68607
|
disabled: disabled,
|
|
68595
68608
|
dispatch: (appended, dynamicMasked)=>{
|
|
68596
|
-
const phoneNumber = dynamicMasked.unmaskedValue + appended;
|
|
68609
|
+
const phoneNumber = (dynamicMasked.unmaskedValue + appended).replace(/\s+/g, '');
|
|
68597
68610
|
if (phoneNumber.startsWith('00')) {
|
|
68611
|
+
if (value && value.length === 12 && phoneNumber === value) {
|
|
68612
|
+
return dynamicMasked.compiledMasks[1];
|
|
68613
|
+
}
|
|
68598
68614
|
return dynamicMasked.compiledMasks[0];
|
|
68599
68615
|
}
|
|
68600
68616
|
if (phoneNumber.startsWith('0') && value && value.length <= 10 && phoneNumber === value) {
|
|
68601
|
-
return dynamicMasked.compiledMasks[
|
|
68617
|
+
return dynamicMasked.compiledMasks[2];
|
|
68602
68618
|
}
|
|
68603
|
-
return dynamicMasked.compiledMasks[
|
|
68619
|
+
return dynamicMasked.compiledMasks[3];
|
|
68604
68620
|
},
|
|
68605
68621
|
id: name,
|
|
68606
68622
|
mask: [
|
|
68607
68623
|
internationalFormat,
|
|
68624
|
+
internationalFrenchFormat,
|
|
68608
68625
|
frenchFormat,
|
|
68609
68626
|
defaultFormat
|
|
68610
68627
|
],
|
|
@@ -68843,10 +68860,10 @@ function Search({ className, customSearch = undefined, customSearchMinQueryLengt
|
|
|
68843
68860
|
style: style,
|
|
68844
68861
|
children: [
|
|
68845
68862
|
/*#__PURE__*/ jsx(Label, {
|
|
68863
|
+
$isHidden: isLabelHidden,
|
|
68846
68864
|
$isRequired: isRequired,
|
|
68847
68865
|
disabled: disabled,
|
|
68848
68866
|
htmlFor: originalProps.name,
|
|
68849
|
-
isHidden: isLabelHidden,
|
|
68850
68867
|
children: label
|
|
68851
68868
|
}),
|
|
68852
68869
|
/*#__PURE__*/ jsxs(StyledInputBox, {
|
|
@@ -69007,10 +69024,10 @@ function Select({ className, customSearch, customSearchMinQueryLength = 1, disab
|
|
|
69007
69024
|
style: style,
|
|
69008
69025
|
children: [
|
|
69009
69026
|
/*#__PURE__*/ jsx(Label, {
|
|
69027
|
+
$isHidden: isLabelHidden,
|
|
69010
69028
|
$isRequired: isRequired,
|
|
69011
69029
|
disabled: disabled,
|
|
69012
69030
|
htmlFor: originalProps.name,
|
|
69013
|
-
isHidden: isLabelHidden,
|
|
69014
69031
|
children: label
|
|
69015
69032
|
}),
|
|
69016
69033
|
/*#__PURE__*/ jsx(StyledRsuitePickerBox, {
|
|
@@ -69082,10 +69099,10 @@ function Textarea({ className, disabled = false, error, isErrorMessageHidden = f
|
|
|
69082
69099
|
style: style,
|
|
69083
69100
|
children: [
|
|
69084
69101
|
/*#__PURE__*/ jsx(Label, {
|
|
69102
|
+
$isHidden: isLabelHidden,
|
|
69085
69103
|
$isRequired: isRequired,
|
|
69086
69104
|
disabled: disabled,
|
|
69087
69105
|
htmlFor: originalProps.name,
|
|
69088
|
-
isHidden: isLabelHidden,
|
|
69089
69106
|
children: label
|
|
69090
69107
|
}),
|
|
69091
69108
|
/*#__PURE__*/ jsx(StyledRsuiteInput, {
|
|
@@ -69185,10 +69202,10 @@ function TextInput({ className, disabled = false, error, Icon, isErrorMessageHid
|
|
|
69185
69202
|
style: style,
|
|
69186
69203
|
children: [
|
|
69187
69204
|
/*#__PURE__*/ jsx(Label, {
|
|
69205
|
+
$isHidden: isLabelHidden,
|
|
69188
69206
|
$isRequired: isRequired,
|
|
69189
69207
|
disabled: disabled,
|
|
69190
69208
|
htmlFor: name,
|
|
69191
|
-
isHidden: isLabelHidden,
|
|
69192
69209
|
children: label
|
|
69193
69210
|
}),
|
|
69194
69211
|
/*#__PURE__*/ jsxs(StyledInputBox, {
|
|
@@ -69341,10 +69358,10 @@ function Toggle({ checked = false, className, dataCy, disabled = false, error, i
|
|
|
69341
69358
|
style: style,
|
|
69342
69359
|
children: [
|
|
69343
69360
|
/*#__PURE__*/ jsx(Label, {
|
|
69361
|
+
$isHidden: isLabelHidden,
|
|
69344
69362
|
$isRequired: isRequired,
|
|
69345
69363
|
disabled: disabled,
|
|
69346
69364
|
htmlFor: originalProps.name,
|
|
69347
|
-
isHidden: isLabelHidden,
|
|
69348
69365
|
children: label
|
|
69349
69366
|
}),
|
|
69350
69367
|
/*#__PURE__*/ jsx(StyledToggle, {
|
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": "18.
|
|
4
|
+
"version": "18.5.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|