@gridsuite/commons-ui 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/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 +1 -1
- 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 +1 -2
- package/dist/components/filter/expert/expert-filter-form.js +141 -20
- package/dist/components/filter/expert/expert-filter-utils.d.ts +2 -2
- package/dist/components/filter/expert/expert-filter-utils.js +45 -46
- 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/useSnackMessage.d.ts +2 -2
- package/dist/hooks/useSnackMessage.js +36 -36
- package/dist/index.d.ts +19 -16
- package/dist/index.js +164 -158
- 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,63 +1,222 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "@mui/material/Dialog";
|
|
3
|
-
import "@mui/material/DialogTitle";
|
|
4
|
-
import "@mui/material/DialogContent";
|
|
5
|
-
import "@mui/material/DialogActions";
|
|
6
|
-
import "react-papaparse";
|
|
7
|
-
import "@mui/material/Button";
|
|
8
|
-
import "react";
|
|
9
|
-
import "@mui/material/Grid";
|
|
10
|
-
import "react-intl";
|
|
11
|
-
import "react-csv-downloader";
|
|
12
|
-
import "@mui/material/Alert";
|
|
13
|
-
import "@mui/material";
|
|
14
|
-
import "react-hook-form";
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import Dialog from "@mui/material/Dialog";
|
|
3
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
|
4
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
5
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
6
|
+
import { useCSVReader } from "react-papaparse";
|
|
7
|
+
import Button from "@mui/material/Button";
|
|
8
|
+
import React, { useState, useMemo } from "react";
|
|
9
|
+
import Grid from "@mui/material/Grid";
|
|
10
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
11
|
+
import CsvDownloader from "react-csv-downloader";
|
|
12
|
+
import Alert from "@mui/material/Alert";
|
|
13
|
+
import { DialogContentText } from "@mui/material";
|
|
14
|
+
import { useWatch } from "react-hook-form";
|
|
15
|
+
import { RECORD_SEP, UNIT_SEP } from "papaparse";
|
|
16
|
+
import FieldConstants from "../../../../../utils/field-constants.js";
|
|
17
|
+
import CancelButton from "../../utils/cancel-button.js";
|
|
18
|
+
function CsvUploader({
|
|
19
|
+
name,
|
|
20
|
+
onClose,
|
|
21
|
+
open,
|
|
22
|
+
title,
|
|
23
|
+
fileHeaders,
|
|
24
|
+
fileName,
|
|
25
|
+
csvData,
|
|
26
|
+
validateData = () => true,
|
|
27
|
+
getDataFromCsv,
|
|
28
|
+
useFieldArrayOutput
|
|
29
|
+
}) {
|
|
30
|
+
const watchTableValues = useWatch({ name });
|
|
31
|
+
const { append, replace } = useFieldArrayOutput;
|
|
32
|
+
const [createError, setCreateError] = React.useState("");
|
|
33
|
+
const intl = useIntl();
|
|
34
|
+
const { CSVReader } = useCSVReader();
|
|
35
|
+
const [importedData, setImportedData] = useState([]);
|
|
36
|
+
const [isConfirmationPopupOpen, setIsConfirmationPopupOpen] = useState(false);
|
|
37
|
+
const data = useMemo(() => {
|
|
38
|
+
const newData = [...[fileHeaders]];
|
|
39
|
+
if (Array.isArray(csvData)) {
|
|
40
|
+
csvData.forEach((row) => newData.push([row]));
|
|
41
|
+
}
|
|
42
|
+
return newData;
|
|
43
|
+
}, [csvData, fileHeaders]);
|
|
44
|
+
const handleClose = () => {
|
|
45
|
+
onClose();
|
|
46
|
+
setCreateError("");
|
|
47
|
+
};
|
|
48
|
+
const validateCsvFile = (rows) => {
|
|
49
|
+
if (rows.length === 0) {
|
|
50
|
+
setCreateError(intl.formatMessage({ id: "noDataInCsvFile" }));
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
for (let i = 0; i < fileHeaders.length; i++) {
|
|
54
|
+
if (fileHeaders[i] !== "" && rows[0][i] !== fileHeaders[i]) {
|
|
55
|
+
setCreateError(
|
|
56
|
+
intl.formatMessage({ id: "wrongCsvHeadersError" })
|
|
57
|
+
);
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return validateData(rows);
|
|
62
|
+
};
|
|
63
|
+
const getResultsFromImportedData = () => {
|
|
64
|
+
return importedData.filter((row) => {
|
|
65
|
+
if (row[0].startsWith("#")) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return row.some((column) => !!(column == null ? void 0 : column.trim()));
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const handleFileSubmit = (keepTableValues) => {
|
|
72
|
+
if (importedData.length !== 0) {
|
|
73
|
+
const result = getResultsFromImportedData();
|
|
74
|
+
if (validateCsvFile(result)) {
|
|
75
|
+
result.splice(0, 1);
|
|
76
|
+
const dataFromCsv = getDataFromCsv(result);
|
|
77
|
+
if (keepTableValues) {
|
|
78
|
+
append(dataFromCsv);
|
|
79
|
+
} else {
|
|
80
|
+
replace(dataFromCsv);
|
|
81
|
+
}
|
|
82
|
+
handleClose();
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
setCreateError(intl.formatMessage({ id: "noDataInCsvFile" }));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const handleOpenCSVConfirmationDataDialog = () => {
|
|
89
|
+
const isValuesInTable = Array.isArray(watchTableValues) && watchTableValues.some(
|
|
90
|
+
(val) => val && Object.keys(val).filter(
|
|
91
|
+
(key) => key !== FieldConstants.AG_GRID_ROW_UUID
|
|
92
|
+
).some(
|
|
93
|
+
(e) => val[e] !== void 0 && val[e] !== null && String(val[e]).trim().length > 0
|
|
94
|
+
)
|
|
95
|
+
);
|
|
96
|
+
if (isValuesInTable && getResultsFromImportedData().length > 0) {
|
|
97
|
+
setIsConfirmationPopupOpen(true);
|
|
98
|
+
} else {
|
|
99
|
+
setIsConfirmationPopupOpen(false);
|
|
100
|
+
handleFileSubmit(false);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const handleAddPopupConfirmation = () => {
|
|
104
|
+
handleFileSubmit(true);
|
|
105
|
+
setIsConfirmationPopupOpen(false);
|
|
106
|
+
};
|
|
107
|
+
const handleReplacePopupConfirmation = () => {
|
|
108
|
+
handleFileSubmit(false);
|
|
109
|
+
setIsConfirmationPopupOpen(false);
|
|
110
|
+
};
|
|
111
|
+
const handleCancelDialog = () => {
|
|
112
|
+
setIsConfirmationPopupOpen(false);
|
|
113
|
+
};
|
|
114
|
+
const renderConfirmationCsvData = () => {
|
|
115
|
+
return /* @__PURE__ */ jsxs(
|
|
116
|
+
Dialog,
|
|
117
|
+
{
|
|
118
|
+
open: isConfirmationPopupOpen,
|
|
119
|
+
"aria-labelledby": "dialog-confirmation-csv-data",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ jsx(DialogTitle, { id: "dialog-confirmation-csv-data", children: "Confirmation" }),
|
|
122
|
+
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogContentText, { children: intl.formatMessage({ id: "keepCSVDataMessage" }) }) }),
|
|
123
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
124
|
+
/* @__PURE__ */ jsx(CancelButton, { onClick: handleCancelDialog }),
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
Button,
|
|
127
|
+
{
|
|
128
|
+
onClick: () => handleReplacePopupConfirmation(),
|
|
129
|
+
variant: "outlined",
|
|
130
|
+
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "replace" })
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
Button,
|
|
135
|
+
{
|
|
136
|
+
onClick: () => handleAddPopupConfirmation(),
|
|
137
|
+
variant: "outlined",
|
|
138
|
+
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "add" })
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
147
|
+
/* @__PURE__ */ jsxs(Dialog, { open, onClose: handleClose, fullWidth: true, children: [
|
|
148
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
149
|
+
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs("div", { children: [
|
|
150
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
151
|
+
/* @__PURE__ */ jsx(Grid, { container: true, item: true, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(
|
|
152
|
+
CsvDownloader,
|
|
153
|
+
{
|
|
154
|
+
datas: data,
|
|
155
|
+
filename: fileName,
|
|
156
|
+
separator: ",",
|
|
157
|
+
children: /* @__PURE__ */ jsx(Button, { variant: "contained", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "GenerateCSV" }) })
|
|
158
|
+
}
|
|
159
|
+
) }) }),
|
|
160
|
+
/* @__PURE__ */ jsx(Grid, { container: true, item: true, spacing: 3, children: /* @__PURE__ */ jsx(
|
|
161
|
+
CSVReader,
|
|
162
|
+
{
|
|
163
|
+
onUploadAccepted: (results) => {
|
|
164
|
+
setImportedData([...results.data]);
|
|
165
|
+
setCreateError("");
|
|
166
|
+
},
|
|
167
|
+
config: {
|
|
168
|
+
// We use | for multi values in one cell, then we remove it from the default value for this config, to avoid delimiter autodetection
|
|
169
|
+
delimitersToGuess: [
|
|
170
|
+
",",
|
|
171
|
+
" ",
|
|
172
|
+
";",
|
|
173
|
+
RECORD_SEP,
|
|
174
|
+
UNIT_SEP
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
children: ({ getRootProps, acceptedFile }) => /* @__PURE__ */ jsxs(Grid, { item: true, children: [
|
|
178
|
+
/* @__PURE__ */ jsx(
|
|
179
|
+
Button,
|
|
180
|
+
{
|
|
181
|
+
...getRootProps(),
|
|
182
|
+
variant: "contained",
|
|
183
|
+
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "UploadCSV" })
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ jsx(
|
|
187
|
+
"span",
|
|
188
|
+
{
|
|
189
|
+
style: {
|
|
190
|
+
marginLeft: "10px",
|
|
191
|
+
fontWeight: "bold"
|
|
192
|
+
},
|
|
193
|
+
children: acceptedFile ? acceptedFile.name : intl.formatMessage({
|
|
194
|
+
id: "uploadMessage"
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] })
|
|
199
|
+
}
|
|
200
|
+
) })
|
|
201
|
+
] }),
|
|
202
|
+
createError !== "" && /* @__PURE__ */ jsx(Alert, { severity: "error", children: createError })
|
|
203
|
+
] }) }),
|
|
204
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
205
|
+
/* @__PURE__ */ jsx(CancelButton, { onClick: handleClose }),
|
|
206
|
+
/* @__PURE__ */ jsx(
|
|
207
|
+
Button,
|
|
208
|
+
{
|
|
209
|
+
variant: "outlined",
|
|
210
|
+
onClick: () => handleOpenCSVConfirmationDataDialog(),
|
|
211
|
+
disabled: createError !== "",
|
|
212
|
+
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" })
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
] })
|
|
216
|
+
] }),
|
|
217
|
+
renderConfirmationCsvData()
|
|
218
|
+
] });
|
|
219
|
+
}
|
|
61
220
|
export {
|
|
62
|
-
|
|
221
|
+
CsvUploader as default
|
|
63
222
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
1
|
|
|
3
2
|
export declare const ROW_DRAGGING_SELECTION_COLUMN_DEF: {
|
|
4
3
|
rowDrag: boolean;
|
|
@@ -19,5 +18,5 @@ export interface CustomAgGridTableProps {
|
|
|
19
18
|
alwaysShowVerticalScroll: boolean;
|
|
20
19
|
stopEditingWhenCellsLoseFocus: boolean;
|
|
21
20
|
}
|
|
22
|
-
|
|
21
|
+
declare function CustomAgGridTable({ name, columnDefs, makeDefaultRowData, csvProps, cssProps, defaultColDef, pagination, paginationPageSize, suppressRowClickSelection, alwaysShowVerticalScroll, stopEditingWhenCellsLoseFocus, ...props }: CustomAgGridTableProps): import("react/jsx-runtime").JSX.Element;
|
|
23
22
|
export default CustomAgGridTable;
|
|
@@ -1,15 +1,247 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-hook-form";
|
|
4
|
-
import "ag-grid-react";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect } from "react";
|
|
3
|
+
import { useFormContext, useFieldArray } from "react-hook-form";
|
|
4
|
+
import { AgGridReact } from "ag-grid-react";
|
|
5
5
|
import "ag-grid-community/styles/ag-grid.css";
|
|
6
6
|
import "ag-grid-community/styles/ag-theme-alpine.css";
|
|
7
|
-
import "@mui/material";
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import "../../../../utils/field-constants.js";
|
|
7
|
+
import { useTheme, Grid } from "@mui/material";
|
|
8
|
+
import { useIntl } from "react-intl";
|
|
9
|
+
import BottomRightButtons from "./bottom-right-buttons.js";
|
|
10
|
+
import FieldConstants from "../../../../utils/field-constants.js";
|
|
11
|
+
const ROW_DRAGGING_SELECTION_COLUMN_DEF = [
|
|
12
|
+
{
|
|
13
|
+
rowDrag: true,
|
|
14
|
+
headerCheckboxSelection: true,
|
|
15
|
+
checkboxSelection: true,
|
|
16
|
+
maxWidth: 50
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
const style = (customProps) => ({
|
|
20
|
+
grid: (theme) => ({
|
|
21
|
+
width: "auto",
|
|
22
|
+
height: "100%",
|
|
23
|
+
position: "relative",
|
|
24
|
+
// - AG Grid colors override -
|
|
25
|
+
// It shouldn't be exactly like this, but I couldn't make it works otherwise
|
|
26
|
+
// https://www.ag-grid.com/react-data-grid/global-style-customisation/
|
|
27
|
+
"--ag-alpine-active-color": `${theme.palette.primary.main} !important`,
|
|
28
|
+
"--ag-checkbox-indeterminate-color": `${theme.palette.primary.main} !important`,
|
|
29
|
+
"--ag-background-color": `${theme.agGridBackground.color} !important`,
|
|
30
|
+
"--ag-header-background-color": `${theme.agGridBackground.color} !important`,
|
|
31
|
+
"--ag-odd-row-background-color": `${theme.agGridBackground.color} !important`,
|
|
32
|
+
"--ag-modal-overlay-background-color": `${theme.agGridBackground.color} !important`,
|
|
33
|
+
"--ag-selected-row-background-color": "transparent !important",
|
|
34
|
+
"--ag-range-selection-border-color": "transparent !important",
|
|
35
|
+
// overrides the default computed max height for ag grid default selector editor to make it more usable
|
|
36
|
+
// can be removed if a custom selector editor is implemented
|
|
37
|
+
"& .ag-select-list": {
|
|
38
|
+
maxHeight: "300px !important"
|
|
39
|
+
},
|
|
40
|
+
"& .ag-root-wrapper-body": {
|
|
41
|
+
maxHeight: "500px"
|
|
42
|
+
},
|
|
43
|
+
"& .ag-cell": {
|
|
44
|
+
boxShadow: "none"
|
|
45
|
+
},
|
|
46
|
+
"& .ag-cell-edit-wrapper": {
|
|
47
|
+
height: "inherit"
|
|
48
|
+
},
|
|
49
|
+
"& .ag-row-hover": {
|
|
50
|
+
cursor: "text"
|
|
51
|
+
},
|
|
52
|
+
"& .ag-overlay-loading-center": {
|
|
53
|
+
border: "none",
|
|
54
|
+
boxShadow: "none"
|
|
55
|
+
},
|
|
56
|
+
"& .numeric-input": {
|
|
57
|
+
fontSize: "calc(var(--ag-font-size) + 1px)",
|
|
58
|
+
paddingLeft: "calc(var(--ag-cell-horizontal-padding) - 1px)",
|
|
59
|
+
width: "100%",
|
|
60
|
+
height: "100%",
|
|
61
|
+
border: "inherit",
|
|
62
|
+
outline: "inherit",
|
|
63
|
+
backgroundColor: theme.agGridBackground.color
|
|
64
|
+
},
|
|
65
|
+
"& .Mui-focused .MuiOutlinedInput-root": {
|
|
66
|
+
// borders moves row height
|
|
67
|
+
outline: "var(--ag-borders-input) var(--ag-input-focus-border-color)",
|
|
68
|
+
outlineOffset: "-1px",
|
|
69
|
+
backgroundColor: theme.agGridBackground.color
|
|
70
|
+
},
|
|
71
|
+
...customProps
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
function CustomAgGridTable({
|
|
75
|
+
name,
|
|
76
|
+
columnDefs,
|
|
77
|
+
makeDefaultRowData,
|
|
78
|
+
csvProps,
|
|
79
|
+
cssProps,
|
|
80
|
+
defaultColDef,
|
|
81
|
+
pagination,
|
|
82
|
+
paginationPageSize,
|
|
83
|
+
suppressRowClickSelection,
|
|
84
|
+
alwaysShowVerticalScroll,
|
|
85
|
+
stopEditingWhenCellsLoseFocus,
|
|
86
|
+
...props
|
|
87
|
+
}) {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
const theme = useTheme();
|
|
90
|
+
const [gridApi, setGridApi] = useState(null);
|
|
91
|
+
const [selectedRows, setSelectedRows] = useState([]);
|
|
92
|
+
const [newRowAdded, setNewRowAdded] = useState(false);
|
|
93
|
+
const [isSortApplied, setIsSortApplied] = useState(false);
|
|
94
|
+
const { control, getValues, watch } = useFormContext();
|
|
95
|
+
const useFieldArrayOutput = useFieldArray({
|
|
96
|
+
control,
|
|
97
|
+
name
|
|
98
|
+
});
|
|
99
|
+
const { append, remove, update, swap, move } = useFieldArrayOutput;
|
|
100
|
+
const rowData = watch(name);
|
|
101
|
+
const isFirstSelected = Boolean(
|
|
102
|
+
(rowData == null ? void 0 : rowData.length) && ((_a = gridApi == null ? void 0 : gridApi.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])) == null ? void 0 : _a.isSelected())
|
|
103
|
+
);
|
|
104
|
+
const isLastSelected = Boolean(
|
|
105
|
+
(rowData == null ? void 0 : rowData.length) && ((_b = gridApi == null ? void 0 : gridApi.api.getRowNode(
|
|
106
|
+
rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID]
|
|
107
|
+
)) == null ? void 0 : _b.isSelected())
|
|
108
|
+
);
|
|
109
|
+
const noRowSelected = selectedRows.length === 0;
|
|
110
|
+
const getIndex = useCallback(
|
|
111
|
+
(val) => {
|
|
112
|
+
return getValues(name).findIndex(
|
|
113
|
+
(row) => row[FieldConstants.AG_GRID_ROW_UUID] === val[FieldConstants.AG_GRID_ROW_UUID]
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
[getValues, name]
|
|
117
|
+
);
|
|
118
|
+
const handleMoveRowUp = () => {
|
|
119
|
+
selectedRows.map((row) => getIndex(row)).sort().forEach((idx) => {
|
|
120
|
+
swap(idx, idx - 1);
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const handleMoveRowDown = () => {
|
|
124
|
+
selectedRows.map((row) => getIndex(row)).sort().reverse().forEach((idx) => {
|
|
125
|
+
swap(idx, idx + 1);
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const handleDeleteRows = () => {
|
|
129
|
+
if (selectedRows.length === rowData.length) {
|
|
130
|
+
remove();
|
|
131
|
+
} else {
|
|
132
|
+
selectedRows.forEach((val) => {
|
|
133
|
+
const idx = getIndex(val);
|
|
134
|
+
remove(idx);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (gridApi) {
|
|
140
|
+
gridApi.api.refreshCells({
|
|
141
|
+
force: true
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}, [gridApi, rowData]);
|
|
145
|
+
const handleAddRow = () => {
|
|
146
|
+
append(makeDefaultRowData());
|
|
147
|
+
setNewRowAdded(true);
|
|
148
|
+
};
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (gridApi) {
|
|
151
|
+
gridApi.api.sizeColumnsToFit();
|
|
152
|
+
}
|
|
153
|
+
}, [columnDefs, gridApi]);
|
|
154
|
+
const intl = useIntl();
|
|
155
|
+
const getLocaleText = useCallback(
|
|
156
|
+
(params) => {
|
|
157
|
+
const key = `agGrid.${params.key}`;
|
|
158
|
+
return intl.messages[key] || params.defaultValue;
|
|
159
|
+
},
|
|
160
|
+
[intl]
|
|
161
|
+
);
|
|
162
|
+
const onGridReady = (params) => {
|
|
163
|
+
setGridApi(params);
|
|
164
|
+
};
|
|
165
|
+
const onRowDataUpdated = () => {
|
|
166
|
+
setNewRowAdded(false);
|
|
167
|
+
if (gridApi == null ? void 0 : gridApi.api) {
|
|
168
|
+
const lastIndex = rowData.length - 1;
|
|
169
|
+
gridApi.api.paginationGoToLastPage();
|
|
170
|
+
gridApi.api.ensureIndexVisible(lastIndex, "bottom");
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const onCellEditingStopped = useCallback(
|
|
174
|
+
(event) => {
|
|
175
|
+
const rowIndex = getIndex(event.data);
|
|
176
|
+
if (rowIndex === -1) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
update(rowIndex, event.data);
|
|
180
|
+
},
|
|
181
|
+
[getIndex, update]
|
|
182
|
+
);
|
|
183
|
+
const onSortChanged = useCallback((event) => {
|
|
184
|
+
const isAnycolumnhasSort = event.api.getColumnState().some((col) => col.sort);
|
|
185
|
+
setIsSortApplied(isAnycolumnhasSort);
|
|
186
|
+
}, []);
|
|
187
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
Grid,
|
|
190
|
+
{
|
|
191
|
+
item: true,
|
|
192
|
+
xs: 12,
|
|
193
|
+
className: theme.aggrid.theme,
|
|
194
|
+
sx: style(cssProps).grid,
|
|
195
|
+
children: /* @__PURE__ */ jsx(
|
|
196
|
+
AgGridReact,
|
|
197
|
+
{
|
|
198
|
+
rowData,
|
|
199
|
+
onGridReady,
|
|
200
|
+
getLocaleText,
|
|
201
|
+
cacheOverflowSize: 10,
|
|
202
|
+
rowSelection: "multiple",
|
|
203
|
+
domLayout: "autoHeight",
|
|
204
|
+
rowDragEntireRow: true,
|
|
205
|
+
rowDragManaged: true,
|
|
206
|
+
onRowDragEnd: (e) => move(getIndex(e.node.data), e.overIndex),
|
|
207
|
+
suppressBrowserResizeObserver: true,
|
|
208
|
+
columnDefs,
|
|
209
|
+
detailRowAutoHeight: true,
|
|
210
|
+
onSelectionChanged: () => {
|
|
211
|
+
setSelectedRows(gridApi.api.getSelectedRows());
|
|
212
|
+
},
|
|
213
|
+
onRowDataUpdated: newRowAdded ? onRowDataUpdated : void 0,
|
|
214
|
+
onCellEditingStopped,
|
|
215
|
+
onSortChanged,
|
|
216
|
+
getRowId: (row) => row.data[FieldConstants.AG_GRID_ROW_UUID],
|
|
217
|
+
pagination,
|
|
218
|
+
paginationPageSize,
|
|
219
|
+
suppressRowClickSelection,
|
|
220
|
+
alwaysShowVerticalScroll,
|
|
221
|
+
stopEditingWhenCellsLoseFocus,
|
|
222
|
+
...props
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
/* @__PURE__ */ jsx(
|
|
228
|
+
BottomRightButtons,
|
|
229
|
+
{
|
|
230
|
+
name,
|
|
231
|
+
handleAddRow,
|
|
232
|
+
handleDeleteRows,
|
|
233
|
+
handleMoveRowDown,
|
|
234
|
+
handleMoveRowUp,
|
|
235
|
+
disableUp: noRowSelected || isFirstSelected || isSortApplied,
|
|
236
|
+
disableDown: noRowSelected || isLastSelected || isSortApplied,
|
|
237
|
+
disableDelete: noRowSelected,
|
|
238
|
+
csvProps,
|
|
239
|
+
useFieldArrayOutput
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] });
|
|
243
|
+
}
|
|
11
244
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
C2 as default
|
|
245
|
+
ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
246
|
+
CustomAgGridTable as default
|
|
15
247
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Option } from '../../../../utils/types';
|
|
2
|
-
import { FunctionComponent } from 'react';
|
|
3
2
|
import { AutocompleteProps, TextFieldProps } from '@mui/material';
|
|
4
3
|
|
|
5
4
|
export interface AutocompleteInputProps extends Omit<AutocompleteProps<Option, boolean | undefined, boolean | undefined, boolean | undefined>, 'value' | 'onChange' | 'renderInput'> {
|
|
@@ -14,5 +13,8 @@ export interface AutocompleteInputProps extends Omit<AutocompleteProps<Option, b
|
|
|
14
13
|
onChangeCallback?: () => void;
|
|
15
14
|
formProps?: Omit<TextFieldProps, 'value' | 'onChange' | 'inputRef' | 'inputProps' | 'InputProps'>;
|
|
16
15
|
}
|
|
17
|
-
declare
|
|
16
|
+
declare function AutocompleteInput({ name, label, options, outputTransform, // transform materialUi input value before sending it to react hook form, mostly used to deal with select fields that need to return a string
|
|
17
|
+
inputTransform, // transform react hook form value before sending it to materialUi input, mostly used to deal with select fields that need to return a string
|
|
18
|
+
readOnly, previousValue, allowNewValue, onChangeCallback, // method called when input value is changing
|
|
19
|
+
formProps, ...props }: AutocompleteInputProps): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export default AutocompleteInput;
|
|
@@ -3,15 +3,15 @@ import { Autocomplete, TextField } from "@mui/material";
|
|
|
3
3
|
import { useController } from "react-hook-form";
|
|
4
4
|
import { isFieldRequired, genHelperPreviousValue, genHelperError, identity } from "../utils/functions.js";
|
|
5
5
|
import FieldLabel from "../utils/field-label.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import useCustomFormContext from "../provider/use-custom-form-context.js";
|
|
7
|
+
function AutocompleteInput({
|
|
8
8
|
name,
|
|
9
9
|
label,
|
|
10
10
|
options,
|
|
11
11
|
outputTransform = identity,
|
|
12
|
-
//transform materialUi input value before sending it to react hook form, mostly used to deal with select fields that need to return a string
|
|
12
|
+
// transform materialUi input value before sending it to react hook form, mostly used to deal with select fields that need to return a string
|
|
13
13
|
inputTransform = identity,
|
|
14
|
-
//transform react hook form value before sending it to materialUi input, mostly used to deal with select fields that need to return a string
|
|
14
|
+
// transform react hook form value before sending it to materialUi input, mostly used to deal with select fields that need to return a string
|
|
15
15
|
readOnly = false,
|
|
16
16
|
previousValue,
|
|
17
17
|
allowNewValue,
|
|
@@ -19,26 +19,26 @@ const AutocompleteInput = ({
|
|
|
19
19
|
// method called when input value is changing
|
|
20
20
|
formProps,
|
|
21
21
|
...props
|
|
22
|
-
})
|
|
22
|
+
}) {
|
|
23
23
|
const { validationSchema, getValues, removeOptional } = useCustomFormContext();
|
|
24
24
|
const {
|
|
25
25
|
field: { onChange, value, ref },
|
|
26
26
|
fieldState: { error }
|
|
27
27
|
} = useController({ name });
|
|
28
|
-
const handleChange = (
|
|
29
|
-
onChangeCallback
|
|
30
|
-
if (!allowNewValue || typeof
|
|
31
|
-
onChange(outputTransform(
|
|
28
|
+
const handleChange = (newValue) => {
|
|
29
|
+
onChangeCallback == null ? void 0 : onChangeCallback();
|
|
30
|
+
if (!allowNewValue || typeof newValue !== "string") {
|
|
31
|
+
onChange(outputTransform(newValue));
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
const matchingOption = options.find(
|
|
35
|
-
(option) => typeof option !== "string" && option.id ===
|
|
35
|
+
(option) => typeof option !== "string" && option.id === newValue
|
|
36
36
|
);
|
|
37
37
|
if (matchingOption) {
|
|
38
38
|
onChange(outputTransform(matchingOption));
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
onChange(outputTransform(
|
|
41
|
+
onChange(outputTransform(newValue));
|
|
42
42
|
};
|
|
43
43
|
return /* @__PURE__ */ jsx(
|
|
44
44
|
Autocomplete,
|
|
@@ -79,7 +79,7 @@ const AutocompleteInput = ({
|
|
|
79
79
|
...props
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
}
|
|
82
|
+
}
|
|
83
83
|
export {
|
|
84
84
|
AutocompleteInput as default
|
|
85
85
|
};
|
package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function MultipleAutocompleteInput({ name, ...props }: any): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default MultipleAutocompleteInput;
|
package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { useWatch, useFieldArray } from "react-hook-form";
|
|
4
4
|
import AutocompleteInput from "./autocomplete-input.js";
|
|
5
|
-
|
|
5
|
+
function MultipleAutocompleteInput({ name, ...props }) {
|
|
6
6
|
const [unsavedInput, setUnsavedInput] = useState("");
|
|
7
7
|
const watchAutocompleteValues = useWatch({
|
|
8
8
|
name
|
|
@@ -40,7 +40,7 @@ const MultipleAutocompleteInput = ({ name, ...props }) => {
|
|
|
40
40
|
...props
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
|
-
}
|
|
43
|
+
}
|
|
44
44
|
export {
|
|
45
45
|
MultipleAutocompleteInput as default
|
|
46
46
|
};
|
|
@@ -6,5 +6,5 @@ export interface BooleanInputProps {
|
|
|
6
6
|
formProps?: any;
|
|
7
7
|
Input: typeof Switch | typeof Checkbox;
|
|
8
8
|
}
|
|
9
|
-
declare
|
|
9
|
+
declare function BooleanInput({ name, label, formProps, Input }: BooleanInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default BooleanInput;
|