@gridsuite/commons-ui 0.125.0 → 0.127.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/dist/components/checkBoxList/checkBoxList.type.d.ts +10 -10
- package/dist/components/customAGGrid/customAggrid.style.d.ts +1 -2
- package/dist/components/customAGGrid/index.d.ts +1 -0
- package/dist/components/customAGGrid/index.js +2 -0
- package/dist/components/customAGGrid/separatorCellRenderer.d.ts +11 -0
- package/dist/components/customAGGrid/separatorCellRenderer.js +16 -0
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.d.ts +16 -16
- package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +5 -5
- package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +3 -3
- package/dist/components/elementSearch/elementItem/EquipmentItem.d.ts +6 -6
- package/dist/components/elementSearch/tagRenderer/TagRenderer.d.ts +3 -3
- package/dist/components/expandableGroup/ExpandableGroup.js +4 -4
- package/dist/components/filter/HeaderFilterForm.d.ts +6 -6
- package/dist/components/filter/HeaderFilterForm.js +3 -3
- package/dist/components/filter/expert/ExpertFilterForm.js +1 -1
- package/dist/components/filter/expert/expertFilterUtils.d.ts +1 -0
- package/dist/components/filter/expert/expertFilterUtils.js +9 -1
- package/dist/components/filter/expert/index.js +2 -1
- package/dist/components/filter/index.js +2 -1
- package/dist/components/grid/grid-section.d.ts +2 -2
- package/dist/components/index.js +4 -1
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +52 -23
- package/dist/components/inputs/reactHookForm/chip-items-input.js +27 -23
- package/dist/components/inputs/reactHookForm/text/DescriptionField.d.ts +2 -2
- package/dist/components/inputs/reactHookForm/text/ExpandingTextField.js +1 -4
- package/dist/components/inputs/reactHookForm/text/UniqueNameInput.d.ts +3 -2
- package/dist/components/inputs/reactQueryBuilder/CustomReactQueryBuilder.js +2 -1
- package/dist/components/menus/custom-nested-menu.d.ts +3 -2
- package/dist/components/menus/custom-nested-menu.js +0 -4
- package/dist/components/overflowableText/OverflowableText.d.ts +4 -3
- package/dist/components/parameters/common/ProviderParam.js +3 -3
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +3 -3
- package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +3 -3
- package/dist/components/parameters/common/limitreductions/limit-reductions-tooltip-column.js +4 -3
- package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +3 -3
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +3 -3
- package/dist/components/parameters/common/widget/parameter-float.js +3 -3
- package/dist/components/parameters/common/widget/parameter-line-slider.d.ts +1 -1
- package/dist/components/parameters/common/widget/parameter-line-slider.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameter-field.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-form.d.ts +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-header.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +3 -3
- package/dist/components/parameters/network-visualizations/map-parameters.js +3 -3
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +3 -3
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +3 -3
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +3 -3
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +3 -3
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +3 -3
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +3 -3
- package/dist/components/parameters/parameters-style.d.ts +64 -59
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +3 -3
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-table.js +3 -3
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +3 -3
- package/dist/components/parameters/sensi/utils.js +3 -3
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +9 -19
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +3 -3
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +3 -3
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +3 -3
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +3 -3
- package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +3 -3
- package/dist/components/parameters/voltage-init/general-parameters.js +3 -3
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +3 -3
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +3 -3
- package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +3 -3
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.d.ts +6 -7
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +3 -3
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +3 -3
- package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +3 -3
- package/dist/components/topBar/AboutDialog.js +3 -7
- package/dist/components/topBar/GridLogo.d.ts +2 -2
- package/dist/components/treeViewFinder/TreeViewFinder.d.ts +3 -0
- package/dist/hooks/use-parameters-backend.d.ts +1 -1
- package/dist/hooks/use-parameters-backend.js +4 -2
- package/dist/hooks/use-unique-name-validation.js +4 -4
- package/dist/index.js +8 -1
- package/dist/translations/en/filterEn.d.ts +1 -0
- package/dist/translations/en/filterEn.js +2 -1
- package/dist/translations/en/index.d.ts +1 -0
- package/dist/translations/en/index.js +3 -1
- package/dist/translations/en/parameters.d.ts +2 -0
- package/dist/translations/en/parameters.js +3 -1
- package/dist/translations/en/use-unique-name-validation-en.d.ts +12 -0
- package/dist/translations/en/use-unique-name-validation-en.js +9 -0
- package/dist/translations/fr/filterFr.d.ts +1 -0
- package/dist/translations/fr/filterFr.js +2 -1
- package/dist/translations/fr/index.d.ts +1 -0
- package/dist/translations/fr/index.js +3 -1
- package/dist/translations/fr/parameters.d.ts +2 -0
- package/dist/translations/fr/parameters.js +4 -2
- package/dist/translations/fr/use-unique-name-validation-fr.d.ts +12 -0
- package/dist/translations/fr/use-unique-name-validation-fr.js +9 -0
- package/dist/utils/constants/fieldConstants.d.ts +2 -0
- package/dist/utils/constants/fieldConstants.js +2 -0
- package/dist/utils/mapper/getFileIcon.d.ts +2 -2
- package/dist/utils/styles.d.ts +2 -0
- package/dist/utils/types/equipmentType.d.ts +24 -25
- package/dist/utils/types/equipmentType.js +1 -5
- package/package.json +40 -41
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { DraggableProvided, DragStart, DropResult } from '@hello-pangea/dnd';
|
|
3
|
-
import {
|
|
3
|
+
import { SxStyle } from '../../utils/styles';
|
|
4
4
|
export type CheckBoxListItemSx = {
|
|
5
|
-
checkBoxIcon?:
|
|
6
|
-
listItemText?:
|
|
7
|
-
label?:
|
|
8
|
-
checkboxListItem?:
|
|
9
|
-
checkboxButton?:
|
|
10
|
-
checkbox?:
|
|
11
|
-
dragButton?:
|
|
5
|
+
checkBoxIcon?: SxStyle;
|
|
6
|
+
listItemText?: SxStyle;
|
|
7
|
+
label?: SxStyle;
|
|
8
|
+
checkboxListItem?: SxStyle;
|
|
9
|
+
checkboxButton?: SxStyle;
|
|
10
|
+
checkbox?: SxStyle;
|
|
11
|
+
dragButton?: SxStyle;
|
|
12
12
|
};
|
|
13
13
|
export type CheckBoxListSx = {
|
|
14
|
-
dragAndDropContainer?:
|
|
15
|
-
checkboxList?:
|
|
14
|
+
dragAndDropContainer?: SxStyle;
|
|
15
|
+
checkboxList?: SxStyle;
|
|
16
16
|
};
|
|
17
17
|
export type CheckBoxListItemSxMethod<T> = (item: T) => CheckBoxListItemSx;
|
|
18
18
|
type CheckBoxListItemSxProps<T> = CheckBoxListSx & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
2
1
|
export declare const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
|
|
3
2
|
export declare const styles: {
|
|
4
|
-
readonly grid: (theme: Theme) => {
|
|
3
|
+
readonly grid: (theme: import('@mui/material').Theme) => {
|
|
5
4
|
width: string;
|
|
6
5
|
height: string;
|
|
7
6
|
position: "relative";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CUSTOM_AGGRID_THEME, styles } from "./customAggrid.style.js";
|
|
2
2
|
import { CustomAGGrid } from "./customAggrid.js";
|
|
3
|
+
import { SeparatorCellRenderer } from "./separatorCellRenderer.js";
|
|
3
4
|
export {
|
|
4
5
|
CUSTOM_AGGRID_THEME,
|
|
5
6
|
CustomAGGrid,
|
|
7
|
+
SeparatorCellRenderer,
|
|
6
8
|
styles
|
|
7
9
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
type SeparatorCellRendererProps = {
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function SeparatorCellRenderer({ value }: Readonly<SeparatorCellRendererProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from "@mui/material";
|
|
3
|
+
const styles = {
|
|
4
|
+
separator: (theme) => ({
|
|
5
|
+
fontWeight: "bold",
|
|
6
|
+
fontSize: "1rem",
|
|
7
|
+
width: "100%",
|
|
8
|
+
marginTop: theme.spacing(1)
|
|
9
|
+
})
|
|
10
|
+
};
|
|
11
|
+
function SeparatorCellRenderer({ value }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", color: "primary", sx: styles.separator, children: value });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
SeparatorCellRenderer
|
|
16
|
+
};
|
|
@@ -30,26 +30,26 @@ export type CustomMuiDialogProps<T extends FieldValues = FieldValues> = DialogPr
|
|
|
30
30
|
* </fullHeightDialog>
|
|
31
31
|
*/
|
|
32
32
|
export declare const unscrollableDialogStyles: {
|
|
33
|
-
fullHeightDialog: {
|
|
34
|
-
'.MuiDialog-paper': {
|
|
35
|
-
minWidth:
|
|
36
|
-
margin:
|
|
37
|
-
height:
|
|
33
|
+
readonly fullHeightDialog: {
|
|
34
|
+
readonly '.MuiDialog-paper': {
|
|
35
|
+
readonly minWidth: "90vw";
|
|
36
|
+
readonly margin: "auto";
|
|
37
|
+
readonly height: "95vh";
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
unscrollableContainer: {
|
|
41
|
-
display:
|
|
42
|
-
flexDirection:
|
|
43
|
-
overflowY:
|
|
40
|
+
readonly unscrollableContainer: {
|
|
41
|
+
readonly display: "flex";
|
|
42
|
+
readonly flexDirection: "column";
|
|
43
|
+
readonly overflowY: "hidden";
|
|
44
44
|
};
|
|
45
|
-
unscrollableHeader: {
|
|
46
|
-
flex:
|
|
47
|
-
padding:
|
|
45
|
+
readonly unscrollableHeader: {
|
|
46
|
+
readonly flex: "none";
|
|
47
|
+
readonly padding: 1;
|
|
48
48
|
};
|
|
49
|
-
scrollableContent: {
|
|
50
|
-
flex:
|
|
51
|
-
overflowY:
|
|
52
|
-
padding:
|
|
49
|
+
readonly scrollableContent: {
|
|
50
|
+
readonly flex: "auto";
|
|
51
|
+
readonly overflowY: "auto";
|
|
52
|
+
readonly padding: 1;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
export declare function CustomMuiDialog<T extends FieldValues = FieldValues>({ open, formSchema, formMethods, onClose, onSave, isDataFetching, onValidationError, titleId, disabledSave, removeOptional, onCancel, children, language, confirmationMessageKey, unscrollableFullHeight, ...dialogProps }: Readonly<CustomMuiDialogProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,6 +19,9 @@ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
|
19
19
|
import * as yup from "yup";
|
|
20
20
|
import "../../overflowableText/OverflowableText.js";
|
|
21
21
|
import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
|
|
22
|
+
import "react-querybuilder";
|
|
23
|
+
import "uuid";
|
|
24
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
22
25
|
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
23
26
|
import "../../customAGGrid/customAggrid.js";
|
|
24
27
|
import "ag-grid-community";
|
|
@@ -29,11 +32,8 @@ import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
|
29
32
|
import { DescriptionField } from "../../inputs/reactHookForm/text/DescriptionField.js";
|
|
30
33
|
import { UniqueNameInput } from "../../inputs/reactHookForm/text/UniqueNameInput.js";
|
|
31
34
|
import "@react-querybuilder/material";
|
|
32
|
-
import "../../filter/expert/expertFilterConstants.js";
|
|
33
35
|
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
34
|
-
import "uuid";
|
|
35
36
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
36
|
-
import "react-querybuilder";
|
|
37
37
|
import { CustomMuiDialog } from "../customMuiDialog/CustomMuiDialog.js";
|
|
38
38
|
import { initializeDirectory } from "./utils.js";
|
|
39
39
|
var OperationType = /* @__PURE__ */ ((OperationType2) => {
|
|
@@ -225,8 +225,8 @@ function ElementSaveDialog({
|
|
|
225
225
|
{
|
|
226
226
|
name: FieldConstants.OPERATION_TYPE,
|
|
227
227
|
options: [
|
|
228
|
-
{ id: "CREATE", label:
|
|
229
|
-
{ id: "UPDATE", label:
|
|
228
|
+
{ id: "CREATE", label: createLabelId ?? "createLabelId" },
|
|
229
|
+
{ id: "UPDATE", label: updateLabelId ?? "updateLabelId" }
|
|
230
230
|
],
|
|
231
231
|
formProps: {
|
|
232
232
|
sx: {
|
|
@@ -16,6 +16,9 @@ import { CancelButton } from "../inputs/reactHookForm/utils/CancelButton.js";
|
|
|
16
16
|
import "yup";
|
|
17
17
|
import "../overflowableText/OverflowableText.js";
|
|
18
18
|
import "../treeViewFinder/TreeViewFinder.js";
|
|
19
|
+
import "react-querybuilder";
|
|
20
|
+
import "uuid";
|
|
21
|
+
import "../filter/expert/expertFilterConstants.js";
|
|
19
22
|
import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
20
23
|
import "../customAGGrid/customAggrid.js";
|
|
21
24
|
import "ag-grid-community";
|
|
@@ -23,11 +26,8 @@ import "react-papaparse";
|
|
|
23
26
|
import "react-csv-downloader";
|
|
24
27
|
import "../inputs/reactHookForm/numbers/RangeInput.js";
|
|
25
28
|
import "@react-querybuilder/material";
|
|
26
|
-
import "../filter/expert/expertFilterConstants.js";
|
|
27
29
|
import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
28
|
-
import "uuid";
|
|
29
30
|
import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
30
|
-
import "react-querybuilder";
|
|
31
31
|
function DndTableAddRowsDialog({ open, handleAddButton, onClose }) {
|
|
32
32
|
const [rowNumber, setRowNumber] = useState(1);
|
|
33
33
|
const handleClose = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SxProps, Theme } from '@mui/material';
|
|
2
1
|
import { EquipmentInfos } from '../../../utils/types/equipmentType';
|
|
3
2
|
import { TagRenderer } from '../tagRenderer/TagRenderer';
|
|
3
|
+
import { SxStyle } from '../../../utils/styles';
|
|
4
4
|
export interface EquipmentItemProps {
|
|
5
5
|
inputValue: string;
|
|
6
6
|
suffixRenderer?: typeof TagRenderer;
|
|
@@ -14,11 +14,11 @@ export interface EquipmentItemProps {
|
|
|
14
14
|
equipmentVlTag?: string;
|
|
15
15
|
};
|
|
16
16
|
styles?: {
|
|
17
|
-
result?:
|
|
18
|
-
equipmentOption?:
|
|
19
|
-
equipmentTag?:
|
|
20
|
-
equipmentTypeTag?:
|
|
21
|
-
equipmentVlTag?:
|
|
17
|
+
result?: SxStyle;
|
|
18
|
+
equipmentOption?: SxStyle;
|
|
19
|
+
equipmentTag?: SxStyle;
|
|
20
|
+
equipmentTypeTag?: SxStyle;
|
|
21
|
+
equipmentVlTag?: SxStyle;
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
export declare function EquipmentItem({ inputValue, suffixRenderer, element, showsJustText, ...props }: EquipmentItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SxProps, Theme } from '@mui/material';
|
|
2
1
|
import { EquipmentInfos } from '../../../utils/types/equipmentType';
|
|
2
|
+
import { SxStyle } from '../../../utils/styles';
|
|
3
3
|
export interface TagRendererProps {
|
|
4
4
|
element: EquipmentInfos;
|
|
5
5
|
classes?: {
|
|
@@ -7,8 +7,8 @@ export interface TagRendererProps {
|
|
|
7
7
|
equipmentVlTag?: string;
|
|
8
8
|
};
|
|
9
9
|
styles?: {
|
|
10
|
-
equipmentTag?:
|
|
11
|
-
equipmentVlTag?:
|
|
10
|
+
equipmentTag?: SxStyle;
|
|
11
|
+
equipmentVlTag?: SxStyle;
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
export declare function TagRenderer({ element, ...props }: TagRendererProps): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -4,12 +4,12 @@ import { useState } from "react";
|
|
|
4
4
|
import { ExpandCircleDown, ExpandMore } from "@mui/icons-material";
|
|
5
5
|
import { FormattedMessage } from "react-intl";
|
|
6
6
|
const styles = {
|
|
7
|
-
accordion:
|
|
7
|
+
accordion: {
|
|
8
8
|
"&:before": {
|
|
9
9
|
display: "none"
|
|
10
10
|
},
|
|
11
11
|
background: "none"
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
13
|
accordionSummary: (theme) => ({
|
|
14
14
|
flexDirection: "row-reverse",
|
|
15
15
|
// place icon at the left
|
|
@@ -31,10 +31,10 @@ const styles = {
|
|
|
31
31
|
transform: "rotate(0deg)"
|
|
32
32
|
}
|
|
33
33
|
}),
|
|
34
|
-
accordionDetails:
|
|
34
|
+
accordionDetails: {
|
|
35
35
|
padding: 0
|
|
36
36
|
// reset default left right space in details
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
};
|
|
39
39
|
function ExpandableGroup({ renderHeader, children }) {
|
|
40
40
|
const [mouseHover, setMouseHover] = useState(false);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { UUID } from 'crypto';
|
|
2
2
|
import { default as yup } from '../../utils/yupConfig';
|
|
3
3
|
export declare const filterStyles: {
|
|
4
|
-
textField: {
|
|
5
|
-
minWidth:
|
|
6
|
-
width:
|
|
4
|
+
readonly textField: {
|
|
5
|
+
readonly minWidth: "250px";
|
|
6
|
+
readonly width: "33%";
|
|
7
7
|
};
|
|
8
|
-
description: {
|
|
9
|
-
minWidth:
|
|
10
|
-
width:
|
|
8
|
+
readonly description: {
|
|
9
|
+
readonly minWidth: "250px";
|
|
10
|
+
readonly width: "50%";
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export interface FilterFormProps {
|
|
@@ -18,6 +18,9 @@ import "../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
|
18
18
|
import * as yup from "yup";
|
|
19
19
|
import "../overflowableText/OverflowableText.js";
|
|
20
20
|
import "../treeViewFinder/TreeViewFinder.js";
|
|
21
|
+
import "react-querybuilder";
|
|
22
|
+
import "uuid";
|
|
23
|
+
import "./expert/expertFilterConstants.js";
|
|
21
24
|
import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
22
25
|
import "../customAGGrid/customAggrid.js";
|
|
23
26
|
import "ag-grid-community";
|
|
@@ -27,11 +30,8 @@ import "../inputs/reactHookForm/numbers/RangeInput.js";
|
|
|
27
30
|
import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
|
|
28
31
|
import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
|
|
29
32
|
import "@react-querybuilder/material";
|
|
30
|
-
import "./expert/expertFilterConstants.js";
|
|
31
33
|
import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
32
|
-
import "uuid";
|
|
33
34
|
import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
34
|
-
import "react-querybuilder";
|
|
35
35
|
const filterStyles = {
|
|
36
36
|
textField: {
|
|
37
37
|
minWidth: "250px",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from "react";
|
|
3
|
-
import { formatQuery } from "react-querybuilder";
|
|
3
|
+
import { formatQuery } from "react-querybuilder/formatQuery";
|
|
4
4
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
5
5
|
import * as yup from "yup";
|
|
6
6
|
import { v4 } from "uuid";
|
|
@@ -12,3 +12,4 @@ export declare const queryValidator: QueryValidator;
|
|
|
12
12
|
export declare const testQuery: (check: string, query: RuleGroupTypeAny) => boolean;
|
|
13
13
|
export declare function getNumberOfSiblings(path: number[], query: RuleGroupTypeAny): number;
|
|
14
14
|
export declare function recursiveRemove(query: RuleGroupTypeAny, path: number[]): RuleGroupTypeAny;
|
|
15
|
+
export declare function getFilterEquipmentTypeLabel(equipmentType: string | undefined): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultOperators, getParentPath, findPath, remove } from "react-querybuilder";
|
|
2
2
|
import { validate } from "uuid";
|
|
3
3
|
import { DataType } from "./expertFilter.type.js";
|
|
4
|
-
import { OPERATOR_OPTIONS, RULES, FIELDS_OPTIONS } from "./expertFilterConstants.js";
|
|
4
|
+
import { OPERATOR_OPTIONS, RULES, FIELDS_OPTIONS, EXPERT_FILTER_EQUIPMENTS } from "./expertFilterConstants.js";
|
|
5
5
|
import { isBlankOrEmpty, convertOutputValue, convertInputValue } from "../../../utils/conversionUtils.js";
|
|
6
6
|
import { FieldType } from "../../../utils/types/fieldType.js";
|
|
7
7
|
const searchTree = (tree, key, value) => {
|
|
@@ -362,9 +362,17 @@ function recursiveRemove(query, path) {
|
|
|
362
362
|
}
|
|
363
363
|
return remove(query, path);
|
|
364
364
|
}
|
|
365
|
+
function getFilterEquipmentTypeLabel(equipmentType) {
|
|
366
|
+
var _a;
|
|
367
|
+
if (!equipmentType) {
|
|
368
|
+
return "";
|
|
369
|
+
}
|
|
370
|
+
return ((_a = EXPERT_FILTER_EQUIPMENTS[equipmentType]) == null ? void 0 : _a.label) ?? "";
|
|
371
|
+
}
|
|
365
372
|
export {
|
|
366
373
|
countRules,
|
|
367
374
|
exportExpertRules,
|
|
375
|
+
getFilterEquipmentTypeLabel,
|
|
368
376
|
getNumberOfSiblings,
|
|
369
377
|
getOperators,
|
|
370
378
|
importExpertRules,
|
|
@@ -2,7 +2,7 @@ import { ExpertFilterEditionDialog } from "./ExpertFilterEditionDialog.js";
|
|
|
2
2
|
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./ExpertFilterForm.js";
|
|
3
3
|
import { CombinatorType, DataType, OperatorType } from "./expertFilter.type.js";
|
|
4
4
|
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./expertFilterConstants.js";
|
|
5
|
-
import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expertFilterUtils.js";
|
|
5
|
+
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expertFilterUtils.js";
|
|
6
6
|
export {
|
|
7
7
|
COMBINATOR_OPTIONS,
|
|
8
8
|
CONVERTERS_MODE_OPTIONS,
|
|
@@ -28,6 +28,7 @@ export {
|
|
|
28
28
|
expertFilterSchema,
|
|
29
29
|
exportExpertRules,
|
|
30
30
|
getExpertFilterEmptyFormData,
|
|
31
|
+
getFilterEquipmentTypeLabel,
|
|
31
32
|
getNumberOfSiblings,
|
|
32
33
|
getOperators,
|
|
33
34
|
importExpertRules,
|
|
@@ -7,7 +7,7 @@ import { ExpertFilterEditionDialog } from "./expert/ExpertFilterEditionDialog.js
|
|
|
7
7
|
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./expert/ExpertFilterForm.js";
|
|
8
8
|
import { CombinatorType, DataType, OperatorType } from "./expert/expertFilter.type.js";
|
|
9
9
|
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./expert/expertFilterConstants.js";
|
|
10
|
-
import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expert/expertFilterUtils.js";
|
|
10
|
+
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expert/expertFilterUtils.js";
|
|
11
11
|
import { ExplicitNamingFilterEditionDialog } from "./explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
12
12
|
import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./explicitNaming/ExplicitNamingFilterForm.js";
|
|
13
13
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicitNaming/ExplicitNamingFilterConstants.js";
|
|
@@ -53,6 +53,7 @@ export {
|
|
|
53
53
|
getCriteriaBasedSchema,
|
|
54
54
|
getExpertFilterEmptyFormData,
|
|
55
55
|
getExplicitNamingFilterEmptyFormData,
|
|
56
|
+
getFilterEquipmentTypeLabel,
|
|
56
57
|
getNumberOfSiblings,
|
|
57
58
|
getOperators,
|
|
58
59
|
importExpertRules,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SxStyle } from '../../utils/styles';
|
|
2
2
|
export interface GridSectionProps {
|
|
3
3
|
title: string;
|
|
4
4
|
heading?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
size?: number;
|
|
6
|
-
customStyle?:
|
|
6
|
+
customStyle?: SxStyle;
|
|
7
7
|
}
|
|
8
8
|
export default function GridSection({ title, heading, size, customStyle }: Readonly<GridSectionProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { ExportCsvButton } from "./csvDownloader/export-csv-button.js";
|
|
|
19
19
|
import { useCsvExport } from "./csvDownloader/use-csv-export.js";
|
|
20
20
|
import { CUSTOM_AGGRID_THEME, styles } from "./customAGGrid/customAggrid.style.js";
|
|
21
21
|
import { CustomAGGrid } from "./customAGGrid/customAggrid.js";
|
|
22
|
+
import { SeparatorCellRenderer } from "./customAGGrid/separatorCellRenderer.js";
|
|
22
23
|
import { CustomMuiDialog, unscrollableDialogStyles } from "./dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
23
24
|
import { DescriptionModificationDialog } from "./dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
24
25
|
import { ElementSaveDialog } from "./dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
@@ -44,7 +45,7 @@ import { ExpertFilterEditionDialog } from "./filter/expert/ExpertFilterEditionDi
|
|
|
44
45
|
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./filter/expert/ExpertFilterForm.js";
|
|
45
46
|
import { CombinatorType, DataType, OperatorType } from "./filter/expert/expertFilter.type.js";
|
|
46
47
|
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./filter/expert/expertFilterConstants.js";
|
|
47
|
-
import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./filter/expert/expertFilterUtils.js";
|
|
48
|
+
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./filter/expert/expertFilterUtils.js";
|
|
48
49
|
import { ExplicitNamingFilterEditionDialog } from "./filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
49
50
|
import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
50
51
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./filter/explicitNaming/ExplicitNamingFilterConstants.js";
|
|
@@ -428,6 +429,7 @@ export {
|
|
|
428
429
|
SensitivityAnalysisParametersDialog,
|
|
429
430
|
SensitivityAnalysisParametersInline,
|
|
430
431
|
SensitivityTable,
|
|
432
|
+
SeparatorCellRenderer,
|
|
431
433
|
ShortCircuitParametersEditionDialog,
|
|
432
434
|
ShortCircuitParametersInLine,
|
|
433
435
|
SignInCallbackHandler,
|
|
@@ -487,6 +489,7 @@ export {
|
|
|
487
489
|
getCriteriaBasedSchema,
|
|
488
490
|
getExpertFilterEmptyFormData,
|
|
489
491
|
getExplicitNamingFilterEmptyFormData,
|
|
492
|
+
getFilterEquipmentTypeLabel,
|
|
490
493
|
getLimitReductionsFormSchema,
|
|
491
494
|
getNumberOfSiblings,
|
|
492
495
|
getOperators,
|
|
@@ -12,9 +12,10 @@ export interface DirectoryItemsInputProps {
|
|
|
12
12
|
disable?: boolean;
|
|
13
13
|
allowMultiSelect?: boolean;
|
|
14
14
|
labelRequiredFromContext?: boolean;
|
|
15
|
+
equipmentColorsMap?: Map<string, string>;
|
|
15
16
|
}
|
|
16
17
|
export declare function DirectoryItemsInput({ label, name, elementType, // Used to specify type of element (Filter, Contingency list, ...)
|
|
17
18
|
equipmentTypes, // Mostly used for filters, it allows the user to get elements of specific equipment only
|
|
18
19
|
itemFilter, // Used to further filter the results displayed according to specific requirement
|
|
19
20
|
titleId, // title of directory item selector dialogue
|
|
20
|
-
hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, }: Readonly<DirectoryItemsInputProps>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, equipmentColorsMap, }: Readonly<DirectoryItemsInputProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FormControl, Chip, Grid, Tooltip, IconButton } from "@mui/material";
|
|
2
|
+
import { FormControl, Box, Chip, FormHelperText, Grid, Tooltip, IconButton } from "@mui/material";
|
|
3
3
|
import { Folder } from "@mui/icons-material";
|
|
4
4
|
import { useState, useMemo, useCallback } from "react";
|
|
5
5
|
import { useFieldArray, useController } from "react-hook-form";
|
|
6
|
-
import { useIntl } from "react-intl";
|
|
6
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
7
7
|
import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
|
|
8
8
|
import { FieldLabel } from "./utils/FieldLabel.js";
|
|
9
|
-
import { useCustomFormContext } from "./provider/useCustomFormContext.js";
|
|
10
9
|
import { isFieldRequired } from "./utils/functions.js";
|
|
10
|
+
import "./provider/CustomFormProvider.js";
|
|
11
|
+
import { useCustomFormContext } from "./provider/useCustomFormContext.js";
|
|
11
12
|
import { ErrorInput } from "./errorManagement/ErrorInput.js";
|
|
13
|
+
import { MidFormError } from "./errorManagement/MidFormError.js";
|
|
14
|
+
import "../../../utils/types/equipmentType.js";
|
|
15
|
+
import { fetchDirectoryElementPath } from "../../../services/directory.js";
|
|
16
|
+
import "localized-countries";
|
|
17
|
+
import "localized-countries/data/fr";
|
|
18
|
+
import "localized-countries/data/en";
|
|
12
19
|
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
13
|
-
import { mergeSx } from "../../../utils/styles.js";
|
|
14
20
|
import { OverflowableText } from "../../overflowableText/OverflowableText.js";
|
|
15
|
-
import { MidFormError } from "./errorManagement/MidFormError.js";
|
|
16
21
|
import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
|
|
17
|
-
import
|
|
22
|
+
import "../../../utils/conversionUtils.js";
|
|
23
|
+
import { mergeSx } from "../../../utils/styles.js";
|
|
24
|
+
import "../../../utils/yupConfig.js";
|
|
18
25
|
import { NAME } from "./constants.js";
|
|
26
|
+
import { getFilterEquipmentTypeLabel } from "../../filter/expert/expertFilterUtils.js";
|
|
19
27
|
const styles = {
|
|
20
28
|
formDirectoryElements1: {
|
|
21
29
|
display: "flex",
|
|
@@ -59,7 +67,8 @@ function DirectoryItemsInput({
|
|
|
59
67
|
onChange,
|
|
60
68
|
disable = false,
|
|
61
69
|
allowMultiSelect = true,
|
|
62
|
-
labelRequiredFromContext = true
|
|
70
|
+
labelRequiredFromContext = true,
|
|
71
|
+
equipmentColorsMap
|
|
63
72
|
}) {
|
|
64
73
|
const { snackError } = useSnackMessage();
|
|
65
74
|
const intl = useIntl();
|
|
@@ -156,22 +165,42 @@ function DirectoryItemsInput({
|
|
|
156
165
|
optional: labelRequiredFromContext && !isFieldRequired(name, validationSchema, getValues())
|
|
157
166
|
}
|
|
158
167
|
),
|
|
159
|
-
(elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) =>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
(elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => {
|
|
169
|
+
var _a, _b, _c;
|
|
170
|
+
return /* @__PURE__ */ jsxs(
|
|
171
|
+
Box,
|
|
172
|
+
{
|
|
173
|
+
sx: { display: "flex", alignItems: "center", flexDirection: "column", gap: 1 },
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ jsx(
|
|
176
|
+
Chip,
|
|
177
|
+
{
|
|
178
|
+
size: "small",
|
|
179
|
+
sx: {
|
|
180
|
+
backgroundColor: ((_a = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _a.equipmentType) && (equipmentColorsMap == null ? void 0 : equipmentColorsMap.get((_b = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _b.equipmentType))
|
|
181
|
+
},
|
|
182
|
+
onDelete: () => removeElements(index),
|
|
183
|
+
onClick: () => handleChipClick(index),
|
|
184
|
+
label: /* @__PURE__ */ jsx(
|
|
185
|
+
OverflowableText,
|
|
186
|
+
{
|
|
187
|
+
text: getValues(`${name}.${index}.${NAME}`) ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
|
|
188
|
+
sx: { width: "100%" }
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
equipmentColorsMap && /* @__PURE__ */ jsx(FormHelperText, { children: ((_c = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _c.equipmentType) ? /* @__PURE__ */ jsx(
|
|
194
|
+
FormattedMessage,
|
|
195
|
+
{
|
|
196
|
+
id: getFilterEquipmentTypeLabel(item.specificMetadata.equipmentType)
|
|
197
|
+
}
|
|
198
|
+
) : "" })
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
item.id
|
|
202
|
+
);
|
|
203
|
+
}) }),
|
|
175
204
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(Grid, { container: true, direction: "row-reverse", children: /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: titleId }), children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
176
205
|
IconButton,
|
|
177
206
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { FormControl, Chip, TextField } from "@mui/material";
|
|
3
|
-
import { useState, useCallback } from "react";
|
|
3
|
+
import { useState, useCallback, useMemo } from "react";
|
|
4
4
|
import { useFieldArray, useController } from "react-hook-form";
|
|
5
5
|
import "react-intl";
|
|
6
6
|
import "../../../utils/types/equipmentType.js";
|
|
@@ -19,6 +19,26 @@ import { OverflowableText } from "../../overflowableText/OverflowableText.js";
|
|
|
19
19
|
import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
|
|
20
20
|
import { ErrorInput } from "./errorManagement/ErrorInput.js";
|
|
21
21
|
import { MidFormError } from "./errorManagement/MidFormError.js";
|
|
22
|
+
const styles = {
|
|
23
|
+
chipContainer: {
|
|
24
|
+
display: "flex",
|
|
25
|
+
gap: "8px",
|
|
26
|
+
flexWrap: "wrap",
|
|
27
|
+
flexDirection: "row",
|
|
28
|
+
border: "2px solid lightgray",
|
|
29
|
+
borderRadius: "4px",
|
|
30
|
+
overflow: "hidden"
|
|
31
|
+
},
|
|
32
|
+
chipItem: {
|
|
33
|
+
display: "flex",
|
|
34
|
+
gap: "8px",
|
|
35
|
+
flexWrap: "wrap",
|
|
36
|
+
flexDirection: "row",
|
|
37
|
+
marginTop: 0,
|
|
38
|
+
padding: 1,
|
|
39
|
+
overflow: "hidden"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
22
42
|
function ChipItemsInput({ label, name, hideErrorMessage }) {
|
|
23
43
|
const [textEntered, setTextEntered] = useState("");
|
|
24
44
|
const { snackError } = useSnackMessage();
|
|
@@ -63,29 +83,13 @@ function ChipItemsInput({ label, name, hideErrorMessage }) {
|
|
|
63
83
|
const handleChange = (e) => {
|
|
64
84
|
setTextEntered(e.target.value);
|
|
65
85
|
};
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
flexDirection: "row",
|
|
72
|
-
border: "2px solid lightgray",
|
|
73
|
-
borderRadius: "4px",
|
|
74
|
-
overflow: "hidden",
|
|
75
|
-
borderColor: (error == null ? void 0 : error.message) ? "error.main" : null
|
|
76
|
-
},
|
|
77
|
-
chipItem: {
|
|
78
|
-
display: "flex",
|
|
79
|
-
gap: "8px",
|
|
80
|
-
flexWrap: "wrap",
|
|
81
|
-
flexDirection: "row",
|
|
82
|
-
marginTop: 0,
|
|
83
|
-
padding: 1,
|
|
84
|
-
overflow: "hidden"
|
|
85
|
-
}
|
|
86
|
-
};
|
|
86
|
+
const hasError = !!(error == null ? void 0 : error.message);
|
|
87
|
+
const containerStyle = useMemo(
|
|
88
|
+
() => ({ ...styles.chipContainer, borderColor: hasError ? "error.main" : null }),
|
|
89
|
+
[hasError]
|
|
90
|
+
);
|
|
87
91
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
-
/* @__PURE__ */ jsxs(FormControl, { sx:
|
|
92
|
+
/* @__PURE__ */ jsxs(FormControl, { sx: containerStyle, error: hasError, children: [
|
|
89
93
|
(elements == null ? void 0 : elements.length) === 0 && label && /* @__PURE__ */ jsx(FieldLabel, { label, optional: !isFieldRequired(name, validationSchema, getValues()) }),
|
|
90
94
|
(elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.chipItem, children: elements.map((item, index) => /* @__PURE__ */ jsx(
|
|
91
95
|
Chip,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SxStyle } from '../../../../utils/styles';
|
|
2
2
|
export interface DescriptionFieldProps {
|
|
3
|
-
expandingTextSx?:
|
|
3
|
+
expandingTextSx?: SxStyle;
|
|
4
4
|
}
|
|
5
5
|
export declare function DescriptionField({ expandingTextSx }: Readonly<DescriptionFieldProps>): import("react/jsx-runtime").JSX.Element;
|