grep-components 1.26.0-GREPF-2179.1 → 1.26.0-GREPF-2126.1
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/dist/components/AppBar/stories/AppBarStory.stories.d.ts +12 -0
- package/dist/components/AppBarNavList/stories/AppBarNavList.stories.d.ts +12 -0
- package/dist/components/AppBarProfile/stories/AppBarProfile.stories.d.ts +11 -1
- package/dist/components/CircularLoading/stories/CircularLoading.stories.d.ts +17 -1
- package/dist/components/ConfirmationDialog/stories/dialog.stories.d.ts +18 -1
- package/dist/components/ContainedLinkList/stories/ContainedLinkList.stories.d.ts +12 -0
- package/dist/components/DropdownMenu/stories/DropDownMenu.stories.d.ts +12 -1
- package/dist/components/Footer/stories/Footer.stories.d.ts +18 -0
- package/dist/components/GDPR/stories/GDPR.stories.d.ts +11 -0
- package/dist/components/GrepCrumbs/stories/GrepCrumbs.stories.d.ts +18 -0
- package/dist/components/GrepDatePicker/stories/DatePicker.stories.d.ts +9 -1
- package/dist/components/GrepDateRange/stories/GrepDateRange.stories.d.ts +8 -0
- package/dist/components/GrepDialog/stories/dialog.stories.d.ts +18 -1
- package/dist/components/GrepEditor/stories/GrepEditor.stories.d.ts +49 -1
- package/dist/components/GrepInput/stories/GrepInput.stories.d.ts +13 -1
- package/dist/components/GrepSelect/stories/GrepSelect.stories.d.ts +8 -1
- package/dist/components/GrepTable/stories/GrepTable.stories.d.ts +67 -0
- package/dist/components/GrepTableCard/stories/GrepTableCard.stories.d.ts +12 -0
- package/dist/components/GreyCover/stories/GreyCover.stories.d.ts +11 -1
- package/dist/components/InfoContainer/stories/infoContainer.stories.d.ts +17 -1
- package/dist/components/LinkList/stories/LinkList.stories.d.ts +12 -0
- package/dist/components/LoadingOverlay/stories/LoadingOverlay.stories.d.ts +11 -1
- package/dist/components/MainLayout/stories/MainLayout.stories.d.ts +11 -1
- package/dist/components/NavGuard/stories/NavGuard.stories.d.ts +11 -0
- package/dist/components/ProfileInfo/stories/ProfileInfo.stories.d.ts +12 -0
- package/dist/components/SearchBar/stories/SearchBar.stories.d.ts +11 -1
- package/dist/components/Sidebar/stories/Sidebar.stories.d.ts +12 -0
- package/dist/components/SortableTable/stories/SortableTable.stories.d.ts +11 -0
- package/dist/components/ToC/stories/ToC.stories.d.ts +11 -0
- package/dist/index.js +25 -11
- package/dist/index.js.map +1 -1
- package/dist/stories/index.stories.d.ts +15 -0
- package/package.json +17 -15
- package/dist/components/DropdownMenu/components/tooltip-menu-item.d.ts +0 -7
- package/dist/components/GrepDateRange/stories/index.d.ts +0 -1
- package/dist/components/NavGuard/stories/index.d.ts +0 -1
- package/dist/components/SortableTable/stories/index.d.ts +0 -1
- package/dist/components/ToC/stories/index.d.ts +0 -1
- package/dist/stories/index.d.ts +0 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const v0colors: {
|
|
2
3
|
primary: string;
|
|
3
4
|
secondary: string;
|
|
@@ -13,3 +14,14 @@ export declare const v0colors: {
|
|
|
13
14
|
white: string;
|
|
14
15
|
lightGrey: string;
|
|
15
16
|
};
|
|
17
|
+
declare const _default: {
|
|
18
|
+
title: string;
|
|
19
|
+
excludeStories: string[];
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
export declare const WithContent: {
|
|
23
|
+
(): JSX.Element;
|
|
24
|
+
story: {
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const navbarPages: {
|
|
2
3
|
id: number;
|
|
3
4
|
label: string;
|
|
@@ -6,3 +7,14 @@ export declare const navbarPages: {
|
|
|
6
7
|
name: string;
|
|
7
8
|
path: string;
|
|
8
9
|
}[];
|
|
10
|
+
declare const _default: {
|
|
11
|
+
title: string;
|
|
12
|
+
excludeStories: string[];
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
export declare const WithThemeAndAppbar: {
|
|
16
|
+
(): JSX.Element;
|
|
17
|
+
story: {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Standard: {
|
|
7
|
+
(): JSX.Element;
|
|
8
|
+
story: {
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const CustomHeight: {
|
|
13
|
+
(): JSX.Element;
|
|
14
|
+
story: {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Standard: {
|
|
8
|
+
(): JSX.Element;
|
|
9
|
+
story: {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const Warning: {
|
|
14
|
+
(): JSX.Element;
|
|
15
|
+
story: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { NavigationProps } from '../../AppBarNavList';
|
|
2
3
|
export declare const myPages: NavigationProps[];
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
excludeStories: string[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Standard: {
|
|
10
|
+
(): JSX.Element;
|
|
11
|
+
story: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DropdownMenuItem } from '../..';
|
|
2
3
|
interface TestMenuItem {
|
|
3
4
|
label: string;
|
|
@@ -5,4 +6,14 @@ interface TestMenuItem {
|
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const menuItems: DropdownMenuItem<TestMenuItem>[];
|
|
8
|
-
|
|
9
|
+
declare const _default: {
|
|
10
|
+
title: string;
|
|
11
|
+
excludeStories: string[];
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
export declare const Standard: {
|
|
15
|
+
(): JSX.Element;
|
|
16
|
+
story: {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FooterItem } from '..';
|
|
2
3
|
export declare const footerItems: FooterItem[];
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
excludeStories: string[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const FooterWithContent: {
|
|
10
|
+
(): JSX.Element;
|
|
11
|
+
story: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const FooterWithContentLongerThan100: {
|
|
16
|
+
(): JSX.Element;
|
|
17
|
+
story: {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const renderGDPRText: () => JSX.Element;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
excludeStories: string[];
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Standard: {
|
|
9
|
+
(): JSX.Element;
|
|
10
|
+
story: {
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Breadcrumb } from '..';
|
|
2
3
|
export declare const breadcrumbs: Breadcrumb[];
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
excludeStories: string[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Standard: {
|
|
10
|
+
(): JSX.Element;
|
|
11
|
+
story: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const OverflowAsTooltip: {
|
|
16
|
+
(): JSX.Element;
|
|
17
|
+
story: {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Standard: () => JSX.Element;
|
|
8
|
+
export declare const Test: () => JSX.Element;
|
|
9
|
+
export declare const Outlined: () => JSX.Element;
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Standard: {
|
|
8
|
+
(): JSX.Element;
|
|
9
|
+
story: {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const WithCustomActions: {
|
|
14
|
+
(): JSX.Element;
|
|
15
|
+
story: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Standard: () => JSX.Element;
|
|
8
|
+
export declare const CustomStyles: {
|
|
9
|
+
(): JSX.Element;
|
|
10
|
+
story: {
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const CustomToolbar: {
|
|
15
|
+
(): JSX.Element;
|
|
16
|
+
story: {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const CustomButtons: {
|
|
21
|
+
(): JSX.Element;
|
|
22
|
+
story: {
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const PasteStrippingAndBlockedInlineStyles: {
|
|
27
|
+
(): JSX.Element;
|
|
28
|
+
story: {
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const WithCharacterCount: {
|
|
33
|
+
(): JSX.Element;
|
|
34
|
+
story: {
|
|
35
|
+
name: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const DisableAndStripNewlines: {
|
|
39
|
+
(): JSX.Element;
|
|
40
|
+
story: {
|
|
41
|
+
name: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export declare const DisablePasting: {
|
|
45
|
+
(): JSX.Element;
|
|
46
|
+
story: {
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Input: () => JSX.Element;
|
|
8
|
+
export declare const InputOutlined: {
|
|
9
|
+
(): JSX.Element;
|
|
10
|
+
story: {
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Standard: () => JSX.Element;
|
|
8
|
+
export declare const Outlined: () => JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TableColumn } from '..';
|
|
2
3
|
export interface ICurriculum {
|
|
3
4
|
id: number;
|
|
@@ -8,3 +9,69 @@ export interface ICurriculum {
|
|
|
8
9
|
}
|
|
9
10
|
export declare const tableColumns: TableColumn<ICurriculum>[];
|
|
10
11
|
export declare const tableData: (samples?: number) => ICurriculum[];
|
|
12
|
+
declare const _default: {
|
|
13
|
+
title: string;
|
|
14
|
+
decorators: ((storyFn: any) => JSX.Element)[];
|
|
15
|
+
excludeStories: string[];
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const Standard: {
|
|
19
|
+
(): JSX.Element;
|
|
20
|
+
story: {
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const Outlined: {
|
|
25
|
+
(): JSX.Element;
|
|
26
|
+
story: {
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare const Clickable: {
|
|
31
|
+
(): JSX.Element;
|
|
32
|
+
story: {
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const WithoutData: {
|
|
37
|
+
(): JSX.Element;
|
|
38
|
+
story: {
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const WithDropdownMenu: {
|
|
43
|
+
(): JSX.Element;
|
|
44
|
+
story: {
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const WithPagination: {
|
|
49
|
+
(): JSX.Element;
|
|
50
|
+
story: {
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare const WithoutHeader: {
|
|
55
|
+
(): JSX.Element;
|
|
56
|
+
story: {
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const WithoutPadding: {
|
|
61
|
+
(): JSX.Element;
|
|
62
|
+
story: {
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare const WithRowStyle: {
|
|
67
|
+
(): JSX.Element;
|
|
68
|
+
story: {
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare const WithRowStyleFunction: {
|
|
73
|
+
(): JSX.Element;
|
|
74
|
+
story: {
|
|
75
|
+
name: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ICurriculum } from '../../GrepTable/stories/GrepTable.stories';
|
|
2
3
|
export declare const data: ICurriculum[];
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
excludeStories: string[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Standard: {
|
|
10
|
+
(): JSX.Element;
|
|
11
|
+
story: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const HorizontalFields: {
|
|
7
|
+
(): JSX.Element;
|
|
8
|
+
story: {
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const VerticalFields: {
|
|
13
|
+
(): JSX.Element;
|
|
14
|
+
story: {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { NavigationProps } from '../../AppBarNavList';
|
|
2
3
|
export declare const adminPages: NavigationProps[];
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
excludeStories: string[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Standard: {
|
|
10
|
+
(): JSX.Element;
|
|
11
|
+
story: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const user: {
|
|
2
3
|
firstName: string;
|
|
3
4
|
lastName: string;
|
|
@@ -5,3 +6,14 @@ export declare const user: {
|
|
|
5
6
|
phoneNumber: string;
|
|
6
7
|
role: string;
|
|
7
8
|
};
|
|
9
|
+
declare const _default: {
|
|
10
|
+
title: string;
|
|
11
|
+
excludeStories: string[];
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
export declare const Standard: {
|
|
15
|
+
(): JSX.Element;
|
|
16
|
+
story: {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { NavigationProps } from '../../AppBarNavList';
|
|
2
3
|
export declare const adminPages: NavigationProps[];
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
excludeStories: string[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Standard: {
|
|
10
|
+
(): JSX.Element;
|
|
11
|
+
story: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -3123,12 +3123,6 @@ var CollapsableMenu = function (_a) {
|
|
|
3123
3123
|
React__default.createElement(MenuList, { disablePadding: true, autoFocusItem: true, onKeyDown: onKeyDown }, children)));
|
|
3124
3124
|
};
|
|
3125
3125
|
|
|
3126
|
-
var TooltipMenuItem = function (_a) {
|
|
3127
|
-
var children = _a.children, tooltipText = _a.tooltipText, disabled = _a.disabled, props = __rest$1(_a, ["children", "tooltipText", "disabled"]);
|
|
3128
|
-
return (React__default.createElement(Tooltip, { title: tooltipText },
|
|
3129
|
-
React__default.createElement(MenuItem, __assign({ role: "menuitem", disabled: disabled, sx: { pointerEvents: 'inherit !important' } }, props), children)));
|
|
3130
|
-
};
|
|
3131
|
-
|
|
3132
3126
|
var useStyles$g = makeStyles()(function (_a, _b) {
|
|
3133
3127
|
var palette = _a.palette, transitions = _a.transitions;
|
|
3134
3128
|
var open = _b.open;
|
|
@@ -3235,7 +3229,10 @@ var CollapsableMenuItem = function (_a) {
|
|
|
3235
3229
|
return window.dispatchEvent(new Event('resize'));
|
|
3236
3230
|
});
|
|
3237
3231
|
} }, items)))); };
|
|
3238
|
-
return tooltipText ? (React__default.createElement(
|
|
3232
|
+
return tooltipText ? (React__default.createElement(Tooltip, { title: tooltipText },
|
|
3233
|
+
React__default.createElement(MenuItem, { role: "menuitem", sx: disabled && !items
|
|
3234
|
+
? { cursor: 'not-allowed', pointerEvents: 'inherit !important' }
|
|
3235
|
+
: { pointerEvents: 'inherit !important' }, className: classes.root, onMouseOver: function (e) { return e.currentTarget.focus(); }, selected: open, ref: listItemRef, onClick: handleClick, onKeyDown: handleKey }, renderInner()))) : (React__default.createElement(MenuItem, __assign({ sx: disabled && !items ? { cursor: 'not-allowed' } : {}, className: classes.root, ref: listItemRef, selected: open, onClick: handleClick, onKeyDown: handleKey }, props), renderInner()));
|
|
3239
3236
|
};
|
|
3240
3237
|
|
|
3241
3238
|
var useStyles$f = makeStyles()(function (_a) {
|
|
@@ -3251,20 +3248,37 @@ var useStyles$f = makeStyles()(function (_a) {
|
|
|
3251
3248
|
var DropdownMenu = function (_a) {
|
|
3252
3249
|
var context = _a.context, menuItems = _a.menuItems, menuProps = __rest$1(_a, ["context", "menuItems"]);
|
|
3253
3250
|
var classes = useStyles$f().classes;
|
|
3254
|
-
var renderChild = function (level) {
|
|
3251
|
+
var renderChild = function (level, parentDisabled) {
|
|
3255
3252
|
if (level === void 0) { level = 0; }
|
|
3256
3253
|
// eslint-disable-next-line react/display-name
|
|
3257
3254
|
return function (item, index) {
|
|
3255
|
+
var _a;
|
|
3258
3256
|
var label = item.label, children = item.children, handleClick = item.handleClick, disabled = item.disabled, props = __rest$1(item, ["label", "children", "handleClick", "disabled"]);
|
|
3257
|
+
var itemOrParentDisabled = (_a = (parentDisabled || disabled)) !== null && _a !== void 0 ? _a : false;
|
|
3259
3258
|
props.key = "child-item-".concat(index);
|
|
3260
3259
|
props.classes = { selected: classes.selected };
|
|
3261
3260
|
// ninja way, since rewriting existing code on lpu and admin is daunting
|
|
3262
3261
|
props.onClick = function (e) {
|
|
3262
|
+
if (itemOrParentDisabled) {
|
|
3263
|
+
e.preventDefault();
|
|
3264
|
+
e.stopPropagation();
|
|
3265
|
+
return;
|
|
3266
|
+
}
|
|
3263
3267
|
menuProps.onClose && menuProps.onClose(e, 'backdropClick');
|
|
3264
|
-
handleClick && handleClick(context);
|
|
3268
|
+
!itemOrParentDisabled && handleClick && handleClick(context);
|
|
3265
3269
|
};
|
|
3266
|
-
|
|
3267
|
-
|
|
3270
|
+
var style = !itemOrParentDisabled
|
|
3271
|
+
? { paddingLeft: "".concat(level * 0.5, "rem") }
|
|
3272
|
+
: {
|
|
3273
|
+
paddingLeft: "".concat(level * 0.5, "rem"),
|
|
3274
|
+
opacity: 0.4,
|
|
3275
|
+
};
|
|
3276
|
+
return (React__default.createElement(CollapsableMenuItem, __assign({ sx: itemOrParentDisabled && !children ? { cursor: 'not-allowed' } : {}, level: level, id: label, disabled: itemOrParentDisabled
|
|
3277
|
+
? true
|
|
3278
|
+
: typeof disabled === 'function'
|
|
3279
|
+
? disabled(context)
|
|
3280
|
+
: disabled, items: children === null || children === void 0 ? void 0 : children.map(renderChild(level + 1, itemOrParentDisabled)) }, props),
|
|
3281
|
+
React__default.createElement("span", { style: style }, label)));
|
|
3268
3282
|
};
|
|
3269
3283
|
};
|
|
3270
3284
|
return (React__default.createElement(Menu, __assign({}, menuProps, { anchorOrigin: (menuProps === null || menuProps === void 0 ? void 0 : menuProps.anchorOrigin) || {
|