@gridsuite/commons-ui 0.296.0 → 0.297.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/agGridTable/BottomTableButtons.js +56 -44
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-comparator-filter.js +32 -23
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-text-filter.js +31 -23
- package/dist/components/composite/customAGGrid/custom-aggrid-header.js +67 -43
- package/dist/components/composite/elementSearch/elementSearchInput/ElementSearchInput.d.ts +3 -2
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +43 -28
- package/dist/components/composite/reactQueryBuilder/CustomReactQueryBuilder.js +4 -7
- package/dist/components/composite/reactQueryBuilder/FieldSelector.js +5 -3
- package/dist/components/composite/reactQueryBuilder/PropertyValueEditor.js +63 -52
- package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +22 -9
- package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +59 -24
- package/dist/components/ui/csvPicker/csv-picker.js +24 -12
- package/dist/components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +15 -7
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +82 -39
- package/dist/components/ui/dialogs/modifyElementSelection/ModifyElementSelection.js +29 -9
- package/dist/components/ui/dialogs/name-element-editor/name-element-editor-form.js +24 -15
- package/dist/components/ui/inputs/ActivableChip.js +2 -2
- package/dist/components/ui/inputs/SelectClearable.js +4 -3
- package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +1 -1
- package/dist/components/ui/reactHookForm/OverflowableChip.js +24 -13
- package/dist/components/ui/reactHookForm/OverflowableChipWithHelperText.js +9 -4
- package/dist/components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js +11 -5
- package/dist/components/ui/reactHookForm/directory-item-input/directory-item-input.js +13 -3
- package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.js +3 -1
- package/dist/components/ui/reactHookForm/utils/HelperPreviousValue.js +11 -1
- package/dist/features/authentication/AuthenticationRouter.js +62 -53
- package/dist/features/authentication/Login.js +15 -7
- package/dist/features/authentication/Logout.js +9 -1
- package/dist/features/cardErrorBoundary/CardErrorBoundary.js +28 -10
- package/dist/features/global-filter/ui/global-filter-panel.js +4 -10
- package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +22 -12
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +21 -11
- package/dist/features/network-modifications/by-filter/deletion/ByFilterDeletionForm.js +35 -25
- package/dist/features/network-modifications/common/currentLimits/LimitsPane.js +28 -16
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsEditor.js +16 -4
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsPropertiesSideStack.js +81 -68
- package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +31 -21
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +32 -21
- package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.d.ts +1 -1
- package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +1 -1
- package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +20 -9
- package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +22 -12
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +28 -18
- package/dist/features/network-modifications/hvdcLine/vsc/common/converterStation/VscConverterStationPane.js +15 -4
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.js +70 -40
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.js +35 -6
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.js +16 -7
- package/dist/features/network-modifications/tabular/TabularForm.js +102 -72
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +20 -10
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +35 -17
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.js +9 -1
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.js +6 -4
- package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.js +17 -7
- package/dist/features/network-modifications/voltageLevel/topology/creation/CreateVoltageLevelTopologyForm.js +23 -13
- package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.js +25 -15
- package/dist/features/parameters/common/parameter-field.js +17 -4
- package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +23 -12
- package/dist/features/parameters/common/provider-param.js +1 -1
- package/dist/features/parameters/common/widget/parameter-float.js +16 -4
- package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +1 -1
- package/dist/features/parameters/common/widget/parameter-switch.js +13 -1
- package/dist/features/parameters/dynamic-simulation/curve/common/checkbox-select.js +6 -4
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector-dialog.js +43 -32
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector.js +47 -25
- package/dist/features/parameters/network-visualizations/map-parameters.js +7 -3
- package/dist/features/parameters/network-visualizations/network-area-diagram-parameters.js +7 -3
- package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +7 -3
- package/dist/features/parameters/security-analysis/security-analysis-violations-hiding.js +23 -13
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-factor-count.js +2 -2
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +12 -1
- package/dist/features/parameters/sensi/sensitivity-parameters-fields.js +36 -26
- package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +67 -26
- package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +15 -4
- package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +51 -15
- package/dist/features/parameters/voltage-init/general-parameters.js +9 -1
- package/dist/features/process-configs/common/FormSubSection.js +2 -2
- package/dist/features/process-configs/common/GeneralInformationSection.js +1 -1
- package/dist/features/process-configs/common/SpecificInformationSection.js +12 -4
- package/dist/features/process-configs/common/process-config-modifications-edition.js +3 -3
- package/dist/features/process-configs/form/components/ProcessTypeChangeDialog.js +5 -2
- package/dist/features/side-bar/AppSideBarHeader.js +36 -16
- package/dist/features/side-bar/footer/AppSideBarFooter.js +46 -38
- package/dist/features/side-bar/footer/applications/OtherAppRedirection.js +10 -8
- package/dist/features/side-bar/footer/common/SideBarMenuItem.js +9 -1
- package/dist/features/side-bar/footer/profile/ProfileInfos.js +15 -6
- package/dist/features/side-bar/footer/settings/DarkModeToggle.js +16 -4
- package/dist/features/side-bar/footer/settings/SettingsMenu.js +16 -6
- package/dist/features/topBar/AboutDialog.js +46 -17
- package/dist/features/topBar/TopBar.js +2 -2
- package/dist/features/topBar/UserInformationDialog.js +198 -45
- package/package.json +16 -11
|
@@ -25,50 +25,62 @@ function BottomTableButtons({
|
|
|
25
25
|
csvProps
|
|
26
26
|
}) {
|
|
27
27
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
-
/* @__PURE__ */ jsxs(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
28
|
+
/* @__PURE__ */ jsxs(
|
|
29
|
+
Grid,
|
|
30
|
+
{
|
|
31
|
+
container: true,
|
|
32
|
+
spacing: 1,
|
|
33
|
+
sx: {
|
|
34
|
+
paddingTop: 1,
|
|
35
|
+
paddingLeft: 1,
|
|
36
|
+
alignItems: "center"
|
|
37
|
+
},
|
|
38
|
+
children: [
|
|
39
|
+
csvProps?.getTableData && /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(
|
|
40
|
+
CsvDownloadButton,
|
|
41
|
+
{
|
|
42
|
+
data: csvProps.getTableData,
|
|
43
|
+
fileName: csvProps.fileName,
|
|
44
|
+
language: csvProps.language,
|
|
45
|
+
labelId: "DownloadCSV",
|
|
46
|
+
disabled: !csvProps.hasTableData,
|
|
47
|
+
withExportButton: true
|
|
48
|
+
}
|
|
49
|
+
) }),
|
|
50
|
+
csvProps?.extraButtons && /* @__PURE__ */ jsx(Grid, { children: csvProps.extraButtons }),
|
|
51
|
+
/* @__PURE__ */ jsxs(Grid, { sx: { marginLeft: "auto" }, children: [
|
|
52
|
+
/* @__PURE__ */ jsx(InnerColoredButton, { onClick: handleAddRow, "aria-label": "Add row", children: /* @__PURE__ */ jsx(ControlPoint, { "data-testid": "ControlPointIcon" }) }),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
InnerColoredButton,
|
|
55
|
+
{
|
|
56
|
+
onClick: handleDeleteRows,
|
|
57
|
+
disabled: disableDelete,
|
|
58
|
+
"aria-label": "Delete selected rows",
|
|
59
|
+
children: /* @__PURE__ */ jsx(Delete, {})
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
InnerColoredButton,
|
|
64
|
+
{
|
|
65
|
+
disabled: disableUp,
|
|
66
|
+
onClick: handleMoveRowUp,
|
|
67
|
+
"aria-label": "Move selected rows up",
|
|
68
|
+
children: /* @__PURE__ */ jsx(ArrowCircleUp, {})
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
InnerColoredButton,
|
|
73
|
+
{
|
|
74
|
+
disabled: disableDown,
|
|
75
|
+
onClick: handleMoveRowDown,
|
|
76
|
+
"aria-label": "Move selected rows down",
|
|
77
|
+
children: /* @__PURE__ */ jsx(ArrowCircleDown, {})
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
72
84
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) })
|
|
73
85
|
] });
|
|
74
86
|
}
|
|
@@ -23,29 +23,38 @@ function CustomAggridComparatorFilter({ colId, filterParams }) {
|
|
|
23
23
|
// used for text filter as a UI type (examples: contains, startsWith..)
|
|
24
24
|
} = filterParams;
|
|
25
25
|
const isComparatorWithoutValue = selectedFilterComparator === FilterTextComparators.IS_EMPTY || selectedFilterComparator === FilterTextComparators.IS_NOT_EMPTY;
|
|
26
|
-
return /* @__PURE__ */ jsxs(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
Stack,
|
|
28
|
+
{
|
|
29
|
+
sx: {
|
|
30
|
+
gap: 0.8,
|
|
31
|
+
padding: "8px"
|
|
32
|
+
},
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
35
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsx(
|
|
36
|
+
CustomAggridComparatorSelector,
|
|
37
|
+
{
|
|
38
|
+
value: selectedFilterComparator,
|
|
39
|
+
onChange: handleFilterComparatorChange,
|
|
40
|
+
options: comparators
|
|
41
|
+
}
|
|
42
|
+
) }),
|
|
43
|
+
isComparatorWithoutValue && selectedFilterData !== void 0 && /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleClearFilter, children: /* @__PURE__ */ jsx(Close, {}) })
|
|
44
|
+
] }),
|
|
45
|
+
!isComparatorWithoutValue && /* @__PURE__ */ jsx(
|
|
46
|
+
CustomAggridTextFilter,
|
|
47
|
+
{
|
|
48
|
+
value: selectedFilterData,
|
|
49
|
+
onChange: handleFilterTextChange,
|
|
50
|
+
onClear: handleClearFilter,
|
|
51
|
+
isNumberInput,
|
|
52
|
+
decimalAfterDot
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
49
58
|
}
|
|
50
59
|
export {
|
|
51
60
|
CustomAggridComparatorFilter
|
package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-text-filter.js
CHANGED
|
@@ -31,30 +31,38 @@ function CustomAggridTextFilter({
|
|
|
31
31
|
}) {
|
|
32
32
|
const intl = useIntl();
|
|
33
33
|
const isRoundingDisplayed = useMemo(() => !!(isNumberInput && value), [isNumberInput, value]);
|
|
34
|
-
return /* @__PURE__ */ jsxs(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
return /* @__PURE__ */ jsxs(
|
|
35
|
+
Stack,
|
|
36
|
+
{
|
|
37
|
+
sx: {
|
|
38
|
+
gap: 0.2
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(
|
|
42
|
+
TextField,
|
|
43
|
+
{
|
|
44
|
+
size: "small",
|
|
45
|
+
fullWidth: true,
|
|
46
|
+
value: value || "",
|
|
47
|
+
onChange,
|
|
48
|
+
placeholder: intl.formatMessage({
|
|
49
|
+
id: "filter.filterOoo"
|
|
50
|
+
}),
|
|
51
|
+
sx: mergeSx(styles.input, isNumberInput ? styles.noArrows : void 0),
|
|
52
|
+
slotProps: {
|
|
53
|
+
input: {
|
|
54
|
+
endAdornment: value ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(IconButton, { "aria-label": "clear filter", onClick: onClear, edge: "end", size: "small", children: /* @__PURE__ */ jsx(Clear, {}) }) }) : null
|
|
55
|
+
},
|
|
56
|
+
htmlInput: {
|
|
57
|
+
type: isNumberInput ? FilterDataTypes.NUMBER : FilterDataTypes.TEXT
|
|
58
|
+
}
|
|
59
|
+
}
|
|
52
60
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
) }),
|
|
62
|
+
isRoundingDisplayed && /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(DisplayRounding, { decimalAfterDot }) })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
58
66
|
}
|
|
59
67
|
export {
|
|
60
68
|
CustomAggridTextFilter
|
|
@@ -54,55 +54,79 @@ function CustomHeaderComponent({
|
|
|
54
54
|
const handleMouseLeave = useCallback(() => {
|
|
55
55
|
setIsHoveringColumnHeader(false);
|
|
56
56
|
}, []);
|
|
57
|
-
return /* @__PURE__ */ jsx(Grid, { container: true, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, sx: { width: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
children: /* @__PURE__ */ jsx(
|
|
57
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, sx: { width: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
58
|
+
Grid,
|
|
59
|
+
{
|
|
60
|
+
container: true,
|
|
61
|
+
wrap: "nowrap",
|
|
62
|
+
sx: {
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
width: "100%"
|
|
65
|
+
},
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
69
68
|
Grid,
|
|
70
69
|
{
|
|
71
70
|
container: true,
|
|
72
71
|
sx: {
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
flexBasis: forceDisplayFilterIcon ? "auto" : "100%",
|
|
73
|
+
cursor: isSortable ? "pointer" : "default",
|
|
74
|
+
...styles.titleContainer,
|
|
75
|
+
flex: forceDisplayFilterIcon ? "0 1 auto" : void 0
|
|
75
76
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
children: /* @__PURE__ */ jsx(
|
|
78
|
+
Grid,
|
|
79
|
+
{
|
|
80
|
+
container: true,
|
|
81
|
+
sx: {
|
|
82
|
+
overflow: "hidden",
|
|
83
|
+
minWidth: 0
|
|
84
|
+
},
|
|
85
|
+
onClick: handleClickHeader,
|
|
86
|
+
children: /* @__PURE__ */ jsxs(
|
|
87
|
+
Grid,
|
|
88
|
+
{
|
|
89
|
+
container: true,
|
|
90
|
+
wrap: "nowrap",
|
|
91
|
+
sx: [
|
|
92
|
+
{
|
|
93
|
+
alignItems: "center"
|
|
94
|
+
},
|
|
95
|
+
styles.displayName
|
|
96
|
+
],
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Grid, { children: displayName }),
|
|
99
|
+
isInvalid && /* @__PURE__ */ jsx(Grid, { sx: styles.invalidIcon, children: /* @__PURE__ */ jsx(
|
|
100
|
+
Tooltip,
|
|
101
|
+
{
|
|
102
|
+
title: /* @__PURE__ */ jsx(FormattedMessage, { id: "spreadsheet/column/invalid-without-loadflow" }),
|
|
103
|
+
children: /* @__PURE__ */ jsx(WarningAmber, { fontSize: "small", color: "warning" })
|
|
104
|
+
}
|
|
105
|
+
) }),
|
|
106
|
+
sortParams && /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(CustomAggridSort, { colId: column.getId(), sortParams }) })
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
)
|
|
88
112
|
}
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, sx: styles.actions, children: [
|
|
115
|
+
filterComponent && /* @__PURE__ */ jsx(
|
|
116
|
+
CustomAggridFilter,
|
|
117
|
+
{
|
|
118
|
+
filterComponent,
|
|
119
|
+
filterComponentParams: { ...filterComponentParams, colId: column.getId(), api },
|
|
120
|
+
isHoveringColumnHeader,
|
|
121
|
+
forceDisplayFilterIcon,
|
|
122
|
+
handleCloseFilter
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
menu && /* @__PURE__ */ jsx(CustomMenu, { ...menu })
|
|
126
|
+
] })
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
) });
|
|
106
130
|
}
|
|
107
131
|
export {
|
|
108
132
|
CustomHeaderComponent
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AutocompleteProps, AutocompleteRenderInputParams } from '@mui/material';
|
|
1
|
+
import { AutocompleteProps, AutocompleteRenderInputParams, AutocompleteSlots } from '@mui/material';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
export type RenderElementProps<T> = HTMLAttributes<HTMLLIElement> & {
|
|
4
4
|
element: T;
|
|
5
5
|
inputValue: string;
|
|
6
6
|
};
|
|
7
|
-
export interface ElementSearchInputProps<T> extends Pick<AutocompleteProps<T, false, boolean, true>, 'sx' | 'size' | 'loadingText' | 'loading' | 'disableClearable' | 'getOptionDisabled'
|
|
7
|
+
export interface ElementSearchInputProps<T> extends Pick<AutocompleteProps<T, false, boolean, true>, 'sx' | 'size' | 'loadingText' | 'loading' | 'disableClearable' | 'getOptionDisabled'> {
|
|
8
|
+
PaperComponent?: AutocompleteSlots['paper'];
|
|
8
9
|
searchTerm: string;
|
|
9
10
|
onSearchTermChange: (searchTerm: string) => void;
|
|
10
11
|
onSelectionChange: (selection: T) => void;
|
|
@@ -182,8 +182,12 @@ function ExplicitNamingFilterForm({
|
|
|
182
182
|
Stack,
|
|
183
183
|
{
|
|
184
184
|
spacing: 2,
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
sx: {
|
|
186
|
+
padding: 1,
|
|
187
|
+
flexGrow: 1,
|
|
188
|
+
flexWrap: "nowrap",
|
|
189
|
+
minHeight: 0
|
|
190
|
+
},
|
|
187
191
|
children: [
|
|
188
192
|
/* @__PURE__ */ jsxs(Grid, { children: [
|
|
189
193
|
/* @__PURE__ */ jsx(
|
|
@@ -215,32 +219,43 @@ function ExplicitNamingFilterForm({
|
|
|
215
219
|
)
|
|
216
220
|
] }),
|
|
217
221
|
watchEquipmentType && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
218
|
-
/* @__PURE__ */ jsxs(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
222
|
+
/* @__PURE__ */ jsxs(
|
|
223
|
+
Grid,
|
|
224
|
+
{
|
|
225
|
+
container: true,
|
|
226
|
+
spacing: 2,
|
|
227
|
+
sx: {
|
|
228
|
+
justifyContent: "space-between",
|
|
229
|
+
alignItems: "center"
|
|
230
|
+
},
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(
|
|
233
|
+
CsvDownloadButton,
|
|
234
|
+
{
|
|
235
|
+
data: getTemplateData,
|
|
236
|
+
fileName: intl.formatMessage({ id: "filterCsvFileName" }),
|
|
237
|
+
language,
|
|
238
|
+
labelId: "GenerateCSV",
|
|
239
|
+
variant: "contained"
|
|
240
|
+
}
|
|
241
|
+
) }),
|
|
242
|
+
/* @__PURE__ */ jsx(Grid, { sx: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(
|
|
243
|
+
CsvPicker,
|
|
244
|
+
{
|
|
245
|
+
label: "UploadCSV",
|
|
246
|
+
requiredColumns: csvFileHeaders,
|
|
247
|
+
language: language ?? LANG_SYSTEM,
|
|
248
|
+
selectedFile,
|
|
249
|
+
onFileChange: setSelectedFile,
|
|
250
|
+
onFileError: setFileErrorMessage,
|
|
251
|
+
getTableData: () => getValues(FILTER_EQUIPMENTS_ATTRIBUTES),
|
|
252
|
+
onAppend: (results) => tableRef.current?.append(getDataFromCsvFile(results.data)),
|
|
253
|
+
onReplace: (results) => tableRef.current?.replace(getDataFromCsvFile(results.data))
|
|
254
|
+
}
|
|
255
|
+
) })
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
),
|
|
244
259
|
fileErrorMessage && /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(Alert, { severity: "error", children: fileErrorMessage }) }),
|
|
245
260
|
/* @__PURE__ */ jsx(Grid, { sx: { flexGrow: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx(
|
|
246
261
|
CustomAgGridTable,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
|
-
import {
|
|
3
|
+
import { QueryBuilderDnD } from "@react-querybuilder/dnd";
|
|
4
4
|
import * as ReactDnD from "react-dnd";
|
|
5
5
|
import * as ReactDndHtml5Backend from "react-dnd-html5-backend";
|
|
6
6
|
import { QueryBuilderMaterial } from "@react-querybuilder/material";
|
|
@@ -8,7 +8,7 @@ import { defaultTranslations, QueryBuilder } from "react-querybuilder";
|
|
|
8
8
|
import { formatQuery } from "react-querybuilder/formatQuery";
|
|
9
9
|
import { useIntl } from "react-intl";
|
|
10
10
|
import { useFormContext } from "react-hook-form";
|
|
11
|
-
import { useCallback,
|
|
11
|
+
import { useCallback, useMemo } from "react";
|
|
12
12
|
import { CombinatorSelector } from "./CombinatorSelector.js";
|
|
13
13
|
import { AddButton } from "./AddButton.js";
|
|
14
14
|
import { ValueEditor } from "./ValueEditor.js";
|
|
@@ -38,6 +38,7 @@ const customTranslations = {
|
|
|
38
38
|
value: { title: "" },
|
|
39
39
|
combinators: { title: "" }
|
|
40
40
|
};
|
|
41
|
+
const dnd = { ...ReactDnD, ...ReactDndHtml5Backend };
|
|
41
42
|
const controlElements = {
|
|
42
43
|
addRuleAction: RuleAddButton,
|
|
43
44
|
addGroupAction: GroupAddButton,
|
|
@@ -77,10 +78,6 @@ function CustomReactQueryBuilder(props) {
|
|
|
77
78
|
},
|
|
78
79
|
[getValues, setValue, isSubmitted, name]
|
|
79
80
|
);
|
|
80
|
-
const [dnd, setDnd] = useState(() => createReactDnDAdapter({ ...ReactDnD, ...ReactDndHtml5Backend }));
|
|
81
|
-
const resetDnd = useCallback(() => {
|
|
82
|
-
setDnd(createReactDnDAdapter({ ...ReactDnD, ...ReactDndHtml5Backend }));
|
|
83
|
-
}, [setDnd]);
|
|
84
81
|
const combinators = useMemo(() => {
|
|
85
82
|
return Object.values(COMBINATOR_OPTIONS).map((c) => ({
|
|
86
83
|
name: c.name,
|
|
@@ -88,7 +85,7 @@ function CustomReactQueryBuilder(props) {
|
|
|
88
85
|
}));
|
|
89
86
|
}, [intl]);
|
|
90
87
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
91
|
-
/* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(QueryBuilderDnD, { dnd,
|
|
88
|
+
/* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(QueryBuilderDnD, { dnd, children: /* @__PURE__ */ jsx(
|
|
92
89
|
QueryBuilder,
|
|
93
90
|
{
|
|
94
91
|
fields,
|
|
@@ -5,9 +5,11 @@ const ITEM_HEIGHT = 32;
|
|
|
5
5
|
const ITEM_PADDING = 4;
|
|
6
6
|
const ITEMS_COUNT = 10;
|
|
7
7
|
const MenuProps = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
slotProps: {
|
|
9
|
+
paper: {
|
|
10
|
+
style: {
|
|
11
|
+
maxHeight: (ITEM_HEIGHT + ITEM_PADDING) * ITEMS_COUNT + ITEM_PADDING
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
};
|
|
@@ -46,61 +46,72 @@ function PropertyValueEditor(props) {
|
|
|
46
46
|
},
|
|
47
47
|
[valueEditorProps]
|
|
48
48
|
);
|
|
49
|
-
return /* @__PURE__ */ jsxs(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
size: "small",
|
|
63
|
-
filterOptions: createCustomFilterOptions
|
|
64
|
-
}
|
|
65
|
-
) }),
|
|
66
|
-
/* @__PURE__ */ jsx(Grid, { size: "auto", children: /* @__PURE__ */ jsx(FormControl, { variant: "standard", sx: { mt: 1, minWidth: 160 }, children: /* @__PURE__ */ jsx(
|
|
67
|
-
Select,
|
|
68
|
-
{
|
|
69
|
-
value: propertyOperator ?? PROPERTY_VALUE_OPERATORS[0].customName,
|
|
70
|
-
size: "small",
|
|
71
|
-
title: valueEditorProps?.title,
|
|
72
|
-
error: !valid,
|
|
73
|
-
onChange: (event) => {
|
|
74
|
-
onChange(FieldConstants.PROPERTY_OPERATOR, event.target.value);
|
|
75
|
-
},
|
|
76
|
-
children: PROPERTY_VALUE_OPERATORS.map((operator) => /* @__PURE__ */ jsx(MenuItem, { value: operator.customName, children: intl.formatMessage({ id: operator.label }) }, operator.customName))
|
|
77
|
-
}
|
|
78
|
-
) }) }),
|
|
79
|
-
valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.EXISTS.customName && valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.NOT_EXISTS.customName && /* @__PURE__ */ jsx(Grid, { size: "grow", children: /* @__PURE__ */ jsx(
|
|
80
|
-
Autocomplete,
|
|
81
|
-
{
|
|
82
|
-
value: propertyValues ?? [],
|
|
83
|
-
options: predefinedValues ?? [],
|
|
84
|
-
title: valueEditorProps?.title,
|
|
85
|
-
multiple: true,
|
|
86
|
-
renderInput: (params) => /* @__PURE__ */ jsx(
|
|
87
|
-
TextField,
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
50
|
+
Grid,
|
|
51
|
+
{
|
|
52
|
+
container: true,
|
|
53
|
+
spacing: 1,
|
|
54
|
+
sx: {
|
|
55
|
+
width: "100%",
|
|
56
|
+
alignItems: "center"
|
|
57
|
+
},
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx(Grid, { size: 4, children: /* @__PURE__ */ jsx(
|
|
60
|
+
Autocomplete,
|
|
88
61
|
{
|
|
89
|
-
|
|
62
|
+
value: propertyName ?? "",
|
|
63
|
+
options: predefinedNames,
|
|
64
|
+
freeSolo: true,
|
|
65
|
+
autoSelect: true,
|
|
66
|
+
forcePopupIcon: true,
|
|
67
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid }),
|
|
68
|
+
onChange: (event, value) => {
|
|
69
|
+
onChange(FieldConstants.PROPERTY_NAME, value);
|
|
70
|
+
},
|
|
71
|
+
size: "small",
|
|
72
|
+
filterOptions: createCustomFilterOptions
|
|
73
|
+
}
|
|
74
|
+
) }),
|
|
75
|
+
/* @__PURE__ */ jsx(Grid, { size: "auto", children: /* @__PURE__ */ jsx(FormControl, { variant: "standard", sx: { mt: 1, minWidth: 160 }, children: /* @__PURE__ */ jsx(
|
|
76
|
+
Select,
|
|
77
|
+
{
|
|
78
|
+
value: propertyOperator ?? PROPERTY_VALUE_OPERATORS[0].customName,
|
|
79
|
+
size: "small",
|
|
80
|
+
title: valueEditorProps?.title,
|
|
90
81
|
error: !valid,
|
|
91
|
-
|
|
82
|
+
onChange: (event) => {
|
|
83
|
+
onChange(FieldConstants.PROPERTY_OPERATOR, event.target.value);
|
|
84
|
+
},
|
|
85
|
+
children: PROPERTY_VALUE_OPERATORS.map((operator) => /* @__PURE__ */ jsx(MenuItem, { value: operator.customName, children: intl.formatMessage({ id: operator.label }) }, operator.customName))
|
|
92
86
|
}
|
|
93
|
-
),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
87
|
+
) }) }),
|
|
88
|
+
valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.EXISTS.customName && valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.NOT_EXISTS.customName && /* @__PURE__ */ jsx(Grid, { size: "grow", children: /* @__PURE__ */ jsx(
|
|
89
|
+
Autocomplete,
|
|
90
|
+
{
|
|
91
|
+
value: propertyValues ?? [],
|
|
92
|
+
options: predefinedValues ?? [],
|
|
93
|
+
title: valueEditorProps?.title,
|
|
94
|
+
multiple: true,
|
|
95
|
+
renderInput: (params) => /* @__PURE__ */ jsx(
|
|
96
|
+
TextField,
|
|
97
|
+
{
|
|
98
|
+
...params,
|
|
99
|
+
error: !valid,
|
|
100
|
+
placeholder: propertyValues?.length > 0 ? "" : intl.formatMessage({ id: "valuesList" })
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
freeSolo: true,
|
|
104
|
+
autoSelect: true,
|
|
105
|
+
onChange: (event, value) => {
|
|
106
|
+
onChange(FieldConstants.PROPERTY_VALUES, value);
|
|
107
|
+
},
|
|
108
|
+
size: "small",
|
|
109
|
+
filterOptions: createCustomFilterOptions
|
|
110
|
+
}
|
|
111
|
+
) })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
104
115
|
}
|
|
105
116
|
export {
|
|
106
117
|
PropertyValueEditor
|