@gridsuite/commons-ui 0.62.0 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +21 -20
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +15 -13
- package/dist/components/AuthenticationRouter/index.d.ts +4 -7
- package/dist/components/AuthenticationRouter/index.js +2 -2
- package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +0 -1
- package/dist/components/CardErrorBoundary/card-error-boundary.js +5 -3
- package/dist/components/CardErrorBoundary/index.d.ts +3 -7
- package/dist/components/CardErrorBoundary/index.js +2 -2
- package/dist/components/CustomAGGrid/custom-aggrid.js +1 -1
- package/dist/components/CustomAGGrid/custom-aggrid.style.js +5 -5
- package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +2 -3
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +108 -105
- package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +1 -1
- package/dist/components/ElementSearchDialog/element-search-dialog.js +2 -2
- package/dist/components/ElementSearchDialog/element-search-input.d.ts +1 -1
- package/dist/components/ElementSearchDialog/element-search-input.js +4 -6
- package/dist/components/ElementSearchDialog/equipment-item.d.ts +3 -3
- package/dist/components/ElementSearchDialog/equipment-item.js +13 -13
- package/dist/components/ElementSearchDialog/index.d.ts +3 -3
- package/dist/components/ElementSearchDialog/index.js +5 -5
- package/dist/components/ElementSearchDialog/tag-renderer.d.ts +11 -12
- package/dist/components/ElementSearchDialog/tag-renderer.js +5 -6
- package/dist/components/ElementSearchDialog/use-element-search.d.ts +2 -2
- package/dist/components/ElementSearchDialog/use-element-search.js +2 -2
- package/dist/components/ExpandableGroup/expandable-group.d.ts +3 -3
- package/dist/components/ExpandableGroup/expandable-group.js +6 -6
- package/dist/components/ExpandableGroup/index.d.ts +3 -7
- package/dist/components/ExpandableGroup/index.js +2 -2
- package/dist/components/FlatParameters/FlatParameters.d.ts +1 -1
- package/dist/components/FlatParameters/FlatParameters.js +46 -46
- package/dist/components/FlatParameters/index.d.ts +3 -7
- package/dist/components/Login/Login.d.ts +1 -7
- package/dist/components/Login/Login.js +3 -9
- package/dist/components/Login/Logout.d.ts +1 -1
- package/dist/components/Login/Logout.js +11 -11
- package/dist/components/Login/index.d.ts +3 -7
- package/dist/components/Login/index.js +2 -2
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +9 -8
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +24 -9
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +200 -205
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +6 -6
- package/dist/components/MuiVirtualizedTable/index.d.ts +2 -2
- package/dist/components/MuiVirtualizedTable/index.js +3 -3
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +1 -1
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +5 -15
- package/dist/components/MultipleSelectionDialog/index.d.ts +3 -7
- package/dist/components/MultipleSelectionDialog/index.js +2 -2
- package/dist/components/OverflowableText/index.d.ts +3 -7
- package/dist/components/OverflowableText/overflowable-text.js +2 -2
- package/dist/components/ReportViewer/filter-button.d.ts +1 -1
- package/dist/components/ReportViewer/filter-button.js +3 -3
- package/dist/components/ReportViewer/index.d.ts +3 -7
- package/dist/components/ReportViewer/index.js +2 -2
- package/dist/components/ReportViewer/log-report-item.d.ts +1 -1
- package/dist/components/ReportViewer/log-report-item.js +12 -9
- package/dist/components/ReportViewer/log-report.js +3 -3
- package/dist/components/ReportViewer/log-table.d.ts +2 -1
- package/dist/components/ReportViewer/log-table.js +6 -5
- package/dist/components/ReportViewer/multi-select-list.d.ts +1 -1
- package/dist/components/ReportViewer/multi-select-list.js +3 -3
- package/dist/components/ReportViewer/report-item.js +4 -3
- package/dist/components/ReportViewer/report-viewer.js +11 -12
- package/dist/components/ReportViewerDialog/index.d.ts +3 -7
- package/dist/components/ReportViewerDialog/index.js +2 -2
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +2 -2
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +3 -3
- package/dist/components/SignInCallbackHandler/index.d.ts +3 -7
- package/dist/components/SignInCallbackHandler/index.js +2 -2
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +2 -2
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +3 -3
- package/dist/components/SilentRenewCallbackHandler/index.d.ts +3 -7
- package/dist/components/SilentRenewCallbackHandler/index.js +2 -2
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +1 -1
- package/dist/components/SnackbarProvider/SnackbarProvider.js +14 -13
- package/dist/components/SnackbarProvider/index.d.ts +3 -7
- package/dist/components/SnackbarProvider/index.js +2 -2
- package/dist/components/TopBar/AboutDialog.d.ts +2 -3
- package/dist/components/TopBar/AboutDialog.js +151 -153
- package/dist/components/TopBar/GridLogo.d.ts +2 -2
- package/dist/components/TopBar/GridLogo.js +24 -24
- package/dist/components/TopBar/TopBar.d.ts +5 -29
- package/dist/components/TopBar/TopBar.js +9 -33
- package/dist/components/TopBar/index.d.ts +1 -1
- package/dist/components/TopBar/index.js +1 -1
- package/dist/components/TreeViewFinder/TreeViewFinder.js +51 -45
- package/dist/components/TreeViewFinder/index.d.ts +1 -1
- package/dist/components/TreeViewFinder/index.js +1 -1
- package/dist/components/dialogs/custom-mui-dialog.d.ts +2 -2
- package/dist/components/dialogs/custom-mui-dialog.js +5 -5
- package/dist/components/dialogs/description-modification-dialog.d.ts +7 -3
- package/dist/components/dialogs/description-modification-dialog.js +11 -5
- package/dist/components/dialogs/modify-element-selection.d.ts +1 -2
- package/dist/components/dialogs/modify-element-selection.js +21 -13
- package/dist/components/dialogs/popup-confirmation-dialog.d.ts +7 -3
- package/dist/components/dialogs/popup-confirmation-dialog.js +3 -6
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +4 -5
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +123 -16
- package/dist/components/filter/criteria-based/criteria-based-filter-form.d.ts +1 -2
- package/dist/components/filter/criteria-based/criteria-based-filter-form.js +6 -5
- package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +27 -20
- package/dist/components/filter/criteria-based/criteria-based-form.d.ts +1 -2
- package/dist/components/filter/criteria-based/criteria-based-form.js +17 -6
- package/dist/components/filter/criteria-based/filter-free-properties.d.ts +5 -3
- package/dist/components/filter/criteria-based/filter-free-properties.js +69 -13
- package/dist/components/filter/criteria-based/filter-properties.d.ts +1 -6
- package/dist/components/filter/criteria-based/filter-properties.js +124 -16
- package/dist/components/filter/criteria-based/filter-property.d.ts +1 -2
- package/dist/components/filter/criteria-based/filter-property.js +16 -16
- package/dist/components/filter/expert/expert-filter-constants.d.ts +8 -1
- package/dist/components/filter/expert/expert-filter-constants.js +7 -0
- package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +3 -4
- package/dist/components/filter/expert/expert-filter-edition-dialog.js +128 -15
- package/dist/components/filter/expert/expert-filter-form.d.ts +2 -2
- package/dist/components/filter/expert/expert-filter-form.js +115 -20
- package/dist/components/filter/expert/expert-filter-utils.d.ts +2 -2
- package/dist/components/filter/expert/expert-filter-utils.js +58 -46
- package/dist/components/filter/expert/expert-filter.type.d.ts +4 -0
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.d.ts +3 -4
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +136 -16
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +4 -5
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +241 -24
- package/dist/components/filter/filter-creation-dialog.d.ts +3 -4
- package/dist/components/filter/filter-creation-dialog.js +125 -13
- package/dist/components/filter/filter-form.d.ts +4 -5
- package/dist/components/filter/filter-form.js +73 -14
- package/dist/components/filter/utils/filter-api.js +1 -1
- package/dist/components/filter/utils/filter-form-utils.js +1 -1
- package/dist/components/inputs/react-hook-form/ExpandingTextField.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/ExpandingTextField.js +5 -5
- package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +102 -13
- package/dist/components/inputs/react-hook-form/ag-grid-table/cell-editors/numericEditor.d.ts +7 -6
- package/dist/components/inputs/react-hook-form/ag-grid-table/cell-editors/numericEditor.js +13 -15
- package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.d.ts +7 -3
- package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +220 -61
- package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +243 -11
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.d.ts +4 -2
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js +12 -12
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js +2 -2
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +2 -2
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +3 -3
- package/dist/components/inputs/react-hook-form/booleans/switch-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/booleans/switch-input.js +3 -3
- package/dist/components/inputs/react-hook-form/directory-items-input.d.ts +11 -3
- package/dist/components/inputs/react-hook-form/directory-items-input.js +11 -11
- package/dist/components/inputs/react-hook-form/error-management/error-input.d.ts +2 -2
- package/dist/components/inputs/react-hook-form/error-management/error-input.js +7 -9
- package/dist/components/inputs/react-hook-form/error-management/field-error-alert.d.ts +2 -2
- package/dist/components/inputs/react-hook-form/error-management/field-error-alert.js +2 -4
- package/dist/components/inputs/react-hook-form/error-management/mid-form-error.d.ts +2 -2
- package/dist/components/inputs/react-hook-form/error-management/mid-form-error.js +2 -2
- package/dist/components/inputs/react-hook-form/numbers/float-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/numbers/float-input.js +6 -5
- package/dist/components/inputs/react-hook-form/numbers/integer-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/numbers/integer-input.js +5 -5
- package/dist/components/inputs/react-hook-form/provider/custom-form-provider.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/provider/custom-form-provider.js +11 -8
- package/dist/components/inputs/react-hook-form/provider/use-custom-form-context.d.ts +2 -1
- package/dist/components/inputs/react-hook-form/provider/use-custom-form-context.js +1 -1
- package/dist/components/inputs/react-hook-form/radio-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/radio-input.js +2 -8
- package/dist/components/inputs/react-hook-form/range-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/range-input.js +5 -5
- package/dist/components/inputs/react-hook-form/raw-read-only-input.d.ts +2 -1
- package/dist/components/inputs/react-hook-form/raw-read-only-input.js +1 -1
- package/dist/components/inputs/react-hook-form/select-inputs/countries-input.d.ts +1 -3
- package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +4 -8
- package/dist/components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.d.ts +3 -1
- package/dist/components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js +4 -4
- package/dist/components/inputs/react-hook-form/select-inputs/mui-select-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/select-inputs/mui-select-input.js +11 -10
- package/dist/components/inputs/react-hook-form/select-inputs/select-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/select-inputs/select-input.js +16 -8
- package/dist/components/inputs/react-hook-form/slider-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/slider-input.js +6 -6
- package/dist/components/inputs/react-hook-form/text-input.d.ts +6 -2
- package/dist/components/inputs/react-hook-form/text-input.js +9 -9
- package/dist/components/inputs/react-hook-form/unique-name-input.d.ts +4 -6
- package/dist/components/inputs/react-hook-form/unique-name-input.js +12 -12
- package/dist/components/inputs/react-hook-form/utils/cancel-button.d.ts +9 -10
- package/dist/components/inputs/react-hook-form/utils/cancel-button.js +2 -6
- package/dist/components/inputs/react-hook-form/utils/field-label.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/utils/field-label.js +3 -3
- package/dist/components/inputs/react-hook-form/utils/functions.js +1 -1
- package/dist/components/inputs/react-hook-form/utils/submit-button.d.ts +9 -10
- package/dist/components/inputs/react-hook-form/utils/submit-button.js +2 -6
- package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.js +7 -7
- package/dist/components/inputs/react-query-builder/add-button.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/add-button.js +13 -10
- package/dist/components/inputs/react-query-builder/combinator-selector.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/combinator-selector.js +7 -6
- package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.js +2 -2
- package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.js +5 -5
- package/dist/components/inputs/react-query-builder/country-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/country-value-editor.js +18 -18
- package/dist/components/inputs/react-query-builder/custom-react-query-builder.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +92 -19
- package/dist/components/inputs/react-query-builder/element-value-editor.d.ts +7 -3
- package/dist/components/inputs/react-query-builder/element-value-editor.js +50 -62
- package/dist/components/inputs/react-query-builder/property-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/property-value-editor.js +5 -5
- package/dist/components/inputs/react-query-builder/remove-button.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/remove-button.js +26 -7
- package/dist/components/inputs/react-query-builder/text-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/text-value-editor.js +17 -17
- package/dist/components/inputs/react-query-builder/translated-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/translated-value-editor.js +22 -26
- package/dist/components/inputs/react-query-builder/value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/value-editor.js +119 -18
- package/dist/components/inputs/react-query-builder/value-selector.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/value-selector.js +2 -2
- package/dist/components/inputs/select-clearable.d.ts +1 -2
- package/dist/components/inputs/select-clearable.js +6 -5
- package/dist/components/translations/card-error-boundary-en.d.ts +2 -2
- package/dist/components/translations/card-error-boundary-en.js +2 -2
- package/dist/components/translations/card-error-boundary-fr.d.ts +2 -2
- package/dist/components/translations/card-error-boundary-fr.js +2 -2
- package/dist/components/translations/common-button-en.d.ts +2 -2
- package/dist/components/translations/common-button-en.js +2 -2
- package/dist/components/translations/common-button-fr.d.ts +2 -2
- package/dist/components/translations/common-button-fr.js +2 -2
- package/dist/components/translations/directory-items-input-en.d.ts +2 -2
- package/dist/components/translations/directory-items-input-en.js +2 -2
- package/dist/components/translations/directory-items-input-fr.d.ts +2 -2
- package/dist/components/translations/directory-items-input-fr.js +2 -2
- package/dist/components/translations/element-search-en.d.ts +2 -2
- package/dist/components/translations/element-search-en.js +2 -2
- package/dist/components/translations/element-search-fr.d.ts +2 -2
- package/dist/components/translations/element-search-fr.js +2 -2
- package/dist/components/translations/equipment-search-en.d.ts +2 -2
- package/dist/components/translations/equipment-search-en.js +2 -2
- package/dist/components/translations/equipment-search-fr.d.ts +2 -2
- package/dist/components/translations/equipment-search-fr.js +2 -2
- package/dist/components/translations/filter-en.d.ts +3 -2
- package/dist/components/translations/filter-en.js +3 -2
- package/dist/components/translations/filter-expert-en.d.ts +2 -2
- package/dist/components/translations/filter-expert-en.js +2 -2
- package/dist/components/translations/filter-expert-fr.d.ts +2 -2
- package/dist/components/translations/filter-expert-fr.js +2 -2
- package/dist/components/translations/filter-fr.d.ts +3 -2
- package/dist/components/translations/filter-fr.js +3 -2
- package/dist/components/translations/flat-parameters-en.d.ts +2 -2
- package/dist/components/translations/flat-parameters-en.js +2 -2
- package/dist/components/translations/flat-parameters-fr.d.ts +2 -2
- package/dist/components/translations/flat-parameters-fr.js +2 -2
- package/dist/components/translations/inputs-en.d.ts +2 -2
- package/dist/components/translations/inputs-en.js +2 -2
- package/dist/components/translations/inputs-fr.d.ts +2 -2
- package/dist/components/translations/inputs-fr.js +2 -2
- package/dist/components/translations/login-en.d.ts +2 -2
- package/dist/components/translations/login-en.js +2 -2
- package/dist/components/translations/login-fr.d.ts +2 -2
- package/dist/components/translations/login-fr.js +2 -2
- package/dist/components/translations/multiple-selection-dialog-en.d.ts +2 -2
- package/dist/components/translations/multiple-selection-dialog-en.js +2 -2
- package/dist/components/translations/multiple-selection-dialog-fr.d.ts +2 -2
- package/dist/components/translations/multiple-selection-dialog-fr.js +2 -2
- package/dist/components/translations/report-viewer-en.d.ts +2 -2
- package/dist/components/translations/report-viewer-en.js +2 -2
- package/dist/components/translations/report-viewer-fr.d.ts +2 -2
- package/dist/components/translations/report-viewer-fr.js +2 -2
- package/dist/components/translations/table-en.d.ts +2 -2
- package/dist/components/translations/table-en.js +2 -2
- package/dist/components/translations/table-fr.d.ts +2 -2
- package/dist/components/translations/table-fr.js +2 -2
- package/dist/components/translations/top-bar-en.d.ts +2 -2
- package/dist/components/translations/top-bar-en.js +2 -2
- package/dist/components/translations/top-bar-fr.d.ts +2 -2
- package/dist/components/translations/top-bar-fr.js +2 -2
- package/dist/components/translations/treeview-finder-en.d.ts +2 -2
- package/dist/components/translations/treeview-finder-en.js +2 -2
- package/dist/components/translations/treeview-finder-fr.d.ts +2 -2
- package/dist/components/translations/treeview-finder-fr.js +2 -2
- package/dist/hooks/localized-countries-hook.js +1 -1
- package/dist/hooks/predefined-properties-hook.d.ts +2 -1
- package/dist/hooks/predefined-properties-hook.js +2 -2
- package/dist/hooks/useDebounce.d.ts +2 -1
- package/dist/hooks/useDebounce.js +1 -1
- package/dist/hooks/useIntlRef.d.ts +2 -1
- package/dist/hooks/useIntlRef.js +1 -1
- package/dist/hooks/usePrevious.d.ts +2 -0
- package/dist/hooks/usePrevious.js +12 -0
- package/dist/hooks/useSnackMessage.d.ts +2 -2
- package/dist/hooks/useSnackMessage.js +36 -36
- package/dist/index.d.ts +27 -16
- package/dist/index.js +183 -159
- package/dist/redux/authActions.d.ts +56 -0
- package/dist/redux/commonStore.d.ts +4 -3
- package/dist/redux/commonStore.js +2 -1
- package/dist/services/apps-metadata.js +1 -1
- package/dist/services/directory.js +6 -6
- package/dist/services/explore.js +14 -12
- package/dist/services/index.d.ts +0 -5
- package/dist/services/study.js +2 -2
- package/dist/services/utils.d.ts +1 -1
- package/dist/services/utils.js +26 -26
- package/dist/utils/AuthService.d.ts +9 -8
- package/dist/utils/AuthService.js +77 -76
- package/dist/utils/ElementIcon.d.ts +3 -2
- package/dist/utils/ElementIcon.js +4 -3
- package/dist/utils/ElementType.d.ts +3 -6
- package/dist/utils/EquipmentType.js +3 -3
- package/dist/utils/FetchStatus.d.ts +2 -1
- package/dist/utils/FetchStatus.js +1 -1
- package/dist/utils/Metadata.d.ts +15 -0
- package/dist/utils/Metadata.js +1 -0
- package/dist/utils/UserManagerMock.d.ts +50 -25
- package/dist/utils/UserManagerMock.js +118 -11
- package/dist/utils/algos.d.ts +2 -1
- package/dist/utils/algos.js +2 -2
- package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +2 -1
- package/dist/utils/equipment-types-for-predefined-properties-mapper.js +3 -1
- package/dist/utils/field-constants.d.ts +2 -1
- package/dist/utils/field-constants.js +1 -1
- package/dist/utils/functions.js +5 -2
- package/dist/utils/types.d.ts +1 -1
- package/dist/utils/yup-config.js +1 -2
- package/package.json +10 -4
- package/dist/chunks/criteria-based-filter-edition-dialog.CAT38SvB.js +0 -1694
- package/dist/chunks/filter-properties.B7-q_yPf.js +0 -195
- package/dist/redux/actions.d.ts +0 -54
- /package/dist/assets/{criteria-based-filter-edition-dialog.css → expert-filter-form.css} +0 -0
- /package/dist/redux/{actions.js → authActions.js} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
1
|
import { default as yup } from '../../../utils/yup-config';
|
|
3
2
|
|
|
4
3
|
export declare const criteriaBasedFilterSchema: {
|
|
@@ -11,5 +10,5 @@ export declare const criteriaBasedFilterSchema: {
|
|
|
11
10
|
export declare const criteriaBasedFilterEmptyFormData: {
|
|
12
11
|
criteriaBased: any;
|
|
13
12
|
};
|
|
14
|
-
declare
|
|
13
|
+
declare function CriteriaBasedFilterForm(): import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
export default CriteriaBasedFilterForm;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import Grid from "@mui/material/Grid";
|
|
3
|
+
import FilterProperties, { filterPropertiesYupSchema } from "./filter-properties.js";
|
|
4
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
4
5
|
import "../../../utils/yup-config.js";
|
|
5
6
|
import CriteriaBasedForm from "./criteria-based-form.js";
|
|
6
|
-
import Grid from "@mui/material/Grid";
|
|
7
7
|
import { getCriteriaBasedSchema, getCriteriaBasedFormData } from "./criteria-based-filter-utils.js";
|
|
8
8
|
import { FILTER_EQUIPMENTS } from "../utils/filter-form-utils.js";
|
|
9
|
+
import { FreePropertiesTypes } from "./filter-free-properties.js";
|
|
9
10
|
import * as yup from "yup";
|
|
10
11
|
const criteriaBasedFilterSchema = getCriteriaBasedSchema({
|
|
11
12
|
[FieldConstants.ENERGY_SOURCE]: yup.string().nullable(),
|
|
@@ -16,7 +17,7 @@ const criteriaBasedFilterEmptyFormData = getCriteriaBasedFormData(null, {
|
|
|
16
17
|
[FreePropertiesTypes.SUBSTATION_FILTER_PROPERTIES]: [],
|
|
17
18
|
[FreePropertiesTypes.FREE_FILTER_PROPERTIES]: []
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
+
function CriteriaBasedFilterForm() {
|
|
20
21
|
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 1, children: [
|
|
21
22
|
/* @__PURE__ */ jsx(
|
|
22
23
|
CriteriaBasedForm,
|
|
@@ -27,7 +28,7 @@ const CriteriaBasedFilterForm = () => {
|
|
|
27
28
|
),
|
|
28
29
|
/* @__PURE__ */ jsx(FilterProperties, {})
|
|
29
30
|
] });
|
|
30
|
-
}
|
|
31
|
+
}
|
|
31
32
|
export {
|
|
32
33
|
criteriaBasedFilterEmptyFormData,
|
|
33
34
|
criteriaBasedFilterSchema,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { F as FreePropertiesTypes } from "../../../chunks/filter-properties.B7-q_yPf.js";
|
|
1
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
3
2
|
import { PROPERTY_VALUES, PROPERTY_VALUES_1, PROPERTY_VALUES_2, PROPERTY_NAME } from "./filter-property.js";
|
|
4
3
|
import { FilterType } from "../constants/filter-constants.js";
|
|
5
4
|
import "../../../utils/yup-config.js";
|
|
6
5
|
import { getRangeInputSchema, getRangeInputDataForm, DEFAULT_RANGE_VALUE } from "../../inputs/react-hook-form/range-input.js";
|
|
6
|
+
import { FreePropertiesTypes } from "./filter-free-properties.js";
|
|
7
7
|
import * as yup from "yup";
|
|
8
8
|
const getCriteriaBasedSchema = (extraFields) => ({
|
|
9
9
|
[FieldConstants.CRITERIA_BASED]: yup.object().shape({
|
|
@@ -96,6 +96,31 @@ const backToFrontTweak = (response) => {
|
|
|
96
96
|
};
|
|
97
97
|
return ret;
|
|
98
98
|
};
|
|
99
|
+
function isNominalVoltageEmpty(nominalVoltage) {
|
|
100
|
+
return nominalVoltage[FieldConstants.VALUE_1] === null && nominalVoltage[FieldConstants.VALUE_2] === null;
|
|
101
|
+
}
|
|
102
|
+
function cleanNominalVoltages(formValues) {
|
|
103
|
+
const cleanedFormValues = { ...formValues };
|
|
104
|
+
if (isNominalVoltageEmpty(cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE])) {
|
|
105
|
+
cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE] = null;
|
|
106
|
+
}
|
|
107
|
+
if (isNominalVoltageEmpty(
|
|
108
|
+
cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE_1]
|
|
109
|
+
)) {
|
|
110
|
+
cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE_1] = null;
|
|
111
|
+
}
|
|
112
|
+
if (isNominalVoltageEmpty(
|
|
113
|
+
cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE_2]
|
|
114
|
+
)) {
|
|
115
|
+
cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE_2] = null;
|
|
116
|
+
}
|
|
117
|
+
if (isNominalVoltageEmpty(
|
|
118
|
+
cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE_3]
|
|
119
|
+
)) {
|
|
120
|
+
cleanedFormValues[FieldConstants.NOMINAL_VOLTAGE_3] = null;
|
|
121
|
+
}
|
|
122
|
+
return cleanedFormValues;
|
|
123
|
+
}
|
|
99
124
|
const frontToBackTweak = (id, filter) => {
|
|
100
125
|
const filterSubstationProperties = filter[FieldConstants.CRITERIA_BASED][FreePropertiesTypes.SUBSTATION_FILTER_PROPERTIES];
|
|
101
126
|
const ret = {
|
|
@@ -141,24 +166,6 @@ const frontToBackTweak = (id, filter) => {
|
|
|
141
166
|
eff.freeProperties = freeProps;
|
|
142
167
|
return ret;
|
|
143
168
|
};
|
|
144
|
-
function cleanNominalVoltages(formValues) {
|
|
145
|
-
if (isNominalVoltageEmpty(formValues[FieldConstants.NOMINAL_VOLTAGE])) {
|
|
146
|
-
formValues[FieldConstants.NOMINAL_VOLTAGE] = null;
|
|
147
|
-
}
|
|
148
|
-
if (isNominalVoltageEmpty(formValues[FieldConstants.NOMINAL_VOLTAGE_1])) {
|
|
149
|
-
formValues[FieldConstants.NOMINAL_VOLTAGE_1] = null;
|
|
150
|
-
}
|
|
151
|
-
if (isNominalVoltageEmpty(formValues[FieldConstants.NOMINAL_VOLTAGE_2])) {
|
|
152
|
-
formValues[FieldConstants.NOMINAL_VOLTAGE_2] = null;
|
|
153
|
-
}
|
|
154
|
-
if (isNominalVoltageEmpty(formValues[FieldConstants.NOMINAL_VOLTAGE_3])) {
|
|
155
|
-
formValues[FieldConstants.NOMINAL_VOLTAGE_3] = null;
|
|
156
|
-
}
|
|
157
|
-
return formValues;
|
|
158
|
-
}
|
|
159
|
-
function isNominalVoltageEmpty(nominalVoltage) {
|
|
160
|
-
return nominalVoltage[FieldConstants.VALUE_1] === null && nominalVoltage[FieldConstants.VALUE_2] === null;
|
|
161
|
-
}
|
|
162
169
|
export {
|
|
163
170
|
backToFrontTweak,
|
|
164
171
|
frontToBackTweak,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { FormEquipment } from '../utils/filter-form-utils';
|
|
2
|
-
import { FunctionComponent } from 'react';
|
|
3
2
|
|
|
4
3
|
export interface CriteriaBasedFormProps {
|
|
5
4
|
equipments: Record<string, FormEquipment>;
|
|
6
5
|
defaultValues: Record<string, any>;
|
|
7
6
|
}
|
|
8
|
-
declare
|
|
7
|
+
declare function CriteriaBasedForm({ equipments, defaultValues, }: CriteriaBasedFormProps): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default CriteriaBasedForm;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FieldConstants } from "../../../utils/field-constants.js";
|
|
3
2
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
4
3
|
import { Grid } from "@mui/material";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
5
6
|
import SelectInput from "../../inputs/react-hook-form/select-inputs/select-input.js";
|
|
6
7
|
import InputWithPopupConfirmation from "../../inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
|
|
7
|
-
|
|
8
|
+
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
9
|
+
function CriteriaBasedForm({
|
|
8
10
|
equipments,
|
|
9
11
|
defaultValues
|
|
10
|
-
})
|
|
12
|
+
}) {
|
|
11
13
|
const { getValues, setValue } = useFormContext();
|
|
14
|
+
const { snackError } = useSnackMessage();
|
|
12
15
|
const watchEquipmentType = useWatch({
|
|
13
16
|
name: FieldConstants.EQUIPMENT_TYPE
|
|
14
17
|
});
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (watchEquipmentType && !equipments[watchEquipmentType]) {
|
|
20
|
+
snackError({
|
|
21
|
+
headerId: "obsoleteFilter"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}, [snackError, equipments, watchEquipmentType]);
|
|
15
25
|
const openConfirmationPopup = () => {
|
|
16
26
|
return JSON.stringify(getValues(FieldConstants.CRITERIA_BASED)) !== JSON.stringify(defaultValues);
|
|
17
27
|
};
|
|
@@ -37,14 +47,15 @@ const CriteriaBasedForm = ({
|
|
|
37
47
|
validateButtonLabel: "button.changeType"
|
|
38
48
|
}
|
|
39
49
|
) }),
|
|
40
|
-
watchEquipmentType && equipments[watchEquipmentType].fields.map(
|
|
50
|
+
watchEquipmentType && equipments[watchEquipmentType] && equipments[watchEquipmentType].fields.map(
|
|
41
51
|
(equipment, index) => {
|
|
42
52
|
const EquipmentForm = equipment.renderer;
|
|
43
|
-
|
|
53
|
+
const uniqueKey = `${watchEquipmentType}-${index}`;
|
|
54
|
+
return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, flexGrow: 1, children: /* @__PURE__ */ jsx(EquipmentForm, { ...equipment.props }) }, uniqueKey);
|
|
44
55
|
}
|
|
45
56
|
)
|
|
46
57
|
] });
|
|
47
|
-
}
|
|
58
|
+
}
|
|
48
59
|
export {
|
|
49
60
|
CriteriaBasedForm as default
|
|
50
61
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { PredefinedProperties } from '../../../utils/types';
|
|
2
|
-
import { FunctionComponent } from 'react';
|
|
3
|
-
import { FreePropertiesTypes } from './filter-properties';
|
|
4
2
|
|
|
3
|
+
export declare enum FreePropertiesTypes {
|
|
4
|
+
SUBSTATION_FILTER_PROPERTIES = "substationFreeProperties",
|
|
5
|
+
FREE_FILTER_PROPERTIES = "freeProperties"
|
|
6
|
+
}
|
|
5
7
|
interface FilterFreePropertiesProps {
|
|
6
8
|
freePropertiesType: FreePropertiesTypes;
|
|
7
9
|
predefined: PredefinedProperties;
|
|
8
10
|
}
|
|
9
|
-
declare
|
|
11
|
+
declare function FilterFreeProperties({ freePropertiesType, predefined, }: FilterFreePropertiesProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export default FilterFreeProperties;
|
|
@@ -1,15 +1,71 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "react
|
|
7
|
-
import "react-
|
|
8
|
-
import
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid, ListItem, Button } from "@mui/material";
|
|
3
|
+
import { useWatch, useFieldArray } from "react-hook-form";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
5
|
+
import AddIcon from "@mui/icons-material/Add";
|
|
6
|
+
import { useMemo } from "react";
|
|
7
|
+
import ErrorInput from "../../inputs/react-hook-form/error-management/error-input.js";
|
|
8
|
+
import FieldErrorAlert from "../../inputs/react-hook-form/error-management/field-error-alert.js";
|
|
9
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
10
|
+
import FilterProperty, { PROPERTY_NAME, PROPERTY_VALUES_1, PROPERTY_VALUES_2, PROPERTY_VALUES } from "./filter-property.js";
|
|
11
|
+
import { Line, Hvdc } from "../../../utils/equipment-types.js";
|
|
12
|
+
var FreePropertiesTypes = /* @__PURE__ */ ((FreePropertiesTypes2) => {
|
|
13
|
+
FreePropertiesTypes2["SUBSTATION_FILTER_PROPERTIES"] = "substationFreeProperties";
|
|
14
|
+
FreePropertiesTypes2["FREE_FILTER_PROPERTIES"] = "freeProperties";
|
|
15
|
+
return FreePropertiesTypes2;
|
|
16
|
+
})(FreePropertiesTypes || {});
|
|
17
|
+
function FilterFreeProperties({
|
|
18
|
+
freePropertiesType,
|
|
19
|
+
predefined
|
|
20
|
+
}) {
|
|
21
|
+
const watchEquipmentType = useWatch({
|
|
22
|
+
name: FieldConstants.EQUIPMENT_TYPE
|
|
23
|
+
});
|
|
24
|
+
const isForLineOrHvdcLineSubstation = (watchEquipmentType === Line.type || watchEquipmentType === Hvdc.type) && freePropertiesType === "substationFreeProperties";
|
|
25
|
+
const fieldName = `${FieldConstants.CRITERIA_BASED}.${freePropertiesType}`;
|
|
26
|
+
const {
|
|
27
|
+
fields: filterProperties,
|
|
28
|
+
// don't use it to access form data ! check doc,
|
|
29
|
+
append,
|
|
30
|
+
remove
|
|
31
|
+
} = useFieldArray({
|
|
32
|
+
name: fieldName
|
|
33
|
+
});
|
|
34
|
+
function addNewProp() {
|
|
35
|
+
if (isForLineOrHvdcLineSubstation) {
|
|
36
|
+
append({
|
|
37
|
+
[PROPERTY_NAME]: null,
|
|
38
|
+
[PROPERTY_VALUES_1]: [],
|
|
39
|
+
[PROPERTY_VALUES_2]: []
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
append({ [PROPERTY_NAME]: null, [PROPERTY_VALUES]: [] });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const valuesFields = isForLineOrHvdcLineSubstation ? [
|
|
46
|
+
{ name: PROPERTY_VALUES_1, label: "PropertyValues1" },
|
|
47
|
+
{ name: PROPERTY_VALUES_2, label: "PropertyValues2" }
|
|
48
|
+
] : [{ name: PROPERTY_VALUES, label: "PropertyValues" }];
|
|
49
|
+
const title = useMemo(() => {
|
|
50
|
+
return freePropertiesType === "freeProperties" ? "FreeProps" : "SubstationFreeProps";
|
|
51
|
+
}, [freePropertiesType]);
|
|
52
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(FormattedMessage, { id: title, children: (formattedTitle) => /* @__PURE__ */ jsx("h4", { children: formattedTitle }) }) }),
|
|
54
|
+
filterProperties.map((prop, index) => /* @__PURE__ */ jsx(ListItem, { children: /* @__PURE__ */ jsx(
|
|
55
|
+
FilterProperty,
|
|
56
|
+
{
|
|
57
|
+
index,
|
|
58
|
+
valuesFields,
|
|
59
|
+
predefined,
|
|
60
|
+
handleDelete: remove,
|
|
61
|
+
propertyType: freePropertiesType
|
|
62
|
+
}
|
|
63
|
+
) }, prop.id)),
|
|
64
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(AddIcon, {}), onClick: () => addNewProp, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "AddFreePropCrit" }) }) }),
|
|
65
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(ErrorInput, { name: fieldName, InputField: FieldErrorAlert }) })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
13
68
|
export {
|
|
14
|
-
|
|
69
|
+
FreePropertiesTypes,
|
|
70
|
+
FilterFreeProperties as default
|
|
15
71
|
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { default as yup } from '../../../utils/yup-config';
|
|
2
|
-
import { FunctionComponent } from 'react';
|
|
3
2
|
|
|
4
|
-
export declare enum FreePropertiesTypes {
|
|
5
|
-
SUBSTATION_FILTER_PROPERTIES = "substationFreeProperties",
|
|
6
|
-
FREE_FILTER_PROPERTIES = "freeProperties"
|
|
7
|
-
}
|
|
8
3
|
export declare const filterPropertiesYupSchema: {
|
|
9
4
|
substationFreeProperties: yup.ArraySchema<{
|
|
10
5
|
prop_values?: (string | undefined)[] | undefined;
|
|
@@ -17,5 +12,5 @@ export declare const filterPropertiesYupSchema: {
|
|
|
17
12
|
name_property: string;
|
|
18
13
|
}[] | undefined, yup.AnyObject, "", "">;
|
|
19
14
|
};
|
|
20
|
-
declare
|
|
15
|
+
declare function FilterProperties(): any;
|
|
21
16
|
export default FilterProperties;
|
|
@@ -1,19 +1,127 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "@mui/material/Grid";
|
|
3
|
-
import "react";
|
|
4
|
-
import "react-hook-form";
|
|
5
|
-
import "react-intl";
|
|
6
|
-
import "../../../utils/equipment-types.js";
|
|
7
|
-
import "../../../utils/functions.js";
|
|
8
|
-
import "../../../utils/field-constants.js";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Grid from "@mui/material/Grid";
|
|
3
|
+
import { useMemo, useEffect } from "react";
|
|
4
|
+
import { useWatch } from "react-hook-form";
|
|
5
|
+
import { FormattedMessage } from "react-intl";
|
|
6
|
+
import { Line, Hvdc, Substation, Load, Generator, TwoWindingTransfo, Battery, ShuntCompensator, VoltageLevel } from "../../../utils/equipment-types.js";
|
|
7
|
+
import { areArrayElementsUnique } from "../../../utils/functions.js";
|
|
8
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
9
9
|
import "../../../utils/yup-config.js";
|
|
10
|
-
import
|
|
11
|
-
import "./filter-property.js";
|
|
12
|
-
import "../../../hooks/predefined-properties-hook.js";
|
|
13
|
-
import "../constants/filter-constants.js";
|
|
14
|
-
import "yup";
|
|
10
|
+
import FilterFreeProperties, { FreePropertiesTypes } from "./filter-free-properties.js";
|
|
11
|
+
import { PROPERTY_NAME, PROPERTY_VALUES, PROPERTY_VALUES_1, PROPERTY_VALUES_2 } from "./filter-property.js";
|
|
12
|
+
import usePredefinedProperties from "../../../hooks/predefined-properties-hook.js";
|
|
13
|
+
import { FilterType } from "../constants/filter-constants.js";
|
|
14
|
+
import * as yup from "yup";
|
|
15
|
+
function propertyValuesTest(values, context, doublePropertyValues) {
|
|
16
|
+
const rootLevelForm = context.from[context.from.length - 1];
|
|
17
|
+
const filterType = rootLevelForm.value[FieldConstants.FILTER_TYPE];
|
|
18
|
+
if (filterType !== FilterType.CRITERIA_BASED.id) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
const equipmentType = rootLevelForm.value[FieldConstants.EQUIPMENT_TYPE];
|
|
22
|
+
const isForLineOrHvdcLine = equipmentType === Line.type || equipmentType === Hvdc.type;
|
|
23
|
+
if (doublePropertyValues) {
|
|
24
|
+
return isForLineOrHvdcLine ? (values == null ? void 0 : values.length) > 0 : true;
|
|
25
|
+
}
|
|
26
|
+
return isForLineOrHvdcLine || (values == null ? void 0 : values.length) > 0;
|
|
27
|
+
}
|
|
28
|
+
const filterPropertiesYupSchema = {
|
|
29
|
+
[FreePropertiesTypes.SUBSTATION_FILTER_PROPERTIES]: yup.array().of(
|
|
30
|
+
yup.object().shape({
|
|
31
|
+
[PROPERTY_NAME]: yup.string().required(),
|
|
32
|
+
[PROPERTY_VALUES]: yup.array().of(yup.string()).test(
|
|
33
|
+
"can not be empty if not line",
|
|
34
|
+
"YupRequired",
|
|
35
|
+
(values, context) => propertyValuesTest(values, context, false)
|
|
36
|
+
),
|
|
37
|
+
[PROPERTY_VALUES_1]: yup.array().of(yup.string()).test(
|
|
38
|
+
"can not be empty if line",
|
|
39
|
+
"YupRequired",
|
|
40
|
+
(values, context) => propertyValuesTest(values, context, true)
|
|
41
|
+
),
|
|
42
|
+
[PROPERTY_VALUES_2]: yup.array().of(yup.string()).test(
|
|
43
|
+
"can not be empty if line",
|
|
44
|
+
"YupRequired",
|
|
45
|
+
(values, context) => propertyValuesTest(values, context, true)
|
|
46
|
+
)
|
|
47
|
+
})
|
|
48
|
+
).test(
|
|
49
|
+
"distinct names",
|
|
50
|
+
"filterPropertiesNameUniquenessError",
|
|
51
|
+
(properties, context) => {
|
|
52
|
+
const rootLevelForm = context.from[context.from.length - 1];
|
|
53
|
+
const filterType = rootLevelForm.value[FieldConstants.FILTER_TYPE];
|
|
54
|
+
if (filterType !== FilterType.CRITERIA_BASED.id) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
const names = properties.filter((prop) => !!prop[PROPERTY_NAME]).map((prop) => prop[PROPERTY_NAME]);
|
|
58
|
+
return areArrayElementsUnique(names);
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
[FreePropertiesTypes.FREE_FILTER_PROPERTIES]: yup.array().of(
|
|
62
|
+
yup.object().shape({
|
|
63
|
+
[PROPERTY_NAME]: yup.string().required(),
|
|
64
|
+
[PROPERTY_VALUES]: yup.array().of(yup.string()).test(
|
|
65
|
+
"can not be empty if not line",
|
|
66
|
+
"YupRequired",
|
|
67
|
+
(values, context) => propertyValuesTest(values, context, false)
|
|
68
|
+
)
|
|
69
|
+
})
|
|
70
|
+
).test(
|
|
71
|
+
"distinct names",
|
|
72
|
+
"filterPropertiesNameUniquenessError",
|
|
73
|
+
(properties, context) => {
|
|
74
|
+
const rootLevelForm = context.from[context.from.length - 1];
|
|
75
|
+
const filterType = rootLevelForm.value[FieldConstants.FILTER_TYPE];
|
|
76
|
+
if (filterType !== FilterType.CRITERIA_BASED.id) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
const names = properties.filter((prop) => !!prop[PROPERTY_NAME]).map((prop) => prop[PROPERTY_NAME]);
|
|
80
|
+
return areArrayElementsUnique(names);
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
};
|
|
84
|
+
function FilterProperties() {
|
|
85
|
+
const watchEquipmentType = useWatch({
|
|
86
|
+
name: FieldConstants.EQUIPMENT_TYPE
|
|
87
|
+
});
|
|
88
|
+
const [equipmentPredefinedProps, setEquipmentType] = usePredefinedProperties(watchEquipmentType);
|
|
89
|
+
const [substationPredefinedProps, setSubstationType] = usePredefinedProperties(null);
|
|
90
|
+
const displayEquipmentProperties = useMemo(() => {
|
|
91
|
+
return watchEquipmentType === Substation.type || watchEquipmentType === Load.type || watchEquipmentType === Generator.type || watchEquipmentType === Line.type || watchEquipmentType === TwoWindingTransfo.type || watchEquipmentType === Battery.type || watchEquipmentType === ShuntCompensator.type || watchEquipmentType === VoltageLevel.type;
|
|
92
|
+
}, [watchEquipmentType]);
|
|
93
|
+
const displaySubstationProperties = useMemo(() => {
|
|
94
|
+
return watchEquipmentType !== Substation.type && watchEquipmentType !== null;
|
|
95
|
+
}, [watchEquipmentType]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (displayEquipmentProperties) {
|
|
98
|
+
setEquipmentType(watchEquipmentType);
|
|
99
|
+
}
|
|
100
|
+
}, [displayEquipmentProperties, watchEquipmentType, setEquipmentType]);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (displaySubstationProperties) {
|
|
103
|
+
setSubstationType(Substation.type);
|
|
104
|
+
}
|
|
105
|
+
}, [displaySubstationProperties, setSubstationType]);
|
|
106
|
+
return watchEquipmentType && /* @__PURE__ */ jsx(Grid, { item: true, container: true, spacing: 1, children: /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
107
|
+
/* @__PURE__ */ jsx(FormattedMessage, { id: "FreePropsCrit", children: (txt) => /* @__PURE__ */ jsx("h3", { children: txt }) }),
|
|
108
|
+
displayEquipmentProperties && /* @__PURE__ */ jsx(
|
|
109
|
+
FilterFreeProperties,
|
|
110
|
+
{
|
|
111
|
+
freePropertiesType: FreePropertiesTypes.FREE_FILTER_PROPERTIES,
|
|
112
|
+
predefined: equipmentPredefinedProps
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
displaySubstationProperties && /* @__PURE__ */ jsx(
|
|
116
|
+
FilterFreeProperties,
|
|
117
|
+
{
|
|
118
|
+
freePropertiesType: FreePropertiesTypes.SUBSTATION_FILTER_PROPERTIES,
|
|
119
|
+
predefined: substationPredefinedProps
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
] }) });
|
|
123
|
+
}
|
|
15
124
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
f as filterPropertiesYupSchema
|
|
125
|
+
FilterProperties as default,
|
|
126
|
+
filterPropertiesYupSchema
|
|
19
127
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PredefinedProperties } from '../../../utils/types';
|
|
2
|
-
import { FunctionComponent } from 'react';
|
|
3
2
|
|
|
4
3
|
export declare const PROPERTY_NAME = "name_property";
|
|
5
4
|
export declare const PROPERTY_VALUES = "prop_values";
|
|
@@ -15,5 +14,5 @@ interface FilterPropertyProps {
|
|
|
15
14
|
predefined: PredefinedProperties;
|
|
16
15
|
propertyType: string;
|
|
17
16
|
}
|
|
18
|
-
declare
|
|
17
|
+
declare function FilterProperty(props: FilterPropertyProps): import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
export default FilterProperty;
|
|
@@ -6,40 +6,40 @@ import Grid from "@mui/material/Grid";
|
|
|
6
6
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
7
7
|
import AutocompleteInput from "../../inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js";
|
|
8
8
|
import MultipleAutocompleteInput from "../../inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js";
|
|
9
|
-
import
|
|
9
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
10
10
|
const PROPERTY_NAME = "name_property";
|
|
11
11
|
const PROPERTY_VALUES = "prop_values";
|
|
12
12
|
const PROPERTY_VALUES_1 = "prop_values1";
|
|
13
13
|
const PROPERTY_VALUES_2 = "prop_values2";
|
|
14
|
-
|
|
14
|
+
function FilterProperty(props) {
|
|
15
|
+
const { propertyType, index, predefined, valuesFields, handleDelete } = props;
|
|
15
16
|
const { setValue } = useFormContext();
|
|
16
17
|
const watchName = useWatch({
|
|
17
|
-
name: `${FieldConstants.CRITERIA_BASED}.${
|
|
18
|
+
name: `${FieldConstants.CRITERIA_BASED}.${propertyType}[${index}].${PROPERTY_NAME}`
|
|
18
19
|
});
|
|
19
20
|
const predefinedNames = useMemo(() => {
|
|
20
|
-
return Object.keys(
|
|
21
|
-
}, [
|
|
21
|
+
return Object.keys(predefined ?? []).sort();
|
|
22
|
+
}, [predefined]);
|
|
22
23
|
const predefinedValues = useMemo(() => {
|
|
23
|
-
|
|
24
|
-
const predefinedForName = (_a = props.predefined) == null ? void 0 : _a[watchName];
|
|
24
|
+
const predefinedForName = predefined == null ? void 0 : predefined[watchName];
|
|
25
25
|
if (!predefinedForName) {
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
28
|
return [...new Set(predefinedForName)].sort();
|
|
29
|
-
}, [watchName,
|
|
29
|
+
}, [watchName, predefined]);
|
|
30
30
|
const onNameChange = useCallback(() => {
|
|
31
|
-
|
|
31
|
+
valuesFields.forEach(
|
|
32
32
|
(valuesField) => setValue(
|
|
33
|
-
`${FieldConstants.CRITERIA_BASED}.${
|
|
33
|
+
`${FieldConstants.CRITERIA_BASED}.${propertyType}[${index}].${valuesField.name}`,
|
|
34
34
|
[]
|
|
35
35
|
)
|
|
36
36
|
);
|
|
37
|
-
}, [setValue,
|
|
37
|
+
}, [setValue, index, valuesFields, propertyType]);
|
|
38
38
|
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 1, columns: 21, children: [
|
|
39
39
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(
|
|
40
40
|
AutocompleteInput,
|
|
41
41
|
{
|
|
42
|
-
name: `${FieldConstants.CRITERIA_BASED}.${
|
|
42
|
+
name: `${FieldConstants.CRITERIA_BASED}.${propertyType}[${index}].${PROPERTY_NAME}`,
|
|
43
43
|
label: "PropertyName",
|
|
44
44
|
options: predefinedNames,
|
|
45
45
|
autoSelect: true,
|
|
@@ -47,17 +47,17 @@ const FilterProperty = (props) => {
|
|
|
47
47
|
onChangeCallback: onNameChange
|
|
48
48
|
}
|
|
49
49
|
) }),
|
|
50
|
-
|
|
50
|
+
valuesFields.map((valuesField) => /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(
|
|
51
51
|
MultipleAutocompleteInput,
|
|
52
52
|
{
|
|
53
|
-
name: `${FieldConstants.CRITERIA_BASED}.${
|
|
53
|
+
name: `${FieldConstants.CRITERIA_BASED}.${propertyType}[${index}].${valuesField.name}`,
|
|
54
54
|
label: valuesField.label,
|
|
55
55
|
options: predefinedValues
|
|
56
56
|
}
|
|
57
57
|
) }, valuesField.name)),
|
|
58
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 1, alignSelf: "center", children: /* @__PURE__ */ jsx(IconButton, { onClick: () =>
|
|
58
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 1, alignSelf: "center", children: /* @__PURE__ */ jsx(IconButton, { onClick: () => handleDelete(index), children: /* @__PURE__ */ jsx(DeleteIcon, {}) }) })
|
|
59
59
|
] });
|
|
60
|
-
}
|
|
60
|
+
}
|
|
61
61
|
export {
|
|
62
62
|
PROPERTY_NAME,
|
|
63
63
|
PROPERTY_VALUES,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Field } from 'react-querybuilder';
|
|
2
1
|
import { CombinatorType, DataType, FieldType, OperatorType } from './expert-filter.type';
|
|
2
|
+
import { Field } from 'react-querybuilder';
|
|
3
3
|
|
|
4
4
|
export declare enum RULES {
|
|
5
5
|
EMPTY_RULE = "emptyRule",
|
|
@@ -234,6 +234,7 @@ export declare const FIELDS_OPTIONS: {
|
|
|
234
234
|
name: FieldType;
|
|
235
235
|
label: string;
|
|
236
236
|
dataType: DataType;
|
|
237
|
+
defaultValue: boolean;
|
|
237
238
|
valueEditorType: string;
|
|
238
239
|
};
|
|
239
240
|
PLANNED_ACTIVE_POWER_SET_POINT: {
|
|
@@ -246,6 +247,7 @@ export declare const FIELDS_OPTIONS: {
|
|
|
246
247
|
name: FieldType;
|
|
247
248
|
label: string;
|
|
248
249
|
dataType: DataType;
|
|
250
|
+
defaultValue: boolean;
|
|
249
251
|
valueEditorType: string;
|
|
250
252
|
};
|
|
251
253
|
RATED_S: {
|
|
@@ -370,12 +372,14 @@ export declare const FIELDS_OPTIONS: {
|
|
|
370
372
|
name: FieldType;
|
|
371
373
|
label: string;
|
|
372
374
|
dataType: DataType;
|
|
375
|
+
defaultValue: boolean;
|
|
373
376
|
valueEditorType: string;
|
|
374
377
|
};
|
|
375
378
|
CONNECTED_2: {
|
|
376
379
|
name: FieldType;
|
|
377
380
|
label: string;
|
|
378
381
|
dataType: DataType;
|
|
382
|
+
defaultValue: boolean;
|
|
379
383
|
valueEditorType: string;
|
|
380
384
|
};
|
|
381
385
|
VOLTAGE_LEVEL_ID_1: {
|
|
@@ -489,12 +493,14 @@ export declare const FIELDS_OPTIONS: {
|
|
|
489
493
|
name: FieldType;
|
|
490
494
|
label: string;
|
|
491
495
|
dataType: DataType;
|
|
496
|
+
defaultValue: boolean;
|
|
492
497
|
valueEditorType: string;
|
|
493
498
|
};
|
|
494
499
|
LOAD_TAP_CHANGING_CAPABILITIES: {
|
|
495
500
|
name: FieldType;
|
|
496
501
|
label: string;
|
|
497
502
|
dataType: DataType;
|
|
503
|
+
defaultValue: boolean;
|
|
498
504
|
valueEditorType: string;
|
|
499
505
|
};
|
|
500
506
|
RATIO_REGULATION_MODE: {
|
|
@@ -518,6 +524,7 @@ export declare const FIELDS_OPTIONS: {
|
|
|
518
524
|
name: FieldType;
|
|
519
525
|
label: string;
|
|
520
526
|
dataType: DataType;
|
|
527
|
+
defaultValue: boolean;
|
|
521
528
|
valueEditorType: string;
|
|
522
529
|
};
|
|
523
530
|
PHASE_REGULATION_MODE: {
|
|
@@ -218,6 +218,7 @@ const FIELDS_OPTIONS = {
|
|
|
218
218
|
name: FieldType.VOLTAGE_REGULATOR_ON,
|
|
219
219
|
label: "voltageRegulatorOn",
|
|
220
220
|
dataType: DataType.BOOLEAN,
|
|
221
|
+
defaultValue: false,
|
|
221
222
|
valueEditorType: "switch"
|
|
222
223
|
},
|
|
223
224
|
PLANNED_ACTIVE_POWER_SET_POINT: {
|
|
@@ -230,6 +231,7 @@ const FIELDS_OPTIONS = {
|
|
|
230
231
|
name: FieldType.CONNECTED,
|
|
231
232
|
label: "connected",
|
|
232
233
|
dataType: DataType.BOOLEAN,
|
|
234
|
+
defaultValue: false,
|
|
233
235
|
valueEditorType: "switch"
|
|
234
236
|
},
|
|
235
237
|
RATED_S: {
|
|
@@ -351,12 +353,14 @@ const FIELDS_OPTIONS = {
|
|
|
351
353
|
name: FieldType.CONNECTED_1,
|
|
352
354
|
label: "terminal1Connected",
|
|
353
355
|
dataType: DataType.BOOLEAN,
|
|
356
|
+
defaultValue: false,
|
|
354
357
|
valueEditorType: "switch"
|
|
355
358
|
},
|
|
356
359
|
CONNECTED_2: {
|
|
357
360
|
name: FieldType.CONNECTED_2,
|
|
358
361
|
label: "terminal2Connected",
|
|
359
362
|
dataType: DataType.BOOLEAN,
|
|
363
|
+
defaultValue: false,
|
|
360
364
|
valueEditorType: "switch"
|
|
361
365
|
},
|
|
362
366
|
VOLTAGE_LEVEL_ID_1: {
|
|
@@ -467,12 +471,14 @@ const FIELDS_OPTIONS = {
|
|
|
467
471
|
name: FieldType.HAS_RATIO_TAP_CHANGER,
|
|
468
472
|
label: "hasRatioTapChanger",
|
|
469
473
|
dataType: DataType.BOOLEAN,
|
|
474
|
+
defaultValue: false,
|
|
470
475
|
valueEditorType: "switch"
|
|
471
476
|
},
|
|
472
477
|
LOAD_TAP_CHANGING_CAPABILITIES: {
|
|
473
478
|
name: FieldType.LOAD_TAP_CHANGING_CAPABILITIES,
|
|
474
479
|
label: "loadTapChangingCapabilities",
|
|
475
480
|
dataType: DataType.BOOLEAN,
|
|
481
|
+
defaultValue: false,
|
|
476
482
|
valueEditorType: "switch"
|
|
477
483
|
},
|
|
478
484
|
RATIO_REGULATION_MODE: {
|
|
@@ -493,6 +499,7 @@ const FIELDS_OPTIONS = {
|
|
|
493
499
|
name: FieldType.HAS_PHASE_TAP_CHANGER,
|
|
494
500
|
label: "hasPhaseTapChanger",
|
|
495
501
|
dataType: DataType.BOOLEAN,
|
|
502
|
+
defaultValue: false,
|
|
496
503
|
valueEditorType: "switch"
|
|
497
504
|
},
|
|
498
505
|
PHASE_REGULATION_MODE: {
|