@gridsuite/commons-ui 0.239.0 → 0.241.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/README.md +6 -2
- package/dist/components/composite/agGridTable/cellEditors/numericEditor.d.ts +9 -3
- package/dist/components/composite/agGridTable/cellEditors/numericEditor.js +24 -5
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-comparator-filter.js +2 -2
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-text-filter.js +4 -4
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-filter-icon.js +2 -2
- package/dist/components/composite/customAGGrid/custom-aggrid-header.js +26 -13
- package/dist/components/composite/customAGGrid/custom-aggrid-menu.js +2 -2
- package/dist/components/composite/dnd-table/dnd-table-bottom-left-buttons.js +4 -4
- package/dist/components/composite/dnd-table/dnd-table-bottom-right-buttons.js +6 -6
- package/dist/components/composite/dnd-table/dnd-table.js +4 -4
- package/dist/components/composite/filter/HeaderFilterForm.js +4 -4
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +1 -1
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +2 -4
- package/dist/components/composite/grid/grid-item.d.ts +4 -3
- package/dist/components/composite/grid/grid-item.js +8 -4
- package/dist/components/composite/grid/grid-section.d.ts +1 -1
- package/dist/components/composite/grid/grid-section.js +3 -3
- package/dist/components/composite/grid/index.js +6 -3
- package/dist/components/composite/index.js +4 -3
- package/dist/components/composite/reactQueryBuilder/PropertyValueEditor.js +5 -5
- package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +2 -2
- package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +5 -5
- package/dist/components/index.js +4 -3
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +9 -9
- package/dist/components/ui/dialogs/modifyElementSelection/ModifyElementSelection.js +3 -3
- package/dist/components/ui/reactHookForm/errorManagement/FieldErrorAlert.js +2 -2
- package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.js +4 -4
- package/dist/components/ui/reactHookForm/expandableInput/ExpandableInput.js +4 -4
- package/dist/components/ui/reactHookForm/numbers/RangeInput.js +5 -5
- package/dist/components/ui/reactHookForm/utils/functions.js +2 -2
- package/dist/features/authentication/AuthenticationRouter.js +2 -2
- package/dist/features/authentication/AuthenticationRouterErrorDisplay.js +3 -3
- package/dist/features/index.js +6 -1
- package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +7 -7
- package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +4 -4
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +8 -8
- package/dist/features/network-modifications/battery/modification/BatteryModificationForm.js +5 -5
- package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js +1 -1
- package/dist/features/network-modifications/by-filter/assignment/modification-by-assignment-form.js +4 -4
- package/dist/features/network-modifications/by-filter/deletion/ByFilterDeletionForm.js +4 -4
- package/dist/features/network-modifications/common/activePowerControl/ActivePowerControlForm.js +1 -1
- package/dist/features/network-modifications/common/connectivity/BranchConnectivityForm.js +1 -1
- package/dist/features/network-modifications/common/connectivity/ConnectivityForm.js +7 -7
- package/dist/features/network-modifications/common/connectivity/PositionForm.js +4 -4
- package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +4 -4
- package/dist/features/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +4 -3
- package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +2 -2
- package/dist/features/network-modifications/common/measurements/PowerMeasurementsForm.js +4 -4
- package/dist/features/network-modifications/common/measurements/PowerWithValidityForm.js +4 -4
- package/dist/features/network-modifications/common/properties/PropertiesForm.js +1 -1
- package/dist/features/network-modifications/common/properties/PropertyForm.js +5 -5
- package/dist/features/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js +3 -3
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js +1 -1
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +7 -7
- package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +2 -2
- package/dist/features/network-modifications/common/setpoints/SetPointsForm.js +5 -5
- package/dist/features/network-modifications/common/shortCircuit/ShortCircuitForm.js +3 -3
- package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +5 -5
- package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +6 -6
- package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/HvdcLccDeletionSpecificForm.js +5 -5
- package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +5 -5
- package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +9 -9
- package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +5 -5
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +9 -9
- package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +5 -5
- package/dist/features/network-modifications/load/common/LoadDialogHeader.js +5 -5
- package/dist/features/network-modifications/load/common/LoadDialogTabsContent.js +1 -1
- package/dist/features/network-modifications/load/common/LoadForm.js +5 -5
- package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +12 -12
- package/dist/features/network-modifications/shunt-compensator/common/characteristicsForm.utils.d.ts +8 -8
- package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +11 -11
- package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.d.ts +12 -12
- package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +3 -3
- package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.d.ts +12 -12
- package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +7 -7
- package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +7 -7
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +7 -7
- package/dist/features/network-modifications/voltageLevel/creation/tabs/characteristicsTab/CharacteristicsTab.js +9 -9
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +5 -5
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/couplingOmnibus/CouplingOmnibusCreation.js +3 -3
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +1 -1
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +7 -7
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +5 -5
- package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +3 -3
- package/dist/features/network-modifications/voltageLevel/modification/voltageLevelModification.utils.d.ts +1 -1
- package/dist/features/parameters/common/contingency-table/contingency-table.js +4 -4
- package/dist/features/parameters/common/hook/use-tabs.d.ts +3 -2
- package/dist/features/parameters/common/hook/use-tabs.js +2 -3
- package/dist/features/parameters/common/index.d.ts +2 -1
- package/dist/features/parameters/common/index.js +6 -1
- package/dist/features/parameters/common/line-separator.js +2 -2
- package/dist/features/parameters/common/name-element-editor/name-element-editor-form.js +4 -4
- package/dist/features/parameters/common/parameter-field.js +5 -4
- package/dist/features/parameters/common/parameter-layout/index.d.ts +8 -0
- package/dist/features/parameters/common/parameter-layout/index.js +7 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout-provider.d.ts +10 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout-provider.js +15 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout.d.ts +23 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout.js +167 -0
- package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +3 -3
- package/dist/features/parameters/common/parameters.js +3 -3
- package/dist/features/parameters/common/provider-param.d.ts +10 -0
- package/dist/features/parameters/common/{ProviderParam.js → provider-param.js} +9 -11
- package/dist/features/parameters/common/widget/parameter-float.js +4 -4
- package/dist/features/parameters/common/widget/parameter-group.js +2 -2
- package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +4 -4
- package/dist/features/parameters/common/widget/parameter-line-slider.js +4 -4
- package/dist/features/parameters/common/widget/parameter-switch.js +2 -2
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.d.ts +4 -5
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +39 -60
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +39 -101
- package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +2 -2
- package/dist/features/parameters/dynamic-margin-calculation/time-delay-parameters.js +2 -2
- package/dist/features/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +8 -7
- package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +12 -11
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +38 -71
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +4 -5
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +39 -61
- package/dist/features/parameters/dynamic-security-analysis/scenario-parameters.js +2 -2
- package/dist/features/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +8 -7
- package/dist/features/parameters/dynamic-simulation/curve/common/grid-buttons.js +4 -4
- package/dist/features/parameters/dynamic-simulation/curve/curve-parameters.js +7 -8
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-preview.js +7 -7
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector-dialog.js +10 -10
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector.js +26 -50
- package/dist/features/parameters/dynamic-simulation/curve/dialog/equipment-filter.js +20 -20
- package/dist/features/parameters/dynamic-simulation/curve/dialog/model-filter.js +11 -10
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +42 -104
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.d.ts +4 -5
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +75 -97
- package/dist/features/parameters/dynamic-simulation/mapping/mapping-parameters.js +10 -9
- package/dist/features/parameters/dynamic-simulation/network/network-parameters.js +2 -2
- package/dist/features/parameters/dynamic-simulation/solver/solver-parameters.js +2 -2
- package/dist/features/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +2 -2
- package/dist/features/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js +7 -6
- package/dist/features/parameters/index.js +6 -1
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-content.js +14 -13
- package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +12 -18
- package/dist/features/parameters/loadflow/load-flow-parameters-form.d.ts +1 -6
- package/dist/features/parameters/loadflow/load-flow-parameters-form.js +26 -91
- package/dist/features/parameters/loadflow/load-flow-parameters-header.js +29 -53
- package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +35 -128
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +11 -10
- package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +10 -9
- package/dist/features/parameters/network-visualizations/map-parameters.js +18 -17
- package/dist/features/parameters/network-visualizations/network-area-diagram-parameters.js +4 -4
- package/dist/features/parameters/network-visualizations/network-visualizations-form.d.ts +1 -4
- package/dist/features/parameters/network-visualizations/network-visualizations-form.js +19 -48
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +13 -19
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +34 -65
- package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +18 -17
- package/dist/features/parameters/parameters-style.d.ts +0 -1
- package/dist/features/parameters/parameters-style.js +0 -2
- package/dist/features/parameters/pcc-min/pcc-min-parameters-dialog.js +13 -18
- package/dist/features/parameters/pcc-min/pcc-min-parameters-form.d.ts +7 -29
- package/dist/features/parameters/pcc-min/pcc-min-parameters-form.js +16 -109
- package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +27 -84
- package/dist/features/parameters/security-analysis/columns-definitions.js +11 -10
- package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +20 -20
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.d.ts +2 -4
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +44 -115
- package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +40 -109
- package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +12 -11
- package/dist/features/parameters/security-analysis/security-analysis-violations-hiding.js +9 -11
- package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +7 -6
- package/dist/features/parameters/sensi/columns-definitions.js +9 -8
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +21 -21
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.d.ts +3 -5
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +33 -90
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +40 -99
- package/dist/features/parameters/sensi/sensitivity-parameters-fields.js +8 -17
- package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +10 -9
- package/dist/features/parameters/sensi/utils.js +8 -7
- package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +15 -14
- package/dist/features/parameters/short-circuit/short-circuit-parameters-content.js +11 -10
- package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +13 -18
- package/dist/features/parameters/short-circuit/short-circuit-parameters-form.d.ts +1 -4
- package/dist/features/parameters/short-circuit/short-circuit-parameters-form.js +5 -63
- package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +33 -101
- package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +12 -11
- package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +17 -16
- package/dist/features/parameters/short-circuit/short-circuit-study-area-tab-panel.js +15 -14
- package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -0
- package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +6 -5
- package/dist/features/parameters/voltage-init/general-parameters.js +11 -10
- package/dist/features/parameters/voltage-init/voltage-init-parameters-dialog.js +13 -18
- package/dist/features/parameters/voltage-init/voltage-init-parameters-form.d.ts +2 -24
- package/dist/features/parameters/voltage-init/voltage-init-parameters-form.js +51 -108
- package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +34 -90
- package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +2 -2
- package/dist/features/process-configs/security-analysis/update-sa-process-config.js +7 -6
- package/dist/features/topBar/AboutDialog.js +4 -7
- package/dist/index.js +13 -4
- package/dist/translations/en/commonButtonEn.d.ts +2 -0
- package/dist/translations/en/commonButtonEn.js +2 -0
- package/dist/translations/en/parameters.d.ts +1 -0
- package/dist/translations/en/parameters.js +3 -1
- package/dist/translations/fr/commonButtonFr.d.ts +2 -0
- package/dist/translations/fr/commonButtonFr.js +2 -0
- package/dist/translations/fr/parameters.d.ts +1 -0
- package/dist/translations/fr/parameters.js +3 -1
- package/dist/utils/types/elementType.d.ts +1 -0
- package/dist/utils/types/elementType.js +1 -0
- package/package.json +3 -2
- package/dist/features/parameters/common/ProviderParam.d.ts +0 -7
package/README.md
CHANGED
|
@@ -25,11 +25,15 @@ The `npm start` command install the library's dependencies then launches the dem
|
|
|
25
25
|
|
|
26
26
|
##### Development Scripts
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Developers can use these scripts to perform check actions instead of executing local tsc, eslint, etc...
|
|
29
|
+
This ensures all developers use the project's local tools version from `node_modules` rather than a potentially different globally-installed version.
|
|
29
30
|
|
|
31
|
+
- **`npm run type-check`** - Runs TypeScript type checking without emitting files on the whole sources. Run this to check that your current dev is mainly correct.
|
|
32
|
+
|
|
33
|
+
- **`npm run type-check:build`** - Runs TypeScript type checking with emitting files and only on the exported sources. This is what is executed by the CI, so you can use it before committing.
|
|
30
34
|
- **`npm run build`** - Builds the library. Note: This automatically runs `npm run prebuild` first.
|
|
31
35
|
|
|
32
|
-
- **`npm run prebuild`** - Runs linting and type checking before the build. This script is executed automatically by npm before `npm run build` and ensures that the build is not executed if linting or type checking fails. You don't need to call this manually unless you want to verify code quality without building.
|
|
36
|
+
- **`npm run prebuild`** - Runs linting and type checking before the build (`npm run lint && npm run type-check:build`). This script is executed automatically by npm before `npm run build` and ensures that the build is not executed if linting or type checking fails. You don't need to call this manually unless you want to verify code quality without building.
|
|
33
37
|
|
|
34
38
|
##### Local Testing
|
|
35
39
|
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { CustomCellEditorProps } from 'ag-grid-react';
|
|
2
2
|
import { SuppressKeyboardEventParams } from 'ag-grid-community';
|
|
3
|
+
type NumericEditorProps = {
|
|
4
|
+
allowNegativeValues?: boolean;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* `suppressKeyboardEvent` callback to put on any column using {@link NumericEditor}.
|
|
5
8
|
* Prevents ag-grid from starting an edit when a non-numeric printable key is pressed on a focused cell.
|
|
6
|
-
* Numeric keys still start editing;
|
|
9
|
+
* Numeric keys and decimal separators still start editing; if `allowNegativeValues` is true, the minus sign does too.
|
|
10
|
+
* Keys pressed while already editing are left to the input's own onKeyDown handling.
|
|
7
11
|
*/
|
|
8
12
|
export declare const suppressNonNumericKeyboardEvent: (params: SuppressKeyboardEventParams) => boolean;
|
|
9
13
|
/**
|
|
10
14
|
* Custom numeric cell editor (see ag-grid custom cell editor docs:
|
|
11
15
|
* https://www.ag-grid.com/react-data-grid/cell-editors/#custom-components).
|
|
12
16
|
* Restricts typing to digits and decimal separators while keeping the raw text in the input,
|
|
13
|
-
* and commits the value as a number (or null) via onValueChange.
|
|
17
|
+
* and commits the value as a number (or null) via onValueChange. The minus sign is accepted when
|
|
18
|
+
* `allowNegativeValues` is true.
|
|
14
19
|
*
|
|
15
20
|
* NB: the `eventKey`-driven logic below (seeding the initial value from the triggering key in the
|
|
16
21
|
* useState/useEffect) only matters when editing is started by typing a character on a focused cell,
|
|
@@ -20,4 +25,5 @@ export declare const suppressNonNumericKeyboardEvent: (params: SuppressKeyboardE
|
|
|
20
25
|
* Columns using this editor should also set `suppressKeyboardEvent: suppressNonNumericKeyboardEvent`
|
|
21
26
|
* so that a non-numeric key on a focused cell doesn't start an edit.
|
|
22
27
|
*/
|
|
23
|
-
export declare function NumericEditor({ value, onValueChange, eventKey }: CustomCellEditorProps): import("react").JSX.Element;
|
|
28
|
+
export declare function NumericEditor({ value, onValueChange, eventKey, allowNegativeValues, }: CustomCellEditorProps & NumericEditorProps): import("react").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState, useEffect } from "react";
|
|
3
3
|
import { KeyCode } from "ag-grid-community";
|
|
4
|
-
const isCharNumeric = (charStr) => !!charStr &&
|
|
5
|
-
const suppressNonNumericKeyboardEvent = (params) =>
|
|
4
|
+
const isCharNumeric = (charStr, allowNegativeValues = false) => !!charStr && (allowNegativeValues ? /^[\d,.-]$/.test(charStr) : /^[\d,.]$/.test(charStr));
|
|
5
|
+
const suppressNonNumericKeyboardEvent = (params) => {
|
|
6
|
+
const allowNegativeValues = params.colDef.cellEditorParams?.allowNegativeValues === true;
|
|
7
|
+
return !params.editing && params.event.key.length === 1 && !isCharNumeric(params.event.key, allowNegativeValues);
|
|
8
|
+
};
|
|
6
9
|
const toNumber = (text) => {
|
|
7
10
|
const result = Number.parseFloat(text.replace(",", "."));
|
|
8
11
|
return Number.isNaN(result) ? null : result;
|
|
9
12
|
};
|
|
10
|
-
function NumericEditor({
|
|
13
|
+
function NumericEditor({
|
|
14
|
+
value,
|
|
15
|
+
onValueChange,
|
|
16
|
+
eventKey,
|
|
17
|
+
allowNegativeValues = false
|
|
18
|
+
}) {
|
|
11
19
|
const refInput = useRef(null);
|
|
12
20
|
const [text, setText] = useState(() => {
|
|
13
21
|
if (eventKey === KeyCode.BACKSPACE) {
|
|
14
22
|
return "";
|
|
15
23
|
}
|
|
16
|
-
if (eventKey?.length === 1 && isCharNumeric(eventKey)) {
|
|
24
|
+
if (eventKey?.length === 1 && isCharNumeric(eventKey, allowNegativeValues)) {
|
|
17
25
|
return eventKey;
|
|
18
26
|
}
|
|
19
27
|
return value == null ? "" : String(value);
|
|
@@ -27,7 +35,18 @@ function NumericEditor({ value, onValueChange, eventKey }) {
|
|
|
27
35
|
onValueChange(toNumber(event.target.value));
|
|
28
36
|
};
|
|
29
37
|
const handleKeyDown = (event) => {
|
|
30
|
-
if (event.key
|
|
38
|
+
if (event.key === "-" && allowNegativeValues) {
|
|
39
|
+
const input = event.currentTarget;
|
|
40
|
+
const selectionStart = input.selectionStart ?? 0;
|
|
41
|
+
const selectionEnd = input.selectionEnd ?? 0;
|
|
42
|
+
const atStart = selectionStart === 0;
|
|
43
|
+
const keepsExistingMinus = input.value.includes("-") && !input.value.slice(selectionStart, selectionEnd).includes("-");
|
|
44
|
+
if (!atStart || keepsExistingMinus) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (event.key.length === 1 && !isCharNumeric(event.key, allowNegativeValues)) {
|
|
31
50
|
event.preventDefault();
|
|
32
51
|
}
|
|
33
52
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Stack, IconButton } from "@mui/material";
|
|
3
3
|
import { Close } from "@mui/icons-material";
|
|
4
4
|
import { CustomAggridComparatorSelector } from "./custom-aggrid-comparator-selector.js";
|
|
5
5
|
import { CustomAggridTextFilter } from "./custom-aggrid-text-filter.js";
|
|
@@ -23,7 +23,7 @@ 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(
|
|
26
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: 0.8, sx: { padding: "8px" }, children: [
|
|
27
27
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
28
28
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsx(
|
|
29
29
|
CustomAggridComparatorSelector,
|
package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-text-filter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Stack, Grid2, TextField, InputAdornment, IconButton } from "@mui/material";
|
|
4
4
|
import { Clear } from "@mui/icons-material";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import "../../../../utils/conversionUtils.js";
|
|
@@ -31,8 +31,8 @@ function CustomAggridTextFilter({
|
|
|
31
31
|
}) {
|
|
32
32
|
const intl = useIntl();
|
|
33
33
|
const isRoundingDisplayed = useMemo(() => !!(isNumberInput && value), [isNumberInput, value]);
|
|
34
|
-
return /* @__PURE__ */ jsxs(
|
|
35
|
-
/* @__PURE__ */ jsx(
|
|
34
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: 0.2, children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
36
36
|
TextField,
|
|
37
37
|
{
|
|
38
38
|
size: "small",
|
|
@@ -51,7 +51,7 @@ function CustomAggridTextFilter({
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
) }),
|
|
54
|
-
isRoundingDisplayed && /* @__PURE__ */ jsx(
|
|
54
|
+
isRoundingDisplayed && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(DisplayRounding, { decimalAfterDot }) })
|
|
55
55
|
] });
|
|
56
56
|
}
|
|
57
57
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, IconButton, Badge } from "@mui/material";
|
|
3
3
|
import { FilterAlt } from "@mui/icons-material";
|
|
4
4
|
import "../../../../utils/conversionUtils.js";
|
|
5
5
|
import "../../../../utils/types/equipmentType.js";
|
|
@@ -15,7 +15,7 @@ function CustomFilterIcon({
|
|
|
15
15
|
selectedFilterComparator
|
|
16
16
|
}) {
|
|
17
17
|
const isFilterActive = selectedFilterData !== void 0 && selectedFilterData !== null && (isNonEmptyStringOrArray(selectedFilterData) || selectedFilterComparator === FilterTextComparators.IS_EMPTY || selectedFilterComparator === FilterTextComparators.IS_NOT_EMPTY);
|
|
18
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
+
return /* @__PURE__ */ jsx(Grid2, { sx: styles.gridRoot, children: /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleShowFilter, children: /* @__PURE__ */ jsx(Badge, { color: "secondary", variant: isFilterActive ? "dot" : void 0, invisible: !isFilterActive, children: /* @__PURE__ */ jsx(FilterAlt, { sx: styles.iconSize }) }) }) }) });
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
21
|
CustomFilterIcon
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useCallback } from "react";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
|
-
import {
|
|
4
|
+
import { Grid2, Tooltip } from "@mui/material";
|
|
5
5
|
import { WarningAmber } from "@mui/icons-material";
|
|
6
6
|
import { CustomAggridSort } from "./custom-aggrid-sort.js";
|
|
7
7
|
import { CustomMenu } from "./custom-aggrid-menu.js";
|
|
@@ -9,13 +9,23 @@ import { useCustomAggridSort } from "./hooks/use-custom-aggrid-sort.js";
|
|
|
9
9
|
import { CustomAggridFilter } from "./custom-aggrid-filters/custom-aggrid-filter.js";
|
|
10
10
|
const styles = {
|
|
11
11
|
displayName: {
|
|
12
|
+
minWidth: 0,
|
|
12
13
|
overflow: "hidden",
|
|
13
|
-
textOverflow: "ellipsis"
|
|
14
|
+
textOverflow: "ellipsis",
|
|
15
|
+
whiteSpace: "nowrap"
|
|
14
16
|
},
|
|
15
17
|
invalidIcon: {
|
|
16
18
|
display: "flex",
|
|
17
19
|
alignItems: "center",
|
|
18
20
|
ml: 0.5
|
|
21
|
+
},
|
|
22
|
+
titleContainer: {
|
|
23
|
+
minWidth: 0
|
|
24
|
+
},
|
|
25
|
+
actions: {
|
|
26
|
+
flex: "0 0 auto",
|
|
27
|
+
flexWrap: "nowrap",
|
|
28
|
+
alignItems: "center"
|
|
19
29
|
}
|
|
20
30
|
};
|
|
21
31
|
function CustomHeaderComponent({
|
|
@@ -44,39 +54,42 @@ function CustomHeaderComponent({
|
|
|
44
54
|
const handleMouseLeave = useCallback(() => {
|
|
45
55
|
setIsHoveringColumnHeader(false);
|
|
46
56
|
}, []);
|
|
47
|
-
return /* @__PURE__ */ jsx(
|
|
57
|
+
return /* @__PURE__ */ jsx(Grid2, { container: true, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, sx: { width: "100%" }, children: /* @__PURE__ */ jsxs(Grid2, { container: true, alignItems: "center", wrap: "nowrap", sx: { width: "100%" }, children: [
|
|
48
58
|
/* @__PURE__ */ jsx(
|
|
49
|
-
|
|
59
|
+
Grid2,
|
|
50
60
|
{
|
|
51
61
|
container: true,
|
|
52
62
|
sx: {
|
|
53
|
-
cursor: isSortable ? "pointer" : "default"
|
|
63
|
+
cursor: isSortable ? "pointer" : "default",
|
|
64
|
+
...styles.titleContainer,
|
|
65
|
+
flex: forceDisplayFilterIcon ? "0 1 auto" : void 0
|
|
54
66
|
},
|
|
55
|
-
flexBasis: forceDisplayFilterIcon ? "
|
|
67
|
+
flexBasis: forceDisplayFilterIcon ? "auto" : "100%",
|
|
56
68
|
children: /* @__PURE__ */ jsx(
|
|
57
|
-
|
|
69
|
+
Grid2,
|
|
58
70
|
{
|
|
59
71
|
container: true,
|
|
60
72
|
sx: {
|
|
61
|
-
overflow: "hidden"
|
|
73
|
+
overflow: "hidden",
|
|
74
|
+
minWidth: 0
|
|
62
75
|
},
|
|
63
76
|
onClick: handleClickHeader,
|
|
64
|
-
children: /* @__PURE__ */ jsxs(
|
|
65
|
-
/* @__PURE__ */ jsx(
|
|
66
|
-
isInvalid && /* @__PURE__ */ jsx(
|
|
77
|
+
children: /* @__PURE__ */ jsxs(Grid2, { container: true, sx: styles.displayName, alignItems: "center", wrap: "nowrap", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(Grid2, { children: displayName }),
|
|
79
|
+
isInvalid && /* @__PURE__ */ jsx(Grid2, { sx: styles.invalidIcon, children: /* @__PURE__ */ jsx(
|
|
67
80
|
Tooltip,
|
|
68
81
|
{
|
|
69
82
|
title: /* @__PURE__ */ jsx(FormattedMessage, { id: "spreadsheet/column/invalid-without-loadflow" }),
|
|
70
83
|
children: /* @__PURE__ */ jsx(WarningAmber, { fontSize: "small", color: "warning" })
|
|
71
84
|
}
|
|
72
85
|
) }),
|
|
73
|
-
sortParams && /* @__PURE__ */ jsx(
|
|
86
|
+
sortParams && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(CustomAggridSort, { colId: column.getId(), sortParams }) })
|
|
74
87
|
] })
|
|
75
88
|
}
|
|
76
89
|
)
|
|
77
90
|
}
|
|
78
91
|
),
|
|
79
|
-
/* @__PURE__ */ jsxs(
|
|
92
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, sx: styles.actions, children: [
|
|
80
93
|
filterComponent && /* @__PURE__ */ jsx(
|
|
81
94
|
CustomAggridFilter,
|
|
82
95
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Grid2, IconButton, Badge } from "@mui/material";
|
|
4
4
|
import { MoreVert } from "@mui/icons-material";
|
|
5
5
|
const styles = {
|
|
6
6
|
iconSize: {
|
|
@@ -11,7 +11,7 @@ function CustomMenu({ Menu, menuParams }) {
|
|
|
11
11
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
12
12
|
const menuButtonRef = useRef(null);
|
|
13
13
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
-
/* @__PURE__ */ jsx(
|
|
14
|
+
/* @__PURE__ */ jsx(Grid2, { container: true, direction: "row", children: /* @__PURE__ */ jsx(IconButton, { ref: menuButtonRef, size: "small", onClick: () => setMenuOpen(true), children: /* @__PURE__ */ jsx(Badge, { color: "secondary", children: /* @__PURE__ */ jsx(MoreVert, { sx: styles.iconSize }) }) }) }),
|
|
15
15
|
/* @__PURE__ */ jsx(Menu, { open: menuOpen, onClose: () => setMenuOpen(false), anchorEl: menuButtonRef.current, ...menuParams })
|
|
16
16
|
] });
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, IconButton } from "@mui/material";
|
|
3
3
|
import { Upload, Replay } from "@mui/icons-material";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { CustomTooltip } from "../../ui/tooltip/CustomTooltip.js";
|
|
@@ -13,8 +13,8 @@ function DndTableBottomLeftButtons({
|
|
|
13
13
|
disabled
|
|
14
14
|
}) {
|
|
15
15
|
const intl = useIntl();
|
|
16
|
-
return /* @__PURE__ */ jsxs(
|
|
17
|
-
/* @__PURE__ */ jsx(
|
|
16
|
+
return /* @__PURE__ */ jsxs(Grid2, { container: true, size: "grow", spacing: 1, children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
18
18
|
CustomTooltip,
|
|
19
19
|
{
|
|
20
20
|
title: intl.formatMessage({
|
|
@@ -31,7 +31,7 @@ function DndTableBottomLeftButtons({
|
|
|
31
31
|
) })
|
|
32
32
|
}
|
|
33
33
|
) }),
|
|
34
|
-
withResetButton && /* @__PURE__ */ jsx(
|
|
34
|
+
withResetButton && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
35
35
|
CustomTooltip,
|
|
36
36
|
{
|
|
37
37
|
title: intl.formatMessage({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, IconButton } from "@mui/material";
|
|
3
3
|
import { AddCircle, Delete, ArrowUpward, ArrowDownward } from "@mui/icons-material";
|
|
4
4
|
import { useWatch } from "react-hook-form";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
@@ -22,8 +22,8 @@ function DndTableBottomRightButtons({
|
|
|
22
22
|
const noRowsSelected = currentRows ? !currentRows.some((row) => row[SELECTED]) : true;
|
|
23
23
|
const firstRowSelected = noRowsSelected ? void 0 : currentRows[0]?.[SELECTED];
|
|
24
24
|
const lastRowSelected = noRowsSelected ? void 0 : currentRows[currentRows.length - 1]?.[SELECTED];
|
|
25
|
-
return /* @__PURE__ */ jsxs(
|
|
26
|
-
/* @__PURE__ */ jsx(
|
|
25
|
+
return /* @__PURE__ */ jsxs(Grid2, { container: true, size: "grow", spacing: 1, sx: { justifyContent: "flex-end" }, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
27
27
|
CustomTooltip,
|
|
28
28
|
{
|
|
29
29
|
title: intl.formatMessage({
|
|
@@ -40,7 +40,7 @@ function DndTableBottomRightButtons({
|
|
|
40
40
|
) })
|
|
41
41
|
}
|
|
42
42
|
) }),
|
|
43
|
-
/* @__PURE__ */ jsx(
|
|
43
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
44
44
|
CustomTooltip,
|
|
45
45
|
{
|
|
46
46
|
title: intl.formatMessage({
|
|
@@ -58,7 +58,7 @@ function DndTableBottomRightButtons({
|
|
|
58
58
|
}
|
|
59
59
|
) }),
|
|
60
60
|
showMoveArrow && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
-
/* @__PURE__ */ jsx(
|
|
61
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
62
62
|
CustomTooltip,
|
|
63
63
|
{
|
|
64
64
|
title: intl.formatMessage({
|
|
@@ -75,7 +75,7 @@ function DndTableBottomRightButtons({
|
|
|
75
75
|
) })
|
|
76
76
|
}
|
|
77
77
|
) }),
|
|
78
|
-
/* @__PURE__ */ jsx(
|
|
78
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
79
79
|
CustomTooltip,
|
|
80
80
|
{
|
|
81
81
|
title: intl.formatMessage({
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createPortal } from "react-dom";
|
|
3
3
|
import { useState, useCallback, useRef, useMemo } from "react";
|
|
4
4
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
5
|
-
import {
|
|
5
|
+
import { Grid2, TableContainer, Table, TableHead, TableRow, TableCell, Box, IconButton, TableBody, Checkbox } from "@mui/material";
|
|
6
6
|
import { DragDropContext, Droppable, Draggable } from "@hello-pangea/dnd";
|
|
7
7
|
import { useIntl } from "react-intl";
|
|
8
8
|
import { AddCircle } from "@mui/icons-material";
|
|
@@ -316,8 +316,8 @@ function DndTable(props) {
|
|
|
316
316
|
providedDroppable.placeholder
|
|
317
317
|
] });
|
|
318
318
|
}
|
|
319
|
-
return /* @__PURE__ */ jsxs(
|
|
320
|
-
/* @__PURE__ */ jsxs(
|
|
319
|
+
return /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 1, size: 12, children: [
|
|
320
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, size: 12, children: [
|
|
321
321
|
/* @__PURE__ */ jsx(DragDropContext, { onBeforeDragStart, onDragEnd, children: /* @__PURE__ */ jsx(Droppable, { droppableId: "tapTable", isDropDisabled: disabled, children: (provided) => /* @__PURE__ */ jsx(
|
|
322
322
|
TableContainer,
|
|
323
323
|
{
|
|
@@ -335,7 +335,7 @@ function DndTable(props) {
|
|
|
335
335
|
) }) }),
|
|
336
336
|
/* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert })
|
|
337
337
|
] }),
|
|
338
|
-
/* @__PURE__ */ jsxs(
|
|
338
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, size: 12, children: [
|
|
339
339
|
handleResetButton && handleUploadButton && resetButtonMessageId && uploadButtonMessageId ? /* @__PURE__ */ jsx(
|
|
340
340
|
DndTableBottomLeftButtons,
|
|
341
341
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2 } from "@mui/material";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
5
5
|
import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
|
|
@@ -50,8 +50,8 @@ const HeaderFilterSchema = {
|
|
|
50
50
|
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION, "descriptionLimitError")
|
|
51
51
|
};
|
|
52
52
|
function HeaderFilterForm({ creation, activeDirectory }) {
|
|
53
|
-
return /* @__PURE__ */ jsxs(
|
|
54
|
-
/* @__PURE__ */ jsx(
|
|
53
|
+
return /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(
|
|
55
55
|
UniqueNameInput,
|
|
56
56
|
{
|
|
57
57
|
name: FieldConstants.NAME,
|
|
@@ -63,7 +63,7 @@ function HeaderFilterForm({ creation, activeDirectory }) {
|
|
|
63
63
|
fullWidth: false
|
|
64
64
|
}
|
|
65
65
|
) }),
|
|
66
|
-
/* @__PURE__ */ jsx(
|
|
66
|
+
/* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: filterStyles.description }) })
|
|
67
67
|
] });
|
|
68
68
|
}
|
|
69
69
|
export {
|
|
@@ -4,8 +4,8 @@ import { DISTRIBUTION_KEY } from '../constants/FilterConstants';
|
|
|
4
4
|
import * as yup from 'yup';
|
|
5
5
|
export declare const explicitNamingFilterSchema: {
|
|
6
6
|
filterEquipmentsAttributes: yup.ArraySchema<{
|
|
7
|
-
distributionKey?: number | null | undefined;
|
|
8
7
|
equipmentID?: string | null | undefined;
|
|
8
|
+
distributionKey?: number | null | undefined;
|
|
9
9
|
}[] | undefined, yup.AnyObject, "", "">;
|
|
10
10
|
};
|
|
11
11
|
interface FilterTableRow {
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useMemo, useCallback, useState, useRef } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { useWatch } from "react-hook-form";
|
|
5
|
-
import { Grid2, Alert } from "@mui/material";
|
|
5
|
+
import { Stack, Grid2, Alert } from "@mui/material";
|
|
6
6
|
import { v4 } from "uuid";
|
|
7
7
|
import * as yup from "yup";
|
|
8
8
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
@@ -187,10 +187,8 @@ function ExplicitNamingFilterForm({
|
|
|
187
187
|
);
|
|
188
188
|
};
|
|
189
189
|
return /* @__PURE__ */ jsxs(
|
|
190
|
-
|
|
190
|
+
Stack,
|
|
191
191
|
{
|
|
192
|
-
container: true,
|
|
193
|
-
direction: "column",
|
|
194
192
|
spacing: 2,
|
|
195
193
|
padding: 1,
|
|
196
194
|
sx: { flexGrow: 1, flexWrap: "nowrap", minHeight: 0 },
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2Props } from '@mui/material';
|
|
3
3
|
export interface GridItemProps extends PropsWithChildren {
|
|
4
|
-
size?:
|
|
4
|
+
size?: Grid2Props['size'];
|
|
5
5
|
alignItem?: string;
|
|
6
6
|
tooltip?: ReactNode;
|
|
7
|
+
sx?: Grid2Props['sx'];
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
+
export declare function GridItem({ children, size, alignItem, tooltip, sx }: Readonly<GridItemProps>): import("react").JSX.Element;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2 } from "@mui/material";
|
|
3
3
|
import { CustomTooltip } from "../../ui/tooltip/CustomTooltip.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import "../../../utils/conversionUtils.js";
|
|
5
|
+
import "../../../utils/types/equipmentType.js";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import { mergeSx } from "../../../utils/styles.js";
|
|
8
|
+
function GridItem({ children, size = 6, alignItem = "flex-start", tooltip, sx }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Grid2, { size, sx: mergeSx({ alignItems: alignItem }, sx), children: children && (tooltip ? /* @__PURE__ */ jsx(CustomTooltip, { title: tooltip, children: /* @__PURE__ */ jsx("div", { children }) }) : children) });
|
|
6
10
|
}
|
|
7
11
|
export {
|
|
8
|
-
GridItem
|
|
12
|
+
GridItem
|
|
9
13
|
};
|
|
@@ -5,4 +5,4 @@ export interface GridSectionProps {
|
|
|
5
5
|
size?: number;
|
|
6
6
|
customStyle?: SxStyle;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export declare function GridSection({ title, heading, size, customStyle }: Readonly<GridSectionProps>): import("react").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, Box } from "@mui/material";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
function GridSection({ title, heading = 3, size = 12, customStyle }) {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
+
return /* @__PURE__ */ jsx(Grid2, { container: true, spacing: 2, sx: { width: "100%" }, children: /* @__PURE__ */ jsx(Grid2, { size, children: /* @__PURE__ */ jsx(Box, { sx: customStyle, component: `h${heading}`, children: /* @__PURE__ */ jsx(FormattedMessage, { id: title }) }) }) });
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
GridSection
|
|
8
|
+
GridSection
|
|
9
9
|
};
|
|
@@ -23,9 +23,8 @@ import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNaming
|
|
|
23
23
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./filter/explicitNaming/ExplicitNamingFilterConstants.js";
|
|
24
24
|
import { saveExpertFilter, saveExplicitNamingFilter } from "./filter/utils/filterApi.js";
|
|
25
25
|
import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./filter/utils/filterFormUtils.js";
|
|
26
|
-
import "
|
|
27
|
-
import "
|
|
28
|
-
import "react-intl";
|
|
26
|
+
import { GridItem } from "./grid/grid-item.js";
|
|
27
|
+
import { GridSection } from "./grid/grid-section.js";
|
|
29
28
|
import { OverflowableTableCell } from "./muiTable/OverflowableTableCell.js";
|
|
30
29
|
import { OverflowableTableCellWithCheckbox } from "./muiTable/OverflowableTableCellWithCheckbox.js";
|
|
31
30
|
import { AutocompleteWithFavorites } from "./reactQueryBuilder/AutocompleteWithFavorites.js";
|
|
@@ -136,6 +135,8 @@ export {
|
|
|
136
135
|
FilterType,
|
|
137
136
|
FlatParameters,
|
|
138
137
|
GLOBAL_REPORT_NODE_LABEL,
|
|
138
|
+
GridItem,
|
|
139
|
+
GridSection,
|
|
139
140
|
GroupValueEditor,
|
|
140
141
|
LOAD_TYPE_OPTIONS,
|
|
141
142
|
default2 as LogTable,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useCallback } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Grid2, Autocomplete, TextField, FormControl, Select, MenuItem } from "@mui/material";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { useValid } from "./hooks/useValid.js";
|
|
6
6
|
import { OPERATOR_OPTIONS } from "../filter/expert/expertFilterConstants.js";
|
|
@@ -46,8 +46,8 @@ function PropertyValueEditor(props) {
|
|
|
46
46
|
},
|
|
47
47
|
[valueEditorProps]
|
|
48
48
|
);
|
|
49
|
-
return /* @__PURE__ */ jsxs(
|
|
50
|
-
/* @__PURE__ */ jsx(
|
|
49
|
+
return /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 1, children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
|
|
51
51
|
Autocomplete,
|
|
52
52
|
{
|
|
53
53
|
value: propertyName ?? "",
|
|
@@ -63,7 +63,7 @@ function PropertyValueEditor(props) {
|
|
|
63
63
|
filterOptions: createCustomFilterOptions
|
|
64
64
|
}
|
|
65
65
|
) }),
|
|
66
|
-
/* @__PURE__ */ jsx(
|
|
66
|
+
/* @__PURE__ */ jsx(Grid2, { size: "auto", children: /* @__PURE__ */ jsx(FormControl, { variant: "standard", sx: { mt: 1, minWidth: 160 }, children: /* @__PURE__ */ jsx(
|
|
67
67
|
Select,
|
|
68
68
|
{
|
|
69
69
|
value: propertyOperator ?? PROPERTY_VALUE_OPERATORS[0].customName,
|
|
@@ -76,7 +76,7 @@ function PropertyValueEditor(props) {
|
|
|
76
76
|
children: PROPERTY_VALUE_OPERATORS.map((operator) => /* @__PURE__ */ jsx(MenuItem, { value: operator.customName, children: intl.formatMessage({ id: operator.label }) }, operator.customName))
|
|
77
77
|
}
|
|
78
78
|
) }) }),
|
|
79
|
-
valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.EXISTS.customName && valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.NOT_EXISTS.customName && /* @__PURE__ */ jsx(
|
|
79
|
+
valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.EXISTS.customName && valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.NOT_EXISTS.customName && /* @__PURE__ */ jsx(Grid2, { size: "grow", children: /* @__PURE__ */ jsx(
|
|
80
80
|
Autocomplete,
|
|
81
81
|
{
|
|
82
82
|
value: propertyValues ?? [],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, createElement } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Stack } from "@mui/material";
|
|
4
4
|
import { RuleValueEditor } from "./RuleValueEditor.js";
|
|
5
5
|
const styles = {
|
|
6
6
|
group: (theme) => ({
|
|
@@ -29,7 +29,7 @@ function GroupValueEditor(props) {
|
|
|
29
29
|
},
|
|
30
30
|
[handleOnChange, combinator, value]
|
|
31
31
|
);
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
32
|
+
return /* @__PURE__ */ jsx(Stack, { sx: styles.group, paddingLeft: 1, paddingRight: 1, paddingBottom: 1, children: children && Object.values(children).map((fieldData) => /* @__PURE__ */ createElement(
|
|
33
33
|
RuleValueEditor,
|
|
34
34
|
{
|
|
35
35
|
...props,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, Typography, Select, MenuItem } from "@mui/material";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
const styles = {
|
|
5
5
|
gridItem: {
|
|
@@ -32,9 +32,9 @@ function RuleValueEditor(props) {
|
|
|
32
32
|
operator
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */ jsxs(
|
|
36
|
-
/* @__PURE__ */ jsx(
|
|
37
|
-
/* @__PURE__ */ jsx(
|
|
35
|
+
return /* @__PURE__ */ jsxs(Grid2, { container: true, paddingTop: 1, children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Grid2, { container: true, size: 4, sx: styles.gridItem, children: /* @__PURE__ */ jsx(Typography, { children: intl.formatMessage({ id: fieldData.label }) }) }),
|
|
37
|
+
/* @__PURE__ */ jsx(Grid2, { container: true, size: 2.5, sx: styles.gridItem, paddingLeft: 1, children: /* @__PURE__ */ jsx(
|
|
38
38
|
Select,
|
|
39
39
|
{
|
|
40
40
|
value: operator,
|
|
@@ -46,7 +46,7 @@ function RuleValueEditor(props) {
|
|
|
46
46
|
children: fieldData.operators?.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option.name, children: intl.formatMessage({ id: option.label }) }, option.name))
|
|
47
47
|
}
|
|
48
48
|
) }),
|
|
49
|
-
/* @__PURE__ */ jsx(
|
|
49
|
+
/* @__PURE__ */ jsx(Grid2, { container: true, size: 5.5, sx: styles.gridItem, paddingLeft: 1, children: /* @__PURE__ */ jsx(
|
|
50
50
|
ValueEditorControlElement,
|
|
51
51
|
{
|
|
52
52
|
...props,
|