@mtes-mct/monitor-ui 2.5.0 → 2.6.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 +14 -0
- package/index.js +263 -108
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/NewWindow/index.d.ts +14 -0
- package/src/elements/FieldError.d.ts +7 -0
- package/src/elements/Label.d.ts +2 -0
- package/src/fields/AutoComplete.d.ts +3 -2
- package/src/fields/MultiSelect.d.ts +3 -2
- package/src/fields/Select.d.ts +3 -2
- package/src/utils/cleanString.d.ts +4 -0
- package/src/utils/normalizeString.d.ts +4 -0
- package/src/utils/cleanInputString.d.ts +0 -4
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.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@babel/runtime": "7.20.6",
|
|
11
11
|
"prop-types": "15.8.1",
|
|
12
|
-
"tslib": "2.4.
|
|
12
|
+
"tslib": "2.4.1"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"formik": "^2.0.0",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
export type NewWindowProps = {
|
|
3
|
+
center?: 'parent' | 'screen';
|
|
4
|
+
children: any;
|
|
5
|
+
height?: number;
|
|
6
|
+
isStoryBook?: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
onOpen?: (window: Window) => Promisable<void>;
|
|
9
|
+
onUnload?: () => Promisable<void>;
|
|
10
|
+
title?: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
width?: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function NewWindow({ center, children, height, isStoryBook, name, onOpen, onUnload, title, url, width }: NewWindowProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type FieldErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
3
|
+
isDisabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const FieldError: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {
|
|
6
|
+
isDisabled?: boolean | undefined;
|
|
7
|
+
}, never>;
|
package/src/elements/Label.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { LabelHTMLAttributes } from 'react';
|
|
2
2
|
export type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
|
|
3
|
+
hasError?: boolean;
|
|
3
4
|
isDisabled?: boolean;
|
|
4
5
|
isHidden?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {
|
|
8
|
+
hasError?: boolean | undefined;
|
|
7
9
|
isDisabled?: boolean | undefined;
|
|
8
10
|
isHidden?: boolean | undefined;
|
|
9
11
|
}, never>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Option } from '../types';
|
|
2
2
|
import type { AutoCompleteProps as RsuiteAutoCompleteProps } from 'rsuite';
|
|
3
3
|
import type { Promisable } from 'type-fest';
|
|
4
|
-
export type AutoCompleteProps = Omit<RsuiteAutoCompleteProps, 'as' | 'data' | 'id' | 'onChange' | 'onSelect' | 'value'> & {
|
|
4
|
+
export type AutoCompleteProps = Omit<RsuiteAutoCompleteProps, 'as' | 'container' | 'data' | 'id' | 'onChange' | 'onSelect' | 'value'> & {
|
|
5
|
+
error?: string;
|
|
5
6
|
isLabelHidden?: boolean;
|
|
6
7
|
isLight?: boolean;
|
|
7
8
|
label: string;
|
|
@@ -12,4 +13,4 @@ export type AutoCompleteProps = Omit<RsuiteAutoCompleteProps, 'as' | 'data' | 'i
|
|
|
12
13
|
queryMap?: (record: Record<string, any>) => Option;
|
|
13
14
|
queryUrl?: string;
|
|
14
15
|
};
|
|
15
|
-
export declare function AutoComplete({ defaultValue, isLabelHidden, isLight, label, onChange, onQuery, options, queryMap, queryUrl, ...originalProps }: AutoCompleteProps): JSX.Element;
|
|
16
|
+
export declare function AutoComplete({ defaultValue, error, isLabelHidden, isLight, label, onChange, onQuery, options, queryMap, queryUrl, ...originalProps }: AutoCompleteProps): JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Option } from '../types';
|
|
2
2
|
import type { TagPickerProps } from 'rsuite';
|
|
3
3
|
import type { Promisable } from 'type-fest';
|
|
4
|
-
export type MultiSelectProps = Omit<TagPickerProps, 'as' | 'data' | 'defaultValue' | 'id' | 'onChange' | 'value'> & {
|
|
4
|
+
export type MultiSelectProps = Omit<TagPickerProps, 'as' | 'container' | 'data' | 'defaultValue' | 'id' | 'onChange' | 'value'> & {
|
|
5
5
|
defaultValue?: string[];
|
|
6
|
+
error?: string;
|
|
6
7
|
/** Width in pixels */
|
|
7
8
|
fixedWidth?: number;
|
|
8
9
|
isLabelHidden?: boolean;
|
|
@@ -12,4 +13,4 @@ export type MultiSelectProps = Omit<TagPickerProps, 'as' | 'data' | 'defaultValu
|
|
|
12
13
|
onChange?: (nextValue: string[] | undefined) => Promisable<void>;
|
|
13
14
|
options: Option[];
|
|
14
15
|
};
|
|
15
|
-
export declare function MultiSelect({ fixedWidth, isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: MultiSelectProps): JSX.Element;
|
|
16
|
+
export declare function MultiSelect({ error, fixedWidth, isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: MultiSelectProps): JSX.Element;
|
package/src/fields/Select.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Option } from '../types';
|
|
2
2
|
import type { SelectPickerProps } from 'rsuite';
|
|
3
3
|
import type { Promisable } from 'type-fest';
|
|
4
|
-
export type SelectProps = Omit<SelectPickerProps<any>, 'as' | 'data' | 'defaultValue' | 'id' | 'onChange' | 'value'> & {
|
|
4
|
+
export type SelectProps = Omit<SelectPickerProps<any>, 'as' | 'container' | 'data' | 'defaultValue' | 'id' | 'onChange' | 'value'> & {
|
|
5
5
|
defaultValue?: string;
|
|
6
|
+
error?: string;
|
|
6
7
|
isLabelHidden?: boolean;
|
|
7
8
|
isLight?: boolean;
|
|
8
9
|
label: string;
|
|
@@ -10,4 +11,4 @@ export type SelectProps = Omit<SelectPickerProps<any>, 'as' | 'data' | 'defaultV
|
|
|
10
11
|
onChange?: (nextValue: string | undefined) => Promisable<void>;
|
|
11
12
|
options: Option[];
|
|
12
13
|
};
|
|
13
|
-
export declare function Select({ isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: SelectProps): JSX.Element;
|
|
14
|
+
export declare function Select({ error, isLabelHidden, isLight, label, onChange, options, searchable, ...originalProps }: SelectProps): JSX.Element;
|