@centreon/ui 24.4.30 → 24.4.32
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 +14 -19
- package/public/mockServiceWorker.js +1 -1
- package/src/Button/Icon/index.tsx +1 -1
- package/src/Button/Save/StartIcon.tsx +3 -3
- package/src/Button/Save/index.tsx +5 -9
- 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/index.tsx +1 -1
- package/src/FallbackPage/FallbackPage.tsx +3 -3
- package/src/FileDropZone/index.tsx +1 -3
- package/src/Form/Inputs/CheckboxGroup.tsx +4 -1
- package/src/Form/Inputs/index.tsx +1 -3
- package/src/Form/Inputs/models.ts +1 -9
- package/src/Graph/LineChart/BasicComponents/Lines/Threshold/Circle.tsx +2 -2
- package/src/Graph/LineChart/BasicComponents/Lines/Threshold/index.tsx +4 -5
- 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/Annotation/index.tsx +3 -2
- package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
- package/src/Graph/LineChart/Legend/useLegend.ts +3 -3
- package/src/Graph/LineChart/helpers/doc.ts +13 -16
- package/src/Graph/LineChart/helpers/index.ts +1 -1
- package/src/Graph/LineChart/index.stories.tsx +2 -4
- package/src/Graph/SingleBar/Thresholds.tsx +2 -2
- package/src/Graph/Text/Text.stories.tsx +4 -60
- package/src/Graph/common/timeSeries/index.ts +3 -3
- package/src/InputField/Number/Number.cypress.spec.tsx +85 -0
- package/src/InputField/Number/Number.stories.tsx +66 -0
- package/src/InputField/Number/Number.tsx +74 -0
- package/src/InputField/Search/index.tsx +2 -2
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +7 -10
- 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/index.tsx +115 -121
- package/src/InputField/Select/IconPopover/index.tsx +2 -2
- package/src/InputField/Select/index.tsx +1 -1
- package/src/InputField/Text/index.tsx +40 -40
- package/src/Listing/Cell/DataCell.tsx +1 -15
- package/src/Listing/Header/ListingHeader.tsx +1 -1
- package/src/Listing/Listing.cypress.spec.tsx +2 -2
- package/src/Listing/Listing.styles.ts +3 -2
- package/src/Listing/index.stories.tsx +3 -14
- package/src/Listing/index.tsx +125 -138
- package/src/Module/index.tsx +4 -2
- package/src/RichTextEditor/RichTextEditor.tsx +1 -12
- package/src/SortableItems/index.tsx +7 -2
- package/src/ThemeProvider/index.tsx +0 -24
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +3 -8
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +2 -0
- package/src/TimePeriods/DateTimePickerInput.tsx +19 -56
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +33 -9
- package/src/TimePeriods/helpers/index.ts +1 -1
- package/src/TimePeriods/index.stories.tsx +4 -12
- package/src/TimePeriods/index.tsx +2 -2
- package/src/api/QueryProvider.tsx +1 -1
- package/src/api/TestQueryProvider.tsx +1 -1
- package/src/api/useFetchQuery/index.ts +23 -27
- package/src/api/useMutationQuery/index.ts +21 -45
- package/src/components/Button/Icon/IconButton.tsx +2 -6
- package/src/components/DataTable/DataTable.stories.tsx +0 -40
- package/src/components/DataTable/DataTable.styles.ts +0 -3
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/DataTable/Item/DataTableItem.styles.ts +2 -7
- package/src/components/DataTable/Item/DataTableItem.tsx +4 -4
- package/src/components/DataTable/index.ts +1 -3
- package/src/components/Form/AccessRights/__fixtures__/contactAccessRight.mock.ts +0 -2
- package/src/components/Form/AccessRights/useAccessRightsForm.utils.ts +1 -1
- package/src/components/Form/Dashboard/DashboardForm.tsx +12 -15
- package/src/components/Layout/PageLayout/PageLayout.tsx +1 -1
- package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -1
- package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -1
- package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +1 -5
- package/src/components/Layout/PageLayout/index.ts +1 -3
- package/src/components/Modal/Modal.styles.ts +3 -4
- package/src/components/Modal/ModalActions.tsx +2 -4
- 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 +3 -2
- package/src/queryParameters/url/index.ts +1 -5
- package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +281 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/useDateTimePickerAdapter.ts +309 -0
- package/src/utils/{useLicenseExpirationWarning.test.tsx → useLicenseExpirationWarning.cypress.spec.tsx} +37 -48
- package/src/utils/useLicenseExpirationWarning.ts +18 -18
- package/src/Form/Form.cypress.spec.tsx +0 -133
- package/src/Form/Inputs/List/Content.tsx +0 -62
- package/src/Form/Inputs/List/List.styles.ts +0 -29
- package/src/Form/Inputs/List/List.tsx +0 -58
- package/src/Form/Inputs/List/useList.ts +0 -81
- package/src/Module/Module.cypress.spec.tsx +0 -129
- package/src/components/DataTable/DataListing.tsx +0 -6
- package/src/components/DataTable/DataTable.cypress.spec.tsx +0 -193
- package/src/components/Layout/PageLayout/PageQuickAccess.tsx +0 -76
- package/src/components/Layout/PageLayout.cypress.spec.tsx +0 -66
- package/src/utils/usePluralizedTranslation.ts +0 -21
|
@@ -17,38 +17,36 @@ import { getNormalizedId } from '../../utils';
|
|
|
17
17
|
|
|
18
18
|
import useAutoSize from './useAutoSize';
|
|
19
19
|
|
|
20
|
-
const useStyles = makeStyles
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})
|
|
51
|
-
);
|
|
20
|
+
const useStyles = makeStyles()((theme: Theme) => ({
|
|
21
|
+
autoSizeCompact: {
|
|
22
|
+
paddingRight: theme.spacing(1),
|
|
23
|
+
paddingTop: theme.spacing(0.6)
|
|
24
|
+
},
|
|
25
|
+
hiddenText: {
|
|
26
|
+
display: 'table',
|
|
27
|
+
lineHeight: 0,
|
|
28
|
+
transform: 'scaleY(0)'
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
fontSize: theme.typography.body1.fontSize
|
|
32
|
+
},
|
|
33
|
+
inputBase: {
|
|
34
|
+
display: 'inline-flex',
|
|
35
|
+
justifyItems: 'start',
|
|
36
|
+
paddingRight: theme.spacing(1)
|
|
37
|
+
},
|
|
38
|
+
noLabelInput: {
|
|
39
|
+
padding: theme.spacing(1)
|
|
40
|
+
},
|
|
41
|
+
textField: {
|
|
42
|
+
transition: theme.transitions.create(['width'], {
|
|
43
|
+
duration: theme.transitions.duration.shortest
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
transparent: {
|
|
47
|
+
backgroundColor: 'transparent'
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
52
50
|
|
|
53
51
|
interface OptionalLabelInputAdornmentProps {
|
|
54
52
|
children: React.ReactNode;
|
|
@@ -72,7 +70,7 @@ const OptionalLabelInputAdornment = ({
|
|
|
72
70
|
|
|
73
71
|
type SizeVariant = 'large' | 'medium' | 'small' | 'compact';
|
|
74
72
|
|
|
75
|
-
export type
|
|
73
|
+
export type TextProps = {
|
|
76
74
|
EndAdornment?: React.FC;
|
|
77
75
|
StartAdornment?: React.FC;
|
|
78
76
|
ariaLabel?: string;
|
|
@@ -114,17 +112,18 @@ const TextField = forwardRef(
|
|
|
114
112
|
defaultValue,
|
|
115
113
|
required = false,
|
|
116
114
|
containerClassName,
|
|
115
|
+
type,
|
|
117
116
|
...rest
|
|
118
|
-
}:
|
|
117
|
+
}: TextProps,
|
|
119
118
|
ref: React.ForwardedRef<HTMLDivElement>
|
|
120
119
|
): JSX.Element => {
|
|
121
|
-
const { classes, cx } = useStyles(
|
|
122
|
-
displayAsBlock: autoSize && isNil(StartAdornment) && isNil(EndAdornment)
|
|
123
|
-
});
|
|
120
|
+
const { classes, cx } = useStyles();
|
|
124
121
|
|
|
125
122
|
const { inputRef, width, changeInputValue, innerValue } = useAutoSize({
|
|
126
123
|
autoSize,
|
|
127
|
-
autoSizeCustomPadding,
|
|
124
|
+
autoSizeCustomPadding: equals(type, 'number')
|
|
125
|
+
? Math.max(6, autoSizeCustomPadding || 0)
|
|
126
|
+
: autoSizeCustomPadding,
|
|
128
127
|
autoSizeDefaultWidth,
|
|
129
128
|
value: externalValueForAutoSize || rest.value
|
|
130
129
|
});
|
|
@@ -155,9 +154,9 @@ const TextField = forwardRef(
|
|
|
155
154
|
helperText={displayErrorInTooltip ? undefined : error}
|
|
156
155
|
id={getNormalizedId(dataTestId || '')}
|
|
157
156
|
inputProps={{
|
|
157
|
+
...rest.inputProps,
|
|
158
158
|
'aria-label': ariaLabel,
|
|
159
|
-
'data-testid': dataTestId
|
|
160
|
-
...rest.inputProps
|
|
159
|
+
'data-testid': dataTestId
|
|
161
160
|
}}
|
|
162
161
|
label={label}
|
|
163
162
|
ref={ref}
|
|
@@ -196,6 +195,7 @@ const TextField = forwardRef(
|
|
|
196
195
|
width: autoSize ? width : undefined,
|
|
197
196
|
...rest?.sx
|
|
198
197
|
}}
|
|
198
|
+
type={type}
|
|
199
199
|
/>
|
|
200
200
|
</Tooltip>
|
|
201
201
|
{autoSize && (
|
|
@@ -107,21 +107,7 @@ const DataCell = ({
|
|
|
107
107
|
const isCellHidden = getHiddenCondition?.(isRowSelected);
|
|
108
108
|
|
|
109
109
|
if (isCellHidden) {
|
|
110
|
-
return
|
|
111
|
-
<Cell
|
|
112
|
-
className={classes.cell}
|
|
113
|
-
isRowHighlighted={isRowHighlighted}
|
|
114
|
-
listingVariant={listingVariant}
|
|
115
|
-
onClick={(e): void => {
|
|
116
|
-
if (!clickable) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
e.stopPropagation();
|
|
121
|
-
}}
|
|
122
|
-
{...commonCellProps}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
110
|
+
return null;
|
|
125
111
|
}
|
|
126
112
|
|
|
127
113
|
return (
|
|
@@ -77,9 +77,9 @@ const mountListing = (): void => {
|
|
|
77
77
|
subItems={{
|
|
78
78
|
canCheckSubItems: false,
|
|
79
79
|
enable: true,
|
|
80
|
-
getRowProperty: () => 'subItems',
|
|
81
80
|
labelCollapse: 'Collapse',
|
|
82
|
-
labelExpand: 'Expand'
|
|
81
|
+
labelExpand: 'Expand',
|
|
82
|
+
rowProperty: 'subItems'
|
|
83
83
|
}}
|
|
84
84
|
totalRows={10}
|
|
85
85
|
/>
|
|
@@ -9,12 +9,13 @@ const loadingIndicatorHeight = 3;
|
|
|
9
9
|
interface StylesProps {
|
|
10
10
|
dataStyle: TableStyle;
|
|
11
11
|
getGridTemplateColumn: string;
|
|
12
|
+
limit: number;
|
|
12
13
|
listingVariant: ListingVariant;
|
|
13
14
|
rows: Array<unknown>;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const useListingStyles = makeStyles<StylesProps>()(
|
|
17
|
-
(theme, { dataStyle, getGridTemplateColumn, rows }) => ({
|
|
18
|
+
(theme, { dataStyle, getGridTemplateColumn, rows, limit }) => ({
|
|
18
19
|
actionBar: {
|
|
19
20
|
alignItems: 'center',
|
|
20
21
|
display: 'flex'
|
|
@@ -55,7 +56,7 @@ const useListingStyles = makeStyles<StylesProps>()(
|
|
|
55
56
|
display: 'grid',
|
|
56
57
|
gridTemplateColumns: getGridTemplateColumn,
|
|
57
58
|
gridTemplateRows: `${theme.spacing(dataStyle.header.height / 8)} repeat(${
|
|
58
|
-
rows?.length ||
|
|
59
|
+
rows?.length || limit
|
|
59
60
|
}, ${dataStyle.body.height}px)`,
|
|
60
61
|
position: 'relative'
|
|
61
62
|
},
|
|
@@ -366,16 +366,6 @@ const columnsWithSubItems = [
|
|
|
366
366
|
}
|
|
367
367
|
];
|
|
368
368
|
|
|
369
|
-
const TemplateSubItems = (args): JSX.Element => {
|
|
370
|
-
const { classes } = useStyles();
|
|
371
|
-
|
|
372
|
-
return (
|
|
373
|
-
<div className={classes.listing}>
|
|
374
|
-
<Listing {...args} />
|
|
375
|
-
</div>
|
|
376
|
-
);
|
|
377
|
-
};
|
|
378
|
-
|
|
379
369
|
export const ListingWithSubItems = {
|
|
380
370
|
args: {
|
|
381
371
|
checkable: true,
|
|
@@ -387,11 +377,10 @@ export const ListingWithSubItems = {
|
|
|
387
377
|
subItems: {
|
|
388
378
|
canCheckSubItems: false,
|
|
389
379
|
enable: true,
|
|
390
|
-
getRowProperty: () => 'subItems',
|
|
391
380
|
labelCollapse: 'Collapse',
|
|
392
|
-
labelExpand: 'Expand'
|
|
381
|
+
labelExpand: 'Expand',
|
|
382
|
+
rowProperty: 'subItems'
|
|
393
383
|
},
|
|
394
384
|
totalRows: 10
|
|
395
|
-
}
|
|
396
|
-
render: TemplateSubItems
|
|
385
|
+
}
|
|
397
386
|
};
|
package/src/Listing/index.tsx
CHANGED
|
@@ -69,7 +69,7 @@ const getVisibleColumns = ({
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return selectedColumnIds.map((id) =>
|
|
72
|
-
columns.find(propEq(id,
|
|
72
|
+
columns.find(propEq('id', id))
|
|
73
73
|
) as Array<Column>;
|
|
74
74
|
};
|
|
75
75
|
|
|
@@ -93,11 +93,9 @@ export interface Props<TRow> {
|
|
|
93
93
|
columnConfiguration?: ColumnConfiguration;
|
|
94
94
|
columns: Array<Column>;
|
|
95
95
|
currentPage?: number;
|
|
96
|
-
customListingComponent?: JSX.Element;
|
|
97
96
|
customPaginationClassName?: string;
|
|
98
97
|
disableRowCheckCondition?: (row) => boolean;
|
|
99
98
|
disableRowCondition?: (row) => boolean;
|
|
100
|
-
displayCustomListing?: boolean;
|
|
101
99
|
getHighlightRowCondition?: (row: TRow) => boolean;
|
|
102
100
|
getId?: (row: TRow) => RowId;
|
|
103
101
|
headerMemoProps?: Array<unknown>;
|
|
@@ -123,9 +121,9 @@ export interface Props<TRow> {
|
|
|
123
121
|
subItems?: {
|
|
124
122
|
canCheckSubItems: boolean;
|
|
125
123
|
enable: boolean;
|
|
126
|
-
getRowProperty: (row?) => string;
|
|
127
124
|
labelCollapse: string;
|
|
128
125
|
labelExpand: string;
|
|
126
|
+
rowProperty: string;
|
|
129
127
|
};
|
|
130
128
|
totalRows?: number;
|
|
131
129
|
viewerModeConfiguration?: ViewerModeConfiguration;
|
|
@@ -140,8 +138,6 @@ const defaultColumnConfiguration = {
|
|
|
140
138
|
export const performanceRowsLimit = 60;
|
|
141
139
|
|
|
142
140
|
const Listing = <TRow extends { id: RowId }>({
|
|
143
|
-
customListingComponent,
|
|
144
|
-
displayCustomListing,
|
|
145
141
|
limit = 10,
|
|
146
142
|
visualizationActions,
|
|
147
143
|
columns,
|
|
@@ -180,9 +176,9 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
180
176
|
subItems = {
|
|
181
177
|
canCheckSubItems: false,
|
|
182
178
|
enable: false,
|
|
183
|
-
getRowProperty: () => '',
|
|
184
179
|
labelCollapse: 'Collapse',
|
|
185
|
-
labelExpand: 'Expand'
|
|
180
|
+
labelExpand: 'Expand',
|
|
181
|
+
rowProperty: ''
|
|
186
182
|
}
|
|
187
183
|
}: Props<TRow>): JSX.Element => {
|
|
188
184
|
const currentVisibleColumns = getVisibleColumns({
|
|
@@ -215,10 +211,10 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
215
211
|
? reduce<TRow, Array<TRow>>(
|
|
216
212
|
(acc, row): Array<TRow> => {
|
|
217
213
|
if (
|
|
218
|
-
row[subItems.
|
|
214
|
+
row[subItems.rowProperty] &&
|
|
219
215
|
subItemsPivots.includes(row.id)
|
|
220
216
|
) {
|
|
221
|
-
return [...acc, row, ...row[subItems.
|
|
217
|
+
return [...acc, row, ...row[subItems.rowProperty]];
|
|
222
218
|
}
|
|
223
219
|
|
|
224
220
|
return [...acc, row];
|
|
@@ -233,6 +229,7 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
233
229
|
const { classes } = useListingStyles({
|
|
234
230
|
dataStyle,
|
|
235
231
|
getGridTemplateColumn,
|
|
232
|
+
limit,
|
|
236
233
|
listingVariant,
|
|
237
234
|
rows: rowsToDisplay
|
|
238
235
|
});
|
|
@@ -453,7 +450,7 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
453
450
|
reduce<TRow | number, Array<string | number>>(
|
|
454
451
|
(acc, row) => [
|
|
455
452
|
...acc,
|
|
456
|
-
...pluck('id', row[subItems?.
|
|
453
|
+
...pluck('id', row[subItems?.rowProperty || ''] || [])
|
|
457
454
|
],
|
|
458
455
|
[],
|
|
459
456
|
rows
|
|
@@ -498,7 +495,6 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
498
495
|
onSelectColumns={onSelectColumns}
|
|
499
496
|
/>
|
|
500
497
|
</div>
|
|
501
|
-
|
|
502
498
|
<ParentSize
|
|
503
499
|
parentSizeStyles={{
|
|
504
500
|
height: '100%',
|
|
@@ -514,141 +510,132 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
514
510
|
height: innerScrollDisabled ? '100%' : `calc(${height}px - 4px)`
|
|
515
511
|
}}
|
|
516
512
|
>
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
513
|
+
<Table
|
|
514
|
+
stickyHeader
|
|
515
|
+
className={classes.table}
|
|
516
|
+
component="div"
|
|
517
|
+
role={undefined}
|
|
518
|
+
size="small"
|
|
519
|
+
>
|
|
520
|
+
<ListingHeader
|
|
521
|
+
areColumnsEditable={areColumnsEditable}
|
|
522
|
+
checkable={checkable}
|
|
523
|
+
columnConfiguration={columnConfiguration}
|
|
524
|
+
columns={columns}
|
|
525
|
+
listingVariant={listingVariant}
|
|
526
|
+
memoProps={headerMemoProps}
|
|
527
|
+
predefinedRowsSelection={predefinedRowsSelection}
|
|
528
|
+
rowCount={limit - emptyRows}
|
|
529
|
+
selectedRowCount={selectedRows.length}
|
|
530
|
+
sortField={sortField}
|
|
531
|
+
sortOrder={sortOrder}
|
|
532
|
+
onSelectAllClick={selectAllRows}
|
|
533
|
+
onSelectColumns={onSelectColumns}
|
|
534
|
+
onSelectRowsWithCondition={onSelectRowsWithCondition}
|
|
535
|
+
onSort={onSort}
|
|
536
|
+
/>
|
|
537
|
+
|
|
538
|
+
<TableBody
|
|
539
|
+
className={classes.tableBody}
|
|
523
540
|
component="div"
|
|
524
|
-
|
|
525
|
-
size="small"
|
|
541
|
+
onMouseLeave={clearHoveredRow}
|
|
526
542
|
>
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
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
|
-
onFocus={(): void => hoverRow(row)}
|
|
585
|
-
onMouseOver={(): void => hoverRow(row)}
|
|
586
|
-
>
|
|
587
|
-
{checkable &&
|
|
588
|
-
(!isSubItem || subItems.canCheckSubItems ? (
|
|
589
|
-
<Cell
|
|
590
|
-
align="left"
|
|
591
|
-
className={classes.checkbox}
|
|
592
|
-
disableRowCondition={disableRowCondition}
|
|
593
|
-
isRowHovered={isRowHovered}
|
|
594
|
-
row={row}
|
|
595
|
-
rowColorConditions={rowColorConditions}
|
|
596
|
-
onClick={(event): void => selectRow(event, row)}
|
|
597
|
-
>
|
|
598
|
-
<Checkbox
|
|
599
|
-
checked={isRowSelected}
|
|
600
|
-
disabled={
|
|
601
|
-
disableRowCheckCondition(row) ||
|
|
602
|
-
disableRowCondition(row)
|
|
603
|
-
}
|
|
604
|
-
inputProps={{
|
|
605
|
-
'aria-label': `Select row ${getId(row)}`
|
|
606
|
-
}}
|
|
607
|
-
/>
|
|
608
|
-
</Cell>
|
|
609
|
-
) : (
|
|
610
|
-
<Cell
|
|
611
|
-
align="left"
|
|
612
|
-
disableRowCondition={disableRowCondition}
|
|
613
|
-
isRowHovered={isRowHovered}
|
|
614
|
-
row={row}
|
|
615
|
-
rowColorConditions={rowColorConditions}
|
|
543
|
+
{rowsToDisplay.map((row, index) => {
|
|
544
|
+
const isRowSelected = isSelected(row);
|
|
545
|
+
const isRowHovered = equals(hoveredRowId, getId(row));
|
|
546
|
+
const isSubItem = allSubItemIds.includes(row.id);
|
|
547
|
+
|
|
548
|
+
return (
|
|
549
|
+
<ListingRow
|
|
550
|
+
checkable={
|
|
551
|
+
checkable && (!isSubItem || subItems.canCheckSubItems)
|
|
552
|
+
}
|
|
553
|
+
columnConfiguration={columnConfiguration}
|
|
554
|
+
columnIds={columns.map(prop('id'))}
|
|
555
|
+
disableRowCondition={disableRowCondition}
|
|
556
|
+
isHovered={isRowHovered}
|
|
557
|
+
isSelected={isRowSelected}
|
|
558
|
+
isShiftKeyDown={isShiftKeyDown}
|
|
559
|
+
key={
|
|
560
|
+
gte(limit, performanceRowsLimit)
|
|
561
|
+
? `row_${index}`
|
|
562
|
+
: getId(row)
|
|
563
|
+
}
|
|
564
|
+
lastSelectionIndex={lastSelectionIndex}
|
|
565
|
+
limit={limit}
|
|
566
|
+
listingVariant={listingVariant}
|
|
567
|
+
row={row}
|
|
568
|
+
rowColorConditions={rowColorConditions}
|
|
569
|
+
shiftKeyDownRowPivot={shiftKeyDownRowPivot}
|
|
570
|
+
subItemsPivots={subItemsPivots}
|
|
571
|
+
tabIndex={-1}
|
|
572
|
+
visibleColumns={visibleColumns}
|
|
573
|
+
onClick={(): void => {
|
|
574
|
+
onRowClick(row);
|
|
575
|
+
}}
|
|
576
|
+
onFocus={(): void => hoverRow(row)}
|
|
577
|
+
onMouseOver={(): void => hoverRow(row)}
|
|
578
|
+
>
|
|
579
|
+
{checkable &&
|
|
580
|
+
(!isSubItem || subItems.canCheckSubItems ? (
|
|
581
|
+
<Cell
|
|
582
|
+
align="left"
|
|
583
|
+
className={classes.checkbox}
|
|
584
|
+
disableRowCondition={disableRowCondition}
|
|
585
|
+
isRowHovered={isRowHovered}
|
|
586
|
+
row={row}
|
|
587
|
+
rowColorConditions={rowColorConditions}
|
|
588
|
+
onClick={(event): void => selectRow(event, row)}
|
|
589
|
+
>
|
|
590
|
+
<Checkbox
|
|
591
|
+
checked={isRowSelected}
|
|
592
|
+
disabled={
|
|
593
|
+
disableRowCheckCondition(row) ||
|
|
594
|
+
disableRowCondition(row)
|
|
595
|
+
}
|
|
596
|
+
inputProps={{
|
|
597
|
+
'aria-label': `Select row ${getId(row)}`
|
|
598
|
+
}}
|
|
616
599
|
/>
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
column={column}
|
|
600
|
+
</Cell>
|
|
601
|
+
) : (
|
|
602
|
+
<Cell
|
|
603
|
+
align="left"
|
|
622
604
|
disableRowCondition={disableRowCondition}
|
|
623
|
-
getHighlightRowCondition={
|
|
624
|
-
getHighlightRowCondition
|
|
625
|
-
}
|
|
626
605
|
isRowHovered={isRowHovered}
|
|
627
|
-
isRowSelected={isRowSelected}
|
|
628
|
-
key={`${getId(row)}-${column.id}`}
|
|
629
|
-
labelCollapse={subItems.labelCollapse}
|
|
630
|
-
labelExpand={subItems.labelExpand}
|
|
631
|
-
listingVariant={listingVariant}
|
|
632
606
|
row={row}
|
|
633
607
|
rowColorConditions={rowColorConditions}
|
|
634
|
-
subItemsRowProperty={subItems?.getRowProperty(
|
|
635
|
-
row
|
|
636
|
-
)}
|
|
637
608
|
/>
|
|
638
609
|
))}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
610
|
+
|
|
611
|
+
{visibleColumns.map((column) => (
|
|
612
|
+
<DataCell
|
|
613
|
+
column={column}
|
|
614
|
+
disableRowCondition={disableRowCondition}
|
|
615
|
+
getHighlightRowCondition={getHighlightRowCondition}
|
|
616
|
+
isRowHovered={isRowHovered}
|
|
617
|
+
isRowSelected={isRowSelected}
|
|
618
|
+
key={`${getId(row)}-${column.id}`}
|
|
619
|
+
labelCollapse={subItems.labelCollapse}
|
|
620
|
+
labelExpand={subItems.labelExpand}
|
|
621
|
+
listingVariant={listingVariant}
|
|
622
|
+
row={row}
|
|
623
|
+
rowColorConditions={rowColorConditions}
|
|
624
|
+
subItemsRowProperty={subItems?.rowProperty}
|
|
625
|
+
/>
|
|
626
|
+
))}
|
|
627
|
+
</ListingRow>
|
|
628
|
+
);
|
|
629
|
+
})}
|
|
630
|
+
|
|
631
|
+
{rows.length < 1 &&
|
|
632
|
+
(loading ? (
|
|
633
|
+
<SkeletonLoader rows={limit} />
|
|
634
|
+
) : (
|
|
635
|
+
<EmptyResult label={t(labelNoResultFound)} />
|
|
636
|
+
))}
|
|
637
|
+
</TableBody>
|
|
638
|
+
</Table>
|
|
652
639
|
</Box>
|
|
653
640
|
)}
|
|
654
641
|
</ParentSize>
|
package/src/Module/index.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
1
3
|
import { Provider as JotaiProvider, createStore } from 'jotai';
|
|
2
4
|
|
|
3
5
|
import { createGenerateClassName, StylesProvider } from '@mui/styles';
|
|
@@ -7,7 +9,7 @@ import SnackbarProvider from '../Snackbar/SnackbarProvider';
|
|
|
7
9
|
|
|
8
10
|
export interface ModuleProps {
|
|
9
11
|
children: React.ReactElement;
|
|
10
|
-
maxSnackbars
|
|
12
|
+
maxSnackbars: number;
|
|
11
13
|
seedName: string;
|
|
12
14
|
store: ReturnType<typeof createStore>;
|
|
13
15
|
}
|
|
@@ -15,7 +17,7 @@ export interface ModuleProps {
|
|
|
15
17
|
const Module = ({
|
|
16
18
|
children,
|
|
17
19
|
seedName,
|
|
18
|
-
maxSnackbars
|
|
20
|
+
maxSnackbars,
|
|
19
21
|
store
|
|
20
22
|
}: ModuleProps): JSX.Element => {
|
|
21
23
|
const generateClassName = createGenerateClassName({
|
|
@@ -12,7 +12,6 @@ import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
|
|
12
12
|
import { equals } from 'ramda';
|
|
13
13
|
import { ListPlugin } from '@lexical/react/LexicalListPlugin';
|
|
14
14
|
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
15
|
-
import { $generateHtmlFromNodes } from '@lexical/html';
|
|
16
15
|
|
|
17
16
|
import { Typography } from '@mui/material';
|
|
18
17
|
|
|
@@ -39,7 +38,6 @@ export interface RichTextEditorProps {
|
|
|
39
38
|
openLinkInNewTab?: boolean;
|
|
40
39
|
placeholder?: string;
|
|
41
40
|
resetEditorToInitialStateCondition?: () => boolean;
|
|
42
|
-
setHtmlString?: (htmlString: string) => void;
|
|
43
41
|
toolbarClassName?: string;
|
|
44
42
|
toolbarPositions?: 'start' | 'end';
|
|
45
43
|
}
|
|
@@ -145,7 +143,6 @@ const RichTextEditor = ({
|
|
|
145
143
|
openLinkInNewTab = true,
|
|
146
144
|
initialize,
|
|
147
145
|
displayBlockButtons = true,
|
|
148
|
-
setHtmlString,
|
|
149
146
|
toolbarClassName
|
|
150
147
|
}: RichTextEditorProps): JSX.Element => {
|
|
151
148
|
const { classes } = useStyles({ toolbarPositions });
|
|
@@ -181,13 +178,6 @@ const RichTextEditor = ({
|
|
|
181
178
|
}
|
|
182
179
|
};
|
|
183
180
|
|
|
184
|
-
const change = (state: EditorState, editor: LexicalEditor): void => {
|
|
185
|
-
editor.update(() => {
|
|
186
|
-
setHtmlString?.($generateHtmlFromNodes(editor, null));
|
|
187
|
-
});
|
|
188
|
-
getEditorState?.(state, editor);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
181
|
return (
|
|
192
182
|
<LexicalComposer initialConfig={initialConfig}>
|
|
193
183
|
<div className={classes.container}>
|
|
@@ -220,7 +210,6 @@ const RichTextEditor = ({
|
|
|
220
210
|
resetEditorToInitialStateCondition={
|
|
221
211
|
resetEditorToInitialStateCondition
|
|
222
212
|
}
|
|
223
|
-
setHtmlString={setHtmlString}
|
|
224
213
|
onBlur={onBlur}
|
|
225
214
|
/>
|
|
226
215
|
}
|
|
@@ -229,7 +218,7 @@ const RichTextEditor = ({
|
|
|
229
218
|
<HistoryPlugin />
|
|
230
219
|
<LinkPlugin />
|
|
231
220
|
<ListPlugin />
|
|
232
|
-
<OnChangePlugin onChange={
|
|
221
|
+
<OnChangePlugin onChange={getEditorState} />
|
|
233
222
|
<AutoCompleteLinkPlugin openLinkInNewTab={openLinkInNewTab} />
|
|
234
223
|
<FloatingLinkEditorPlugin
|
|
235
224
|
editable={editable}
|