@gridsuite/commons-ui 0.54.0 → 0.56.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.
Files changed (165) hide show
  1. package/dist/assets/criteria-based-filter-edition-dialog.css +168 -0
  2. package/dist/chunks/criteria-based-filter-edition-dialog.DxqH-mLe.js +1673 -0
  3. package/dist/chunks/filter-properties.GRon8-ML.js +195 -0
  4. package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +7 -6
  5. package/dist/components/DirectoryItemSelector/directory-item-selector.js +34 -43
  6. package/dist/components/FlatParameters/FlatParameters.js +3 -0
  7. package/dist/components/ReportViewer/log-report.d.ts +2 -2
  8. package/dist/components/TreeViewFinder/TreeViewFinder.d.ts +32 -58
  9. package/dist/components/TreeViewFinder/TreeViewFinder.js +126 -82
  10. package/dist/components/dialogs/custom-mui-dialog.d.ts +21 -0
  11. package/dist/components/dialogs/custom-mui-dialog.js +87 -0
  12. package/dist/components/dialogs/description-modification-dialog.d.ts +11 -0
  13. package/dist/components/dialogs/description-modification-dialog.js +71 -0
  14. package/dist/components/dialogs/popup-confirmation-dialog.d.ts +11 -0
  15. package/dist/components/dialogs/popup-confirmation-dialog.js +38 -0
  16. package/dist/components/filter/constants/equipment-types.d.ts +72 -0
  17. package/dist/components/filter/constants/equipment-types.js +63 -0
  18. package/dist/components/filter/constants/expert-filter-constants.d.ts +546 -0
  19. package/dist/components/filter/constants/expert-filter-constants.js +663 -0
  20. package/dist/components/filter/constants/field-constants.d.ts +45 -0
  21. package/dist/components/filter/constants/field-constants.js +43 -0
  22. package/dist/components/filter/constants/filter-constants.d.ts +21 -0
  23. package/dist/components/filter/constants/filter-constants.js +10 -0
  24. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +29 -0
  25. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +19 -0
  26. package/dist/components/filter/criteria-based/criteria-based-filter-form.d.ts +15 -0
  27. package/dist/components/filter/criteria-based/criteria-based-filter-form.js +33 -0
  28. package/dist/components/filter/criteria-based/criteria-based-filter-utils.d.ts +37 -0
  29. package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +127 -0
  30. package/dist/components/filter/criteria-based/criteria-based-form.d.ts +7 -0
  31. package/dist/components/filter/criteria-based/criteria-based-form.js +50 -0
  32. package/dist/components/filter/criteria-based/filter-free-properties.d.ts +10 -0
  33. package/dist/components/filter/criteria-based/filter-free-properties.js +15 -0
  34. package/dist/components/filter/criteria-based/filter-properties.d.ts +21 -0
  35. package/dist/components/filter/criteria-based/filter-properties.js +19 -0
  36. package/dist/components/filter/criteria-based/filter-property.d.ts +19 -0
  37. package/dist/components/filter/criteria-based/filter-property.js +67 -0
  38. package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +28 -0
  39. package/dist/components/filter/expert/expert-filter-edition-dialog.js +20 -0
  40. package/dist/components/filter/expert/expert-filter-form.d.ts +21 -0
  41. package/dist/components/filter/expert/expert-filter-form.js +22 -0
  42. package/dist/components/filter/expert/expert-filter-utils.d.ts +19 -0
  43. package/dist/components/filter/expert/expert-filter-utils.js +302 -0
  44. package/dist/components/filter/expert/expert-filter.type.d.ts +113 -0
  45. package/dist/components/filter/expert/expert-filter.type.js +103 -0
  46. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.d.ts +22 -0
  47. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +19 -0
  48. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +22 -0
  49. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +23 -0
  50. package/dist/components/filter/filter-context.d.ts +12 -0
  51. package/dist/components/filter/filter-context.js +10 -0
  52. package/dist/components/filter/filter-creation-dialog.d.ts +21 -0
  53. package/dist/components/filter/filter-creation-dialog.js +17 -0
  54. package/dist/components/filter/filter-form.d.ts +11 -0
  55. package/dist/components/filter/filter-form.js +14 -0
  56. package/dist/components/filter/utils/criteria-based-utils.d.ts +28 -0
  57. package/dist/components/filter/utils/criteria-based-utils.js +197 -0
  58. package/dist/components/filter/utils/filters-utils.d.ts +5 -0
  59. package/dist/components/filter/utils/filters-utils.js +99 -0
  60. package/dist/components/inputs/select-clearable.d.ts +14 -0
  61. package/dist/components/inputs/select-clearable.js +40 -0
  62. package/dist/components/react-hook-form/ExpandingTextField.d.ts +1 -1
  63. package/dist/components/react-hook-form/ExpandingTextField.js +0 -37
  64. package/dist/components/react-hook-form/ag-grid-table-rhf/bottom-right-buttons.d.ts +17 -0
  65. package/dist/components/react-hook-form/ag-grid-table-rhf/bottom-right-buttons.js +15 -0
  66. package/dist/components/react-hook-form/ag-grid-table-rhf/cell-editors/numericEditor.d.ts +23 -0
  67. package/dist/components/react-hook-form/ag-grid-table-rhf/cell-editors/numericEditor.js +70 -0
  68. package/dist/components/react-hook-form/ag-grid-table-rhf/csv-uploader/csv-uploader.d.ts +16 -0
  69. package/dist/components/react-hook-form/ag-grid-table-rhf/csv-uploader/csv-uploader.js +69 -0
  70. package/dist/components/react-hook-form/ag-grid-table-rhf/custom-ag-grid-table.d.ts +23 -0
  71. package/dist/components/react-hook-form/ag-grid-table-rhf/custom-ag-grid-table.js +15 -0
  72. package/dist/components/react-hook-form/autocomplete-input.d.ts +17 -29
  73. package/dist/components/react-hook-form/autocomplete-input.js +4 -15
  74. package/dist/components/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.d.ts +2 -0
  75. package/dist/components/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js +46 -0
  76. package/dist/components/react-hook-form/directory-items-input.d.ts +2 -4
  77. package/dist/components/react-hook-form/directory-items-input.js +61 -12
  78. package/dist/components/react-hook-form/error-management/error-input.d.ts +13 -4
  79. package/dist/components/react-hook-form/error-management/error-input.js +7 -7
  80. package/dist/components/react-hook-form/error-management/field-error-alert.d.ts +6 -3
  81. package/dist/components/react-hook-form/error-management/field-error-alert.js +3 -1
  82. package/dist/components/react-hook-form/numbers/float-input.d.ts +5 -17
  83. package/dist/components/react-hook-form/numbers/float-input.js +3 -5
  84. package/dist/components/react-hook-form/numbers/integer-input.d.ts +15 -12
  85. package/dist/components/react-hook-form/numbers/utils.d.ts +8 -2
  86. package/dist/components/react-hook-form/provider/custom-form-provider.d.ts +1 -0
  87. package/dist/components/react-hook-form/provider/custom-form-provider.js +12 -3
  88. package/dist/components/react-hook-form/radio-input.d.ts +14 -17
  89. package/dist/components/react-hook-form/radio-input.js +7 -9
  90. package/dist/components/react-hook-form/range-input.d.ts +54 -0
  91. package/dist/components/react-hook-form/range-input.js +118 -0
  92. package/dist/components/react-hook-form/select-inputs/countries-input.d.ts +8 -0
  93. package/dist/components/react-hook-form/select-inputs/countries-input.js +36 -0
  94. package/dist/components/react-hook-form/select-inputs/input-with-popup-confirmation.d.ts +2 -0
  95. package/dist/components/react-hook-form/select-inputs/input-with-popup-confirmation.js +61 -0
  96. package/dist/components/react-hook-form/select-inputs/mui-select-input.d.ts +12 -0
  97. package/dist/components/react-hook-form/select-inputs/mui-select-input.js +25 -0
  98. package/dist/components/react-hook-form/select-inputs/select-input.d.ts +9 -0
  99. package/dist/components/react-hook-form/select-inputs/select-input.js +37 -0
  100. package/dist/components/react-hook-form/text-input.d.ts +23 -32
  101. package/dist/components/react-hook-form/text-input.js +6 -20
  102. package/dist/components/react-hook-form/unique-name-input.d.ts +21 -0
  103. package/dist/components/react-hook-form/unique-name-input.js +129 -0
  104. package/dist/components/react-hook-form/utils/cancel-button.d.ts +9 -8
  105. package/dist/components/react-hook-form/utils/field-label.d.ts +12 -5
  106. package/dist/components/react-hook-form/utils/field-label.js +5 -1
  107. package/dist/components/react-hook-form/utils/functions.d.ts +12 -4
  108. package/dist/components/react-hook-form/utils/functions.js +21 -1
  109. package/dist/components/react-hook-form/utils/submit-button.d.ts +9 -8
  110. package/dist/components/react-hook-form/utils/text-field-with-adornment.d.ts +11 -11
  111. package/dist/components/react-hook-form/utils/text-field-with-adornment.js +18 -23
  112. package/dist/components/react-query-builder-inputs/add-button.d.ts +8 -0
  113. package/dist/components/react-query-builder-inputs/add-button.js +17 -0
  114. package/dist/components/react-query-builder-inputs/combinator-selector.d.ts +5 -0
  115. package/dist/components/react-query-builder-inputs/combinator-selector.js +38 -0
  116. package/dist/components/react-query-builder-inputs/country-value-editor.d.ts +5 -0
  117. package/dist/components/react-query-builder-inputs/country-value-editor.js +46 -0
  118. package/dist/components/react-query-builder-inputs/custom-react-query-builder.d.ts +8 -0
  119. package/dist/components/react-query-builder-inputs/custom-react-query-builder.js +21 -0
  120. package/dist/components/react-query-builder-inputs/element-value-editor.d.ts +14 -0
  121. package/dist/components/react-query-builder-inputs/element-value-editor.js +69 -0
  122. package/dist/components/react-query-builder-inputs/property-value-editor.d.ts +9 -0
  123. package/dist/components/react-query-builder-inputs/property-value-editor.js +100 -0
  124. package/dist/components/react-query-builder-inputs/remove-button.d.ts +5 -0
  125. package/dist/components/react-query-builder-inputs/remove-button.js +9 -0
  126. package/dist/components/react-query-builder-inputs/text-value-editor.d.ts +5 -0
  127. package/dist/components/react-query-builder-inputs/text-value-editor.js +34 -0
  128. package/dist/components/react-query-builder-inputs/translated-value-editor.d.ts +5 -0
  129. package/dist/components/react-query-builder-inputs/translated-value-editor.js +58 -0
  130. package/dist/components/react-query-builder-inputs/use-convert-value.d.ts +9 -0
  131. package/dist/components/react-query-builder-inputs/use-convert-value.js +24 -0
  132. package/dist/components/react-query-builder-inputs/use-valid.d.ts +7 -0
  133. package/dist/components/react-query-builder-inputs/use-valid.js +13 -0
  134. package/dist/components/react-query-builder-inputs/value-editor.d.ts +5 -0
  135. package/dist/components/react-query-builder-inputs/value-editor.js +18 -0
  136. package/dist/components/react-query-builder-inputs/value-selector.d.ts +4 -0
  137. package/dist/components/react-query-builder-inputs/value-selector.js +14 -0
  138. package/dist/components/translations/treeview-finder-en.d.ts +1 -0
  139. package/dist/components/translations/treeview-finder-en.js +4 -3
  140. package/dist/components/translations/treeview-finder-fr.d.ts +1 -0
  141. package/dist/components/translations/treeview-finder-fr.js +4 -3
  142. package/dist/hooks/localized-countries-hook.d.ts +6 -0
  143. package/dist/hooks/localized-countries-hook.js +45 -0
  144. package/dist/hooks/predefined-properties-hook.d.ts +18 -0
  145. package/dist/hooks/predefined-properties-hook.js +43 -0
  146. package/dist/hooks/useDebounce.d.ts +7 -1
  147. package/dist/hooks/useSnackMessage.d.ts +23 -5
  148. package/dist/hooks/useSnackMessage.js +14 -12
  149. package/dist/index.d.ts +92 -143
  150. package/dist/index.js +168 -91
  151. package/dist/utils/FetchStatus.d.ts +12 -0
  152. package/dist/utils/FetchStatus.js +9 -0
  153. package/dist/utils/conversion-utils.d.ts +12 -0
  154. package/dist/utils/conversion-utils.js +22 -0
  155. package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +3 -0
  156. package/dist/utils/equipment-types-for-predefined-properties-mapper.js +31 -0
  157. package/dist/utils/functions.d.ts +14 -0
  158. package/dist/utils/functions.js +16 -0
  159. package/dist/utils/types.d.ts +21 -0
  160. package/dist/utils/types.js +1 -0
  161. package/dist/utils/yup-config.d.ts +8 -0
  162. package/dist/utils/yup-config.js +16 -0
  163. package/package.json +27 -4
  164. package/dist/components/react-hook-form/select-input.d.ts +0 -17
  165. package/dist/components/react-hook-form/select-input.js +0 -30
@@ -0,0 +1,129 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect } from "react";
3
+ import { useDebounce } from "../../hooks/useDebounce.js";
4
+ import { FormattedMessage } from "react-intl";
5
+ import { InputAdornment } from "@mui/material";
6
+ import CheckIcon from "@mui/icons-material/Check";
7
+ import { useController, useFormContext } from "react-hook-form";
8
+ import CircularProgress from "@mui/material/CircularProgress";
9
+ import TextField from "@mui/material/TextField";
10
+ import { FieldConstants } from "../filter/constants/field-constants.js";
11
+ const UniqueNameInput = ({
12
+ name,
13
+ label,
14
+ elementType,
15
+ autoFocus,
16
+ onManualChangeCallback,
17
+ formProps,
18
+ activeDirectory,
19
+ elementExists
20
+ }) => {
21
+ var _a;
22
+ const {
23
+ field: { onChange, onBlur, value, ref },
24
+ fieldState: { error, isDirty }
25
+ } = useController({
26
+ name
27
+ });
28
+ const {
29
+ field: { value: selectedDirectory }
30
+ } = useController({
31
+ name: FieldConstants.DIRECTORY
32
+ });
33
+ const {
34
+ setError,
35
+ clearErrors,
36
+ formState: { errors }
37
+ } = useFormContext();
38
+ const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
39
+ const directory = selectedDirectory || activeDirectory;
40
+ const handleCheckName = useCallback(
41
+ (value2) => {
42
+ if (value2) {
43
+ elementExists && elementExists(directory, value2, elementType).then((alreadyExist) => {
44
+ if (alreadyExist) {
45
+ setError(name, {
46
+ type: "validate",
47
+ message: "nameAlreadyUsed"
48
+ });
49
+ }
50
+ }).catch((error2) => {
51
+ setError(name, {
52
+ type: "validate",
53
+ message: "nameValidityCheckErrorMsg"
54
+ });
55
+ console.error(error2 == null ? void 0 : error2.message);
56
+ }).finally(() => {
57
+ clearErrors("root.isValidating");
58
+ });
59
+ }
60
+ },
61
+ [setError, clearErrors, name, elementType, elementExists, directory]
62
+ );
63
+ const debouncedHandleCheckName = useDebounce(handleCheckName, 700);
64
+ useEffect(() => {
65
+ const trimmedValue = value.trim();
66
+ if (selectedDirectory) {
67
+ debouncedHandleCheckName(trimmedValue);
68
+ }
69
+ if (!isDirty) {
70
+ clearErrors(name);
71
+ return;
72
+ }
73
+ if (trimmedValue) {
74
+ clearErrors(name);
75
+ setError("root.isValidating", {
76
+ type: "validate",
77
+ message: "cantSubmitWhileValidating"
78
+ });
79
+ debouncedHandleCheckName(trimmedValue);
80
+ } else {
81
+ clearErrors("root.isValidating");
82
+ setError(name, {
83
+ type: "validate",
84
+ message: "nameEmpty"
85
+ });
86
+ }
87
+ }, [
88
+ debouncedHandleCheckName,
89
+ setError,
90
+ clearErrors,
91
+ name,
92
+ value,
93
+ isDirty,
94
+ selectedDirectory
95
+ ]);
96
+ const handleManualChange = (e) => {
97
+ onChange(e.target.value);
98
+ onManualChangeCallback && onManualChangeCallback();
99
+ };
100
+ const translatedLabel = /* @__PURE__ */ jsx(FormattedMessage, { id: label });
101
+ const translatedError = error && /* @__PURE__ */ jsx(FormattedMessage, { id: error.message });
102
+ const showOk = (value == null ? void 0 : value.trim()) && !isValidating && !error;
103
+ const endAdornment = /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
104
+ isValidating && /* @__PURE__ */ jsx(CircularProgress, { size: "1rem" }),
105
+ showOk && /* @__PURE__ */ jsx(CheckIcon, { style: { color: "green" } })
106
+ ] });
107
+ return /* @__PURE__ */ jsx(
108
+ TextField,
109
+ {
110
+ onChange: handleManualChange,
111
+ onBlur,
112
+ value,
113
+ name,
114
+ inputRef: ref,
115
+ label: translatedLabel,
116
+ type: "text",
117
+ autoFocus,
118
+ margin: "dense",
119
+ fullWidth: true,
120
+ error: !!error,
121
+ helperText: translatedError,
122
+ InputProps: { endAdornment },
123
+ ...formProps
124
+ }
125
+ );
126
+ };
127
+ export {
128
+ UniqueNameInput
129
+ };
@@ -1,10 +1,11 @@
1
1
  import { default as PropTypes } from 'prop-types';
2
+
3
+ declare const CancelButton: {
4
+ ({ ...inProps }: {
5
+ [x: string]: any;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ propTypes: {
8
+ buttonProps: PropTypes.Requireable<object>;
9
+ };
10
+ };
2
11
  export default CancelButton;
3
- declare function CancelButton({ ...inProps }: {
4
- [x: string]: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- declare namespace CancelButton {
7
- namespace propTypes {
8
- let buttonProps: PropTypes.Requireable<object>;
9
- }
10
- }
@@ -1,6 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2024, 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
+ type FieldLabelProps = {
8
+ label: string;
9
+ optional?: boolean;
10
+ values?: any;
11
+ };
12
+ declare const FieldLabel: ({ label, optional, values, }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element;
1
13
  export default FieldLabel;
2
- declare function FieldLabel({ label, optional, values }: {
3
- label: any;
4
- optional: any;
5
- values?: undefined;
6
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,10 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { FormattedMessage } from "react-intl";
3
- const FieldLabel = ({ label, optional, values = void 0 }) => {
3
+ const FieldLabel = ({
4
+ label,
5
+ optional = false,
6
+ values = void 0
7
+ }) => {
4
8
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5
9
  /* @__PURE__ */ jsx(FormattedMessage, { id: label, values }),
6
10
  optional && /* @__PURE__ */ jsx(FormattedMessage, { id: "Optional" })
@@ -1,10 +1,18 @@
1
- export function genHelperPreviousValue(previousValue: any, adornment: any): any;
2
- export function genHelperError(...errors: any[]): {
1
+ import { ReactElement } from 'react';
2
+
3
+ export declare function genHelperPreviousValue(previousValue: number | string, adornment?: any): {
4
+ error?: boolean | undefined;
5
+ helperText?: string | undefined;
6
+ };
7
+ export declare function genHelperError(...errors: any[]): {
3
8
  error: boolean;
4
9
  helperText: import("react/jsx-runtime").JSX.Element;
5
10
  } | {
6
11
  error?: undefined;
7
12
  helperText?: undefined;
8
13
  };
9
- export function identity(x: any): any;
10
- export function isFieldRequired(fieldName: any, schema: any, values: any): boolean;
14
+ export declare function identity(x: any): any;
15
+ export declare const isFieldRequired: (fieldName: string, schema: any, values: unknown) => boolean;
16
+ export declare const gridItem: (field: string | ReactElement, size?: number) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const isFloatNumber: (val: string) => boolean;
18
+ export declare const toFloatOrNullValue: (value: string) => number | "-" | null;
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { FormattedMessage } from "react-intl";
3
3
  import { getIn } from "yup";
4
+ import { Grid } from "@mui/material";
4
5
  function genHelperPreviousValue(previousValue, adornment) {
5
6
  return {
6
7
  ...(previousValue || previousValue === 0) && {
@@ -27,9 +28,28 @@ const isFieldRequired = (fieldName, schema, values) => {
27
28
  const { schema: fieldSchema, parent: parentValues } = getIn(schema, fieldName, values) || {};
28
29
  return ((_a = fieldSchema.describe({ parent: parentValues })) == null ? void 0 : _a.optional) === false;
29
30
  };
31
+ const gridItem = (field, size = 6) => {
32
+ return /* @__PURE__ */ jsx(Grid, { item: true, xs: size, alignItems: "start", children: field });
33
+ };
34
+ const isFloatNumber = (val) => {
35
+ return /^-?[0-9]*[.,]?[0-9]*$/.test(val);
36
+ };
37
+ const toFloatOrNullValue = (value) => {
38
+ if (value === "-") {
39
+ return value;
40
+ }
41
+ if (value === "0") {
42
+ return 0;
43
+ }
44
+ const tmp = (value == null ? void 0 : value.replace(",", ".")) || "";
45
+ return parseFloat(tmp) || null;
46
+ };
30
47
  export {
31
48
  genHelperError,
32
49
  genHelperPreviousValue,
50
+ gridItem,
33
51
  identity,
34
- isFieldRequired
52
+ isFieldRequired,
53
+ isFloatNumber,
54
+ toFloatOrNullValue
35
55
  };
@@ -1,10 +1,11 @@
1
1
  import { default as PropTypes } from 'prop-types';
2
+
3
+ declare const SubmitButton: {
4
+ ({ ...buttonProps }: {
5
+ [x: string]: any;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ propTypes: {
8
+ buttonProps: PropTypes.Requireable<object>;
9
+ };
10
+ };
2
11
  export default SubmitButton;
3
- declare function SubmitButton({ ...buttonProps }: {
4
- [x: string]: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- declare namespace SubmitButton {
7
- namespace propTypes {
8
- let buttonProps: PropTypes.Requireable<object>;
9
- }
10
- }
@@ -1,12 +1,12 @@
1
- import { default as PropTypes } from 'prop-types';
1
+ import { Input } from '../../../utils/types.ts';
2
+ import { TextFieldProps } from '@mui/material';
3
+ import { FunctionComponent } from 'react';
4
+
5
+ export type TextFieldWithAdornmentProps = TextFieldProps & {
6
+ value: Input;
7
+ adornmentPosition: string;
8
+ adornmentText: string;
9
+ handleClearValue?: () => void;
10
+ };
11
+ declare const TextFieldWithAdornment: FunctionComponent<TextFieldWithAdornmentProps>;
2
12
  export default TextFieldWithAdornment;
3
- declare function TextFieldWithAdornment(props: any): import("react/jsx-runtime").JSX.Element;
4
- declare namespace TextFieldWithAdornment {
5
- namespace propTypes {
6
- let adornmentPosition: PropTypes.Validator<string>;
7
- let adornmentText: PropTypes.Validator<string>;
8
- let value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
9
- let variant: PropTypes.Requireable<string>;
10
- let handleClearValue: PropTypes.Requireable<(...args: any[]) => any>;
11
- }
12
- }
@@ -1,6 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useCallback } from "react";
3
- import PropTypes from "prop-types";
4
3
  import { Clear } from "@mui/icons-material";
5
4
  import { InputAdornment, IconButton, TextField } from "@mui/material";
6
5
  const TextFieldWithAdornment = (props) => {
@@ -13,20 +12,23 @@ const TextFieldWithAdornment = (props) => {
13
12
  ...otherProps
14
13
  } = props;
15
14
  const [isFocused, setIsFocused] = useState(false);
16
- const getAdornmentStyle = useCallback((variant2) => {
17
- if (variant2 === "filled") {
18
- return {
19
- alignItems: "start",
20
- marginBottom: "0.4em"
21
- };
22
- }
23
- if (variant2 === "standard") {
24
- return {
25
- marginBottom: "0.3em"
26
- };
27
- }
28
- return void 0;
29
- }, []);
15
+ const getAdornmentStyle = useCallback(
16
+ (variant2) => {
17
+ if (variant2 === "filled") {
18
+ return {
19
+ alignItems: "start",
20
+ marginBottom: "0.4em"
21
+ };
22
+ }
23
+ if (variant2 === "standard") {
24
+ return {
25
+ marginBottom: "0.3em"
26
+ };
27
+ }
28
+ return void 0;
29
+ },
30
+ []
31
+ );
30
32
  const getClearAdornment = useCallback(
31
33
  (position) => {
32
34
  return /* @__PURE__ */ jsx(InputAdornment, { position, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleClearValue, children: /* @__PURE__ */ jsx(Clear, {}) }) });
@@ -39,7 +41,7 @@ const TextFieldWithAdornment = (props) => {
39
41
  InputAdornment,
40
42
  {
41
43
  position,
42
- sx: getAdornmentStyle(variant),
44
+ sx: variant && getAdornmentStyle(variant),
43
45
  children: adornmentText
44
46
  }
45
47
  );
@@ -84,13 +86,6 @@ const TextFieldWithAdornment = (props) => {
84
86
  }
85
87
  );
86
88
  };
87
- TextFieldWithAdornment.propTypes = {
88
- adornmentPosition: PropTypes.string.isRequired,
89
- adornmentText: PropTypes.string.isRequired,
90
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
91
- variant: PropTypes.string,
92
- handleClearValue: PropTypes.func
93
- };
94
89
  export {
95
90
  TextFieldWithAdornment as default
96
91
  };
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { ActionWithRulesAndAddersProps } from 'react-querybuilder';
3
+
4
+ interface ActionWithRulesAndAddersWithLabelProps extends ActionWithRulesAndAddersProps {
5
+ label: string;
6
+ }
7
+ declare const AddButton: FunctionComponent<ActionWithRulesAndAddersWithLabelProps>;
8
+ export default AddButton;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@mui/material";
3
+ import AddIcon from "@mui/icons-material/ControlPoint";
4
+ import { FormattedMessage } from "react-intl";
5
+ const AddButton = (props) => /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
6
+ Button,
7
+ {
8
+ startIcon: /* @__PURE__ */ jsx(AddIcon, {}),
9
+ onClick: props.handleOnClick,
10
+ size: "small",
11
+ className: "add-button",
12
+ children: /* @__PURE__ */ jsx(FormattedMessage, { id: props.label })
13
+ }
14
+ ) });
15
+ export {
16
+ AddButton as default
17
+ };
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { CombinatorSelectorProps } from 'react-querybuilder';
3
+
4
+ declare const CombinatorSelector: FunctionComponent<CombinatorSelectorProps>;
5
+ export default CombinatorSelector;
@@ -0,0 +1,38 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useState, useCallback } from "react";
3
+ import PopupConfirmationDialog from "../dialogs/popup-confirmation-dialog.js";
4
+ import { MaterialValueSelector } from "@react-querybuilder/material";
5
+ const CombinatorSelector = (props) => {
6
+ const [tempCombinator, setTempCombinator] = useState(props.value);
7
+ const [openPopup, setOpenPopup] = useState(false);
8
+ const handlePopupConfirmation = useCallback(() => {
9
+ props.handleOnChange(tempCombinator);
10
+ setOpenPopup(false);
11
+ }, [props, tempCombinator]);
12
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ /* @__PURE__ */ jsx(
14
+ PopupConfirmationDialog,
15
+ {
16
+ message: "changeOperatorMessage",
17
+ validateButtonLabel: "button.changeOperator",
18
+ openConfirmationPopup: openPopup,
19
+ setOpenConfirmationPopup: setOpenPopup,
20
+ handlePopupConfirmation
21
+ }
22
+ ),
23
+ /* @__PURE__ */ jsx(
24
+ MaterialValueSelector,
25
+ {
26
+ ...props,
27
+ title: void 0,
28
+ handleOnChange: (newCombinator) => {
29
+ setTempCombinator(newCombinator);
30
+ setOpenPopup(true);
31
+ }
32
+ }
33
+ )
34
+ ] });
35
+ };
36
+ export {
37
+ CombinatorSelector as default
38
+ };
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { ValueEditorProps } from 'react-querybuilder';
3
+
4
+ declare const CountryValueEditor: FunctionComponent<ValueEditorProps>;
5
+ export default CountryValueEditor;
@@ -0,0 +1,46 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { MaterialValueEditor } from "@react-querybuilder/material";
3
+ import { Autocomplete, TextField } from "@mui/material";
4
+ import useConvertValue from "./use-convert-value.js";
5
+ import useValid from "./use-valid.js";
6
+ import { useLocalizedCountries } from "../../hooks/localized-countries-hook.js";
7
+ import { useCustomFormContext } from "../react-hook-form/provider/use-custom-form-context.js";
8
+ import { useMemo } from "react";
9
+ const CountryValueEditor = (props) => {
10
+ const { language } = useCustomFormContext();
11
+ const { translate, countryCodes } = useLocalizedCountries(language);
12
+ const countriesList = useMemo(
13
+ () => countryCodes.map((country) => {
14
+ return { name: country, label: translate(country) };
15
+ }),
16
+ [countryCodes, translate]
17
+ );
18
+ useConvertValue(props);
19
+ const valid = useValid(props);
20
+ if (!Array.isArray(props.value)) {
21
+ return /* @__PURE__ */ jsx(
22
+ MaterialValueEditor,
23
+ {
24
+ ...props,
25
+ values: countriesList,
26
+ title: void 0
27
+ }
28
+ );
29
+ } else {
30
+ return /* @__PURE__ */ jsx(
31
+ Autocomplete,
32
+ {
33
+ value: props.value,
34
+ options: countryCodes,
35
+ getOptionLabel: (code) => translate(code),
36
+ onChange: (event, value) => props.handleOnChange(value),
37
+ multiple: true,
38
+ fullWidth: true,
39
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, error: !valid })
40
+ }
41
+ );
42
+ }
43
+ };
44
+ export {
45
+ CountryValueEditor as default
46
+ };
@@ -0,0 +1,8 @@
1
+ import { Field } from 'react-querybuilder';
2
+
3
+ interface CustomReactQueryBuilderProps {
4
+ name: string;
5
+ fields: Field[];
6
+ }
7
+ declare const CustomReactQueryBuilder: (props: CustomReactQueryBuilderProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default CustomReactQueryBuilder;
@@ -0,0 +1,21 @@
1
+ import "react/jsx-runtime";
2
+ import "@mui/material/Grid";
3
+ import "@react-querybuilder/dnd";
4
+ import "react-dnd";
5
+ import "react-dnd-html5-backend";
6
+ import "@react-querybuilder/material";
7
+ import "react-querybuilder";
8
+ import "react-intl";
9
+ import "react-hook-form";
10
+ import { j } from "../../chunks/criteria-based-filter-edition-dialog.DxqH-mLe.js";
11
+ import "./combinator-selector.js";
12
+ import "./add-button.js";
13
+ import "./value-selector.js";
14
+ import "react";
15
+ import "../filter/constants/expert-filter-constants.js";
16
+ import "../react-hook-form/error-management/error-input.js";
17
+ import "../react-hook-form/error-management/field-error-alert.js";
18
+ import "../filter/expert/expert-filter-utils.js";
19
+ export {
20
+ j as default
21
+ };
@@ -0,0 +1,14 @@
1
+ import { FunctionComponent } from 'react';
2
+
3
+ interface ElementValueEditorProps {
4
+ name: string;
5
+ elementType: string;
6
+ equipmentTypes?: string[];
7
+ titleId: string;
8
+ hideErrorMessage: boolean;
9
+ onChange?: (e: any) => void;
10
+ itemFilter?: any;
11
+ defaultValue?: any;
12
+ }
13
+ declare const ElementValueEditor: FunctionComponent<ElementValueEditorProps>;
14
+ export default ElementValueEditor;
@@ -0,0 +1,69 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "uuid";
4
+ import "../TreeViewFinder/TreeViewFinder.js";
5
+ import "../TopBar/TopBar.js";
6
+ import "../TopBar/GridLogo.js";
7
+ import "../TopBar/AboutDialog.js";
8
+ import "../SnackbarProvider/SnackbarProvider.js";
9
+ import "react-router-dom";
10
+ import "../../utils/AuthService.js";
11
+ import "@mui/material";
12
+ import "@mui/icons-material";
13
+ import "react-intl";
14
+ import "../MuiVirtualizedTable/MuiVirtualizedTable.js";
15
+ import "../ReportViewer/report-item.js";
16
+ import "../ReportViewer/log-table.js";
17
+ import "../ReportViewer/report-tree-view-context.js";
18
+ import "@mui/x-tree-view";
19
+ import "../OverflowableText/overflowable-text.js";
20
+ import "../ElementSearchDialog/element-search-dialog.js";
21
+ import "../ElementSearchDialog/tag-renderer.js";
22
+ import "../react-hook-form/utils/submit-button.js";
23
+ import "../react-hook-form/utils/cancel-button.js";
24
+ import "../react-hook-form/provider/custom-form-provider.js";
25
+ import "../dialogs/description-modification-dialog.js";
26
+ import "react-hook-form";
27
+ import "yup";
28
+ import "../react-hook-form/provider/use-custom-form-context.js";
29
+ import "../dialogs/popup-confirmation-dialog.js";
30
+ import "../filter/utils/criteria-based-utils.js";
31
+ import { i } from "../../chunks/criteria-based-filter-edition-dialog.DxqH-mLe.js";
32
+ import "ag-grid-react";
33
+ import "ag-grid-community/styles/ag-grid.css";
34
+ import "ag-grid-community/styles/ag-theme-alpine.css";
35
+ import "autosuggest-highlight/match";
36
+ import "autosuggest-highlight/parse";
37
+ import "clsx";
38
+ import "../CardErrorBoundary/card-error-boundary.js";
39
+ import "notistack";
40
+ import "../react-hook-form/slider-input.js";
41
+ import "../react-hook-form/numbers/integer-input.js";
42
+ import "../react-hook-form/booleans/checkbox-input.js";
43
+ import "../react-hook-form/booleans/switch-input.js";
44
+ import "../react-hook-form/directory-items-input.js";
45
+ import "../../chunks/filter-properties.GRon8-ML.js";
46
+ import "@mui/icons-material/Delete";
47
+ import "@mui/material/IconButton";
48
+ import "@mui/material/Grid";
49
+ import "../filter/expert/expert-filter-utils.js";
50
+ import "../react-hook-form/range-input.js";
51
+ import "../react-hook-form/select-inputs/mui-select-input.js";
52
+ import "localized-countries";
53
+ import "localized-countries/data/fr";
54
+ import "localized-countries/data/en";
55
+ import "@mui/material/Dialog";
56
+ import "@mui/material/DialogTitle";
57
+ import "@mui/material/DialogContent";
58
+ import "@mui/material/DialogActions";
59
+ import "react-papaparse";
60
+ import "@mui/material/Button";
61
+ import "react-csv-downloader";
62
+ import "@mui/material/Alert";
63
+ import "@mui/icons-material/Check";
64
+ import "@mui/material/CircularProgress";
65
+ import "@mui/material/TextField";
66
+ import "../filter/filter-context.js";
67
+ export {
68
+ i as default
69
+ };
@@ -0,0 +1,9 @@
1
+ import { ValueEditorProps } from 'react-querybuilder';
2
+ import { FunctionComponent } from 'react';
3
+
4
+ interface ExpertFilterPropertyProps {
5
+ equipmentType: string;
6
+ valueEditorProps: ValueEditorProps;
7
+ }
8
+ declare const PropertyValueEditor: FunctionComponent<ExpertFilterPropertyProps>;
9
+ export default PropertyValueEditor;