@gridsuite/commons-ui 0.47.0 → 0.49.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 +10 -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/index.d.ts +1 -0
- package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +31 -0
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +270 -0
- package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +16 -0
- package/dist/components/ElementSearchDialog/equipment-item.d.ts +16 -0
- package/dist/components/ElementSearchDialog/index.d.ts +2 -0
- package/dist/components/ElementSearchDialog/tag-renderer.d.ts +11 -0
- package/dist/components/FlatParameters/FlatParameters.d.ts +10 -0
- package/dist/components/FlatParameters/index.d.ts +1 -0
- package/dist/components/Login/Login.d.ts +5 -0
- package/dist/components/Login/Logout.d.ts +5 -0
- package/dist/components/Login/index.d.ts +1 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +4 -0
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +104 -0
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +131 -0
- package/dist/components/MuiVirtualizedTable/index.d.ts +2 -0
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +10 -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/ReportViewer/filter-button.d.ts +1 -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.d.ts +21 -0
- package/dist/components/ReportViewer/log-table.d.ts +8 -0
- package/dist/components/ReportViewer/multi-select-list.d.ts +1 -0
- package/dist/components/ReportViewer/report-item.d.ts +13 -0
- package/dist/components/ReportViewer/report-tree-view-context.d.ts +2 -0
- package/dist/components/ReportViewer/report-viewer.d.ts +4 -0
- package/dist/components/ReportViewerDialog/index.d.ts +1 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +1 -0
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +5 -0
- package/dist/components/SignInCallbackHandler/index.d.ts +1 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +5 -0
- package/dist/components/SilentRenewCallbackHandler/index.d.ts +1 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -0
- package/dist/components/SnackbarProvider/index.d.ts +1 -0
- package/dist/components/TopBar/AboutDialog.d.ts +24 -0
- package/dist/components/TopBar/GridLogo.d.ts +34 -0
- package/dist/components/TopBar/TopBar.d.ts +53 -0
- package/dist/components/TopBar/index.d.ts +3 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.d.ts +59 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.js +2 -1
- 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/booleans/boolean-input.d.ts +16 -0
- package/dist/components/react-hook-form/booleans/checkbox-input.d.ts +14 -0
- package/dist/components/react-hook-form/booleans/switch-input.d.ts +14 -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/field-error-alert.d.ts +4 -0
- package/dist/components/react-hook-form/error-management/mid-form-error.d.ts +4 -0
- package/dist/components/react-hook-form/numbers/float-input.d.ts +18 -0
- package/dist/components/react-hook-form/numbers/integer-input.d.ts +18 -0
- package/dist/components/react-hook-form/numbers/utils.d.ts +2 -0
- package/dist/components/react-hook-form/radio-input.d.ts +18 -0
- package/dist/components/react-hook-form/raw-read-only-input.d.ts +9 -0
- 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/slider-input.d.ts +21 -0
- package/dist/components/react-hook-form/text-input.d.ts +33 -0
- package/dist/components/react-hook-form/utils/cancel-button.d.ts +10 -0
- package/dist/components/react-hook-form/utils/field-label.d.ts +6 -0
- package/dist/components/react-hook-form/utils/functions.d.ts +11 -0
- package/dist/components/react-hook-form/utils/functions.js +5 -0
- package/dist/components/react-hook-form/utils/submit-button.d.ts +10 -0
- package/dist/components/react-hook-form/utils/text-field-with-adornment.d.ts +12 -0
- package/dist/components/translations/card-error-boundary-en.d.ts +12 -0
- package/dist/components/translations/card-error-boundary-fr.d.ts +12 -0
- package/dist/components/translations/common-button-en.d.ts +5 -0
- package/dist/components/translations/common-button-fr.d.ts +5 -0
- package/dist/components/translations/directory-items-input-en.d.ts +10 -0
- package/dist/components/translations/directory-items-input-en.js +6 -0
- package/dist/components/translations/directory-items-input-fr.d.ts +10 -0
- package/dist/components/translations/directory-items-input-fr.js +6 -0
- package/dist/components/translations/element-search-en.d.ts +11 -0
- package/dist/components/translations/element-search-fr.d.ts +11 -0
- package/dist/components/translations/equipment-search-en.d.ts +25 -0
- package/dist/components/translations/equipment-search-fr.d.ts +25 -0
- package/dist/components/translations/flat-parameters-en.d.ts +12 -0
- package/dist/components/translations/flat-parameters-fr.d.ts +12 -0
- package/dist/components/translations/login-en.d.ts +18 -0
- package/dist/components/translations/login-en.js +1 -1
- package/dist/components/translations/login-fr.d.ts +18 -0
- package/dist/components/translations/multiple-selection-dialog-en.d.ts +12 -0
- package/dist/components/translations/multiple-selection-dialog-fr.d.ts +12 -0
- package/dist/components/translations/report-viewer-en.d.ts +12 -0
- package/dist/components/translations/report-viewer-fr.d.ts +12 -0
- package/dist/components/translations/table-en.d.ts +10 -0
- package/dist/components/translations/table-fr.d.ts +10 -0
- package/dist/components/translations/top-bar-en.d.ts +31 -0
- package/dist/components/translations/top-bar-fr.d.ts +31 -0
- package/dist/components/translations/treeview-finder-en.d.ts +16 -0
- package/dist/components/translations/treeview-finder-fr.d.ts +16 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useSnackMessage.d.ts +5 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +44 -34
- package/dist/utils/AuthService.d.ts +9 -0
- package/dist/utils/ElementType.d.ts +13 -0
- package/dist/utils/ElementType.js +6 -2
- package/dist/utils/EquipmentType.d.ts +136 -0
- package/dist/utils/UserManagerMock.d.ts +34 -0
- package/dist/utils/actions.d.ts +50 -0
- package/dist/utils/algos.d.ts +7 -0
- package/dist/utils/styles.d.ts +5 -0
- package/package.json +4 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default AuthenticationRouter;
|
|
2
|
+
declare function AuthenticationRouter({ userManager, signInCallbackError, authenticationRouterError, showAuthenticationRouterLogin, dispatch, navigate, location, }: {
|
|
3
|
+
userManager: any;
|
|
4
|
+
signInCallbackError: any;
|
|
5
|
+
authenticationRouterError: any;
|
|
6
|
+
showAuthenticationRouterLogin: any;
|
|
7
|
+
dispatch: any;
|
|
8
|
+
navigate: any;
|
|
9
|
+
location: any;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./AuthenticationRouter";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default CardErrorBoundary;
|
|
2
|
+
declare class CardErrorBoundary extends React.Component<any, any, any> {
|
|
3
|
+
static getDerivedStateFromError(error: any): {
|
|
4
|
+
hasError: boolean;
|
|
5
|
+
error: any;
|
|
6
|
+
};
|
|
7
|
+
constructor(props: any);
|
|
8
|
+
state: {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
error: undefined;
|
|
12
|
+
};
|
|
13
|
+
handleExpandClick(): void;
|
|
14
|
+
handleReloadClick(): void;
|
|
15
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
16
|
+
render(): any;
|
|
17
|
+
}
|
|
18
|
+
import React from 'react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./card-error-boundary";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
/// <reference types="node" />
|
|
8
|
+
import { FunctionComponent } from 'react';
|
|
9
|
+
import { UUID } from 'crypto';
|
|
10
|
+
interface DirectoryItemSelectorProps {
|
|
11
|
+
open: boolean;
|
|
12
|
+
onClose: any;
|
|
13
|
+
types: string[];
|
|
14
|
+
equipmentTypes?: string[];
|
|
15
|
+
title: string;
|
|
16
|
+
itemFilter?: any;
|
|
17
|
+
fetchDirectoryContent: (directoryUuid: UUID, elementTypes: string[]) => Promise<any>;
|
|
18
|
+
fetchRootFolders: (types: string[]) => Promise<any>;
|
|
19
|
+
fetchElementsInfos: (ids: UUID[], elementTypes: string[], equipmentTypes?: string[]) => Promise<any>;
|
|
20
|
+
classes?: any;
|
|
21
|
+
contentText?: string;
|
|
22
|
+
defaultExpanded?: string[];
|
|
23
|
+
defaultSelected?: string[];
|
|
24
|
+
validationButtonText?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
cancelButtonProps?: any;
|
|
27
|
+
onlyLeaves?: boolean;
|
|
28
|
+
multiselect?: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare const DirectoryItemSelector: FunctionComponent<DirectoryItemSelectorProps>;
|
|
31
|
+
export default DirectoryItemSelector;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
3
|
+
import { elementType, getFileIcon } from "../../utils/ElementType.js";
|
|
4
|
+
import { useSnackMessage } from "../../hooks/useSnackMessage.js";
|
|
5
|
+
import TreeViewFinder from "../TreeViewFinder/TreeViewFinder.js";
|
|
6
|
+
const styles = {
|
|
7
|
+
icon: (theme) => ({
|
|
8
|
+
marginRight: theme.spacing(1),
|
|
9
|
+
width: "18px",
|
|
10
|
+
height: "18px"
|
|
11
|
+
})
|
|
12
|
+
};
|
|
13
|
+
const DirectoryItemSelector = ({
|
|
14
|
+
open,
|
|
15
|
+
onClose,
|
|
16
|
+
types,
|
|
17
|
+
equipmentTypes,
|
|
18
|
+
title,
|
|
19
|
+
itemFilter,
|
|
20
|
+
fetchDirectoryContent,
|
|
21
|
+
fetchRootFolders,
|
|
22
|
+
fetchElementsInfos,
|
|
23
|
+
classes,
|
|
24
|
+
contentText,
|
|
25
|
+
defaultExpanded,
|
|
26
|
+
defaultSelected,
|
|
27
|
+
validationButtonText,
|
|
28
|
+
className,
|
|
29
|
+
cancelButtonProps,
|
|
30
|
+
onlyLeaves = true,
|
|
31
|
+
multiselect = true
|
|
32
|
+
}) => {
|
|
33
|
+
const [data, setData] = useState([]);
|
|
34
|
+
const [rootDirectories, setRootDirectories] = useState([]);
|
|
35
|
+
const nodeMap = useRef({});
|
|
36
|
+
const dataRef = useRef([]);
|
|
37
|
+
dataRef.current = data;
|
|
38
|
+
const rootsRef = useRef([]);
|
|
39
|
+
rootsRef.current = rootDirectories;
|
|
40
|
+
const { snackError } = useSnackMessage();
|
|
41
|
+
const openRef = useRef();
|
|
42
|
+
openRef.current = open;
|
|
43
|
+
const contentFilter = useCallback(
|
|
44
|
+
() => /* @__PURE__ */ new Set([elementType.DIRECTORY, ...types]),
|
|
45
|
+
[types]
|
|
46
|
+
);
|
|
47
|
+
const convertChildren = useCallback((children) => {
|
|
48
|
+
return children.map((e) => {
|
|
49
|
+
return {
|
|
50
|
+
id: e.elementUuid,
|
|
51
|
+
name: e.elementName,
|
|
52
|
+
specificMetadata: e.specificMetadata,
|
|
53
|
+
icon: getFileIcon(e.type, styles.icon),
|
|
54
|
+
children: e.type === elementType.DIRECTORY ? convertChildren(e.children) : void 0,
|
|
55
|
+
childrenCount: e.type === elementType.DIRECTORY ? e.subdirectoriesCount : void 0
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}, []);
|
|
59
|
+
const convertRoots = useCallback(
|
|
60
|
+
(newRoots) => {
|
|
61
|
+
return newRoots.map((e) => {
|
|
62
|
+
return {
|
|
63
|
+
id: e.elementUuid,
|
|
64
|
+
name: e.elementName,
|
|
65
|
+
icon: getFileIcon(e.type, styles.icon),
|
|
66
|
+
children: e.type === elementType.DIRECTORY ? convertChildren(
|
|
67
|
+
nodeMap.current[e.elementUuid].children
|
|
68
|
+
) : void 0,
|
|
69
|
+
childrenCount: e.type === elementType.DIRECTORY ? e.subdirectoriesCount : void 0
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
[convertChildren]
|
|
74
|
+
);
|
|
75
|
+
const addToDirectory = useCallback(
|
|
76
|
+
(nodeId, content) => {
|
|
77
|
+
let [nrs, mdr] = updatedTree(
|
|
78
|
+
rootsRef.current,
|
|
79
|
+
nodeMap.current,
|
|
80
|
+
nodeId,
|
|
81
|
+
content
|
|
82
|
+
);
|
|
83
|
+
setRootDirectories(nrs);
|
|
84
|
+
nodeMap.current = mdr;
|
|
85
|
+
setData(convertRoots(nrs));
|
|
86
|
+
},
|
|
87
|
+
[convertRoots]
|
|
88
|
+
);
|
|
89
|
+
const updateRootDirectories = useCallback(() => {
|
|
90
|
+
fetchRootFolders(types).then((data2) => {
|
|
91
|
+
let [nrs, mdr] = updatedTree(
|
|
92
|
+
rootsRef.current,
|
|
93
|
+
nodeMap.current,
|
|
94
|
+
null,
|
|
95
|
+
data2
|
|
96
|
+
);
|
|
97
|
+
setRootDirectories(nrs);
|
|
98
|
+
nodeMap.current = mdr;
|
|
99
|
+
setData(convertRoots(nrs));
|
|
100
|
+
}).catch((error) => {
|
|
101
|
+
snackError({
|
|
102
|
+
messageTxt: error.message,
|
|
103
|
+
headerId: "DirectoryItemSelector"
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}, [convertRoots, types, snackError, fetchRootFolders]);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (open) {
|
|
109
|
+
updateRootDirectories();
|
|
110
|
+
}
|
|
111
|
+
}, [open, updateRootDirectories]);
|
|
112
|
+
const fetchDirectory = useCallback(
|
|
113
|
+
(nodeId) => {
|
|
114
|
+
fetchDirectoryContent(nodeId, types).then((children) => {
|
|
115
|
+
const childrenMatchedTypes = children.filter(
|
|
116
|
+
(item) => contentFilter().has(item.type)
|
|
117
|
+
);
|
|
118
|
+
if (childrenMatchedTypes.length > 0 && equipmentTypes && equipmentTypes.length > 0) {
|
|
119
|
+
fetchElementsInfos(
|
|
120
|
+
childrenMatchedTypes.map((e) => e.elementUuid),
|
|
121
|
+
types,
|
|
122
|
+
equipmentTypes
|
|
123
|
+
).then((childrenWithMetadata) => {
|
|
124
|
+
const children2 = itemFilter ? childrenWithMetadata.filter((val) => {
|
|
125
|
+
if (val.type === elementType.DIRECTORY) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
return itemFilter(val);
|
|
129
|
+
}) : childrenWithMetadata;
|
|
130
|
+
addToDirectory(nodeId, children2);
|
|
131
|
+
});
|
|
132
|
+
} else {
|
|
133
|
+
addToDirectory(nodeId, childrenMatchedTypes);
|
|
134
|
+
}
|
|
135
|
+
}).catch((error) => {
|
|
136
|
+
console.warn(
|
|
137
|
+
`Could not update subs (and content) of '${nodeId}' : ${error.message}`
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
[
|
|
142
|
+
types,
|
|
143
|
+
equipmentTypes,
|
|
144
|
+
itemFilter,
|
|
145
|
+
contentFilter,
|
|
146
|
+
addToDirectory,
|
|
147
|
+
fetchDirectoryContent,
|
|
148
|
+
fetchElementsInfos
|
|
149
|
+
]
|
|
150
|
+
);
|
|
151
|
+
function sortHandlingDirectories(a, b) {
|
|
152
|
+
if (a.children && !b.children) {
|
|
153
|
+
return -1;
|
|
154
|
+
} else if (b.children && !a.children) {
|
|
155
|
+
return 1;
|
|
156
|
+
}
|
|
157
|
+
return a.name.localeCompare(b.name);
|
|
158
|
+
}
|
|
159
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
160
|
+
TreeViewFinder,
|
|
161
|
+
{
|
|
162
|
+
multiselect,
|
|
163
|
+
onTreeBrowse: fetchDirectory,
|
|
164
|
+
data,
|
|
165
|
+
onlyLeaves,
|
|
166
|
+
sortMethod: sortHandlingDirectories,
|
|
167
|
+
title,
|
|
168
|
+
onClose,
|
|
169
|
+
open,
|
|
170
|
+
classes,
|
|
171
|
+
contentText,
|
|
172
|
+
defaultExpanded,
|
|
173
|
+
defaultSelected,
|
|
174
|
+
validationButtonText,
|
|
175
|
+
className,
|
|
176
|
+
cancelButtonProps
|
|
177
|
+
}
|
|
178
|
+
) });
|
|
179
|
+
};
|
|
180
|
+
function updatedTree(prevRoots, prevMap, nodeId, children) {
|
|
181
|
+
var _a;
|
|
182
|
+
const nextChildren = children.sort((a, b) => a.elementName.localeCompare(b.elementName)).map((n) => {
|
|
183
|
+
let pn = prevMap[n.elementUuid];
|
|
184
|
+
if (!pn) {
|
|
185
|
+
return { ...n, children: [], parentUuid: nodeId };
|
|
186
|
+
} else if (n.elementName === pn.elementName && sameRights(n.accessRights, pn.accessRights) && n.subdirectoriesCount === pn.subdirectoriesCount && nodeId === pn.parentUuid) {
|
|
187
|
+
return pn;
|
|
188
|
+
} else {
|
|
189
|
+
if (pn.parentUuid !== nodeId) {
|
|
190
|
+
console.warn("reparent " + pn.parentUuid + " -> " + nodeId);
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
...pn,
|
|
194
|
+
elementName: n.elementName,
|
|
195
|
+
accessRights: n.accessRights,
|
|
196
|
+
subdirectoriesCount: n.subdirectoriesCount,
|
|
197
|
+
parentUuid: nodeId
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
const prevChildren = nodeId ? (_a = prevMap[nodeId]) == null ? void 0 : _a.children : prevRoots;
|
|
202
|
+
if ((prevChildren == null ? void 0 : prevChildren.length) === nextChildren.length && prevChildren.every((e, i) => e === nextChildren[i])) {
|
|
203
|
+
return [prevRoots, prevMap];
|
|
204
|
+
}
|
|
205
|
+
let nextUuids = new Set(children ? children.map((n) => n.elementUuid) : []);
|
|
206
|
+
let prevUuids = prevChildren ? prevChildren.map((n) => n.elementUuid) : [];
|
|
207
|
+
let mayNodeId = nodeId ? [nodeId] : [];
|
|
208
|
+
let nonCopyUuids = /* @__PURE__ */ new Set([
|
|
209
|
+
...nextUuids,
|
|
210
|
+
...mayNodeId,
|
|
211
|
+
...Array.prototype.concat(
|
|
212
|
+
...prevUuids.filter((u) => !nextUuids.has(u)).map(
|
|
213
|
+
(u) => flattenDownNodes(prevMap[u], (n) => n.children).map(
|
|
214
|
+
(n) => n.elementUuid
|
|
215
|
+
)
|
|
216
|
+
)
|
|
217
|
+
)
|
|
218
|
+
]);
|
|
219
|
+
const prevNode = nodeId ? prevMap[nodeId] : {};
|
|
220
|
+
const nextNode = {
|
|
221
|
+
elementUuid: nodeId,
|
|
222
|
+
parentUuid: null,
|
|
223
|
+
...prevNode,
|
|
224
|
+
children: nextChildren,
|
|
225
|
+
subdirectoriesCount: nextChildren.length
|
|
226
|
+
};
|
|
227
|
+
const nextMap = Object.fromEntries([
|
|
228
|
+
...Object.entries(prevMap).filter(([k, v], i) => !nonCopyUuids.has(k)),
|
|
229
|
+
...nextChildren.map((n) => [n.elementUuid, n]),
|
|
230
|
+
...refreshedUpNodes(prevMap, nextNode).map((n) => [n.elementUuid, n])
|
|
231
|
+
]);
|
|
232
|
+
const nextRoots = nodeId === null ? nextChildren : prevRoots.map((r) => nextMap[r.elementUuid]);
|
|
233
|
+
return [nextRoots, nextMap];
|
|
234
|
+
}
|
|
235
|
+
function sameRights(a, b) {
|
|
236
|
+
if (!a && !b) {
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
if (!a || !b) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
return a.isPrivate === b.isPrivate;
|
|
243
|
+
}
|
|
244
|
+
function flattenDownNodes(n, cef) {
|
|
245
|
+
const subs = cef(n);
|
|
246
|
+
if (subs.length === 0) {
|
|
247
|
+
return [n];
|
|
248
|
+
}
|
|
249
|
+
return Array.prototype.concat(
|
|
250
|
+
[n],
|
|
251
|
+
...subs.map((sn) => flattenDownNodes(sn, cef))
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
function refreshedUpNodes(m, nn) {
|
|
255
|
+
if (!(nn == null ? void 0 : nn.elementUuid)) {
|
|
256
|
+
return [];
|
|
257
|
+
}
|
|
258
|
+
if (nn.parentUuid === null) {
|
|
259
|
+
return [nn];
|
|
260
|
+
}
|
|
261
|
+
const parent = m[nn.parentUuid];
|
|
262
|
+
const nextChildren = parent.children.map(
|
|
263
|
+
(c) => c.elementUuid === nn.elementUuid ? nn : c
|
|
264
|
+
);
|
|
265
|
+
const nextParent = { ...parent, children: nextChildren };
|
|
266
|
+
return [nn, ...refreshedUpNodes(m, nextParent)];
|
|
267
|
+
}
|
|
268
|
+
export {
|
|
269
|
+
DirectoryItemSelector as default
|
|
270
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default ElementSearchDialog;
|
|
2
|
+
declare function ElementSearchDialog(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace ElementSearchDialog {
|
|
4
|
+
namespace propTypes {
|
|
5
|
+
const open: PropTypes.Validator<boolean>;
|
|
6
|
+
const onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
7
|
+
const searchingLabel: PropTypes.Requireable<string>;
|
|
8
|
+
const onSearchTermChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
9
|
+
const onSelectionChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
10
|
+
const elementsFound: PropTypes.Validator<any[]>;
|
|
11
|
+
const renderElement: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
+
const searchTermDisabled: PropTypes.Requireable<boolean>;
|
|
13
|
+
const searchTermDisableReason: PropTypes.Requireable<string>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function EquipmentItem({ inputValue, suffixRenderer, element, showsJustText, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
inputValue: any;
|
|
4
|
+
suffixRenderer?: {
|
|
5
|
+
({ props, element }: {
|
|
6
|
+
props: any;
|
|
7
|
+
element: any;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
propTypes: {
|
|
10
|
+
element: import("prop-types").Requireable<object>;
|
|
11
|
+
props: import("prop-types").Requireable<object>;
|
|
12
|
+
};
|
|
13
|
+
} | undefined;
|
|
14
|
+
element: any;
|
|
15
|
+
showsJustText?: boolean | undefined;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function TagRenderer({ props, element }: {
|
|
2
|
+
props: any;
|
|
3
|
+
element: any;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export namespace TagRenderer {
|
|
6
|
+
namespace propTypes {
|
|
7
|
+
const element: PropTypes.Requireable<object>;
|
|
8
|
+
const props: PropTypes.Requireable<object>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function extractDefault(paramDescription: any): any;
|
|
2
|
+
export function FlatParameters({ paramsAsArray, initValues, onChange, variant, showSeparator, selectionWithDialog, }: {
|
|
3
|
+
paramsAsArray: any;
|
|
4
|
+
initValues: any;
|
|
5
|
+
onChange: any;
|
|
6
|
+
variant?: string | undefined;
|
|
7
|
+
showSeparator?: boolean | undefined;
|
|
8
|
+
selectionWithDialog?: ((param: any) => boolean) | undefined;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default FlatParameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./FlatParameters";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Login";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const ColumnHeader: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
2
|
+
declare const _default: import("@emotion/styled").StyledComponent<React.RefAttributes<any> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
|
|
3
|
+
export default _default;
|
|
4
|
+
import React from 'react';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export namespace CHANGE_WAYS {
|
|
2
|
+
const SIMPLE: string;
|
|
3
|
+
const TAIL: string;
|
|
4
|
+
const AMEND: string;
|
|
5
|
+
const REMOVE: string;
|
|
6
|
+
}
|
|
7
|
+
export const noOpHelper: Readonly<{
|
|
8
|
+
debugName: "noOp";
|
|
9
|
+
maintainsStats: false;
|
|
10
|
+
initStat: () => undefined;
|
|
11
|
+
updateStat: (colStat: any, value: any) => void;
|
|
12
|
+
accepts: (value: any, userParams: any, outerParams: any) => true;
|
|
13
|
+
}>;
|
|
14
|
+
export const collectibleHelper: Readonly<{
|
|
15
|
+
debugName: "collectible";
|
|
16
|
+
maintainsStats: true;
|
|
17
|
+
initStat: () => {
|
|
18
|
+
seen: {};
|
|
19
|
+
kept: {};
|
|
20
|
+
};
|
|
21
|
+
updateStat: (colStat: any, cellValue: any, isForKeep: any) => void;
|
|
22
|
+
accepts: (value: any, userParams: any, outerParams: any) => any;
|
|
23
|
+
}>;
|
|
24
|
+
export function getHelper(column: any): Readonly<{
|
|
25
|
+
debugName: "noOp";
|
|
26
|
+
maintainsStats: false;
|
|
27
|
+
initStat: () => undefined;
|
|
28
|
+
updateStat: (colStat: any, value: any) => void;
|
|
29
|
+
accepts: (value: any, userParams: any, outerParams: any) => true;
|
|
30
|
+
}> | Readonly<{
|
|
31
|
+
debugName: "num";
|
|
32
|
+
maintainsStats: true;
|
|
33
|
+
initStat: () => {
|
|
34
|
+
imin: null;
|
|
35
|
+
imax: null;
|
|
36
|
+
};
|
|
37
|
+
updateStat: (colStat: any, value: any) => void;
|
|
38
|
+
accepts: (value: any, userParams: any, outerParams: any) => true;
|
|
39
|
+
}> | Readonly<{
|
|
40
|
+
debugName: "collectible";
|
|
41
|
+
maintainsStats: true;
|
|
42
|
+
initStat: () => {
|
|
43
|
+
seen: {};
|
|
44
|
+
kept: {};
|
|
45
|
+
};
|
|
46
|
+
updateStat: (colStat: any, cellValue: any, isForKeep: any) => void;
|
|
47
|
+
accepts: (value: any, userParams: any, outerParams: any) => any;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* A rows indexer for MuiVirtualizedTable to delegate to an instance of it
|
|
51
|
+
* for filtering, grouping and multi-column sorting via
|
|
52
|
+
* a view index to model index array.
|
|
53
|
+
*/
|
|
54
|
+
export class KeyedColumnsRowIndexer {
|
|
55
|
+
static get CHANGE_WAYS(): {
|
|
56
|
+
SIMPLE: string;
|
|
57
|
+
TAIL: string;
|
|
58
|
+
AMEND: string;
|
|
59
|
+
REMOVE: string;
|
|
60
|
+
};
|
|
61
|
+
constructor(isThreeState?: boolean, singleColumnByDefault?: boolean, delegatorCallback?: null, versionSetter?: null);
|
|
62
|
+
_versionSetter: any;
|
|
63
|
+
version: number;
|
|
64
|
+
filterVersion: number;
|
|
65
|
+
delegatorCallback: any;
|
|
66
|
+
indirectionStatus: string | null;
|
|
67
|
+
isThreeState: boolean;
|
|
68
|
+
singleColumnByDefault: boolean;
|
|
69
|
+
lastUsedRank: number;
|
|
70
|
+
sortingState: any;
|
|
71
|
+
groupingCount: number;
|
|
72
|
+
byColFilter: {} | null;
|
|
73
|
+
byRowFilter: any;
|
|
74
|
+
hasVersionSetter: () => boolean;
|
|
75
|
+
getVersion: () => number;
|
|
76
|
+
_bumpVersion: (isFilter?: boolean) => void;
|
|
77
|
+
updatePreferences: (preferences: any) => false | undefined;
|
|
78
|
+
preFilterRowMapping: (columns: any, rows: any, rowFilter: any) => {
|
|
79
|
+
rowAndOrigIndex: any[][];
|
|
80
|
+
colsStats: {};
|
|
81
|
+
rowsCount: any;
|
|
82
|
+
} | null;
|
|
83
|
+
makeGroupAndSortIndirector: (preFilteredRowPairs: any, columns: any) => any;
|
|
84
|
+
getSortingAsKeyAndCodedRank: () => any;
|
|
85
|
+
updateSortingFromUser: (colKey: any, change_way: any) => boolean;
|
|
86
|
+
codedRankByColumnIndex: (columns: any) => number[] | null;
|
|
87
|
+
columnSortingSignedRank: (colKey: any) => number;
|
|
88
|
+
highestCodedColumn: (columns: any) => number;
|
|
89
|
+
_getColFilterParams: (colKey: any, isForUser: any) => any;
|
|
90
|
+
_setColFilterParams: (colKey: any, params: any, isForUser: any) => boolean;
|
|
91
|
+
getColFilterOuterParams: (colKey: any) => any;
|
|
92
|
+
setColFilterOuterParams: (colKey: any, outerParams: any) => boolean;
|
|
93
|
+
getColFilterUserParams: (colKey: any) => any;
|
|
94
|
+
setColFilterUserParams: (colKey: any, params: any) => boolean;
|
|
95
|
+
getUserFiltering: () => {};
|
|
96
|
+
updateRowFiltering: (rowFilterFunc: any) => void;
|
|
97
|
+
}
|
|
98
|
+
export namespace forTesting {
|
|
99
|
+
export { codedColumnsFromKeyAndDirection };
|
|
100
|
+
export { makeCompositeComparatorFromCodedColumns };
|
|
101
|
+
}
|
|
102
|
+
declare function codedColumnsFromKeyAndDirection(keyAndDirections: any, columns: any): number[] | null;
|
|
103
|
+
declare function makeCompositeComparatorFromCodedColumns(codedColumns: any, columns: any, rowExtractor: any): (row_a_i: any, row_b_i: any) => number;
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export const DEFAULT_CELL_PADDING: 16;
|
|
2
|
+
export const DEFAULT_HEADER_HEIGHT: 48;
|
|
3
|
+
export const DEFAULT_ROW_HEIGHT: 48;
|
|
4
|
+
export function generateMuiVirtualizedTableClass(className: any): string;
|
|
5
|
+
declare const _default: import("@emotion/styled").StyledComponent<Pick<PropTypes.InferProps<{
|
|
6
|
+
name: PropTypes.Requireable<string>;
|
|
7
|
+
classes: PropTypes.Requireable<object>;
|
|
8
|
+
rows: PropTypes.Requireable<any[]>;
|
|
9
|
+
columns: PropTypes.Validator<(PropTypes.InferProps<{
|
|
10
|
+
dataKey: PropTypes.Validator<string>;
|
|
11
|
+
label: PropTypes.Validator<string>;
|
|
12
|
+
numeric: PropTypes.Requireable<boolean>;
|
|
13
|
+
width: PropTypes.Requireable<number>;
|
|
14
|
+
minWidth: PropTypes.Requireable<number>;
|
|
15
|
+
maxWidth: PropTypes.Requireable<number>;
|
|
16
|
+
unit: PropTypes.Requireable<string>;
|
|
17
|
+
fractionDigits: PropTypes.Requireable<number>;
|
|
18
|
+
extra: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
19
|
+
}> | null | undefined)[]>;
|
|
20
|
+
enableExportCSV: PropTypes.Requireable<boolean>;
|
|
21
|
+
exportCSVDataKeys: PropTypes.Requireable<any[]>;
|
|
22
|
+
sort: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
|
+
sortable: PropTypes.Requireable<boolean>;
|
|
24
|
+
indexer: PropTypes.Requireable<object>;
|
|
25
|
+
headerHeight: PropTypes.Requireable<number>;
|
|
26
|
+
onRowClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
onCellClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
+
rowHeight: PropTypes.Requireable<number>;
|
|
29
|
+
filter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
+
tooltipSx: PropTypes.Requireable<object>;
|
|
31
|
+
}>, "filter" | "name" | "rows" | "columns" | "sort" | "tooltipSx" | "indexer" | "sortable" | "exportCSVDataKeys" | "onRowClick" | "onCellClick"> & {
|
|
32
|
+
classes?: object | null | undefined;
|
|
33
|
+
headerHeight?: number | null | undefined;
|
|
34
|
+
enableExportCSV?: boolean | null | undefined;
|
|
35
|
+
rowHeight?: number | null | undefined;
|
|
36
|
+
} & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {
|
|
37
|
+
ref?: React.Ref<MuiVirtualizedTable> | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export default _default;
|
|
40
|
+
import PropTypes from 'prop-types';
|
|
41
|
+
declare class MuiVirtualizedTable extends React.PureComponent<any, any, any> {
|
|
42
|
+
static defaultProps: {
|
|
43
|
+
headerHeight: number;
|
|
44
|
+
rowHeight: number;
|
|
45
|
+
enableExportCSV: boolean;
|
|
46
|
+
classes: {};
|
|
47
|
+
};
|
|
48
|
+
constructor(props: any, context: any);
|
|
49
|
+
_computeHeaderSize(): void;
|
|
50
|
+
_registerHeader(label: any, header: any): void;
|
|
51
|
+
_registerObserver(element: any): void;
|
|
52
|
+
headers: React.RefObject<any>;
|
|
53
|
+
observer: IntersectionObserver;
|
|
54
|
+
state: {
|
|
55
|
+
headerHeight: any;
|
|
56
|
+
indexer: any;
|
|
57
|
+
indirectionVersion: number;
|
|
58
|
+
popoverAnchorEl: null;
|
|
59
|
+
popoverColKey: null;
|
|
60
|
+
deferredFilterChange: null;
|
|
61
|
+
};
|
|
62
|
+
setVersion: (v: any) => void;
|
|
63
|
+
componentDidUpdate(oldProps: any): void;
|
|
64
|
+
componentDidMount(): void;
|
|
65
|
+
componentWillUnmount(): void;
|
|
66
|
+
computeDataWidth: (text: any) => any;
|
|
67
|
+
sizes: import("memoize-one").MemoizedFn<(this: any, columns: any, rows: any, rowGetter: any) => {}>;
|
|
68
|
+
openPopover: (popoverTarget: any, colKey: any) => void;
|
|
69
|
+
dropDownVisible: any;
|
|
70
|
+
handleKeyDownOnPopover: (evt: any) => void;
|
|
71
|
+
closePopover: (evt: any, reason: any) => void;
|
|
72
|
+
makeColumnFilterEditor: () => import("react/jsx-runtime").JSX.Element;
|
|
73
|
+
_commitFilterChange: () => boolean;
|
|
74
|
+
onFilterParamsChange(newVal: any, colKey: any): void;
|
|
75
|
+
sortClickHandler: (evt: any, name: any, columnIndex: any) => void;
|
|
76
|
+
filterClickHandler: (evt: any, target: any, columnIndex: any) => void;
|
|
77
|
+
sortableHeader: ({ label, columnIndex }: {
|
|
78
|
+
label: any;
|
|
79
|
+
columnIndex: any;
|
|
80
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
simpleHeaderRenderer: ({ label }: {
|
|
82
|
+
label: any;
|
|
83
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
getRowClassName: ({ index, rowGetter }: {
|
|
85
|
+
index: any;
|
|
86
|
+
rowGetter: any;
|
|
87
|
+
}) => string;
|
|
88
|
+
onClickableRowClick: (event: any) => void;
|
|
89
|
+
cellRenderer: ({ cellData, columnIndex, rowIndex }: {
|
|
90
|
+
cellData: any;
|
|
91
|
+
columnIndex: any;
|
|
92
|
+
rowIndex: any;
|
|
93
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
getDisplayValue(column: any, cellData: any): any;
|
|
95
|
+
makeHeaderRenderer(dataKey: any, columnIndex: any): (headerProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
makeSizedTable: (height: any, width: any, sizes: any, reorderedIndex: any, rowGetter: any) => import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
getCSVFilename: () => any;
|
|
98
|
+
getCSVData: () => Promise<{}[]>;
|
|
99
|
+
csvHeaders: import("memoize-one").MemoizedFn<(this: any, columns: any, exportCSVDataKeys: any) => any[]>;
|
|
100
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
}
|
|
102
|
+
declare namespace MuiVirtualizedTable {
|
|
103
|
+
namespace propTypes {
|
|
104
|
+
const name: PropTypes.Requireable<string>;
|
|
105
|
+
const classes: PropTypes.Requireable<object>;
|
|
106
|
+
const rows: PropTypes.Requireable<any[]>;
|
|
107
|
+
const columns: PropTypes.Validator<(PropTypes.InferProps<{
|
|
108
|
+
dataKey: PropTypes.Validator<string>;
|
|
109
|
+
label: PropTypes.Validator<string>;
|
|
110
|
+
numeric: PropTypes.Requireable<boolean>;
|
|
111
|
+
width: PropTypes.Requireable<number>;
|
|
112
|
+
minWidth: PropTypes.Requireable<number>;
|
|
113
|
+
maxWidth: PropTypes.Requireable<number>;
|
|
114
|
+
unit: PropTypes.Requireable<string>;
|
|
115
|
+
fractionDigits: PropTypes.Requireable<number>;
|
|
116
|
+
extra: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
117
|
+
}> | null | undefined)[]>;
|
|
118
|
+
const enableExportCSV: PropTypes.Requireable<boolean>;
|
|
119
|
+
const exportCSVDataKeys: PropTypes.Requireable<any[]>;
|
|
120
|
+
const sort: PropTypes.Requireable<(...args: any[]) => any>;
|
|
121
|
+
const sortable: PropTypes.Requireable<boolean>;
|
|
122
|
+
const indexer: PropTypes.Requireable<object>;
|
|
123
|
+
const headerHeight: PropTypes.Requireable<number>;
|
|
124
|
+
const onRowClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
125
|
+
const onCellClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
126
|
+
const rowHeight: PropTypes.Requireable<number>;
|
|
127
|
+
const filter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
128
|
+
const tooltipSx: PropTypes.Requireable<object>;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
import React from 'react';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default MultipleSelectionDialog;
|
|
2
|
+
declare function MultipleSelectionDialog({ options, selectedOptions, open, getOptionLabel, handleClose, handleValidate, titleId, }: {
|
|
3
|
+
options: any;
|
|
4
|
+
selectedOptions: any;
|
|
5
|
+
open: any;
|
|
6
|
+
getOptionLabel: any;
|
|
7
|
+
handleClose: any;
|
|
8
|
+
handleValidate: any;
|
|
9
|
+
titleId: any;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|