@centreon/ui 24.4.1-MON-21276-Create-a-basic-token.7 → 24.4.1-MON-33109-dashboard-list.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.
- package/package.json +1 -1
- package/src/Button/Save/index.tsx +3 -3
- package/src/Dialog/index.tsx +1 -1
- package/src/InputField/Select/Autocomplete/index.tsx +115 -121
- package/src/InputField/Text/index.tsx +2 -2
- package/src/Listing/index.tsx +148 -133
- package/src/TimePeriods/DateTimePickerInput.tsx +3 -12
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { any, isEmpty, isNil, not, or, pipe } from 'ramda';
|
|
|
2
2
|
import { makeStyles } from 'tss-react/mui';
|
|
3
3
|
|
|
4
4
|
import { Theme, Tooltip, TypographyProps } from '@mui/material';
|
|
5
|
-
import { LoadingButton
|
|
5
|
+
import { LoadingButton } from '@mui/lab';
|
|
6
6
|
|
|
7
7
|
import { getNormalizedId } from '../../utils';
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ const useStyles = makeStyles()((theme: Theme) => ({
|
|
|
15
15
|
}
|
|
16
16
|
}));
|
|
17
17
|
|
|
18
|
-
interface Props {
|
|
18
|
+
interface Props extends Record<string, unknown> {
|
|
19
19
|
className?: string;
|
|
20
20
|
labelLoading?: string;
|
|
21
21
|
labelProps?: TypographyProps;
|
|
@@ -50,7 +50,7 @@ const SaveButton = ({
|
|
|
50
50
|
startIcon = true,
|
|
51
51
|
labelProps,
|
|
52
52
|
...rest
|
|
53
|
-
}: Props
|
|
53
|
+
}: Props): JSX.Element => {
|
|
54
54
|
const { classes, cx } = useStyles();
|
|
55
55
|
const hasLabel = hasValue([labelLoading, labelSave, labelSucceeded]);
|
|
56
56
|
|
package/src/Dialog/index.tsx
CHANGED
|
@@ -43,7 +43,7 @@ export type Props = {
|
|
|
43
43
|
dialogTitleClassName?: string;
|
|
44
44
|
labelCancel?: string | null;
|
|
45
45
|
labelConfirm?: string | null;
|
|
46
|
-
labelTitle?:
|
|
46
|
+
labelTitle?: string | null;
|
|
47
47
|
onCancel?: () => void;
|
|
48
48
|
onClose?: () => void;
|
|
49
49
|
onConfirm: (event, value?) => void;
|
|
@@ -141,132 +141,126 @@ 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
|
-
|
|
168
|
-
): JSX.Element => {
|
|
169
|
-
const { classes, cx } = useStyles({ hideInput });
|
|
170
|
-
const { t } = useTranslation();
|
|
171
|
-
const theme = useTheme();
|
|
144
|
+
const AutocompleteField = ({
|
|
145
|
+
options,
|
|
146
|
+
label,
|
|
147
|
+
placeholder,
|
|
148
|
+
loading = false,
|
|
149
|
+
onTextChange = (): void => undefined,
|
|
150
|
+
endAdornment = undefined,
|
|
151
|
+
inputValue,
|
|
152
|
+
displayOptionThumbnail = false,
|
|
153
|
+
required = false,
|
|
154
|
+
error,
|
|
155
|
+
displayPopupIcon = true,
|
|
156
|
+
autoFocus = false,
|
|
157
|
+
hideInput = false,
|
|
158
|
+
dataTestId,
|
|
159
|
+
autoSize = false,
|
|
160
|
+
autoSizeDefaultWidth = 0,
|
|
161
|
+
autoSizeCustomPadding,
|
|
162
|
+
getOptionItemLabel = (option) => option.name,
|
|
163
|
+
...autocompleteProps
|
|
164
|
+
}: Props): JSX.Element => {
|
|
165
|
+
const { classes, cx } = useStyles({ hideInput });
|
|
166
|
+
const { t } = useTranslation();
|
|
167
|
+
const theme = useTheme();
|
|
172
168
|
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
const areSelectEntriesEqual = (option, value): boolean => {
|
|
170
|
+
const identifyingProps = ['id', 'name'];
|
|
175
171
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
paddingRight: theme.spacing(5)
|
|
204
|
-
}
|
|
205
|
-
}}
|
|
206
|
-
autoFocus={autoFocus}
|
|
207
|
-
autoSize={autoSize}
|
|
208
|
-
autoSizeCustomPadding={7 + (autoSizeCustomPadding || 0)}
|
|
209
|
-
autoSizeDefaultWidth={autoSizeDefaultWidth}
|
|
210
|
-
classes={{
|
|
211
|
-
root: classes.textfield
|
|
212
|
-
}}
|
|
213
|
-
error={error}
|
|
214
|
-
externalValueForAutoSize={autocompleteProps?.value?.name}
|
|
215
|
-
inputProps={{
|
|
216
|
-
...params.inputProps,
|
|
217
|
-
'aria-label': label,
|
|
218
|
-
'data-testid': dataTestId || label,
|
|
219
|
-
id: getNormalizedId(label || '')
|
|
220
|
-
}}
|
|
221
|
-
label={label}
|
|
222
|
-
placeholder={isNil(placeholder) ? t(searchLabel) : placeholder}
|
|
223
|
-
required={required}
|
|
224
|
-
value={inputValue || undefined}
|
|
225
|
-
onChange={onTextChange}
|
|
226
|
-
/>
|
|
172
|
+
return equals(
|
|
173
|
+
pick(identifyingProps, option),
|
|
174
|
+
pick(identifyingProps, value)
|
|
227
175
|
);
|
|
176
|
+
};
|
|
228
177
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
178
|
+
const renderInput = (params): JSX.Element => (
|
|
179
|
+
<TextField
|
|
180
|
+
{...params}
|
|
181
|
+
InputLabelProps={{
|
|
182
|
+
classes: {
|
|
183
|
+
marginDense: classes.inputLabel,
|
|
184
|
+
shrink: classes.inputLabelShrink
|
|
185
|
+
}
|
|
186
|
+
}}
|
|
187
|
+
InputProps={{
|
|
188
|
+
...params.InputProps,
|
|
189
|
+
endAdornment: (
|
|
190
|
+
<>
|
|
191
|
+
{endAdornment && (
|
|
192
|
+
<InputAdornment position="end">{endAdornment}</InputAdornment>
|
|
193
|
+
)}
|
|
194
|
+
{params.InputProps.endAdornment}
|
|
195
|
+
</>
|
|
196
|
+
),
|
|
197
|
+
style: {
|
|
198
|
+
background: 'transparent',
|
|
199
|
+
paddingRight: theme.spacing(5)
|
|
244
200
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
201
|
+
}}
|
|
202
|
+
autoFocus={autoFocus}
|
|
203
|
+
autoSize={autoSize}
|
|
204
|
+
autoSizeCustomPadding={7 + (autoSizeCustomPadding || 0)}
|
|
205
|
+
autoSizeDefaultWidth={autoSizeDefaultWidth}
|
|
206
|
+
classes={{
|
|
207
|
+
root: classes.textfield
|
|
208
|
+
}}
|
|
209
|
+
error={error}
|
|
210
|
+
externalValueForAutoSize={autocompleteProps?.value?.name}
|
|
211
|
+
inputProps={{
|
|
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}
|
|
256
254
|
>
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
/>
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
);
|
|
255
|
+
{getOptionItemLabel(option)}
|
|
256
|
+
</Option>
|
|
257
|
+
</li>
|
|
258
|
+
);
|
|
259
|
+
}}
|
|
260
|
+
size="small"
|
|
261
|
+
{...autocompleteProps}
|
|
262
|
+
/>
|
|
263
|
+
);
|
|
264
|
+
};
|
|
271
265
|
|
|
272
266
|
export default AutocompleteField;
|
|
@@ -155,9 +155,9 @@ const TextField = forwardRef(
|
|
|
155
155
|
helperText={displayErrorInTooltip ? undefined : error}
|
|
156
156
|
id={getNormalizedId(dataTestId || '')}
|
|
157
157
|
inputProps={{
|
|
158
|
+
...rest.inputProps,
|
|
158
159
|
'aria-label': ariaLabel,
|
|
159
|
-
'data-testid': dataTestId
|
|
160
|
-
...rest.inputProps
|
|
160
|
+
'data-testid': dataTestId
|
|
161
161
|
}}
|
|
162
162
|
label={label}
|
|
163
163
|
ref={ref}
|
package/src/Listing/index.tsx
CHANGED
|
@@ -93,9 +93,11 @@ export interface Props<TRow> {
|
|
|
93
93
|
columnConfiguration?: ColumnConfiguration;
|
|
94
94
|
columns: Array<Column>;
|
|
95
95
|
currentPage?: number;
|
|
96
|
+
customListingComponent?: JSX.Element;
|
|
96
97
|
customPaginationClassName?: string;
|
|
97
98
|
disableRowCheckCondition?: (row) => boolean;
|
|
98
99
|
disableRowCondition?: (row) => boolean;
|
|
100
|
+
displayCostumListing?: boolean;
|
|
99
101
|
getHighlightRowCondition?: (row: TRow) => boolean;
|
|
100
102
|
getId?: (row: TRow) => RowId;
|
|
101
103
|
headerMemoProps?: Array<unknown>;
|
|
@@ -138,6 +140,8 @@ const defaultColumnConfiguration = {
|
|
|
138
140
|
export const performanceRowsLimit = 60;
|
|
139
141
|
|
|
140
142
|
const Listing = <TRow extends { id: RowId }>({
|
|
143
|
+
customListingComponent,
|
|
144
|
+
displayCostumListing,
|
|
141
145
|
limit = 10,
|
|
142
146
|
visualizationActions,
|
|
143
147
|
columns,
|
|
@@ -494,150 +498,161 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
494
498
|
onSelectColumns={onSelectColumns}
|
|
495
499
|
/>
|
|
496
500
|
</div>
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}}
|
|
511
|
-
>
|
|
512
|
-
<Table
|
|
513
|
-
stickyHeader
|
|
514
|
-
className={classes.table}
|
|
501
|
+
{displayCostumListing ? (
|
|
502
|
+
customListingComponent
|
|
503
|
+
) : (
|
|
504
|
+
<ParentSize
|
|
505
|
+
parentSizeStyles={{
|
|
506
|
+
height: '100%',
|
|
507
|
+
overflowY: 'auto',
|
|
508
|
+
width: '100%'
|
|
509
|
+
}}
|
|
510
|
+
>
|
|
511
|
+
{({ height }) => (
|
|
512
|
+
<Box
|
|
513
|
+
className={classes.tableWrapper}
|
|
515
514
|
component="div"
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
style={{
|
|
516
|
+
height: innerScrollDisabled
|
|
517
|
+
? '100%'
|
|
518
|
+
: `calc(${height}px - 4px)`
|
|
519
|
+
}}
|
|
518
520
|
>
|
|
519
|
-
<
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
columnConfiguration={columnConfiguration}
|
|
523
|
-
columns={columns}
|
|
524
|
-
listingVariant={listingVariant}
|
|
525
|
-
memoProps={headerMemoProps}
|
|
526
|
-
predefinedRowsSelection={predefinedRowsSelection}
|
|
527
|
-
rowCount={limit - emptyRows}
|
|
528
|
-
selectedRowCount={selectedRows.length}
|
|
529
|
-
sortField={sortField}
|
|
530
|
-
sortOrder={sortOrder}
|
|
531
|
-
onSelectAllClick={selectAllRows}
|
|
532
|
-
onSelectColumns={onSelectColumns}
|
|
533
|
-
onSelectRowsWithCondition={onSelectRowsWithCondition}
|
|
534
|
-
onSort={onSort}
|
|
535
|
-
/>
|
|
536
|
-
|
|
537
|
-
<TableBody
|
|
538
|
-
className={classes.tableBody}
|
|
521
|
+
<Table
|
|
522
|
+
stickyHeader
|
|
523
|
+
className={classes.table}
|
|
539
524
|
component="div"
|
|
540
|
-
|
|
525
|
+
role={undefined}
|
|
526
|
+
size="small"
|
|
541
527
|
>
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
row
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
528
|
+
<ListingHeader
|
|
529
|
+
areColumnsEditable={areColumnsEditable}
|
|
530
|
+
checkable={checkable}
|
|
531
|
+
columnConfiguration={columnConfiguration}
|
|
532
|
+
columns={columns}
|
|
533
|
+
listingVariant={listingVariant}
|
|
534
|
+
memoProps={headerMemoProps}
|
|
535
|
+
predefinedRowsSelection={predefinedRowsSelection}
|
|
536
|
+
rowCount={limit - emptyRows}
|
|
537
|
+
selectedRowCount={selectedRows.length}
|
|
538
|
+
sortField={sortField}
|
|
539
|
+
sortOrder={sortOrder}
|
|
540
|
+
onSelectAllClick={selectAllRows}
|
|
541
|
+
onSelectColumns={onSelectColumns}
|
|
542
|
+
onSelectRowsWithCondition={onSelectRowsWithCondition}
|
|
543
|
+
onSort={onSort}
|
|
544
|
+
/>
|
|
545
|
+
|
|
546
|
+
<TableBody
|
|
547
|
+
className={classes.tableBody}
|
|
548
|
+
component="div"
|
|
549
|
+
onMouseLeave={clearHoveredRow}
|
|
550
|
+
>
|
|
551
|
+
{rowsToDisplay.map((row, index) => {
|
|
552
|
+
const isRowSelected = isSelected(row);
|
|
553
|
+
const isRowHovered = equals(hoveredRowId, getId(row));
|
|
554
|
+
const isSubItem = allSubItemIds.includes(row.id);
|
|
555
|
+
|
|
556
|
+
return (
|
|
557
|
+
<ListingRow
|
|
558
|
+
checkable={
|
|
559
|
+
checkable &&
|
|
560
|
+
(!isSubItem || subItems.canCheckSubItems)
|
|
561
|
+
}
|
|
562
|
+
columnConfiguration={columnConfiguration}
|
|
563
|
+
columnIds={columns.map(prop('id'))}
|
|
564
|
+
disableRowCondition={disableRowCondition}
|
|
565
|
+
isHovered={isRowHovered}
|
|
566
|
+
isSelected={isRowSelected}
|
|
567
|
+
isShiftKeyDown={isShiftKeyDown}
|
|
568
|
+
key={
|
|
569
|
+
gte(limit, performanceRowsLimit)
|
|
570
|
+
? `row_${index}`
|
|
571
|
+
: getId(row)
|
|
572
|
+
}
|
|
573
|
+
lastSelectionIndex={lastSelectionIndex}
|
|
574
|
+
limit={limit}
|
|
575
|
+
listingVariant={listingVariant}
|
|
576
|
+
row={row}
|
|
577
|
+
rowColorConditions={rowColorConditions}
|
|
578
|
+
shiftKeyDownRowPivot={shiftKeyDownRowPivot}
|
|
579
|
+
subItemsPivots={subItemsPivots}
|
|
580
|
+
tabIndex={-1}
|
|
581
|
+
visibleColumns={visibleColumns}
|
|
582
|
+
onClick={(): void => {
|
|
583
|
+
onRowClick(row);
|
|
584
|
+
}}
|
|
585
|
+
onFocus={(): void => hoverRow(row)}
|
|
586
|
+
onMouseOver={(): void => hoverRow(row)}
|
|
587
|
+
>
|
|
588
|
+
{checkable &&
|
|
589
|
+
(!isSubItem || subItems.canCheckSubItems ? (
|
|
590
|
+
<Cell
|
|
591
|
+
align="left"
|
|
592
|
+
className={classes.checkbox}
|
|
593
|
+
disableRowCondition={disableRowCondition}
|
|
594
|
+
isRowHovered={isRowHovered}
|
|
595
|
+
row={row}
|
|
596
|
+
rowColorConditions={rowColorConditions}
|
|
597
|
+
onClick={(event): void => selectRow(event, row)}
|
|
598
|
+
>
|
|
599
|
+
<Checkbox
|
|
600
|
+
checked={isRowSelected}
|
|
601
|
+
disabled={
|
|
602
|
+
disableRowCheckCondition(row) ||
|
|
603
|
+
disableRowCondition(row)
|
|
604
|
+
}
|
|
605
|
+
inputProps={{
|
|
606
|
+
'aria-label': `Select row ${getId(row)}`
|
|
607
|
+
}}
|
|
608
|
+
/>
|
|
609
|
+
</Cell>
|
|
610
|
+
) : (
|
|
611
|
+
<Cell
|
|
612
|
+
align="left"
|
|
613
|
+
disableRowCondition={disableRowCondition}
|
|
614
|
+
isRowHovered={isRowHovered}
|
|
615
|
+
row={row}
|
|
616
|
+
rowColorConditions={rowColorConditions}
|
|
598
617
|
/>
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
618
|
+
))}
|
|
619
|
+
|
|
620
|
+
{visibleColumns.map((column) => (
|
|
621
|
+
<DataCell
|
|
622
|
+
column={column}
|
|
603
623
|
disableRowCondition={disableRowCondition}
|
|
624
|
+
getHighlightRowCondition={
|
|
625
|
+
getHighlightRowCondition
|
|
626
|
+
}
|
|
604
627
|
isRowHovered={isRowHovered}
|
|
628
|
+
isRowSelected={isRowSelected}
|
|
629
|
+
key={`${getId(row)}-${column.id}`}
|
|
630
|
+
labelCollapse={subItems.labelCollapse}
|
|
631
|
+
labelExpand={subItems.labelExpand}
|
|
632
|
+
listingVariant={listingVariant}
|
|
605
633
|
row={row}
|
|
606
634
|
rowColorConditions={rowColorConditions}
|
|
635
|
+
subItemsRowProperty={subItems?.getRowProperty(
|
|
636
|
+
row
|
|
637
|
+
)}
|
|
607
638
|
/>
|
|
608
639
|
))}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
))}
|
|
626
|
-
</ListingRow>
|
|
627
|
-
);
|
|
628
|
-
})}
|
|
629
|
-
|
|
630
|
-
{rows.length < 1 &&
|
|
631
|
-
(loading ? (
|
|
632
|
-
<SkeletonLoader rows={limit} />
|
|
633
|
-
) : (
|
|
634
|
-
<EmptyResult label={t(labelNoResultFound)} />
|
|
635
|
-
))}
|
|
636
|
-
</TableBody>
|
|
637
|
-
</Table>
|
|
638
|
-
</Box>
|
|
639
|
-
)}
|
|
640
|
-
</ParentSize>
|
|
640
|
+
</ListingRow>
|
|
641
|
+
);
|
|
642
|
+
})}
|
|
643
|
+
|
|
644
|
+
{rows.length < 1 &&
|
|
645
|
+
(loading ? (
|
|
646
|
+
<SkeletonLoader rows={limit} />
|
|
647
|
+
) : (
|
|
648
|
+
<EmptyResult label={t(labelNoResultFound)} />
|
|
649
|
+
))}
|
|
650
|
+
</TableBody>
|
|
651
|
+
</Table>
|
|
652
|
+
</Box>
|
|
653
|
+
)}
|
|
654
|
+
</ParentSize>
|
|
655
|
+
)}
|
|
641
656
|
</div>
|
|
642
657
|
</div>
|
|
643
658
|
);
|
|
@@ -4,11 +4,7 @@ import dayjs, { Dayjs } from 'dayjs';
|
|
|
4
4
|
import { useAtomValue } from 'jotai';
|
|
5
5
|
import { equals } from 'ramda';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
DateTimePicker,
|
|
9
|
-
DateTimePickerProps,
|
|
10
|
-
LocalizationProvider
|
|
11
|
-
} from '@mui/x-date-pickers';
|
|
7
|
+
import { DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
12
8
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
13
9
|
|
|
14
10
|
import { userAtom } from '@centreon/ui-context';
|
|
@@ -27,7 +23,6 @@ interface Props {
|
|
|
27
23
|
disabled?: boolean;
|
|
28
24
|
maxDate?: Date;
|
|
29
25
|
minDate?: Date;
|
|
30
|
-
minDateTime?: Date;
|
|
31
26
|
property: CustomTimePeriodProperty | string;
|
|
32
27
|
}
|
|
33
28
|
|
|
@@ -35,13 +30,11 @@ const DateTimePickerInput = ({
|
|
|
35
30
|
date,
|
|
36
31
|
maxDate,
|
|
37
32
|
minDate,
|
|
38
|
-
minDateTime,
|
|
39
33
|
property,
|
|
40
34
|
changeDate,
|
|
41
35
|
disabled = false,
|
|
42
|
-
desktopMediaQuery
|
|
43
|
-
|
|
44
|
-
}: Props & DateTimePickerProps<dayjs.Dayjs>): JSX.Element => {
|
|
36
|
+
desktopMediaQuery
|
|
37
|
+
}: Props): JSX.Element => {
|
|
45
38
|
const desktopPickerMediaQuery =
|
|
46
39
|
'@media (min-width: 1024px) or (pointer: fine)';
|
|
47
40
|
|
|
@@ -74,10 +67,8 @@ const DateTimePickerInput = ({
|
|
|
74
67
|
disabled={disabled}
|
|
75
68
|
maxDate={maxDate && formatDate(maxDate)}
|
|
76
69
|
minDate={minDate && formatDate(minDate)}
|
|
77
|
-
minDateTime={minDateTime && formatDate(minDateTime)}
|
|
78
70
|
value={formatDate(date)}
|
|
79
71
|
onChange={changeTime}
|
|
80
|
-
{...rest}
|
|
81
72
|
/>
|
|
82
73
|
</LocalizationProvider>
|
|
83
74
|
);
|