@gridsuite/commons-ui 0.271.0 → 0.272.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composite/customAGGrid/custom-aggrid-types.d.ts +7 -0
- package/dist/components/composite/dnd-table/deletable-table-row.d.ts +2 -1
- package/dist/components/composite/dnd-table/deletable-table-row.js +3 -1
- package/dist/components/composite/dnd-table/dnd-table-row.d.ts +2 -1
- package/dist/components/composite/dnd-table/dnd-table-row.js +29 -4
- package/dist/components/composite/dnd-table/dnd-table.d.ts +1 -0
- package/dist/components/composite/dnd-table/dnd-table.js +13 -3
- package/dist/components/composite/dnd-table/dnd-table.type.d.ts +1 -0
- package/dist/components/composite/report/report-viewer/context/report-viewer-context.d.ts +4 -4
- package/dist/components/composite/report/report-viewer/log-table/log-table.js +8 -7
- package/dist/components/composite/report/report.type.d.ts +0 -4
- package/dist/components/ui/addButton/AddButton.js +9 -1
- package/dist/components/ui/reactHookForm/DirectoryItemsInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +3 -1
- package/dist/components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js +2 -0
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +3 -1
- package/dist/components/ui/reactHookForm/booleans/SwitchInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/booleans/SwitchInput.js +12 -2
- package/dist/components/ui/reactHookForm/chip-items-input.d.ts +2 -1
- package/dist/components/ui/reactHookForm/chip-items-input.js +2 -1
- package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.d.ts +2 -1
- package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.js +3 -1
- package/dist/components/ui/reactHookForm/expandableInput/ExpandableInput.d.ts +2 -0
- package/dist/components/ui/reactHookForm/expandableInput/ExpandableInput.js +13 -2
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.d.ts +2 -1
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.js +2 -1
- package/dist/features/common/index.d.ts +1 -0
- package/dist/features/common/types.d.ts +32 -0
- package/dist/features/common/types.js +1 -0
- package/dist/features/index.d.ts +2 -0
- package/dist/features/index.js +23 -2
- package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +4 -2
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.js +2 -2
- package/dist/features/results/common/index.d.ts +7 -0
- package/dist/features/results/common/index.js +5 -0
- package/dist/features/results/common/utils.d.ts +5 -0
- package/dist/features/results/common/utils.js +18 -0
- package/dist/features/results/securityanalysis/index.js +1 -2
- package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +3 -2
- package/dist/features/results/securityanalysis/utils.d.ts +0 -1
- package/dist/features/results/securityanalysis/utils.js +0 -2
- package/dist/features/results/shortcircuit/index.d.ts +11 -0
- package/dist/features/results/shortcircuit/index.js +21 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-all-buses-result.d.ts +4 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-all-buses-result.js +25 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-content.d.ts +13 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-content.js +62 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-table.d.ts +41 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-table.js +451 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.d.ts +53 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.js +252 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.type.d.ts +41 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.type.js +8 -0
- package/dist/index.js +23 -2
- package/dist/utils/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { useTheme, Button, Box } from "@mui/material";
|
|
5
|
+
import { ShortCircuitAnalysisType } from "./shortcircuit-analysis-result.type.js";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import { OverflowableText } from "../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import { unitToKiloUnit } from "../../../utils/conversionUtils.js";
|
|
9
|
+
import "../../../utils/types/equipmentType.js";
|
|
10
|
+
import { getRows } from "../../../utils/functions.js";
|
|
11
|
+
import "react-hook-form";
|
|
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 "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
30
|
+
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
31
|
+
import "mui-nested-menu";
|
|
32
|
+
import "react-resizable-panels";
|
|
33
|
+
import "react-papaparse";
|
|
34
|
+
import "react-dom";
|
|
35
|
+
import "autosuggest-highlight/match";
|
|
36
|
+
import "autosuggest-highlight/parse";
|
|
37
|
+
import "clsx";
|
|
38
|
+
import "../../../components/composite/filter/FilterCreationDialog.js";
|
|
39
|
+
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
40
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
41
|
+
import "../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
42
|
+
import "../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
43
|
+
import "../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
44
|
+
import "react-querybuilder";
|
|
45
|
+
import "uuid";
|
|
46
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
47
|
+
import "../../../components/composite/filter/utils/filterFormUtils.js";
|
|
48
|
+
import "@react-querybuilder/material";
|
|
49
|
+
import "../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
50
|
+
import "../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
51
|
+
import "../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
52
|
+
import "../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
53
|
+
import "ag-grid-community";
|
|
54
|
+
import { CustomAGGrid } from "../../../components/composite/customAGGrid/customAggrid.js";
|
|
55
|
+
import { DefaultCellRenderer } from "../../../components/composite/customAGGrid/cell-renderers.js";
|
|
56
|
+
import "../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
57
|
+
import { FilterTextComparators, FilterDataTypes, FilterNumberComparators, TableType } from "../../../components/composite/customAGGrid/custom-aggrid-types.js";
|
|
58
|
+
import { CustomAggridAutocompleteFilter } from "../../../components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-autocomplete-filter.js";
|
|
59
|
+
import { CustomAggridComparatorFilter } from "../../../components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-comparator-filter.js";
|
|
60
|
+
import "mathjs";
|
|
61
|
+
import { makeAgGridCustomHeaderColumn } from "../../../components/composite/customAGGrid/utils/custom-aggrid-header-utils.js";
|
|
62
|
+
import "../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
63
|
+
import "react-window";
|
|
64
|
+
import "../../../components/composite/report/report-treeview/treeview-item.js";
|
|
65
|
+
import "../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
66
|
+
import { mappingTabs } from "./shortcircuit-analysis-result-content.js";
|
|
67
|
+
import { getNoRowsMessage } from "../utils/no-rows-message.js";
|
|
68
|
+
import { AGGRID_LOCALES } from "../../../translations/not-intl/aggrid-locales.js";
|
|
69
|
+
import { useIntlResultStatusMessages } from "../hooks/useIntlResultStatusMessages.js";
|
|
70
|
+
import { createMultiEnumFilterParams } from "../common/utils.js";
|
|
71
|
+
const SHORTCIRCUIT_ANALYSIS_RESULT_SORT_STORE = "shortcircuitAnalysisResult";
|
|
72
|
+
const textFilterParams = {
|
|
73
|
+
dataType: FilterDataTypes.TEXT,
|
|
74
|
+
comparators: [FilterTextComparators.STARTS_WITH, FilterTextComparators.CONTAINS]
|
|
75
|
+
};
|
|
76
|
+
const numericFilterParams = {
|
|
77
|
+
dataType: FilterDataTypes.NUMBER,
|
|
78
|
+
comparators: [
|
|
79
|
+
FilterNumberComparators.EQUALS,
|
|
80
|
+
FilterNumberComparators.NOT_EQUAL,
|
|
81
|
+
FilterNumberComparators.LESS_THAN_OR_EQUAL,
|
|
82
|
+
FilterNumberComparators.GREATER_THAN_OR_EQUAL
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
const resultsStyles = {
|
|
86
|
+
sldLink: {
|
|
87
|
+
color: "node.background",
|
|
88
|
+
maxWidth: "100%"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
function ShortCircuitAnalysisResultTable({
|
|
92
|
+
result,
|
|
93
|
+
analysisType,
|
|
94
|
+
isFetching,
|
|
95
|
+
filterEnums,
|
|
96
|
+
onRowDataUpdated,
|
|
97
|
+
onDisplayedColumnsChanged,
|
|
98
|
+
shortCircuitAnalysisStatus,
|
|
99
|
+
columnFilters,
|
|
100
|
+
onGridReady,
|
|
101
|
+
onVoltageLevelClick
|
|
102
|
+
}) {
|
|
103
|
+
const intl = useIntl();
|
|
104
|
+
const theme = useTheme();
|
|
105
|
+
const voltageLevelIdRenderer = useCallback(
|
|
106
|
+
(props) => {
|
|
107
|
+
const { value } = props || {};
|
|
108
|
+
const onClick = () => {
|
|
109
|
+
onVoltageLevelClick?.(value);
|
|
110
|
+
};
|
|
111
|
+
if (value) {
|
|
112
|
+
return /* @__PURE__ */ jsx(Button, { sx: resultsStyles.sldLink, onClick, children: /* @__PURE__ */ jsx(OverflowableText, { text: value }) });
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
},
|
|
116
|
+
[onVoltageLevelClick]
|
|
117
|
+
);
|
|
118
|
+
const getEnumLabel = useCallback(
|
|
119
|
+
(value) => value ? intl.formatMessage({
|
|
120
|
+
id: value,
|
|
121
|
+
defaultMessage: value
|
|
122
|
+
}) : "",
|
|
123
|
+
[intl]
|
|
124
|
+
);
|
|
125
|
+
const columns = useMemo(() => {
|
|
126
|
+
const isAllBusesAnalysisType = analysisType === ShortCircuitAnalysisType.ALL_BUSES;
|
|
127
|
+
const onlyIfIsAllBuses = (data, defaultData = {}) => isAllBusesAnalysisType ? data : defaultData;
|
|
128
|
+
const onlyIfIsOneBus = (data, defaultData = {}) => !isAllBusesAnalysisType ? data : defaultData;
|
|
129
|
+
const sortParams = {
|
|
130
|
+
table: SHORTCIRCUIT_ANALYSIS_RESULT_SORT_STORE,
|
|
131
|
+
tab: mappingTabs(analysisType)
|
|
132
|
+
};
|
|
133
|
+
const filterParams = {
|
|
134
|
+
type: TableType.ShortcircuitAnalysis,
|
|
135
|
+
tab: mappingTabs(analysisType)
|
|
136
|
+
};
|
|
137
|
+
const inputFilterParams = (field, filterDefinition) => {
|
|
138
|
+
return {
|
|
139
|
+
filterComponent: CustomAggridComparatorFilter,
|
|
140
|
+
filterComponentParams: {
|
|
141
|
+
filterParams: {
|
|
142
|
+
...filterDefinition,
|
|
143
|
+
...filterParams
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
const autocompleteFilterParams = (colId) => {
|
|
149
|
+
return {
|
|
150
|
+
filterComponent: CustomAggridAutocompleteFilter,
|
|
151
|
+
filterComponentParams: {
|
|
152
|
+
filterParams: {
|
|
153
|
+
dataType: FilterDataTypes.TEXT,
|
|
154
|
+
...filterParams
|
|
155
|
+
},
|
|
156
|
+
options: filterEnums[colId] ?? [],
|
|
157
|
+
getOptionLabel: getEnumLabel
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
return [
|
|
162
|
+
{
|
|
163
|
+
...makeAgGridCustomHeaderColumn({
|
|
164
|
+
headerName: intl.formatMessage({ id: "IDNode" }),
|
|
165
|
+
colId: "elementId",
|
|
166
|
+
field: "elementId",
|
|
167
|
+
context: {
|
|
168
|
+
...onlyIfIsAllBuses({ sortParams, ...inputFilterParams("elementId", textFilterParams) })
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
minWidth: 180
|
|
172
|
+
},
|
|
173
|
+
makeAgGridCustomHeaderColumn({
|
|
174
|
+
headerName: intl.formatMessage({ id: "busVoltageLevel" }),
|
|
175
|
+
colId: "voltageLevel",
|
|
176
|
+
field: "voltageLevel",
|
|
177
|
+
cellRenderer: voltageLevelIdRenderer,
|
|
178
|
+
context: {
|
|
179
|
+
...onlyIfIsAllBuses({ sortParams, ...inputFilterParams("voltageLevel", textFilterParams) })
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
182
|
+
makeAgGridCustomHeaderColumn({
|
|
183
|
+
headerName: intl.formatMessage({ id: "Type" }),
|
|
184
|
+
colId: "faultType",
|
|
185
|
+
field: "faultType",
|
|
186
|
+
filterParams: createMultiEnumFilterParams,
|
|
187
|
+
context: {
|
|
188
|
+
...onlyIfIsAllBuses({ sortParams, ...autocompleteFilterParams("faultType") })
|
|
189
|
+
},
|
|
190
|
+
valueGetter: (value) => value.data.faultType,
|
|
191
|
+
valueFormatter: (params) => getEnumLabel(params.value)
|
|
192
|
+
}),
|
|
193
|
+
makeAgGridCustomHeaderColumn({
|
|
194
|
+
headerName: intl.formatMessage({ id: "Feeders" }),
|
|
195
|
+
colId: "connectableId",
|
|
196
|
+
field: "connectableId",
|
|
197
|
+
context: {
|
|
198
|
+
sortParams: onlyIfIsAllBuses({ ...sortParams, isChildren: true }, sortParams),
|
|
199
|
+
...inputFilterParams("connectableId", textFilterParams)
|
|
200
|
+
}
|
|
201
|
+
}),
|
|
202
|
+
makeAgGridCustomHeaderColumn({
|
|
203
|
+
headerName: intl.formatMessage({ id: "IscKA" }),
|
|
204
|
+
colId: "current",
|
|
205
|
+
field: "current",
|
|
206
|
+
context: {
|
|
207
|
+
numeric: true,
|
|
208
|
+
fractionDigits: 2,
|
|
209
|
+
sortParams,
|
|
210
|
+
...inputFilterParams("current", numericFilterParams)
|
|
211
|
+
},
|
|
212
|
+
valueGetter: (params) => unitToKiloUnit(params.data?.current)
|
|
213
|
+
}),
|
|
214
|
+
makeAgGridCustomHeaderColumn({
|
|
215
|
+
headerName: intl.formatMessage({ id: "Side" }),
|
|
216
|
+
colId: "side",
|
|
217
|
+
field: "side",
|
|
218
|
+
hide: isAllBusesAnalysisType,
|
|
219
|
+
filterParams: createMultiEnumFilterParams,
|
|
220
|
+
context: {
|
|
221
|
+
...onlyIfIsOneBus({ sortParams, ...autocompleteFilterParams("side") })
|
|
222
|
+
},
|
|
223
|
+
valueGetter: (value) => value.data.side,
|
|
224
|
+
valueFormatter: (params) => getEnumLabel(params.value)
|
|
225
|
+
}),
|
|
226
|
+
{
|
|
227
|
+
...makeAgGridCustomHeaderColumn({
|
|
228
|
+
headerName: intl.formatMessage({ id: "LimitType" }),
|
|
229
|
+
colId: "limitType",
|
|
230
|
+
field: "limitType",
|
|
231
|
+
filterParams: createMultiEnumFilterParams,
|
|
232
|
+
context: {
|
|
233
|
+
...onlyIfIsAllBuses({ sortParams, ...autocompleteFilterParams("limitType") })
|
|
234
|
+
},
|
|
235
|
+
valueGetter: (value) => value.data.limitType,
|
|
236
|
+
valueFormatter: (params) => getEnumLabel(params.value)
|
|
237
|
+
}),
|
|
238
|
+
minWidth: 150
|
|
239
|
+
},
|
|
240
|
+
makeAgGridCustomHeaderColumn({
|
|
241
|
+
headerName: intl.formatMessage({ id: "IscMinKA" }),
|
|
242
|
+
colId: "limitMin",
|
|
243
|
+
field: "limitMin",
|
|
244
|
+
context: {
|
|
245
|
+
numeric: true,
|
|
246
|
+
fractionDigits: 2,
|
|
247
|
+
...onlyIfIsAllBuses({ sortParams, ...inputFilterParams("limitMin", numericFilterParams) })
|
|
248
|
+
},
|
|
249
|
+
valueGetter: (params) => unitToKiloUnit(params.data?.limitMin)
|
|
250
|
+
}),
|
|
251
|
+
makeAgGridCustomHeaderColumn({
|
|
252
|
+
headerName: intl.formatMessage({ id: "IscMaxKA" }),
|
|
253
|
+
colId: "limitMax",
|
|
254
|
+
field: "limitMax",
|
|
255
|
+
context: {
|
|
256
|
+
numeric: true,
|
|
257
|
+
fractionDigits: 2,
|
|
258
|
+
...onlyIfIsAllBuses({ sortParams, ...inputFilterParams("limitMax", numericFilterParams) })
|
|
259
|
+
},
|
|
260
|
+
valueGetter: (params) => unitToKiloUnit(params.data?.limitMax)
|
|
261
|
+
}),
|
|
262
|
+
makeAgGridCustomHeaderColumn({
|
|
263
|
+
headerName: intl.formatMessage({ id: "PscMVA" }),
|
|
264
|
+
colId: "shortCircuitPower",
|
|
265
|
+
field: "shortCircuitPower",
|
|
266
|
+
context: {
|
|
267
|
+
numeric: true,
|
|
268
|
+
fractionDigits: 2,
|
|
269
|
+
...onlyIfIsAllBuses({ sortParams, ...inputFilterParams("shortCircuitPower", numericFilterParams) })
|
|
270
|
+
}
|
|
271
|
+
}),
|
|
272
|
+
{
|
|
273
|
+
...makeAgGridCustomHeaderColumn({
|
|
274
|
+
headerName: intl.formatMessage({ id: "deltaCurrentIpMin" }),
|
|
275
|
+
colId: "deltaCurrentIpMin",
|
|
276
|
+
field: "deltaCurrentIpMin",
|
|
277
|
+
context: {
|
|
278
|
+
numeric: true,
|
|
279
|
+
fractionDigits: 2,
|
|
280
|
+
...onlyIfIsAllBuses({
|
|
281
|
+
sortParams,
|
|
282
|
+
...inputFilterParams("deltaCurrentIpMin", numericFilterParams)
|
|
283
|
+
})
|
|
284
|
+
},
|
|
285
|
+
valueGetter: (params) => unitToKiloUnit(params.data?.deltaCurrentIpMin)
|
|
286
|
+
}),
|
|
287
|
+
minWidth: 180
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
...makeAgGridCustomHeaderColumn({
|
|
291
|
+
headerName: intl.formatMessage({ id: "deltaCurrentIpMax" }),
|
|
292
|
+
colId: "deltaCurrentIpMax",
|
|
293
|
+
field: "deltaCurrentIpMax",
|
|
294
|
+
context: {
|
|
295
|
+
numeric: true,
|
|
296
|
+
fractionDigits: 2,
|
|
297
|
+
...onlyIfIsAllBuses({
|
|
298
|
+
sortParams,
|
|
299
|
+
...inputFilterParams("deltaCurrentIpMax", numericFilterParams)
|
|
300
|
+
})
|
|
301
|
+
},
|
|
302
|
+
valueGetter: (params) => unitToKiloUnit(params.data?.deltaCurrentIpMax)
|
|
303
|
+
}),
|
|
304
|
+
minWidth: 180
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
field: "linkedElementId",
|
|
308
|
+
hide: true
|
|
309
|
+
}
|
|
310
|
+
];
|
|
311
|
+
}, [analysisType, intl, voltageLevelIdRenderer, filterEnums, getEnumLabel]);
|
|
312
|
+
const messages = useIntlResultStatusMessages(intl, true, (columnFilters?.length ?? 0) > 0);
|
|
313
|
+
const getRowStyle = useCallback(
|
|
314
|
+
(params) => {
|
|
315
|
+
if (!params?.data?.linkedElementId) {
|
|
316
|
+
return {
|
|
317
|
+
backgroundColor: theme.selectedRow.background
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
return void 0;
|
|
321
|
+
},
|
|
322
|
+
[theme.selectedRow.background]
|
|
323
|
+
);
|
|
324
|
+
const defaultColDef = useMemo(
|
|
325
|
+
() => ({
|
|
326
|
+
suppressMovable: true,
|
|
327
|
+
resizable: true,
|
|
328
|
+
flex: 1,
|
|
329
|
+
cellRenderer: DefaultCellRenderer
|
|
330
|
+
}),
|
|
331
|
+
[]
|
|
332
|
+
);
|
|
333
|
+
const handleRowDataUpdated = useCallback(
|
|
334
|
+
(event) => {
|
|
335
|
+
if (event?.api) {
|
|
336
|
+
onRowDataUpdated(event);
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
[onRowDataUpdated]
|
|
340
|
+
);
|
|
341
|
+
const getCurrent = useCallback(
|
|
342
|
+
(x) => {
|
|
343
|
+
let current = Number.NaN;
|
|
344
|
+
if (analysisType === ShortCircuitAnalysisType.ALL_BUSES) {
|
|
345
|
+
current = x.current;
|
|
346
|
+
} else if (analysisType === ShortCircuitAnalysisType.ONE_BUS) {
|
|
347
|
+
current = x.positiveMagnitude;
|
|
348
|
+
}
|
|
349
|
+
return current;
|
|
350
|
+
},
|
|
351
|
+
[analysisType]
|
|
352
|
+
);
|
|
353
|
+
const flattenResult = useCallback(
|
|
354
|
+
(shortCircuitAnalysisResult) => {
|
|
355
|
+
const rows2 = [];
|
|
356
|
+
shortCircuitAnalysisResult?.forEach((faultResult) => {
|
|
357
|
+
const { fault } = faultResult;
|
|
358
|
+
const limitViolations = faultResult.limitViolations ?? [];
|
|
359
|
+
let firstLimitViolation;
|
|
360
|
+
if (limitViolations.length > 0) {
|
|
361
|
+
const lv = limitViolations[0];
|
|
362
|
+
firstLimitViolation = {
|
|
363
|
+
limitType: lv.limitType
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
const current = getCurrent(faultResult);
|
|
367
|
+
const { deltaCurrentIpMax } = faultResult.shortCircuitLimits;
|
|
368
|
+
const { deltaCurrentIpMin } = faultResult.shortCircuitLimits;
|
|
369
|
+
rows2.push({
|
|
370
|
+
faultId: fault.id,
|
|
371
|
+
elementId: fault.elementId,
|
|
372
|
+
voltageLevel: fault.voltageLevelId,
|
|
373
|
+
faultType: fault.faultType,
|
|
374
|
+
shortCircuitPower: faultResult.shortCircuitPower,
|
|
375
|
+
limitMin: faultResult.shortCircuitLimits.ipMin,
|
|
376
|
+
limitMax: faultResult.shortCircuitLimits.ipMax,
|
|
377
|
+
deltaCurrentIpMax,
|
|
378
|
+
deltaCurrentIpMin,
|
|
379
|
+
current,
|
|
380
|
+
connectableId: "",
|
|
381
|
+
...firstLimitViolation
|
|
382
|
+
});
|
|
383
|
+
limitViolations.slice(1).forEach((lv) => {
|
|
384
|
+
rows2.push({
|
|
385
|
+
limitType: lv.limitType,
|
|
386
|
+
limitMin: lv.limitType === "LOW_SHORT_CIRCUIT_CURRENT" ? lv.limit : null,
|
|
387
|
+
limitMax: lv.limitType === "HIGH_SHORT_CIRCUIT_CURRENT" ? lv.limit : null,
|
|
388
|
+
current: lv.value,
|
|
389
|
+
elementId: "",
|
|
390
|
+
voltageLevel: "",
|
|
391
|
+
faultType: "",
|
|
392
|
+
connectableId: ""
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
const feederResults = faultResult.feederResults ?? [];
|
|
396
|
+
feederResults.forEach((feederResult) => {
|
|
397
|
+
const feederCurrent = getCurrent(feederResult);
|
|
398
|
+
const side = analysisType === ShortCircuitAnalysisType.ONE_BUS ? feederResult.side : void 0;
|
|
399
|
+
rows2.push({
|
|
400
|
+
connectableId: feederResult.connectableId,
|
|
401
|
+
linkedElementId: fault.id,
|
|
402
|
+
current: feederCurrent,
|
|
403
|
+
elementId: "",
|
|
404
|
+
voltageLevel: "",
|
|
405
|
+
faultType: "",
|
|
406
|
+
limitType: "",
|
|
407
|
+
side
|
|
408
|
+
});
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
return rows2;
|
|
412
|
+
},
|
|
413
|
+
[getCurrent, analysisType]
|
|
414
|
+
);
|
|
415
|
+
const rows = useMemo(() => {
|
|
416
|
+
if (result) {
|
|
417
|
+
return flattenResult(result);
|
|
418
|
+
}
|
|
419
|
+
return void 0;
|
|
420
|
+
}, [flattenResult, result]);
|
|
421
|
+
const message = getNoRowsMessage(messages, rows, shortCircuitAnalysisStatus, !isFetching);
|
|
422
|
+
const rowsToShow = getRows(rows, shortCircuitAnalysisStatus);
|
|
423
|
+
return /* @__PURE__ */ jsx(Box, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ jsx(
|
|
424
|
+
CustomAGGrid,
|
|
425
|
+
{
|
|
426
|
+
rowData: rowsToShow,
|
|
427
|
+
defaultColDef,
|
|
428
|
+
onGridReady,
|
|
429
|
+
getRowStyle,
|
|
430
|
+
columnDefs: columns,
|
|
431
|
+
overlayNoRowsTemplate: message,
|
|
432
|
+
onRowDataUpdated: handleRowDataUpdated,
|
|
433
|
+
onDisplayedColumnsChanged,
|
|
434
|
+
overrideLocales: AGGRID_LOCALES,
|
|
435
|
+
onModelUpdated: ({ api }) => {
|
|
436
|
+
if (api.getDisplayedRowCount()) {
|
|
437
|
+
api.hideOverlay();
|
|
438
|
+
} else {
|
|
439
|
+
api.showNoRowsOverlay();
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
) });
|
|
444
|
+
}
|
|
445
|
+
export {
|
|
446
|
+
SHORTCIRCUIT_ANALYSIS_RESULT_SORT_STORE,
|
|
447
|
+
ShortCircuitAnalysisResultTable,
|
|
448
|
+
numericFilterParams,
|
|
449
|
+
resultsStyles,
|
|
450
|
+
textFilterParams
|
|
451
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { DisplayedColumnsChangedEvent, GridReadyEvent, RowDataUpdatedEvent } from 'ag-grid-community';
|
|
3
|
+
import { ShortcircuitFilterConfig } from './shortcircuit-analysis-result-content';
|
|
4
|
+
import { SCAFaultResult, SCAFeederResult, SCAPagedResults, ShortCircuitAnalysisType } from './shortcircuit-analysis-result.type';
|
|
5
|
+
import { ShortcircuitColumnFilter } from './shortcircuit-analysis-result-table';
|
|
6
|
+
import { ComputingType, RunningStatus } from '../../../utils';
|
|
7
|
+
import { PaginationConfig, SortConfig } from '../../../components';
|
|
8
|
+
import { GlobalFilters } from '../../global-filter';
|
|
9
|
+
export type FetchPagedResultsParams = {
|
|
10
|
+
studyUuid: UUID | null;
|
|
11
|
+
currentNodeUuid: UUID | undefined;
|
|
12
|
+
currentRootNetworkUuid: UUID;
|
|
13
|
+
type: ShortCircuitAnalysisType;
|
|
14
|
+
selector: {
|
|
15
|
+
page: number;
|
|
16
|
+
size: number;
|
|
17
|
+
filter: ShortcircuitFilterConfig[] | null;
|
|
18
|
+
sort: SortConfig[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
globalFilters?: GlobalFilters;
|
|
21
|
+
};
|
|
22
|
+
export type FetchFilterEnumValuesParams = {
|
|
23
|
+
studyUuid: UUID;
|
|
24
|
+
currentNodeUuid: UUID;
|
|
25
|
+
currentRootNetworkUuid: UUID;
|
|
26
|
+
computingType: ComputingType;
|
|
27
|
+
filterType: string;
|
|
28
|
+
};
|
|
29
|
+
export interface IShortCircuitAnalysisGlobalResultProps {
|
|
30
|
+
analysisType: ShortCircuitAnalysisType;
|
|
31
|
+
analysisStatus: RunningStatus;
|
|
32
|
+
result: SCAFaultResult[] | undefined;
|
|
33
|
+
updateResult: (result: SCAFaultResult[] | SCAFeederResult[] | null) => void;
|
|
34
|
+
customTablePaginationProps?: any;
|
|
35
|
+
onGridColumnsChanged: (params: GridReadyEvent) => void;
|
|
36
|
+
onRowDataUpdated: (event: RowDataUpdatedEvent) => void;
|
|
37
|
+
onDisplayedColumnsChanged: (event: DisplayedColumnsChangedEvent) => void;
|
|
38
|
+
studyUuid: UUID | null;
|
|
39
|
+
currentNodeUuid: UUID | null | undefined;
|
|
40
|
+
currentRootNetworkUuid: UUID | null | undefined;
|
|
41
|
+
sortConfig?: SortConfig[];
|
|
42
|
+
columnFilters?: ShortcircuitColumnFilter[];
|
|
43
|
+
globalFilters?: GlobalFilters;
|
|
44
|
+
pagination: PaginationConfig;
|
|
45
|
+
onPageChange: (newPage: number) => void;
|
|
46
|
+
onRowsPerPageChange: (newRowsPerPage: number) => void;
|
|
47
|
+
fetchPagedResults: (params: FetchPagedResultsParams) => Promise<SCAPagedResults | null>;
|
|
48
|
+
fetchFilterEnumValues: (params: FetchFilterEnumValuesParams) => Promise<string[]>;
|
|
49
|
+
mapFieldsToColumnsFilter?: (filters: ShortcircuitFilterConfig[], mapping: Record<string, string>) => ShortcircuitFilterConfig[];
|
|
50
|
+
onVoltageLevelClick?: (voltageLevelId: string) => void;
|
|
51
|
+
onGridReady?: (params: GridReadyEvent) => void;
|
|
52
|
+
}
|
|
53
|
+
export declare function ShortCircuitAnalysisResult({ analysisType, analysisStatus, result, updateResult, customTablePaginationProps, onGridColumnsChanged, onRowDataUpdated, onDisplayedColumnsChanged, studyUuid, currentNodeUuid, currentRootNetworkUuid, sortConfig, columnFilters, globalFilters, pagination, onPageChange, onRowsPerPageChange, fetchPagedResults, fetchFilterEnumValues, mapFieldsToColumnsFilter, onVoltageLevelClick, onGridReady, }: IShortCircuitAnalysisGlobalResultProps): import("react").JSX.Element;
|