@gridsuite/commons-ui 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -17
- package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +10 -0
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +147 -0
- package/dist/components/AuthenticationRouter/index.d.ts +1 -0
- package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +18 -0
- package/dist/components/CardErrorBoundary/card-error-boundary.js +110 -0
- package/dist/components/CardErrorBoundary/index.d.ts +1 -0
- package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +22 -0
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +254 -0
- package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +16 -0
- package/dist/components/ElementSearchDialog/element-search-dialog.js +139 -0
- package/dist/components/ElementSearchDialog/equipment-item.d.ts +16 -0
- package/dist/components/ElementSearchDialog/equipment-item.js +77 -0
- package/dist/components/ElementSearchDialog/index.d.ts +2 -0
- package/dist/components/ElementSearchDialog/tag-renderer.d.ts +11 -0
- package/dist/components/ElementSearchDialog/tag-renderer.js +34 -0
- package/dist/components/FlatParameters/FlatParameters.d.ts +10 -0
- package/dist/components/FlatParameters/FlatParameters.js +411 -0
- package/dist/components/FlatParameters/index.d.ts +1 -0
- package/dist/components/Login/Login.d.ts +5 -0
- package/dist/components/Login/Login.js +78 -0
- package/dist/components/Login/Logout.d.ts +5 -0
- package/dist/components/Login/Logout.js +69 -0
- package/dist/components/Login/index.d.ts +1 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +4 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +127 -0
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +104 -0
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +548 -0
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +131 -0
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +790 -0
- package/dist/components/MuiVirtualizedTable/index.d.ts +2 -0
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +10 -0
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +87 -0
- package/dist/components/MultipleSelectionDialog/index.d.ts +1 -0
- package/dist/components/OverflowableText/index.d.ts +1 -0
- package/dist/components/OverflowableText/overflowable-text.d.ts +2 -0
- package/dist/components/OverflowableText/overflowable-text.js +87 -0
- package/dist/components/ReportViewer/filter-button.d.ts +1 -0
- package/dist/components/ReportViewer/filter-button.js +64 -0
- package/dist/components/ReportViewer/index.d.ts +1 -0
- package/dist/components/ReportViewer/log-report-item.d.ts +68 -0
- package/dist/components/ReportViewer/log-report-item.js +95 -0
- package/dist/components/ReportViewer/log-report.d.ts +21 -0
- package/dist/components/ReportViewer/log-report.js +49 -0
- package/dist/components/ReportViewer/log-table.d.ts +8 -0
- package/dist/components/ReportViewer/log-table.js +131 -0
- package/dist/components/ReportViewer/multi-select-list.d.ts +1 -0
- package/dist/components/ReportViewer/multi-select-list.js +40 -0
- package/dist/components/ReportViewer/report-item.d.ts +13 -0
- package/dist/components/ReportViewer/report-item.js +112 -0
- package/dist/components/ReportViewer/report-tree-view-context.d.ts +2 -0
- package/dist/components/ReportViewer/report-tree-view-context.js +8 -0
- package/dist/components/ReportViewer/report-viewer.d.ts +4 -0
- package/dist/components/ReportViewer/report-viewer.js +158 -0
- package/dist/components/ReportViewerDialog/index.d.ts +1 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +1 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.js +61 -0
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +5 -0
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +13 -0
- package/dist/components/SignInCallbackHandler/index.d.ts +1 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +5 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +16 -0
- package/dist/components/SilentRenewCallbackHandler/index.d.ts +1 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.js +28 -0
- package/dist/components/SnackbarProvider/index.d.ts +1 -0
- package/dist/components/TopBar/AboutDialog.d.ts +24 -0
- package/dist/components/TopBar/AboutDialog.js +467 -0
- package/dist/components/TopBar/GridLogo.d.ts +34 -0
- package/dist/components/TopBar/GridLogo.js +71 -0
- package/dist/components/TopBar/TopBar.d.ts +53 -0
- package/dist/components/TopBar/TopBar.js +679 -0
- package/dist/components/TopBar/index.d.ts +3 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.d.ts +57 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.js +288 -0
- package/dist/components/TreeViewFinder/index.d.ts +1 -0
- package/dist/components/react-hook-form/autocomplete-input.d.ts +30 -0
- package/dist/components/react-hook-form/autocomplete-input.js +96 -0
- package/dist/components/react-hook-form/booleans/boolean-input.d.ts +16 -0
- package/dist/components/react-hook-form/booleans/boolean-input.js +49 -0
- package/dist/components/react-hook-form/booleans/checkbox-input.d.ts +14 -0
- package/dist/components/react-hook-form/booleans/checkbox-input.js +24 -0
- package/dist/components/react-hook-form/booleans/switch-input.d.ts +14 -0
- package/dist/components/react-hook-form/booleans/switch-input.js +24 -0
- package/dist/components/react-hook-form/directory-items-input.d.ts +28 -0
- package/dist/components/react-hook-form/directory-items-input.js +185 -0
- package/dist/components/react-hook-form/error-management/error-input.d.ts +5 -0
- package/dist/components/react-hook-form/error-management/error-input.js +42 -0
- package/dist/components/react-hook-form/error-management/field-error-alert.d.ts +4 -0
- package/dist/components/react-hook-form/error-management/field-error-alert.js +9 -0
- package/dist/components/react-hook-form/error-management/mid-form-error.d.ts +4 -0
- package/dist/components/react-hook-form/error-management/mid-form-error.js +20 -0
- package/dist/components/react-hook-form/numbers/float-input.d.ts +18 -0
- package/dist/components/react-hook-form/numbers/float-input.js +51 -0
- package/dist/components/react-hook-form/numbers/integer-input.d.ts +18 -0
- package/dist/components/react-hook-form/numbers/integer-input.js +36 -0
- package/dist/components/react-hook-form/numbers/utils.d.ts +2 -0
- package/dist/components/react-hook-form/numbers/utils.js +10 -0
- package/dist/components/react-hook-form/radio-input.d.ts +18 -0
- package/dist/components/react-hook-form/radio-input.js +44 -0
- package/{es/components/MultipleSelectionDialog/index.js → dist/components/react-hook-form/raw-read-only-input.d.ts} +3 -2
- package/dist/components/react-hook-form/raw-read-only-input.js +10 -0
- package/dist/components/react-hook-form/select-input.d.ts +17 -0
- package/dist/components/react-hook-form/select-input.js +31 -0
- package/dist/components/react-hook-form/slider-input.d.ts +21 -0
- package/dist/components/react-hook-form/slider-input.js +43 -0
- package/dist/components/react-hook-form/text-input.d.ts +33 -0
- package/dist/components/react-hook-form/text-input.js +94 -0
- package/dist/components/react-hook-form/utils/cancel-button.d.ts +10 -0
- package/dist/components/react-hook-form/utils/cancel-button.js +16 -0
- package/dist/components/react-hook-form/utils/field-label.d.ts +6 -0
- package/dist/components/react-hook-form/utils/field-label.js +12 -0
- package/dist/components/react-hook-form/utils/functions.d.ts +11 -0
- package/dist/components/react-hook-form/utils/functions.js +41 -0
- package/dist/components/react-hook-form/utils/submit-button.d.ts +10 -0
- package/dist/components/react-hook-form/utils/submit-button.js +23 -0
- package/dist/components/react-hook-form/utils/text-field-with-adornment.d.ts +12 -0
- package/dist/components/react-hook-form/utils/text-field-with-adornment.js +96 -0
- package/{es/components/translations/report-viewer-fr.js → dist/components/translations/card-error-boundary-en.d.ts} +5 -6
- package/dist/components/translations/card-error-boundary-en.js +8 -0
- package/dist/components/translations/card-error-boundary-fr.d.ts +12 -0
- package/dist/components/translations/card-error-boundary-fr.js +8 -0
- package/dist/components/translations/common-button-en.d.ts +5 -0
- package/dist/components/translations/common-button-en.js +7 -0
- package/dist/components/translations/common-button-fr.d.ts +5 -0
- package/dist/components/translations/common-button-fr.js +7 -0
- package/{es/components/translations/element-search-en.js → dist/components/translations/element-search-en.d.ts} +4 -5
- package/dist/components/translations/element-search-en.js +7 -0
- package/dist/components/translations/element-search-fr.d.ts +11 -0
- package/dist/components/translations/element-search-fr.js +7 -0
- package/dist/components/translations/equipment-search-en.d.ts +25 -0
- package/dist/components/translations/equipment-search-en.js +21 -0
- package/dist/components/translations/equipment-search-fr.d.ts +25 -0
- package/dist/components/translations/equipment-search-fr.js +21 -0
- package/{es/components/translations/flat-parameters-en.js → dist/components/translations/flat-parameters-en.d.ts} +5 -6
- package/dist/components/translations/flat-parameters-en.js +8 -0
- package/{es/components/translations/common-button-en.js → dist/components/translations/flat-parameters-fr.d.ts} +5 -5
- package/dist/components/translations/flat-parameters-fr.js +8 -0
- package/dist/components/translations/login-en.d.ts +18 -0
- package/dist/components/translations/login-en.js +14 -0
- package/dist/components/translations/login-fr.d.ts +18 -0
- package/dist/components/translations/login-fr.js +14 -0
- package/{es/components/translations/flat-parameters-fr.js → dist/components/translations/multiple-selection-dialog-en.d.ts} +5 -6
- package/dist/components/translations/multiple-selection-dialog-en.js +8 -0
- package/{es/components/translations/common-button-fr.js → dist/components/translations/multiple-selection-dialog-fr.d.ts} +5 -5
- package/dist/components/translations/multiple-selection-dialog-fr.js +8 -0
- package/{es/components/translations/report-viewer-en.js → dist/components/translations/report-viewer-en.d.ts} +5 -6
- package/dist/components/translations/report-viewer-en.js +8 -0
- package/{es/components/translations/element-search-fr.js → dist/components/translations/report-viewer-fr.d.ts} +5 -5
- package/dist/components/translations/report-viewer-fr.js +8 -0
- package/{es/components/translations/table-en.js → dist/components/translations/table-en.d.ts} +3 -4
- package/dist/components/translations/table-en.js +6 -0
- package/{es/components/translations/table-fr.js → dist/components/translations/table-fr.d.ts} +3 -4
- package/dist/components/translations/table-fr.js +6 -0
- package/dist/components/translations/top-bar-en.d.ts +31 -0
- package/dist/components/translations/top-bar-en.js +27 -0
- package/dist/components/translations/top-bar-fr.d.ts +31 -0
- package/dist/components/translations/top-bar-fr.js +27 -0
- package/dist/components/translations/treeview-finder-en.d.ts +16 -0
- package/dist/components/translations/treeview-finder-en.js +12 -0
- package/dist/components/translations/treeview-finder-fr.d.ts +16 -0
- package/dist/components/translations/treeview-finder-fr.js +12 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useDebounce.js +17 -0
- package/{es/components/ElementSearchDialog/index.js → dist/hooks/useIntlRef.d.ts} +2 -2
- package/dist/hooks/useIntlRef.js +13 -0
- package/dist/hooks/useSnackMessage.d.ts +5 -0
- package/dist/hooks/useSnackMessage.js +81 -0
- package/dist/index.d.ts +234 -0
- package/dist/index.js +158 -0
- package/dist/utils/AuthService.d.ts +9 -0
- package/dist/utils/AuthService.js +336 -0
- package/dist/utils/ElementType.d.ts +13 -0
- package/dist/utils/ElementType.js +42 -0
- package/dist/utils/EquipmentType.d.ts +136 -0
- package/dist/utils/EquipmentType.js +132 -0
- package/dist/utils/UserManagerMock.d.ts +34 -0
- package/dist/utils/UserManagerMock.js +85 -0
- package/dist/utils/actions.d.ts +50 -0
- package/dist/utils/actions.js +71 -0
- package/{es/components/CardErrorBoundary/index.js → dist/utils/algos.d.ts} +1 -1
- package/dist/utils/algos.js +24 -0
- package/dist/utils/styles.d.ts +5 -0
- package/dist/utils/styles.js +13 -0
- package/package.json +36 -21
- package/es/components/AuthenticationRouter/AuthenticationRouter.js +0 -102
- package/es/components/AuthenticationRouter/index.js +0 -7
- package/es/components/CardErrorBoundary/card-error-boundary.js +0 -138
- package/es/components/ElementSearchDialog/element-search-dialog.js +0 -153
- package/es/components/ElementSearchDialog/equipment-item.js +0 -63
- package/es/components/ElementSearchDialog/tag-renderer.js +0 -29
- package/es/components/FlatParameters/FlatParameters.js +0 -448
- package/es/components/FlatParameters/index.js +0 -8
- package/es/components/Login/Login.js +0 -79
- package/es/components/Login/Logout.js +0 -78
- package/es/components/Login/index.js +0 -7
- package/es/components/MuiVirtualizedTable/ColumnHeader.js +0 -125
- package/es/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +0 -619
- package/es/components/MuiVirtualizedTable/MuiVirtualizedTable.js +0 -780
- package/es/components/MuiVirtualizedTable/index.js +0 -9
- package/es/components/MultipleSelectionDialog/MultipleSelectionDialog.js +0 -95
- package/es/components/OverflowableText/index.js +0 -7
- package/es/components/OverflowableText/overflowable-text.js +0 -81
- package/es/components/ReportViewer/filter-button.js +0 -77
- package/es/components/ReportViewer/index.js +0 -7
- package/es/components/ReportViewer/log-report-item.js +0 -97
- package/es/components/ReportViewer/log-report.js +0 -63
- package/es/components/ReportViewer/log-table.js +0 -130
- package/es/components/ReportViewer/multi-select-list.js +0 -56
- package/es/components/ReportViewer/report-item.js +0 -131
- package/es/components/ReportViewer/report-tree-view-context.js +0 -13
- package/es/components/ReportViewer/report-viewer.js +0 -167
- package/es/components/ReportViewerDialog/index.js +0 -7
- package/es/components/ReportViewerDialog/report-viewer-dialog.js +0 -67
- package/es/components/SignInCallbackHandler/SignInCallbackHandler.js +0 -19
- package/es/components/SignInCallbackHandler/index.js +0 -7
- package/es/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +0 -19
- package/es/components/SilentRenewCallbackHandler/index.js +0 -7
- package/es/components/SnackbarProvider/SnackbarProvider.js +0 -39
- package/es/components/SnackbarProvider/index.js +0 -7
- package/es/components/TopBar/AboutDialog.js +0 -456
- package/es/components/TopBar/GridLogo.js +0 -73
- package/es/components/TopBar/TopBar.js +0 -487
- package/es/components/TopBar/index.js +0 -9
- package/es/components/TreeViewFinder/TreeViewFinder.js +0 -341
- package/es/components/TreeViewFinder/index.js +0 -7
- package/es/components/images/powsybl_logo.svg +0 -35
- package/es/components/react-hook-form/autocomplete-input.js +0 -110
- package/es/components/react-hook-form/booleans/boolean-input.js +0 -56
- package/es/components/react-hook-form/booleans/checkbox-input.js +0 -28
- package/es/components/react-hook-form/booleans/switch-input.js +0 -28
- package/es/components/react-hook-form/error-management/error-input.js +0 -50
- package/es/components/react-hook-form/error-management/field-error-alert.js +0 -22
- package/es/components/react-hook-form/error-management/mid-form-error.js +0 -25
- package/es/components/react-hook-form/numbers/float-input.js +0 -105
- package/es/components/react-hook-form/numbers/integer-input.js +0 -35
- package/es/components/react-hook-form/numbers/utils.js +0 -6
- package/es/components/react-hook-form/radio-input.js +0 -55
- package/es/components/react-hook-form/select-input.js +0 -40
- package/es/components/react-hook-form/slider-input.js +0 -48
- package/es/components/react-hook-form/text-input.js +0 -100
- package/es/components/react-hook-form/utils/cancel-button.js +0 -28
- package/es/components/react-hook-form/utils/field-label.js +0 -15
- package/es/components/react-hook-form/utils/functions.js +0 -42
- package/es/components/react-hook-form/utils/submit-button.js +0 -29
- package/es/components/react-hook-form/utils/text-field-with-adornment.js +0 -92
- package/es/components/translations/card-error-boundary-en.js +0 -13
- package/es/components/translations/card-error-boundary-fr.js +0 -13
- package/es/components/translations/equipment-search-en.js +0 -26
- package/es/components/translations/equipment-search-fr.js +0 -26
- package/es/components/translations/inputs-en.js +0 -25
- package/es/components/translations/inputs-fr.js +0 -25
- package/es/components/translations/login-en.js +0 -19
- package/es/components/translations/login-fr.js +0 -19
- package/es/components/translations/multiple-selection-dialog-en.js +0 -13
- package/es/components/translations/multiple-selection-dialog-fr.js +0 -13
- package/es/components/translations/top-bar-en.js +0 -32
- package/es/components/translations/top-bar-fr.js +0 -32
- package/es/components/translations/treeview-finder-en.js +0 -17
- package/es/components/translations/treeview-finder-fr.js +0 -17
- package/es/hooks/useDebounce.js +0 -26
- package/es/hooks/useIntlRef.js +0 -22
- package/es/hooks/useSnackMessage.js +0 -81
- package/es/index.js +0 -71
- package/es/utils/AuthService.js +0 -312
- package/es/utils/ElementType.js +0 -53
- package/es/utils/EquipmentType.js +0 -133
- package/es/utils/UserManagerMock.js +0 -81
- package/es/utils/actions.js +0 -65
- package/es/utils/algos.js +0 -29
- package/es/utils/styles.js +0 -35
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl, Chip, Grid, Tooltip, IconButton } from "@mui/material";
|
|
3
|
+
import { OverflowableText } from "../OverflowableText/overflowable-text.js";
|
|
4
|
+
import { useSnackMessage } from "../../hooks/useSnackMessage.js";
|
|
5
|
+
import FieldLabel from "./utils/field-label.js";
|
|
6
|
+
import FolderIcon from "@mui/icons-material/Folder";
|
|
7
|
+
import { useMemo, useState, useCallback } from "react";
|
|
8
|
+
import { useFieldArray, useFormContext, useController } from "react-hook-form";
|
|
9
|
+
import { useIntl } from "react-intl";
|
|
10
|
+
import ErrorInput from "./error-management/error-input.js";
|
|
11
|
+
import MidFormError from "./error-management/mid-form-error.js";
|
|
12
|
+
import { RawReadOnlyInput } from "./raw-read-only-input.js";
|
|
13
|
+
import { mergeSx } from "../../utils/styles.js";
|
|
14
|
+
import DirectoryItemSelector from "../DirectoryItemSelector/directory-item-selector.js";
|
|
15
|
+
import { isFieldFromContextRequired } from "./utils/functions.js";
|
|
16
|
+
const NAME = "name";
|
|
17
|
+
const styles = {
|
|
18
|
+
formDirectoryElements1: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
gap: "8px",
|
|
21
|
+
flexWrap: "wrap",
|
|
22
|
+
flexDirection: "row",
|
|
23
|
+
border: "2px solid lightgray",
|
|
24
|
+
padding: "4px",
|
|
25
|
+
borderRadius: "4px",
|
|
26
|
+
overflow: "hidden"
|
|
27
|
+
},
|
|
28
|
+
formDirectoryElementsError: (theme) => ({
|
|
29
|
+
borderColor: theme.palette.error.main
|
|
30
|
+
}),
|
|
31
|
+
formDirectoryElements2: {
|
|
32
|
+
display: "flex",
|
|
33
|
+
gap: "8px",
|
|
34
|
+
flexWrap: "wrap",
|
|
35
|
+
flexDirection: "row",
|
|
36
|
+
marginTop: 0,
|
|
37
|
+
padding: "4px",
|
|
38
|
+
overflow: "hidden"
|
|
39
|
+
},
|
|
40
|
+
addDirectoryElements: {
|
|
41
|
+
marginTop: "-5px"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const DirectoryItemsInput = ({
|
|
45
|
+
label,
|
|
46
|
+
name,
|
|
47
|
+
elementType,
|
|
48
|
+
// Used to specify type of element (Filter, Contingency list, ...)
|
|
49
|
+
equipmentTypes,
|
|
50
|
+
// Mostly used for filters, it allows the user to get elements of specific equipment only
|
|
51
|
+
itemFilter,
|
|
52
|
+
// Used to further filter the results displayed according to specific requirement
|
|
53
|
+
titleId,
|
|
54
|
+
// title of directory item selector dialogue
|
|
55
|
+
hideErrorMessage,
|
|
56
|
+
onRowChanged,
|
|
57
|
+
onChange,
|
|
58
|
+
disable = false,
|
|
59
|
+
fetchDirectoryContent,
|
|
60
|
+
fetchRootFolders,
|
|
61
|
+
fetchElementsInfos,
|
|
62
|
+
labelRequiredFromContext = true
|
|
63
|
+
}) => {
|
|
64
|
+
const { snackError } = useSnackMessage();
|
|
65
|
+
const intl = useIntl();
|
|
66
|
+
const types = useMemo(() => [elementType], [elementType]);
|
|
67
|
+
const [directoryItemSelectorOpen, setDirectoryItemSelectorOpen] = useState(false);
|
|
68
|
+
const {
|
|
69
|
+
fields: elements,
|
|
70
|
+
append,
|
|
71
|
+
remove
|
|
72
|
+
} = useFieldArray({
|
|
73
|
+
name
|
|
74
|
+
});
|
|
75
|
+
const formContext = useFormContext();
|
|
76
|
+
const { getValues } = formContext;
|
|
77
|
+
const {
|
|
78
|
+
fieldState: { error }
|
|
79
|
+
} = useController({
|
|
80
|
+
name
|
|
81
|
+
});
|
|
82
|
+
const addElements = useCallback(
|
|
83
|
+
(values) => {
|
|
84
|
+
values.forEach((value) => {
|
|
85
|
+
const { icon, children, ...otherElementAttributes } = value;
|
|
86
|
+
if (getValues(name).find(
|
|
87
|
+
(v) => (v == null ? void 0 : v.id) === otherElementAttributes.id
|
|
88
|
+
) !== void 0) {
|
|
89
|
+
snackError({
|
|
90
|
+
messageTxt: "",
|
|
91
|
+
headerId: "ElementAlreadyUsed"
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
append(otherElementAttributes);
|
|
95
|
+
onRowChanged && onRowChanged(true);
|
|
96
|
+
onChange && onChange(getValues(name));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
setDirectoryItemSelectorOpen(false);
|
|
100
|
+
},
|
|
101
|
+
[append, getValues, snackError, name, onRowChanged, onChange]
|
|
102
|
+
);
|
|
103
|
+
const removeElements = useCallback(
|
|
104
|
+
(index) => {
|
|
105
|
+
remove(index);
|
|
106
|
+
onRowChanged && onRowChanged(true);
|
|
107
|
+
onChange && onChange(getValues(name));
|
|
108
|
+
},
|
|
109
|
+
[onRowChanged, remove, getValues, name, onChange]
|
|
110
|
+
);
|
|
111
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
|
+
/* @__PURE__ */ jsxs(
|
|
113
|
+
FormControl,
|
|
114
|
+
{
|
|
115
|
+
sx: mergeSx(
|
|
116
|
+
styles.formDirectoryElements1,
|
|
117
|
+
(error == null ? void 0 : error.message) && styles.formDirectoryElementsError
|
|
118
|
+
),
|
|
119
|
+
error: !!(error == null ? void 0 : error.message),
|
|
120
|
+
children: [
|
|
121
|
+
(elements == null ? void 0 : elements.length) === 0 && label && /* @__PURE__ */ jsx(
|
|
122
|
+
FieldLabel,
|
|
123
|
+
{
|
|
124
|
+
label,
|
|
125
|
+
optional: labelRequiredFromContext && !isFieldFromContextRequired(
|
|
126
|
+
name,
|
|
127
|
+
formContext,
|
|
128
|
+
getValues()
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
(elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => /* @__PURE__ */ jsx(
|
|
133
|
+
Chip,
|
|
134
|
+
{
|
|
135
|
+
size: "small",
|
|
136
|
+
onDelete: () => removeElements(index),
|
|
137
|
+
label: /* @__PURE__ */ jsx(
|
|
138
|
+
OverflowableText,
|
|
139
|
+
{
|
|
140
|
+
text: /* @__PURE__ */ jsx(
|
|
141
|
+
RawReadOnlyInput,
|
|
142
|
+
{
|
|
143
|
+
name: `${name}.${index}.${NAME}`
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
sx: { width: "100%" }
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
},
|
|
150
|
+
item.id
|
|
151
|
+
)) }),
|
|
152
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(Grid, { container: true, direction: "row-reverse", children: /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: titleId }), children: /* @__PURE__ */ jsx(
|
|
153
|
+
IconButton,
|
|
154
|
+
{
|
|
155
|
+
sx: styles.addDirectoryElements,
|
|
156
|
+
size: "small",
|
|
157
|
+
disabled: disable,
|
|
158
|
+
onClick: () => setDirectoryItemSelectorOpen(true),
|
|
159
|
+
children: /* @__PURE__ */ jsx(FolderIcon, {})
|
|
160
|
+
}
|
|
161
|
+
) }) }) })
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
!hideErrorMessage && /* @__PURE__ */ jsx(ErrorInput, { name, InputField: MidFormError }),
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
DirectoryItemSelector,
|
|
168
|
+
{
|
|
169
|
+
open: directoryItemSelectorOpen,
|
|
170
|
+
onClose: addElements,
|
|
171
|
+
types,
|
|
172
|
+
equipmentTypes,
|
|
173
|
+
title: intl.formatMessage({ id: titleId }),
|
|
174
|
+
itemFilter,
|
|
175
|
+
fetchDirectoryContent,
|
|
176
|
+
fetchRootFolders,
|
|
177
|
+
fetchElementsInfos
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
] });
|
|
181
|
+
};
|
|
182
|
+
export {
|
|
183
|
+
NAME,
|
|
184
|
+
DirectoryItemsInput as default
|
|
185
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { useController } from "react-hook-form";
|
|
5
|
+
const ErrorInput = ({ name, InputField }) => {
|
|
6
|
+
const {
|
|
7
|
+
fieldState: { error },
|
|
8
|
+
formState: { isSubmitting }
|
|
9
|
+
} = useController({
|
|
10
|
+
name
|
|
11
|
+
});
|
|
12
|
+
const errorRef = useRef(null);
|
|
13
|
+
const errorProps = (errorMsg) => {
|
|
14
|
+
if (typeof errorMsg === "string") {
|
|
15
|
+
return {
|
|
16
|
+
id: errorMsg
|
|
17
|
+
};
|
|
18
|
+
} else if (typeof errorMsg === "object") {
|
|
19
|
+
return {
|
|
20
|
+
id: errorMsg.id,
|
|
21
|
+
values: {
|
|
22
|
+
value: errorMsg.value
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {};
|
|
27
|
+
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (error && errorRef.current) {
|
|
30
|
+
errorRef.current.scrollIntoView({ behavior: "smooth" });
|
|
31
|
+
}
|
|
32
|
+
}, [isSubmitting]);
|
|
33
|
+
return /* @__PURE__ */ jsx(Fragment, { children: (error == null ? void 0 : error.message) && /* @__PURE__ */ jsx("div", { ref: errorRef, children: /* @__PURE__ */ jsx(
|
|
34
|
+
InputField,
|
|
35
|
+
{
|
|
36
|
+
message: /* @__PURE__ */ jsx(FormattedMessage, { ...errorProps(error == null ? void 0 : error.message) })
|
|
37
|
+
}
|
|
38
|
+
) }) });
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
ErrorInput as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Grid, Alert } from "@mui/material";
|
|
4
|
+
const FieldErrorAlert = ({ message }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Alert, { severity: "error", children: message }) });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
FieldErrorAlert as default
|
|
9
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Box } from "@mui/material";
|
|
4
|
+
const MidFormError = ({ message }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
Box,
|
|
7
|
+
{
|
|
8
|
+
sx: (theme) => ({
|
|
9
|
+
color: theme.palette.error.main,
|
|
10
|
+
fontSize: "small",
|
|
11
|
+
marginLeft: theme.spacing(2),
|
|
12
|
+
marginRight: theme.spacing(2)
|
|
13
|
+
}),
|
|
14
|
+
children: message
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
MidFormError as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default FloatInput;
|
|
2
|
+
declare function FloatInput(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace FloatInput {
|
|
4
|
+
const propTypes: {
|
|
5
|
+
name: import("prop-types").Requireable<string>;
|
|
6
|
+
label: import("prop-types").Requireable<string>;
|
|
7
|
+
labelValues: import("prop-types").Requireable<object>;
|
|
8
|
+
id: import("prop-types").Requireable<string>;
|
|
9
|
+
adornment: import("prop-types").Requireable<object>;
|
|
10
|
+
customAdornment: import("prop-types").Requireable<object>;
|
|
11
|
+
outputTransform: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
|
+
inputTransform: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
13
|
+
acceptValue: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
+
previousValue: import("prop-types").Requireable<any>;
|
|
15
|
+
clearable: import("prop-types").Requireable<boolean>;
|
|
16
|
+
formProps: import("prop-types").Requireable<object>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import TextInput from "../text-input.js";
|
|
4
|
+
import { isFloatNumber } from "./utils.js";
|
|
5
|
+
const normalizeFixed = (number) => {
|
|
6
|
+
return number.toLocaleString("en-US", {
|
|
7
|
+
maximumFractionDigits: 20,
|
|
8
|
+
useGrouping: false
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
const FloatInput = (props) => {
|
|
12
|
+
const inputTransform = (value) => {
|
|
13
|
+
if (typeof value == "number" && !isNaN(value)) {
|
|
14
|
+
return normalizeFixed(value);
|
|
15
|
+
} else {
|
|
16
|
+
if (["-", "."].includes(value)) {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
return value === null || isNaN(value) ? "" : value;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const outputTransform = (value) => {
|
|
23
|
+
if (value === "-") {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
if (value === "") {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const tmp = (value == null ? void 0 : value.replace(",", ".")) || "";
|
|
30
|
+
if (tmp.endsWith(".") || tmp.includes(".") && tmp.endsWith("0")) {
|
|
31
|
+
return tmp;
|
|
32
|
+
}
|
|
33
|
+
const parsed = parseFloat(tmp);
|
|
34
|
+
return isNaN(parsed) ? null : normalizeFixed(parsed);
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
TextInput,
|
|
38
|
+
{
|
|
39
|
+
acceptValue: isFloatNumber,
|
|
40
|
+
outputTransform,
|
|
41
|
+
inputTransform,
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
FloatInput.propTypes = {
|
|
47
|
+
...TextInput.propTypes
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
FloatInput as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default IntegerInput;
|
|
2
|
+
declare function IntegerInput(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace IntegerInput {
|
|
4
|
+
const propTypes: {
|
|
5
|
+
name: import("prop-types").Requireable<string>;
|
|
6
|
+
label: import("prop-types").Requireable<string>;
|
|
7
|
+
labelValues: import("prop-types").Requireable<object>;
|
|
8
|
+
id: import("prop-types").Requireable<string>;
|
|
9
|
+
adornment: import("prop-types").Requireable<object>;
|
|
10
|
+
customAdornment: import("prop-types").Requireable<object>;
|
|
11
|
+
outputTransform: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
|
+
inputTransform: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
13
|
+
acceptValue: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
+
previousValue: import("prop-types").Requireable<any>;
|
|
15
|
+
clearable: import("prop-types").Requireable<boolean>;
|
|
16
|
+
formProps: import("prop-types").Requireable<object>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import TextInput from "../text-input.js";
|
|
4
|
+
import { isIntegerNumber } from "./utils.js";
|
|
5
|
+
const IntegerInput = (props) => {
|
|
6
|
+
const inputTransform = (value) => {
|
|
7
|
+
if ("-" === value) {
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
return value === null || isNaN(value) ? "" : value.toString();
|
|
11
|
+
};
|
|
12
|
+
const outputTransform = (value) => {
|
|
13
|
+
if (value === "-") {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
if (value === "0") {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
return parseInt(value) || null;
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
TextInput,
|
|
23
|
+
{
|
|
24
|
+
acceptValue: isIntegerNumber,
|
|
25
|
+
outputTransform,
|
|
26
|
+
inputTransform,
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
IntegerInput.propTypes = {
|
|
32
|
+
...TextInput.propTypes
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
IntegerInput as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default RadioInput;
|
|
2
|
+
declare function RadioInput({ name, label, id, options, formProps }: {
|
|
3
|
+
name: any;
|
|
4
|
+
label: any;
|
|
5
|
+
id: any;
|
|
6
|
+
options: any;
|
|
7
|
+
formProps: any;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare namespace RadioInput {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
const name: PropTypes.Validator<string>;
|
|
12
|
+
const label: PropTypes.Requireable<string>;
|
|
13
|
+
const id: PropTypes.Requireable<string>;
|
|
14
|
+
const options: PropTypes.Validator<any[]>;
|
|
15
|
+
const formProps: PropTypes.Requireable<object>;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { FormControl, FormLabel, RadioGroup, FormControlLabel, Radio } from "@mui/material";
|
|
5
|
+
import { FormattedMessage } from "react-intl";
|
|
6
|
+
import { useController } from "react-hook-form";
|
|
7
|
+
import FieldLabel from "./utils/field-label.js";
|
|
8
|
+
const RadioInput = ({ name, label, id, options, formProps }) => {
|
|
9
|
+
const {
|
|
10
|
+
field: { onChange, value }
|
|
11
|
+
} = useController({ name });
|
|
12
|
+
return /* @__PURE__ */ jsxs(FormControl, { children: [
|
|
13
|
+
label && /* @__PURE__ */ jsx(FormLabel, { id: id ?? label, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
RadioGroup,
|
|
16
|
+
{
|
|
17
|
+
row: true,
|
|
18
|
+
"aria-labelledby": id ?? label,
|
|
19
|
+
value,
|
|
20
|
+
onChange,
|
|
21
|
+
...formProps,
|
|
22
|
+
children: options.map((option) => /* @__PURE__ */ jsx(
|
|
23
|
+
FormControlLabel,
|
|
24
|
+
{
|
|
25
|
+
control: /* @__PURE__ */ jsx(Radio, {}),
|
|
26
|
+
value: option.id,
|
|
27
|
+
label: /* @__PURE__ */ jsx(FieldLabel, { label: option.label })
|
|
28
|
+
},
|
|
29
|
+
option.id
|
|
30
|
+
))
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
};
|
|
35
|
+
RadioInput.propTypes = {
|
|
36
|
+
name: PropTypes.string.isRequired,
|
|
37
|
+
label: PropTypes.string,
|
|
38
|
+
id: PropTypes.string,
|
|
39
|
+
options: PropTypes.array.isRequired,
|
|
40
|
+
formProps: PropTypes.object
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
RadioInput as default
|
|
44
|
+
};
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export declare function RawReadOnlyInput({ name }: {
|
|
8
|
+
name: string;
|
|
9
|
+
}): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default SelectInput;
|
|
2
|
+
declare function SelectInput(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace SelectInput {
|
|
4
|
+
const propTypes: {
|
|
5
|
+
name: PropTypes.Validator<string>;
|
|
6
|
+
label: PropTypes.Requireable<string>;
|
|
7
|
+
options: PropTypes.Validator<any[]>;
|
|
8
|
+
outputTransform: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
|
+
inputTransform: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
readOnly: PropTypes.Requireable<boolean>;
|
|
11
|
+
previousValue: PropTypes.Requireable<any>;
|
|
12
|
+
allowNewValue: PropTypes.Requireable<boolean>;
|
|
13
|
+
onChangeCallback: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
formProps: PropTypes.Requireable<object>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import AutocompleteInput from "./autocomplete-input.js";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
const SelectInput = (props) => {
|
|
7
|
+
const intl = useIntl();
|
|
8
|
+
const inputTransform = (value) => props.options.find((option) => (option == null ? void 0 : option.id) === value) || null;
|
|
9
|
+
const outputTransform = (value) => {
|
|
10
|
+
return (value == null ? void 0 : value.id) ?? null;
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
AutocompleteInput,
|
|
14
|
+
{
|
|
15
|
+
getOptionLabel: (option) => {
|
|
16
|
+
return (option == null ? void 0 : option.label) ? intl.formatMessage({ id: option == null ? void 0 : option.label }) : option == null ? void 0 : option.id;
|
|
17
|
+
},
|
|
18
|
+
inputTransform,
|
|
19
|
+
outputTransform,
|
|
20
|
+
readOnly: true,
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
SelectInput.propTypes = {
|
|
26
|
+
options: PropTypes.array.isRequired,
|
|
27
|
+
...AutocompleteInput.propTypes
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
SelectInput as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default SliderInput;
|
|
2
|
+
declare function SliderInput({ name, min, max, step, size, onValueChange, }: {
|
|
3
|
+
name: any;
|
|
4
|
+
min: any;
|
|
5
|
+
max: any;
|
|
6
|
+
step: any;
|
|
7
|
+
size?: string | undefined;
|
|
8
|
+
onValueChange?: typeof identity | undefined;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare namespace SliderInput {
|
|
11
|
+
namespace propTypes {
|
|
12
|
+
const name: PropTypes.Validator<string>;
|
|
13
|
+
const min: PropTypes.Validator<number>;
|
|
14
|
+
const max: PropTypes.Validator<number>;
|
|
15
|
+
const step: PropTypes.Validator<number>;
|
|
16
|
+
const size: PropTypes.Requireable<string>;
|
|
17
|
+
const onValueChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
import { identity } from './utils/functions';
|
|
21
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { Slider } from "@mui/material";
|
|
5
|
+
import { useController } from "react-hook-form";
|
|
6
|
+
import { identity } from "./utils/functions.js";
|
|
7
|
+
const SliderInput = ({
|
|
8
|
+
name,
|
|
9
|
+
min,
|
|
10
|
+
max,
|
|
11
|
+
step,
|
|
12
|
+
size = "small",
|
|
13
|
+
onValueChange = identity
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
field: { onChange, value }
|
|
17
|
+
} = useController({ name });
|
|
18
|
+
const handleValueChange = (e) => {
|
|
19
|
+
onChange(onValueChange(e.target.value));
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
Slider,
|
|
23
|
+
{
|
|
24
|
+
size,
|
|
25
|
+
min,
|
|
26
|
+
max,
|
|
27
|
+
step,
|
|
28
|
+
value,
|
|
29
|
+
onChange: handleValueChange
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
SliderInput.propTypes = {
|
|
34
|
+
name: PropTypes.string.isRequired,
|
|
35
|
+
min: PropTypes.number.isRequired,
|
|
36
|
+
max: PropTypes.number.isRequired,
|
|
37
|
+
step: PropTypes.number.isRequired,
|
|
38
|
+
size: PropTypes.string,
|
|
39
|
+
onValueChange: PropTypes.func
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
SliderInput as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default TextInput;
|
|
2
|
+
declare function TextInput({ name, label, labelValues, id, adornment, customAdornment, outputTransform, inputTransform, acceptValue, previousValue, clearable, formProps, }: {
|
|
3
|
+
name: any;
|
|
4
|
+
label: any;
|
|
5
|
+
labelValues: any;
|
|
6
|
+
id: any;
|
|
7
|
+
adornment: any;
|
|
8
|
+
customAdornment: any;
|
|
9
|
+
outputTransform?: typeof identity | undefined;
|
|
10
|
+
inputTransform?: typeof identity | undefined;
|
|
11
|
+
acceptValue?: (() => boolean) | undefined;
|
|
12
|
+
previousValue: any;
|
|
13
|
+
clearable: any;
|
|
14
|
+
formProps: any;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare namespace TextInput {
|
|
17
|
+
namespace propTypes {
|
|
18
|
+
const name: PropTypes.Requireable<string>;
|
|
19
|
+
const label: PropTypes.Requireable<string>;
|
|
20
|
+
const labelValues: PropTypes.Requireable<object>;
|
|
21
|
+
const id: PropTypes.Requireable<string>;
|
|
22
|
+
const adornment: PropTypes.Requireable<object>;
|
|
23
|
+
const customAdornment: PropTypes.Requireable<object>;
|
|
24
|
+
const outputTransform: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
|
+
const inputTransform: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
|
+
const acceptValue: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
const previousValue: PropTypes.Requireable<any>;
|
|
28
|
+
const clearable: PropTypes.Requireable<boolean>;
|
|
29
|
+
const formProps: PropTypes.Requireable<object>;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
import { identity } from './utils/functions';
|
|
33
|
+
import PropTypes from 'prop-types';
|