@mtes-mct/monitor-ui 4.0.6 → 4.1.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/cypress/index.d.ts +1 -1
- package/fields/MultiZoneEditor/index.d.ts +2 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [4.0.7](https://github.com/MTES-MCT/monitor-ui/compare/v4.0.6...v4.0.7) (2023-04-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **cypress:** add number to fill command type ([db11067](https://github.com/MTES-MCT/monitor-ui/commit/db11067d9a0f3523bef61b390bd38f8c9c3c6ed4))
|
|
7
|
+
|
|
8
|
+
## [4.0.6](https://github.com/MTES-MCT/monitor-ui/compare/v4.0.5...v4.0.6) (2023-03-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **cypress:** handle previous subject case in clickButton command ([5fc8b34](https://github.com/MTES-MCT/monitor-ui/commit/5fc8b34de09bf79156e348810897b55f0a1839f9))
|
|
14
|
+
|
|
1
15
|
## [4.0.5](https://github.com/MTES-MCT/monitor-ui/compare/v4.0.4...v4.0.5) (2023-03-30)
|
|
2
16
|
|
|
3
17
|
|
package/cypress/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare namespace Cypress {
|
|
|
11
11
|
): Chainable<JQuery<HTMLButtonElement>>
|
|
12
12
|
clickLink(linkText: string): Chainable<JQuery<HTMLAnchorElement>>
|
|
13
13
|
clickOutside(xPosition?: number, yPosition?: number): Chainable<JQuery<HTMLBodyElement>>
|
|
14
|
-
fill(label: string, value: boolean | string | string[] | undefined): Chainable<Element>
|
|
14
|
+
fill(label: string, value: boolean | number | string | string[] | undefined): Chainable<Element>
|
|
15
15
|
forceClick(): Chainable<JQuery<HTMLElement>>
|
|
16
16
|
getDataCy(dataCy: string): Chainable<JQuery<HTMLElement>>
|
|
17
17
|
}
|
|
@@ -5,6 +5,7 @@ export type MultiZoneEditorProps = {
|
|
|
5
5
|
disabled?: boolean | undefined;
|
|
6
6
|
error?: string | undefined;
|
|
7
7
|
initialZone: Record<string, any>;
|
|
8
|
+
isAddButtonDisabled?: boolean | undefined;
|
|
8
9
|
isLabelHidden?: boolean;
|
|
9
10
|
isLight?: boolean | undefined;
|
|
10
11
|
label: string;
|
|
@@ -15,4 +16,4 @@ export type MultiZoneEditorProps = {
|
|
|
15
16
|
onDelete?: ((nextZones: Record<string, any>[]) => Promisable<void>) | undefined;
|
|
16
17
|
onEdit?: ((zone: Record<string, any>, index: number) => Promisable<void>) | undefined;
|
|
17
18
|
};
|
|
18
|
-
export declare function MultiZoneEditor({ addButtonLabel, defaultValue, disabled, error, initialZone, isLabelHidden, isLight, label, labelPropName, onAdd, onCenter, onChange, onDelete, onEdit }: MultiZoneEditorProps): JSX.Element;
|
|
19
|
+
export declare function MultiZoneEditor({ addButtonLabel, defaultValue, disabled, error, initialZone, isAddButtonDisabled, isLabelHidden, isLight, label, labelPropName, onAdd, onCenter, onChange, onDelete, onEdit }: MultiZoneEditorProps): JSX.Element;
|
package/index.js
CHANGED
|
@@ -22518,7 +22518,7 @@ const CheckboxesBox = styled.div `
|
|
|
22518
22518
|
`}
|
|
22519
22519
|
`;
|
|
22520
22520
|
|
|
22521
|
-
function MultiZoneEditor({ addButtonLabel, defaultValue = [], disabled = false, error, initialZone, isLabelHidden = false, isLight = false, label, labelPropName, onAdd, onCenter, onChange, onDelete, onEdit }) {
|
|
22521
|
+
function MultiZoneEditor({ addButtonLabel, defaultValue = [], disabled = false, error, initialZone, isAddButtonDisabled = false, isLabelHidden = false, isLight = false, label, labelPropName, onAdd, onCenter, onChange, onDelete, onEdit }) {
|
|
22522
22522
|
const prevDefaultValueRef = useRef(defaultValue);
|
|
22523
22523
|
const [zones, setZones] = useState(defaultValue);
|
|
22524
22524
|
const controlledError = useMemo(() => normalizeString(error), [error]);
|
|
@@ -22557,7 +22557,7 @@ function MultiZoneEditor({ addButtonLabel, defaultValue = [], disabled = false,
|
|
|
22557
22557
|
setZones(defaultValue);
|
|
22558
22558
|
}, [defaultValue]);
|
|
22559
22559
|
useFieldUndefineEffect(disabled, onChange, handleDisable);
|
|
22560
|
-
return (jsxs(Fieldset, { className: "Field-MultiZoneEditor", disabled: disabled, isLegendHidden: isLabelHidden, legend: label, children: [jsx(Button, { accent: Accent.SECONDARY, disabled: disabled, Icon: Plus, isFullWidth: true, onClick: addZone, children: addButtonLabel }), jsx(Fragment, { children: zones.map((zone, index) => (
|
|
22560
|
+
return (jsxs(Fieldset, { className: "Field-MultiZoneEditor", disabled: disabled, isLegendHidden: isLabelHidden, legend: label, children: [jsx(Button, { accent: Accent.SECONDARY, disabled: disabled || isAddButtonDisabled, Icon: Plus, isFullWidth: true, onClick: addZone, children: addButtonLabel }), jsx(Fragment, { children: zones.map((zone, index) => (
|
|
22561
22561
|
// eslint-disable-next-line react/no-array-index-key
|
|
22562
22562
|
jsxs(Row, { children: [jsxs(ZoneBox, { "$isLight": isLight, children: [zone[labelPropName], jsxs(Link, { onClick: () => centerZone(zone), children: [jsx(SelectRectangle, {}), jsx("span", { children: "Centrer sur la carte" })] })] }), jsx(IconButton, { accent: Accent.SECONDARY, Icon: Edit, onClick: () => editZone(index, zone) }), jsx(IconButton, { accent: Accent.SECONDARY, "aria-label": "Supprimer cette zone", Icon: Delete, onClick: () => deleteZone(index) })] }, `zone-${index}`))) }), hasError && jsx(FieldError, { children: controlledError })] }));
|
|
22563
22563
|
}
|