@gridsuite/commons-ui 0.48.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.
@@ -17,6 +17,15 @@ interface DirectoryItemSelectorProps {
17
17
  fetchDirectoryContent: (directoryUuid: UUID, elementTypes: string[]) => Promise<any>;
18
18
  fetchRootFolders: (types: string[]) => Promise<any>;
19
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;
20
29
  }
21
30
  declare const DirectoryItemSelector: FunctionComponent<DirectoryItemSelectorProps>;
22
31
  export default DirectoryItemSelector;
@@ -19,7 +19,16 @@ const DirectoryItemSelector = ({
19
19
  itemFilter,
20
20
  fetchDirectoryContent,
21
21
  fetchRootFolders,
22
- fetchElementsInfos
22
+ fetchElementsInfos,
23
+ classes,
24
+ contentText,
25
+ defaultExpanded,
26
+ defaultSelected,
27
+ validationButtonText,
28
+ className,
29
+ cancelButtonProps,
30
+ onlyLeaves = true,
31
+ multiselect = true
23
32
  }) => {
24
33
  const [data, setData] = useState([]);
25
34
  const [rootDirectories, setRootDirectories] = useState([]);
@@ -150,14 +159,21 @@ const DirectoryItemSelector = ({
150
159
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
151
160
  TreeViewFinder,
152
161
  {
153
- multiselect: true,
162
+ multiselect,
154
163
  onTreeBrowse: fetchDirectory,
155
164
  data,
156
- onlyLeaves: true,
165
+ onlyLeaves,
157
166
  sortMethod: sortHandlingDirectories,
158
167
  title,
159
168
  onClose,
160
- open
169
+ open,
170
+ classes,
171
+ contentText,
172
+ defaultExpanded,
173
+ defaultSelected,
174
+ validationButtonText,
175
+ className,
176
+ cancelButtonProps
161
177
  }
162
178
  ) });
163
179
  };
@@ -18,7 +18,8 @@ declare const _default: import("@emotion/styled").StyledComponent<Pick<PropTypes
18
18
  multiselect: PropTypes.Requireable<boolean>;
19
19
  sortMethod: PropTypes.Requireable<(...args: any[]) => any>;
20
20
  cancelButtonProps: PropTypes.Requireable<object>;
21
- }>, "title" | "onClose" | "onTreeBrowse" | "contentText" | "validationButtonText" | "cancelButtonProps" | PropTypes.RequiredKeys<{
21
+ className: PropTypes.Requireable<string>;
22
+ }>, "className" | "title" | "onClose" | "contentText" | "validationButtonText" | "cancelButtonProps" | "onTreeBrowse" | PropTypes.RequiredKeys<{
22
23
  open: PropTypes.Validator<boolean>;
23
24
  onClose: PropTypes.Requireable<(...args: any[]) => any>;
24
25
  data: PropTypes.Validator<(PropTypes.InferProps<{
@@ -37,10 +38,11 @@ declare const _default: import("@emotion/styled").StyledComponent<Pick<PropTypes
37
38
  multiselect: PropTypes.Requireable<boolean>;
38
39
  sortMethod: PropTypes.Requireable<(...args: any[]) => any>;
39
40
  cancelButtonProps: PropTypes.Requireable<object>;
41
+ className: PropTypes.Requireable<string>;
40
42
  }>> & {
41
43
  classes?: object | null | undefined;
42
- defaultSelected?: (string | null | undefined)[] | null | undefined;
43
44
  defaultExpanded?: (string | null | undefined)[] | null | undefined;
45
+ defaultSelected?: (string | null | undefined)[] | null | undefined;
44
46
  onlyLeaves?: boolean | null | undefined;
45
47
  multiselect?: boolean | null | undefined;
46
48
  sortMethod?: ((...args: any[]) => any) | null | undefined;
@@ -267,7 +267,8 @@ TreeViewFinder.propTypes = {
267
267
  onlyLeaves: PropTypes.bool,
268
268
  multiselect: PropTypes.bool,
269
269
  sortMethod: PropTypes.func,
270
- cancelButtonProps: PropTypes.object
270
+ cancelButtonProps: PropTypes.object,
271
+ className: PropTypes.string
271
272
  };
272
273
  TreeViewFinder.defaultProps = {
273
274
  defaultSelected: [],
@@ -88,7 +88,7 @@ const DirectoryItemsInput = ({
88
88
  ) !== void 0) {
89
89
  snackError({
90
90
  messageTxt: "",
91
- headerId: "ElementAlreadyUsed"
91
+ headerId: "directory_items_input/ElementAlreadyUsed"
92
92
  });
93
93
  } else {
94
94
  append(otherElementAttributes);
@@ -0,0 +1,10 @@
1
+ export default directory_items_input_en;
2
+ /**
3
+ * Copyright (c) 2024, RTE (http://www.rte-france.com)
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
+ */
8
+ declare const directory_items_input_en: {
9
+ 'directory_items_input/ElementAlreadyUsed': string;
10
+ };
@@ -0,0 +1,6 @@
1
+ const directory_items_input_en = {
2
+ "directory_items_input/ElementAlreadyUsed": "This element is already used"
3
+ };
4
+ export {
5
+ directory_items_input_en as default
6
+ };
@@ -0,0 +1,10 @@
1
+ export default directory_items_input_fr;
2
+ /**
3
+ * Copyright (c) 2024, RTE (http://www.rte-france.com)
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
+ */
8
+ declare const directory_items_input_fr: {
9
+ 'directory_items_input/ElementAlreadyUsed': string;
10
+ };
@@ -0,0 +1,6 @@
1
+ const directory_items_input_fr = {
2
+ "directory_items_input/ElementAlreadyUsed": "Cet élément est déjà utilisé"
3
+ };
4
+ export {
5
+ directory_items_input_fr as default
6
+ };
@@ -2,7 +2,7 @@ const login_en = {
2
2
  "login/login": "Login",
3
3
  "login/connection": "Connection",
4
4
  "login/unauthorizedAccess": "Unauthorized access",
5
- "login/unauthorizedAccessMessage": "The user {userName} isn't granted yet",
5
+ "login/unauthorizedAccessMessage": "The user {userName} does not have permission to access GridSuite yet.",
6
6
  "login/errorInUserValidation": "Error during user validation",
7
7
  "login/errorInUserValidationMessage": "An unexpected error occured during user validation for {userName}.",
8
8
  "login/errorInLogout": "Error during user logout",
package/dist/index.js CHANGED
@@ -39,77 +39,81 @@ import { default as default30 } from "./components/translations/multiple-selecti
39
39
  import { default as default31 } from "./components/translations/multiple-selection-dialog-fr.js";
40
40
  import { default as default32 } from "./components/translations/common-button-en.js";
41
41
  import { default as default33 } from "./components/translations/common-button-fr.js";
42
+ import { default as default34 } from "./components/translations/directory-items-input-en.js";
43
+ import { default as default35 } from "./components/translations/directory-items-input-fr.js";
42
44
  import { EquipmentItem } from "./components/ElementSearchDialog/equipment-item.js";
43
- import { default as default34 } from "./components/CardErrorBoundary/card-error-boundary.js";
45
+ import { default as default36 } from "./components/CardErrorBoundary/card-error-boundary.js";
44
46
  import { useIntlRef } from "./hooks/useIntlRef.js";
45
47
  import { useSnackMessage } from "./hooks/useSnackMessage.js";
46
48
  import { useDebounce } from "./hooks/useDebounce.js";
47
- import { default as default35 } from "./components/react-hook-form/autocomplete-input.js";
48
- import { default as default36 } from "./components/react-hook-form/text-input.js";
49
- import { default as default37 } from "./components/react-hook-form/radio-input.js";
50
- import { default as default38 } from "./components/react-hook-form/slider-input.js";
51
- import { default as default39 } from "./components/react-hook-form/numbers/float-input.js";
52
- import { default as default40 } from "./components/react-hook-form/numbers/integer-input.js";
53
- import { default as default41 } from "./components/react-hook-form/select-input.js";
54
- import { default as default42 } from "./components/react-hook-form/booleans/checkbox-input.js";
55
- import { default as default43 } from "./components/react-hook-form/booleans/switch-input.js";
56
- import { default as default44 } from "./components/react-hook-form/error-management/error-input.js";
57
- import { default as default45 } from "./components/react-hook-form/error-management/field-error-alert.js";
58
- import { default as default46 } from "./components/react-hook-form/error-management/mid-form-error.js";
59
- import { default as default47 } from "./components/react-hook-form/utils/text-field-with-adornment.js";
60
- import { default as default48 } from "./components/react-hook-form/utils/field-label.js";
61
- import { default as default49 } from "./components/react-hook-form/utils/submit-button.js";
62
- import { default as default50 } from "./components/react-hook-form/utils/cancel-button.js";
49
+ import { default as default37 } from "./components/react-hook-form/autocomplete-input.js";
50
+ import { default as default38 } from "./components/react-hook-form/text-input.js";
51
+ import { default as default39 } from "./components/react-hook-form/radio-input.js";
52
+ import { default as default40 } from "./components/react-hook-form/slider-input.js";
53
+ import { default as default41 } from "./components/react-hook-form/numbers/float-input.js";
54
+ import { default as default42 } from "./components/react-hook-form/numbers/integer-input.js";
55
+ import { default as default43 } from "./components/react-hook-form/select-input.js";
56
+ import { default as default44 } from "./components/react-hook-form/booleans/checkbox-input.js";
57
+ import { default as default45 } from "./components/react-hook-form/booleans/switch-input.js";
58
+ import { default as default46 } from "./components/react-hook-form/error-management/error-input.js";
59
+ import { default as default47 } from "./components/react-hook-form/error-management/field-error-alert.js";
60
+ import { default as default48 } from "./components/react-hook-form/error-management/mid-form-error.js";
61
+ import { default as default49 } from "./components/react-hook-form/utils/text-field-with-adornment.js";
62
+ import { default as default50 } from "./components/react-hook-form/utils/field-label.js";
63
+ import { default as default51 } from "./components/react-hook-form/utils/submit-button.js";
64
+ import { default as default52 } from "./components/react-hook-form/utils/cancel-button.js";
63
65
  import { genHelperError, genHelperPreviousValue, identity, isFieldRequired } from "./components/react-hook-form/utils/functions.js";
64
- import { default as default51 } from "./components/react-hook-form/directory-items-input.js";
65
- import { default as default52 } from "./components/DirectoryItemSelector/directory-item-selector.js";
66
+ import { default as default53 } from "./components/react-hook-form/directory-items-input.js";
67
+ import { default as default54 } from "./components/DirectoryItemSelector/directory-item-selector.js";
68
+ import { RawReadOnlyInput } from "./components/react-hook-form/raw-read-only-input.js";
66
69
  export {
67
70
  default4 as AboutDialog,
68
71
  default6 as AuthenticationRouter,
69
- default35 as AutocompleteInput,
72
+ default37 as AutocompleteInput,
70
73
  CHANGE_WAYS,
71
- default50 as CancelButton,
72
- default34 as CardErrorBoundary,
73
- default42 as CheckboxInput,
74
+ default52 as CancelButton,
75
+ default36 as CardErrorBoundary,
76
+ default44 as CheckboxInput,
74
77
  DARK_THEME,
75
78
  DEFAULT_CELL_PADDING,
76
79
  DEFAULT_HEADER_HEIGHT,
77
80
  DEFAULT_ROW_HEIGHT,
78
- default52 as DirectoryItemSelector,
79
- default51 as DirectoryItemsInput,
81
+ default54 as DirectoryItemSelector,
82
+ default53 as DirectoryItemsInput,
80
83
  EQUIPMENT_TYPE,
81
84
  default10 as ElementSearchDialog,
82
85
  EquipmentItem,
83
- default44 as ErrorInput,
84
- default45 as FieldErrorAlert,
85
- default48 as FieldLabel,
86
+ default46 as ErrorInput,
87
+ default47 as FieldErrorAlert,
88
+ default50 as FieldLabel,
86
89
  FlatParameters,
87
- default39 as FloatInput,
88
- default40 as IntegerInput,
90
+ default41 as FloatInput,
91
+ default42 as IntegerInput,
89
92
  KeyedColumnsRowIndexer,
90
93
  LANG_ENGLISH,
91
94
  LANG_FRENCH,
92
95
  LANG_SYSTEM,
93
96
  LIGHT_THEME,
94
97
  LOGOUT_ERROR,
95
- default46 as MidFormError,
98
+ default48 as MidFormError,
96
99
  default7 as MuiVirtualizedTable,
97
100
  default11 as MultipleSelectionDialog,
98
101
  OverflowableText,
99
102
  RESET_AUTHENTICATION_ROUTER_ERROR,
100
- default37 as RadioInput,
103
+ default39 as RadioInput,
104
+ RawReadOnlyInput,
101
105
  default8 as ReportViewer,
102
106
  default9 as ReportViewerDialog,
103
107
  SHOW_AUTH_INFO_LOGIN,
104
108
  SIGNIN_CALLBACK_ERROR,
105
- default41 as SelectInput,
106
- default38 as SliderInput,
109
+ default43 as SelectInput,
110
+ default40 as SliderInput,
107
111
  default5 as SnackbarProvider,
108
- default49 as SubmitButton,
109
- default43 as SwitchInput,
112
+ default51 as SubmitButton,
113
+ default45 as SwitchInput,
110
114
  TagRenderer,
111
- default47 as TextFieldWithAdornment,
112
- default36 as TextInput,
115
+ default49 as TextFieldWithAdornment,
116
+ default38 as TextInput,
113
117
  default3 as TopBar,
114
118
  default2 as TreeViewFinder,
115
119
  UNAUTHORIZED_USER_INFO,
@@ -119,6 +123,8 @@ export {
119
123
  default27 as card_error_boundary_fr,
120
124
  default32 as common_button_en,
121
125
  default33 as common_button_fr,
126
+ default34 as directory_items_input_en,
127
+ default35 as directory_items_input_fr,
122
128
  dispatchUser,
123
129
  elementType,
124
130
  default22 as element_search_en,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",
@@ -14,8 +14,9 @@
14
14
  ],
15
15
  "scripts": {
16
16
  "start": "vite demo/ --config vite.config.mts",
17
- "build": "npm install && tsc && vite build && npm prune --production",
18
- "build:only": "vite build",
17
+ "start:open": "vite demo/ --config vite.config.mts --open",
18
+ "build": "tsc && vite build",
19
+ "build:prune": "npm install && tsc && vite build && npm prune --production",
19
20
  "prepublishOnly": "npm run build",
20
21
  "test": "jest",
21
22
  "test:coverage": "jest --coverage",