@centreon/ui 24.7.0 → 24.7.2
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 +66 -85
- package/public/mockServiceWorker.js +1 -1
- package/src/Graph/BarChart/BarChart.cypress.spec.tsx +85 -2
- package/src/Graph/BarChart/BarStack.tsx +8 -6
- package/src/Graph/BarChart/SingleBar.tsx +2 -2
- package/src/Graph/LineChart/BasicComponents/Lines/Threshold/index.tsx +3 -3
- package/src/Graph/LineChart/Icons/Downtime.tsx +1 -1
- package/src/Graph/LineChart/LineChart.tsx +2 -0
- package/src/Graph/LineChart/helpers/index.ts +3 -0
- package/src/Graph/LineChart/index.tsx +2 -1
- package/src/Graph/LineChart/models.ts +1 -0
- package/src/Graph/PieChart/PieChart.cypress.spec.tsx +0 -4
- package/src/Graph/common/Axes/index.tsx +3 -5
- package/src/Graph/common/BaseChart/BaseChart.tsx +5 -1
- package/src/Graph/common/BaseChart/ChartSvgWrapper.tsx +2 -2
- package/src/Graph/common/BaseChart/useComputeBaseChartDimensions.ts +7 -2
- package/src/Graph/index.ts +5 -0
- package/src/{Home.stories.mdx → Home.mdx} +41 -39
- package/src/Image/index.stories.tsx +101 -101
- package/src/RichTextEditor/index.stories.tsx +102 -102
- package/src/ThemeProvider/index.tsx +5 -4
- package/src/TimePeriods/DateTimePickerInput.tsx +1 -1
- package/src/TimePeriods/index.tsx +10 -2
- package/src/TimePeriods/models.ts +1 -0
- package/src/Typography/FluidTypography/index.stories.tsx +63 -63
- package/src/components/Form/AccessRights/AccessRights.stories.tsx +5 -5
- package/src/index.ts +0 -2
- package/test/setupTests.js +1 -0
- package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +0 -60
- package/src/Listing/index.test.tsx +0 -234
- /package/{public → src}/fonts/roboto-bold-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-bold-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-bold-webfont.woff2 +0 -0
- /package/{public → src}/fonts/roboto-light-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-light-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-light-webfont.woff2 +0 -0
- /package/{public → src}/fonts/roboto-medium-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-medium-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-medium-webfont.woff2 +0 -0
- /package/{public → src}/fonts/roboto-regular-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-regular-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-regular-webfont.woff2 +0 -0
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</
|
|
1
|
+
{/* Home.mdx */}
|
|
2
|
+
|
|
3
|
+
import { Meta } from '@storybook/addon-docs'
|
|
4
|
+
import { Typography, Link, Stack } from '@mui/material'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
<Meta title="Home" />
|
|
8
|
+
|
|
9
|
+
<Typography variant="h4">Welcome to Centreon UI</Typography>
|
|
10
|
+
<br />
|
|
11
|
+
|
|
12
|
+
<Typography>This project contains design system's component used in every Centreon projects using ReactJS</Typography>
|
|
13
|
+
<br />
|
|
14
|
+
|
|
15
|
+
<Typography>Discover older versions of the Centreon UI's storybook</Typography>
|
|
16
|
+
<Stack>
|
|
17
|
+
<Link href="https://storybook.centreon.com/index.html" target="__blank" rel="noopener noreferrer">
|
|
18
|
+
<Typography>Latest</Typography>
|
|
19
|
+
</Link>
|
|
20
|
+
<Link href="https://storybook.centreon.com/23.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
21
|
+
<Typography>23.04</Typography>
|
|
22
|
+
</Link>
|
|
23
|
+
<Link href="https://storybook.centreon.com/22.10/index.html" target="__blank" rel="noopener noreferrer">
|
|
24
|
+
<Typography>22.10</Typography>
|
|
25
|
+
</Link>
|
|
26
|
+
<Link href="https://storybook.centreon.com/22.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
27
|
+
<Typography>22.04</Typography>
|
|
28
|
+
</Link>
|
|
29
|
+
<Link href="https://storybook.centreon.com/21.10/index.html" target="__blank" rel="noopener noreferrer">
|
|
30
|
+
<Typography>21.10</Typography>
|
|
31
|
+
</Link>
|
|
32
|
+
<Link href="https://storybook.centreon.com/21.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
33
|
+
<Typography>21.04</Typography>
|
|
34
|
+
</Link>
|
|
35
|
+
<Link href="https://storybook.centreon.com/20.10/index.html" target="__blank" rel="noopener noreferrer">
|
|
36
|
+
<Typography>20.10</Typography>
|
|
37
|
+
</Link>
|
|
38
|
+
<Link href="https://storybook.centreon.com/20.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
39
|
+
<Typography>20.04</Typography>
|
|
40
|
+
</Link>
|
|
41
|
+
</Stack>
|
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { ComponentStory } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import LoadingSkeleton from '../LoadingSkeleton';
|
|
4
|
-
import CentreonLogoLight from '../@assets/brand/centreon-logo-one-line-light.svg';
|
|
5
|
-
import NotAuthorized from '../@assets/images/not-authorized-template-background-light.svg';
|
|
6
|
-
|
|
7
|
-
import Image, { ImageVariant } from './Image';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
argTypes: {
|
|
11
|
-
alt: { control: 'text' },
|
|
12
|
-
height: { control: 'number' },
|
|
13
|
-
width: { control: 'number' }
|
|
14
|
-
},
|
|
15
|
-
component: Image,
|
|
16
|
-
|
|
17
|
-
title: 'Image'
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const Template: ComponentStory<typeof Image> = (args) => (
|
|
21
|
-
<Image
|
|
22
|
-
{...args}
|
|
23
|
-
fallback={<LoadingSkeleton />}
|
|
24
|
-
imagePath={CentreonLogoLight}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
const size = 50;
|
|
29
|
-
|
|
30
|
-
export const basic = Template.bind({});
|
|
31
|
-
basic.args = {
|
|
32
|
-
alt: 'Centreon logo light'
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const multipleImages = (): JSX.Element => {
|
|
36
|
-
return (
|
|
37
|
-
<div
|
|
38
|
-
style={{
|
|
39
|
-
columnGap: '16px',
|
|
40
|
-
display: 'grid',
|
|
41
|
-
gridTemplateColumns: `repeat(2, ${size}px)`
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
<Image
|
|
45
|
-
alt="Centreon logo light"
|
|
46
|
-
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
47
|
-
height={size}
|
|
48
|
-
imagePath={CentreonLogoLight}
|
|
49
|
-
width={size}
|
|
50
|
-
/>
|
|
51
|
-
<Image
|
|
52
|
-
alt="Not authorized"
|
|
53
|
-
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
54
|
-
height={size}
|
|
55
|
-
imagePath={NotAuthorized}
|
|
56
|
-
width={size}
|
|
57
|
-
/>
|
|
58
|
-
<Image
|
|
59
|
-
alt="Centreon logo light"
|
|
60
|
-
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
61
|
-
height={size}
|
|
62
|
-
imagePath={CentreonLogoLight}
|
|
63
|
-
width={size}
|
|
64
|
-
/>
|
|
65
|
-
<Image
|
|
66
|
-
alt="Not authorized"
|
|
67
|
-
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
68
|
-
height={size}
|
|
69
|
-
imagePath={NotAuthorized}
|
|
70
|
-
width={size}
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const withWidthAndHeight = Template.bind({});
|
|
77
|
-
withWidthAndHeight.args = {
|
|
78
|
-
alt: 'Centreon logo light',
|
|
79
|
-
fallback: <LoadingSkeleton height={size} width={size} />,
|
|
80
|
-
height: size,
|
|
81
|
-
imagePath: CentreonLogoLight,
|
|
82
|
-
width: size
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const imageNotFound = (): JSX.Element => (
|
|
86
|
-
<Image
|
|
87
|
-
alt="Not found alt text"
|
|
88
|
-
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
89
|
-
height={size}
|
|
90
|
-
imagePath="not-found"
|
|
91
|
-
width={size}
|
|
92
|
-
/>
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
export const variantContain = Template.bind({});
|
|
96
|
-
variantContain.args = {
|
|
97
|
-
alt: 'Centreon logo light',
|
|
98
|
-
height: size,
|
|
99
|
-
variant: ImageVariant.Contain,
|
|
100
|
-
width: size
|
|
101
|
-
};
|
|
1
|
+
import { ComponentStory } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import LoadingSkeleton from '../LoadingSkeleton';
|
|
4
|
+
import CentreonLogoLight from '../@assets/brand/centreon-logo-one-line-light.svg';
|
|
5
|
+
import NotAuthorized from '../@assets/images/not-authorized-template-background-light.svg';
|
|
6
|
+
|
|
7
|
+
import Image, { ImageVariant } from './Image';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
argTypes: {
|
|
11
|
+
alt: { control: 'text' },
|
|
12
|
+
height: { control: 'number' },
|
|
13
|
+
width: { control: 'number' }
|
|
14
|
+
},
|
|
15
|
+
component: Image,
|
|
16
|
+
|
|
17
|
+
title: 'Image'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const Template: ComponentStory<typeof Image> = (args) => (
|
|
21
|
+
<Image
|
|
22
|
+
{...args}
|
|
23
|
+
fallback={<LoadingSkeleton />}
|
|
24
|
+
imagePath={CentreonLogoLight}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const size = 50;
|
|
29
|
+
|
|
30
|
+
export const basic = Template.bind({});
|
|
31
|
+
basic.args = {
|
|
32
|
+
alt: 'Centreon logo light'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const multipleImages = (): JSX.Element => {
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
style={{
|
|
39
|
+
columnGap: '16px',
|
|
40
|
+
display: 'grid',
|
|
41
|
+
gridTemplateColumns: `repeat(2, ${size}px)`
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<Image
|
|
45
|
+
alt="Centreon logo light"
|
|
46
|
+
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
47
|
+
height={size}
|
|
48
|
+
imagePath={CentreonLogoLight}
|
|
49
|
+
width={size}
|
|
50
|
+
/>
|
|
51
|
+
<Image
|
|
52
|
+
alt="Not authorized"
|
|
53
|
+
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
54
|
+
height={size}
|
|
55
|
+
imagePath={NotAuthorized}
|
|
56
|
+
width={size}
|
|
57
|
+
/>
|
|
58
|
+
<Image
|
|
59
|
+
alt="Centreon logo light"
|
|
60
|
+
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
61
|
+
height={size}
|
|
62
|
+
imagePath={CentreonLogoLight}
|
|
63
|
+
width={size}
|
|
64
|
+
/>
|
|
65
|
+
<Image
|
|
66
|
+
alt="Not authorized"
|
|
67
|
+
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
68
|
+
height={size}
|
|
69
|
+
imagePath={NotAuthorized}
|
|
70
|
+
width={size}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const withWidthAndHeight = Template.bind({});
|
|
77
|
+
withWidthAndHeight.args = {
|
|
78
|
+
alt: 'Centreon logo light',
|
|
79
|
+
fallback: <LoadingSkeleton height={size} width={size} />,
|
|
80
|
+
height: size,
|
|
81
|
+
imagePath: CentreonLogoLight,
|
|
82
|
+
width: size
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const imageNotFound = (): JSX.Element => (
|
|
86
|
+
<Image
|
|
87
|
+
alt="Not found alt text"
|
|
88
|
+
fallback={<LoadingSkeleton height={size} width={size} />}
|
|
89
|
+
height={size}
|
|
90
|
+
imagePath="not-found"
|
|
91
|
+
width={size}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
export const variantContain = Template.bind({});
|
|
96
|
+
variantContain.args = {
|
|
97
|
+
alt: 'Centreon logo light',
|
|
98
|
+
height: size,
|
|
99
|
+
variant: ImageVariant.Contain,
|
|
100
|
+
width: size
|
|
101
|
+
};
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { ComponentMeta } from '@storybook/react';
|
|
4
|
-
import { EditorState } from 'lexical';
|
|
5
|
-
|
|
6
|
-
import RichTextEditor from './RichTextEditor';
|
|
7
|
-
import type { RichTextEditorProps } from './RichTextEditor';
|
|
8
|
-
import initialEditorState from './initialEditorState.json';
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
argTypes: {
|
|
12
|
-
editable: { control: false },
|
|
13
|
-
initialEditorState: { control: 'text' },
|
|
14
|
-
inputClassname: { control: 'text' },
|
|
15
|
-
minInputHeight: { control: 'number' },
|
|
16
|
-
namespace: { control: 'text' },
|
|
17
|
-
placeholder: { control: 'text' }
|
|
18
|
-
},
|
|
19
|
-
component: RichTextEditor,
|
|
20
|
-
title: 'RichTextEditor'
|
|
21
|
-
} as ComponentMeta<typeof RichTextEditor>;
|
|
22
|
-
|
|
23
|
-
const Template = (props: RichTextEditorProps): JSX.Element => (
|
|
24
|
-
<RichTextEditor {...props} />
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
export const normal = Template.bind({});
|
|
28
|
-
|
|
29
|
-
export const withCustomEditorMinHeight = Template.bind({});
|
|
30
|
-
withCustomEditorMinHeight.args = {
|
|
31
|
-
minInputHeight: 300
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const StoryWithUpdateListener = (): JSX.Element => {
|
|
35
|
-
const [editorState, setEditorState] = useState<EditorState>();
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div>
|
|
39
|
-
<Template getEditorState={setEditorState} />
|
|
40
|
-
<pre>{JSON.stringify(editorState, null, 2)}</pre>
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const withUpdateListener = (): JSX.Element => (
|
|
46
|
-
<StoryWithUpdateListener />
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
export const withInitialEditorState = Template.bind({});
|
|
50
|
-
withInitialEditorState.args = {
|
|
51
|
-
initialEditorState: JSON.stringify(initialEditorState)
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const withCustomPlaceholder = Template.bind({});
|
|
55
|
-
withCustomPlaceholder.args = {
|
|
56
|
-
placeholder: 'Custom placeholder...'
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const withMacrosPlugin = Template.bind({});
|
|
60
|
-
withMacrosPlugin.args = {
|
|
61
|
-
displayMacrosButton: true
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const withEditableFalse = Template.bind({});
|
|
65
|
-
withEditableFalse.args = {
|
|
66
|
-
editable: true,
|
|
67
|
-
editorState: JSON.stringify(initialEditorState),
|
|
68
|
-
initialEditorState: JSON.stringify(initialEditorState)
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const Disabled = Template.bind({});
|
|
72
|
-
Disabled.args = {
|
|
73
|
-
disabled: true,
|
|
74
|
-
editable: false,
|
|
75
|
-
editorState: JSON.stringify(initialEditorState),
|
|
76
|
-
initialEditorState: JSON.stringify(initialEditorState)
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const StoryWithEditableFalseLikePreview = (): JSX.Element => {
|
|
80
|
-
const [editorState, setEditorState] =
|
|
81
|
-
useState<EditorState>(initialEditorState);
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<div>
|
|
85
|
-
<Template
|
|
86
|
-
getEditorState={setEditorState}
|
|
87
|
-
initialEditorState={JSON.stringify(initialEditorState)}
|
|
88
|
-
namespace="editable"
|
|
89
|
-
/>
|
|
90
|
-
<Template
|
|
91
|
-
editable={false}
|
|
92
|
-
editorStateForReadOnlyMode={JSON.stringify(editorState)}
|
|
93
|
-
namespace="uneditable"
|
|
94
|
-
placeholder=""
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const withEditableFalseLikePreview = (): JSX.Element => (
|
|
101
|
-
<StoryWithEditableFalseLikePreview />
|
|
102
|
-
);
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { ComponentMeta } from '@storybook/react';
|
|
4
|
+
import { EditorState } from 'lexical';
|
|
5
|
+
|
|
6
|
+
import RichTextEditor from './RichTextEditor';
|
|
7
|
+
import type { RichTextEditorProps } from './RichTextEditor';
|
|
8
|
+
import initialEditorState from './initialEditorState.json';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
argTypes: {
|
|
12
|
+
editable: { control: false },
|
|
13
|
+
initialEditorState: { control: 'text' },
|
|
14
|
+
inputClassname: { control: 'text' },
|
|
15
|
+
minInputHeight: { control: 'number' },
|
|
16
|
+
namespace: { control: 'text' },
|
|
17
|
+
placeholder: { control: 'text' }
|
|
18
|
+
},
|
|
19
|
+
component: RichTextEditor,
|
|
20
|
+
title: 'RichTextEditor'
|
|
21
|
+
} as ComponentMeta<typeof RichTextEditor>;
|
|
22
|
+
|
|
23
|
+
const Template = (props: RichTextEditorProps): JSX.Element => (
|
|
24
|
+
<RichTextEditor {...props} />
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const normal = Template.bind({});
|
|
28
|
+
|
|
29
|
+
export const withCustomEditorMinHeight = Template.bind({});
|
|
30
|
+
withCustomEditorMinHeight.args = {
|
|
31
|
+
minInputHeight: 300
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const StoryWithUpdateListener = (): JSX.Element => {
|
|
35
|
+
const [editorState, setEditorState] = useState<EditorState>();
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div>
|
|
39
|
+
<Template getEditorState={setEditorState} />
|
|
40
|
+
<pre>{JSON.stringify(editorState, null, 2)}</pre>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const withUpdateListener = (): JSX.Element => (
|
|
46
|
+
<StoryWithUpdateListener />
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export const withInitialEditorState = Template.bind({});
|
|
50
|
+
withInitialEditorState.args = {
|
|
51
|
+
initialEditorState: JSON.stringify(initialEditorState)
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const withCustomPlaceholder = Template.bind({});
|
|
55
|
+
withCustomPlaceholder.args = {
|
|
56
|
+
placeholder: 'Custom placeholder...'
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const withMacrosPlugin = Template.bind({});
|
|
60
|
+
withMacrosPlugin.args = {
|
|
61
|
+
displayMacrosButton: true
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const withEditableFalse = Template.bind({});
|
|
65
|
+
withEditableFalse.args = {
|
|
66
|
+
editable: true,
|
|
67
|
+
editorState: JSON.stringify(initialEditorState),
|
|
68
|
+
initialEditorState: JSON.stringify(initialEditorState)
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const Disabled = Template.bind({});
|
|
72
|
+
Disabled.args = {
|
|
73
|
+
disabled: true,
|
|
74
|
+
editable: false,
|
|
75
|
+
editorState: JSON.stringify(initialEditorState),
|
|
76
|
+
initialEditorState: JSON.stringify(initialEditorState)
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const StoryWithEditableFalseLikePreview = (): JSX.Element => {
|
|
80
|
+
const [editorState, setEditorState] =
|
|
81
|
+
useState<EditorState>(initialEditorState);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div>
|
|
85
|
+
<Template
|
|
86
|
+
getEditorState={setEditorState}
|
|
87
|
+
initialEditorState={JSON.stringify(initialEditorState)}
|
|
88
|
+
namespace="editable"
|
|
89
|
+
/>
|
|
90
|
+
<Template
|
|
91
|
+
editable={false}
|
|
92
|
+
editorStateForReadOnlyMode={JSON.stringify(editorState)}
|
|
93
|
+
namespace="uneditable"
|
|
94
|
+
placeholder=""
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const withEditableFalseLikePreview = (): JSX.Element => (
|
|
101
|
+
<StoryWithEditableFalseLikePreview />
|
|
102
|
+
);
|
|
@@ -17,10 +17,11 @@ import { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
|
17
17
|
import { ThemeOptions } from '@mui/material/styles/createTheme';
|
|
18
18
|
|
|
19
19
|
import { ThemeMode, userAtom } from '@centreon/ui-context';
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
20
|
+
|
|
21
|
+
import RobotoMediumWoff2 from '../fonts/roboto-medium-webfont.woff2';
|
|
22
|
+
import RobotoBoldWoff2 from '../fonts/roboto-bold-webfont.woff2';
|
|
23
|
+
import RobotoLightWoff2 from '../fonts/roboto-light-webfont.woff2';
|
|
24
|
+
import RobotoRegularWoff2 from '../fonts/roboto-regular-webfont.woff2';
|
|
24
25
|
|
|
25
26
|
import { getPalette } from './palettes';
|
|
26
27
|
|
|
@@ -68,7 +68,7 @@ const DateTimePickerInput = ({
|
|
|
68
68
|
>
|
|
69
69
|
<DateTimePicker<dayjs.Dayjs>
|
|
70
70
|
dayOfWeekFormatter={(dayOfWeek) =>
|
|
71
|
-
dayOfWeek.
|
|
71
|
+
dayOfWeek.format('dd').toLocaleUpperCase()
|
|
72
72
|
}
|
|
73
73
|
desktopModeMediaQuery={desktopMediaQuery ?? desktopPickerMediaQuery}
|
|
74
74
|
disabled={disabled}
|
|
@@ -9,6 +9,7 @@ import timezonePlugin from 'dayjs/plugin/timezone';
|
|
|
9
9
|
import utcPlugin from 'dayjs/plugin/utc';
|
|
10
10
|
|
|
11
11
|
import { ParentSize } from '..';
|
|
12
|
+
import LoadingSkeleton from '../LoadingSkeleton';
|
|
12
13
|
|
|
13
14
|
import { WrapperTimePeriodProps } from './models';
|
|
14
15
|
import TimePeriods from './TimePeriods';
|
|
@@ -18,10 +19,17 @@ dayjs.extend(utcPlugin);
|
|
|
18
19
|
dayjs.extend(timezonePlugin);
|
|
19
20
|
dayjs.extend(duration);
|
|
20
21
|
|
|
21
|
-
const WrapperTimePeriods = (
|
|
22
|
+
const WrapperTimePeriods = ({
|
|
23
|
+
skeletonHeight = 38,
|
|
24
|
+
...rest
|
|
25
|
+
}: WrapperTimePeriodProps): JSX.Element => (
|
|
22
26
|
<ParentSize>
|
|
23
27
|
{({ width }): JSX.Element => {
|
|
24
|
-
return
|
|
28
|
+
return !width ? (
|
|
29
|
+
<LoadingSkeleton height={skeletonHeight} variant="rectangular" />
|
|
30
|
+
) : (
|
|
31
|
+
<TimePeriods width={width} {...rest} />
|
|
32
|
+
);
|
|
25
33
|
}}
|
|
26
34
|
</ParentSize>
|
|
27
35
|
);
|