@gridsuite/commons-ui 0.63.0 → 0.63.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -234,6 +234,7 @@ export declare const FIELDS_OPTIONS: {
234
234
  name: FieldType;
235
235
  label: string;
236
236
  dataType: DataType;
237
+ defaultValue: boolean;
237
238
  valueEditorType: string;
238
239
  };
239
240
  PLANNED_ACTIVE_POWER_SET_POINT: {
@@ -246,6 +247,7 @@ export declare const FIELDS_OPTIONS: {
246
247
  name: FieldType;
247
248
  label: string;
248
249
  dataType: DataType;
250
+ defaultValue: boolean;
249
251
  valueEditorType: string;
250
252
  };
251
253
  RATED_S: {
@@ -370,12 +372,14 @@ export declare const FIELDS_OPTIONS: {
370
372
  name: FieldType;
371
373
  label: string;
372
374
  dataType: DataType;
375
+ defaultValue: boolean;
373
376
  valueEditorType: string;
374
377
  };
375
378
  CONNECTED_2: {
376
379
  name: FieldType;
377
380
  label: string;
378
381
  dataType: DataType;
382
+ defaultValue: boolean;
379
383
  valueEditorType: string;
380
384
  };
381
385
  VOLTAGE_LEVEL_ID_1: {
@@ -489,12 +493,14 @@ export declare const FIELDS_OPTIONS: {
489
493
  name: FieldType;
490
494
  label: string;
491
495
  dataType: DataType;
496
+ defaultValue: boolean;
492
497
  valueEditorType: string;
493
498
  };
494
499
  LOAD_TAP_CHANGING_CAPABILITIES: {
495
500
  name: FieldType;
496
501
  label: string;
497
502
  dataType: DataType;
503
+ defaultValue: boolean;
498
504
  valueEditorType: string;
499
505
  };
500
506
  RATIO_REGULATION_MODE: {
@@ -518,6 +524,7 @@ export declare const FIELDS_OPTIONS: {
518
524
  name: FieldType;
519
525
  label: string;
520
526
  dataType: DataType;
527
+ defaultValue: boolean;
521
528
  valueEditorType: string;
522
529
  };
523
530
  PHASE_REGULATION_MODE: {
@@ -218,6 +218,7 @@ const FIELDS_OPTIONS = {
218
218
  name: FieldType.VOLTAGE_REGULATOR_ON,
219
219
  label: "voltageRegulatorOn",
220
220
  dataType: DataType.BOOLEAN,
221
+ defaultValue: false,
221
222
  valueEditorType: "switch"
222
223
  },
223
224
  PLANNED_ACTIVE_POWER_SET_POINT: {
@@ -230,6 +231,7 @@ const FIELDS_OPTIONS = {
230
231
  name: FieldType.CONNECTED,
231
232
  label: "connected",
232
233
  dataType: DataType.BOOLEAN,
234
+ defaultValue: false,
233
235
  valueEditorType: "switch"
234
236
  },
235
237
  RATED_S: {
@@ -351,12 +353,14 @@ const FIELDS_OPTIONS = {
351
353
  name: FieldType.CONNECTED_1,
352
354
  label: "terminal1Connected",
353
355
  dataType: DataType.BOOLEAN,
356
+ defaultValue: false,
354
357
  valueEditorType: "switch"
355
358
  },
356
359
  CONNECTED_2: {
357
360
  name: FieldType.CONNECTED_2,
358
361
  label: "terminal2Connected",
359
362
  dataType: DataType.BOOLEAN,
363
+ defaultValue: false,
360
364
  valueEditorType: "switch"
361
365
  },
362
366
  VOLTAGE_LEVEL_ID_1: {
@@ -467,12 +471,14 @@ const FIELDS_OPTIONS = {
467
471
  name: FieldType.HAS_RATIO_TAP_CHANGER,
468
472
  label: "hasRatioTapChanger",
469
473
  dataType: DataType.BOOLEAN,
474
+ defaultValue: false,
470
475
  valueEditorType: "switch"
471
476
  },
472
477
  LOAD_TAP_CHANGING_CAPABILITIES: {
473
478
  name: FieldType.LOAD_TAP_CHANGING_CAPABILITIES,
474
479
  label: "loadTapChangingCapabilities",
475
480
  dataType: DataType.BOOLEAN,
481
+ defaultValue: false,
476
482
  valueEditorType: "switch"
477
483
  },
478
484
  RATIO_REGULATION_MODE: {
@@ -493,6 +499,7 @@ const FIELDS_OPTIONS = {
493
499
  name: FieldType.HAS_PHASE_TAP_CHANGER,
494
500
  label: "hasPhaseTapChanger",
495
501
  dataType: DataType.BOOLEAN,
502
+ defaultValue: false,
496
503
  valueEditorType: "switch"
497
504
  },
498
505
  PHASE_REGULATION_MODE: {
@@ -2,6 +2,7 @@ import { FieldType } from './expert-filter.type';
2
2
 
3
3
  import * as yup from 'yup';
4
4
  export declare const EXPERT_FILTER_QUERY = "rules";
5
+ export declare const rqbQuerySchemaValidator: (schema: yup.Schema) => yup.Schema<any, any, any, "">;
5
6
  export declare const expertFilterSchema: {
6
7
  rules: yup.ObjectSchema<{}, yup.AnyObject, {}, "">;
7
8
  };
@@ -8,7 +8,7 @@ import * as yup from "yup";
8
8
  import { v4 } from "uuid";
9
9
  import { useIntl } from "react-intl";
10
10
  import { testQuery } from "./expert-filter-utils.js";
11
- import { RULES, COMBINATOR_OPTIONS, OPERATOR_OPTIONS, EXPERT_FILTER_EQUIPMENTS, fields } from "./expert-filter-constants.js";
11
+ import { COMBINATOR_OPTIONS, OPERATOR_OPTIONS, EXPERT_FILTER_EQUIPMENTS, RULES, fields } from "./expert-filter-constants.js";
12
12
  import { FieldType } from "./expert-filter.type.js";
13
13
  import FieldConstants from "../../../utils/field-constants.js";
14
14
  import InputWithPopupConfirmation from "../../inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
@@ -30,48 +30,21 @@ const EXPERT_FILTER_QUERY = "rules";
30
30
  function isSupportedEquipmentType(equipmentType) {
31
31
  return Object.values(EXPERT_FILTER_EQUIPMENTS).map((equipments) => equipments.id).includes(equipmentType);
32
32
  }
33
+ const rqbQuerySchemaValidator = (schema) => schema.test(RULES.EMPTY_GROUP, RULES.EMPTY_GROUP, (query) => {
34
+ return testQuery(RULES.EMPTY_GROUP, query);
35
+ }).test(RULES.EMPTY_RULE, RULES.EMPTY_RULE, (query) => {
36
+ return testQuery(RULES.EMPTY_RULE, query);
37
+ }).test(RULES.INCORRECT_RULE, RULES.INCORRECT_RULE, (query) => {
38
+ return testQuery(RULES.INCORRECT_RULE, query);
39
+ }).test(RULES.BETWEEN_RULE, RULES.BETWEEN_RULE, (query) => {
40
+ return testQuery(RULES.BETWEEN_RULE, query);
41
+ });
33
42
  const expertFilterSchema = {
34
43
  [EXPERT_FILTER_QUERY]: yup.object().when([FieldConstants.FILTER_TYPE], {
35
44
  is: FilterType.EXPERT.id,
36
45
  then: (schema) => schema.when([FieldConstants.EQUIPMENT_TYPE], {
37
46
  is: (equipmentType) => isSupportedEquipmentType(equipmentType),
38
- then: (innerSchema) => innerSchema.test(
39
- RULES.EMPTY_GROUP,
40
- RULES.EMPTY_GROUP,
41
- (query) => {
42
- return testQuery(
43
- RULES.EMPTY_GROUP,
44
- query
45
- );
46
- }
47
- ).test(
48
- RULES.EMPTY_RULE,
49
- RULES.EMPTY_RULE,
50
- (query) => {
51
- return testQuery(
52
- RULES.EMPTY_RULE,
53
- query
54
- );
55
- }
56
- ).test(
57
- RULES.INCORRECT_RULE,
58
- RULES.INCORRECT_RULE,
59
- (query) => {
60
- return testQuery(
61
- RULES.INCORRECT_RULE,
62
- query
63
- );
64
- }
65
- ).test(
66
- RULES.BETWEEN_RULE,
67
- RULES.BETWEEN_RULE,
68
- (query) => {
69
- return testQuery(
70
- RULES.BETWEEN_RULE,
71
- query
72
- );
73
- }
74
- )
47
+ then: rqbQuerySchemaValidator
75
48
  })
76
49
  })
77
50
  };
@@ -139,5 +112,6 @@ export {
139
112
  EXPERT_FILTER_QUERY,
140
113
  ExpertFilterForm as default,
141
114
  expertFilterSchema,
142
- getExpertFilterEmptyFormData
115
+ getExpertFilterEmptyFormData,
116
+ rqbQuerySchemaValidator
143
117
  };
@@ -149,6 +149,7 @@ function exportExpertRules(query) {
149
149
  return transformCompositeRule(rule);
150
150
  }
151
151
  return {
152
+ id: rule.id,
152
153
  field: rule.field,
153
154
  operator: dataType !== DataType.PROPERTY ? (_a = Object.values(OPERATOR_OPTIONS).find(
154
155
  (operator) => operator.name === rule.operator
@@ -172,6 +173,7 @@ function exportExpertRules(query) {
172
173
  })
173
174
  );
174
175
  return {
176
+ id: compositeGroup.id,
175
177
  combinator: compositeGroup.combinator,
176
178
  dataType: DataType.COMBINATOR,
177
179
  rules: transformedRules,
@@ -190,6 +192,7 @@ function exportExpertRules(query) {
190
192
  return transformRule(ruleOrGroup);
191
193
  });
192
194
  return {
195
+ id: group.id,
193
196
  combinator: group.combinator,
194
197
  dataType: DataType.COMBINATOR,
195
198
  rules: transformedRules
@@ -219,6 +222,7 @@ function importExpertRules(query) {
219
222
  function transformRule(rule) {
220
223
  var _a;
221
224
  return {
225
+ id: rule.id,
222
226
  field: rule.field,
223
227
  operator: rule.dataType !== DataType.PROPERTY ? (_a = Object.values(OPERATOR_OPTIONS).find(
224
228
  (operator) => operator.customName === rule.operator
@@ -239,6 +243,7 @@ function importExpertRules(query) {
239
243
  {}
240
244
  );
241
245
  return {
246
+ id: group.id,
242
247
  field: group.field,
243
248
  operator: (_a = Object.values(OPERATOR_OPTIONS).find(
244
249
  (operator) => operator.customName === group.operator
@@ -260,6 +265,7 @@ function importExpertRules(query) {
260
265
  return transformRule(ruleOrGroup);
261
266
  });
262
267
  return {
268
+ id: group.id,
263
269
  combinator: group.combinator,
264
270
  rules: transformedRules
265
271
  };
@@ -267,6 +273,9 @@ function importExpertRules(query) {
267
273
  return transformGroup(query);
268
274
  }
269
275
  function countRules(query) {
276
+ if (!query) {
277
+ return 0;
278
+ }
270
279
  if ("rules" in query) {
271
280
  const group = query;
272
281
  return group.rules.reduce(
@@ -278,6 +287,9 @@ function countRules(query) {
278
287
  }
279
288
  const queryValidator = (query) => {
280
289
  const result = {};
290
+ if (!query) {
291
+ return result;
292
+ }
281
293
  const validateRule = (rule) => {
282
294
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
283
295
  const isValueAnArray = Array.isArray(rule.value);
@@ -382,9 +394,10 @@ const testQuery = (check, query) => {
382
394
  });
383
395
  };
384
396
  function getNumberOfSiblings(path, query) {
397
+ var _a;
385
398
  const parentPath = getParentPath(path);
386
399
  const parentGroup = findPath(parentPath, query);
387
- return parentGroup.rules.length;
400
+ return (_a = parentGroup == null ? void 0 : parentGroup.rules) == null ? void 0 : _a.length;
388
401
  }
389
402
  function recursiveRemove(query, path) {
390
403
  if (getNumberOfSiblings(path, query) === 1 && path.toString() !== [0].toString()) {
@@ -1,3 +1,4 @@
1
+ import { UUID } from 'crypto';
1
2
  import { FullField } from 'react-querybuilder';
2
3
 
3
4
  export declare enum OperatorType {
@@ -117,6 +118,7 @@ export type OperatorOption = {
117
118
  label: string;
118
119
  };
119
120
  export interface RuleTypeExport {
121
+ id?: UUID;
120
122
  field: FieldType;
121
123
  operator: OperatorType;
122
124
  value: string | number | undefined;
@@ -126,6 +128,7 @@ export interface RuleTypeExport {
126
128
  propertyValues?: string[];
127
129
  }
128
130
  export interface RuleGroupTypeExport {
131
+ id?: UUID;
129
132
  combinator: CombinatorType;
130
133
  dataType: DataType;
131
134
  field?: FieldType;
@@ -139,6 +142,7 @@ export interface CompositeField extends FullField {
139
142
  };
140
143
  }
141
144
  export interface CompositeGroup {
145
+ id?: string;
142
146
  combinator: string;
143
147
  rules: {
144
148
  [field: string]: CompositeRule;
@@ -0,0 +1,2 @@
1
+ export declare function usePrevious<T = undefined>(value: T): T | undefined;
2
+ export default usePrevious;
@@ -0,0 +1,12 @@
1
+ import { useRef, useEffect } from "react";
2
+ function usePrevious(value) {
3
+ const ref = useRef();
4
+ useEffect(() => {
5
+ ref.current = value;
6
+ }, [value]);
7
+ return ref.current;
8
+ }
9
+ export {
10
+ usePrevious as default,
11
+ usePrevious
12
+ };
package/dist/index.d.ts CHANGED
@@ -31,6 +31,13 @@ export { ROW_DRAGGING_SELECTION_COLUMN_DEF } from './components/inputs/react-hoo
31
31
  export type { Parameter } from './components/FlatParameters/FlatParameters';
32
32
  export { Line, Generator, Load, Battery, SVC, DanglingLine, LCC, VSC, Hvdc, BusBar, TwoWindingTransfo, ThreeWindingTransfo, ShuntCompensator, VoltageLevel, Substation, noSelectionForCopy, } from './utils/equipment-types';
33
33
  export { default as FieldConstants } from './utils/field-constants';
34
+ export { fields as EXPERT_FILTER_FIELDS } from './components/filter/expert/expert-filter-constants';
35
+ export { default as CustomReactQueryBuilder } from './components/inputs/react-query-builder/custom-react-query-builder';
36
+ export { EXPERT_FILTER_QUERY, rqbQuerySchemaValidator, getExpertFilterEmptyFormData, } from './components/filter/expert/expert-filter-form';
37
+ export { importExpertRules, exportExpertRules, } from './components/filter/expert/expert-filter-utils';
38
+ export type { RuleTypeExport, RuleGroupTypeExport, } from './components/filter/expert/expert-filter.type';
39
+ export { formatQuery } from 'react-querybuilder';
40
+ export { default as yup } from './utils/yup-config';
34
41
  export type { TreeViewFinderNodeProps } from './components/TreeViewFinder/TreeViewFinder';
35
42
  export { GRIDSUITE_DEFAULT_PRECISION, roundToPrecision, roundToDefaultPrecision, isBlankOrEmpty, unitToMicroUnit, microUnitToUnit, } from './utils/conversion-utils';
36
43
  export { ElementType } from './utils/ElementType';
@@ -78,6 +85,7 @@ export { default as CardErrorBoundary } from './components/CardErrorBoundary';
78
85
  export { default as useIntlRef } from './hooks/useIntlRef';
79
86
  export { useSnackMessage } from './hooks/useSnackMessage';
80
87
  export { default as useDebounce } from './hooks/useDebounce';
88
+ export { default as usePrevious } from './hooks/usePrevious';
81
89
  export { default as SelectClearable } from './components/inputs/select-clearable';
82
90
  export { default as useCustomFormContext } from './components/inputs/react-hook-form/provider/use-custom-form-context';
83
91
  export { default as CustomFormProvider } from './components/inputs/react-hook-form/provider/custom-form-provider';
package/dist/index.js CHANGED
@@ -28,85 +28,92 @@ import { default as default19 } from "./components/inputs/react-hook-form/ag-gri
28
28
  import { default as default20, ROW_DRAGGING_SELECTION_COLUMN_DEF } from "./components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js";
29
29
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel, noSelectionForCopy } from "./utils/equipment-types.js";
30
30
  import { default as default21 } from "./utils/field-constants.js";
31
+ import { fields } from "./components/filter/expert/expert-filter-constants.js";
32
+ import { default as default22 } from "./components/inputs/react-query-builder/custom-react-query-builder.js";
33
+ import { EXPERT_FILTER_QUERY, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./components/filter/expert/expert-filter-form.js";
34
+ import { exportExpertRules, importExpertRules } from "./components/filter/expert/expert-filter-utils.js";
35
+ import { formatQuery } from "react-querybuilder";
36
+ import "./utils/yup-config.js";
31
37
  import { GRIDSUITE_DEFAULT_PRECISION, isBlankOrEmpty, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToMicroUnit } from "./utils/conversion-utils.js";
32
38
  import { ElementType } from "./utils/ElementType.js";
33
39
  import { EQUIPMENT_TYPE, EquipmentType, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/EquipmentType.js";
34
40
  import { dispatchUser, getPreLoginPath, initializeAuthenticationDev, initializeAuthenticationProd, logout } from "./utils/AuthService.js";
35
- import { default as default22 } from "./utils/ElementIcon.js";
41
+ import { default as default23 } from "./utils/ElementIcon.js";
36
42
  import { LOGOUT_ERROR, RESET_AUTHENTICATION_ROUTER_ERROR, SHOW_AUTH_INFO_LOGIN, SIGNIN_CALLBACK_ERROR, UNAUTHORIZED_USER_INFO, USER, USER_VALIDATION_ERROR, setLoggedUser, setSignInCallbackError } from "./redux/authActions.js";
37
- import { default as default23 } from "./components/translations/report-viewer-en.js";
38
- import { default as default24 } from "./components/translations/report-viewer-fr.js";
39
- import { default as default25 } from "./components/translations/login-en.js";
40
- import { default as default26 } from "./components/translations/login-fr.js";
41
- import { default as default27 } from "./components/translations/top-bar-en.js";
42
- import { default as default28 } from "./components/translations/top-bar-fr.js";
43
- import { default as default29 } from "./components/translations/table-en.js";
44
- import { default as default30 } from "./components/translations/table-fr.js";
45
- import { default as default31 } from "./components/translations/treeview-finder-en.js";
46
- import { default as default32 } from "./components/translations/treeview-finder-fr.js";
47
- import { default as default33 } from "./components/translations/element-search-en.js";
48
- import { default as default34 } from "./components/translations/element-search-fr.js";
49
- import { default as default35 } from "./components/translations/equipment-search-en.js";
50
- import { default as default36 } from "./components/translations/equipment-search-fr.js";
51
- import { default as default37 } from "./components/translations/filter-en.js";
52
- import { default as default38 } from "./components/translations/filter-fr.js";
53
- import { default as default39 } from "./components/translations/filter-expert-en.js";
54
- import { default as default40 } from "./components/translations/filter-expert-fr.js";
55
- import { default as default41 } from "./components/translations/card-error-boundary-en.js";
56
- import { default as default42 } from "./components/translations/card-error-boundary-fr.js";
57
- import { default as default43 } from "./components/translations/flat-parameters-en.js";
58
- import { default as default44 } from "./components/translations/flat-parameters-fr.js";
59
- import { default as default45 } from "./components/translations/multiple-selection-dialog-en.js";
60
- import { default as default46 } from "./components/translations/multiple-selection-dialog-fr.js";
61
- import { default as default47 } from "./components/translations/common-button-en.js";
62
- import { default as default48 } from "./components/translations/common-button-fr.js";
63
- import { default as default49 } from "./components/translations/directory-items-input-en.js";
64
- import { default as default50 } from "./components/translations/directory-items-input-fr.js";
43
+ import { default as default24 } from "./components/translations/report-viewer-en.js";
44
+ import { default as default25 } from "./components/translations/report-viewer-fr.js";
45
+ import { default as default26 } from "./components/translations/login-en.js";
46
+ import { default as default27 } from "./components/translations/login-fr.js";
47
+ import { default as default28 } from "./components/translations/top-bar-en.js";
48
+ import { default as default29 } from "./components/translations/top-bar-fr.js";
49
+ import { default as default30 } from "./components/translations/table-en.js";
50
+ import { default as default31 } from "./components/translations/table-fr.js";
51
+ import { default as default32 } from "./components/translations/treeview-finder-en.js";
52
+ import { default as default33 } from "./components/translations/treeview-finder-fr.js";
53
+ import { default as default34 } from "./components/translations/element-search-en.js";
54
+ import { default as default35 } from "./components/translations/element-search-fr.js";
55
+ import { default as default36 } from "./components/translations/equipment-search-en.js";
56
+ import { default as default37 } from "./components/translations/equipment-search-fr.js";
57
+ import { default as default38 } from "./components/translations/filter-en.js";
58
+ import { default as default39 } from "./components/translations/filter-fr.js";
59
+ import { default as default40 } from "./components/translations/filter-expert-en.js";
60
+ import { default as default41 } from "./components/translations/filter-expert-fr.js";
61
+ import { default as default42 } from "./components/translations/card-error-boundary-en.js";
62
+ import { default as default43 } from "./components/translations/card-error-boundary-fr.js";
63
+ import { default as default44 } from "./components/translations/flat-parameters-en.js";
64
+ import { default as default45 } from "./components/translations/flat-parameters-fr.js";
65
+ import { default as default46 } from "./components/translations/multiple-selection-dialog-en.js";
66
+ import { default as default47 } from "./components/translations/multiple-selection-dialog-fr.js";
67
+ import { default as default48 } from "./components/translations/common-button-en.js";
68
+ import { default as default49 } from "./components/translations/common-button-fr.js";
69
+ import { default as default50 } from "./components/translations/directory-items-input-en.js";
70
+ import { default as default51 } from "./components/translations/directory-items-input-fr.js";
65
71
  import { EquipmentItem } from "./components/ElementSearchDialog/equipment-item.js";
66
- import { default as default51 } from "./components/CardErrorBoundary/card-error-boundary.js";
67
- import { default as default52 } from "./hooks/useIntlRef.js";
72
+ import { default as default52 } from "./components/CardErrorBoundary/card-error-boundary.js";
73
+ import { default as default53 } from "./hooks/useIntlRef.js";
68
74
  import { useSnackMessage } from "./hooks/useSnackMessage.js";
69
- import { default as default53 } from "./hooks/useDebounce.js";
70
- import { default as default54 } from "./components/inputs/select-clearable.js";
71
- import { default as default55 } from "./components/inputs/react-hook-form/provider/use-custom-form-context.js";
72
- import { default as default56 } from "./components/inputs/react-hook-form/provider/custom-form-provider.js";
73
- import { default as default57 } from "./components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js";
74
- import { default as default58 } from "./components/inputs/react-hook-form/text-input.js";
75
- import { default as default59 } from "./components/inputs/react-hook-form/ExpandingTextField.js";
76
- import { default as default60 } from "./components/inputs/react-hook-form/radio-input.js";
77
- import { default as default61 } from "./components/inputs/react-hook-form/slider-input.js";
78
- import { default as default62 } from "./components/inputs/react-hook-form/numbers/float-input.js";
79
- import { default as default63 } from "./components/inputs/react-hook-form/numbers/integer-input.js";
80
- import { default as default64 } from "./components/inputs/react-hook-form/select-inputs/select-input.js";
81
- import { default as default65 } from "./components/inputs/react-hook-form/booleans/checkbox-input.js";
82
- import { default as default66 } from "./components/inputs/react-hook-form/booleans/switch-input.js";
83
- import { default as default67 } from "./components/inputs/react-hook-form/error-management/error-input.js";
84
- import { default as default68 } from "./components/inputs/react-hook-form/error-management/field-error-alert.js";
85
- import { default as default69 } from "./components/inputs/react-hook-form/error-management/mid-form-error.js";
86
- import { default as default70 } from "./components/inputs/react-hook-form/utils/text-field-with-adornment.js";
87
- import { default as default71 } from "./components/inputs/react-hook-form/utils/field-label.js";
88
- import { default as default72 } from "./components/inputs/react-hook-form/utils/submit-button.js";
89
- import { default as default73 } from "./components/inputs/react-hook-form/utils/cancel-button.js";
75
+ import { default as default54 } from "./hooks/useDebounce.js";
76
+ import { usePrevious } from "./hooks/usePrevious.js";
77
+ import { default as default55 } from "./components/inputs/select-clearable.js";
78
+ import { default as default56 } from "./components/inputs/react-hook-form/provider/use-custom-form-context.js";
79
+ import { default as default57 } from "./components/inputs/react-hook-form/provider/custom-form-provider.js";
80
+ import { default as default58 } from "./components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js";
81
+ import { default as default59 } from "./components/inputs/react-hook-form/text-input.js";
82
+ import { default as default60 } from "./components/inputs/react-hook-form/ExpandingTextField.js";
83
+ import { default as default61 } from "./components/inputs/react-hook-form/radio-input.js";
84
+ import { default as default62 } from "./components/inputs/react-hook-form/slider-input.js";
85
+ import { default as default63 } from "./components/inputs/react-hook-form/numbers/float-input.js";
86
+ import { default as default64 } from "./components/inputs/react-hook-form/numbers/integer-input.js";
87
+ import { default as default65 } from "./components/inputs/react-hook-form/select-inputs/select-input.js";
88
+ import { default as default66 } from "./components/inputs/react-hook-form/booleans/checkbox-input.js";
89
+ import { default as default67 } from "./components/inputs/react-hook-form/booleans/switch-input.js";
90
+ import { default as default68 } from "./components/inputs/react-hook-form/error-management/error-input.js";
91
+ import { default as default69 } from "./components/inputs/react-hook-form/error-management/field-error-alert.js";
92
+ import { default as default70 } from "./components/inputs/react-hook-form/error-management/mid-form-error.js";
93
+ import { default as default71 } from "./components/inputs/react-hook-form/utils/text-field-with-adornment.js";
94
+ import { default as default72 } from "./components/inputs/react-hook-form/utils/field-label.js";
95
+ import { default as default73 } from "./components/inputs/react-hook-form/utils/submit-button.js";
96
+ import { default as default74 } from "./components/inputs/react-hook-form/utils/cancel-button.js";
90
97
  import { genHelperError, genHelperPreviousValue, gridItem, identity, isFieldRequired, isFloatNumber, toFloatOrNullValue } from "./components/inputs/react-hook-form/utils/functions.js";
91
98
  import { areArrayElementsUnique, isObjectEmpty, keyGenerator } from "./utils/functions.js";
92
- import { default as default74 } from "./components/inputs/react-hook-form/directory-items-input.js";
93
- import { default as default75 } from "./components/DirectoryItemSelector/directory-item-selector.js";
94
- import { default as default76 } from "./components/CustomAGGrid/custom-aggrid.js";
95
- import { default as default77 } from "./components/inputs/react-hook-form/raw-read-only-input.js";
96
- import { default as default78 } from "./components/filter/filter-creation-dialog.js";
97
- import { default as default79 } from "./components/filter/expert/expert-filter-edition-dialog.js";
98
- import { default as default80 } from "./components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js";
99
- import { default as default81 } from "./components/filter/criteria-based/criteria-based-filter-edition-dialog.js";
99
+ import { default as default75 } from "./components/inputs/react-hook-form/directory-items-input.js";
100
+ import { default as default76 } from "./components/DirectoryItemSelector/directory-item-selector.js";
101
+ import { default as default77 } from "./components/CustomAGGrid/custom-aggrid.js";
102
+ import { default as default78 } from "./components/inputs/react-hook-form/raw-read-only-input.js";
103
+ import { default as default79 } from "./components/filter/filter-creation-dialog.js";
104
+ import { default as default80 } from "./components/filter/expert/expert-filter-edition-dialog.js";
105
+ import { default as default81 } from "./components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js";
106
+ import { default as default82 } from "./components/filter/criteria-based/criteria-based-filter-edition-dialog.js";
100
107
  import { saveCriteriaBasedFilter, saveExpertFilter, saveExplicitNamingFilter } from "./components/filter/utils/filter-api.js";
101
- import { DEFAULT_RANGE_VALUE, default as default82, getRangeInputDataForm, getRangeInputSchema } from "./components/inputs/react-hook-form/range-input.js";
102
- import { default as default83 } from "./components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
103
- import { default as default84 } from "./components/inputs/react-hook-form/select-inputs/mui-select-input.js";
104
- import { default as default85 } from "./components/inputs/react-hook-form/select-inputs/countries-input.js";
108
+ import { DEFAULT_RANGE_VALUE, default as default83, getRangeInputDataForm, getRangeInputSchema } from "./components/inputs/react-hook-form/range-input.js";
109
+ import { default as default84 } from "./components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
110
+ import { default as default85 } from "./components/inputs/react-hook-form/select-inputs/mui-select-input.js";
111
+ import { default as default86 } from "./components/inputs/react-hook-form/select-inputs/countries-input.js";
105
112
  import { getComputedLanguage, getSystemLanguage, useLocalizedCountries } from "./hooks/localized-countries-hook.js";
106
- import { default as default86 } from "./components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js";
107
- import { default as default87 } from "./components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js";
108
- import { default as default88 } from "./components/inputs/react-hook-form/unique-name-input.js";
109
- import { default as default89 } from "./utils/UserManagerMock.js";
113
+ import { default as default87 } from "./components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js";
114
+ import { default as default88 } from "./components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js";
115
+ import { default as default89 } from "./components/inputs/react-hook-form/unique-name-input.js";
116
+ import { default as default90 } from "./utils/UserManagerMock.js";
110
117
  import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./components/filter/utils/filter-form-utils.js";
111
118
  import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./components/filter/criteria-based/criteria-based-filter-utils.js";
112
119
  import { setCommonStore } from "./redux/commonStore.js";
@@ -115,26 +122,28 @@ import { createFilter, fetchElementsInfos, saveFilter } from "./services/explore
115
122
  import { fetchAppsMetadata, fetchEnv, fetchStudyMetadata } from "./services/apps-metadata.js";
116
123
  import { fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./services/directory.js";
117
124
  import { exportFilter } from "./services/study.js";
125
+ import * as yup from "yup";
118
126
  export {
119
127
  default4 as AboutDialog,
120
128
  default6 as AuthenticationRouter,
121
- default57 as AutocompleteInput,
129
+ default58 as AutocompleteInput,
122
130
  Battery,
123
131
  default19 as BottomRightButtons,
124
132
  BusBar,
125
133
  CONTINGENCY_LIST_EQUIPMENTS,
126
- default73 as CancelButton,
127
- default51 as CardErrorBoundary,
134
+ default74 as CancelButton,
135
+ default52 as CardErrorBoundary,
128
136
  ChangeWays,
129
- default65 as CheckboxInput,
130
- default85 as CountriesInput,
131
- default81 as CriteriaBasedFilterEditionDialog,
137
+ default66 as CheckboxInput,
138
+ default86 as CountriesInput,
139
+ default82 as CriteriaBasedFilterEditionDialog,
132
140
  default17 as CriteriaBasedForm,
133
- default87 as CsvUploader,
134
- default76 as CustomAGGrid,
141
+ default88 as CsvUploader,
142
+ default77 as CustomAGGrid,
135
143
  default20 as CustomAgGridTable,
136
- default56 as CustomFormProvider,
144
+ default57 as CustomFormProvider,
137
145
  default14 as CustomMuiDialog,
146
+ default22 as CustomReactQueryBuilder,
138
147
  DARK_THEME,
139
148
  DEFAULT_CELL_PADDING,
140
149
  DEFAULT_HEADER_HEIGHT,
@@ -142,31 +151,33 @@ export {
142
151
  DEFAULT_ROW_HEIGHT,
143
152
  DanglingLine,
144
153
  default15 as DescriptionModificationDialog,
145
- default75 as DirectoryItemSelector,
146
- default74 as DirectoryItemsInput,
154
+ default76 as DirectoryItemSelector,
155
+ default75 as DirectoryItemsInput,
147
156
  EQUIPMENT_TYPE,
157
+ fields as EXPERT_FILTER_FIELDS,
158
+ EXPERT_FILTER_QUERY,
148
159
  ElementSearchDialog,
149
160
  ElementSearchInput,
150
161
  ElementType,
151
162
  EquipmentItem,
152
163
  EquipmentType,
153
- default67 as ErrorInput,
164
+ default68 as ErrorInput,
154
165
  default12 as ExpandableGroup,
155
- default59 as ExpandingTextField,
156
- default79 as ExpertFilterEditionDialog,
157
- default80 as ExplicitNamingFilterEditionDialog,
166
+ default60 as ExpandingTextField,
167
+ default80 as ExpertFilterEditionDialog,
168
+ default81 as ExplicitNamingFilterEditionDialog,
158
169
  FILTER_EQUIPMENTS,
159
170
  default21 as FieldConstants,
160
- default68 as FieldErrorAlert,
161
- default71 as FieldLabel,
162
- default78 as FilterCreationDialog,
171
+ default69 as FieldErrorAlert,
172
+ default72 as FieldLabel,
173
+ default79 as FilterCreationDialog,
163
174
  FlatParameters,
164
- default62 as FloatInput,
175
+ default63 as FloatInput,
165
176
  GRIDSUITE_DEFAULT_PRECISION,
166
177
  Generator,
167
178
  Hvdc,
168
- default83 as InputWithPopupConfirmation,
169
- default63 as IntegerInput,
179
+ default84 as InputWithPopupConfirmation,
180
+ default64 as IntegerInput,
170
181
  KeyedColumnsRowIndexer,
171
182
  LANG_ENGLISH,
172
183
  LANG_FRENCH,
@@ -176,35 +187,35 @@ export {
176
187
  LOGOUT_ERROR,
177
188
  Line,
178
189
  Load,
179
- default69 as MidFormError,
190
+ default70 as MidFormError,
180
191
  default16 as ModifyElementSelection,
181
- default84 as MuiSelectInput,
192
+ default85 as MuiSelectInput,
182
193
  default7 as MuiVirtualizedTable,
183
- default86 as MultipleAutocompleteInput,
194
+ default87 as MultipleAutocompleteInput,
184
195
  default13 as MultipleSelectionDialog,
185
196
  OverflowableText,
186
197
  default18 as PopupConfirmationDialog,
187
198
  RESET_AUTHENTICATION_ROUTER_ERROR,
188
199
  ROW_DRAGGING_SELECTION_COLUMN_DEF,
189
- default60 as RadioInput,
190
- default82 as RangeInput,
191
- default77 as RawReadOnlyInput,
200
+ default61 as RadioInput,
201
+ default83 as RangeInput,
202
+ default78 as RawReadOnlyInput,
192
203
  default8 as ReportViewer,
193
204
  default9 as ReportViewerDialog,
194
205
  SHOW_AUTH_INFO_LOGIN,
195
206
  SIGNIN_CALLBACK_ERROR,
196
207
  SVC,
197
- default54 as SelectClearable,
198
- default64 as SelectInput,
208
+ default55 as SelectClearable,
209
+ default65 as SelectInput,
199
210
  ShuntCompensator,
200
- default61 as SliderInput,
211
+ default62 as SliderInput,
201
212
  default5 as SnackbarProvider,
202
- default72 as SubmitButton,
213
+ default73 as SubmitButton,
203
214
  Substation,
204
- default66 as SwitchInput,
215
+ default67 as SwitchInput,
205
216
  default10 as TagRenderer,
206
- default70 as TextFieldWithAdornment,
207
- default58 as TextInput,
217
+ default71 as TextFieldWithAdornment,
218
+ default59 as TextInput,
208
219
  ThreeWindingTransfo,
209
220
  default3 as TopBar,
210
221
  default2 as TreeViewFinder,
@@ -212,26 +223,27 @@ export {
212
223
  UNAUTHORIZED_USER_INFO,
213
224
  USER,
214
225
  USER_VALIDATION_ERROR,
215
- default88 as UniqueNameInput,
216
- default89 as UserManagerMock,
226
+ default89 as UniqueNameInput,
227
+ default90 as UserManagerMock,
217
228
  VSC,
218
229
  VoltageLevel,
219
230
  areArrayElementsUnique,
220
231
  backendFetch,
221
232
  backendFetchJson,
222
- default41 as card_error_boundary_en,
223
- default42 as card_error_boundary_fr,
224
- default47 as common_button_en,
225
- default48 as common_button_fr,
233
+ default42 as card_error_boundary_en,
234
+ default43 as card_error_boundary_fr,
235
+ default48 as common_button_en,
236
+ default49 as common_button_fr,
226
237
  createFilter,
227
- default49 as directory_items_input_en,
228
- default50 as directory_items_input_fr,
238
+ default50 as directory_items_input_en,
239
+ default51 as directory_items_input_fr,
229
240
  dispatchUser,
230
- default33 as element_search_en,
231
- default34 as element_search_fr,
241
+ default34 as element_search_en,
242
+ default35 as element_search_fr,
232
243
  equipmentStyles,
233
- default35 as equipment_search_en,
234
- default36 as equipment_search_fr,
244
+ default36 as equipment_search_en,
245
+ default37 as equipment_search_fr,
246
+ exportExpertRules,
235
247
  exportFilter,
236
248
  fetchAppsMetadata,
237
249
  fetchDirectoryContent,
@@ -240,19 +252,21 @@ export {
240
252
  fetchEnv,
241
253
  fetchRootFolders,
242
254
  fetchStudyMetadata,
243
- default37 as filter_en,
244
- default39 as filter_expert_en,
245
- default40 as filter_expert_fr,
246
- default38 as filter_fr,
247
- default43 as flat_parameters_en,
248
- default44 as flat_parameters_fr,
255
+ default38 as filter_en,
256
+ default40 as filter_expert_en,
257
+ default41 as filter_expert_fr,
258
+ default39 as filter_fr,
259
+ default44 as flat_parameters_en,
260
+ default45 as flat_parameters_fr,
261
+ formatQuery,
249
262
  genHelperError,
250
263
  genHelperPreviousValue,
251
264
  getComputedLanguage,
252
265
  getCriteriaBasedFormData,
253
266
  getCriteriaBasedSchema,
254
267
  getEquipmentsInfosForSearchBar,
255
- default22 as getFileIcon,
268
+ getExpertFilterEmptyFormData,
269
+ default23 as getFileIcon,
256
270
  getPreLoginPath,
257
271
  getRangeInputDataForm,
258
272
  getRangeInputSchema,
@@ -260,6 +274,7 @@ export {
260
274
  getSystemLanguage,
261
275
  gridItem,
262
276
  identity,
277
+ importExpertRules,
263
278
  initializeAuthenticationDev,
264
279
  initializeAuthenticationProd,
265
280
  isBlankOrEmpty,
@@ -267,18 +282,19 @@ export {
267
282
  isFloatNumber,
268
283
  isObjectEmpty,
269
284
  keyGenerator,
270
- default25 as login_en,
271
- default26 as login_fr,
285
+ default26 as login_en,
286
+ default27 as login_fr,
272
287
  logout,
273
288
  mergeSx,
274
289
  microUnitToUnit,
275
- default45 as multiple_selection_dialog_en,
276
- default46 as multiple_selection_dialog_fr,
290
+ default46 as multiple_selection_dialog_en,
291
+ default47 as multiple_selection_dialog_fr,
277
292
  noSelectionForCopy,
278
- default23 as report_viewer_en,
279
- default24 as report_viewer_fr,
293
+ default24 as report_viewer_en,
294
+ default25 as report_viewer_fr,
280
295
  roundToDefaultPrecision,
281
296
  roundToPrecision,
297
+ rqbQuerySchemaValidator,
282
298
  saveCriteriaBasedFilter,
283
299
  saveExpertFilter,
284
300
  saveExplicitNamingFilter,
@@ -286,18 +302,20 @@ export {
286
302
  setCommonStore,
287
303
  setLoggedUser,
288
304
  setSignInCallbackError,
289
- default29 as table_en,
290
- default30 as table_fr,
305
+ default30 as table_en,
306
+ default31 as table_fr,
291
307
  toFloatOrNullValue,
292
- default27 as top_bar_en,
293
- default28 as top_bar_fr,
294
- default31 as treeview_finder_en,
295
- default32 as treeview_finder_fr,
308
+ default28 as top_bar_en,
309
+ default29 as top_bar_fr,
310
+ default32 as treeview_finder_en,
311
+ default33 as treeview_finder_fr,
296
312
  unitToMicroUnit,
297
- default55 as useCustomFormContext,
298
- default53 as useDebounce,
313
+ default56 as useCustomFormContext,
314
+ default54 as useDebounce,
299
315
  default11 as useElementSearch,
300
- default52 as useIntlRef,
316
+ default53 as useIntlRef,
301
317
  useLocalizedCountries,
302
- useSnackMessage
318
+ usePrevious,
319
+ useSnackMessage,
320
+ yup
303
321
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.63.0",
3
+ "version": "0.63.1",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",