@centreon/ui 25.10.9 → 25.10.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/package.json +1 -1
  2. package/public/mockServiceWorker.js +8 -31
  3. package/src/Form/Inputs/ConnectedAutocomplete.tsx +2 -0
  4. package/src/Form/Inputs/Grid.tsx +2 -3
  5. package/src/Form/Inputs/models.ts +2 -0
  6. package/src/Form/Section/navigateToSection.ts +6 -6
  7. package/src/Graph/BarChart/BarChart.cypress.spec.tsx +55 -92
  8. package/src/Graph/BarChart/BarChart.stories.tsx +1 -42
  9. package/src/Graph/BarChart/BarChart.tsx +1 -1
  10. package/src/Graph/BarChart/BarStack.tsx +26 -15
  11. package/src/Graph/BarChart/MemoizedGroup.tsx +8 -7
  12. package/src/Graph/BarChart/ResponsiveBarChart.tsx +1 -2
  13. package/src/Graph/Chart/BasicComponents/Lines/StackedLines/index.tsx +5 -4
  14. package/src/Graph/Chart/BasicComponents/Lines/index.tsx +94 -94
  15. package/src/Graph/Chart/Chart.cypress.spec.tsx +6 -25
  16. package/src/Graph/Chart/Chart.stories.tsx +1 -34
  17. package/src/Graph/Chart/Chart.tsx +6 -5
  18. package/src/Graph/Chart/Legend/index.tsx +2 -26
  19. package/src/Graph/Chart/index.tsx +28 -24
  20. package/src/Graph/Chart/models.ts +1 -6
  21. package/src/Graph/Chart/translatedLabels.ts +1 -0
  22. package/src/Graph/Chart/useChartData.ts +1 -1
  23. package/src/Graph/common/BaseChart/BaseChart.tsx +1 -6
  24. package/src/Graph/common/BaseChart/Header/index.tsx +3 -1
  25. package/src/Graph/common/Error/NoData.tsx +18 -0
  26. package/src/Graph/common/timeSeries/index.test.ts +4 -4
  27. package/src/Graph/common/timeSeries/index.ts +77 -73
  28. package/src/Graph/common/utils.ts +4 -10
  29. package/src/Graph/index.ts +20 -19
  30. package/src/InputField/Select/Autocomplete/Connected/index.tsx +7 -7
  31. package/src/InputField/Select/Autocomplete/Multi/Multi.tsx +1 -1
  32. package/src/InputField/Select/Autocomplete/index.tsx +28 -17
  33. package/src/InputField/Select/Option.tsx +3 -3
  34. package/src/InputField/Select/index.tsx +2 -1
  35. package/src/Module/index.tsx +2 -8
  36. package/src/ThemeProvider/index.tsx +21 -30
  37. package/src/ThemeProvider/tailwindcss.css +10 -10
  38. package/src/components/Form/AccessRights/ShareInput/ShareInput.tsx +4 -3
  39. package/src/components/Form/AccessRights/ShareInput/useShareInput.tsx +15 -10
  40. package/src/components/Menu/Button/MenuButton.tsx +1 -2
  41. package/src/components/Modal/Modal.styles.ts +2 -1
  42. package/src/components/Modal/ModalHeader.tsx +1 -5
  43. package/src/Graph/mockedData/dataWithMissingPoint.json +0 -74
@@ -32,7 +32,8 @@ import {
32
32
  reject,
33
33
  sortBy,
34
34
  split,
35
- uniq
35
+ uniq,
36
+ isNotNil
36
37
  } from 'ramda';
37
38
 
38
39
  import { margin } from '../../Chart/common';
@@ -72,7 +73,7 @@ const toTimeTickValue = (
72
73
  const getMetricsForIndex = (): Omit<TimeValue, 'timeTick'> => {
73
74
  const addMetricForTimeIndex = (acc, { metric_id, data }): TimeValue => ({
74
75
  ...acc,
75
- [metric_id]: data[timeIndex] === undefined ? null : data[timeIndex]
76
+ [metric_id]: data[timeIndex]
76
77
  });
77
78
 
78
79
  return reduce(addMetricForTimeIndex, {} as TimeValue, metrics);
@@ -158,8 +159,8 @@ const getMetrics = (timeValue: TimeValue): Array<string> =>
158
159
 
159
160
  const getValueForMetric =
160
161
  (timeValue: TimeValue) =>
161
- (metric_id: number): number =>
162
- prop(metric_id, timeValue) as number;
162
+ (metric_id: number): number =>
163
+ prop(metric_id, timeValue) as number;
163
164
 
164
165
  const getUnits = (lines: Array<Line>): Array<string> =>
165
166
  pipe(map(prop('unit')), uniq)(lines);
@@ -240,10 +241,7 @@ const getStackedMetricValues = ({
240
241
  timeSeries
241
242
  }: LinesTimeSeries): Array<number> => {
242
243
  const getTimeSeriesValuesForMetric = (metric_id): Array<number> =>
243
- map(
244
- (timeValue) => getValueForMetric(timeValue)(metric_id) || 0,
245
- timeSeries
246
- );
244
+ map((timeValue) => getValueForMetric(timeValue)(metric_id), timeSeries);
247
245
 
248
246
  const metricsValues = pipe(
249
247
  map(prop('metric_id')) as (metric) => Array<number>,
@@ -306,8 +304,8 @@ const getTimeSeriesForLines = ({
306
304
  ...acc,
307
305
  [metric_id]:
308
306
  invert &&
309
- metricsValue[metric_id] &&
310
- gt(metricsValue[metric_id], 0)
307
+ metricsValue[metric_id] &&
308
+ gt(metricsValue[metric_id], 0)
311
309
  ? negate(metricsValue[metric_id])
312
310
  : metricsValue[metric_id]
313
311
  };
@@ -340,10 +338,10 @@ const getYScale = ({
340
338
 
341
339
  return invert
342
340
  ? getScaleType(scale)({
343
- base: scaleLogarithmicBase,
344
- domain: yScale.domain().reverse(),
345
- range: yScale.range().reverse()
346
- })
341
+ base: scaleLogarithmicBase,
342
+ domain: yScale.domain().reverse(),
343
+ range: yScale.range().reverse()
344
+ })
347
345
  : yScale;
348
346
  };
349
347
 
@@ -380,6 +378,7 @@ const getScale = ({
380
378
  invert,
381
379
  hasDisplayAsBar,
382
380
  hasLineFilled,
381
+ hasStackedLines,
383
382
  min,
384
383
  max
385
384
  }): ScaleLinear<number, number> => {
@@ -387,30 +386,42 @@ const getScale = ({
387
386
  const sanitizedValuesForMinimum = min
388
387
  ? [min]
389
388
  : getSanitizedValues([
390
- invert && graphValues.every(lt(0))
391
- ? negate(getMax(graphValues))
392
- : getMin(graphValues),
393
- !isEmpty(stackedValues) &&
394
- !equals(stackedValues, [0]) &&
395
- getMin(stackedValues),
396
- Math.min(...thresholds)
397
- ]);
398
- const minValue = Math.min(...sanitizedValuesForMinimum);
399
- const minValueWithMargin =
400
- (hasDisplayAsBar || hasLineFilled) && minValue > 0 && !min
401
- ? 0
402
- : minValue - Math.abs(minValue) * 0.05;
389
+ invert && graphValues.every(lt(0))
390
+ ? negate(getMax(graphValues))
391
+ : getMin(graphValues),
392
+ !isEmpty(stackedValues) &&
393
+ !equals(stackedValues, [0]) &&
394
+ getMin(stackedValues),
395
+ Math.min(...thresholds)
396
+ ]);
397
+ const minValue = Math.min(...sanitizedValuesForMinimum.filter(isNotNil));
403
398
 
404
399
  const sanitizedValuesForMaximum = max
405
400
  ? [max]
406
401
  : getSanitizedValues([
407
- getMax(graphValues),
408
- getMax(stackedValues),
409
- hasOnlyZeroesHasValue(graphValues) ? 1 : 0,
410
- Math.max(...thresholds)
411
- ]);
412
- const maxValue = Math.max(...sanitizedValuesForMaximum);
413
- const maxValueWithMargin = maxValue + Math.abs(maxValue) * 0.05;
402
+ getMax(graphValues),
403
+ getMax(stackedValues),
404
+ hasOnlyZeroesHasValue(graphValues) ? 1 : null,
405
+ Math.max(...thresholds)
406
+ ]);
407
+ const maxValue = Math.max(...sanitizedValuesForMaximum.filter(isNotNil));
408
+
409
+ const minValueWithMargin =
410
+ (hasDisplayAsBar && minValue > 0) ||
411
+ (hasLineFilled &&
412
+ Math.max(maxValue, minValue) > minValue &&
413
+ minValue > 0) ||
414
+ (hasStackedLines && minValue > maxValue)
415
+ ? 0
416
+ : minValue - Math.abs(minValue) * 0.05;
417
+ const maxValueWithMargin =
418
+ (hasDisplayAsBar && maxValue < 0) ||
419
+ (hasLineFilled &&
420
+ Math.min(maxValue, minValue) < maxValue &&
421
+ maxValue < 0) ||
422
+ (hasStackedLines && minValue > maxValue)
423
+ ? 0
424
+ : maxValue + Math.abs(maxValue) * 0.05;
414
425
 
415
426
  const scaleType = getScaleType(scale);
416
427
 
@@ -477,7 +488,8 @@ const getYScaleUnit = ({
477
488
  min,
478
489
  max,
479
490
  isBarChart,
480
- boundariesUnit
491
+ boundariesUnit,
492
+ isFilled
481
493
  }: AxeScale & {
482
494
  invert?: boolean | string | null;
483
495
  unit: string;
@@ -485,6 +497,7 @@ const getYScaleUnit = ({
485
497
  min?: number;
486
498
  boundariesUnit?: string;
487
499
  isBarChart?: boolean;
500
+ isFilled?: boolean;
488
501
  }): ScaleLinear<number, number> => {
489
502
  const [firstUnit] = getUnits(dataLines);
490
503
  const shouldApplyThresholds =
@@ -503,12 +516,12 @@ const getYScaleUnit = ({
503
516
 
504
517
  const stackedValues = hasStackedLines
505
518
  ? getStackedMetricValues({
506
- lines: getSortedStackedLines(dataLines).filter(
507
- ({ unit: stackedUnit }) => equals(unit, stackedUnit)
508
- ),
509
- timeSeries: dataTimeSeries
510
- })
511
- : [0];
519
+ lines: getSortedStackedLines(dataLines).filter(
520
+ ({ unit: stackedUnit }) => equals(unit, stackedUnit)
521
+ ),
522
+ timeSeries: dataTimeSeries
523
+ })
524
+ : [];
512
525
 
513
526
  return getScale({
514
527
  graphValues,
@@ -518,8 +531,14 @@ const getYScaleUnit = ({
518
531
  ({ displayAs, unit: lineUnit }) =>
519
532
  equals(unit, lineUnit) && equals(displayAs, 'bar')
520
533
  ),
521
- hasLineFilled: dataLines.some(
522
- ({ unit: lineUnit, filled }) => equals(unit, lineUnit) && filled
534
+ hasLineFilled: isNil(isFilled)
535
+ ? dataLines.some(
536
+ ({ unit: lineUnit, filled }) => equals(unit, lineUnit) && filled
537
+ )
538
+ : isFilled,
539
+ hasStackedLines: dataLines.some(
540
+ ({ unit: lineUnit, stackKey, stackOrder }) =>
541
+ equals(unit, lineUnit) && (stackKey || stackOrder)
523
542
  ),
524
543
  height: valueGraphHeight,
525
544
  invert,
@@ -559,12 +578,14 @@ const getYScalePerUnit = ({
559
578
  isBarChart,
560
579
  min,
561
580
  max,
562
- boundariesUnit
581
+ boundariesUnit,
582
+ isFilled
563
583
  }: AxeScale & {
564
584
  min?: number;
565
585
  max?: number;
566
586
  isBarChart?: boolean;
567
587
  boundariesUnit?: string;
588
+ isFilled?: boolean;
568
589
  }): Record<string, ScaleLinear<number, number>> => {
569
590
  const units = getUnits(dataLines);
570
591
 
@@ -588,7 +609,8 @@ const getYScalePerUnit = ({
588
609
  min,
589
610
  max,
590
611
  isBarChart,
591
- boundariesUnit
612
+ boundariesUnit,
613
+ isFilled
592
614
  })
593
615
  };
594
616
  }, {});
@@ -596,15 +618,15 @@ const getYScalePerUnit = ({
596
618
  return scalePerUnit;
597
619
  };
598
620
 
599
- const formatTime = ({ value, unit }): string => {
600
- return `${numeral(value).format('0.[00]a')} ${unit}`;
621
+ const formatTime = (value: number): string => {
622
+ return `${numeral(value).format('0.[00]a')} ms`;
601
623
  };
602
624
 
603
625
  const registerMsUnitToNumeral = (): null => {
604
626
  try {
605
627
  numeral.register('format', 'milliseconds', {
606
628
  format: (value) => {
607
- return formatTime({ value, unit: 'ms' });
629
+ return formatTime(value);
608
630
  },
609
631
  regexps: {
610
632
  format: /(ms)/,
@@ -621,27 +643,6 @@ const registerMsUnitToNumeral = (): null => {
621
643
 
622
644
  registerMsUnitToNumeral();
623
645
 
624
- const registerSecondsUnitToNumeral = (): null => {
625
- try {
626
- numeral.register('format', 'seconds', {
627
- format: (value) => {
628
- return formatTime({ value, unit: 's' });
629
- },
630
- regexps: {
631
- format: /(s)/,
632
- unformat: /(s)/
633
- },
634
- unformat: () => ''
635
- });
636
-
637
- return null;
638
- } catch (_) {
639
- return null;
640
- }
641
- };
642
-
643
- registerSecondsUnitToNumeral();
644
-
645
646
  const getBase1024 = ({ unit, base }): boolean => {
646
647
  const base2Units = [
647
648
  'B',
@@ -671,13 +672,12 @@ const formatMetricValue = ({
671
672
 
672
673
  const formatSuffix = cond([
673
674
  [equals('ms'), always(' ms')],
674
- [equals('s'), always(' s')],
675
675
  [T, always(base1024 ? ' ib' : 'a')]
676
676
  ])(unit);
677
677
 
678
678
  const formattedMetricValue = numeral(Math.abs(value))
679
679
  .format(`0.[00]${formatSuffix}`)
680
- .replace(/(iB|B)/g, unit);
680
+ .replace(/B/, unit);
681
681
 
682
682
  if (lt(value, 0)) {
683
683
  return `-${formattedMetricValue}`;
@@ -696,6 +696,8 @@ const formatMetricValueWithUnit = ({
696
696
  return null;
697
697
  }
698
698
 
699
+ const base1024 = getBase1024({ base, unit });
700
+
699
701
  if (isRaw) {
700
702
  const unitText = equals('%', unit) ? unit : ` ${unit}`;
701
703
 
@@ -708,7 +710,9 @@ const formatMetricValueWithUnit = ({
708
710
 
709
711
  const formattedMetricValue = formatMetricValue({ base, unit, value });
710
712
 
711
- return formattedMetricValue;
713
+ return base1024 || !unit || equals(unit, 'ms')
714
+ ? formattedMetricValue
715
+ : `${formattedMetricValue} ${unit}`;
712
716
  };
713
717
 
714
718
  const bisectDate = bisector(identity).center;
@@ -787,4 +791,4 @@ export {
787
791
  formatMetricValueWithUnit,
788
792
  getYScaleUnit,
789
793
  getYScalePerUnit
790
- };
794
+ };
@@ -25,7 +25,7 @@ import { BarStyle } from '../BarChart/models';
25
25
  import { margin } from '../Chart/common';
26
26
  import { LineStyle } from '../Chart/models';
27
27
  import { Threshold, Thresholds } from './models';
28
- import { formatMetricValueWithUnit } from './timeSeries';
28
+ import { formatMetricValue } from './timeSeries';
29
29
  import { Line, TimeValue } from './timeSeries/models';
30
30
 
31
31
  interface GetColorFromDataAndThresholdsProps {
@@ -234,7 +234,7 @@ export const getFormattedAxisValues = ({
234
234
 
235
235
  const formattedData = metricIds.map((metricId) =>
236
236
  timeSeries.map((data) =>
237
- formatMetricValueWithUnit({
237
+ formatMetricValue({
238
238
  value: data[metricId],
239
239
  unit: axisUnit,
240
240
  base
@@ -246,7 +246,7 @@ export const getFormattedAxisValues = ({
246
246
 
247
247
  const formattedThresholdValues = equals(thresholdUnit, axisUnit)
248
248
  ? threshold.map(({ value }) =>
249
- formatMetricValueWithUnit({
249
+ formatMetricValue({
250
250
  value,
251
251
  unit: axisUnit,
252
252
  base
@@ -273,11 +273,5 @@ export const computeGElementMarginLeft = ({
273
273
  export const computPixelsToShiftMouse = (xScale): number => {
274
274
  const domain = xScale.domain();
275
275
 
276
- const hoursDiffInGraph = dayjs(domain[1]).diff(domain[0], 'h');
277
-
278
- if (!hoursDiffInGraph) {
279
- return 0;
280
- }
281
-
282
- return Math.round(8 / hoursDiffInGraph);
276
+ return Math.round(8 / dayjs(domain[1]).diff(domain[0], 'h'));
283
277
  };
@@ -1,19 +1,20 @@
1
- export type { ParentSizeProps } from '@visx/responsive/lib/components/ParentSize';
2
- export { default as LineChart } from './Chart';
3
- export { default as ThresholdLines } from './Chart/BasicComponents/Lines/Threshold';
4
- export { default as useLineChartData } from './Chart/useChartData';
5
- export { default as BarChart } from './BarChart/BarChart';
6
- export { Gauge } from './Gauge';
7
- export { SingleBar } from './SingleBar';
8
- export { Text as GraphText } from './Text';
9
-
10
- export { HeatMap } from './HeatMap';
11
- export { BarStack } from './BarStack';
12
- export { PieChart } from './PieChart';
13
- export { Timeline } from './Timeline';
14
- export * from './Tree';
15
- export type { LineChartData, Threshold, Thresholds } from './common/models';
16
- export * from './common/timeSeries';
17
- export type { Metric } from './common/timeSeries/models';
18
- export * from './Chart/models';
19
- export * from './PieChart/models';
1
+ export type { ParentSizeProps } from "@visx/responsive/lib/components/ParentSize";
2
+ export { default as BarChart } from "./BarChart/BarChart";
3
+ export { BarStack } from "./BarStack";
4
+ export { default as LineChart } from "./Chart";
5
+ export { default as ThresholdLines } from "./Chart/BasicComponents/Lines/Threshold";
6
+ export * from "./Chart/models";
7
+ export { default as useLineChartData } from "./Chart/useChartData";
8
+ export { default as Header } from "./common/BaseChart/Header";
9
+ export { default as NoData } from "./common/Error/NoData";
10
+ export type { LineChartData, Threshold, Thresholds } from "./common/models";
11
+ export * from "./common/timeSeries";
12
+ export type { Metric } from "./common/timeSeries/models";
13
+ export { Gauge } from "./Gauge";
14
+ export { HeatMap } from "./HeatMap";
15
+ export { PieChart } from "./PieChart";
16
+ export * from "./PieChart/models";
17
+ export { SingleBar } from "./SingleBar";
18
+ export { Text as GraphText } from "./Text";
19
+ export { Timeline } from "./Timeline";
20
+ export * from "./Tree";
@@ -1,4 +1,4 @@
1
- import { useCallback, useEffect, useState } from 'react';
1
+ import { ReactElement, useCallback, useEffect, useState } from 'react';
2
2
 
3
3
  import {
4
4
  equals,
@@ -44,7 +44,7 @@ export interface ConnectedAutoCompleteFieldProps<TData> {
44
44
  field: string;
45
45
  getEndpoint: ({ search, page }) => string;
46
46
  decoder?;
47
- getRenderedOptionText: (option: TData) => string;
47
+ getRenderedOptionText?: (option: TData) => ReactElement | string;
48
48
  getRequestHeaders?: HeadersInit;
49
49
  initialPage: number;
50
50
  labelKey?: string;
@@ -53,9 +53,9 @@ export interface ConnectedAutoCompleteFieldProps<TData> {
53
53
  }
54
54
 
55
55
  const ConnectedAutocompleteField = (
56
- AutocompleteField: (props) => JSX.Element,
56
+ AutocompleteField: (props) => ReactElement,
57
57
  multiple: boolean
58
- ): ((props) => JSX.Element) => {
58
+ ): ((props) => ReactElement) => {
59
59
  const InnerConnectedAutocompleteField = <TData extends { name: string }>({
60
60
  initialPage = 1,
61
61
  getEndpoint,
@@ -65,7 +65,7 @@ const ConnectedAutocompleteField = (
65
65
  open,
66
66
  exclusionOptionProperty = 'id',
67
67
  searchConditions = [],
68
- getRenderedOptionText = (option): string => option.name?.toString(),
68
+ getRenderedOptionText = (option): string => option?.name?.toString(),
69
69
  getRequestHeaders,
70
70
  displayOptionThumbnail,
71
71
  queryKey,
@@ -74,7 +74,7 @@ const ConnectedAutocompleteField = (
74
74
  changeIdValue,
75
75
  ...props
76
76
  }: ConnectedAutoCompleteFieldProps<TData> &
77
- Omit<AutocompleteFieldProps, 'options'>): JSX.Element => {
77
+ Omit<AutocompleteFieldProps, 'options'>): ReactElement => {
78
78
  const [options, setOptions] = useState<Array<TData>>([]);
79
79
  const [page, setPage] = useState(1);
80
80
  const [maxPage, setMaxPage] = useState(initialPage);
@@ -221,7 +221,7 @@ const ConnectedAutocompleteField = (
221
221
  debounce(event.target.value);
222
222
  };
223
223
 
224
- const renderOptions = (renderProps, option, { selected }): JSX.Element => {
224
+ const renderOptions = (renderProps, option, { selected }): ReactElement => {
225
225
  const { value } = props;
226
226
 
227
227
  const lastValue = Array.isArray(value) ? last(value) : value;
@@ -36,7 +36,7 @@ const MultiAutocompleteField = ({
36
36
  disableSortedOptions = false,
37
37
  disableSelectAll = true,
38
38
  optionProperty = 'name',
39
- getOptionLabel = (option): string => option.name,
39
+ getOptionLabel = (option): string => option?.name,
40
40
  getTagLabel = (option): string => option[optionProperty],
41
41
  getOptionTooltipLabel,
42
42
  chipProps,
@@ -13,6 +13,7 @@ import { AutocompleteSlotsAndSlotProps } from '@mui/material/Autocomplete';
13
13
  import { TextFieldSlotsAndSlotProps } from '@mui/material/TextField';
14
14
  import { UseAutocompleteProps } from '@mui/material/useAutocomplete';
15
15
 
16
+ import type { AutocompleteRenderOptionState } from '@mui/material/Autocomplete';
16
17
  import { ForwardedRef, HTMLAttributes, ReactElement, forwardRef } from 'react';
17
18
  import { SelectEntry } from '..';
18
19
  import { getNormalizedId } from '../../../utils';
@@ -33,6 +34,11 @@ export type Props = {
33
34
  error?: string;
34
35
  getOptionItemLabel?: (option) => string;
35
36
  hideInput?: boolean;
37
+ renderOption?: (
38
+ renderProps: HTMLAttributes<HTMLLIElement>,
39
+ option: SelectEntry,
40
+ state: AutocompleteRenderOptionState
41
+ ) => ReactElement;
36
42
  label: string;
37
43
  loading?: boolean;
38
44
  onTextChange?;
@@ -52,7 +58,7 @@ export type Props = {
52
58
  > &
53
59
  UseAutocompleteProps<SelectEntry, Multiple, DisableClearable, FreeSolo>;
54
60
 
55
- const LoadingIndicator = (): JSX.Element => {
61
+ const LoadingIndicator = (): ReactElement => {
56
62
  const { classes } = useAutoCompleteStyles({});
57
63
 
58
64
  return (
@@ -90,10 +96,11 @@ const AutocompleteField = forwardRef(
90
96
  forceInputRenderValue = false,
91
97
  textFieldSlotsAndSlotProps,
92
98
  autocompleteSlotsAndSlotProps,
99
+ renderOption,
93
100
  ...autocompleteProps
94
101
  }: Props,
95
102
  ref?: ForwardedRef<HTMLDivElement>
96
- ): JSX.Element => {
103
+ ): ReactElement => {
97
104
  const { classes, cx } = useAutoCompleteStyles({ hideInput });
98
105
  const { t } = useTranslation();
99
106
  const theme = useTheme();
@@ -107,7 +114,24 @@ const AutocompleteField = forwardRef(
107
114
  );
108
115
  };
109
116
 
110
- const renderInput = (params): JSX.Element => {
117
+ const renderOptions = renderOption
118
+ ? renderOption
119
+ : (props, option): ReactElement => {
120
+ return (
121
+ <li
122
+ className={classes.options}
123
+ {...(props as HTMLAttributes<HTMLLIElement>)}
124
+ >
125
+ <Option
126
+ thumbnailUrl={displayOptionThumbnail ? option.url : undefined}
127
+ >
128
+ {getOptionItemLabel(option)}
129
+ </Option>
130
+ </li>
131
+ );
132
+ };
133
+
134
+ const renderInput = (params): ReactElement => {
111
135
  return (
112
136
  <TextField
113
137
  {...params}
@@ -202,20 +226,7 @@ const AutocompleteField = forwardRef(
202
226
  options={options}
203
227
  ref={ref}
204
228
  renderInput={renderInput}
205
- renderOption={(props, option): JSX.Element => {
206
- return (
207
- <li
208
- className={classes.options}
209
- {...(props as HTMLAttributes<HTMLLIElement>)}
210
- >
211
- <Option
212
- thumbnailUrl={displayOptionThumbnail ? option.url : undefined}
213
- >
214
- {getOptionItemLabel(option)}
215
- </Option>
216
- </li>
217
- );
218
- }}
229
+ renderOption={renderOptions}
219
230
  size="small"
220
231
  slotProps={{
221
232
  ...autocompleteSlotsAndSlotProps?.slotProps,
@@ -1,4 +1,4 @@
1
- import { RefObject, forwardRef } from 'react';
1
+ import { ReactElement, RefObject, forwardRef } from 'react';
2
2
 
3
3
  import { equals, isNil } from 'ramda';
4
4
  import { makeStyles } from 'tss-react/mui';
@@ -28,12 +28,12 @@ const useStyles = makeStyles()((theme) => ({
28
28
 
29
29
  interface Props {
30
30
  checkboxSelected?: boolean;
31
- children: string;
31
+ children: string | ReactElement;
32
32
  thumbnailUrl?: string;
33
33
  }
34
34
 
35
35
  const Option = forwardRef(
36
- ({ children, checkboxSelected, thumbnailUrl }: Props, ref): JSX.Element => {
36
+ ({ children, checkboxSelected, thumbnailUrl }: Props, ref): ReactElement => {
37
37
  const { classes } = useStyles();
38
38
 
39
39
  return (
@@ -96,6 +96,7 @@ const SelectField = ({
96
96
  fullWidth={fullWidth}
97
97
  size="small"
98
98
  {...formControlProps}
99
+
99
100
  >
100
101
  {label && <InputLabel>{label}</InputLabel>}
101
102
  <Select
@@ -150,4 +151,4 @@ const SelectField = ({
150
151
  );
151
152
  };
152
153
 
153
- export default SelectField;
154
+ export default SelectField;
@@ -3,7 +3,6 @@ import { Provider as JotaiProvider, createStore } from 'jotai';
3
3
 
4
4
  import { StylesProvider, createGenerateClassName } from '@mui/styles';
5
5
 
6
- import { ThemeOptions } from '@mui/material';
7
6
  import { QueryProvider, ThemeProvider } from '..';
8
7
  import SnackbarProvider from '../Snackbar/SnackbarProvider';
9
8
 
@@ -13,10 +12,6 @@ export interface ModuleProps {
13
12
  queryClient?: QueryClient;
14
13
  seedName: string;
15
14
  store: ReturnType<typeof createStore>;
16
- overrideTheme?: {
17
- light: Partial<ThemeOptions>;
18
- dark: Partial<ThemeOptions>;
19
- };
20
15
  }
21
16
 
22
17
  const Module = ({
@@ -24,8 +19,7 @@ const Module = ({
24
19
  seedName,
25
20
  maxSnackbars = 3,
26
21
  store,
27
- queryClient,
28
- overrideTheme
22
+ queryClient
29
23
  }: ModuleProps): JSX.Element => {
30
24
  const generateClassName = createGenerateClassName({
31
25
  seed: seedName
@@ -35,7 +29,7 @@ const Module = ({
35
29
  <QueryProvider queryClient={queryClient}>
36
30
  <JotaiProvider store={store}>
37
31
  <StylesProvider generateClassName={generateClassName}>
38
- <ThemeProvider overrideTheme={overrideTheme}>
32
+ <ThemeProvider>
39
33
  <SnackbarProvider maxSnackbars={maxSnackbars}>
40
34
  {children}
41
35
  </SnackbarProvider>