@centreon/ui 25.6.1 → 25.6.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "25.6.1",
3
+ "version": "25.6.10",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -167,5 +167,11 @@
167
167
  "workerDirectory": [
168
168
  "public"
169
169
  ]
170
+ },
171
+ "nyc": {
172
+ "report-dir": "coverage",
173
+ "reporter": [
174
+ "json"
175
+ ]
170
176
  }
171
177
  }
@@ -4,6 +4,7 @@ import { makeStyles } from 'tss-react/mui';
4
4
  import { Theme } from '@mui/material';
5
5
 
6
6
  import ButtonSave from '.';
7
+ import '../../ThemeProvider/tailwindcss.css';
7
8
 
8
9
  const useStyles = makeStyles()((theme: Theme) => ({
9
10
  root: {
@@ -55,7 +55,7 @@ const ContainerDescription = ({
55
55
  {toPairs(palette[keyTheme]).map(
56
56
  ([key, value]) =>
57
57
  !includes(key, keysToRemove) && (
58
- <Grid item key={key} xs={6}>
58
+ <Grid item key={key} size={6}>
59
59
  <div className={classes.headerContainer}>
60
60
  <Typography variant="h6">{key}</Typography>
61
61
  <Typography variant="button">{value}</Typography>
@@ -4,6 +4,7 @@ import { useSnackbar } from '../..';
4
4
  import SnackbarProvider from '../../Snackbar/SnackbarProvider';
5
5
 
6
6
  import UnsavedChangesDialog from '.';
7
+ import '../../ThemeProvider/tailwindcss.css';
7
8
 
8
9
  export default {
9
10
  argTypes: {
@@ -135,6 +135,7 @@ const ConnectedAutocomplete = ({
135
135
  error={error}
136
136
  field={filterKey}
137
137
  getEndpoint={getEndpoint}
138
+ decoder={connectedAutocomplete?.decoder}
138
139
  getRenderedOptionText={connectedAutocomplete?.getRenderedOptionText}
139
140
  initialPage={1}
140
141
  isOptionEqualToValue={isOptionEqualToValue}
@@ -146,6 +147,7 @@ const ConnectedAutocomplete = ({
146
147
  onChange={changeAutocomplete}
147
148
  disableSelectAll={connectedAutocomplete?.disableSelectAll}
148
149
  limitTags={connectedAutocomplete?.limitTags}
150
+ searchConditions={connectedAutocomplete?.additionalConditionParameters}
149
151
  />
150
152
  ),
151
153
  memoProps: [
@@ -63,6 +63,7 @@ export interface InputProps {
63
63
  getRenderedOptionText?: (option) => string | JSX.Element;
64
64
  disableSelectAll?: boolean;
65
65
  limitTags?: number;
66
+ decoder?;
66
67
  };
67
68
  file?: {
68
69
  multiple?: boolean;
@@ -37,6 +37,7 @@ export interface ConnectedAutoCompleteFieldProps<TData> {
37
37
  exclusionOptionProperty?: keyof SelectEntry;
38
38
  field: string;
39
39
  getEndpoint: ({ search, page }) => string;
40
+ decoder?;
40
41
  getRenderedOptionText: (option: TData) => string;
41
42
  getRequestHeaders?: HeadersInit;
42
43
  initialPage: number;
@@ -52,6 +53,7 @@ const ConnectedAutocompleteField = (
52
53
  const InnerConnectedAutocompleteField = <TData extends { name: string }>({
53
54
  initialPage = 1,
54
55
  getEndpoint,
56
+ decoder,
55
57
  field,
56
58
  labelKey,
57
59
  open,
@@ -91,6 +93,7 @@ const ConnectedAutocompleteField = (
91
93
  const { fetchQuery, isFetching, prefetchNextPage, data } = useFetchQuery<
92
94
  ListingModel<TData>
93
95
  >({
96
+ decoder,
94
97
  baseEndpoint,
95
98
  fetchHeaders: getRequestHeaders,
96
99
  getEndpoint: (params) => {
@@ -15,6 +15,7 @@ import Panel from '../Panel';
15
15
  import Filter from './Filter';
16
16
 
17
17
  import ListingPage, { ListingPageProps } from '.';
18
+ import '../ThemeProvider/tailwindcss.css';
18
19
 
19
20
  export default { title: 'Listing Page' };
20
21
 
@@ -1,6 +1,7 @@
1
1
  import { ComponentMeta, ComponentStory } from '@storybook/react';
2
2
 
3
3
  import MultiSelectEntries from '.';
4
+ import '../ThemeProvider/tailwindcss.css';
4
5
 
5
6
  export default {
6
7
  argTypes: {
@@ -63,7 +63,7 @@ const EntryChip = ({
63
63
  const { classes } = useStyles();
64
64
 
65
65
  return (
66
- <Grid item xs={gridWidth}>
66
+ <Grid item size={gridWidth}>
67
67
  <Chip
68
68
  className={classes.chip}
69
69
  label={<div className={classes.labelChip}>{label}</div>}
@@ -230,7 +230,7 @@ const ContentWithGrid = ({
230
230
  const { classes } = useContentStyles({ isDragging });
231
231
 
232
232
  return (
233
- <Grid item style={style} xs={xs} {...listeners} {...attributes}>
233
+ <Grid item style={style} size={xs} {...listeners} {...attributes}>
234
234
  <Paper className={classes.content} ref={itemRef}>
235
235
  <Typography>{name as string}</Typography>
236
236
  </Paper>
@@ -244,7 +244,7 @@ const RootComponent = ({
244
244
  }: RootComponentProps): JSX.Element => (
245
245
  <Grid container spacing={1} style={{ width: '550px' }}>
246
246
  {not(isInDragOverlay) && (
247
- <Grid item xs={12}>
247
+ <Grid item size={12}>
248
248
  <Typography align="center">This item cannot move</Typography>
249
249
  </Grid>
250
250
  )}
@@ -7,6 +7,7 @@ import { ChangeEvent, useEffect } from 'react';
7
7
  import { CrudPage } from '.';
8
8
  import { SnackbarProvider } from '../../';
9
9
  import { Column, ColumnType } from '../../Listing/models';
10
+ import '../../ThemeProvider/tailwindcss.css';
10
11
 
11
12
  interface Item {
12
13
  id: number;
@@ -5,6 +5,7 @@ import { Box } from '@mui/material';
5
5
  import { ColumnType } from '../../Listing/models';
6
6
 
7
7
  import { DataTable } from './index';
8
+ import '../../ThemeProvider/tailwindcss.css';
8
9
 
9
10
  const meta: Meta<typeof DataTable> = {
10
11
  component: DataTable
@@ -1,6 +1,7 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
 
3
3
  import { DataTableEmptyState } from './DataTableEmptyState';
4
+ import '../../../ThemeProvider/tailwindcss.css';
4
5
 
5
6
  const meta: Meta<typeof DataTableEmptyState> = {
6
7
  component: DataTableEmptyState
@@ -1,6 +1,7 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
 
3
3
  import { DataTableItem } from './DataTableItem';
4
+ import '../../../ThemeProvider/tailwindcss.css';
4
5
 
5
6
  const meta: Meta<typeof DataTableItem> = {
6
7
  component: DataTableItem
@@ -12,6 +12,7 @@ import {
12
12
  labels,
13
13
  roles
14
14
  } from './storiesData';
15
+ import '../../../ThemeProvider/tailwindcss.css';
15
16
 
16
17
  const meta: Meta<typeof AccessRights> = {
17
18
  component: AccessRights,
@@ -17,12 +17,12 @@ const AreaIndicator = ({
17
17
  }: AreaIndicatorProps): ReactElement => {
18
18
  return (
19
19
  <div
20
- className={'bg-secondary-main/25 relative min-h-8'}
20
+ className={'bg-secondary-main/25 min-h-8 grid grid-cols-[3fr_1fr]'}
21
21
  data-depth={depth}
22
22
  style={{ height, width }}
23
23
  >
24
24
  {/* biome-ignore lint/a11y: */}
25
- <label className="left-2 rounded-sm border border-[#9747FF7F] border-dashed text-[#9747FF] text-[0.75rem] font-medium left-2 absolute top-1.5 px-2 py-0.5">
25
+ <label className="left-2 rounded-sm border border-[#9747FF7F] border-dashed text-[#9747FF] text-[0.75rem] font-medium left-2 top-1.5 px-2 py-0.5">
26
26
  {name}
27
27
  </label>
28
28
  {children}
@@ -4,6 +4,7 @@ import { Default as DefaultPageHeaderStory } from '../../Header/PageHeader/PageH
4
4
  import { AreaIndicator } from '../AreaIndicator';
5
5
 
6
6
  import { PageLayout } from './index';
7
+ import '../../../ThemeProvider/tailwindcss.css';
7
8
 
8
9
  const meta: Meta<typeof PageLayout> = {
9
10
  argTypes: {
@@ -4,6 +4,7 @@ import { Provider, atom, createStore, useSetAtom } from 'jotai';
4
4
  import { Button } from '../../Button';
5
5
 
6
6
  import { ConfirmationModal } from './ConfirmationModal';
7
+ import '../../../ThemeProvider/tailwindcss.css';
7
8
 
8
9
  const meta: Meta<typeof ConfirmationModal> = {
9
10
  component: ConfirmationModal
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
3
3
  import { Button } from '../Button';
4
4
 
5
5
  import { Modal } from '.';
6
+ import '../../ThemeProvider/tailwindcss.css';
6
7
 
7
8
  const meta: Meta<typeof Modal> = {
8
9
  argTypes: {
@@ -1,14 +1,14 @@
1
1
  import { useCallback, useState } from 'react';
2
2
 
3
- import { TabContext, TabList, TabListProps } from '@mui/lab';
4
- import { Tab } from '@mui/material';
3
+ import { TabContext } from '@mui/lab';
4
+ import { Tab, Tabs as MuiTabs, TabsProps } from '@mui/material';
5
5
 
6
6
  import { useTabsStyles } from './Tab.styles';
7
7
 
8
8
  type Props = {
9
9
  children: Array<JSX.Element>;
10
10
  defaultTab: string;
11
- tabList?: TabListProps;
11
+ tabList?: TabsProps;
12
12
  tabs: Array<{
13
13
  label: string;
14
14
  value: string;
@@ -31,12 +31,13 @@ export const Tabs = ({
31
31
 
32
32
  return (
33
33
  <TabContext value={selectedTab}>
34
- <TabList
34
+ <MuiTabs
35
35
  classes={{
36
36
  indicator: classes.indicator,
37
37
  root: classes.tabs
38
38
  }}
39
39
  onChange={changeTab}
40
+ value={selectedTab}
40
41
  {...tabList}
41
42
  >
42
43
  {tabs.map(({ value, label }) => (
@@ -48,7 +49,7 @@ export const Tabs = ({
48
49
  value={value}
49
50
  />
50
51
  ))}
51
- </TabList>
52
+ </MuiTabs>
52
53
  {children}
53
54
  </TabContext>
54
55
  );