@gridsuite/commons-ui 0.280.0 → 0.282.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/customAGGrid/custom-aggrid-filters/hooks/use-custom-aggrid-comparator-filter.js +1 -0
- package/dist/components/composite/customAGGrid/hooks/use-custom-aggrid-sort.js +1 -0
- package/dist/components/composite/reactQueryBuilder/OperatorSelector.js +1 -0
- package/dist/components/composite/report/QuickSearch.js +1 -0
- package/dist/components/composite/report/report-viewer/log-table/log-table.js +1 -1
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.d.ts +6 -1
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +29 -5
- package/dist/components/ui/directoryItemSelector/DirectoryItemSelector.js +1 -0
- package/dist/components/ui/reactHookForm/booleans/RadioInput.d.ts +1 -0
- package/dist/components/ui/reactHookForm/booleans/RadioInput.js +2 -1
- package/dist/features/index.js +92 -12
- package/dist/features/network-modification-table/network-modifications-table.js +1 -0
- package/dist/features/network-modification-table/renderers/reference-link-cell.js +1 -1
- package/dist/features/network-modification-table/renderers/root-network-chip-cell.js +1 -0
- package/dist/features/network-modification-table/renderers/switch-cell.js +1 -0
- package/dist/features/network-modification-table/row/drag-row-clone.js +1 -0
- package/dist/features/network-modification-table/use-modifications-drag-and-drop.js +1 -0
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabs.d.ts +3 -3
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabs.js +2 -2
- package/dist/features/network-modifications/battery/modification/BatteryModificationForm.d.ts +4 -1
- package/dist/features/network-modifications/battery/modification/BatteryModificationForm.js +7 -11
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.d.ts +3 -3
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.js +2 -2
- package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.d.ts +4 -1
- package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +4 -8
- package/dist/features/network-modifications/index.d.ts +1 -1
- package/dist/features/network-modifications/index.js +81 -6
- package/dist/features/network-modifications/line/common/LineDialogTabs.d.ts +3 -3
- package/dist/features/network-modifications/line/common/LineDialogTabs.js +2 -2
- package/dist/features/network-modifications/line/common/LineForm.d.ts +4 -1
- package/dist/features/network-modifications/line/common/LineForm.js +7 -11
- package/dist/features/network-modifications/line/common/line.utils.d.ts +1 -1
- package/dist/features/network-modifications/load/common/LoadDialogTabs.d.ts +3 -3
- package/dist/features/network-modifications/load/common/LoadDialogTabs.js +2 -2
- package/dist/features/network-modifications/load/common/LoadForm.d.ts +4 -1
- package/dist/features/network-modifications/load/common/LoadForm.js +7 -11
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.d.ts +3 -2
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +2 -2
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.d.ts +4 -1
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js +8 -11
- package/dist/features/network-modifications/tabular/TabularForm.d.ts +22 -0
- package/dist/features/network-modifications/tabular/TabularForm.js +536 -0
- package/dist/features/network-modifications/tabular/index.d.ts +7 -0
- package/dist/features/network-modifications/tabular/index.js +65 -0
- package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.d.ts +12 -0
- package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.js +123 -0
- package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.d.ts +1 -0
- package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.js +87 -0
- package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.d.ts +5 -0
- package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.js +91 -0
- package/dist/features/network-modifications/tabular/properties/index.d.ts +4 -0
- package/dist/features/network-modifications/tabular/properties/index.js +13 -0
- package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.d.ts +26 -0
- package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.js +50 -0
- package/dist/features/network-modifications/tabular/tabular.constants.d.ts +59 -0
- package/dist/features/network-modifications/tabular/tabular.constants.js +75 -0
- package/dist/features/network-modifications/tabular/tabular.types.d.ts +41 -0
- package/dist/features/network-modifications/tabular/tabular.types.js +8 -0
- package/dist/features/network-modifications/tabular/tabular.utils.d.ts +68 -0
- package/dist/features/network-modifications/tabular/tabular.utils.js +301 -0
- package/dist/features/network-modifications/tabular/tabularCreation.utils.d.ts +25 -0
- package/dist/features/network-modifications/tabular/tabularCreation.utils.js +276 -0
- package/dist/features/network-modifications/tabular/tabularModification.utils.d.ts +43 -0
- package/dist/features/network-modifications/tabular/tabularModification.utils.js +406 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.d.ts +3 -3
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.js +2 -2
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.d.ts +4 -1
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.js +7 -11
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.d.ts +4 -7
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +16 -19
- package/dist/features/network-modifications/voltageLevel/creation/index.d.ts +1 -1
- package/dist/features/network-modifications/voltageLevel/creation/index.js +3 -1
- package/dist/features/network-modifications/voltageLevel/index.d.ts +2 -1
- package/dist/features/network-modifications/voltageLevel/index.js +18 -4
- package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.d.ts → creation/CreateVoltageLevelTopologyForm.d.ts} +1 -1
- package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.js → creation/CreateVoltageLevelTopologyForm.js} +38 -38
- package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.types.d.ts → creation/voltageLevelTopologyCreation.types.d.ts} +1 -1
- package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.d.ts → creation/voltageLevelTopologyCreation.utils.d.ts} +1 -1
- package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.js → creation/voltageLevelTopologyCreation.utils.js} +5 -5
- package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.d.ts +6 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.js +80 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.d.ts +10 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.js +284 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/constants.d.ts +10 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/constants.js +10 -0
- package/dist/features/network-modifications/{hooks → voltageLevel/topology/modification}/index.d.ts +4 -1
- package/dist/features/network-modifications/voltageLevel/topology/modification/index.js +14 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.d.ts +28 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.js +1 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.d.ts +29 -0
- package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.js +124 -0
- package/dist/features/parameters/common/hook/index.d.ts +0 -1
- package/dist/features/parameters/common/hook/index.js +1 -3
- package/dist/features/parameters/common/index.d.ts +1 -0
- package/dist/features/parameters/common/index.js +3 -3
- package/dist/features/parameters/common/parameter-field.d.ts +2 -2
- package/dist/features/parameters/common/parameter-field.js +1 -1
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.d.ts +1 -1
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +1 -1
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +10 -10
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation.type.d.ts +1 -0
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation.type.js +2 -0
- package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
- package/dist/features/parameters/dynamic-margin-calculation/time-delay-parameters.js +1 -1
- package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +1 -1
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +9 -9
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +1 -1
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +1 -1
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis.type.d.ts +1 -0
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis.type.js +2 -0
- package/dist/features/parameters/dynamic-security-analysis/scenario-parameters.js +1 -1
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-preview.js +1 -0
- package/dist/features/parameters/dynamic-simulation/curve/dialog/equipment-filter.js +1 -0
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +9 -9
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.d.ts +1 -1
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +1 -1
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation.type.d.ts +1 -0
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation.type.js +2 -0
- package/dist/features/parameters/dynamic-simulation/network/network-parameters.js +1 -1
- package/dist/features/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters.js +1 -1
- package/dist/features/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters.js +1 -1
- package/dist/features/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters.js +1 -1
- package/dist/features/parameters/dynamic-simulation/solver/solver-parameters.js +1 -1
- package/dist/features/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +1 -1
- package/dist/features/parameters/index.js +12 -7
- package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +1 -1
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +6 -6
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.d.ts +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +2 -0
- package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +1 -1
- package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +3 -3
- package/dist/features/parameters/network-visualizations/constants.d.ts +1 -0
- package/dist/features/parameters/network-visualizations/constants.js +2 -0
- package/dist/features/parameters/network-visualizations/index.js +2 -1
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +6 -6
- package/dist/features/parameters/network-visualizations/use-network-visualizations-parameters-form.js +3 -7
- package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +6 -6
- package/dist/features/parameters/security-analysis/constants.d.ts +1 -0
- package/dist/features/parameters/security-analysis/constants.js +2 -0
- package/dist/features/parameters/security-analysis/index.js +2 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-content.js +1 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +1 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +6 -6
- package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +3 -3
- package/dist/features/parameters/sensi/columns-definitions.d.ts +2 -0
- package/dist/features/parameters/sensi/columns-definitions.js +36 -1
- package/dist/features/parameters/sensi/index.js +3 -1
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +1 -1
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +2 -1
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +10 -7
- package/dist/features/parameters/sensi/sensitivity-parameters-selector.d.ts +3 -1
- package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +19 -35
- package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.d.ts +9 -1
- package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +29 -1
- package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +6 -6
- package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.d.ts +1 -0
- package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +2 -0
- package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +3 -3
- package/dist/features/parameters/voltage-init/constants.d.ts +1 -0
- package/dist/features/parameters/voltage-init/constants.js +2 -0
- package/dist/features/parameters/voltage-init/index.js +2 -1
- package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +4 -8
- package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +6 -6
- package/dist/features/process-configs/loadflow/lf-process-config-edition.js +7 -1
- package/dist/features/process-configs/security-analysis/sa-process-config-edition.js +7 -1
- package/dist/features/process-configs/shortcircuit/sc-process-config-edition.js +7 -1
- package/dist/features/results/loadflow/limit-violation-result.js +1 -1
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.js +1 -1
- package/dist/features/side-bar/AppSideBarHeader.js +20 -5
- package/dist/features/side-bar/EnvironmentChip.d.ts +13 -0
- package/dist/features/side-bar/EnvironmentChip.js +49 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/use-tabs.d.ts +33 -0
- package/dist/hooks/use-tabs.js +55 -0
- package/dist/index.js +97 -13
- package/dist/services/appsMetadata.d.ts +2 -0
- package/dist/services/directory.d.ts +1 -1
- package/dist/services/directory.js +6 -2
- package/dist/services/index.js +2 -1
- package/dist/services/userAdmin.d.ts +2 -1
- package/dist/services/userAdmin.js +9 -1
- package/dist/translations/en/businessErrorsEn.d.ts +1 -0
- package/dist/translations/en/businessErrorsEn.js +1 -0
- package/dist/translations/en/networkModificationsEn.d.ts +85 -0
- package/dist/translations/en/networkModificationsEn.js +91 -1
- package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
- package/dist/translations/fr/businessErrorsFr.js +1 -0
- package/dist/translations/fr/networkModificationsFr.d.ts +85 -0
- package/dist/translations/fr/networkModificationsFr.js +91 -1
- package/dist/utils/constants/index.js +2 -1
- package/dist/utils/constants/notificationsProvider.d.ts +1 -0
- package/dist/utils/constants/notificationsProvider.js +1 -0
- package/dist/utils/constants/translationKeys.d.ts +1 -0
- package/dist/utils/constants/translationKeys.js +2 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/types/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/features/network-modifications/hooks/index.js +0 -4
- package/dist/features/network-modifications/hooks/useTabsWithError.d.ts +0 -15
- package/dist/features/network-modifications/hooks/useTabsWithError.js +0 -28
- package/dist/features/parameters/common/hook/use-tabs.d.ts +0 -16
- package/dist/features/parameters/common/hook/use-tabs.js +0 -65
- /package/dist/features/network-modifications/voltageLevel/topology/{index.d.ts → creation/index.d.ts} +0 -0
- /package/dist/features/network-modifications/voltageLevel/topology/{index.js → creation/index.js} +0 -0
- /package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.types.js → creation/voltageLevelTopologyCreation.types.js} +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DefineTabularPropertiesDialog } from "./properties/DefineTabularPropertiesDialog.js";
|
|
2
|
+
import { TabularPropertiesForm } from "./properties/TabularPropertiesForm.js";
|
|
3
|
+
import { TabularPropertyForm } from "./properties/TabularPropertyForm.js";
|
|
4
|
+
import { buildPredefinedTabularProperties, emptyTabularProperties, initializedTabularProperty, tabularPropertiesSchema } from "./properties/tabularProperty.utils.js";
|
|
5
|
+
import { LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION, PROPERTY_CSV_COLUMN_PREFIX, REGULATING_TERMINAL_TYPES, TABULAR_BOOLEAN, TABULAR_ENUM, TABULAR_NUMBER, TabularFieldConstants } from "./tabular.constants.js";
|
|
6
|
+
import { TabularModificationType } from "./tabular.types.js";
|
|
7
|
+
import { addPropertiesFromBack, convertReactiveCapabilityCurvePointsFromBackToFront, convertReactiveCapabilityCurvePointsFromFrontToBack, formatModification, generateCommentLines, getEmptyTabularFormData, getSelectedTabularPropertyNames, isFieldTypeOk, sanitizeRowValue, setFieldTypeError, tabularFormSchema, transformProperties } from "./tabular.utils.js";
|
|
8
|
+
import { TABULAR_CREATION_FIELDS, TABULAR_CREATION_TYPES, convertCreationFieldFromBackToFront, convertCreationFieldFromFrontToBack, convertCreations, getEquipmentTypeFromCreationType, tabularCreationDtoToForm, tabularCreationFormToDto, transformCreationsTable, transformRowToBackEndCreation } from "./tabularCreation.utils.js";
|
|
9
|
+
import { MODIFICATION_TRANSFORMATION_STRATEGIES, TABULAR_MODIFICATION_FIELDS, TABULAR_MODIFICATION_TYPES, TWT_TAP_CHANGER_FIELDS, convertGeneratorOrBatteryModificationFromBackToFront, convertGeneratorOrBatteryModificationFromFrontToBack, convertInputValues, convertOutputValues, convertTWTTapChangerModificationFromFrontToBack, getEquipmentTypeFromModificationType, getTabularFieldType, tabularModificationDtoToForm, tabularModificationFormToDto, transformModificationsTable, transformRowToBackEndModification } from "./tabularModification.utils.js";
|
|
10
|
+
import { TabularForm } from "./TabularForm.js";
|
|
11
|
+
export {
|
|
12
|
+
DefineTabularPropertiesDialog,
|
|
13
|
+
LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION,
|
|
14
|
+
MODIFICATION_TRANSFORMATION_STRATEGIES,
|
|
15
|
+
PROPERTY_CSV_COLUMN_PREFIX,
|
|
16
|
+
REGULATING_TERMINAL_TYPES,
|
|
17
|
+
TABULAR_BOOLEAN,
|
|
18
|
+
TABULAR_CREATION_FIELDS,
|
|
19
|
+
TABULAR_CREATION_TYPES,
|
|
20
|
+
TABULAR_ENUM,
|
|
21
|
+
TABULAR_MODIFICATION_FIELDS,
|
|
22
|
+
TABULAR_MODIFICATION_TYPES,
|
|
23
|
+
TABULAR_NUMBER,
|
|
24
|
+
TWT_TAP_CHANGER_FIELDS,
|
|
25
|
+
TabularFieldConstants,
|
|
26
|
+
TabularForm,
|
|
27
|
+
TabularModificationType,
|
|
28
|
+
TabularPropertiesForm,
|
|
29
|
+
TabularPropertyForm,
|
|
30
|
+
addPropertiesFromBack,
|
|
31
|
+
buildPredefinedTabularProperties,
|
|
32
|
+
convertCreationFieldFromBackToFront,
|
|
33
|
+
convertCreationFieldFromFrontToBack,
|
|
34
|
+
convertCreations,
|
|
35
|
+
convertGeneratorOrBatteryModificationFromBackToFront,
|
|
36
|
+
convertGeneratorOrBatteryModificationFromFrontToBack,
|
|
37
|
+
convertInputValues,
|
|
38
|
+
convertOutputValues,
|
|
39
|
+
convertReactiveCapabilityCurvePointsFromBackToFront,
|
|
40
|
+
convertReactiveCapabilityCurvePointsFromFrontToBack,
|
|
41
|
+
convertTWTTapChangerModificationFromFrontToBack,
|
|
42
|
+
emptyTabularProperties,
|
|
43
|
+
formatModification,
|
|
44
|
+
generateCommentLines,
|
|
45
|
+
getEmptyTabularFormData,
|
|
46
|
+
getEquipmentTypeFromCreationType,
|
|
47
|
+
getEquipmentTypeFromModificationType,
|
|
48
|
+
getSelectedTabularPropertyNames,
|
|
49
|
+
getTabularFieldType,
|
|
50
|
+
initializedTabularProperty,
|
|
51
|
+
isFieldTypeOk,
|
|
52
|
+
sanitizeRowValue,
|
|
53
|
+
setFieldTypeError,
|
|
54
|
+
tabularCreationDtoToForm,
|
|
55
|
+
tabularCreationFormToDto,
|
|
56
|
+
tabularFormSchema,
|
|
57
|
+
tabularModificationDtoToForm,
|
|
58
|
+
tabularModificationFormToDto,
|
|
59
|
+
tabularPropertiesSchema,
|
|
60
|
+
transformCreationsTable,
|
|
61
|
+
transformModificationsTable,
|
|
62
|
+
transformProperties,
|
|
63
|
+
transformRowToBackEndCreation,
|
|
64
|
+
transformRowToBackEndModification
|
|
65
|
+
};
|
package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EquipmentType } from '../../../../utils';
|
|
2
|
+
import { UseStateBooleanReturn } from '../../../../hooks';
|
|
3
|
+
import { PredefinedEquipmentProperties } from '../tabular.types';
|
|
4
|
+
import { TabularPropertiesFormType, TabularProperty } from './tabularProperty.utils';
|
|
5
|
+
export interface DefineTabularPropertiesDialogProps {
|
|
6
|
+
open: UseStateBooleanReturn;
|
|
7
|
+
equipmentType: EquipmentType;
|
|
8
|
+
currentProperties: TabularProperty[];
|
|
9
|
+
predefinedEquipmentProperties: PredefinedEquipmentProperties;
|
|
10
|
+
onValidate: (formData: TabularPropertiesFormType) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function DefineTabularPropertiesDialog({ open, equipmentType, currentProperties, predefinedEquipmentProperties, onValidate, }: Readonly<DefineTabularPropertiesDialogProps>): import("react").JSX.Element;
|
package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
5
|
+
import { Grid } from "@mui/material";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import "react-intl";
|
|
8
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import { equipmentTypesForPredefinedPropertiesMapper } from "../../../../utils/mapper/equipmentTypesForPredefinedPropertiesMapper.js";
|
|
12
|
+
import "localized-countries";
|
|
13
|
+
import "localized-countries/data/fr";
|
|
14
|
+
import "localized-countries/data/en";
|
|
15
|
+
import "notistack";
|
|
16
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
17
|
+
import "yup";
|
|
18
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
19
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
25
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
26
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
27
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
28
|
+
import "@hello-pangea/dnd";
|
|
29
|
+
import { CustomMuiDialog } from "../../../../components/ui/dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
30
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
31
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
32
|
+
import "mui-nested-menu";
|
|
33
|
+
import "react-resizable-panels";
|
|
34
|
+
import "react-papaparse";
|
|
35
|
+
import "react-dom";
|
|
36
|
+
import "autosuggest-highlight/match";
|
|
37
|
+
import "autosuggest-highlight/parse";
|
|
38
|
+
import "clsx";
|
|
39
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
40
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
41
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
42
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
43
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
44
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
45
|
+
import "react-querybuilder";
|
|
46
|
+
import "uuid";
|
|
47
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
48
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
49
|
+
import "@react-querybuilder/material";
|
|
50
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
51
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
52
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
53
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
|
+
import "ag-grid-community";
|
|
55
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
57
|
+
import "mathjs";
|
|
58
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
59
|
+
import "react-window";
|
|
60
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
61
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
62
|
+
import { TabularFieldConstants } from "../tabular.constants.js";
|
|
63
|
+
import { TabularPropertiesForm } from "./TabularPropertiesForm.js";
|
|
64
|
+
import { emptyTabularProperties, tabularPropertiesSchema, buildPredefinedTabularProperties } from "./tabularProperty.utils.js";
|
|
65
|
+
const styles = {
|
|
66
|
+
dialogContent: {
|
|
67
|
+
".MuiDialog-paper": {
|
|
68
|
+
width: "35%",
|
|
69
|
+
height: "50%",
|
|
70
|
+
maxWidth: "none",
|
|
71
|
+
margin: "auto"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
function DefineTabularPropertiesDialog({
|
|
76
|
+
open,
|
|
77
|
+
equipmentType,
|
|
78
|
+
currentProperties,
|
|
79
|
+
predefinedEquipmentProperties,
|
|
80
|
+
onValidate
|
|
81
|
+
}) {
|
|
82
|
+
const formMethods = useForm({
|
|
83
|
+
defaultValues: emptyTabularProperties,
|
|
84
|
+
resolver: yupResolver(tabularPropertiesSchema)
|
|
85
|
+
});
|
|
86
|
+
const { reset } = formMethods;
|
|
87
|
+
const onClose = useCallback(() => {
|
|
88
|
+
open.setFalse();
|
|
89
|
+
reset(emptyTabularProperties);
|
|
90
|
+
}, [open, reset]);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (open.value && equipmentType) {
|
|
93
|
+
if (currentProperties?.length) {
|
|
94
|
+
reset({
|
|
95
|
+
[TabularFieldConstants.TABULAR_PROPERTIES]: currentProperties
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
const networkEquipmentType = equipmentTypesForPredefinedPropertiesMapper(equipmentType);
|
|
99
|
+
if (networkEquipmentType && predefinedEquipmentProperties?.[networkEquipmentType]) {
|
|
100
|
+
const propertyNames = Object.keys(predefinedEquipmentProperties[networkEquipmentType] ?? {}).sort(
|
|
101
|
+
(a, b) => a.localeCompare(b)
|
|
102
|
+
);
|
|
103
|
+
reset(buildPredefinedTabularProperties(propertyNames));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, [currentProperties, equipmentType, open, predefinedEquipmentProperties, reset]);
|
|
108
|
+
return /* @__PURE__ */ jsx(
|
|
109
|
+
CustomMuiDialog,
|
|
110
|
+
{
|
|
111
|
+
titleId: "DefinePropertiesTitle",
|
|
112
|
+
open: open.value,
|
|
113
|
+
formContext: { ...formMethods, validationSchema: tabularPropertiesSchema },
|
|
114
|
+
onClose,
|
|
115
|
+
onSave: onValidate,
|
|
116
|
+
sx: styles.dialogContent,
|
|
117
|
+
children: /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(TabularPropertiesForm, {}) })
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
DefineTabularPropertiesDialog
|
|
123
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TabularPropertiesForm(): import("react").JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useFormContext } from "react-hook-form";
|
|
4
|
+
import { Grid } from "@mui/material";
|
|
5
|
+
import "@mui/icons-material";
|
|
6
|
+
import "react-intl";
|
|
7
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import "../../../../utils/conversionUtils.js";
|
|
9
|
+
import "../../../../utils/types/equipmentType.js";
|
|
10
|
+
import "localized-countries";
|
|
11
|
+
import "localized-countries/data/fr";
|
|
12
|
+
import "localized-countries/data/en";
|
|
13
|
+
import "notistack";
|
|
14
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
15
|
+
import "yup";
|
|
16
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
17
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
18
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
23
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
24
|
+
import { ExpandableInput } from "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
25
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
26
|
+
import "@hello-pangea/dnd";
|
|
27
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
28
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
29
|
+
import "mui-nested-menu";
|
|
30
|
+
import "react-resizable-panels";
|
|
31
|
+
import "react-papaparse";
|
|
32
|
+
import "react-dom";
|
|
33
|
+
import "autosuggest-highlight/match";
|
|
34
|
+
import "autosuggest-highlight/parse";
|
|
35
|
+
import "clsx";
|
|
36
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
37
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
38
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
39
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
40
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
41
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
42
|
+
import "react-querybuilder";
|
|
43
|
+
import "uuid";
|
|
44
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
45
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
46
|
+
import "@react-querybuilder/material";
|
|
47
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
48
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
49
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
50
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
51
|
+
import "ag-grid-community";
|
|
52
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
53
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
54
|
+
import "mathjs";
|
|
55
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
56
|
+
import "react-window";
|
|
57
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
58
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
59
|
+
import { TabularFieldConstants } from "../tabular.constants.js";
|
|
60
|
+
import { TabularPropertyForm } from "./TabularPropertyForm.js";
|
|
61
|
+
import { initializedTabularProperty } from "./tabularProperty.utils.js";
|
|
62
|
+
function TabularPropertiesForm() {
|
|
63
|
+
const { getValues } = useFormContext();
|
|
64
|
+
const disabledDeletion = useCallback(
|
|
65
|
+
(idx) => {
|
|
66
|
+
const properties = getValues(TabularFieldConstants.TABULAR_PROPERTIES);
|
|
67
|
+
if (properties?.[idx] !== void 0) {
|
|
68
|
+
return properties[idx][TabularFieldConstants.PREDEFINED];
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
},
|
|
72
|
+
[getValues]
|
|
73
|
+
);
|
|
74
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(
|
|
75
|
+
ExpandableInput,
|
|
76
|
+
{
|
|
77
|
+
name: TabularFieldConstants.TABULAR_PROPERTIES,
|
|
78
|
+
Field: TabularPropertyForm,
|
|
79
|
+
addButtonLabel: "AddProperty",
|
|
80
|
+
initialValue: initializedTabularProperty(),
|
|
81
|
+
disabledDeletion
|
|
82
|
+
}
|
|
83
|
+
) });
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
TabularPropertiesForm
|
|
87
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useWatch } from "react-hook-form";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import "@mui/icons-material";
|
|
5
|
+
import "react-intl";
|
|
6
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
7
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
8
|
+
import "../../../../utils/conversionUtils.js";
|
|
9
|
+
import "../../../../utils/types/equipmentType.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "yup";
|
|
17
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
18
|
+
import { CheckboxInput } from "../../../../components/ui/reactHookForm/booleans/CheckboxInput.js";
|
|
19
|
+
import { TextInput } from "../../../../components/ui/reactHookForm/text/TextInput.js";
|
|
20
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
26
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
27
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
28
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
29
|
+
import "@hello-pangea/dnd";
|
|
30
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
31
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
32
|
+
import "mui-nested-menu";
|
|
33
|
+
import "react-resizable-panels";
|
|
34
|
+
import "react-papaparse";
|
|
35
|
+
import "react-dom";
|
|
36
|
+
import "autosuggest-highlight/match";
|
|
37
|
+
import "autosuggest-highlight/parse";
|
|
38
|
+
import "clsx";
|
|
39
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
40
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
41
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
42
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
43
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
44
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
45
|
+
import "react-querybuilder";
|
|
46
|
+
import "uuid";
|
|
47
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
48
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
49
|
+
import { GridItem } from "../../../../components/composite/grid/grid-item.js";
|
|
50
|
+
import "@react-querybuilder/material";
|
|
51
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
52
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
53
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
54
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
55
|
+
import "ag-grid-community";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
58
|
+
import "mathjs";
|
|
59
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
60
|
+
import "react-window";
|
|
61
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
62
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
63
|
+
import { italicFontTextField } from "../../common/form.utils.js";
|
|
64
|
+
import "../../common/properties/propertyUtils.js";
|
|
65
|
+
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
66
|
+
import "@mui/material/colors";
|
|
67
|
+
import "@mui/x-charts";
|
|
68
|
+
import "../../common/currentLimits/limitsPane.utils.js";
|
|
69
|
+
import { TabularFieldConstants } from "../tabular.constants.js";
|
|
70
|
+
function TabularPropertyForm({ name, index }) {
|
|
71
|
+
const watchPredefined = useWatch({
|
|
72
|
+
name: `${name}.${index}.${TabularFieldConstants.PREDEFINED}`
|
|
73
|
+
});
|
|
74
|
+
const nameField = /* @__PURE__ */ jsx(TextInput, { name: `${name}.${index}.${FieldConstants.NAME}`, label: "PropertyName" });
|
|
75
|
+
const nameReadOnlyField = /* @__PURE__ */ jsx(
|
|
76
|
+
TextInput,
|
|
77
|
+
{
|
|
78
|
+
name: `${name}.${index}.${FieldConstants.NAME}`,
|
|
79
|
+
label: "PropertyName",
|
|
80
|
+
formProps: { disabled: true, ...italicFontTextField }
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
const selectionField = /* @__PURE__ */ jsx(CheckboxInput, { name: `${name}.${index}.${FieldConstants.SELECTED}` });
|
|
84
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(GridItem, { size: 10, children: watchPredefined ? nameReadOnlyField : nameField }),
|
|
86
|
+
/* @__PURE__ */ jsx(GridItem, { size: 1, children: selectionField })
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
TabularPropertyForm
|
|
91
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DefineTabularPropertiesDialog } from "./DefineTabularPropertiesDialog.js";
|
|
2
|
+
import { TabularPropertiesForm } from "./TabularPropertiesForm.js";
|
|
3
|
+
import { TabularPropertyForm } from "./TabularPropertyForm.js";
|
|
4
|
+
import { buildPredefinedTabularProperties, emptyTabularProperties, initializedTabularProperty, tabularPropertiesSchema } from "./tabularProperty.utils.js";
|
|
5
|
+
export {
|
|
6
|
+
DefineTabularPropertiesDialog,
|
|
7
|
+
TabularPropertiesForm,
|
|
8
|
+
TabularPropertyForm,
|
|
9
|
+
buildPredefinedTabularProperties,
|
|
10
|
+
emptyTabularProperties,
|
|
11
|
+
initializedTabularProperty,
|
|
12
|
+
tabularPropertiesSchema
|
|
13
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FieldConstants } from '../../../../utils';
|
|
2
|
+
import { TabularFieldConstants } from '../tabular.constants';
|
|
3
|
+
import * as yup from 'yup';
|
|
4
|
+
export type TabularProperty = {
|
|
5
|
+
[FieldConstants.NAME]: string;
|
|
6
|
+
[TabularFieldConstants.PREDEFINED]: boolean;
|
|
7
|
+
[FieldConstants.SELECTED]: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type TabularProperties = {
|
|
10
|
+
[TabularFieldConstants.TABULAR_PROPERTIES]?: TabularProperty[];
|
|
11
|
+
};
|
|
12
|
+
export declare const emptyTabularProperties: TabularProperties;
|
|
13
|
+
export declare const buildPredefinedTabularProperties: (names: string[]) => {
|
|
14
|
+
properties: TabularProperty[];
|
|
15
|
+
};
|
|
16
|
+
export declare const initializedTabularProperty: () => TabularProperty;
|
|
17
|
+
export declare const tabularPropertiesSchema: yup.ObjectSchema<{
|
|
18
|
+
properties: {
|
|
19
|
+
name: string;
|
|
20
|
+
selected: NonNullable<boolean | undefined>;
|
|
21
|
+
predefined: NonNullable<boolean | undefined>;
|
|
22
|
+
}[] | undefined;
|
|
23
|
+
}, yup.AnyObject, {
|
|
24
|
+
properties: "";
|
|
25
|
+
}, "">;
|
|
26
|
+
export type TabularPropertiesFormType = yup.InferType<typeof tabularPropertiesSchema>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import { DUPLICATED_PROPS_ERROR } from "../../../../utils/constants/translationKeys.js";
|
|
4
|
+
import "../../../../utils/conversionUtils.js";
|
|
5
|
+
import "../../../../utils/types/equipmentType.js";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
import { TabularFieldConstants } from "../tabular.constants.js";
|
|
9
|
+
const emptyTabularProperties = {
|
|
10
|
+
[TabularFieldConstants.TABULAR_PROPERTIES]: []
|
|
11
|
+
};
|
|
12
|
+
const buildPredefinedTabularProperties = (names) => {
|
|
13
|
+
const properties = names.map((name) => ({
|
|
14
|
+
[FieldConstants.NAME]: name,
|
|
15
|
+
[TabularFieldConstants.PREDEFINED]: true,
|
|
16
|
+
[FieldConstants.SELECTED]: false
|
|
17
|
+
}));
|
|
18
|
+
return {
|
|
19
|
+
[TabularFieldConstants.TABULAR_PROPERTIES]: properties
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const initializedTabularProperty = () => {
|
|
23
|
+
return {
|
|
24
|
+
[FieldConstants.NAME]: "",
|
|
25
|
+
[TabularFieldConstants.PREDEFINED]: false,
|
|
26
|
+
[FieldConstants.SELECTED]: true
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const checkUniquePropertyNames = (properties) => {
|
|
30
|
+
if (properties === void 0) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
const validValues = properties.filter((v) => v.name);
|
|
34
|
+
return validValues.length === new Set(validValues.map((v) => v.name)).size;
|
|
35
|
+
};
|
|
36
|
+
const tabularPropertiesSchema = yup.object({
|
|
37
|
+
[TabularFieldConstants.TABULAR_PROPERTIES]: yup.array().of(
|
|
38
|
+
yup.object().shape({
|
|
39
|
+
[FieldConstants.NAME]: yup.string().required(),
|
|
40
|
+
[TabularFieldConstants.PREDEFINED]: yup.boolean().required(),
|
|
41
|
+
[FieldConstants.SELECTED]: yup.boolean().required()
|
|
42
|
+
})
|
|
43
|
+
).test("checkUniqueProperties", DUPLICATED_PROPS_ERROR, (values) => checkUniquePropertyNames(values))
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
buildPredefinedTabularProperties,
|
|
47
|
+
emptyTabularProperties,
|
|
48
|
+
initializedTabularProperty,
|
|
49
|
+
tabularPropertiesSchema
|
|
50
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field names specific to the tabular creation/modification CSV format.
|
|
3
|
+
* Every other column name comes from {@link FieldConstants}.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum TabularFieldConstants {
|
|
6
|
+
EQUIPMENT_ID = "equipmentId",
|
|
7
|
+
CSV_FILENAME = "csvFilename",
|
|
8
|
+
MODIFICATIONS_TABLE = "modificationsTable",
|
|
9
|
+
TABULAR_PROPERTIES = "properties",
|
|
10
|
+
PREDEFINED = "predefined",
|
|
11
|
+
BUS_OR_BUSBAR_SECTION_ID = "busOrBusbarSectionId",
|
|
12
|
+
MIN_P = "minP",
|
|
13
|
+
MAX_P = "maxP",
|
|
14
|
+
P0 = "p0",
|
|
15
|
+
TARGET_P = "targetP",
|
|
16
|
+
TARGET_Q = "targetQ",
|
|
17
|
+
PARTICIPATE = "participate",
|
|
18
|
+
VOLTAGE_REGULATION_ON = "voltageRegulationOn",
|
|
19
|
+
REGULATING_TERMINAL_ID = "regulatingTerminalId",
|
|
20
|
+
REGULATING_TERMINAL_TYPE = "regulatingTerminalType",
|
|
21
|
+
STEP_UP_TRANSFORMER_REACTANCE = "stepUpTransformerX",
|
|
22
|
+
REACTIVE_CAPABILITY_CURVE = "reactiveCapabilityCurve",
|
|
23
|
+
REACTIVE_CAPABILITY_CURVE_POINTS = "reactiveCapabilityCurvePoints",
|
|
24
|
+
REACTIVE_CAPABILITY_CURVE_P_MIN = "reactiveCapabilityCurvePmin",
|
|
25
|
+
REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MIN = "reactiveCapabilityCurveQminPmin",
|
|
26
|
+
REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MIN = "reactiveCapabilityCurveQmaxPmin",
|
|
27
|
+
REACTIVE_CAPABILITY_CURVE_P_0 = "reactiveCapabilityCurveP0",
|
|
28
|
+
REACTIVE_CAPABILITY_CURVE_Q_MIN_P_0 = "reactiveCapabilityCurveQminP0",
|
|
29
|
+
REACTIVE_CAPABILITY_CURVE_Q_MAX_P_0 = "reactiveCapabilityCurveQmaxP0",
|
|
30
|
+
REACTIVE_CAPABILITY_CURVE_P_MAX = "reactiveCapabilityCurvePmax",
|
|
31
|
+
REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MAX = "reactiveCapabilityCurveQminPmax",
|
|
32
|
+
REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MAX = "reactiveCapabilityCurveQmaxPmax",
|
|
33
|
+
CONNECTED1 = "terminal1Connected",
|
|
34
|
+
CONNECTED2 = "terminal2Connected",
|
|
35
|
+
CONNECTION_NAME1 = "connectionName1",
|
|
36
|
+
CONNECTION_NAME2 = "connectionName2",
|
|
37
|
+
CONNECTION_DIRECTION1 = "connectionDirection1",
|
|
38
|
+
CONNECTION_DIRECTION2 = "connectionDirection2",
|
|
39
|
+
CONNECTION_POSITION1 = "connectionPosition1",
|
|
40
|
+
CONNECTION_POSITION2 = "connectionPosition2",
|
|
41
|
+
IP_MIN = "ipMin",
|
|
42
|
+
IP_MAX = "ipMax",
|
|
43
|
+
RATIO_TAP_CHANGER_LOAD_TAP_CHANGING_CAPABILITIES = "ratioTapChangerLoadTapChangingCapabilities",
|
|
44
|
+
RATIO_TAP_CHANGER_REGULATION_SIDE = "ratioTapChangerRegulationSide"
|
|
45
|
+
}
|
|
46
|
+
/** Cell data types handled by the tabular table (they match AG Grid cell data types). */
|
|
47
|
+
export declare const TABULAR_NUMBER = "number";
|
|
48
|
+
export declare const TABULAR_ENUM = "enum";
|
|
49
|
+
export declare const TABULAR_BOOLEAN = "boolean";
|
|
50
|
+
/** Prefix of the CSV columns holding a user defined equipment property. */
|
|
51
|
+
export declare const PROPERTY_CSV_COLUMN_PREFIX = "property_";
|
|
52
|
+
export declare const REGULATING_TERMINAL_TYPES: string[];
|
|
53
|
+
export declare const LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION: readonly [...{
|
|
54
|
+
id: string;
|
|
55
|
+
label: string;
|
|
56
|
+
}[], {
|
|
57
|
+
readonly id: "UNDEFINED";
|
|
58
|
+
readonly label: "Undefined";
|
|
59
|
+
}];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import "../../../utils/conversionUtils.js";
|
|
2
|
+
import { LOAD_TYPES, UNDEFINED_LOAD_TYPE } from "../../../utils/types/equipmentType.js";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "@mui/icons-material";
|
|
5
|
+
var TabularFieldConstants = /* @__PURE__ */ ((TabularFieldConstants2) => {
|
|
6
|
+
TabularFieldConstants2["EQUIPMENT_ID"] = "equipmentId";
|
|
7
|
+
TabularFieldConstants2["CSV_FILENAME"] = "csvFilename";
|
|
8
|
+
TabularFieldConstants2["MODIFICATIONS_TABLE"] = "modificationsTable";
|
|
9
|
+
TabularFieldConstants2["TABULAR_PROPERTIES"] = "properties";
|
|
10
|
+
TabularFieldConstants2["PREDEFINED"] = "predefined";
|
|
11
|
+
TabularFieldConstants2["BUS_OR_BUSBAR_SECTION_ID"] = "busOrBusbarSectionId";
|
|
12
|
+
TabularFieldConstants2["MIN_P"] = "minP";
|
|
13
|
+
TabularFieldConstants2["MAX_P"] = "maxP";
|
|
14
|
+
TabularFieldConstants2["P0"] = "p0";
|
|
15
|
+
TabularFieldConstants2["TARGET_P"] = "targetP";
|
|
16
|
+
TabularFieldConstants2["TARGET_Q"] = "targetQ";
|
|
17
|
+
TabularFieldConstants2["PARTICIPATE"] = "participate";
|
|
18
|
+
TabularFieldConstants2["VOLTAGE_REGULATION_ON"] = "voltageRegulationOn";
|
|
19
|
+
TabularFieldConstants2["REGULATING_TERMINAL_ID"] = "regulatingTerminalId";
|
|
20
|
+
TabularFieldConstants2["REGULATING_TERMINAL_TYPE"] = "regulatingTerminalType";
|
|
21
|
+
TabularFieldConstants2["STEP_UP_TRANSFORMER_REACTANCE"] = "stepUpTransformerX";
|
|
22
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE"] = "reactiveCapabilityCurve";
|
|
23
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_POINTS"] = "reactiveCapabilityCurvePoints";
|
|
24
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_P_MIN"] = "reactiveCapabilityCurvePmin";
|
|
25
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MIN"] = "reactiveCapabilityCurveQminPmin";
|
|
26
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MIN"] = "reactiveCapabilityCurveQmaxPmin";
|
|
27
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_P_0"] = "reactiveCapabilityCurveP0";
|
|
28
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MIN_P_0"] = "reactiveCapabilityCurveQminP0";
|
|
29
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MAX_P_0"] = "reactiveCapabilityCurveQmaxP0";
|
|
30
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_P_MAX"] = "reactiveCapabilityCurvePmax";
|
|
31
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MAX"] = "reactiveCapabilityCurveQminPmax";
|
|
32
|
+
TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MAX"] = "reactiveCapabilityCurveQmaxPmax";
|
|
33
|
+
TabularFieldConstants2["CONNECTED1"] = "terminal1Connected";
|
|
34
|
+
TabularFieldConstants2["CONNECTED2"] = "terminal2Connected";
|
|
35
|
+
TabularFieldConstants2["CONNECTION_NAME1"] = "connectionName1";
|
|
36
|
+
TabularFieldConstants2["CONNECTION_NAME2"] = "connectionName2";
|
|
37
|
+
TabularFieldConstants2["CONNECTION_DIRECTION1"] = "connectionDirection1";
|
|
38
|
+
TabularFieldConstants2["CONNECTION_DIRECTION2"] = "connectionDirection2";
|
|
39
|
+
TabularFieldConstants2["CONNECTION_POSITION1"] = "connectionPosition1";
|
|
40
|
+
TabularFieldConstants2["CONNECTION_POSITION2"] = "connectionPosition2";
|
|
41
|
+
TabularFieldConstants2["IP_MIN"] = "ipMin";
|
|
42
|
+
TabularFieldConstants2["IP_MAX"] = "ipMax";
|
|
43
|
+
TabularFieldConstants2["RATIO_TAP_CHANGER_LOAD_TAP_CHANGING_CAPABILITIES"] = "ratioTapChangerLoadTapChangingCapabilities";
|
|
44
|
+
TabularFieldConstants2["RATIO_TAP_CHANGER_REGULATION_SIDE"] = "ratioTapChangerRegulationSide";
|
|
45
|
+
return TabularFieldConstants2;
|
|
46
|
+
})(TabularFieldConstants || {});
|
|
47
|
+
const TABULAR_NUMBER = "number";
|
|
48
|
+
const TABULAR_ENUM = "enum";
|
|
49
|
+
const TABULAR_BOOLEAN = "boolean";
|
|
50
|
+
const PROPERTY_CSV_COLUMN_PREFIX = "property_";
|
|
51
|
+
const REGULATING_TERMINAL_TYPES = [
|
|
52
|
+
"LINE",
|
|
53
|
+
"TWO_WINDINGS_TRANSFORMER",
|
|
54
|
+
"GENERATOR",
|
|
55
|
+
"LOAD",
|
|
56
|
+
"BATTERY",
|
|
57
|
+
"SHUNT_COMPENSATOR",
|
|
58
|
+
"STATIC_VAR_COMPENSATOR",
|
|
59
|
+
"BOUNDARY_LINE",
|
|
60
|
+
"HVDC_CONVERTER_STATION",
|
|
61
|
+
"BUSBAR_SECTION"
|
|
62
|
+
];
|
|
63
|
+
const LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION = [
|
|
64
|
+
...LOAD_TYPES,
|
|
65
|
+
{ id: UNDEFINED_LOAD_TYPE, label: "Undefined" }
|
|
66
|
+
];
|
|
67
|
+
export {
|
|
68
|
+
LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION,
|
|
69
|
+
PROPERTY_CSV_COLUMN_PREFIX,
|
|
70
|
+
REGULATING_TERMINAL_TYPES,
|
|
71
|
+
TABULAR_BOOLEAN,
|
|
72
|
+
TABULAR_ENUM,
|
|
73
|
+
TABULAR_NUMBER,
|
|
74
|
+
TabularFieldConstants
|
|
75
|
+
};
|