@mtes-mct/monitor-ui 2.0.0 → 2.1.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 +20 -0
- package/elements/Fieldset.d.ts +5 -3
- package/fields/DatePicker/index.d.ts +2 -1
- package/fields/DateRangePicker/DateInput.d.ts +2 -0
- package/fields/DateRangePicker/TimeInput.d.ts +2 -0
- package/fields/DateRangePicker/index.d.ts +2 -1
- package/fields/MultiCheckbox.d.ts +2 -1
- package/fields/MultiRadio.d.ts +2 -1
- package/fields/MultiZoneEditor/index.d.ts +15 -0
- package/index.d.ts +2 -0
- package/index.js +284 -254
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [2.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v2.0.0...v2.1.0) (2022-12-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **elements:** add isLight & hasBorder props to Fieldset ([#134](https://github.com/MTES-MCT/monitor-ui/issues/134)) ([761ea73](https://github.com/MTES-MCT/monitor-ui/commit/761ea733f1441c32986b64f2ad6be4541073a485))
|
|
7
|
+
* **fields:** add MultiZoneEditor ([#135](https://github.com/MTES-MCT/monitor-ui/issues/135)) ([8a3d653](https://github.com/MTES-MCT/monitor-ui/commit/8a3d6537484f8a0b85289f6903e5567cdef0673b))
|
|
8
|
+
|
|
9
|
+
# [2.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v1.14.0...v2.0.0) (2022-12-14)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat(fields)!: convert MultiSelect fixedWidth prop from rem to px (#132) ([6ab4d7f](https://github.com/MTES-MCT/monitor-ui/commit/6ab4d7fb4cf253964ba7074ab0e845c182a39928)), closes [#132](https://github.com/MTES-MCT/monitor-ui/issues/132)
|
|
13
|
+
* feat(elements)!: convert Icon size prop from rem to px (#131) ([30d3639](https://github.com/MTES-MCT/monitor-ui/commit/30d363933c0cd733874ed9999646a332a7b3c2f3)), closes [#131](https://github.com/MTES-MCT/monitor-ui/issues/131)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* Both MultiSelect and FormikMultiSelect `fixedWidth` prop are now in px instead of rem.
|
|
19
|
+
* Both Icon and ButtonIcon `size` prop is now in px instead of rem.
|
|
20
|
+
|
|
1
21
|
# [1.14.0](https://github.com/MTES-MCT/monitor-ui/compare/v1.13.0...v1.14.0) (2022-12-14)
|
|
2
22
|
|
|
3
23
|
|
package/elements/Fieldset.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FieldsetHTMLAttributes } from 'react';
|
|
2
2
|
export type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement> & {
|
|
3
|
+
hasBorder?: boolean;
|
|
4
|
+
isHidden?: boolean;
|
|
3
5
|
isLight?: boolean;
|
|
4
|
-
|
|
6
|
+
legend?: string;
|
|
5
7
|
};
|
|
6
|
-
export declare function Fieldset({ isLight,
|
|
8
|
+
export declare function Fieldset({ children, hasBorder, isHidden, isLight, legend, ...nativeProps }: FieldsetProps): JSX.Element;
|
|
@@ -4,6 +4,7 @@ export type DatePickerProps = {
|
|
|
4
4
|
/** Only allow past dates until today. */
|
|
5
5
|
isHistorical?: boolean;
|
|
6
6
|
isLabelHidden?: boolean;
|
|
7
|
+
isLight?: boolean;
|
|
7
8
|
label: string;
|
|
8
9
|
/**
|
|
9
10
|
* Range of minutes used to generate the time picker list.
|
|
@@ -20,4 +21,4 @@ export type DatePickerProps = {
|
|
|
20
21
|
onChange?: (nextUtcDate: Date) => Promisable<void>;
|
|
21
22
|
withTime?: boolean;
|
|
22
23
|
};
|
|
23
|
-
export declare function DatePicker({ defaultValue, isHistorical, isLabelHidden, label, minutesRange, onChange, withTime }: DatePickerProps): JSX.Element;
|
|
24
|
+
export declare function DatePicker({ defaultValue, isHistorical, isLabelHidden, isLight, label, minutesRange, onChange, withTime }: DatePickerProps): JSX.Element;
|
|
@@ -6,6 +6,7 @@ export type DateInputProps = Pick<NumberInputProps, 'onBack' | 'onPrevious' | 'o
|
|
|
6
6
|
defaultValue?: DateTuple;
|
|
7
7
|
isEndDate?: boolean;
|
|
8
8
|
isForcedFocused: boolean;
|
|
9
|
+
isLight: boolean;
|
|
9
10
|
isStartDate?: boolean;
|
|
10
11
|
/** Called each time the date input is changed to a new valid value. */
|
|
11
12
|
onChange: (nextDateTuple: DateTuple) => Promisable<void>;
|
|
@@ -15,6 +16,7 @@ export declare const DateInput: import("react").ForwardRefExoticComponent<Pick<N
|
|
|
15
16
|
defaultValue?: DateTuple | undefined;
|
|
16
17
|
isEndDate?: boolean | undefined;
|
|
17
18
|
isForcedFocused: boolean;
|
|
19
|
+
isLight: boolean;
|
|
18
20
|
isStartDate?: boolean | undefined;
|
|
19
21
|
/** Called each time the date input is changed to a new valid value. */
|
|
20
22
|
onChange: (nextDateTuple: DateTuple) => Promisable<void>;
|
|
@@ -4,6 +4,7 @@ import type { DateOrTimeInputRef, TimeTuple } from './types';
|
|
|
4
4
|
import type { Promisable } from 'type-fest';
|
|
5
5
|
export type TimeInputProps = Pick<NumberInputProps, 'onBack' | 'onPrevious' | 'onNext'> & {
|
|
6
6
|
defaultValue?: TimeTuple;
|
|
7
|
+
isLight: boolean;
|
|
7
8
|
isStartDate?: boolean;
|
|
8
9
|
minutesRange?: number;
|
|
9
10
|
/** Called each time the time input is changed to a new valid value. */
|
|
@@ -14,6 +15,7 @@ export type TimeInputProps = Pick<NumberInputProps, 'onBack' | 'onPrevious' | 'o
|
|
|
14
15
|
};
|
|
15
16
|
export declare const TimeInput: import("react").ForwardRefExoticComponent<Pick<NumberInputProps, "onBack" | "onNext" | "onPrevious"> & {
|
|
16
17
|
defaultValue?: TimeTuple | undefined;
|
|
18
|
+
isLight: boolean;
|
|
17
19
|
isStartDate?: boolean | undefined;
|
|
18
20
|
minutesRange?: number | undefined;
|
|
19
21
|
/** Called each time the time input is changed to a new valid value. */
|
|
@@ -5,6 +5,7 @@ export type DateRangePickerProps = {
|
|
|
5
5
|
/** Only allow past dates until today. */
|
|
6
6
|
isHistorical?: boolean;
|
|
7
7
|
isLabelHidden?: boolean;
|
|
8
|
+
isLight?: boolean;
|
|
8
9
|
label: string;
|
|
9
10
|
/**
|
|
10
11
|
* Range of minutes used to generate the time picker list.
|
|
@@ -21,4 +22,4 @@ export type DateRangePickerProps = {
|
|
|
21
22
|
onChange?: (nextUtcDateRange: DateRange) => Promisable<void>;
|
|
22
23
|
withTime?: boolean;
|
|
23
24
|
};
|
|
24
|
-
export declare function DateRangePicker({ defaultValue, isHistorical, isLabelHidden, label, minutesRange, onChange, withTime }: DateRangePickerProps): JSX.Element;
|
|
25
|
+
export declare function DateRangePicker({ defaultValue, isHistorical, isLabelHidden, isLight, label, minutesRange, onChange, withTime }: DateRangePickerProps): JSX.Element;
|
|
@@ -4,9 +4,10 @@ export type MultiCheckboxProps = {
|
|
|
4
4
|
defaultValue?: string[];
|
|
5
5
|
isInline?: boolean;
|
|
6
6
|
isLabelHidden?: boolean;
|
|
7
|
+
isLight?: boolean;
|
|
7
8
|
label: string;
|
|
8
9
|
name: string;
|
|
9
10
|
onChange?: (nextValue: string[] | undefined) => Promisable<void>;
|
|
10
11
|
options: Option[];
|
|
11
12
|
};
|
|
12
|
-
export declare function MultiCheckbox({ defaultValue, isInline, isLabelHidden, label, name, onChange, options }: MultiCheckboxProps): JSX.Element;
|
|
13
|
+
export declare function MultiCheckbox({ defaultValue, isInline, isLabelHidden, isLight, label, name, onChange, options }: MultiCheckboxProps): JSX.Element;
|
package/fields/MultiRadio.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ export type MultiRadioProps = {
|
|
|
4
4
|
defaultValue?: string;
|
|
5
5
|
isInline?: boolean;
|
|
6
6
|
isLabelHidden?: boolean;
|
|
7
|
+
isLight?: boolean;
|
|
7
8
|
label: string;
|
|
8
9
|
name: string;
|
|
9
10
|
onChange?: (nextValue: string | undefined) => Promisable<void>;
|
|
10
11
|
options: Option[];
|
|
11
12
|
};
|
|
12
|
-
export declare function MultiRadio({ defaultValue, isInline, isLabelHidden, label, name, onChange, options }: MultiRadioProps): JSX.Element;
|
|
13
|
+
export declare function MultiRadio({ defaultValue, isInline, isLabelHidden, isLight, label, name, onChange, options }: MultiRadioProps): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
export type MultiZoneEditorProps = {
|
|
3
|
+
addButtonLabel: string;
|
|
4
|
+
defaultValue?: Record<string, any>[];
|
|
5
|
+
initialZone: Record<string, any>;
|
|
6
|
+
isLabelHidden?: boolean;
|
|
7
|
+
isLight?: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
labelPropName: string;
|
|
10
|
+
onAdd?: (nextZones: Record<string, any>[], index: number) => Promisable<void>;
|
|
11
|
+
onCenter?: (zone: Record<string, any>) => Promisable<void>;
|
|
12
|
+
onDelete?: (nextZones: Record<string, any>[]) => Promisable<void>;
|
|
13
|
+
onEdit?: (zone: Record<string, any>, index: number) => Promisable<void>;
|
|
14
|
+
};
|
|
15
|
+
export declare function MultiZoneEditor({ addButtonLabel, defaultValue, initialZone, isLabelHidden, isLight, label, labelPropName, onAdd, onCenter, onDelete, onEdit }: MultiZoneEditorProps): JSX.Element;
|
package/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { DatePicker } from './fields/DatePicker';
|
|
|
17
17
|
export { MultiCheckbox } from './fields/MultiCheckbox';
|
|
18
18
|
export { MultiSelect } from './fields/MultiSelect';
|
|
19
19
|
export { MultiRadio } from './fields/MultiRadio';
|
|
20
|
+
export { MultiZoneEditor } from './fields/MultiZoneEditor';
|
|
20
21
|
export { Select } from './fields/Select';
|
|
21
22
|
export { Textarea } from './fields/Textarea';
|
|
22
23
|
export { TextInput } from './fields/TextInput';
|
|
@@ -49,6 +50,7 @@ export type { DatePickerProps } from './fields/DatePicker';
|
|
|
49
50
|
export type { MultiCheckboxProps } from './fields/MultiCheckbox';
|
|
50
51
|
export type { MultiSelectProps } from './fields/MultiSelect';
|
|
51
52
|
export type { MultiRadioProps } from './fields/MultiRadio';
|
|
53
|
+
export type { MultiZoneEditorProps } from './fields/MultiZoneEditor';
|
|
52
54
|
export type { SelectProps } from './fields/Select';
|
|
53
55
|
export type { TextareaProps } from './fields/Textarea';
|
|
54
56
|
export type { TextInputProps } from './fields/TextInput';
|