@gridsuite/commons-ui 0.257.0 → 0.259.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/composite/filter/FilterForm.js +10 -0
- package/dist/components/composite/filter/HeaderFilterForm.d.ts +0 -10
- package/dist/components/composite/filter/HeaderFilterForm.js +4 -14
- package/dist/components/composite/filter/expert/ExpertFilterForm.js +3 -3
- package/dist/components/index.js +8 -0
- package/dist/components/ui/dialogs/index.d.ts +1 -0
- package/dist/components/ui/dialogs/index.js +8 -0
- package/dist/{features/parameters/common → components/ui/dialogs}/name-element-editor/index.d.ts +2 -1
- package/dist/components/ui/dialogs/name-element-editor/index.js +10 -0
- package/dist/{features/parameters/common → components/ui/dialogs}/name-element-editor/name-element-editor-form.js +5 -5
- package/dist/{features/parameters/common → components/ui/dialogs}/name-element-editor/name-element-editor-utils.d.ts +13 -3
- package/dist/{features/parameters/common → components/ui/dialogs}/name-element-editor/name-element-editor-utils.js +27 -22
- package/dist/components/ui/dialogs/name-element-editor/named-element-edition-dialog.d.ts +17 -0
- package/dist/components/ui/dialogs/name-element-editor/named-element-edition-dialog.js +49 -0
- package/dist/components/ui/index.js +8 -0
- package/dist/features/global-filter/context/global-filter-context-provider.d.ts +2 -0
- package/dist/features/global-filter/context/global-filter-context-provider.js +41 -0
- package/dist/features/global-filter/context/global-filter-context.d.ts +3 -0
- package/dist/features/global-filter/context/global-filter-context.js +13 -0
- package/dist/features/global-filter/context/global-filter-context.type.d.ts +14 -0
- package/dist/features/global-filter/context/global-filter-context.type.js +1 -0
- package/dist/features/global-filter/context/index.d.ts +8 -0
- package/dist/features/global-filter/context/index.js +4 -0
- package/dist/features/global-filter/global-filter.style.d.ts +162 -0
- package/dist/features/global-filter/global-filter.style.js +190 -0
- package/dist/features/global-filter/index.d.ts +10 -0
- package/dist/features/global-filter/index.js +31 -0
- package/dist/features/global-filter/types/global-filter.type.d.ts +51 -0
- package/dist/features/global-filter/types/global-filter.type.js +19 -0
- package/dist/features/global-filter/types/index.d.ts +8 -0
- package/dist/features/global-filter/types/index.js +8 -0
- package/dist/features/global-filter/types/limit-violation.type.d.ts +11 -0
- package/dist/features/global-filter/types/limit-violation.type.js +9 -0
- package/dist/features/global-filter/ui/global-filter-dropdown-panel.d.ts +10 -0
- package/dist/features/global-filter/ui/global-filter-dropdown-panel.js +251 -0
- package/dist/features/global-filter/ui/global-filter-panel.d.ts +9 -0
- package/dist/features/global-filter/ui/global-filter-panel.js +391 -0
- package/dist/features/global-filter/ui/label-with-info-tooltip.d.ts +12 -0
- package/dist/features/global-filter/ui/label-with-info-tooltip.js +24 -0
- package/dist/features/global-filter/ui/selected-global-filters.d.ts +4 -0
- package/dist/features/global-filter/ui/selected-global-filters.js +114 -0
- package/dist/features/global-filter/utils/build-valid-global-filters.d.ts +8 -0
- package/dist/features/global-filter/utils/build-valid-global-filters.js +51 -0
- package/dist/features/global-filter/utils/editing-global-filter-sync.d.ts +9 -0
- package/dist/features/global-filter/utils/editing-global-filter-sync.js +15 -0
- package/dist/features/global-filter/utils/global-filter-state.utils.d.ts +14 -0
- package/dist/features/global-filter/utils/global-filter-state.utils.js +71 -0
- package/dist/features/global-filter/utils/global-filter-sync.utils.d.ts +9 -0
- package/dist/features/global-filter/utils/global-filter-sync.utils.js +26 -0
- package/dist/features/global-filter/utils/global-filter-utils.d.ts +7 -0
- package/dist/features/global-filter/utils/global-filter-utils.js +44 -0
- package/dist/features/global-filter/utils/index.d.ts +11 -0
- package/dist/features/global-filter/utils/index.js +21 -0
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.js +42 -8
- package/dist/features/network-modification-table/renderers/description-cell.js +4 -0
- package/dist/features/parameters/common/hook/use-parameters-form.js +1 -2
- package/dist/features/parameters/common/parameters-creation-dialog.js +9 -0
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +0 -1
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +0 -1
- package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +0 -1
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +0 -1
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +0 -1
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +0 -1
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +0 -1
- package/dist/features/parameters/dynamic-simulation/mapping/mapping-parameters.js +0 -1
- package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +0 -1
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +0 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-content.js +0 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +4 -8
- package/dist/features/parameters/loadflow/load-flow-parameters-header.js +0 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +0 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +0 -1
- package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +0 -1
- package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +1 -2
- package/dist/features/parameters/network-visualizations/network-visualizations-form.js +0 -1
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +3 -7
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +0 -1
- package/dist/features/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -2
- package/dist/features/parameters/pcc-min/pcc-min-parameters-dialog.js +1 -5
- package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +0 -1
- package/dist/features/parameters/pcc-min/use-pcc-min-parameters-form.js +1 -2
- package/dist/features/parameters/security-analysis/columns-definitions.js +1 -2
- package/dist/features/parameters/security-analysis/security-analysis-parameters-content.js +0 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +2 -6
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +0 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +0 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-utils.js +0 -1
- package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -2
- package/dist/features/parameters/sensi/columns-definitions.js +0 -1
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +1 -5
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +0 -1
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +0 -1
- package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +0 -1
- package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -2
- package/dist/features/parameters/sensi/utils.js +1 -2
- package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +0 -1
- package/dist/features/parameters/short-circuit/short-circuit-parameters-content.js +0 -1
- package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +1 -5
- package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +0 -1
- package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +0 -1
- package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +0 -1
- package/dist/features/parameters/short-circuit/short-circuit-study-area-tab-panel.js +0 -1
- package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -2
- package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +0 -1
- package/dist/features/parameters/voltage-init/general-parameters.js +0 -1
- package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -2
- package/dist/features/parameters/voltage-init/voltage-init-parameters-dialog.js +1 -5
- package/dist/features/parameters/voltage-init/voltage-init-parameters-form.js +0 -1
- package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +0 -1
- package/dist/features/process-configs/common/index.d.ts +9 -0
- package/dist/features/process-configs/common/index.js +11 -0
- package/dist/features/process-configs/common/process-config-modifications-edition.d.ts +3 -0
- package/dist/features/process-configs/common/process-config-modifications-edition.js +129 -0
- package/dist/features/process-configs/common/process-config-modifications-edition.utils.d.ts +53 -0
- package/dist/features/process-configs/common/process-config-modifications-edition.utils.js +50 -0
- package/dist/features/process-configs/common/process-config.type.d.ts +14 -0
- package/dist/features/process-configs/index.d.ts +6 -3
- package/dist/features/process-configs/index.js +13 -8
- package/dist/features/process-configs/lf-process-config-edition-dialog.d.ts +3 -0
- package/dist/features/process-configs/lf-process-config-edition-dialog.js +136 -0
- package/dist/features/process-configs/loadflow/index.d.ts +9 -0
- package/dist/features/process-configs/loadflow/index.js +9 -0
- package/dist/features/process-configs/loadflow/lf-process-config-edition.d.ts +1 -0
- package/dist/features/process-configs/loadflow/lf-process-config-edition.js +91 -0
- package/dist/features/process-configs/loadflow/lf-process-config-edition.utils.d.ts +39 -0
- package/dist/features/process-configs/{security-analysis/update-sa-process-config-dialog.js → loadflow/lf-process-config-edition.utils.js} +53 -81
- package/dist/features/process-configs/loadflow/lf-process-config.type.d.ts +6 -0
- package/dist/features/process-configs/loadflow/lf-process-config.type.js +1 -0
- package/dist/features/process-configs/process-config-edition.utils.d.ts +13 -0
- package/dist/features/process-configs/process-config-edition.utils.js +1 -0
- package/dist/features/process-configs/process-config.type.d.ts +14 -0
- package/dist/features/process-configs/process-config.type.js +1 -0
- package/dist/features/process-configs/process-config.utils.d.ts +2 -0
- package/dist/features/process-configs/{update-process-config-modifications.js → process-config.utils.js} +11 -74
- package/dist/features/process-configs/sa-process-config-edition-dialog.d.ts +3 -0
- package/dist/features/process-configs/sa-process-config-edition-dialog.js +136 -0
- package/dist/features/process-configs/security-analysis/index.d.ts +4 -3
- package/dist/features/process-configs/security-analysis/index.js +7 -8
- package/dist/features/process-configs/security-analysis/sa-process-config-edition.d.ts +1 -0
- package/dist/features/process-configs/security-analysis/{update-sa-process-config.js → sa-process-config-edition.js} +5 -13
- package/dist/features/process-configs/security-analysis/sa-process-config-edition.utils.d.ts +45 -0
- package/dist/features/process-configs/security-analysis/sa-process-config-edition.utils.js +119 -0
- package/dist/features/process-configs/security-analysis/sa-process-config.type.d.ts +7 -0
- package/dist/features/process-configs/security-analysis/sa-process-config.type.js +1 -0
- package/dist/index.js +52 -9
- package/dist/translations/en/processConfigEn.d.ts +3 -0
- package/dist/translations/en/processConfigEn.js +5 -2
- package/dist/translations/fr/processConfigFr.d.ts +3 -0
- package/dist/translations/fr/processConfigFr.js +5 -2
- package/dist/utils/index.js +2 -1
- package/dist/utils/types/index.js +2 -1
- package/dist/utils/types/types.d.ts +10 -0
- package/dist/utils/types/types.js +8 -1
- package/package.json +1 -1
- package/dist/features/parameters/common/name-element-editor/index.js +0 -7
- package/dist/features/process-configs/process-configs.type.d.ts +0 -33
- package/dist/features/process-configs/security-analysis/update-sa-process-config-dialog.d.ts +0 -14
- package/dist/features/process-configs/security-analysis/update-sa-process-config.d.ts +0 -7
- package/dist/features/process-configs/security-analysis/update-sa-process-configs-utils.d.ts +0 -68
- package/dist/features/process-configs/security-analysis/update-sa-process-configs-utils.js +0 -88
- package/dist/features/process-configs/update-process-config-modifications.d.ts +0 -3
- /package/dist/{features/parameters/common → components/ui/dialogs}/name-element-editor/name-element-editor-form.d.ts +0 -0
- /package/dist/features/process-configs/{process-configs.type.js → common/process-config.type.js} +0 -0
|
@@ -20,6 +20,16 @@ import "localized-countries/data/en";
|
|
|
20
20
|
import "notistack";
|
|
21
21
|
import "@hello-pangea/dnd";
|
|
22
22
|
import "../../ui/overflowableText/OverflowableText.js";
|
|
23
|
+
import "../../ui/reactHookForm/provider/CustomFormProvider.js";
|
|
24
|
+
import "yup";
|
|
25
|
+
import "../../ui/reactHookForm/numbers/RangeInput.js";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
27
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
29
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
31
|
+
import "../../ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
32
|
+
import "../../ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
23
33
|
function FilterForm({
|
|
24
34
|
sourceFilterForExplicitNamingConversion,
|
|
25
35
|
creation,
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
2
|
import * as yup from 'yup';
|
|
3
|
-
export declare const filterStyles: {
|
|
4
|
-
readonly textField: {
|
|
5
|
-
readonly minWidth: "250px";
|
|
6
|
-
readonly width: "33%";
|
|
7
|
-
};
|
|
8
|
-
readonly description: {
|
|
9
|
-
readonly minWidth: "250px";
|
|
10
|
-
readonly width: "50%";
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
3
|
export declare const HeaderFilterSchema: {
|
|
14
4
|
name: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
15
5
|
equipmentType: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
@@ -31,20 +31,11 @@ import "../../ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
|
31
31
|
import "../../ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
32
32
|
import "@hello-pangea/dnd";
|
|
33
33
|
import "../../ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
34
|
+
import { elementEditionStyles } from "../../ui/dialogs/name-element-editor/name-element-editor-utils.js";
|
|
34
35
|
import "../../ui/snackbarProvider/SnackbarProvider.js";
|
|
35
36
|
import "mui-nested-menu";
|
|
36
37
|
import "react-resizable-panels";
|
|
37
38
|
import "react-papaparse";
|
|
38
|
-
const filterStyles = {
|
|
39
|
-
textField: {
|
|
40
|
-
minWidth: "250px",
|
|
41
|
-
width: "33%"
|
|
42
|
-
},
|
|
43
|
-
description: {
|
|
44
|
-
minWidth: "250px",
|
|
45
|
-
width: "50%"
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
39
|
const HeaderFilterSchema = {
|
|
49
40
|
[FieldConstants.NAME]: yup.string().trim().required(NAME_EMPTY),
|
|
50
41
|
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
@@ -60,15 +51,14 @@ function HeaderFilterForm({ creation, activeDirectory }) {
|
|
|
60
51
|
elementType: ElementType.FILTER,
|
|
61
52
|
autoFocus: creation,
|
|
62
53
|
activeDirectory,
|
|
63
|
-
sx:
|
|
54
|
+
sx: elementEditionStyles.textField,
|
|
64
55
|
fullWidth: false
|
|
65
56
|
}
|
|
66
57
|
) }),
|
|
67
|
-
/* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx:
|
|
58
|
+
/* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: elementEditionStyles.description }) })
|
|
68
59
|
] });
|
|
69
60
|
}
|
|
70
61
|
export {
|
|
71
62
|
HeaderFilterForm,
|
|
72
|
-
HeaderFilterSchema
|
|
73
|
-
filterStyles
|
|
63
|
+
HeaderFilterSchema
|
|
74
64
|
};
|
|
@@ -27,9 +27,9 @@ import "notistack";
|
|
|
27
27
|
import { useFormatLabelWithUnit } from "../../../../hooks/useFormatLabelWithUnit.js";
|
|
28
28
|
import "@hello-pangea/dnd";
|
|
29
29
|
import "../../../ui/overflowableText/OverflowableText.js";
|
|
30
|
-
import { filterStyles } from "../HeaderFilterForm.js";
|
|
31
|
-
import "../../../ui/reactHookForm/provider/CustomFormProvider.js";
|
|
32
30
|
import { useCustomFormContext } from "../../../ui/reactHookForm/provider/useCustomFormContext.js";
|
|
31
|
+
import { elementEditionStyles } from "../../../ui/dialogs/name-element-editor/name-element-editor-utils.js";
|
|
32
|
+
import "../../../ui/reactHookForm/provider/CustomFormProvider.js";
|
|
33
33
|
import "../../../ui/reactHookForm/numbers/RangeInput.js";
|
|
34
34
|
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
35
35
|
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
@@ -105,7 +105,7 @@ function ExpertFilterForm({ isEditing }) {
|
|
|
105
105
|
onValueChange: resetOnTypeChange,
|
|
106
106
|
message: "changeTypeMessage",
|
|
107
107
|
validateButtonLabel: "button.changeType",
|
|
108
|
-
sx:
|
|
108
|
+
sx: elementEditionStyles.textField,
|
|
109
109
|
"data-testid": "EquipmentTypeSelector"
|
|
110
110
|
}
|
|
111
111
|
) }),
|
package/dist/components/index.js
CHANGED
|
@@ -58,6 +58,9 @@ import { initializeDirectory } from "./ui/dialogs/elementSaveDialog/utils.js";
|
|
|
58
58
|
import { ModifyElementSelection } from "./ui/dialogs/modifyElementSelection/ModifyElementSelection.js";
|
|
59
59
|
import { PopupConfirmationDialog } from "./ui/dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
|
|
60
60
|
import { MultipleSelectionDialog } from "./ui/dialogs/multipleSelectionDialog/MultipleSelectionDialog.js";
|
|
61
|
+
import { NameElementEditorForm } from "./ui/dialogs/name-element-editor/name-element-editor-form.js";
|
|
62
|
+
import { elementEditionStyles, getNameElementEditorEmptyFormData, getNameElementEditorSchema } from "./ui/dialogs/name-element-editor/name-element-editor-utils.js";
|
|
63
|
+
import { NamedElementEditionDialog } from "./ui/dialogs/name-element-editor/named-element-edition-dialog.js";
|
|
61
64
|
import { OverflowableText } from "./ui/overflowableText/OverflowableText.js";
|
|
62
65
|
import { SnackbarProvider } from "./ui/snackbarProvider/SnackbarProvider.js";
|
|
63
66
|
import { CustomTooltip } from "./ui/tooltip/CustomTooltip.js";
|
|
@@ -284,6 +287,8 @@ export {
|
|
|
284
287
|
MultipleSelectionDialog,
|
|
285
288
|
NAME,
|
|
286
289
|
NETWORK_MODIFICATION,
|
|
290
|
+
NameElementEditorForm,
|
|
291
|
+
NamedElementEditionDialog,
|
|
287
292
|
NetworkModificationNameCellRenderer,
|
|
288
293
|
NumericCellRenderer,
|
|
289
294
|
NumericEditor,
|
|
@@ -345,6 +350,7 @@ export {
|
|
|
345
350
|
countRules,
|
|
346
351
|
directoryItemSchema,
|
|
347
352
|
doesNodeHasChildren,
|
|
353
|
+
elementEditionStyles,
|
|
348
354
|
expertFilterSchema,
|
|
349
355
|
explicitNamingFilterSchema,
|
|
350
356
|
exportExpertRules,
|
|
@@ -358,6 +364,8 @@ export {
|
|
|
358
364
|
getDefaultSeverityFilter,
|
|
359
365
|
getExpertFilterEmptyFormData,
|
|
360
366
|
getExplicitNamingFilterEmptyFormData,
|
|
367
|
+
getNameElementEditorEmptyFormData,
|
|
368
|
+
getNameElementEditorSchema,
|
|
361
369
|
getNumberOfSiblings,
|
|
362
370
|
getOperators,
|
|
363
371
|
getRangeInputSchema,
|
|
@@ -5,13 +5,21 @@ import { initializeDirectory } from "./elementSaveDialog/utils.js";
|
|
|
5
5
|
import { ModifyElementSelection } from "./modifyElementSelection/ModifyElementSelection.js";
|
|
6
6
|
import { PopupConfirmationDialog } from "./popupConfirmationDialog/PopupConfirmationDialog.js";
|
|
7
7
|
import { MultipleSelectionDialog } from "./multipleSelectionDialog/MultipleSelectionDialog.js";
|
|
8
|
+
import { NameElementEditorForm } from "./name-element-editor/name-element-editor-form.js";
|
|
9
|
+
import { elementEditionStyles, getNameElementEditorEmptyFormData, getNameElementEditorSchema } from "./name-element-editor/name-element-editor-utils.js";
|
|
10
|
+
import { NamedElementEditionDialog } from "./name-element-editor/named-element-edition-dialog.js";
|
|
8
11
|
export {
|
|
9
12
|
CustomMuiDialog,
|
|
10
13
|
DescriptionModificationDialog,
|
|
11
14
|
ElementSaveDialog,
|
|
12
15
|
ModifyElementSelection,
|
|
13
16
|
MultipleSelectionDialog,
|
|
17
|
+
NameElementEditorForm,
|
|
18
|
+
NamedElementEditionDialog,
|
|
14
19
|
PopupConfirmationDialog,
|
|
20
|
+
elementEditionStyles,
|
|
21
|
+
getNameElementEditorEmptyFormData,
|
|
22
|
+
getNameElementEditorSchema,
|
|
15
23
|
initializeDirectory,
|
|
16
24
|
unscrollableDialogStyles
|
|
17
25
|
};
|
package/dist/{features/parameters/common → components/ui/dialogs}/name-element-editor/index.d.ts
RENAMED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2025, RTE (http://www.rte-france.com)
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
7
|
export * from './name-element-editor-form';
|
|
8
8
|
export * from './name-element-editor-utils';
|
|
9
|
+
export * from './named-element-edition-dialog';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NameElementEditorForm } from "./name-element-editor-form.js";
|
|
2
|
+
import { elementEditionStyles, getNameElementEditorEmptyFormData, getNameElementEditorSchema } from "./name-element-editor-utils.js";
|
|
3
|
+
import { NamedElementEditionDialog } from "./named-element-edition-dialog.js";
|
|
4
|
+
export {
|
|
5
|
+
NameElementEditorForm,
|
|
6
|
+
NamedElementEditionDialog,
|
|
7
|
+
elementEditionStyles,
|
|
8
|
+
getNameElementEditorEmptyFormData,
|
|
9
|
+
getNameElementEditorSchema
|
|
10
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Grid2, Stack } from "@mui/material";
|
|
3
|
-
import { DescriptionField } from "
|
|
4
|
-
import { UniqueNameInput } from "
|
|
3
|
+
import { DescriptionField } from "../../reactHookForm/text/DescriptionField.js";
|
|
4
|
+
import { UniqueNameInput } from "../../reactHookForm/text/UniqueNameInput.js";
|
|
5
5
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
6
6
|
import "../../../../utils/conversionUtils.js";
|
|
7
7
|
import "../../../../utils/types/equipmentType.js";
|
|
8
8
|
import "@mui/icons-material";
|
|
9
|
-
import {
|
|
9
|
+
import { elementEditionStyles } from "./name-element-editor-utils.js";
|
|
10
10
|
function NameElementEditorForm({
|
|
11
11
|
initialElementName,
|
|
12
12
|
activeDirectory,
|
|
@@ -21,11 +21,11 @@ function NameElementEditorForm({
|
|
|
21
21
|
label: "nameProperty",
|
|
22
22
|
elementType,
|
|
23
23
|
activeDirectory,
|
|
24
|
-
sx:
|
|
24
|
+
sx: elementEditionStyles.textField,
|
|
25
25
|
fullWidth: false
|
|
26
26
|
}
|
|
27
27
|
) }),
|
|
28
|
-
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx:
|
|
28
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: elementEditionStyles.description }) })
|
|
29
29
|
] }) });
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
@@ -5,9 +5,15 @@
|
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
7
|
import * as yup from 'yup';
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export declare const elementEditionStyles: {
|
|
9
|
+
readonly textField: {
|
|
10
|
+
readonly minWidth: "250px";
|
|
11
|
+
readonly width: "33%";
|
|
12
|
+
};
|
|
13
|
+
readonly description: {
|
|
14
|
+
readonly minWidth: "250px";
|
|
15
|
+
readonly width: "50%";
|
|
16
|
+
};
|
|
11
17
|
};
|
|
12
18
|
export declare function getNameElementEditorSchema(initialElementName: string | null): yup.ObjectSchema<{
|
|
13
19
|
name: string | null | undefined;
|
|
@@ -16,3 +22,7 @@ export declare function getNameElementEditorSchema(initialElementName: string |
|
|
|
16
22
|
name: undefined;
|
|
17
23
|
description: undefined;
|
|
18
24
|
}, "">;
|
|
25
|
+
export declare function getNameElementEditorEmptyFormData(initialElementName: string | null, initialElementDescription: string | null): {
|
|
26
|
+
name: string | null;
|
|
27
|
+
description: string | null;
|
|
28
|
+
};
|
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
import * as yup from "yup";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "@mui/material";
|
|
4
|
-
import "
|
|
5
|
-
import "react-intl";
|
|
6
|
-
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
4
|
+
import "../../overflowableText/OverflowableText.js";
|
|
7
5
|
import "../../../../utils/conversionUtils.js";
|
|
8
6
|
import "../../../../utils/types/equipmentType.js";
|
|
7
|
+
import "@mui/icons-material";
|
|
9
8
|
import "react";
|
|
10
9
|
import "react-hook-form";
|
|
10
|
+
import "react-intl";
|
|
11
11
|
import "localized-countries";
|
|
12
12
|
import "localized-countries/data/fr";
|
|
13
13
|
import "localized-countries/data/en";
|
|
14
14
|
import "notistack";
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import { DESCRIPTION, NAME } from "
|
|
18
|
-
import "
|
|
15
|
+
import "../../reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
17
|
+
import { DESCRIPTION, NAME } from "../../reactHookForm/constants.js";
|
|
18
|
+
import "../../reactHookForm/numbers/RangeInput.js";
|
|
19
19
|
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
20
20
|
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
21
21
|
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
22
22
|
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
23
23
|
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
}
|
|
24
|
+
import "../descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
25
|
+
import "../../reactHookForm/expandableInput/ExpandableInput.js";
|
|
26
|
+
import "../../reactHookForm/directory-item-input/directory-item-utils.js";
|
|
27
|
+
const elementEditionStyles = {
|
|
28
|
+
textField: {
|
|
29
|
+
minWidth: "250px",
|
|
30
|
+
width: "33%"
|
|
31
|
+
},
|
|
32
|
+
description: {
|
|
33
|
+
minWidth: "250px",
|
|
34
|
+
width: "50%"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
39
37
|
function getNameElementEditorSchema(initialElementName) {
|
|
40
38
|
return yup.object().shape({
|
|
41
39
|
[NAME]: yup.string().nullable().when("nameRequiredWhenInitialNameIsSet", {
|
|
@@ -46,7 +44,14 @@ function getNameElementEditorSchema(initialElementName) {
|
|
|
46
44
|
[DESCRIPTION]: yup.string().nullable()
|
|
47
45
|
});
|
|
48
46
|
}
|
|
47
|
+
function getNameElementEditorEmptyFormData(initialElementName, initialElementDescription) {
|
|
48
|
+
return {
|
|
49
|
+
[NAME]: initialElementName,
|
|
50
|
+
[DESCRIPTION]: initialElementDescription
|
|
51
|
+
};
|
|
52
|
+
}
|
|
49
53
|
export {
|
|
54
|
+
elementEditionStyles,
|
|
50
55
|
getNameElementEditorEmptyFormData,
|
|
51
56
|
getNameElementEditorSchema
|
|
52
57
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
4
|
+
import { ObjectSchema } from 'yup';
|
|
5
|
+
import { ElementType } from '../../../../utils';
|
|
6
|
+
import { CustomMuiDialogProps } from '../customMuiDialog/CustomMuiDialog';
|
|
7
|
+
type ElementEditionDialogProps<TFieldValues extends FieldValues> = Omit<CustomMuiDialogProps<TFieldValues>, 'formContext'> & {
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
directory: UUID;
|
|
10
|
+
elementName: string;
|
|
11
|
+
elementType: ElementType;
|
|
12
|
+
formMethods: UseFormReturn<TFieldValues>;
|
|
13
|
+
formSchema: ObjectSchema<TFieldValues>;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export declare function NamedElementEditionDialog<TFieldValues extends FieldValues>({ isLoading, directory, elementName, elementType, formMethods, formSchema, children, ...customMuiDialogProps }: Readonly<ElementEditionDialogProps<TFieldValues>>): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LinearProgress } from "@mui/material";
|
|
3
|
+
import "../../../../utils/conversionUtils.js";
|
|
4
|
+
import "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import { isDisabledValidationButton } from "../../../../utils/form-utils.js";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import { CustomMuiDialog } from "../customMuiDialog/CustomMuiDialog.js";
|
|
8
|
+
import { NameElementEditorForm } from "./name-element-editor-form.js";
|
|
9
|
+
function NamedElementEditionDialog({
|
|
10
|
+
isLoading,
|
|
11
|
+
directory,
|
|
12
|
+
elementName,
|
|
13
|
+
elementType,
|
|
14
|
+
formMethods,
|
|
15
|
+
formSchema,
|
|
16
|
+
children,
|
|
17
|
+
...customMuiDialogProps
|
|
18
|
+
}) {
|
|
19
|
+
const {
|
|
20
|
+
formState: { errors }
|
|
21
|
+
} = formMethods;
|
|
22
|
+
const disabledSave = isLoading || isDisabledValidationButton(errors);
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
CustomMuiDialog,
|
|
25
|
+
{
|
|
26
|
+
...customMuiDialogProps,
|
|
27
|
+
formContext: {
|
|
28
|
+
...formMethods,
|
|
29
|
+
validationSchema: formSchema,
|
|
30
|
+
removeOptional: true
|
|
31
|
+
},
|
|
32
|
+
disabledSave,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
NameElementEditorForm,
|
|
36
|
+
{
|
|
37
|
+
activeDirectory: directory,
|
|
38
|
+
elementType,
|
|
39
|
+
initialElementName: elementName
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
isLoading ? /* @__PURE__ */ jsx(LinearProgress, {}) : children
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
NamedElementEditionDialog
|
|
49
|
+
};
|
|
@@ -58,6 +58,9 @@ import { initializeDirectory } from "./dialogs/elementSaveDialog/utils.js";
|
|
|
58
58
|
import { ModifyElementSelection } from "./dialogs/modifyElementSelection/ModifyElementSelection.js";
|
|
59
59
|
import { PopupConfirmationDialog } from "./dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
|
|
60
60
|
import { MultipleSelectionDialog } from "./dialogs/multipleSelectionDialog/MultipleSelectionDialog.js";
|
|
61
|
+
import { NameElementEditorForm } from "./dialogs/name-element-editor/name-element-editor-form.js";
|
|
62
|
+
import { elementEditionStyles, getNameElementEditorEmptyFormData, getNameElementEditorSchema } from "./dialogs/name-element-editor/name-element-editor-utils.js";
|
|
63
|
+
import { NamedElementEditionDialog } from "./dialogs/name-element-editor/named-element-edition-dialog.js";
|
|
61
64
|
import { OverflowableText } from "./overflowableText/OverflowableText.js";
|
|
62
65
|
import { SnackbarProvider } from "./snackbarProvider/SnackbarProvider.js";
|
|
63
66
|
import { CustomTooltip } from "./tooltip/CustomTooltip.js";
|
|
@@ -140,6 +143,8 @@ export {
|
|
|
140
143
|
MultipleAutocompleteInput,
|
|
141
144
|
MultipleSelectionDialog,
|
|
142
145
|
NAME,
|
|
146
|
+
NameElementEditorForm,
|
|
147
|
+
NamedElementEditionDialog,
|
|
143
148
|
OverflowableChip,
|
|
144
149
|
OverflowableChipWithHelperText,
|
|
145
150
|
OverflowableText,
|
|
@@ -166,10 +171,13 @@ export {
|
|
|
166
171
|
VoltageUnitIcon,
|
|
167
172
|
directoryItemSchema,
|
|
168
173
|
doesNodeHasChildren,
|
|
174
|
+
elementEditionStyles,
|
|
169
175
|
fetchCsvSeparator,
|
|
170
176
|
genHelperError,
|
|
171
177
|
generateTreeViewFinderClass,
|
|
172
178
|
getAbsenceLabelKeyFromType,
|
|
179
|
+
getNameElementEditorEmptyFormData,
|
|
180
|
+
getNameElementEditorSchema,
|
|
173
181
|
getRangeInputSchema,
|
|
174
182
|
gridItem,
|
|
175
183
|
identity,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { GlobalFilterContextProviderProps } from './global-filter-context.type';
|
|
2
|
+
export declare function GlobalFilterContextProvider({ children, globalFilterOptions, selectedGlobalFilters, recentGlobalFilters, selectGlobalFilter, unselectGlobalFilters, clearSelectedGlobalFilters, removeGlobalFilterOption, addFiltersToGlobalFiltersOptions, }: Readonly<GlobalFilterContextProviderProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { GlobalFilterContext } from "./global-filter-context.js";
|
|
4
|
+
function GlobalFilterContextProvider({
|
|
5
|
+
children,
|
|
6
|
+
globalFilterOptions,
|
|
7
|
+
selectedGlobalFilters,
|
|
8
|
+
recentGlobalFilters,
|
|
9
|
+
selectGlobalFilter,
|
|
10
|
+
unselectGlobalFilters,
|
|
11
|
+
clearSelectedGlobalFilters,
|
|
12
|
+
removeGlobalFilterOption,
|
|
13
|
+
addFiltersToGlobalFiltersOptions
|
|
14
|
+
}) {
|
|
15
|
+
const value = useMemo(
|
|
16
|
+
() => ({
|
|
17
|
+
globalFilterOptions,
|
|
18
|
+
selectedGlobalFilters,
|
|
19
|
+
recentGlobalFilters,
|
|
20
|
+
selectGlobalFilter,
|
|
21
|
+
unselectGlobalFilters,
|
|
22
|
+
clearSelectedGlobalFilters,
|
|
23
|
+
removeGlobalFilterOption,
|
|
24
|
+
addFiltersToGlobalFiltersOptions
|
|
25
|
+
}),
|
|
26
|
+
[
|
|
27
|
+
globalFilterOptions,
|
|
28
|
+
selectedGlobalFilters,
|
|
29
|
+
recentGlobalFilters,
|
|
30
|
+
selectGlobalFilter,
|
|
31
|
+
unselectGlobalFilters,
|
|
32
|
+
clearSelectedGlobalFilters,
|
|
33
|
+
removeGlobalFilterOption,
|
|
34
|
+
addFiltersToGlobalFiltersOptions
|
|
35
|
+
]
|
|
36
|
+
);
|
|
37
|
+
return /* @__PURE__ */ jsx(GlobalFilterContext.Provider, { value, children });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
GlobalFilterContextProvider
|
|
41
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
const GlobalFilterContext = createContext(null);
|
|
3
|
+
function useGlobalFilterContext() {
|
|
4
|
+
const context = useContext(GlobalFilterContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error("useGlobalFilterContext must be used inside GlobalFilterProvider");
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
GlobalFilterContext,
|
|
12
|
+
useGlobalFilterContext
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { UUID } from 'node:crypto';
|
|
3
|
+
import { GlobalFilter, RecentGlobalFilter } from '../types/global-filter.type';
|
|
4
|
+
export type GlobalFilterContextValue = {
|
|
5
|
+
globalFilterOptions: GlobalFilter[];
|
|
6
|
+
selectedGlobalFilters: GlobalFilter[];
|
|
7
|
+
recentGlobalFilters: RecentGlobalFilter[];
|
|
8
|
+
selectGlobalFilter: (id: string) => void;
|
|
9
|
+
unselectGlobalFilters: (ids: string[]) => void;
|
|
10
|
+
clearSelectedGlobalFilters: () => void;
|
|
11
|
+
removeGlobalFilterOption: (id: string) => void;
|
|
12
|
+
addFiltersToGlobalFiltersOptions: (elementIds: UUID[]) => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export type GlobalFilterContextProviderProps = PropsWithChildren<GlobalFilterContextValue>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, 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
|
+
export * from './global-filter-context-provider';
|
|
8
|
+
export * from './global-filter-context.type';
|