@mtes-mct/monitor-ui 21.2.1 → 22.0.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 CHANGED
@@ -1,3 +1,29 @@
1
+ ## [21.3.0](https://github.com/MTES-MCT/monitor-ui/compare/v21.2.1...v21.3.0) (2024-09-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * **fields:** add areArrowsHidden prop to NumberInput ([6dad78e](https://github.com/MTES-MCT/monitor-ui/commit/6dad78ea5406295ee0cf97cc2dc7355c3d655761))
7
+
8
+
9
+ ### Buid System & Dependencies
10
+
11
+ * **deps:** bump @babel/runtime in the non-major-dependencies group ([ad6262c](https://github.com/MTES-MCT/monitor-ui/commit/ad6262c22e5cdfa701e9f72a2519b65bd5e2be3e))
12
+
13
+ ## [21.2.1](https://github.com/MTES-MCT/monitor-ui/compare/v21.2.0...v21.2.1) (2024-09-06)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **utils:** sort by French natural order in getOptionsFromLabelledEnum() ([3803823](https://github.com/MTES-MCT/monitor-ui/commit/38038234d4aa389178c80fe89f88e6429aef530c))
19
+
20
+
21
+ ### Buid System & Dependencies
22
+
23
+ * **deps:** bump micromatch from 4.0.5 to 4.0.8 ([7866fa1](https://github.com/MTES-MCT/monitor-ui/commit/7866fa1c8c0c68aa038e3fb3a0a66994437eef54))
24
+ * **deps:** bump the non-major-dependencies group with 3 updates ([0ac790e](https://github.com/MTES-MCT/monitor-ui/commit/0ac790ed596abe0192b68b4cdd5760352cac7862))
25
+ * **dev-deps:** bump the all-non-major-dependencies group ([ca16c6b](https://github.com/MTES-MCT/monitor-ui/commit/ca16c6b6a6974ec339ca131017aa04b1146e5dea))
26
+
1
27
  ## [21.2.0](https://github.com/MTES-MCT/monitor-ui/compare/v21.1.1...v21.2.0) (2024-08-27)
2
28
 
3
29
 
@@ -1,14 +1,14 @@
1
1
  import type { LabelHTMLAttributes } from 'react';
2
2
  export type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
3
+ $hasError?: boolean | undefined;
4
+ $idDisabled?: boolean | undefined;
5
+ $isHidden?: boolean | undefined;
3
6
  $isRequired?: boolean | undefined;
4
- disabled?: boolean | undefined;
5
- 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
+ $hasError?: boolean | undefined;
10
+ $idDisabled?: boolean | undefined;
11
+ $isHidden?: boolean | undefined;
9
12
  $isRequired?: boolean | undefined;
10
- disabled?: boolean | undefined;
11
- hasError?: boolean | undefined;
12
- isHidden?: boolean | undefined;
13
- }, "disabled" | keyof LabelHTMLAttributes<HTMLLabelElement> | "isHidden" | "$isRequired" | "hasError">;
13
+ }, keyof LabelHTMLAttributes<HTMLLabelElement> | "$isHidden" | "$isRequired" | "$hasError" | "$idDisabled">;
14
14
  //# sourceMappingURL=Label.d.ts.map
@@ -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,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/B,CAAA;AACD,eAAO,MAAM,KAAK;kBALF,OAAO,GAAG,SAAS;eACtB,OAAO,GAAG,SAAS;eACnB,OAAO,GAAG,SAAS;eACnB,OAAO,GAAG,SAAS;sGAmB/B,CAAA"}
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,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAClC,CAAA;AACD,eAAO,MAAM,KAAK;gBALJ,OAAO,GAAG,SAAS;kBACjB,OAAO,GAAG,SAAS;gBACrB,OAAO,GAAG,SAAS;kBACjB,OAAO,GAAG,SAAS;2GAmBlC,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import { type InputProps } from 'rsuite';
2
2
  import type { Promisable } from 'type-fest';
3
3
  export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'onChange' | 'type' | 'value'> & {
4
+ areArrowsHidden?: boolean | undefined;
4
5
  disabled?: boolean | undefined;
5
6
  error?: string | undefined;
6
7
  isErrorMessageHidden?: boolean | undefined;
@@ -15,5 +16,5 @@ export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | '
15
16
  readOnly?: boolean | undefined;
16
17
  value?: number | undefined;
17
18
  };
18
- export declare function NumberInput({ 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;
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;
19
20
  //# sourceMappingURL=NumberInput.d.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,UAAkB,EAClB,aAAqB,EACrB,uBAA+B,EAC/B,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAgB,EAChB,KAAK,EACL,KAAK,EACL,GAAG,aAAa,EACjB,EAAE,gBAAgB,2CA+ElB"}
package/index.js CHANGED
@@ -53465,11 +53465,11 @@ const PADDING$2 = {
53465
53465
  const StyledButton$1 = styled.button`
53466
53466
  align-items: center;
53467
53467
  display: inline-flex;
53468
- font-size: ${(p)=>FONT_SIZE$1[p.size]};
53468
+ font-size: ${(p)=>FONT_SIZE$1[p.$size]};
53469
53469
  justify-content: center;
53470
53470
  max-width: 100%;
53471
- padding: ${(p)=>PADDING$2[p.size]};
53472
- width: ${(p)=>p.isFullWidth ? '100%' : 'auto'};
53471
+ padding: ${(p)=>PADDING$2[p.$size]};
53472
+ width: ${(p)=>p.$isFullWidth ? '100%' : 'auto'};
53473
53473
 
53474
53474
  > .Element-IconBox {
53475
53475
  margin-right: 5px;
@@ -54433,8 +54433,8 @@ const Label = styled.label.attrs((props)=>({
54433
54433
  className: classnames('Element-Label', props.className)
54434
54434
  }))`
54435
54435
  color: ${(p)=>// eslint-disable-next-line no-nested-ternary
54436
- p.disabled ? p.theme.color.lightGray : p.hasError ? p.theme.color.maximumRed : p.theme.color.slateGray};
54437
- display: ${(p)=>p.isHidden ? 'none' : 'block'};
54436
+ p.$idDisabled ? p.theme.color.lightGray : p.$hasError ? p.theme.color.maximumRed : p.theme.color.slateGray};
54437
+ display: ${(p)=>p.$isHidden ? 'none' : 'block'};
54438
54438
  font-size: 13px;
54439
54439
  line-height: 1.3846;
54440
54440
  margin-bottom: 4px;
@@ -55377,10 +55377,10 @@ function CheckPicker({ className, customSearch, customSearchMinQueryLength = 1,
55377
55377
  style: style,
55378
55378
  children: [
55379
55379
  /*#__PURE__*/ jsx(Label, {
55380
+ $idDisabled: disabled,
55381
+ $isHidden: isLabelHidden,
55380
55382
  $isRequired: isRequired,
55381
- disabled: disabled,
55382
55383
  htmlFor: originalProps.name,
55383
- isHidden: isLabelHidden,
55384
55384
  children: label
55385
55385
  }),
55386
55386
  /*#__PURE__*/ jsx(StyledRsuitePickerBox, {
@@ -67941,10 +67941,10 @@ function MultiCascader({ className, disabled = false, error, isErrorMessageHidde
67941
67941
  style: style,
67942
67942
  children: [
67943
67943
  /*#__PURE__*/ jsx(Label, {
67944
+ $idDisabled: disabled,
67945
+ $isHidden: isLabelHidden,
67944
67946
  $isRequired: isRequired,
67945
- disabled: disabled,
67946
67947
  htmlFor: originalProps.name,
67947
- isHidden: isLabelHidden,
67948
67948
  children: label
67949
67949
  }),
67950
67950
  /*#__PURE__*/ jsx(Box$1, {
@@ -68074,10 +68074,10 @@ function MultiSelect({ className, customSearch, customSearchMinQueryLength = 1,
68074
68074
  style: style,
68075
68075
  children: [
68076
68076
  /*#__PURE__*/ jsx(Label, {
68077
+ $idDisabled: disabled,
68078
+ $isHidden: isLabelHidden,
68077
68079
  $isRequired: isRequired,
68078
- disabled: disabled,
68079
68080
  htmlFor: originalProps.name,
68080
- isHidden: isLabelHidden,
68081
68081
  children: label
68082
68082
  }),
68083
68083
  /*#__PURE__*/ jsx(Box, {
@@ -68560,7 +68560,7 @@ const Link = styled.a`
68560
68560
  }
68561
68561
  `;
68562
68562
 
68563
- function NumberInput({ 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 }) {
68563
+ 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 }) {
68564
68564
  // eslint-disable-next-line no-null/no-null
68565
68565
  const inputRef = useRef(null);
68566
68566
  const controlledClassname = useMemo(()=>classnames('Field-NumberInput', className), [
@@ -68612,14 +68612,15 @@ function NumberInput({ className, disabled = false, error, isErrorMessageHidden
68612
68612
  style: style,
68613
68613
  children: [
68614
68614
  /*#__PURE__*/ jsx(Label, {
68615
+ $idDisabled: disabled,
68616
+ $isHidden: isLabelHidden,
68615
68617
  $isRequired: isRequired,
68616
- disabled: disabled,
68617
68618
  htmlFor: name,
68618
- isHidden: isLabelHidden,
68619
68619
  children: label
68620
68620
  }),
68621
68621
  /*#__PURE__*/ jsx(StyledInput, {
68622
68622
  ref: inputRef,
68623
+ $areArrowsHidden: areArrowsHidden,
68623
68624
  $hasError: hasError,
68624
68625
  $isDisabled: disabled,
68625
68626
  $isLight: isLight,
@@ -68654,6 +68655,15 @@ const StyledInput = styled(Input)`
68654
68655
  vertical-align: center;
68655
68656
  width: 100%;
68656
68657
 
68658
+ ${(p)=>p.$areArrowsHidden && css`
68659
+ -moz-appearance: textfield;
68660
+
68661
+ &::-webkit-outer-spin-button,
68662
+ &::-webkit-inner-spin-button {
68663
+ -webkit-appearance: none;
68664
+ }
68665
+ `}
68666
+
68657
68667
  &::placeholder {
68658
68668
  color: ${getFieldPlaceholderColorFactoryForState('default')};
68659
68669
  }
@@ -68786,10 +68796,10 @@ const defaultFormat = {
68786
68796
  className: "Field-PhoneInput",
68787
68797
  children: [
68788
68798
  /*#__PURE__*/ jsx(Label, {
68799
+ $idDisabled: disabled,
68800
+ $isHidden: isLabelHidden,
68789
68801
  $isRequired: isRequired,
68790
- disabled: disabled,
68791
68802
  htmlFor: name,
68792
- isHidden: isLabelHidden,
68793
68803
  children: label
68794
68804
  }),
68795
68805
  /*#__PURE__*/ jsx(StyledIMaskInput, {
@@ -69054,10 +69064,10 @@ function Search({ className, customSearch = undefined, customSearchMinQueryLengt
69054
69064
  style: style,
69055
69065
  children: [
69056
69066
  /*#__PURE__*/ jsx(Label, {
69067
+ $idDisabled: disabled,
69068
+ $isHidden: isLabelHidden,
69057
69069
  $isRequired: isRequired,
69058
- disabled: disabled,
69059
69070
  htmlFor: originalProps.name,
69060
- isHidden: isLabelHidden,
69061
69071
  children: label
69062
69072
  }),
69063
69073
  /*#__PURE__*/ jsxs(StyledInputBox, {
@@ -69218,10 +69228,10 @@ function Select({ className, customSearch, customSearchMinQueryLength = 1, disab
69218
69228
  style: style,
69219
69229
  children: [
69220
69230
  /*#__PURE__*/ jsx(Label, {
69231
+ $idDisabled: disabled,
69232
+ $isHidden: isLabelHidden,
69221
69233
  $isRequired: isRequired,
69222
- disabled: disabled,
69223
69234
  htmlFor: originalProps.name,
69224
- isHidden: isLabelHidden,
69225
69235
  children: label
69226
69236
  }),
69227
69237
  /*#__PURE__*/ jsx(StyledRsuitePickerBox, {
@@ -69293,10 +69303,10 @@ function Textarea({ className, disabled = false, error, isErrorMessageHidden = f
69293
69303
  style: style,
69294
69304
  children: [
69295
69305
  /*#__PURE__*/ jsx(Label, {
69306
+ $idDisabled: disabled,
69307
+ $isHidden: isLabelHidden,
69296
69308
  $isRequired: isRequired,
69297
- disabled: disabled,
69298
69309
  htmlFor: originalProps.name,
69299
- isHidden: isLabelHidden,
69300
69310
  children: label
69301
69311
  }),
69302
69312
  /*#__PURE__*/ jsx(StyledRsuiteInput, {
@@ -69396,10 +69406,10 @@ function TextInput({ className, disabled = false, error, Icon, isErrorMessageHid
69396
69406
  style: style,
69397
69407
  children: [
69398
69408
  /*#__PURE__*/ jsx(Label, {
69409
+ $idDisabled: disabled,
69410
+ $isHidden: isLabelHidden,
69399
69411
  $isRequired: isRequired,
69400
- disabled: disabled,
69401
69412
  htmlFor: name,
69402
- isHidden: isLabelHidden,
69403
69413
  children: label
69404
69414
  }),
69405
69415
  /*#__PURE__*/ jsxs(RestyledStyledInputBox, {
@@ -69559,10 +69569,10 @@ function Toggle({ checked = false, className, dataCy, disabled = false, error, i
69559
69569
  style: style,
69560
69570
  children: [
69561
69571
  /*#__PURE__*/ jsx(Label, {
69572
+ $idDisabled: disabled,
69573
+ $isHidden: isLabelHidden,
69562
69574
  $isRequired: isRequired,
69563
- disabled: disabled,
69564
69575
  htmlFor: originalProps.name,
69565
- isHidden: isLabelHidden,
69566
69576
  children: label
69567
69577
  }),
69568
69578
  /*#__PURE__*/ jsx(StyledToggle, {
package/package.json CHANGED
@@ -1,14 +1,14 @@
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": "21.2.1",
4
+ "version": "22.0.0",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {
8
8
  "node": ">=20"
9
9
  },
10
10
  "dependencies": {
11
- "@babel/runtime": "7.25.4",
11
+ "@babel/runtime": "7.25.6",
12
12
  "@tanstack/react-table": "8.20.5",
13
13
  "@tanstack/react-virtual": "beta",
14
14
  "prop-types": "15.8.1",