@centreon/ui 24.4.39 → 24.4.40
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/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 +2 -2
- package/src/Listing/Cell/DataCell.tsx +1 -15
- package/src/Listing/Header/ListingHeader.tsx +1 -1
- package/src/Listing/Listing.styles.ts +3 -2
- package/src/Listing/index.stories.tsx +1 -12
- package/src/Listing/index.tsx +2 -1
- 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/CompactCustomTimePeriod.styles.ts +7 -6
- 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/ResolutionTimePeriod.cypress.spec.tsx +9 -12
- 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/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 +1 -1
- 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 +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 -2
- 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
|
@@ -179,7 +179,7 @@ const getMetricValuesForUnit = ({
|
|
|
179
179
|
) as Array<number>;
|
|
180
180
|
|
|
181
181
|
return pipe(
|
|
182
|
-
filter(propEq(unit,
|
|
182
|
+
filter(propEq('unit', unit)) as (line) => Array<Line>,
|
|
183
183
|
map(prop('metric_id')),
|
|
184
184
|
map(getTimeSeriesValuesForMetric),
|
|
185
185
|
flatten,
|
|
@@ -203,7 +203,7 @@ const getLineForMetric = ({
|
|
|
203
203
|
lines,
|
|
204
204
|
metric_id
|
|
205
205
|
}: LineForMetricProps): Line | undefined =>
|
|
206
|
-
find(propEq(metric_id,
|
|
206
|
+
find(propEq('metric_id', metric_id), lines);
|
|
207
207
|
|
|
208
208
|
interface LinesTimeSeries {
|
|
209
209
|
lines: Array<Line>;
|
|
@@ -275,7 +275,7 @@ interface HasStackedLines {
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
const hasUnitStackedLines = ({ lines, unit }: HasStackedLines): boolean =>
|
|
278
|
-
pipe(getSortedStackedLines, any(propEq(unit,
|
|
278
|
+
pipe(getSortedStackedLines, any(propEq('unit', unit)))(lines);
|
|
279
279
|
|
|
280
280
|
const getTimeSeriesForLines = ({
|
|
281
281
|
lines,
|
|
@@ -292,16 +292,13 @@ const ConnectedAutocompleteField = (
|
|
|
292
292
|
}
|
|
293
293
|
}, [optionsOpen]);
|
|
294
294
|
|
|
295
|
-
useEffect(
|
|
296
|
-
(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
},
|
|
303
|
-
useDeepCompare([searchConditions])
|
|
304
|
-
);
|
|
295
|
+
useEffect(() => {
|
|
296
|
+
setSearchParameter(
|
|
297
|
+
!isEmpty(searchConditions)
|
|
298
|
+
? { conditions: searchConditions }
|
|
299
|
+
: undefined
|
|
300
|
+
);
|
|
301
|
+
}, useDeepCompare([searchConditions]));
|
|
305
302
|
|
|
306
303
|
useEffect(() => {
|
|
307
304
|
if (!autocompleteChangedValue && !props?.value) {
|
|
@@ -49,7 +49,7 @@ const SortableListContent = ({
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const itemIndex = findIndex(propEq(id,
|
|
52
|
+
const itemIndex = findIndex(propEq('id', id), items);
|
|
53
53
|
|
|
54
54
|
itemHover?.(null);
|
|
55
55
|
itemClick?.({ index: itemIndex, item: { createOption, id, name } });
|
|
@@ -77,7 +77,7 @@ const DraggableAutocomplete = (
|
|
|
77
77
|
const deleteValue = (id): void => {
|
|
78
78
|
itemHover?.(null);
|
|
79
79
|
setSelectedValues((values: Array<DraggableSelectEntry>) => {
|
|
80
|
-
const index = findIndex(propEq(id,
|
|
80
|
+
const index = findIndex(propEq('id', id), values);
|
|
81
81
|
|
|
82
82
|
const newSelectedValues = remove(index, 1, values);
|
|
83
83
|
|
|
@@ -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;
|
|
@@ -73,14 +73,14 @@ const IconPopoverMultiAutocomplete = ({
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const isSelected = (id: number | string): boolean => {
|
|
76
|
-
return pipe(find(propEq(id,
|
|
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(id,
|
|
83
|
+
? reject(propEq('id', id), value)
|
|
84
84
|
: [...value, option];
|
|
85
85
|
|
|
86
86
|
onChange(updatedValue);
|
|
@@ -69,7 +69,7 @@ const SelectField = ({
|
|
|
69
69
|
const { classes, cx } = useStyles();
|
|
70
70
|
|
|
71
71
|
const getOption = (id): SelectEntry => {
|
|
72
|
-
return options.find(propEq(id,
|
|
72
|
+
return options.find(propEq('id', id)) as SelectEntry;
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const changeOption = (event): void => {
|
|
@@ -154,9 +154,9 @@ const TextField = forwardRef(
|
|
|
154
154
|
helperText={displayErrorInTooltip ? undefined : error}
|
|
155
155
|
id={getNormalizedId(dataTestId || '')}
|
|
156
156
|
inputProps={{
|
|
157
|
+
...rest.inputProps,
|
|
157
158
|
'aria-label': ariaLabel,
|
|
158
|
-
'data-testid': dataTestId
|
|
159
|
-
...rest.inputProps
|
|
159
|
+
'data-testid': dataTestId
|
|
160
160
|
}}
|
|
161
161
|
label={label}
|
|
162
162
|
ref={ref}
|
|
@@ -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 (
|
|
@@ -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,
|
|
@@ -392,6 +382,5 @@ export const ListingWithSubItems = {
|
|
|
392
382
|
labelExpand: 'Expand'
|
|
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
|
|
|
@@ -233,6 +233,7 @@ const Listing = <TRow extends { id: RowId }>({
|
|
|
233
233
|
const { classes } = useListingStyles({
|
|
234
234
|
dataStyle,
|
|
235
235
|
getGridTemplateColumn,
|
|
236
|
+
limit,
|
|
236
237
|
listingVariant,
|
|
237
238
|
rows: rowsToDisplay
|
|
238
239
|
});
|
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}
|
|
@@ -15,7 +15,11 @@ import {
|
|
|
15
15
|
DragEndEvent,
|
|
16
16
|
Over
|
|
17
17
|
} from '@dnd-kit/core';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
SortableContext,
|
|
20
|
+
sortableKeyboardCoordinates,
|
|
21
|
+
SortingStrategy
|
|
22
|
+
} from '@dnd-kit/sortable';
|
|
19
23
|
import {
|
|
20
24
|
equals,
|
|
21
25
|
find,
|
|
@@ -113,6 +117,7 @@ const SortableItems = <T extends { [propertyToFilterItemsOn]: string }>({
|
|
|
113
117
|
useSensor(MouseSensor),
|
|
114
118
|
useSensor(PointerSensor),
|
|
115
119
|
useSensor(KeyboardSensor, {
|
|
120
|
+
coordinateGetter: sortableKeyboardCoordinates,
|
|
116
121
|
keyboardCodes: {
|
|
117
122
|
cancel: ['Escape'],
|
|
118
123
|
end: ['Space', 'Enter'],
|
|
@@ -164,7 +169,7 @@ const SortableItems = <T extends { [propertyToFilterItemsOn]: string }>({
|
|
|
164
169
|
};
|
|
165
170
|
|
|
166
171
|
const getItemById = (id): T | undefined =>
|
|
167
|
-
find(propEq(
|
|
172
|
+
find(propEq(propertyToFilterItemsOn, id), items);
|
|
168
173
|
|
|
169
174
|
const activeItem = getItemById(activeId) as Record<string, unknown>;
|
|
170
175
|
|
|
@@ -147,30 +147,6 @@ export const getTheme = (mode: ThemeMode): ThemeOptions => ({
|
|
|
147
147
|
},
|
|
148
148
|
MuiCssBaseline: {
|
|
149
149
|
styleOverrides: (theme) => `
|
|
150
|
-
::-webkit-scrollbar {
|
|
151
|
-
height: ${theme.spacing(1)};
|
|
152
|
-
width: ${theme.spacing(1)};
|
|
153
|
-
background-color: transparent;
|
|
154
|
-
}
|
|
155
|
-
::-webkit-scrollbar-thumb {
|
|
156
|
-
background-color: ${
|
|
157
|
-
equals(mode, 'dark')
|
|
158
|
-
? theme.palette.divider
|
|
159
|
-
: theme.palette.text.disabled
|
|
160
|
-
};
|
|
161
|
-
border-radius: ${theme.spacing(0.5)};
|
|
162
|
-
}
|
|
163
|
-
::-webkit-scrollbar-thumb:hover {
|
|
164
|
-
background-color: ${theme.palette.primary.main};
|
|
165
|
-
}
|
|
166
|
-
* {
|
|
167
|
-
scrollbar-color: ${
|
|
168
|
-
equals(mode, 'dark')
|
|
169
|
-
? theme.palette.divider
|
|
170
|
-
: theme.palette.text.disabled
|
|
171
|
-
} ${theme.palette.background.default};
|
|
172
|
-
scrollbar-width: thin;
|
|
173
|
-
}
|
|
174
150
|
html {
|
|
175
151
|
margin: 0;
|
|
176
152
|
padding: 0;
|
|
@@ -12,21 +12,22 @@ const useStyles = makeStyles()((theme) => ({
|
|
|
12
12
|
},
|
|
13
13
|
containerDates: {
|
|
14
14
|
display: 'flex',
|
|
15
|
+
gap: theme.spacing(0.5),
|
|
15
16
|
[theme.breakpoints.down('sm')]: {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
columnGap: theme.spacing(0.5),
|
|
18
|
+
flexDirection: 'column'
|
|
18
19
|
}
|
|
19
20
|
},
|
|
20
21
|
date: {
|
|
21
|
-
minWidth: theme.spacing(12),
|
|
22
|
+
minWidth: theme.spacing(12.5),
|
|
22
23
|
textAlign: 'start'
|
|
23
24
|
},
|
|
24
25
|
error: {
|
|
25
26
|
textAlign: 'center'
|
|
26
27
|
},
|
|
27
28
|
label: {
|
|
28
|
-
minWidth: theme.spacing(3
|
|
29
|
-
textAlign: '
|
|
29
|
+
minWidth: theme.spacing(3),
|
|
30
|
+
textAlign: 'start'
|
|
30
31
|
},
|
|
31
32
|
|
|
32
33
|
picker: {
|
|
@@ -38,7 +39,7 @@ const useStyles = makeStyles()((theme) => ({
|
|
|
38
39
|
},
|
|
39
40
|
timeContainer: {
|
|
40
41
|
alignItems: 'center',
|
|
41
|
-
columnGap: theme.spacing(
|
|
42
|
+
columnGap: theme.spacing(1),
|
|
42
43
|
display: 'flex',
|
|
43
44
|
flexDirection: 'row',
|
|
44
45
|
[theme.breakpoints.down('sm')]: {
|