@centreon/ui 24.4.59 → 24.4.61
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/package.json +50 -42
- package/public/mockServiceWorker.js +1 -1
- package/src/ActionsList/ActionsList.styles.ts +40 -71
- package/src/Button/Icon/index.tsx +1 -1
- package/src/Button/Save/StartIcon.tsx +3 -3
- package/src/Button/Save/index.tsx +9 -5
- package/src/Checkbox/Checkbox.tsx +2 -2
- package/src/Checkbox/CheckboxGroup/index.tsx +2 -2
- package/src/Dashboard/Item.tsx +1 -1
- package/src/Dashboard/Layout.tsx +2 -2
- package/src/Dialog/Confirm/index.tsx +10 -2
- package/src/Dialog/UnsavedChanges/index.tsx +21 -20
- package/src/Dialog/UnsavedChanges/translatedLabels.ts +4 -6
- package/src/Dialog/index.tsx +9 -2
- package/src/FallbackPage/FallbackPage.tsx +3 -3
- package/src/FileDropZone/index.tsx +3 -1
- package/src/Form/Form.cypress.spec.tsx +133 -0
- package/src/Form/Inputs/List/Content.tsx +62 -0
- package/src/Form/Inputs/List/List.styles.ts +29 -0
- package/src/Form/Inputs/List/List.tsx +58 -0
- package/src/Form/Inputs/List/useList.ts +81 -0
- package/src/Form/Inputs/Text.tsx +3 -1
- package/src/Form/Inputs/index.tsx +3 -1
- package/src/Form/Inputs/models.ts +10 -1
- package/src/Graph/BarStack/BarStack.cypress.spec.tsx +154 -0
- package/src/Graph/BarStack/BarStack.stories.tsx +123 -0
- package/src/Graph/BarStack/BarStack.styles.ts +37 -0
- package/src/Graph/BarStack/BarStack.tsx +14 -0
- package/src/Graph/BarStack/ResponsiveBarStack.tsx +222 -0
- package/src/Graph/BarStack/index.ts +1 -0
- package/src/Graph/BarStack/models.ts +20 -0
- package/src/Graph/BarStack/useResponsiveBarStack.ts +137 -0
- package/src/Graph/Gauge/Gauge.cypress.spec.tsx +102 -0
- package/src/Graph/Gauge/Gauge.tsx +1 -1
- package/src/Graph/HeatMap/HeatMap.cypress.spec.tsx +145 -0
- package/src/Graph/HeatMap/HeatMap.stories.tsx +0 -25
- package/src/Graph/HeatMap/ResponsiveHeatMap.tsx +8 -2
- package/src/Graph/Legend/Legend.tsx +21 -0
- package/src/Graph/Legend/index.ts +1 -0
- package/src/Graph/Legend/models.ts +11 -0
- package/src/Graph/LineChart/BasicComponents/Lines/Threshold/Circle.tsx +2 -2
- package/src/Graph/LineChart/BasicComponents/Thresholds.tsx +2 -2
- package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +1 -1
- package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/GuidingLines.tsx +2 -2
- package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
- package/src/Graph/LineChart/Legend/Legend.styles.ts +1 -1
- package/src/Graph/LineChart/Legend/LegendHeader.tsx +1 -1
- package/src/Graph/LineChart/Legend/useInteractiveValues.ts +2 -2
- package/src/Graph/LineChart/Legend/useLegend.ts +3 -3
- package/src/Graph/LineChart/helpers/doc.ts +16 -13
- package/src/Graph/LineChart/helpers/index.ts +1 -1
- package/src/Graph/LineChart/index.stories.tsx +4 -2
- package/src/Graph/LineChart/index.tsx +1 -1
- package/src/Graph/PieChart/PieChart.cypress.spec.tsx +169 -0
- package/src/Graph/PieChart/PieChart.stories.tsx +194 -0
- package/src/Graph/PieChart/PieChart.styles.ts +39 -0
- package/src/Graph/PieChart/PieChart.tsx +14 -0
- package/src/Graph/PieChart/ResponsivePie.tsx +254 -0
- package/src/Graph/PieChart/index.ts +1 -0
- package/src/Graph/PieChart/models.ts +20 -0
- package/src/Graph/PieChart/useResponsivePie.ts +85 -0
- package/src/Graph/SingleBar/SingleBar.cypress.spec.tsx +121 -0
- package/src/Graph/SingleBar/Thresholds.tsx +2 -2
- package/src/Graph/Text/Text.cypress.spec.tsx +101 -0
- package/src/Graph/Text/Text.stories.tsx +60 -4
- package/src/Graph/Text/Text.tsx +1 -1
- package/src/Graph/common/testUtils.ts +71 -0
- package/src/Graph/common/timeSeries/index.ts +22 -14
- package/src/Graph/common/utils.ts +19 -0
- package/src/Graph/index.ts +3 -0
- package/src/Graph/translatedLabels.ts +1 -0
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +10 -7
- package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/index.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Multi/index.tsx +4 -2
- package/src/InputField/Select/Autocomplete/index.tsx +129 -116
- package/src/InputField/Select/IconPopover/index.tsx +2 -2
- package/src/InputField/Select/index.tsx +15 -2
- package/src/InputField/Text/index.tsx +2 -2
- package/src/Listing/ActionBar/index.tsx +9 -8
- package/src/Listing/Cell/DataCell.styles.ts +3 -0
- package/src/Listing/Cell/DataCell.tsx +23 -5
- package/src/Listing/Header/ListingHeader.tsx +1 -1
- package/src/Listing/Listing.cypress.spec.tsx +218 -33
- package/src/Listing/Listing.styles.ts +4 -7
- package/src/Listing/Row/Row.tsx +7 -3
- package/src/Listing/index.stories.tsx +37 -3
- package/src/Listing/index.test.tsx +1 -1
- package/src/Listing/index.tsx +80 -36
- package/src/Listing/models.ts +1 -0
- package/src/Listing/useStyleTable.ts +1 -0
- package/src/Module/Module.cypress.spec.tsx +129 -0
- package/src/Module/index.tsx +2 -4
- package/src/PopoverMenu/index.tsx +6 -5
- package/src/RichTextEditor/RichTextEditor.tsx +12 -1
- package/src/SortableItems/index.tsx +2 -7
- package/src/ThemeProvider/index.tsx +24 -0
- package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.styles.ts +6 -7
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +8 -3
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +0 -2
- package/src/TimePeriods/DateTimePickerInput.tsx +56 -19
- package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +12 -9
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +9 -33
- package/src/TimePeriods/helpers/index.ts +1 -1
- package/src/TimePeriods/index.stories.tsx +12 -4
- package/src/TimePeriods/index.tsx +2 -2
- package/src/Typography/FluidTypography/FluidTypography.cypress.spec.tsx +27 -0
- package/src/Typography/FluidTypography/index.stories.tsx +2 -2
- package/src/Typography/FluidTypography/index.tsx +21 -28
- package/src/api/QueryProvider.tsx +1 -1
- package/src/api/TestQueryProvider.tsx +1 -1
- package/src/api/index.ts +3 -3
- package/src/api/useFetchQuery/index.ts +27 -23
- package/src/api/useMutationQuery/index.test.ts +4 -4
- package/src/api/useMutationQuery/index.ts +60 -25
- package/src/components/Button/Icon/IconButton.tsx +6 -2
- package/src/components/DataTable/DataListing.tsx +6 -0
- package/src/components/DataTable/DataTable.cypress.spec.tsx +174 -0
- package/src/components/DataTable/DataTable.stories.tsx +40 -0
- package/src/components/DataTable/DataTable.styles.ts +3 -0
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/DataTable/Item/DataTableItem.styles.ts +7 -2
- package/src/components/DataTable/Item/DataTableItem.tsx +4 -60
- package/src/components/DataTable/index.ts +3 -1
- package/src/components/Form/AccessRights/AccessRights.cypress.spec.tsx +13 -13
- package/src/components/Form/AccessRights/ShareInput/ContactSwitch.tsx +3 -3
- package/src/components/Form/AccessRights/ShareInput/ShareInput.tsx +1 -0
- package/src/components/Form/AccessRights/storiesData.ts +22 -22
- package/src/components/Form/Dashboard/DashboardDuplicationForm.tsx +85 -0
- package/src/components/Form/Dashboard/DashboardForm.tsx +15 -12
- package/src/components/Form/Dashboard/index.ts +1 -0
- package/src/components/Form/FormActions.tsx +7 -2
- package/src/components/ItemComposition/ItemComposition.styles.ts +2 -2
- package/src/components/Layout/PageLayout/PageLayout.tsx +1 -1
- package/src/components/Layout/PageLayout/PageLayoutActions.tsx +1 -0
- package/src/components/Layout/PageLayout/PageLayoutBody.tsx +1 -0
- package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +5 -1
- package/src/components/Layout/PageLayout/PageQuickAccess.tsx +76 -0
- package/src/components/Layout/PageLayout/index.ts +3 -1
- package/src/components/Layout/PageLayout.cypress.spec.tsx +66 -0
- package/src/components/List/Item/ListItem.tsx +3 -3
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.cypress.spec.tsx +168 -0
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.stories.tsx +62 -0
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.tsx +87 -0
- package/src/components/Modal/Modal.styles.ts +8 -3
- package/src/components/Modal/index.ts +2 -0
- package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.stories.tsx +3 -3
- package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.tsx +1 -1
- package/src/components/Tooltip/ConfirmationTooltip/models.ts +1 -1
- package/src/index.ts +2 -2
- package/src/queryParameters/url/index.ts +5 -1
- package/src/utils/index.ts +1 -1
- package/src/utils/useFullscreen/Fullscreen.cypress.spec.tsx +1 -3
- package/src/utils/useFullscreen/useFullscreenListener.ts +10 -7
- package/src/utils/useInfiniteScrollListing.ts +4 -1
- package/src/utils/{useLicenseExpirationWarning.cypress.spec.tsx → useLicenseExpirationWarning.test.tsx} +48 -37
- package/src/utils/useLicenseExpirationWarning.ts +18 -18
- package/src/utils/usePluralizedTranslation.ts +21 -0
- package/src/Typography/FluidTypography/useFluidResizeObserver.ts +0 -56
- package/src/screens/dashboard/DashboardsDetail.stories.tsx +0 -108
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +0 -281
- package/src/utils/useDateTimePickerAdapter.ts +0 -309
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { equals, isNil, pick } from 'ramda';
|
|
3
|
+
import { equals, isEmpty, isNil, pick } from 'ramda';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { makeStyles } from 'tss-react/mui';
|
|
6
6
|
|
|
@@ -141,126 +141,139 @@ type Multiple = boolean;
|
|
|
141
141
|
type DisableClearable = boolean;
|
|
142
142
|
type FreeSolo = boolean;
|
|
143
143
|
|
|
144
|
-
const AutocompleteField = (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
144
|
+
const AutocompleteField = React.forwardRef(
|
|
145
|
+
(
|
|
146
|
+
{
|
|
147
|
+
options,
|
|
148
|
+
label,
|
|
149
|
+
placeholder,
|
|
150
|
+
loading = false,
|
|
151
|
+
onTextChange = (): void => undefined,
|
|
152
|
+
endAdornment = undefined,
|
|
153
|
+
inputValue,
|
|
154
|
+
displayOptionThumbnail = false,
|
|
155
|
+
required = false,
|
|
156
|
+
error,
|
|
157
|
+
displayPopupIcon = true,
|
|
158
|
+
autoFocus = false,
|
|
159
|
+
hideInput = false,
|
|
160
|
+
dataTestId,
|
|
161
|
+
autoSize = false,
|
|
162
|
+
autoSizeDefaultWidth = 0,
|
|
163
|
+
autoSizeCustomPadding,
|
|
164
|
+
getOptionItemLabel = (option) => option.name,
|
|
165
|
+
...autocompleteProps
|
|
166
|
+
}: Props,
|
|
167
|
+
ref?: React.ForwardedRef<HTMLDivElement>
|
|
168
|
+
): JSX.Element => {
|
|
169
|
+
const { classes, cx } = useStyles({ hideInput });
|
|
170
|
+
const { t } = useTranslation();
|
|
171
|
+
const theme = useTheme();
|
|
168
172
|
|
|
169
|
-
|
|
170
|
-
|
|
173
|
+
const areSelectEntriesEqual = (option, value): boolean => {
|
|
174
|
+
const identifyingProps = ['id', 'name'];
|
|
171
175
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
return equals(
|
|
177
|
+
pick(identifyingProps, option),
|
|
178
|
+
pick(identifyingProps, value)
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const renderInput = (params): JSX.Element => (
|
|
183
|
+
<TextField
|
|
184
|
+
{...params}
|
|
185
|
+
InputLabelProps={{
|
|
186
|
+
classes: {
|
|
187
|
+
marginDense: classes.inputLabel,
|
|
188
|
+
shrink: classes.inputLabelShrink
|
|
189
|
+
}
|
|
190
|
+
}}
|
|
191
|
+
InputProps={{
|
|
192
|
+
...params.InputProps,
|
|
193
|
+
endAdornment: (
|
|
194
|
+
<>
|
|
195
|
+
{endAdornment && (
|
|
196
|
+
<InputAdornment position="end">{endAdornment}</InputAdornment>
|
|
197
|
+
)}
|
|
198
|
+
{params.InputProps.endAdornment}
|
|
199
|
+
</>
|
|
200
|
+
),
|
|
201
|
+
style: {
|
|
202
|
+
background: 'transparent',
|
|
203
|
+
minWidth: 0,
|
|
204
|
+
padding: theme.spacing(
|
|
205
|
+
0.75,
|
|
206
|
+
isEmpty(placeholder) ? 0 : 5,
|
|
207
|
+
0.75,
|
|
208
|
+
0.75
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
}}
|
|
212
|
+
autoFocus={autoFocus}
|
|
213
|
+
autoSize={autoSize}
|
|
214
|
+
autoSizeCustomPadding={7 + (autoSizeCustomPadding || 0)}
|
|
215
|
+
autoSizeDefaultWidth={autoSizeDefaultWidth}
|
|
216
|
+
classes={{
|
|
217
|
+
root: classes.textfield
|
|
218
|
+
}}
|
|
219
|
+
error={error}
|
|
220
|
+
externalValueForAutoSize={autocompleteProps?.value?.name}
|
|
221
|
+
inputProps={{
|
|
222
|
+
...params.inputProps,
|
|
223
|
+
'aria-label': label,
|
|
224
|
+
'data-testid': dataTestId || label,
|
|
225
|
+
id: getNormalizedId(label || ''),
|
|
226
|
+
...autocompleteProps?.inputProps
|
|
227
|
+
}}
|
|
228
|
+
label={label}
|
|
229
|
+
placeholder={isNil(placeholder) ? t(searchLabel) : placeholder}
|
|
230
|
+
required={required}
|
|
231
|
+
value={inputValue || undefined}
|
|
232
|
+
onChange={onTextChange}
|
|
233
|
+
/>
|
|
175
234
|
);
|
|
176
|
-
};
|
|
177
235
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
)}
|
|
194
|
-
{params.InputProps.endAdornment}
|
|
195
|
-
</>
|
|
196
|
-
),
|
|
197
|
-
style: {
|
|
198
|
-
background: 'transparent',
|
|
199
|
-
paddingRight: theme.spacing(5)
|
|
236
|
+
return (
|
|
237
|
+
<Autocomplete
|
|
238
|
+
disableClearable
|
|
239
|
+
classes={{
|
|
240
|
+
groupLabel: classes.inputLabel,
|
|
241
|
+
inputRoot: cx([
|
|
242
|
+
classes.input,
|
|
243
|
+
label ? classes.inputWithLabel : classes.inputWithoutLabel
|
|
244
|
+
]),
|
|
245
|
+
popper: classes.popper,
|
|
246
|
+
root: classes.textfield
|
|
247
|
+
}}
|
|
248
|
+
forcePopupIcon={displayPopupIcon}
|
|
249
|
+
getOptionLabel={(option): string =>
|
|
250
|
+
(option as SelectEntry)?.name?.toString() || ''
|
|
200
251
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
...params.inputProps,
|
|
213
|
-
'aria-label': label,
|
|
214
|
-
'data-testid': dataTestId || label,
|
|
215
|
-
id: getNormalizedId(label || '')
|
|
216
|
-
}}
|
|
217
|
-
label={label}
|
|
218
|
-
placeholder={isNil(placeholder) ? t(searchLabel) : placeholder}
|
|
219
|
-
required={required}
|
|
220
|
-
value={inputValue || undefined}
|
|
221
|
-
onChange={onTextChange}
|
|
222
|
-
/>
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
return (
|
|
226
|
-
<Autocomplete
|
|
227
|
-
disableClearable
|
|
228
|
-
classes={{
|
|
229
|
-
groupLabel: classes.inputLabel,
|
|
230
|
-
inputRoot: cx([
|
|
231
|
-
classes.input,
|
|
232
|
-
label ? classes.inputWithLabel : classes.inputWithoutLabel
|
|
233
|
-
]),
|
|
234
|
-
popper: classes.popper,
|
|
235
|
-
root: classes.textfield
|
|
236
|
-
}}
|
|
237
|
-
forcePopupIcon={displayPopupIcon}
|
|
238
|
-
getOptionLabel={(option): string =>
|
|
239
|
-
(option as SelectEntry)?.name?.toString() || ''
|
|
240
|
-
}
|
|
241
|
-
isOptionEqualToValue={areSelectEntriesEqual}
|
|
242
|
-
loading={loading}
|
|
243
|
-
loadingText={<LoadingIndicator />}
|
|
244
|
-
options={options}
|
|
245
|
-
renderInput={renderInput}
|
|
246
|
-
renderOption={(props, option): JSX.Element => {
|
|
247
|
-
return (
|
|
248
|
-
<li
|
|
249
|
-
className={classes.options}
|
|
250
|
-
{...(props as React.HTMLAttributes<HTMLLIElement>)}
|
|
251
|
-
>
|
|
252
|
-
<Option
|
|
253
|
-
thumbnailUrl={displayOptionThumbnail ? option.url : undefined}
|
|
252
|
+
isOptionEqualToValue={areSelectEntriesEqual}
|
|
253
|
+
loading={loading}
|
|
254
|
+
loadingText={<LoadingIndicator />}
|
|
255
|
+
options={options}
|
|
256
|
+
ref={ref}
|
|
257
|
+
renderInput={renderInput}
|
|
258
|
+
renderOption={(props, option): JSX.Element => {
|
|
259
|
+
return (
|
|
260
|
+
<li
|
|
261
|
+
className={classes.options}
|
|
262
|
+
{...(props as React.HTMLAttributes<HTMLLIElement>)}
|
|
254
263
|
>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
264
|
+
<Option
|
|
265
|
+
thumbnailUrl={displayOptionThumbnail ? option.url : undefined}
|
|
266
|
+
>
|
|
267
|
+
{getOptionItemLabel(option)}
|
|
268
|
+
</Option>
|
|
269
|
+
</li>
|
|
270
|
+
);
|
|
271
|
+
}}
|
|
272
|
+
size="small"
|
|
273
|
+
{...autocompleteProps}
|
|
274
|
+
/>
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
);
|
|
265
278
|
|
|
266
279
|
export default AutocompleteField;
|
|
@@ -73,14 +73,14 @@ const IconPopoverMultiAutocomplete = ({
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const isSelected = (id: number | string): boolean => {
|
|
76
|
-
return pipe(find(propEq(
|
|
76
|
+
return pipe(find(propEq(id, 'id')), Boolean)(value);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
const unSelect = (option: SelectEntry): void => {
|
|
80
80
|
const { id } = option;
|
|
81
81
|
|
|
82
82
|
const updatedValue = isSelected(id)
|
|
83
|
-
? reject(propEq(
|
|
83
|
+
? reject(propEq(id, 'id'), value)
|
|
84
84
|
: [...value, option];
|
|
85
85
|
|
|
86
86
|
onChange(updatedValue);
|
|
@@ -27,6 +27,14 @@ const useStyles = makeStyles()((theme: Theme) => ({
|
|
|
27
27
|
},
|
|
28
28
|
noLabelInput: {
|
|
29
29
|
padding: theme.spacing(1)
|
|
30
|
+
},
|
|
31
|
+
select: {
|
|
32
|
+
'& .MuiInputLabel-shrink~.MuiInputBase-root fieldset legend': {
|
|
33
|
+
maxWidth: '100%'
|
|
34
|
+
},
|
|
35
|
+
'& fieldset legend': {
|
|
36
|
+
maxWidth: 0
|
|
37
|
+
}
|
|
30
38
|
}
|
|
31
39
|
}));
|
|
32
40
|
|
|
@@ -69,7 +77,7 @@ const SelectField = ({
|
|
|
69
77
|
const { classes, cx } = useStyles();
|
|
70
78
|
|
|
71
79
|
const getOption = (id): SelectEntry => {
|
|
72
|
-
return options.find(propEq(
|
|
80
|
+
return options.find(propEq(id, 'id')) as SelectEntry;
|
|
73
81
|
};
|
|
74
82
|
|
|
75
83
|
const changeOption = (event): void => {
|
|
@@ -79,7 +87,12 @@ const SelectField = ({
|
|
|
79
87
|
};
|
|
80
88
|
|
|
81
89
|
return (
|
|
82
|
-
<FormControl
|
|
90
|
+
<FormControl
|
|
91
|
+
className={classes.select}
|
|
92
|
+
error={!isNil(error)}
|
|
93
|
+
fullWidth={fullWidth}
|
|
94
|
+
size="small"
|
|
95
|
+
>
|
|
83
96
|
{label && <InputLabel>{label}</InputLabel>}
|
|
84
97
|
<Select
|
|
85
98
|
displayEmpty
|
|
@@ -154,9 +154,9 @@ const TextField = forwardRef(
|
|
|
154
154
|
helperText={displayErrorInTooltip ? undefined : error}
|
|
155
155
|
id={getNormalizedId(dataTestId || '')}
|
|
156
156
|
inputProps={{
|
|
157
|
-
...rest.inputProps,
|
|
158
157
|
'aria-label': ariaLabel,
|
|
159
|
-
'data-testid': dataTestId
|
|
158
|
+
'data-testid': dataTestId,
|
|
159
|
+
...rest.inputProps
|
|
160
160
|
}}
|
|
161
161
|
label={label}
|
|
162
162
|
ref={ref}
|
|
@@ -174,14 +174,15 @@ const MemoListingActionBar = ({
|
|
|
174
174
|
</IconButton>
|
|
175
175
|
)}
|
|
176
176
|
<div className={classes.ModeViewer} />
|
|
177
|
-
{columnConfiguration?.selectedColumnIds &&
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
{columnConfiguration?.selectedColumnIds &&
|
|
178
|
+
columnConfiguration?.sortable && (
|
|
179
|
+
<ColumnMultiSelect
|
|
180
|
+
columnConfiguration={columnConfiguration}
|
|
181
|
+
columns={columns}
|
|
182
|
+
onResetColumns={onResetColumns}
|
|
183
|
+
onSelectColumns={onSelectColumns}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
185
186
|
{paginated && (
|
|
186
187
|
<StyledPagination
|
|
187
188
|
ActionsComponent={PaginationActions}
|
|
@@ -46,7 +46,7 @@ const DataCell = ({
|
|
|
46
46
|
labelCollapse,
|
|
47
47
|
labelExpand
|
|
48
48
|
}: Props): JSX.Element | null => {
|
|
49
|
-
const { classes } = useStyles();
|
|
49
|
+
const { classes, cx } = useStyles();
|
|
50
50
|
const { dataStyle } = useStyleTable({ listingVariant });
|
|
51
51
|
|
|
52
52
|
const commonCellProps = {
|
|
@@ -64,7 +64,7 @@ const DataCell = ({
|
|
|
64
64
|
|
|
65
65
|
const cellByColumnType = {
|
|
66
66
|
[ColumnType.string]: (): JSX.Element => {
|
|
67
|
-
const { getFormattedString, isTruncated, getColSpan } = column;
|
|
67
|
+
const { getFormattedString, isTruncated, getColSpan, align } = column;
|
|
68
68
|
|
|
69
69
|
const colSpan = getColSpan?.(isRowSelected);
|
|
70
70
|
|
|
@@ -87,6 +87,7 @@ const DataCell = ({
|
|
|
87
87
|
isRowHighlighted={isRowHighlighted}
|
|
88
88
|
listingVariant={listingVariant}
|
|
89
89
|
style={{
|
|
90
|
+
alignItems: align,
|
|
90
91
|
gridColumn
|
|
91
92
|
}}
|
|
92
93
|
{...commonCellProps}
|
|
@@ -99,7 +100,7 @@ const DataCell = ({
|
|
|
99
100
|
);
|
|
100
101
|
},
|
|
101
102
|
[ColumnType.component]: (): JSX.Element | null => {
|
|
102
|
-
const { getHiddenCondition, clickable } = column;
|
|
103
|
+
const { getHiddenCondition, clickable, align } = column;
|
|
103
104
|
const Component = column.Component as (
|
|
104
105
|
props: ComponentColumnProps
|
|
105
106
|
) => JSX.Element;
|
|
@@ -107,14 +108,31 @@ const DataCell = ({
|
|
|
107
108
|
const isCellHidden = getHiddenCondition?.(isRowSelected);
|
|
108
109
|
|
|
109
110
|
if (isCellHidden) {
|
|
110
|
-
return
|
|
111
|
+
return (
|
|
112
|
+
<Cell
|
|
113
|
+
className={classes.cell}
|
|
114
|
+
isRowHighlighted={isRowHighlighted}
|
|
115
|
+
listingVariant={listingVariant}
|
|
116
|
+
onClick={(e): void => {
|
|
117
|
+
if (!clickable) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
}}
|
|
123
|
+
{...commonCellProps}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
111
126
|
}
|
|
112
127
|
|
|
113
128
|
return (
|
|
114
129
|
<Cell
|
|
115
|
-
className={classes.cell}
|
|
130
|
+
className={cx(classes.cell, clickable && classes.clickable)}
|
|
116
131
|
isRowHighlighted={isRowHighlighted}
|
|
117
132
|
listingVariant={listingVariant}
|
|
133
|
+
style={{
|
|
134
|
+
alignItems: align
|
|
135
|
+
}}
|
|
118
136
|
onClick={(e): void => {
|
|
119
137
|
if (!clickable) {
|
|
120
138
|
return;
|