@mtes-mct/monitor-ui 2.13.2 → 2.14.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtes-mct/monitor-ui",
3
3
  "description": "Common React UI components and styles for Monitorfish and Monitorenv.",
4
- "version": "2.13.2",
4
+ "version": "2.14.1",
5
5
  "license": "AGPL-3.0",
6
6
  "engines": {
7
7
  "node": ">=18"
@@ -0,0 +1,6 @@
1
+ import type { Promisable } from 'type-fest';
2
+ export type SingleTagProps = {
3
+ children: string;
4
+ onDelete: () => Promisable<void>;
5
+ };
6
+ export declare function SingleTag({ children, onDelete }: SingleTagProps): JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { FieldsetHTMLAttributes } from 'react';
2
2
  export type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement> & {
3
3
  hasBorder?: boolean | undefined;
4
- isHidden?: boolean | undefined;
4
+ isLegendHidden?: boolean | undefined;
5
5
  isLight?: boolean | undefined;
6
6
  legend?: string | undefined;
7
7
  };
8
- export declare function Fieldset({ children, hasBorder, isHidden, isLight, legend, ...nativeProps }: FieldsetProps): JSX.Element;
8
+ export declare function Fieldset({ children, hasBorder, isLegendHidden, isLight, legend, ...nativeProps }: FieldsetProps): JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import type { LabelHTMLAttributes } from 'react';
2
2
  export type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
3
+ disabled?: boolean | undefined;
3
4
  hasError?: boolean | undefined;
4
- isDisabled?: boolean | undefined;
5
5
  isHidden?: boolean | undefined;
6
6
  };
7
7
  export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {
8
+ disabled?: boolean | undefined;
8
9
  hasError?: boolean | undefined;
9
- isDisabled?: boolean | undefined;
10
10
  isHidden?: boolean | undefined;
11
11
  }, never>;
@@ -1,6 +1,6 @@
1
1
  import type { HTMLAttributes } from 'react';
2
2
  export type LegendProps = HTMLAttributes<HTMLLegendElement> & {
3
- isDisabled?: boolean | undefined;
3
+ disabled?: boolean | undefined;
4
4
  isHidden?: boolean | undefined;
5
5
  };
6
- export declare function Legend({ isDisabled, isHidden, ...nativeProps }: LegendProps): JSX.Element;
6
+ export declare function Legend({ disabled, isHidden, ...nativeProps }: LegendProps): JSX.Element;
@@ -6,4 +6,4 @@ export type CheckboxProps = Omit<RsuiteCheckboxProps, 'as' | 'checked' | 'id' |
6
6
  name: string;
7
7
  onChange?: ((isCheched: boolean) => Promisable<void>) | undefined;
8
8
  };
9
- export declare function Checkbox({ error, label, onChange, ...originalProps }: CheckboxProps): JSX.Element;
9
+ export declare function Checkbox({ defaultChecked, error, label, onChange, ...originalProps }: CheckboxProps): JSX.Element;
@@ -15,4 +15,4 @@ export type MultiSelectProps<OptionValue = string> = Omit<TagPickerProps, 'as' |
15
15
  onChange?: ((nextValue: OptionValue[] | undefined) => Promisable<void>) | undefined;
16
16
  options: Option<OptionValue>[];
17
17
  };
18
- export declare function MultiSelect<OptionValue = string>({ baseContainer, error, fixedWidth, isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: MultiSelectProps<OptionValue>): JSX.Element;
18
+ export declare function MultiSelect<OptionValue = string>({ baseContainer, defaultValue, error, fixedWidth, isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: MultiSelectProps<OptionValue>): JSX.Element;
@@ -2,6 +2,7 @@ import type { Promisable } from 'type-fest';
2
2
  export type MultiZoneEditorProps = {
3
3
  addButtonLabel: string;
4
4
  defaultValue?: Record<string, any>[] | undefined;
5
+ disabled?: boolean | undefined;
5
6
  error?: string | undefined;
6
7
  initialZone: Record<string, any>;
7
8
  isLabelHidden?: boolean;
@@ -10,7 +11,8 @@ export type MultiZoneEditorProps = {
10
11
  labelPropName: string;
11
12
  onAdd?: ((nextZones: Record<string, any>[], index: number) => Promisable<void>) | undefined;
12
13
  onCenter?: ((zone: Record<string, any>) => Promisable<void>) | undefined;
14
+ onChange?: ((nextZones: Record<string, any>[] | undefined) => Promisable<void>) | undefined;
13
15
  onDelete?: ((nextZones: Record<string, any>[]) => Promisable<void>) | undefined;
14
16
  onEdit?: ((zone: Record<string, any>, index: number) => Promisable<void>) | undefined;
15
17
  };
16
- export declare function MultiZoneEditor({ addButtonLabel, defaultValue, error, initialZone, isLabelHidden, isLight, label, labelPropName, onAdd, onCenter, onDelete, onEdit }: MultiZoneEditorProps): JSX.Element;
18
+ export declare function MultiZoneEditor({ addButtonLabel, defaultValue, disabled, error, initialZone, isLabelHidden, isLight, label, labelPropName, onAdd, onCenter, onChange, onDelete, onEdit }: MultiZoneEditorProps): JSX.Element;
@@ -9,4 +9,4 @@ export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | '
9
9
  name: string;
10
10
  onChange?: ((nextValue: number | undefined) => Promisable<void>) | undefined;
11
11
  };
12
- export declare function NumberInput({ error, isLabelHidden, isLight, label, onChange, ...originalProps }: NumberInputProps): JSX.Element;
12
+ export declare function NumberInput({ defaultValue, error, isLabelHidden, isLight, label, onChange, ...originalProps }: NumberInputProps): JSX.Element;
@@ -13,4 +13,4 @@ export type SelectProps<OptionValue = string> = Omit<SelectPickerProps<any>, 'as
13
13
  onChange?: ((nextValue: OptionValue | undefined) => Promisable<void>) | undefined;
14
14
  options: Option<OptionValue>[];
15
15
  };
16
- export declare function Select<OptionValue = string>({ baseContainer, error, isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: SelectProps<OptionValue>): JSX.Element;
16
+ export declare function Select<OptionValue = string>({ baseContainer, defaultValue, error, isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: SelectProps<OptionValue>): JSX.Element;
@@ -9,4 +9,4 @@ export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'on
9
9
  name: string;
10
10
  onChange?: ((nextValue: string | undefined) => Promisable<void>) | undefined;
11
11
  };
12
- export declare function TextInput({ error, isLabelHidden, isLight, label, onChange, ...originalProps }: TextInputProps): JSX.Element;
12
+ export declare function TextInput({ defaultValue, error, isLabelHidden, isLight, label, onChange, ...originalProps }: TextInputProps): JSX.Element;
@@ -9,4 +9,4 @@ export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'd
9
9
  name: string;
10
10
  onChange?: ((nextValue: string | undefined) => Promisable<void>) | undefined;
11
11
  };
12
- export declare function Textarea({ error, isLabelHidden, isLight, label, onChange, rows, ...originalProps }: TextareaProps): JSX.Element;
12
+ export declare function Textarea({ defaultValue, error, isLabelHidden, isLight, label, onChange, rows, ...originalProps }: TextareaProps): JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import type { Promisable } from 'type-fest';
2
- export declare function useFieldUndefineEffect(disabled: boolean | undefined, onChange: ((nextValue: any) => Promisable<void>) | undefined): void;
2
+ export declare function useFieldUndefineEffect(disabled: boolean | undefined, onChange: ((nextValue: any) => Promisable<void>) | undefined, onDisable?: () => Promisable<void>): void;
@@ -0,0 +1,2 @@
1
+ import type { DependencyList } from 'react';
2
+ export declare function useKey(deps: DependencyList): string;
@@ -0,0 +1 @@
1
+ export declare function usePrevious<T = any>(value: T): T | undefined;
package/src/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { OnlyFontGlobalStyle } from './OnlyFontGlobalStyle';
4
4
  export { THEME } from './theme';
5
5
  export { ThemeProvider } from './ThemeProvider';
6
6
  export { Dropdown } from './components/Dropdown';
7
+ export { SingleTag } from './components/SingleTag';
7
8
  export { Button } from './elements/Button';
8
9
  export { Field } from './elements/Field';
9
10
  export { Fieldset } from './elements/Fieldset';
@@ -47,6 +48,7 @@ export { stopMouseEventPropagation } from './utils/stopMouseEventPropagation';
47
48
  export type { PartialTheme, Theme } from './theme';
48
49
  export type { DateAsStringRange, DateRange, IconProps, Option, Undefine } from './types';
49
50
  export type { DropdownProps, DropdownItemProps } from './components/Dropdown';
51
+ export type { SingleTagProps } from './components/SingleTag';
50
52
  export type { ButtonProps } from './elements/Button';
51
53
  export type { FieldProps } from './elements/Field';
52
54
  export type { FieldsetProps } from './elements/Fieldset';
@@ -0,0 +1 @@
1
+ export declare const getPseudoRandomString: () => string;