@gridsuite/commons-ui 0.192.0 → 0.194.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/directoryItemSelector/DirectoryItemSelector.js +0 -1
- package/dist/components/dnd-table-v2/deletable-table-row.d.ts +7 -0
- package/dist/components/dnd-table-v2/deletable-table-row.js +37 -0
- package/dist/components/dnd-table-v2/dnd-table-add-rows-dialog.d.ts +13 -0
- package/dist/components/dnd-table-v2/dnd-table-add-rows-dialog.js +75 -0
- package/dist/components/dnd-table-v2/dnd-table-bottom-left-buttons.d.ts +17 -0
- package/dist/components/dnd-table-v2/dnd-table-bottom-left-buttons.js +48 -0
- package/dist/components/dnd-table-v2/dnd-table-bottom-right-buttons.d.ts +17 -0
- package/dist/components/dnd-table-v2/dnd-table-bottom-right-buttons.js +103 -0
- package/dist/components/dnd-table-v2/dnd-table-row.d.ts +23 -0
- package/dist/components/dnd-table-v2/dnd-table-row.js +183 -0
- package/dist/components/dnd-table-v2/dnd-table-utils.d.ts +2 -0
- package/dist/components/dnd-table-v2/dnd-table-utils.js +10 -0
- package/dist/components/dnd-table-v2/dnd-table.d.ts +32 -0
- package/dist/components/dnd-table-v2/dnd-table.js +381 -0
- package/dist/components/dnd-table-v2/dnd-table.type.d.ts +70 -0
- package/dist/components/dnd-table-v2/dnd-table.type.js +19 -0
- package/dist/components/dnd-table-v2/index.d.ts +12 -0
- package/dist/components/dnd-table-v2/index.js +16 -0
- package/dist/components/filter/constants/FilterConstants.d.ts +6 -2
- package/dist/components/filter/constants/FilterConstants.js +1 -10
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +2 -1
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -1
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +1 -1
- package/dist/components/filter/filter.type.d.ts +27 -17
- package/dist/components/filter/index.js +1 -2
- package/dist/components/index.js +12 -12
- package/dist/components/inputs/checkbox-autocomplete/checkbox-autocomplete.d.ts +12 -0
- package/dist/components/inputs/checkbox-autocomplete/checkbox-autocomplete.js +126 -0
- package/dist/components/inputs/checkbox-autocomplete/checkbox-item.d.ts +8 -0
- package/dist/components/inputs/checkbox-autocomplete/checkbox-item.js +17 -0
- package/dist/components/inputs/checkbox-autocomplete/index.d.ts +7 -0
- package/dist/components/inputs/checkbox-autocomplete/index.js +4 -0
- package/dist/components/inputs/checkbox-autocomplete/virtualized-list-item.d.ts +15 -0
- package/dist/components/inputs/checkbox-autocomplete/virtualized-list-item.js +27 -0
- package/dist/components/inputs/checkbox-autocomplete/virtualized-list.d.ts +3 -0
- package/dist/components/inputs/checkbox-autocomplete/virtualized-list.js +30 -0
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +1 -2
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +2 -5
- package/dist/components/inputs/reactHookForm/booleans/BooleanInput.js +6 -4
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +0 -1
- package/dist/components/parameters/common/contingency-table/columns-definitions.d.ts +4 -3
- package/dist/components/parameters/common/contingency-table/columns-definitions.js +23 -15
- package/dist/components/parameters/common/contingency-table/contingency-table.d.ts +2 -1
- package/dist/components/parameters/common/contingency-table/contingency-table.js +45 -44
- package/dist/components/parameters/common/contingency-table/index.js +2 -2
- package/dist/components/parameters/common/hook/index.d.ts +8 -0
- package/dist/components/parameters/common/hook/index.js +6 -0
- package/dist/components/parameters/common/hook/use-parameters-form.d.ts +13 -0
- package/dist/components/parameters/common/hook/use-parameters-form.js +60 -0
- package/dist/components/parameters/common/hook/use-tabs.d.ts +13 -0
- package/dist/components/parameters/common/hook/use-tabs.js +60 -0
- package/dist/components/parameters/common/index.d.ts +1 -0
- package/dist/components/parameters/common/index.js +7 -3
- package/dist/components/parameters/common/parameter-field.js +4 -0
- package/dist/components/parameters/common/parameter-table/table-cell.js +1 -1
- package/dist/components/parameters/common/parameter-table-field/constants.d.ts +10 -0
- package/dist/components/parameters/common/parameter-table-field/constants.js +10 -0
- package/dist/components/parameters/common/{parameter-table → parameter-table-field}/index.d.ts +2 -3
- package/dist/components/parameters/common/parameter-table-field/index.js +9 -0
- package/dist/components/parameters/common/parameter-table-field/parameter-table-field.d.ts +11 -0
- package/dist/components/parameters/common/parameter-table-field/parameter-table-field.js +121 -0
- package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +1 -1
- package/dist/components/parameters/common/utils.d.ts +2 -15
- package/dist/components/parameters/common/utils.js +1 -40
- package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.d.ts +4 -3
- package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +21 -12
- package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +11 -6
- package/dist/components/parameters/dynamic-margin-calculation/loads-variations-parameters.js +9 -7
- package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.d.ts +1 -3
- package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +11 -54
- package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.js +16 -7
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +11 -6
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +4 -3
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +43 -40
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis.type.d.ts +10 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis.type.js +8 -0
- package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.js +15 -6
- package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.d.ts +1 -6
- package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +21 -96
- package/dist/components/parameters/dynamic-simulation/curve/common/checkbox-select.d.ts +15 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/checkbox-select.js +83 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/checkbox-treeview.d.ts +22 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/checkbox-treeview.js +163 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/curve.type.d.ts +14 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/curve.type.js +1 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/grid-buttons.d.ts +8 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/grid-buttons.js +39 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/grid-search.d.ts +8 -0
- package/dist/components/parameters/dynamic-simulation/curve/common/grid-search.js +60 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters-constants.d.ts +11 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters-constants.js +9 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters-utils.d.ts +12 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters-utils.js +18 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters.d.ts +11 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters.js +177 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters.type.d.ts +6 -0
- package/dist/components/parameters/dynamic-simulation/curve/curve-parameters.type.js +1 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-preview.d.ts +8 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-preview.js +123 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-selector-dialog.d.ts +15 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-selector-dialog.js +126 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-selector-utils.d.ts +20 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-selector-utils.js +283 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-selector.d.ts +16 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/curve-selector.js +96 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/equipment-filter.d.ts +14 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/equipment-filter.js +239 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/model-filter-utils.d.ts +3 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/model-filter-utils.js +68 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/model-filter.d.ts +12 -0
- package/dist/components/parameters/dynamic-simulation/curve/dialog/model-filter.js +148 -0
- package/dist/components/parameters/dynamic-simulation/dynamic-simulation-inline.d.ts +15 -0
- package/dist/components/parameters/dynamic-simulation/dynamic-simulation-inline.js +193 -0
- package/dist/components/parameters/dynamic-simulation/dynamic-simulation-parameters-form.d.ts +15 -0
- package/dist/components/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +155 -0
- package/dist/components/parameters/dynamic-simulation/dynamic-simulation.type.d.ts +13 -0
- package/dist/components/parameters/dynamic-simulation/dynamic-simulation.type.js +11 -0
- package/dist/components/parameters/dynamic-simulation/hook/use-default-params.d.ts +4 -0
- package/dist/components/parameters/dynamic-simulation/hook/use-default-params.js +22 -0
- package/dist/components/parameters/dynamic-simulation/index.d.ts +7 -0
- package/dist/components/parameters/dynamic-simulation/index.js +4 -0
- package/dist/components/parameters/dynamic-simulation/mapping/index.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/mapping/index.js +9 -0
- package/dist/components/parameters/dynamic-simulation/mapping/mapping-parameters-constants.d.ts +7 -0
- package/dist/components/parameters/dynamic-simulation/mapping/mapping-parameters-constants.js +4 -0
- package/dist/components/parameters/dynamic-simulation/mapping/mapping-parameters-utils.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/mapping/mapping-parameters-utils.js +13 -0
- package/dist/components/parameters/dynamic-simulation/mapping/mapping-parameters.d.ts +5 -0
- package/dist/components/parameters/dynamic-simulation/mapping/mapping-parameters.js +52 -0
- package/dist/components/parameters/dynamic-simulation/network/index.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/network/index.js +10 -0
- package/dist/components/parameters/dynamic-simulation/network/network-parameters-constants.d.ts +29 -0
- package/dist/components/parameters/dynamic-simulation/network/network-parameters-constants.js +28 -0
- package/dist/components/parameters/dynamic-simulation/network/network-parameters-utils.d.ts +66 -0
- package/dist/components/parameters/dynamic-simulation/network/network-parameters-utils.js +51 -0
- package/dist/components/parameters/dynamic-simulation/network/network-parameters.d.ts +3 -0
- package/dist/components/parameters/dynamic-simulation/network/network-parameters.js +120 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters-constants.d.ts +31 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters-constants.js +29 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters-utils.d.ts +26 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters-utils.js +33 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters.d.ts +3 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters.js +134 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/index.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/solver/common-solver/index.js +8 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters-constants.d.ts +14 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters-constants.js +12 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters-utils.d.ts +62 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters-utils.js +17 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters.d.ts +3 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters.js +53 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/index.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/solver/ida-solver/index.js +8 -0
- package/dist/components/parameters/dynamic-simulation/solver/index.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/solver/index.js +9 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/index.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/index.js +8 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters-constant.d.ts +26 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters-constant.js +24 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters-utils.d.ts +86 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters-utils.js +31 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters.d.ts +3 -0
- package/dist/components/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters.js +113 -0
- package/dist/components/parameters/dynamic-simulation/solver/solver-parameters-constants.d.ts +10 -0
- package/dist/components/parameters/dynamic-simulation/solver/solver-parameters-constants.js +8 -0
- package/dist/components/parameters/dynamic-simulation/solver/solver-parameters-utils.d.ts +12 -0
- package/dist/components/parameters/dynamic-simulation/solver/solver-parameters-utils.js +38 -0
- package/dist/components/parameters/dynamic-simulation/solver/solver-parameters.d.ts +5 -0
- package/dist/components/parameters/dynamic-simulation/solver/solver-parameters.js +52 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/index.d.ts +9 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/index.js +9 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/time-delay-parameters-constants.d.ts +10 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/time-delay-parameters-constants.js +8 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/time-delay-parameters-utils.d.ts +12 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/time-delay-parameters-utils.js +21 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/time-delay-parameters.d.ts +3 -0
- package/dist/components/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +30 -0
- package/dist/components/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.d.ts +13 -0
- package/dist/components/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js +124 -0
- package/dist/components/parameters/index.d.ts +2 -1
- package/dist/components/parameters/index.js +12 -11
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +4 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +4 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +4 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-header.js +4 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +5 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +4 -0
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +3 -1
- package/dist/components/parameters/network-visualizations/map-parameters.js +4 -0
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +4 -0
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +5 -1
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +4 -0
- package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +4 -0
- package/dist/components/parameters/pcc-min/pcc-min-parameters-inline.js +5 -1
- package/dist/components/parameters/security-analysis/columns-definitions.js +3 -0
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +5 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +7 -4
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +4 -0
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +4 -2
- package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +4 -0
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +1 -1
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +7 -3
- package/dist/components/parameters/sensi/columns-definitions.d.ts +7 -180
- package/dist/components/parameters/sensi/columns-definitions.js +83 -73
- package/dist/components/parameters/sensi/index.js +1 -6
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +5 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +6 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +4 -0
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +54 -51
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.d.ts +2 -2
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +41 -61
- package/dist/components/parameters/sensi/utils.d.ts +4 -4
- package/dist/components/parameters/sensi/utils.js +9 -6
- package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.js +4 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-content.js +4 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +3 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +5 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +4 -0
- package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +4 -0
- package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.js +4 -0
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +2 -0
- package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +4 -0
- package/dist/components/parameters/voltage-init/general-parameters.js +4 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +4 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +5 -1
- package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +17 -31
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -2
- package/dist/index.js +27 -15
- package/dist/services/dynamic-mapping.d.ts +3 -0
- package/dist/services/dynamic-mapping.js +21 -0
- package/dist/services/dynamic-margin-calculation.js +1 -1
- package/dist/services/dynamic-simulation.d.ts +5 -0
- package/dist/services/dynamic-simulation.js +35 -0
- package/dist/services/index.d.ts +3 -1
- package/dist/services/index.js +8 -1
- package/dist/translations/en/parameters.d.ts +101 -2
- package/dist/translations/en/parameters.js +115 -2
- package/dist/translations/fr/parameters.d.ts +101 -2
- package/dist/translations/fr/parameters.js +115 -2
- package/dist/translations/not-intl/aggrid-locales.d.ts +8 -0
- package/dist/translations/not-intl/aggrid-locales.js +12 -0
- package/dist/utils/directory-utils.d.ts +2 -0
- package/dist/utils/directory-utils.js +11 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +8 -1
- package/dist/utils/types/dynamic-simulation.type.d.ts +14 -24
- package/dist/utils/types/elementType.d.ts +2 -1
- package/dist/utils/types/elementType.js +2 -1
- package/dist/utils/types/equipmentType.d.ts +9 -0
- package/dist/utils/types/equipmentType.js +52 -0
- package/dist/utils/types/index.js +6 -1
- package/dist/utils/types/parameters.type.d.ts +2 -2
- package/dist/utils/types/types.d.ts +11 -0
- package/package.json +3 -1
- package/dist/components/parameters/common/parameter-dnd-table-field.d.ts +0 -9
- package/dist/components/parameters/common/parameter-dnd-table-field.js +0 -86
- package/dist/components/parameters/common/parameter-table/index.js +0 -10
- package/dist/components/parameters/util/make-component-utils.d.ts +0 -17
- package/dist/components/parameters/util/make-component-utils.js +0 -97
- package/dist/components/parameters/util/styles.d.ts +0 -38
- package/dist/components/parameters/util/styles.js +0 -41
- package/dist/hooks/use-create-row-data.d.ts +0 -4
- package/dist/hooks/use-create-row-data.js +0 -19
- /package/dist/components/parameters/sensi/{sensitivity-Flow-parameters.d.ts → sensitivity-parameters-fields.d.ts} +0 -0
- /package/dist/components/parameters/sensi/{sensitivity-Flow-parameters.js → sensitivity-parameters-fields.js} +0 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { useState, useCallback, useRef, useMemo } from "react";
|
|
4
|
+
import { useFormContext, useWatch } from "react-hook-form";
|
|
5
|
+
import { Grid, TableContainer, Table, TableHead, TableRow, TableCell, Box, Tooltip, IconButton, TableBody, Checkbox } from "@mui/material";
|
|
6
|
+
import { DragDropContext, Droppable, Draggable } from "@hello-pangea/dnd";
|
|
7
|
+
import { useIntl } from "react-intl";
|
|
8
|
+
import { AddCircle } from "@mui/icons-material";
|
|
9
|
+
import { MAX_ROWS_NUMBER, SELECTED } from "./dnd-table.type.js";
|
|
10
|
+
import { DndTableBottomLeftButtons } from "./dnd-table-bottom-left-buttons.js";
|
|
11
|
+
import { DndTableBottomRightButtons } from "./dnd-table-bottom-right-buttons.js";
|
|
12
|
+
import { DndTableAddRowsDialog } from "./dnd-table-add-rows-dialog.js";
|
|
13
|
+
import "../overflowableText/OverflowableText.js";
|
|
14
|
+
import "../../utils/conversionUtils.js";
|
|
15
|
+
import "../../utils/types/equipmentType.js";
|
|
16
|
+
import { mergeSx } from "../../utils/styles.js";
|
|
17
|
+
import "../../utils/yupConfig.js";
|
|
18
|
+
import "localized-countries";
|
|
19
|
+
import "localized-countries/data/fr";
|
|
20
|
+
import "localized-countries/data/en";
|
|
21
|
+
import "notistack";
|
|
22
|
+
import "../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
23
|
+
import "yup";
|
|
24
|
+
import { ErrorInput } from "../inputs/reactHookForm/errorManagement/ErrorInput.js";
|
|
25
|
+
import { FieldErrorAlert } from "../inputs/reactHookForm/errorManagement/FieldErrorAlert.js";
|
|
26
|
+
import "../treeViewFinder/TreeViewFinder.js";
|
|
27
|
+
import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
28
|
+
import "../customAGGrid/customAggrid.js";
|
|
29
|
+
import "ag-grid-community";
|
|
30
|
+
import "react-papaparse";
|
|
31
|
+
import "react-csv-downloader";
|
|
32
|
+
import "../inputs/reactHookForm/numbers/RangeInput.js";
|
|
33
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
34
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
35
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
36
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
37
|
+
import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
38
|
+
import "../inputs/reactHookForm/expandableInput/ExpandableInput.js";
|
|
39
|
+
import "@react-querybuilder/material";
|
|
40
|
+
import "../filter/expert/expertFilterConstants.js";
|
|
41
|
+
import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
42
|
+
import "uuid";
|
|
43
|
+
import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
44
|
+
import "react-querybuilder";
|
|
45
|
+
import { DndTableRow } from "./dnd-table-row.js";
|
|
46
|
+
const styles = {
|
|
47
|
+
columnsStyle: {
|
|
48
|
+
display: "inline-flex",
|
|
49
|
+
justifyContent: "space-between",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
margin: 1,
|
|
52
|
+
textTransform: "none"
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function MultiCheckbox({
|
|
56
|
+
arrayFormName,
|
|
57
|
+
handleClickCheck,
|
|
58
|
+
handleClickUncheck,
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
const arrayToWatch = useWatch({
|
|
62
|
+
name: arrayFormName
|
|
63
|
+
});
|
|
64
|
+
const allRowSelected = useMemo(
|
|
65
|
+
() => arrayToWatch ? arrayToWatch?.every((row) => row[SELECTED]) : false,
|
|
66
|
+
[arrayToWatch]
|
|
67
|
+
);
|
|
68
|
+
const someRowSelected = useMemo(
|
|
69
|
+
() => arrayToWatch ? arrayToWatch?.some((row) => row[SELECTED]) : false,
|
|
70
|
+
[arrayToWatch]
|
|
71
|
+
);
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
Checkbox,
|
|
74
|
+
{
|
|
75
|
+
checked: arrayToWatch?.length > 0 && allRowSelected,
|
|
76
|
+
indeterminate: someRowSelected && !allRowSelected,
|
|
77
|
+
onChange: (event) => {
|
|
78
|
+
if (event.target.checked) {
|
|
79
|
+
handleClickCheck();
|
|
80
|
+
} else {
|
|
81
|
+
handleClickUncheck();
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
function DndTable(props) {
|
|
89
|
+
const {
|
|
90
|
+
name,
|
|
91
|
+
useFieldArrayOutput,
|
|
92
|
+
columnsDefinition,
|
|
93
|
+
tableHeight,
|
|
94
|
+
allowedToAddRows = () => Promise.resolve(true),
|
|
95
|
+
createRows,
|
|
96
|
+
disabled = false,
|
|
97
|
+
withResetButton = false,
|
|
98
|
+
withAddRowsDialog = true,
|
|
99
|
+
previousValues,
|
|
100
|
+
disableTableCell,
|
|
101
|
+
getPreviousValue,
|
|
102
|
+
isValueModified,
|
|
103
|
+
disableAddingRows = false,
|
|
104
|
+
showMoveArrow = true,
|
|
105
|
+
disableDragAndDrop = false,
|
|
106
|
+
handleUploadButton = void 0,
|
|
107
|
+
uploadButtonMessageId = void 0,
|
|
108
|
+
handleResetButton = void 0,
|
|
109
|
+
resetButtonMessageId = void 0,
|
|
110
|
+
maxRows = MAX_ROWS_NUMBER,
|
|
111
|
+
disabledDeletion,
|
|
112
|
+
multiselect,
|
|
113
|
+
onChange,
|
|
114
|
+
onDelete
|
|
115
|
+
} = props;
|
|
116
|
+
const intl = useIntl();
|
|
117
|
+
const { getValues, setValue, setError, clearErrors } = useFormContext();
|
|
118
|
+
const {
|
|
119
|
+
fields: currentRows,
|
|
120
|
+
// don't use it to access form data ! check doc
|
|
121
|
+
move,
|
|
122
|
+
swap,
|
|
123
|
+
append,
|
|
124
|
+
remove
|
|
125
|
+
} = useFieldArrayOutput;
|
|
126
|
+
const [openAddRowsDialog, setOpenAddRowsDialog] = useState(false);
|
|
127
|
+
const addNewRows = (numberOfRows) => {
|
|
128
|
+
if (currentRows.length + numberOfRows > maxRows) {
|
|
129
|
+
setError(name, {
|
|
130
|
+
type: "custom",
|
|
131
|
+
message: intl.formatMessage(
|
|
132
|
+
{
|
|
133
|
+
id: "MaximumRowNumberError"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
value: maxRows
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
clearErrors(name);
|
|
143
|
+
const rowsToAdd = createRows?.(numberOfRows).map((row) => {
|
|
144
|
+
return { ...row, [SELECTED]: false };
|
|
145
|
+
});
|
|
146
|
+
if (rowsToAdd) {
|
|
147
|
+
append(rowsToAdd);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const handleAddRowsButton = () => {
|
|
151
|
+
allowedToAddRows().then((isAllowed) => {
|
|
152
|
+
if (isAllowed) {
|
|
153
|
+
if (withAddRowsDialog) {
|
|
154
|
+
setOpenAddRowsDialog(true);
|
|
155
|
+
} else {
|
|
156
|
+
addNewRows(1);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
const handleCloseAddRowsDialog = () => {
|
|
162
|
+
setOpenAddRowsDialog(false);
|
|
163
|
+
};
|
|
164
|
+
const deleteSelectedRows = () => {
|
|
165
|
+
const currentRowsValues = getValues(name);
|
|
166
|
+
const rowsToDelete = [];
|
|
167
|
+
for (let i = 0; i < currentRowsValues.length; i++) {
|
|
168
|
+
if (currentRowsValues[i][SELECTED]) {
|
|
169
|
+
rowsToDelete.push(i);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const removedRows = rowsToDelete.map((index) => currentRowsValues[index]);
|
|
173
|
+
remove(rowsToDelete);
|
|
174
|
+
onDelete?.(removedRows);
|
|
175
|
+
};
|
|
176
|
+
const handleDeleteRow = useCallback(
|
|
177
|
+
(index) => {
|
|
178
|
+
const removedRow = getValues(name)[index];
|
|
179
|
+
remove(index);
|
|
180
|
+
onDelete?.([removedRow]);
|
|
181
|
+
},
|
|
182
|
+
[onDelete, getValues, name, remove]
|
|
183
|
+
);
|
|
184
|
+
const selectAllRows = () => {
|
|
185
|
+
for (let i = 0; i < currentRows.length; i++) {
|
|
186
|
+
setValue(`${name}[${i}].${SELECTED}`, true);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const unselectAllRows = () => {
|
|
190
|
+
for (let i = 0; i < currentRows.length; i++) {
|
|
191
|
+
setValue(`${name}[${i}].${SELECTED}`, false);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const moveUpSelectedRows = () => {
|
|
195
|
+
const currentRowsValues = getValues(name);
|
|
196
|
+
if (currentRowsValues[0][SELECTED]) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
for (let i = 1; i < currentRowsValues.length; i++) {
|
|
200
|
+
if (currentRowsValues[i][SELECTED]) {
|
|
201
|
+
swap(i - 1, i);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const moveDownSelectedRows = () => {
|
|
206
|
+
const currentRowsValues = getValues(name);
|
|
207
|
+
if (currentRowsValues[currentRowsValues.length - 1][SELECTED]) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
for (let i = currentRowsValues.length - 2; i >= 0; i--) {
|
|
211
|
+
if (currentRowsValues[i][SELECTED]) {
|
|
212
|
+
swap(i, i + 1);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const snapshotCellWidthsRef = useRef([]);
|
|
217
|
+
const cellIdxRef = useRef(0);
|
|
218
|
+
const onBeforeDragStart = useCallback((start) => {
|
|
219
|
+
const row = document.querySelector(`[data-rfd-draggable-id="${start.draggableId}"]`);
|
|
220
|
+
if (row) {
|
|
221
|
+
snapshotCellWidthsRef.current = Array.from(row.cells, (cell) => cell.offsetWidth);
|
|
222
|
+
}
|
|
223
|
+
}, []);
|
|
224
|
+
const nextSnapshotCellWidthSx = useCallback((isDragging) => {
|
|
225
|
+
const cellWidths = snapshotCellWidthsRef.current;
|
|
226
|
+
const cellIdx = cellIdxRef.current;
|
|
227
|
+
if (!isDragging || cellWidths[cellIdx] == null) {
|
|
228
|
+
return void 0;
|
|
229
|
+
}
|
|
230
|
+
cellIdxRef.current += 1;
|
|
231
|
+
return { width: cellWidths[cellIdx], boxSizing: "border-box" };
|
|
232
|
+
}, []);
|
|
233
|
+
const onDragEnd = (result) => {
|
|
234
|
+
snapshotCellWidthsRef.current = [];
|
|
235
|
+
if (!result.destination) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
move(result.source.index, result.destination.index);
|
|
239
|
+
};
|
|
240
|
+
function renderTableHead() {
|
|
241
|
+
return /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
242
|
+
!disableDragAndDrop && /* @__PURE__ */ jsx(TableCell, { sx: { width: "3%" } }),
|
|
243
|
+
multiselect && /* @__PURE__ */ jsx(TableCell, { sx: { width: "5%", textAlign: "center" }, children: /* @__PURE__ */ jsx(
|
|
244
|
+
MultiCheckbox,
|
|
245
|
+
{
|
|
246
|
+
arrayFormName: name,
|
|
247
|
+
handleClickCheck: selectAllRows,
|
|
248
|
+
handleClickUncheck: unselectAllRows,
|
|
249
|
+
disabled: disabled || currentRows.length === 0
|
|
250
|
+
}
|
|
251
|
+
) }),
|
|
252
|
+
columnsDefinition.map((column) => /* @__PURE__ */ jsx(
|
|
253
|
+
TableCell,
|
|
254
|
+
{
|
|
255
|
+
sx: mergeSx(
|
|
256
|
+
{ width: column.width, maxWidth: column.maxWidth, textAlign: "left" },
|
|
257
|
+
column.sxHeader
|
|
258
|
+
),
|
|
259
|
+
children: /* @__PURE__ */ jsxs(Box, { sx: styles.columnsStyle, children: [
|
|
260
|
+
column.label,
|
|
261
|
+
column.extra
|
|
262
|
+
] })
|
|
263
|
+
},
|
|
264
|
+
column.dataKey
|
|
265
|
+
)),
|
|
266
|
+
!disableAddingRows && !multiselect && /* @__PURE__ */ jsx(TableCell, { sx: { width: "5rem", textAlign: "center" }, children: /* @__PURE__ */ jsx(
|
|
267
|
+
Tooltip,
|
|
268
|
+
{
|
|
269
|
+
title: intl.formatMessage({
|
|
270
|
+
id: "AddRows"
|
|
271
|
+
}),
|
|
272
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(IconButton, { disabled: disableAddingRows, onClick: handleAddRowsButton, children: /* @__PURE__ */ jsx(AddCircle, {}) }) })
|
|
273
|
+
}
|
|
274
|
+
) })
|
|
275
|
+
] }) });
|
|
276
|
+
}
|
|
277
|
+
const handleChangeRow = useCallback(
|
|
278
|
+
(index) => {
|
|
279
|
+
onChange?.(getValues(name)[index]);
|
|
280
|
+
},
|
|
281
|
+
[getValues, name, onChange]
|
|
282
|
+
);
|
|
283
|
+
function renderTableBody(providedDroppable) {
|
|
284
|
+
return /* @__PURE__ */ jsxs(TableBody, { children: [
|
|
285
|
+
currentRows.map((row, index) => /* @__PURE__ */ jsx(
|
|
286
|
+
Draggable,
|
|
287
|
+
{
|
|
288
|
+
draggableId: row.id.toString(),
|
|
289
|
+
index,
|
|
290
|
+
isDragDisabled: disableDragAndDrop,
|
|
291
|
+
children: (provided, snapshot) => {
|
|
292
|
+
cellIdxRef.current = 0;
|
|
293
|
+
const tableRow = /* @__PURE__ */ jsx(
|
|
294
|
+
DndTableRow,
|
|
295
|
+
{
|
|
296
|
+
provided,
|
|
297
|
+
snapshot,
|
|
298
|
+
rowId: row.id,
|
|
299
|
+
tableName: name,
|
|
300
|
+
columnsDefinition,
|
|
301
|
+
index,
|
|
302
|
+
disableDragAndDrop,
|
|
303
|
+
disabled,
|
|
304
|
+
previousValues,
|
|
305
|
+
disableTableCell,
|
|
306
|
+
getPreviousValue,
|
|
307
|
+
isValueModified,
|
|
308
|
+
disabledDeletion,
|
|
309
|
+
onChangeRow: handleChangeRow,
|
|
310
|
+
onDeleteRow: handleDeleteRow,
|
|
311
|
+
multiselect,
|
|
312
|
+
nextSnapshotCellWidthSx
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
return snapshot.isDragging ? createPortal(tableRow, document.body) : tableRow;
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
row.id
|
|
319
|
+
)),
|
|
320
|
+
providedDroppable.placeholder
|
|
321
|
+
] });
|
|
322
|
+
}
|
|
323
|
+
return /* @__PURE__ */ jsxs(Grid, { item: true, container: true, spacing: 1, children: [
|
|
324
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, container: true, children: [
|
|
325
|
+
/* @__PURE__ */ jsx(DragDropContext, { onBeforeDragStart, onDragEnd, children: /* @__PURE__ */ jsx(Droppable, { droppableId: "tapTable", isDropDisabled: disabled, children: (provided) => /* @__PURE__ */ jsx(
|
|
326
|
+
TableContainer,
|
|
327
|
+
{
|
|
328
|
+
ref: provided.innerRef,
|
|
329
|
+
...provided.droppableProps,
|
|
330
|
+
sx: {
|
|
331
|
+
height: tableHeight,
|
|
332
|
+
border: "solid 1px rgba(0,0,0,0.1)"
|
|
333
|
+
},
|
|
334
|
+
children: /* @__PURE__ */ jsxs(Table, { stickyHeader: true, size: "small", padding: "none", children: [
|
|
335
|
+
renderTableHead(),
|
|
336
|
+
renderTableBody(provided)
|
|
337
|
+
] })
|
|
338
|
+
}
|
|
339
|
+
) }) }),
|
|
340
|
+
/* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert })
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, item: true, children: [
|
|
343
|
+
handleResetButton && handleUploadButton && resetButtonMessageId && uploadButtonMessageId ? /* @__PURE__ */ jsx(
|
|
344
|
+
DndTableBottomLeftButtons,
|
|
345
|
+
{
|
|
346
|
+
withResetButton,
|
|
347
|
+
disableUploadButton: disableAddingRows,
|
|
348
|
+
disabled,
|
|
349
|
+
handleUploadButton,
|
|
350
|
+
uploadButtonMessageId,
|
|
351
|
+
handleResetButton,
|
|
352
|
+
resetButtonMessageId
|
|
353
|
+
}
|
|
354
|
+
) : null,
|
|
355
|
+
multiselect && /* @__PURE__ */ jsx(
|
|
356
|
+
DndTableBottomRightButtons,
|
|
357
|
+
{
|
|
358
|
+
arrayFormName: name,
|
|
359
|
+
handleAddButton: handleAddRowsButton,
|
|
360
|
+
handleDeleteButton: deleteSelectedRows,
|
|
361
|
+
handleMoveUpButton: moveUpSelectedRows,
|
|
362
|
+
handleMoveDownButton: moveDownSelectedRows,
|
|
363
|
+
disableAddingRows,
|
|
364
|
+
showMoveArrow,
|
|
365
|
+
disabled
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] }),
|
|
369
|
+
/* @__PURE__ */ jsx(
|
|
370
|
+
DndTableAddRowsDialog,
|
|
371
|
+
{
|
|
372
|
+
open: openAddRowsDialog,
|
|
373
|
+
handleAddButton: addNewRows,
|
|
374
|
+
onClose: handleCloseAddRowsDialog
|
|
375
|
+
}
|
|
376
|
+
)
|
|
377
|
+
] });
|
|
378
|
+
}
|
|
379
|
+
export {
|
|
380
|
+
DndTable
|
|
381
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { ElementType } from '../../utils/types/elementType';
|
|
4
|
+
import { EquipmentType } from '../../utils/types/equipmentType';
|
|
5
|
+
import { Option } from '../../utils/types/types';
|
|
6
|
+
export declare const SELECTED = "selected";
|
|
7
|
+
export declare const MAX_ROWS_NUMBER = 100;
|
|
8
|
+
export declare enum DndColumnType {
|
|
9
|
+
TEXT = "TEXT",
|
|
10
|
+
NUMERIC = "NUMERIC",
|
|
11
|
+
AUTOCOMPLETE = "AUTOCOMPLETE",
|
|
12
|
+
SELECT = "SELECT",
|
|
13
|
+
CHIP_ITEMS = "CHIP_ITEMS",
|
|
14
|
+
DIRECTORY_ITEMS = "DIRECTORY_ITEMS",
|
|
15
|
+
SWITCH = "SWITCH",
|
|
16
|
+
DESCRIPTIONS = "DESCRIPTIONS",
|
|
17
|
+
CUSTOM = "CUSTOM"
|
|
18
|
+
}
|
|
19
|
+
export interface ColumnBase {
|
|
20
|
+
dataKey: string;
|
|
21
|
+
maxWidth?: number | string;
|
|
22
|
+
width?: number | string;
|
|
23
|
+
label?: string;
|
|
24
|
+
sxHeader?: SxProps<Theme>;
|
|
25
|
+
extra?: JSX.Element;
|
|
26
|
+
editable?: boolean;
|
|
27
|
+
type: DndColumnType;
|
|
28
|
+
initialValue?: any;
|
|
29
|
+
shouldHandleOnChangeCell?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface ColumnText extends ColumnBase {
|
|
32
|
+
type: DndColumnType.TEXT;
|
|
33
|
+
showErrorMsg?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ColumnNumeric extends ColumnBase {
|
|
36
|
+
type: DndColumnType.NUMERIC;
|
|
37
|
+
adornment?: {
|
|
38
|
+
text: string;
|
|
39
|
+
};
|
|
40
|
+
clearable?: boolean;
|
|
41
|
+
textAlign?: 'right' | 'left';
|
|
42
|
+
}
|
|
43
|
+
export interface ColumnAutocomplete extends ColumnBase {
|
|
44
|
+
type: DndColumnType.AUTOCOMPLETE;
|
|
45
|
+
options: Option[];
|
|
46
|
+
}
|
|
47
|
+
export interface ColumnSelect extends ColumnBase {
|
|
48
|
+
type: DndColumnType.SELECT;
|
|
49
|
+
options: Option[];
|
|
50
|
+
}
|
|
51
|
+
export interface ColumnDirectoryItem extends ColumnBase {
|
|
52
|
+
type: DndColumnType.DIRECTORY_ITEMS;
|
|
53
|
+
equipmentTypes: EquipmentType[];
|
|
54
|
+
elementType: ElementType;
|
|
55
|
+
titleId: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ColumnChipsItem extends ColumnBase {
|
|
58
|
+
type: DndColumnType.CHIP_ITEMS;
|
|
59
|
+
}
|
|
60
|
+
export interface ColumnSwitchItem extends ColumnBase {
|
|
61
|
+
type: DndColumnType.SWITCH;
|
|
62
|
+
}
|
|
63
|
+
export interface ColumnDescriptions extends ColumnBase {
|
|
64
|
+
type: DndColumnType.DESCRIPTIONS;
|
|
65
|
+
}
|
|
66
|
+
export interface ColumnCustom extends ColumnBase {
|
|
67
|
+
type: DndColumnType.CUSTOM;
|
|
68
|
+
component: (rowIndex: number) => ReactNode;
|
|
69
|
+
}
|
|
70
|
+
export type DndColumn = ColumnNumeric | ColumnAutocomplete | ColumnSelect | ColumnText | ColumnDirectoryItem | ColumnChipsItem | ColumnSwitchItem | ColumnDescriptions | ColumnCustom;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const SELECTED = "selected";
|
|
2
|
+
const MAX_ROWS_NUMBER = 100;
|
|
3
|
+
var DndColumnType = /* @__PURE__ */ ((DndColumnType2) => {
|
|
4
|
+
DndColumnType2["TEXT"] = "TEXT";
|
|
5
|
+
DndColumnType2["NUMERIC"] = "NUMERIC";
|
|
6
|
+
DndColumnType2["AUTOCOMPLETE"] = "AUTOCOMPLETE";
|
|
7
|
+
DndColumnType2["SELECT"] = "SELECT";
|
|
8
|
+
DndColumnType2["CHIP_ITEMS"] = "CHIP_ITEMS";
|
|
9
|
+
DndColumnType2["DIRECTORY_ITEMS"] = "DIRECTORY_ITEMS";
|
|
10
|
+
DndColumnType2["SWITCH"] = "SWITCH";
|
|
11
|
+
DndColumnType2["DESCRIPTIONS"] = "DESCRIPTIONS";
|
|
12
|
+
DndColumnType2["CUSTOM"] = "CUSTOM";
|
|
13
|
+
return DndColumnType2;
|
|
14
|
+
})(DndColumnType || {});
|
|
15
|
+
export {
|
|
16
|
+
DndColumnType,
|
|
17
|
+
MAX_ROWS_NUMBER,
|
|
18
|
+
SELECTED
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './dnd-table';
|
|
8
|
+
export * from './dnd-table.type';
|
|
9
|
+
export * from './dnd-table-utils';
|
|
10
|
+
export * from './dnd-table-add-rows-dialog';
|
|
11
|
+
export * from './dnd-table-bottom-left-buttons';
|
|
12
|
+
export * from './dnd-table-bottom-right-buttons';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DndTable } from "./dnd-table.js";
|
|
2
|
+
import { DndColumnType, MAX_ROWS_NUMBER, SELECTED } from "./dnd-table.type.js";
|
|
3
|
+
import { getDefaultRowData } from "./dnd-table-utils.js";
|
|
4
|
+
import { DndTableAddRowsDialog } from "./dnd-table-add-rows-dialog.js";
|
|
5
|
+
import { DndTableBottomLeftButtons } from "./dnd-table-bottom-left-buttons.js";
|
|
6
|
+
import { DndTableBottomRightButtons } from "./dnd-table-bottom-right-buttons.js";
|
|
7
|
+
export {
|
|
8
|
+
DndColumnType,
|
|
9
|
+
DndTable,
|
|
10
|
+
DndTableAddRowsDialog,
|
|
11
|
+
DndTableBottomLeftButtons,
|
|
12
|
+
DndTableBottomRightButtons,
|
|
13
|
+
MAX_ROWS_NUMBER,
|
|
14
|
+
SELECTED,
|
|
15
|
+
getDefaultRowData
|
|
16
|
+
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024, 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
|
+
*/
|
|
2
7
|
export declare const DISTRIBUTION_KEY = "distributionKey";
|
|
3
8
|
export declare const FilterType: {
|
|
4
9
|
EXPERT: {
|
|
@@ -10,4 +15,3 @@ export declare const FilterType: {
|
|
|
10
15
|
label: string;
|
|
11
16
|
};
|
|
12
17
|
};
|
|
13
|
-
export declare const NO_ITEM_SELECTION_FOR_COPY: ItemSelectionForCopy;
|
|
@@ -3,16 +3,7 @@ const FilterType = {
|
|
|
3
3
|
EXPERT: { id: "EXPERT", label: "filter.expert" },
|
|
4
4
|
EXPLICIT_NAMING: { id: "IDENTIFIER_LIST", label: "filter.explicitNaming" }
|
|
5
5
|
};
|
|
6
|
-
const NO_ITEM_SELECTION_FOR_COPY = {
|
|
7
|
-
sourceItemUuid: null,
|
|
8
|
-
nameItem: null,
|
|
9
|
-
descriptionItem: null,
|
|
10
|
-
parentDirectoryUuid: null,
|
|
11
|
-
typeItem: null,
|
|
12
|
-
specificTypeItem: null
|
|
13
|
-
};
|
|
14
6
|
export {
|
|
15
7
|
DISTRIBUTION_KEY,
|
|
16
|
-
FilterType
|
|
17
|
-
NO_ITEM_SELECTION_FOR_COPY
|
|
8
|
+
FilterType
|
|
18
9
|
};
|
|
@@ -7,7 +7,8 @@ import { FetchStatus } from "../../../utils/constants/fetchStatus.js";
|
|
|
7
7
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
8
8
|
import "../../../utils/yupConfig.js";
|
|
9
9
|
import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
10
|
-
import {
|
|
10
|
+
import { FilterType } from "../constants/FilterConstants.js";
|
|
11
|
+
import { NO_ITEM_SELECTION_FOR_COPY } from "../../../utils/directory-utils.js";
|
|
11
12
|
import { FilterForm } from "../FilterForm.js";
|
|
12
13
|
import { saveExpertFilter } from "../utils/filterApi.js";
|
|
13
14
|
import { expertFilterSchema } from "./ExpertFilterForm.js";
|
|
@@ -12,7 +12,8 @@ import { saveExplicitNamingFilter } from "../utils/filterApi.js";
|
|
|
12
12
|
import { explicitNamingFilterSchema } from "./ExplicitNamingFilterForm.js";
|
|
13
13
|
import { FetchStatus } from "../../../utils/constants/fetchStatus.js";
|
|
14
14
|
import { FilterForm } from "../FilterForm.js";
|
|
15
|
-
import {
|
|
15
|
+
import { FilterType } from "../constants/FilterConstants.js";
|
|
16
|
+
import { NO_ITEM_SELECTION_FOR_COPY } from "../../../utils/directory-utils.js";
|
|
16
17
|
import { HeaderFilterSchema } from "../HeaderFilterForm.js";
|
|
17
18
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
|
|
18
19
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
@@ -4,8 +4,8 @@ import { default as yup } from '../../../utils/yupConfig';
|
|
|
4
4
|
import { DISTRIBUTION_KEY } from '../constants/FilterConstants';
|
|
5
5
|
export declare const explicitNamingFilterSchema: {
|
|
6
6
|
filterEquipmentsAttributes: yup.ArraySchema<{
|
|
7
|
-
equipmentID?: string | null | undefined;
|
|
8
7
|
distributionKey?: number | null | undefined;
|
|
8
|
+
equipmentID?: string | null | undefined;
|
|
9
9
|
}[] | undefined, yup.AnyObject, "", "">;
|
|
10
10
|
};
|
|
11
11
|
interface FilterTableRow {
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
-
import { FieldConstants, GsLang } from '../../utils';
|
|
2
|
+
import { EquipmentType, FieldConstants, GsLang } from '../../utils';
|
|
3
|
+
import { ItemSelectionForCopy } from '../../utils/types/types';
|
|
3
4
|
import { RuleGroupTypeExport } from './expert/expertFilter.type';
|
|
4
5
|
import { EXPERT_FILTER_QUERY } from './expert/expertFilterConstants';
|
|
5
6
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from './explicitNaming/ExplicitNamingFilterConstants';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
export type ItemSelectionForCopy = {
|
|
10
|
-
sourceItemUuid: UUID | null;
|
|
11
|
-
typeItem: string | null;
|
|
12
|
-
nameItem: string | null;
|
|
13
|
-
descriptionItem: string | null;
|
|
14
|
-
parentDirectoryUuid: UUID | null;
|
|
15
|
-
specificTypeItem: string | null;
|
|
16
|
-
};
|
|
17
|
-
type EquipmentsFilter = {
|
|
7
|
+
import { FilterType } from './constants/FilterConstants';
|
|
8
|
+
export type EquipmentsFilter = {
|
|
18
9
|
equipmentID: string;
|
|
19
10
|
distributionKey?: number;
|
|
20
11
|
};
|
|
12
|
+
export interface IdentifiableAttributes {
|
|
13
|
+
id: string;
|
|
14
|
+
type: EquipmentType;
|
|
15
|
+
distributionKey: number;
|
|
16
|
+
}
|
|
17
|
+
export interface FilterEquipments {
|
|
18
|
+
filterId: UUID;
|
|
19
|
+
identifiableAttributes: IdentifiableAttributes[];
|
|
20
|
+
notFoundEquipments: string[];
|
|
21
|
+
}
|
|
21
22
|
export interface FilterEditionProps {
|
|
22
23
|
id: string;
|
|
23
24
|
name: string;
|
|
@@ -37,11 +38,20 @@ export interface FilterEditionProps {
|
|
|
37
38
|
description?: string;
|
|
38
39
|
isDeveloperMode: boolean;
|
|
39
40
|
}
|
|
40
|
-
export
|
|
41
|
-
|
|
41
|
+
export type NewFilterType = ExpertFilter | ExplicitNamingFilter;
|
|
42
|
+
type BaseFilter = {
|
|
43
|
+
id?: string | null;
|
|
44
|
+
name?: string;
|
|
42
45
|
type: string;
|
|
43
46
|
equipmentType: string;
|
|
44
|
-
|
|
47
|
+
};
|
|
48
|
+
export type ExpertFilter = BaseFilter & {
|
|
49
|
+
type: typeof FilterType.EXPERT.id;
|
|
50
|
+
rules: RuleGroupTypeExport;
|
|
51
|
+
topologyKind?: string;
|
|
52
|
+
};
|
|
53
|
+
export type ExplicitNamingFilter = BaseFilter & {
|
|
54
|
+
type: typeof FilterType.EXPLICIT_NAMING.id;
|
|
45
55
|
filterEquipmentsAttributes?: EquipmentsFilter[];
|
|
46
|
-
}
|
|
56
|
+
};
|
|
47
57
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FilterCreationDialog } from "./FilterCreationDialog.js";
|
|
2
2
|
import { FilterForm } from "./FilterForm.js";
|
|
3
|
-
import { DISTRIBUTION_KEY, FilterType
|
|
3
|
+
import { DISTRIBUTION_KEY, FilterType } from "./constants/FilterConstants.js";
|
|
4
4
|
import { ExpertFilterEditionDialog } from "./expert/ExpertFilterEditionDialog.js";
|
|
5
5
|
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData } from "./expert/ExpertFilterForm.js";
|
|
6
6
|
import { CombinatorType, DataType, OperatorType } from "./expert/expertFilter.type.js";
|
|
@@ -33,7 +33,6 @@ export {
|
|
|
33
33
|
FilterForm,
|
|
34
34
|
FilterType,
|
|
35
35
|
LOAD_TYPE_OPTIONS,
|
|
36
|
-
NO_ITEM_SELECTION_FOR_COPY,
|
|
37
36
|
OPERATOR_OPTIONS,
|
|
38
37
|
OperatorType,
|
|
39
38
|
PHASE_REGULATION_MODE_OPTIONS,
|