@camunda/camunda-composite-components 0.0.41 → 0.0.42
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/README.md +2 -1
- package/lib/esm/api/api.d.ts +19 -19
- package/lib/esm/api/api.js +65 -67
- package/lib/esm/api/endpoints.const.d.ts +12 -12
- package/lib/esm/api/endpoints.const.js +24 -25
- package/lib/esm/api/jwt.utils.d.ts +3 -3
- package/lib/esm/api/jwt.utils.js +23 -21
- package/lib/esm/api/notifications.d.ts +64 -35
- package/lib/esm/api/notifications.js +168 -159
- package/lib/esm/components/c3-empty-state/c3-empty-state.d.ts +8 -2
- package/lib/esm/components/c3-empty-state/c3-empty-state.js +58 -17
- package/lib/esm/components/c3-empty-state/c3-empty-state.types.d.ts +19 -19
- package/lib/esm/components/c3-empty-state/c3-empty-state.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-info-button.d.ts +3 -3
- package/lib/esm/components/c3-navigation/c3-info-button.js +13 -5
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +21 -8
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation-appbar.d.ts +3 -3
- package/lib/esm/components/c3-navigation/c3-navigation-appbar.js +157 -68
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +58 -37
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +9 -9
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +56 -33
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +8 -8
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +114 -54
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +70 -60
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +4 -4
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +142 -88
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-org-sidebar.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-org-sidebar.js +105 -51
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +26 -24
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +38 -25
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +125 -43
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/components.d.ts +6 -1
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/components.js +4 -4
- package/lib/esm/components/c3-navigation/c3-navigation.d.ts +13 -2
- package/lib/esm/components/c3-navigation/c3-navigation.js +210 -88
- package/lib/esm/components/c3-navigation/c3-navigation.types.d.ts +69 -63
- package/lib/esm/components/c3-navigation/c3-navigation.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +30 -13
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-container.js +114 -70
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +29 -27
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +118 -90
- package/lib/esm/components/c3-navigation/helpers.d.ts +5 -3
- package/lib/esm/components/c3-navigation/helpers.js +53 -49
- package/lib/esm/components/c3-navigation/index.d.ts +4 -2
- package/lib/esm/components/c3-navigation/index.js +3 -3
- package/lib/esm/components/c3-navigation/story-helpers.d.ts +23 -18
- package/lib/esm/components/c3-navigation/story-helpers.js +189 -186
- package/lib/esm/components/c3-navigation/story-templates.d.ts +8 -8
- package/lib/esm/components/c3-navigation/story-templates.js +66 -33
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.d.ts +20 -16
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.js +9 -4
- package/lib/esm/icons/c3-icons.d.ts +7 -5
- package/lib/esm/icons/c3-icons.js +82 -14
- package/lib/esm/icons/c3-icons.types.d.ts +1 -1
- package/lib/esm/icons/c3-icons.types.js +1 -1
- package/lib/esm/index.d.ts +14 -9
- package/lib/esm/index.js +4 -4
- package/package.json +2 -1
|
@@ -1,76 +1,165 @@
|
|
|
1
|
-
import React, { useState } from "react"
|
|
2
|
-
import { Close } from "@carbon/react/icons"
|
|
3
|
-
import { useOnClickOutside } from "./helpers"
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { Close } from "@carbon/react/icons"
|
|
3
|
+
import { useOnClickOutside } from "./helpers"
|
|
4
|
+
import {
|
|
5
|
+
HeaderGlobalAction,
|
|
6
|
+
HeaderMenuItem,
|
|
7
|
+
HeaderSideNavItems,
|
|
8
|
+
SideNav as CarbonSideNav,
|
|
9
|
+
SideNavItems,
|
|
10
|
+
SideNavLink,
|
|
11
|
+
SideNavMenu,
|
|
12
|
+
SideNavMenuItem,
|
|
13
|
+
} from "@carbon/react"
|
|
14
|
+
import { C3AppMenuIcon } from "../../icons/c3-icons"
|
|
15
|
+
import styled from "styled-components"
|
|
16
|
+
const NavWrapper = styled.div`
|
|
8
17
|
.cds--side-nav__overlay {
|
|
9
18
|
display: none;
|
|
10
19
|
}
|
|
11
|
-
|
|
12
|
-
const SideNav = styled(CarbonSideNav)
|
|
20
|
+
`
|
|
21
|
+
const SideNav = styled(CarbonSideNav)`
|
|
13
22
|
visibility: ${({ expanded }) => (expanded ? "visible" : "hidden")};
|
|
14
23
|
display: grid;
|
|
15
24
|
grid-auto-flow: row;
|
|
16
25
|
grid-auto-rows: max-content 1fr;
|
|
17
|
-
border-right: ${({ expanded }) =>
|
|
26
|
+
border-right: ${({ expanded }) =>
|
|
27
|
+
expanded ? "1px solid var(--cds-border-subtle)" : undefined};
|
|
18
28
|
overflow-y: auto;
|
|
19
|
-
|
|
20
|
-
export const C3NavigationAppBar = ({ appBar, forwardRef, navbar
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
29
|
+
`
|
|
30
|
+
export const C3NavigationAppBar = ({ appBar, forwardRef, navbar }) => {
|
|
31
|
+
const [appBarOpen, setAppBarOpen] = useState(appBar.isOpen)
|
|
32
|
+
const [panelRef, iconRef] = useOnClickOutside(() => setAppBarOpen(false))
|
|
33
|
+
return React.createElement(
|
|
34
|
+
React.Fragment,
|
|
35
|
+
null,
|
|
36
|
+
React.createElement(
|
|
37
|
+
HeaderGlobalAction,
|
|
38
|
+
{
|
|
39
|
+
ref: iconRef,
|
|
40
|
+
"aria-label": "Camunda apps",
|
|
41
|
+
isActive: appBarOpen,
|
|
42
|
+
onClick: () => {
|
|
43
|
+
setAppBarOpen(!appBarOpen)
|
|
44
|
+
},
|
|
45
|
+
tooltipAlignment: "start",
|
|
46
|
+
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
|
|
47
|
+
/* @ts-ignore */
|
|
48
|
+
leaveDelayMs: 100,
|
|
49
|
+
},
|
|
50
|
+
appBarOpen
|
|
51
|
+
? React.createElement(Close, { size: 20 })
|
|
52
|
+
: React.createElement(C3AppMenuIcon, { size: 20 }),
|
|
53
|
+
),
|
|
54
|
+
React.createElement(
|
|
55
|
+
NavWrapper,
|
|
56
|
+
null,
|
|
57
|
+
React.createElement(
|
|
58
|
+
SideNav,
|
|
59
|
+
{
|
|
60
|
+
ref: panelRef,
|
|
61
|
+
"aria-label": appBar.ariaLabel || "Side Navigation",
|
|
62
|
+
expanded: appBarOpen,
|
|
63
|
+
isPersistent: false,
|
|
64
|
+
},
|
|
65
|
+
React.createElement(
|
|
66
|
+
SideNavItems,
|
|
67
|
+
null,
|
|
68
|
+
React.createElement(
|
|
69
|
+
"li",
|
|
70
|
+
null,
|
|
71
|
+
navbar.elements.length > 0 &&
|
|
72
|
+
React.createElement(
|
|
73
|
+
HeaderSideNavItems,
|
|
74
|
+
{ hasDivider: true },
|
|
75
|
+
navbar.elements.map((element) =>
|
|
76
|
+
React.createElement(
|
|
77
|
+
HeaderMenuItem,
|
|
78
|
+
{
|
|
79
|
+
key: element.key,
|
|
80
|
+
element: element.routeProps && forwardRef,
|
|
81
|
+
isActive: element.isCurrentPage,
|
|
82
|
+
...element.routeProps,
|
|
83
|
+
onClick: () => {
|
|
84
|
+
if (element.routeProps.onClick) {
|
|
85
|
+
element.routeProps.onClick()
|
|
86
|
+
}
|
|
87
|
+
if (appBar.closeOnClick !== false) {
|
|
88
|
+
setAppBarOpen(false)
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
element.label,
|
|
93
|
+
),
|
|
94
|
+
),
|
|
95
|
+
),
|
|
96
|
+
),
|
|
97
|
+
appBar.elements &&
|
|
98
|
+
appBar.elements.map((element) => {
|
|
99
|
+
if (element.subElements && element.subElements.length > 0) {
|
|
100
|
+
return React.createElement(
|
|
101
|
+
SideNavMenu,
|
|
102
|
+
{ large: true, title: element.label, key: element.key },
|
|
103
|
+
element.subElements.map((subElement) =>
|
|
104
|
+
React.createElement(
|
|
105
|
+
SideNavMenuItem,
|
|
106
|
+
{
|
|
107
|
+
element: subElement.routeProps && forwardRef,
|
|
108
|
+
key: subElement.key,
|
|
109
|
+
href: subElement.href,
|
|
110
|
+
target: subElement.href ? subElement.target : undefined,
|
|
111
|
+
...subElement.routeProps,
|
|
112
|
+
onClick: () => {
|
|
113
|
+
if (subElement.onClick) {
|
|
114
|
+
subElement.onClick()
|
|
115
|
+
}
|
|
116
|
+
if (subElement.routeProps.onClick) {
|
|
117
|
+
subElement.routeProps.onClick()
|
|
118
|
+
}
|
|
119
|
+
if (appBar.closeOnClick !== false) {
|
|
120
|
+
setAppBarOpen(false)
|
|
121
|
+
}
|
|
122
|
+
if (appBar.elementClicked) {
|
|
123
|
+
appBar.elementClicked(subElement.key)
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
subElement.label,
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
)
|
|
131
|
+
} else {
|
|
132
|
+
return React.createElement(
|
|
133
|
+
SideNavLink,
|
|
134
|
+
{
|
|
135
|
+
element: element.routeProps && forwardRef,
|
|
136
|
+
key: element.key,
|
|
137
|
+
large: true,
|
|
138
|
+
isActive: element.active,
|
|
139
|
+
...element.routeProps,
|
|
140
|
+
onClick: () => {
|
|
141
|
+
if (element.onClick) {
|
|
142
|
+
element.onClick()
|
|
143
|
+
}
|
|
144
|
+
if (element.routeProps.onClick) {
|
|
145
|
+
element.routeProps.onClick()
|
|
146
|
+
}
|
|
147
|
+
if (appBar.closeOnClick !== false) {
|
|
148
|
+
setAppBarOpen(false)
|
|
149
|
+
}
|
|
150
|
+
if (appBar.elementClicked) {
|
|
151
|
+
appBar.elementClicked(element.key)
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
href: element.href,
|
|
155
|
+
target: element.href ? element.target : undefined,
|
|
156
|
+
},
|
|
157
|
+
element.label,
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
}),
|
|
161
|
+
),
|
|
162
|
+
),
|
|
163
|
+
),
|
|
164
|
+
)
|
|
165
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC } from "react"
|
|
2
|
-
import { C3NavigationInfoSideBarProps } from "./c3-navigation-sidebar.types"
|
|
1
|
+
import { FC } from "react"
|
|
2
|
+
import { C3NavigationInfoSideBarProps } from "./c3-navigation-sidebar.types"
|
|
3
3
|
declare const C3InfoSidebar: FC<{
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export default C3InfoSidebar
|
|
4
|
+
sideBar: C3NavigationInfoSideBarProps
|
|
5
|
+
}>
|
|
6
|
+
export default C3InfoSidebar
|
|
@@ -1,37 +1,58 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { SwitcherDivider } from "./components"
|
|
3
|
-
import { Help } from "@carbon/react/icons"
|
|
4
|
-
import C3NavigationSideBar from "./c3-navigation-sidebar"
|
|
5
|
-
const C3InfoSidebar = ({ sideBar
|
|
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
|
-
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { SwitcherDivider } from "./components"
|
|
3
|
+
import { Help } from "@carbon/react/icons"
|
|
4
|
+
import C3NavigationSideBar from "./c3-navigation-sidebar"
|
|
5
|
+
const C3InfoSidebar = ({ sideBar }) => {
|
|
6
|
+
const { version, ...sideBarProps } = sideBar
|
|
7
|
+
return React.createElement(C3NavigationSideBar, {
|
|
8
|
+
sideBar: {
|
|
9
|
+
...sideBarProps,
|
|
10
|
+
ariaLabel: sideBarProps.ariaLabel || "Info Sidebar",
|
|
11
|
+
},
|
|
12
|
+
icon: React.createElement(Help, { size: 20 }),
|
|
13
|
+
bottomChildren:
|
|
14
|
+
version !== undefined &&
|
|
15
|
+
React.createElement(
|
|
16
|
+
React.Fragment,
|
|
17
|
+
null,
|
|
18
|
+
React.createElement(SwitcherDivider, null),
|
|
19
|
+
React.createElement(
|
|
20
|
+
"span",
|
|
21
|
+
{
|
|
22
|
+
className: "cds--switcher__item",
|
|
23
|
+
style: {
|
|
24
|
+
padding: "var(--cds-spacing-05)",
|
|
25
|
+
paddingTop: "var(--cds-spacing-03)",
|
|
26
|
+
paddingBottom: 0,
|
|
27
|
+
color: "var(--cds-text-primary)",
|
|
28
|
+
fontSize: "var(--cds-body-01-font-size)",
|
|
29
|
+
fontWeight: "var(--cds-body-01-font-weight)",
|
|
30
|
+
lineHeight: "var(--cds-body-01-line-height)",
|
|
31
|
+
letterSpacing: "var(--cds-body-01-letter-spacing)",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
"Version ",
|
|
35
|
+
version,
|
|
36
|
+
),
|
|
37
|
+
React.createElement(
|
|
38
|
+
"span",
|
|
39
|
+
{
|
|
40
|
+
className: "cds--switcher__item",
|
|
41
|
+
style: {
|
|
42
|
+
paddingRight: "var(--cds-spacing-05)",
|
|
43
|
+
paddingLeft: "var(--cds-spacing-05)",
|
|
44
|
+
color: "var(--cds-text-secondary)",
|
|
45
|
+
fontSize: "var(--cds-label-01-font-size)",
|
|
46
|
+
fontWeight: "var(--cds-label-01-font-weight)",
|
|
47
|
+
lineHeight: "var(--cds-label-01-line-height)",
|
|
48
|
+
letterSpacing: "var(--cds-label-01-letter-spacing)",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
`© Camunda Services GmbH ${new Date().getFullYear()}`,
|
|
52
|
+
React.createElement("br", null),
|
|
53
|
+
" All rights reserved.",
|
|
54
|
+
),
|
|
55
|
+
),
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
export default C3InfoSidebar
|
package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { C3NavigationElementProps } from "../c3-navigation.types"
|
|
3
|
-
import { C3NavigationSideBarProps } from "./c3-navigation-sidebar.types"
|
|
2
|
+
import { C3NavigationElementProps } from "../c3-navigation.types"
|
|
3
|
+
import { C3NavigationSideBarProps } from "./c3-navigation-sidebar.types"
|
|
4
4
|
declare const C3NavigationSidebarElement: (props: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}) => JSX.Element
|
|
11
|
-
export default C3NavigationSidebarElement
|
|
5
|
+
element: C3NavigationElementProps
|
|
6
|
+
index: number
|
|
7
|
+
itemTabIndex?: number | undefined
|
|
8
|
+
sideBar: C3NavigationSideBarProps
|
|
9
|
+
setSideBarOpen: (open: boolean) => void
|
|
10
|
+
}) => JSX.Element
|
|
11
|
+
export default C3NavigationSidebarElement
|
package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js
CHANGED
|
@@ -1,34 +1,57 @@
|
|
|
1
|
-
import { Button } from "@carbon/react"
|
|
2
|
-
import React, { useEffect, useRef, useState } from "react"
|
|
3
|
-
import { SwitcherDivider } from "./components"
|
|
1
|
+
import { Button } from "@carbon/react"
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react"
|
|
3
|
+
import { SwitcherDivider } from "./components"
|
|
4
4
|
const C3NavigationSidebarElement = (props) => {
|
|
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
|
-
|
|
5
|
+
const sideBarElementRef = useRef(null)
|
|
6
|
+
const [isOverflown, setIsOverflown] = useState(false)
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const element = sideBarElementRef.current
|
|
9
|
+
setIsOverflown(element ? element.offsetWidth < element.scrollWidth : false)
|
|
10
|
+
}, [JSON.stringify(props.element)])
|
|
11
|
+
return React.createElement(
|
|
12
|
+
React.Fragment,
|
|
13
|
+
null,
|
|
14
|
+
props.element.preceedingDivider &&
|
|
15
|
+
React.createElement(SwitcherDivider, null),
|
|
16
|
+
React.createElement(
|
|
17
|
+
Button,
|
|
18
|
+
{
|
|
19
|
+
style: {
|
|
20
|
+
width: "calc(16rem - 2px)",
|
|
21
|
+
...(props.index === 0 &&
|
|
22
|
+
(!("elements" in props.sideBar) || !props.sideBar.elements)
|
|
23
|
+
? { marginTop: "1.5rem" }
|
|
24
|
+
: {}),
|
|
25
|
+
},
|
|
26
|
+
size: "sm",
|
|
27
|
+
kind: props.element.kind ?? "ghost",
|
|
28
|
+
className: "cds--switcher__item",
|
|
29
|
+
onClick: () => {
|
|
30
|
+
if (props.element.onClick) {
|
|
31
|
+
props.element.onClick()
|
|
32
|
+
}
|
|
33
|
+
if (props.sideBar.closeOnClick !== false) {
|
|
34
|
+
props.setSideBarOpen(false)
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
tabIndex: props.itemTabIndex,
|
|
38
|
+
renderIcon: props.element.renderIcon,
|
|
39
|
+
},
|
|
40
|
+
React.createElement(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
ref: (el) => (sideBarElementRef.current = el),
|
|
44
|
+
title: isOverflown ? props.element.label : "",
|
|
45
|
+
style: {
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
textOverflow: "ellipsis",
|
|
48
|
+
whiteSpace: "nowrap",
|
|
49
|
+
width: "100%",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
props.element.label,
|
|
53
|
+
),
|
|
54
|
+
),
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
export default C3NavigationSidebarElement
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from "react"
|
|
2
|
-
import { C3NavigationSideBarProps } from "./c3-navigation-sidebar.types"
|
|
1
|
+
import { ReactElement, ReactNode } from "react"
|
|
2
|
+
import { C3NavigationSideBarProps } from "./c3-navigation-sidebar.types"
|
|
3
3
|
declare const C3NavigationSideBar: (props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}) => JSX.Element
|
|
9
|
-
export default C3NavigationSideBar
|
|
4
|
+
sideBar: C3NavigationSideBarProps
|
|
5
|
+
icon: ReactElement
|
|
6
|
+
children?: ReactNode
|
|
7
|
+
bottomChildren?: ReactNode
|
|
8
|
+
}) => JSX.Element
|
|
9
|
+
export default C3NavigationSideBar
|