@mtes-mct/monitor-ui 5.2.2 → 5.3.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,16 @@
1
+ # [5.3.0](https://github.com/MTES-MCT/monitor-ui/compare/v5.2.2...v5.3.0) (2023-04-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **fields:** update value in MultiCheckbox on value prop change ([c9a11c8](https://github.com/MTES-MCT/monitor-ui/commit/c9a11c85c4b35f5df2979916588e0ab091ffd06f))
7
+ * **fields:** update value in MultiRadio on value prop change ([a230925](https://github.com/MTES-MCT/monitor-ui/commit/a230925361a54bad0251159600dba4c87965867b))
8
+
9
+
10
+ ### Features
11
+
12
+ * **fields:** add isErrorMessageHidden prop to fields ([f5d498d](https://github.com/MTES-MCT/monitor-ui/commit/f5d498da707133d5cb45105da5675f48b368664b))
13
+
1
14
  ## [5.2.1](https://github.com/MTES-MCT/monitor-ui/compare/v5.2.0...v5.2.1) (2023-04-11)
2
15
 
3
16
 
@@ -3,9 +3,10 @@ import type { Promisable } from 'type-fest';
3
3
  export type CheckboxProps = Omit<RsuiteCheckboxProps, 'as' | 'checked' | 'defaultChecked' | 'id' | 'onChange'> & {
4
4
  checked?: boolean | undefined;
5
5
  error?: string | undefined;
6
+ isErrorMessageHidden?: boolean | undefined;
6
7
  isUndefinedWhenDisabled?: boolean | undefined;
7
8
  label: string;
8
9
  name: string;
9
10
  onChange?: ((isCheched: boolean) => Promisable<void>) | undefined;
10
11
  };
11
- export declare function Checkbox({ checked, error, isUndefinedWhenDisabled, label, onChange, ...originalProps }: CheckboxProps): JSX.Element;
12
+ export declare function Checkbox({ checked, error, isErrorMessageHidden, isUndefinedWhenDisabled, label, onChange, ...originalProps }: CheckboxProps): JSX.Element;
@@ -31,6 +31,7 @@ export interface DatePickerProps extends Omit<HTMLAttributes<HTMLFieldSetElement
31
31
  isCompact?: boolean | undefined;
32
32
  /** Set the default time to the end (instead of start) of the day when picking/entering a date. */
33
33
  isEndDate?: boolean | undefined;
34
+ isErrorMessageHidden?: boolean | undefined;
34
35
  /** Only allow past dates until today. */
35
36
  isHistorical?: boolean | undefined;
36
37
  isLabelHidden?: boolean | undefined;
@@ -4,7 +4,6 @@ import type { DateTuple, DateInputRef } from './types';
4
4
  import type { Promisable } from 'type-fest';
5
5
  export type DateInputProps = Pick<NumberInputProps, 'onBack' | 'onPrevious' | 'onNext'> & {
6
6
  baseContainer: Document | HTMLDivElement | undefined;
7
- defaultValue?: DateTuple | undefined;
8
7
  disabled: boolean;
9
8
  isCompact: boolean;
10
9
  isEndDate?: boolean | undefined;
@@ -23,10 +22,10 @@ export type DateInputProps = Pick<NumberInputProps, 'onBack' | 'onPrevious' | 'o
23
22
  onClick: () => Promisable<void>;
24
23
  /** Called each time any date input receive a keyboard-input change whether the value is valid or not. */
25
24
  onInput: () => Promisable<void>;
25
+ value?: DateTuple | undefined;
26
26
  };
27
27
  export declare const DateInput: import("react").ForwardRefExoticComponent<Pick<NumberInputProps, "onBack" | "onNext" | "onPrevious"> & {
28
28
  baseContainer: Document | HTMLDivElement | undefined;
29
- defaultValue?: DateTuple | undefined;
30
29
  disabled: boolean;
31
30
  isCompact: boolean;
32
31
  isEndDate?: boolean | undefined;
@@ -45,4 +44,5 @@ export declare const DateInput: import("react").ForwardRefExoticComponent<Pick<N
45
44
  onClick: () => Promisable<void>;
46
45
  /** Called each time any date input receive a keyboard-input change whether the value is valid or not. */
47
46
  onInput: () => Promisable<void>;
47
+ value?: DateTuple | undefined;
48
48
  } & import("react").RefAttributes<DateInputRef>>;
@@ -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>, 'maxLength' | 'onInput' | 'pattern' | 'type' | 'value'> & {
3
+ export type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'maxLength' | 'onInput' | 'pattern' | 'type'> & {
4
4
  isLight: boolean;
5
5
  max: number;
6
6
  min: number;
@@ -16,7 +16,7 @@ export type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'maxL
16
16
  onPrevious?: (() => Promisable<void>) | undefined;
17
17
  size: number;
18
18
  };
19
- export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "pattern" | "value" | "onInput" | "type" | "maxLength"> & {
19
+ export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "pattern" | "defaultValue" | "onInput" | "type" | "maxLength"> & {
20
20
  isLight: boolean;
21
21
  max: number;
22
22
  min: number;
@@ -4,7 +4,6 @@ import type { TimeInputRef, TimeTuple } from './types';
4
4
  import type { Promisable } from 'type-fest';
5
5
  export type TimeInputProps = Pick<NumberInputProps, 'onBack' | 'onPrevious' | 'onNext'> & {
6
6
  baseContainer?: Document | HTMLDivElement | undefined;
7
- defaultValue?: TimeTuple | undefined;
8
7
  disabled: boolean;
9
8
  isCompact: boolean;
10
9
  isEndDate?: boolean | undefined;
@@ -18,10 +17,10 @@ export type TimeInputProps = Pick<NumberInputProps, 'onBack' | 'onPrevious' | 'o
18
17
  onInput: () => Promisable<void>;
19
18
  onNext?: (() => Promisable<void>) | undefined;
20
19
  onPrevious?: (() => Promisable<void>) | undefined;
20
+ value?: TimeTuple | undefined;
21
21
  };
22
22
  export declare const TimeInput: import("react").ForwardRefExoticComponent<Pick<NumberInputProps, "onBack" | "onNext" | "onPrevious"> & {
23
23
  baseContainer?: Document | HTMLDivElement | undefined;
24
- defaultValue?: TimeTuple | undefined;
25
24
  disabled: boolean;
26
25
  isCompact: boolean;
27
26
  isEndDate?: boolean | undefined;
@@ -35,4 +34,5 @@ export declare const TimeInput: import("react").ForwardRefExoticComponent<Pick<N
35
34
  onInput: () => Promisable<void>;
36
35
  onNext?: (() => Promisable<void>) | undefined;
37
36
  onPrevious?: (() => Promisable<void>) | undefined;
37
+ value?: TimeTuple | undefined;
38
38
  } & import("react").RefAttributes<TimeInputRef>>;
@@ -34,6 +34,7 @@ export interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLFieldSetEl
34
34
  disabled?: boolean | undefined;
35
35
  error?: string | undefined;
36
36
  isCompact?: boolean | undefined;
37
+ isErrorMessageHidden?: boolean | undefined;
37
38
  /** Only allow past dates until today. */
38
39
  isHistorical?: boolean | undefined;
39
40
  isLabelHidden?: boolean | undefined;
@@ -3,6 +3,7 @@ import type { Promisable } from 'type-fest';
3
3
  export type MultiCheckboxProps<OptionValue extends OptionValueType = string> = {
4
4
  disabled?: boolean | undefined;
5
5
  error?: string | undefined;
6
+ isErrorMessageHidden?: boolean | undefined;
6
7
  isInline?: boolean | undefined;
7
8
  isLabelHidden?: boolean | undefined;
8
9
  isLight?: boolean | undefined;
@@ -13,4 +14,4 @@ export type MultiCheckboxProps<OptionValue extends OptionValueType = string> = {
13
14
  options: Option<OptionValue>[];
14
15
  value?: OptionValue[] | undefined;
15
16
  };
16
- export declare function MultiCheckbox<OptionValue extends OptionValueType = string>({ value, disabled, error, isInline, isLabelHidden, isLight, isUndefinedWhenDisabled, label, name, onChange, options }: MultiCheckboxProps<OptionValue>): JSX.Element;
17
+ export declare function MultiCheckbox<OptionValue extends OptionValueType = string>({ disabled, error, isErrorMessageHidden, isInline, isLabelHidden, isLight, isUndefinedWhenDisabled, label, name, onChange, options, value }: MultiCheckboxProps<OptionValue>): JSX.Element;
@@ -3,6 +3,7 @@ import type { Promisable } from 'type-fest';
3
3
  export type MultiRadioProps<OptionValue extends OptionValueType = string> = {
4
4
  disabled?: boolean | undefined;
5
5
  error?: string | undefined;
6
+ isErrorMessageHidden?: boolean | undefined;
6
7
  isInline?: boolean | undefined;
7
8
  isLabelHidden?: boolean | undefined;
8
9
  isLight?: boolean | undefined;
@@ -13,4 +14,4 @@ export type MultiRadioProps<OptionValue extends OptionValueType = string> = {
13
14
  options: Option<OptionValue>[];
14
15
  value?: OptionValue | undefined;
15
16
  };
16
- export declare function MultiRadio<OptionValue extends OptionValueType = string>({ disabled, error, isInline, isLabelHidden, isLight, isUndefinedWhenDisabled, label, name, onChange, options, value }: MultiRadioProps<OptionValue>): JSX.Element;
17
+ export declare function MultiRadio<OptionValue extends OptionValueType = string>({ disabled, error, isErrorMessageHidden, isInline, isLabelHidden, isLight, isUndefinedWhenDisabled, label, name, onChange, options, value }: MultiRadioProps<OptionValue>): JSX.Element;
@@ -5,6 +5,7 @@ export type MultiSelectProps<OptionValue extends OptionValueType = string> = Omi
5
5
  /** Used to pass something else than `window.document` as a base container to attach global events listeners. */
6
6
  baseContainer?: Document | HTMLDivElement | null | undefined;
7
7
  error?: string | undefined;
8
+ isErrorMessageHidden?: boolean | undefined;
8
9
  isLabelHidden?: boolean | undefined;
9
10
  isLight?: boolean | undefined;
10
11
  isUndefinedWhenDisabled?: boolean | undefined;
@@ -15,4 +16,4 @@ export type MultiSelectProps<OptionValue extends OptionValueType = string> = Omi
15
16
  options: Option<OptionValue>[];
16
17
  value?: OptionValue[] | undefined;
17
18
  };
18
- export declare function MultiSelect<OptionValue extends OptionValueType = string>({ baseContainer, disabled, error, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, options, optionValueKey, searchable, value, ...originalProps }: MultiSelectProps<OptionValue>): JSX.Element;
19
+ export declare function MultiSelect<OptionValue extends OptionValueType = string>({ baseContainer, disabled, error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, options, optionValueKey, searchable, value, ...originalProps }: MultiSelectProps<OptionValue>): JSX.Element;
@@ -2,6 +2,7 @@ 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
4
  error?: string | undefined;
5
+ isErrorMessageHidden?: boolean | undefined;
5
6
  isLabelHidden?: boolean | undefined;
6
7
  isLight?: boolean | undefined;
7
8
  isUndefinedWhenDisabled?: boolean | undefined;
@@ -10,4 +11,4 @@ export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | '
10
11
  onChange?: ((nextValue: number | undefined) => Promisable<void>) | undefined;
11
12
  value?: number | undefined;
12
13
  };
13
- export declare function NumberInput({ error, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, value, ...originalProps }: NumberInputProps): JSX.Element;
14
+ export declare function NumberInput({ error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, value, ...originalProps }: NumberInputProps): JSX.Element;
@@ -8,6 +8,7 @@ export type SearchProps<OptionValue extends OptionValueType = string> = Omit<Rsu
8
8
  baseContainer?: Document | HTMLDivElement | null | undefined;
9
9
  defaultValue?: OptionValue | undefined;
10
10
  error?: string | undefined;
11
+ isErrorMessageHidden?: boolean | undefined;
11
12
  isLabelHidden?: boolean | undefined;
12
13
  isLight?: boolean | undefined;
13
14
  isSearchIconHidden?: boolean | undefined;
@@ -21,4 +22,4 @@ export type SearchProps<OptionValue extends OptionValueType = string> = Omit<Rsu
21
22
  /** Duration in milliseconds */
22
23
  throttleDuration?: number;
23
24
  };
24
- export declare function Search<OptionValue extends OptionValueType = string>({ baseContainer, defaultValue, error, isLabelHidden, isLight, isSearchIconHidden, label, MenuItem, onChange, onQuery, options, queryMap, queryUrl, throttleDuration, ...originalProps }: SearchProps<OptionValue>): JSX.Element;
25
+ export declare function Search<OptionValue extends OptionValueType = string>({ baseContainer, defaultValue, error, isErrorMessageHidden, isLabelHidden, isLight, isSearchIconHidden, label, MenuItem, onChange, onQuery, options, queryMap, queryUrl, throttleDuration, ...originalProps }: SearchProps<OptionValue>): JSX.Element;
@@ -5,6 +5,7 @@ export type SelectProps<OptionValue extends OptionValueType = string> = Omit<Sel
5
5
  /** Used to pass something else than `window.document` as a base container to attach global events listeners. */
6
6
  baseContainer?: Document | HTMLDivElement | null | undefined;
7
7
  error?: string | undefined;
8
+ isErrorMessageHidden?: boolean | undefined;
8
9
  isLabelHidden?: boolean | undefined;
9
10
  isLight?: boolean | undefined;
10
11
  isUndefinedWhenDisabled?: boolean | undefined;
@@ -15,4 +16,4 @@ export type SelectProps<OptionValue extends OptionValueType = string> = Omit<Sel
15
16
  options: Option<OptionValue>[];
16
17
  value?: OptionValue | undefined;
17
18
  };
18
- export declare function Select<OptionValue extends OptionValueType = string>({ baseContainer, disabled, error, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, options, optionValueKey, searchable, value, ...originalProps }: SelectProps<OptionValue>): JSX.Element;
19
+ export declare function Select<OptionValue extends OptionValueType = string>({ baseContainer, disabled, error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, options, optionValueKey, searchable, value, ...originalProps }: SelectProps<OptionValue>): JSX.Element;
@@ -2,6 +2,7 @@ import type { InputProps } from 'rsuite';
2
2
  import type { Promisable } from 'type-fest';
3
3
  export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'onChange' | 'type' | 'value'> & {
4
4
  error?: string | undefined;
5
+ isErrorMessageHidden?: boolean | undefined;
5
6
  isLabelHidden?: boolean | undefined;
6
7
  isLight?: boolean | undefined;
7
8
  isUndefinedWhenDisabled?: boolean | undefined;
@@ -10,4 +11,4 @@ export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'on
10
11
  onChange?: ((nextValue: string | undefined) => Promisable<void>) | undefined;
11
12
  value?: string | undefined;
12
13
  };
13
- export declare function TextInput({ error, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, value, ...originalProps }: TextInputProps): JSX.Element;
14
+ export declare function TextInput({ error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, value, ...originalProps }: TextInputProps): JSX.Element;
@@ -2,6 +2,7 @@ import type { TextareaHTMLAttributes } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
3
  export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'defaultValue' | 'id' | 'onChange' | 'value'> & {
4
4
  error?: string | undefined;
5
+ isErrorMessageHidden?: boolean | undefined;
5
6
  isLabelHidden?: boolean | undefined;
6
7
  isLight?: boolean | undefined;
7
8
  isUndefinedWhenDisabled?: boolean | undefined;
@@ -10,4 +11,4 @@ export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'd
10
11
  onChange?: ((nextValue: string | undefined) => Promisable<void>) | undefined;
11
12
  value?: string | undefined;
12
13
  };
13
- export declare function Textarea({ error, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, rows, value, ...originalProps }: TextareaProps): JSX.Element;
14
+ export declare function Textarea({ error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, rows, value, ...originalProps }: TextareaProps): JSX.Element;
@@ -6,4 +6,5 @@ export declare function useFieldControl<T>(value: T, onChange: ((nextValue: T) =
6
6
  }): {
7
7
  controlledOnChange: (nextValue: T) => Promisable<void>;
8
8
  controlledValue: T | undefined;
9
+ setInternalValue: (nextValue: T) => Promisable<void>;
9
10
  };