@servicetitan/navigation 11.0.0-canary.237.0ce6038.0 → 11.0.0-canary.237.1f404bf.0
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/badge-tag.d.ts +1 -1
- package/dist/components/badge-tag.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.js +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
- package/dist/components/left-navigation/header-navigation-tiny.stories.js +2 -2
- package/dist/components/left-navigation/header-navigation-tiny.stories.js.map +1 -1
- package/dist/components/logo/logo-titan-text.d.ts +1 -1
- package/dist/components/logo/logo-titan-text.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.d.ts +10 -7
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +2 -2
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.module.less +2 -0
- package/dist/components/titan-layout/layout-context.js +1 -1
- package/dist/components/titan-layout/layout-context.js.map +1 -1
- package/dist/components/titan-layout/layout-header.d.ts +2 -0
- package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header.js +3 -4
- package/dist/components/titan-layout/layout-header.js.map +1 -1
- package/dist/components/titan-layout/layout-header.module.less +60 -21
- package/dist/components/titan-layout/layout-logo.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-logo.js +2 -1
- package/dist/components/titan-layout/layout-logo.js.map +1 -1
- package/dist/components/titan-layout/layout-profile.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-profile.js +32 -8
- package/dist/components/titan-layout/layout-profile.js.map +1 -1
- package/dist/components/titan-layout/layout-profile.stories.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-profile.stories.js +1 -1
- package/dist/components/titan-layout/layout-profile.stories.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts +2 -2
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.js +4 -4
- package/dist/components/titan-layout/layout-sidebar-links-internal.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.js +12 -5
- package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.d.ts +2 -0
- package/dist/components/titan-layout/layout-sidebar.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.js +6 -4
- package/dist/components/titan-layout/layout-sidebar.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.module.less +29 -6
- package/dist/components/titan-layout/notifications-context.d.ts +13 -0
- package/dist/components/titan-layout/notifications-context.d.ts.map +1 -0
- package/dist/components/titan-layout/notifications-context.js +23 -0
- package/dist/components/titan-layout/notifications-context.js.map +1 -0
- package/dist/components/titan-layout/titan-layout.d.ts +10 -6
- package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.js +104 -21
- package/dist/components/titan-layout/titan-layout.js.map +1 -1
- package/dist/components/titan-layout/titan-layout.module.less +50 -20
- package/dist/components/titan-layout/titan-layout.stories.d.ts +15 -11
- package/dist/components/titan-layout/titan-layout.stories.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.stories.js +35 -14
- package/dist/components/titan-layout/titan-layout.stories.js.map +1 -1
- package/dist/test/data.d.ts +4 -1
- package/dist/test/data.d.ts.map +1 -1
- package/dist/test/data.js +2 -3
- package/dist/test/data.js.map +1 -1
- package/dist/utils/use-breakpoint.d.ts +1 -0
- package/dist/utils/use-breakpoint.d.ts.map +1 -1
- package/dist/utils/use-breakpoint.js +3 -2
- package/dist/utils/use-breakpoint.js.map +1 -1
- package/package.json +2 -2
- package/src/components/badge-tag.tsx +1 -1
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +1 -1
- package/src/components/header-navigation/header-navigation.stories.tsx +1 -1
- package/src/components/left-navigation/header-navigation-tiny.stories.tsx +2 -2
- package/src/components/logo/logo-titan-text.tsx +1 -1
- package/src/components/profile-dropdown/profile-dropdown.module.less +2 -0
- package/src/components/profile-dropdown/profile-dropdown.tsx +13 -6
- package/src/components/titan-layout/layout-context.tsx +1 -1
- package/src/components/titan-layout/layout-header.module.less +60 -21
- package/src/components/titan-layout/layout-header.module.less.d.ts +2 -0
- package/src/components/titan-layout/layout-header.tsx +17 -6
- package/src/components/titan-layout/layout-logo.tsx +13 -6
- package/src/components/titan-layout/layout-profile.stories.tsx +10 -1
- package/src/components/titan-layout/layout-profile.tsx +62 -25
- package/src/components/titan-layout/layout-sidebar-links-internal.tsx +18 -5
- package/src/components/titan-layout/layout-sidebar-links.tsx +21 -5
- package/src/components/titan-layout/layout-sidebar.module.less +29 -6
- package/src/components/titan-layout/layout-sidebar.module.less.d.ts +1 -0
- package/src/components/titan-layout/layout-sidebar.tsx +14 -5
- package/src/components/titan-layout/notifications-context.tsx +44 -0
- package/src/components/titan-layout/titan-layout.module.less +50 -20
- package/src/components/titan-layout/titan-layout.module.less.d.ts +3 -0
- package/src/components/titan-layout/titan-layout.stories.tsx +166 -19
- package/src/components/titan-layout/titan-layout.tsx +265 -76
- package/src/test/data.tsx +2 -3
- package/src/utils/use-breakpoint.ts +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-profile.stories.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-profile.stories.tsx"],"names":[],"mappings":";;;;;;;;;;AAWA,wBAKE;AAEF,eAAO,MAAM,cAAc,+
|
|
1
|
+
{"version":3,"file":"layout-profile.stories.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-profile.stories.tsx"],"names":[],"mappings":";;;;;;;;;;AAWA,wBAKE;AAEF,eAAO,MAAM,cAAc,+CA2B1B,CAAC"}
|
|
@@ -9,5 +9,5 @@ export default {
|
|
|
9
9
|
decorators: [withDefaultRedirects, withMemoryRouter, withAnvil],
|
|
10
10
|
parameters: {},
|
|
11
11
|
};
|
|
12
|
-
export const ProfileDefault = withTitanLayout(_jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", children: "first link" }), _jsx(ProfileDropdown.Section, { id: "second", onClick: () => alert('second click'), children: "second link" }), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Section, { id: "content", children: "some content" }), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Link, { id: "third", to: "third", children: "third link" }), _jsx(ProfileDropdown.Divider, {})] }));
|
|
12
|
+
export const ProfileDefault = withTitanLayout(_jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", external: true, children: "first link" }), _jsx(ProfileDropdown.Section, { id: "second", onClick: () => alert('second click'), children: "second link" }), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Section, { id: "content", children: "some content" }), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Link, { id: "third", to: "third", children: "third link" }), _jsx(ProfileDropdown.Divider, {}), _jsxs(ProfileDropdown.Section, { id: "forth", onClick: () => alert('forth click'), text: "Sign Out user", children: ["Sign Out", _jsx("span", { className: "c-neutral-60 m-l-1", children: "user" })] }), _jsx(ProfileDropdown.Divider, {})] }));
|
|
13
13
|
//# sourceMappingURL=layout-profile.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-profile.stories.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-profile.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,eAAe,GAAG,CAAC,OAAqB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CACrD,KAAC,WAAW,IAAC,mBAAmB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,YAClD,KAAC,WAAW,CAAC,OAAO,0BAA8B,GACxC,CACjB,CAAC;AAEF,eAAe;IACX,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,eAAe;IAC1B,UAAU,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,SAAS,CAAC;IAC/D,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CACzC,MAAC,eAAe,eACZ,KAAC,eAAe,CAAC,IAAI,IAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"layout-profile.stories.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-profile.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,eAAe,GAAG,CAAC,OAAqB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CACrD,KAAC,WAAW,IAAC,mBAAmB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,YAClD,KAAC,WAAW,CAAC,OAAO,0BAA8B,GACxC,CACjB,CAAC;AAEF,eAAe;IACX,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,eAAe;IAC1B,UAAU,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,SAAS,CAAC;IAC/D,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CACzC,MAAC,eAAe,eACZ,KAAC,eAAe,CAAC,IAAI,IAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,oBAAoB,EAAC,QAAQ,iCAE1C,EACvB,KAAC,eAAe,CAAC,OAAO,IAAC,EAAE,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,4BAE/C,EAC1B,KAAC,eAAe,CAAC,OAAO,KAAG,EAC3B,KAAC,eAAe,CAAC,OAAO,IAAC,EAAE,EAAC,SAAS,6BAAuC,EAC5E,KAAC,eAAe,CAAC,OAAO,KAAG,EAC3B,KAAC,eAAe,CAAC,OAAO,KAAG,EAC3B,KAAC,eAAe,CAAC,OAAO,KAAG,EAC3B,KAAC,eAAe,CAAC,IAAI,IAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,2BAEpB,EACvB,KAAC,eAAe,CAAC,OAAO,KAAG,EAC3B,MAAC,eAAe,CAAC,OAAO,IACpB,EAAE,EAAC,OAAO,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,EACnC,IAAI,EAAC,eAAe,yBAGpB,eAAM,SAAS,EAAC,oBAAoB,qBAAY,IAC1B,EAC1B,KAAC,eAAe,CAAC,OAAO,KAAG,IACb,CACrB,CAAC"}
|
|
@@ -28,7 +28,7 @@ export declare const internalNavigationContentContainerProps: ({ className, icon
|
|
|
28
28
|
export declare const InternalSideNavigationLink: FC<InternalSideNavigationLinkProps>;
|
|
29
29
|
/** Side Navigation menu trigger (for internal usage) */
|
|
30
30
|
export declare const InternalSideNavigationTrigger: FC<Omit<InternalSideNavigationLinkProps, 'to' | 'navigationComponent'> & {
|
|
31
|
-
onClick?: () => void;
|
|
31
|
+
onClick?: (e: MouseEvent<never>) => void;
|
|
32
32
|
}>;
|
|
33
33
|
export declare const InternalSideNavigationGroupLink: FC<NavigationSubmenuItemData & NavigationComponentProps>;
|
|
34
34
|
export declare const InternalSideNavigationGroupTrigger: FC<Omit<NavigationSubmenuItemData, 'to'> & {
|
|
@@ -41,6 +41,6 @@ export declare const InternalSideNavigationGroup: FC<Omit<NavigationItemData, 't
|
|
|
41
41
|
onExpandToggle?: (e: MouseEvent<never>) => void;
|
|
42
42
|
tag: BadgeTagProps | undefined;
|
|
43
43
|
to: NavigationItemData['to'] | undefined;
|
|
44
|
-
onClick?: () => void;
|
|
44
|
+
onClick?: (e: MouseEvent<never>) => void;
|
|
45
45
|
}>;
|
|
46
46
|
//# sourceMappingURL=layout-sidebar-links-internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-sidebar-links-internal.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar-links-internal.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,EAAE,EAAY,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAY,aAAa,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,MAAM,WAAW,sCACb,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;IACvE,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,iCAAiC,EAAE,EAAE,CAAC,sCAAsC,CAqExF,CAAC;AAEF,MAAM,WAAW,+BACb,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC,EAC5D,wBAAwB;IAC5B,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,uCAAuC,GAAI,+EASrD,IAAI,CAAC,8BAA8B,EAAE,UAAU,GAAG,KAAK,CAAC,GAAG;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACnB;;;;CAQC,CAAC;AAEH,qDAAqD;AACrD,eAAO,MAAM,0BAA0B,EAAE,EAAE,CAAC,+BAA+B,CA8B1E,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,6BAA6B,EAAE,EAAE,CAC1C,IAAI,CAAC,+BAA+B,EAAE,IAAI,GAAG,qBAAqB,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"layout-sidebar-links-internal.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar-links-internal.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,EAAE,EAAY,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAY,aAAa,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,MAAM,WAAW,sCACb,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,IAAI,GAAG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C/C,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;CAAE,CAkBrF,CAAC;AAEF,eAAO,MAAM,kCAAkC,+CAE9C,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,EAAE,CACxC,IAAI,CAAC,kBAAkB,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC,GAC9C,wBAAwB,GAAG;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAChD,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;IAC/B,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CAC5C,CA8BR,CAAC"}
|
|
@@ -39,13 +39,13 @@ export const InternalSideNavigationTrigger = ({ className, dataPrefix, isActive,
|
|
|
39
39
|
isLink: !!onClick,
|
|
40
40
|
}), onClick: onClick, children: _jsx(InternalSideNavigationItemContent, { submenuExpanded: submenuExpanded, onExpandToggle: onExpandToggle, ...props }) }));
|
|
41
41
|
};
|
|
42
|
-
export const InternalSideNavigationGroupLink = ({ id, counter, tag, title, to, isActive, navigationComponent: NavigationComponent }) => {
|
|
43
|
-
return (_jsxs(NavigationComponent, { "data-cy": `navigation-item-${id}`, "data-pendo": `navigation-item-${id}`, to: to, className: classNames(Styles.submenuItem, Styles.submenuLink, {
|
|
42
|
+
export const InternalSideNavigationGroupLink = ({ id, counter, tag, title, to, isActive, navigationComponent: NavigationComponent, ...rest }) => {
|
|
43
|
+
return (_jsxs(NavigationComponent, { "data-cy": `navigation-item-${id}`, "data-pendo": `navigation-item-${id}`, ...rest, to: to, className: classNames(Styles.submenuItem, Styles.submenuLink, {
|
|
44
44
|
[Styles.submenuLinkActive]: isActive === true,
|
|
45
45
|
}), isActive: typeof isActive === 'function' ? isActive : undefined, activeClassName: Styles.submenuLinkActive, children: [_jsx("span", { children: title }), _jsx(BadgeTag, { data: getCounterTag(counter, tag), className: Styles.submenuLinkCounter })] }, id));
|
|
46
46
|
};
|
|
47
|
-
export const InternalSideNavigationGroupTrigger = ({ id, counter, onClick, tag, title, isActive }) => {
|
|
48
|
-
return (_jsxs("div", { "data-cy": `navigation-item-${id}`, "data-pendo": `navigation-item-${id}`, className: classNames(Styles.submenuItem, {
|
|
47
|
+
export const InternalSideNavigationGroupTrigger = ({ id, counter, onClick, tag, title, isActive, ...rest }) => {
|
|
48
|
+
return (_jsxs("div", { "data-cy": `navigation-item-${id}`, "data-pendo": `navigation-item-${id}`, ...rest, className: classNames(Styles.submenuItem, {
|
|
49
49
|
[Styles.submenuLink]: !!onClick,
|
|
50
50
|
[Styles.submenuLinkActive]: isActive === true,
|
|
51
51
|
}), onClick: onClick, children: [_jsx("span", { children: title }), _jsx(BadgeTag, { data: getCounterTag(counter, tag), className: Styles.submenuLinkCounter })] }, id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-sidebar-links-internal.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar-links-internal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,kEAAkE,CAAC;AAChG,OAAO,cAAc,MAAM,kEAAkE,CAAC;AAE9F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAM,QAAQ,EAAyB,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAiB,MAAM,cAAc,CAAC;AAGvD,OAAO,KAAK,MAAM,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,EAAE,EAAE,EACN,QAAQ,EAAE,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC/D,eAAe,EAAE,MAAM,CAAC,aAAa,YAErC,KAAC,iCAAiC,IAC9B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,KAC1B,KAAK,GACX,GACgB,CACzB,CAAC;AACN,CAAC,CAAC;AAEF,wDAAwD;AACxD,MAAM,CAAC,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"layout-sidebar-links-internal.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar-links-internal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,kEAAkE,CAAC;AAChG,OAAO,cAAc,MAAM,kEAAkE,CAAC;AAE9F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAM,QAAQ,EAAyB,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAiB,MAAM,cAAc,CAAC;AAGvD,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AASvD,MAAM,CAAC,MAAM,iCAAiC,GAA+C,CAAC,EAC1F,IAAI,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EAAE,aAAa,EAC5B,GAAG,EACH,KAAK,EACL,eAAe,EACf,cAAc,GACjB,EAAE,EAAE,CAAC,CACF,MAAC,QAAQ,eACL,eAAK,SAAS,EAAE,MAAM,CAAC,kBAAkB,aACpC,aAAa,CAAC,CAAC,CAAC,CACb,YAAG,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,YACnD,KAAC,aAAa,KAAG,GACjB,CACP,CAAC,CAAC,CAAC,CACA,MAAC,QAAQ,eACJ,IAAI,IAAI,CACL,KAAC,IAAI,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AAM,CAAC,uBAAuB,CAAC,EAAE,CAAC,eAAe;iBACrD,CAAC,YAEF,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAO,GAC9C,IACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-sidebar-links.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar-links.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"layout-sidebar-links.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar-links.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAgB1F,gCAAgC;AAChC,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,2BAA2B,2CAqBxF;AAED,mCAAmC;AACnC,wBAAgB,yBAAyB,CAAC,EACtC,OAAO,EACP,aAAa,EACb,OAAO,EACP,GAAG,KAAK,EACX,EAAE,8BAA8B,2CAuBhC"}
|
|
@@ -2,20 +2,27 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getCounterTag } from '../../utils/side-nav';
|
|
3
3
|
import { useTitanLayoutContext } from './layout-context';
|
|
4
4
|
import { InternalSideNavigationLink, InternalSideNavigationTrigger, } from './layout-sidebar-links-internal';
|
|
5
|
+
import { useNotificationsContext } from './notifications-context';
|
|
5
6
|
const WrappedLink = ({ children, wrapper: WrapperComponent }) => {
|
|
6
7
|
const { sidebar } = useTitanLayoutContext();
|
|
7
8
|
return _jsx(WrapperComponent, { context: sidebar, children: children });
|
|
8
9
|
};
|
|
9
10
|
/** Side Navigation menu link */
|
|
10
11
|
export function TitanLayoutSidebarLink({ wrapper, ...props }) {
|
|
11
|
-
const { NavigationComponent } = useTitanLayoutContext();
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const { NavigationComponent, breakpoint: { isMobile }, } = useTitanLayoutContext();
|
|
13
|
+
const { onNotificationsUpdate } = useNotificationsContext();
|
|
14
|
+
const tag = getCounterTag(props.counter, props.tag);
|
|
15
|
+
onNotificationsUpdate(props.id, !!tag);
|
|
16
|
+
const element = (_jsx(InternalSideNavigationLink, { ...props, navigationComponent: NavigationComponent, submenuExpanded: undefined, dataPrefix: "navigation-link", tag: tag }));
|
|
17
|
+
return wrapper && !isMobile ? _jsx(WrappedLink, { wrapper: wrapper, children: element }) : element;
|
|
14
18
|
}
|
|
15
19
|
/** Side Navigation menu trigger */
|
|
16
20
|
export function TitanLayoutSidebarTrigger({ wrapper, onMobileClick, onClick, ...props }) {
|
|
17
21
|
const { breakpoint: { isMobile }, } = useTitanLayoutContext();
|
|
18
|
-
const
|
|
19
|
-
|
|
22
|
+
const { onNotificationsUpdate } = useNotificationsContext();
|
|
23
|
+
const tag = getCounterTag(props.counter, props.tag);
|
|
24
|
+
onNotificationsUpdate(props.id, !!tag);
|
|
25
|
+
const element = (_jsx(InternalSideNavigationTrigger, { ...props, submenuExpanded: undefined, dataPrefix: "navigation-trigger", tag: tag, onClick: isMobile && !!onMobileClick ? onMobileClick : onClick }));
|
|
26
|
+
return wrapper && (!isMobile || !onMobileClick) ? (_jsx(WrappedLink, { wrapper: wrapper, children: element })) : (element);
|
|
20
27
|
}
|
|
21
28
|
//# sourceMappingURL=layout-sidebar-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-sidebar-links.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar-links.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACH,0BAA0B,EAC1B,6BAA6B,GAChC,MAAM,iCAAiC,CAAC;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O,EAAE,OAAO,YAAG,OAAO,GAAe,CAAC,CAAC,CAAC,OAAO,CAAC;AACnG,CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,yBAAyB,CAAC,EACtC,OAAO,EACP,aAAa,EACb,OAAO,EACP,GAAG,KAAK,EACqB;IAC7B,MAAM,EACF,UAAU,EAAE,EAAE,QAAQ,EAAE,GAC3B,GAAG,qBAAqB,EAAE,CAAC;IAC5B,MAAM,EAAE,qBAAqB,EAAE,GAAG,uBAAuB,EAAE,CAAC;IAC5D,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAEpD,qBAAqB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAEvC,MAAM,OAAO,GAAG,CACZ,KAAC,6BAA6B,OACtB,KAAK,EACT,eAAe,EAAE,SAAS,EAC1B,UAAU,EAAC,oBAAoB,EAC/B,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,QAAQ,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,GAChE,CACL,CAAC;IACF,OAAO,OAAO,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAC9C,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,YAAG,OAAO,GAAe,CACzD,CAAC,CAAC,CAAC,CACA,OAAO,CACV,CAAC;AACN,CAAC"}
|
|
@@ -8,9 +8,11 @@ export interface LayoutSidebarProps {
|
|
|
8
8
|
mainItems?: NavigationItemData[];
|
|
9
9
|
barExpanded: boolean;
|
|
10
10
|
submenuExpanded: string | undefined;
|
|
11
|
+
drawerOpened: boolean;
|
|
11
12
|
mobile: boolean;
|
|
12
13
|
navigationComponent: FC<NavLinkComponentProps>;
|
|
13
14
|
onBarExpandChange(expanded: boolean): void;
|
|
15
|
+
onDrawerOpenChange(expanded: boolean): void;
|
|
14
16
|
onSubmenuExpandChange(id: string, expanded: boolean): void;
|
|
15
17
|
}
|
|
16
18
|
export declare const LayoutSidebar: FC<LayoutSidebarProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEH,EAAE,EAGF,YAAY,EAGf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAyB,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAavE,MAAM,WAAW,kBAAkB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACjC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC/C,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9D;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"layout-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEH,EAAE,EAGF,YAAY,EAGf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAyB,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAavE,MAAM,WAAW,kBAAkB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACjC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC/C,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9D;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA4FhD,CAAC"}
|
|
@@ -10,11 +10,13 @@ import { LayoutPlacementContext, useTitanLayoutContext } from './layout-context'
|
|
|
10
10
|
import { InternalSideNavigationGroup, InternalSideNavigationGroupLink, InternalSideNavigationLink, } from './layout-sidebar-links-internal';
|
|
11
11
|
import * as Styles from './layout-sidebar.module.less';
|
|
12
12
|
import { withTooltip } from './with-tooltip';
|
|
13
|
-
export const LayoutSidebar = ({ className, mobile, barExpanded, submenuExpanded, onBarExpandChange, onSubmenuExpandChange, mainItems, top, bottom, navigationComponent, }) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
13
|
+
export const LayoutSidebar = ({ className, mobile, barExpanded, submenuExpanded, drawerOpened, onBarExpandChange, onSubmenuExpandChange, onDrawerOpenChange, mainItems, top, bottom, navigationComponent, }) => {
|
|
14
|
+
const closeDrawer = () => {
|
|
15
|
+
if (mobile) {
|
|
16
|
+
onDrawerOpenChange === null || onDrawerOpenChange === void 0 ? void 0 : onDrawerOpenChange(false);
|
|
17
|
+
}
|
|
16
18
|
};
|
|
17
|
-
return (
|
|
19
|
+
return (_jsxs(LayoutPlacementContext.Provider, { value: "side", children: [mobile && drawerOpened && (_jsx("div", { className: Styles.navDrawerBackdrop, onClick: closeDrawer })), _jsxs("div", { className: classNames(Styles.nav, mobile && Styles.navDrawer, mobile && drawerOpened && Styles.navDrawerOpened, !mobile && (barExpanded ? Styles.navWide : Styles.navSlim), className), "data-cy": "side-navigation", onClick: closeDrawer, children: [_jsxs(ThemeProvider, { mode: "dark", className: Styles.navMain, children: [mobile && (_jsx("div", { className: Styles.navCloseWrapper, children: _jsx("div", { className: Styles.navClose, onClick: () => onBarExpandChange(false), children: _jsx(Icon, { svg: SvgClose, size: "large" }) }) })), !!(top === null || top === void 0 ? void 0 : top.length) && _jsx(SidebarTop, { children: top }), _jsx("div", { "data-cy": "navigation-items", children: mainItems === null || mainItems === void 0 ? void 0 : mainItems.map(item => item.submenu ? (_jsx(SideNavigationGroupItem, { barExpanded: mobile ? drawerOpened : barExpanded, submenuExpanded: !!item.id && submenuExpanded === item.id, onSubmenuExpand: onSubmenuExpandChange, navigationComponent: navigationComponent, ...item }, item.id)) : (_jsx(InternalSideNavigationLink, { submenuExpanded: undefined, navigationComponent: navigationComponent, ...item, tag: getSubmenuGroupTag(item.submenu, getCounterTag(item.counter, item.tag)) }, item.id))) }), !!bottom && _jsx(SidebarBottom, { children: bottom })] }), !mobile && (_jsxs("div", { className: Styles.navFooter, children: [_jsx("div", { className: Styles.divider }), _jsx("div", { className: Styles.toggleWrapper, children: _jsx(SideNavigationOptionsToggle, { appearance: barExpanded ? 'collapse-button' : 'expand', onExpandedChange: () => onBarExpandChange(!barExpanded) }) })] }))] })] }));
|
|
18
20
|
};
|
|
19
21
|
LayoutSidebar.displayName = 'LayoutSidebar';
|
|
20
22
|
/** Side Navigation options toggle */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-sidebar.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,QAAQ,MAAM,4DAA4D,CAAC;AAClF,OAAO,WAAW,MAAM,6DAA6D,CAAC;AACtF,OAAO,SAAS,MAAM,2DAA2D,CAAC;AAClF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACH,QAAQ,EAER,QAAQ,EAGR,cAAc,EACd,WAAW,GACd,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACH,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,GAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"layout-sidebar.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,QAAQ,MAAM,4DAA4D,CAAC;AAClF,OAAO,WAAW,MAAM,6DAA6D,CAAC;AACtF,OAAO,SAAS,MAAM,2DAA2D,CAAC;AAClF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACH,QAAQ,EAER,QAAQ,EAGR,cAAc,EACd,WAAW,GACd,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACH,2BAA2B,EAC3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N,CAAC,CAAC;AAEF,SAAS,UAAU,CAAC,EAAE,QAAQ,EAAO;IACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE;QACxC,OAAO,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAC,CAAC,CAAC,CAClB,MAAC,aAAa,IAAC,IAAI,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,MAAM,aAAU,sBAAsB,aAC9E,IAAI,EACL,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,IACtB,CACnB,CAAC,CAAC,CAAC,IAAI,CAAC;AACb,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,QAAQ,EAAO;IACpC,OAAO,CACH,MAAC,aAAa,IAAC,IAAI,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,SAAS,aAAU,yBAAyB,aACrF,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,EACjC,QAAQ,IACG,CACnB,CAAC;AACN,CAAC"}
|
|
@@ -17,15 +17,20 @@
|
|
|
17
17
|
|
|
18
18
|
// mobile version
|
|
19
19
|
.nav-drawer {
|
|
20
|
-
display: none;
|
|
20
|
+
// display: none;
|
|
21
21
|
position: fixed;
|
|
22
22
|
max-width: 400px;
|
|
23
23
|
width: 0;
|
|
24
|
+
height: 100vh;
|
|
24
25
|
top: 0;
|
|
25
|
-
|
|
26
|
-
left: 0;
|
|
26
|
+
left: -100vh;
|
|
27
27
|
z-index: 991;
|
|
28
28
|
|
|
29
|
+
-webkit-transition: width 200ms ease-in-out;
|
|
30
|
+
-moz-transition: width 200ms ease-in-out;
|
|
31
|
+
-o-transition: width 200ms ease-in-out;
|
|
32
|
+
transition: width 200ms ease-in-out;
|
|
33
|
+
|
|
29
34
|
.nav-main {
|
|
30
35
|
padding-left: @spacing-2;
|
|
31
36
|
padding-right: @spacing-2;
|
|
@@ -39,6 +44,7 @@
|
|
|
39
44
|
padding-top: @spacing-2;
|
|
40
45
|
padding-left: @spacing-2;
|
|
41
46
|
padding-right: @spacing-2;
|
|
47
|
+
cursor: pointer;
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
|
|
@@ -61,10 +67,21 @@
|
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
|
|
70
|
+
.nav-drawer-backdrop {
|
|
71
|
+
position: fixed;
|
|
72
|
+
height: 100vh;
|
|
73
|
+
width: 100vw;
|
|
74
|
+
top: 0;
|
|
75
|
+
left: 0;
|
|
76
|
+
z-index: 991;
|
|
77
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
78
|
+
}
|
|
79
|
+
|
|
64
80
|
// mobile version opened
|
|
65
81
|
.nav-drawer-opened {
|
|
66
82
|
display: flex;
|
|
67
83
|
width: 90vw;
|
|
84
|
+
left: 0;
|
|
68
85
|
}
|
|
69
86
|
|
|
70
87
|
@media only screen and (min-width: 361px) {
|
|
@@ -141,7 +158,11 @@
|
|
|
141
158
|
// desktop version expanded
|
|
142
159
|
.nav-wide {
|
|
143
160
|
width: var(--nav-offset-left);
|
|
144
|
-
|
|
161
|
+
|
|
162
|
+
.nav-item {
|
|
163
|
+
margin-left: @spacing-1;
|
|
164
|
+
margin-right: @spacing-1;
|
|
165
|
+
}
|
|
145
166
|
|
|
146
167
|
.toggle {
|
|
147
168
|
.toggle-content {
|
|
@@ -162,14 +183,16 @@
|
|
|
162
183
|
margin-top: @spacing-1;
|
|
163
184
|
margin-bottom: @spacing-1;
|
|
164
185
|
}
|
|
186
|
+
|
|
187
|
+
.nav-main {
|
|
188
|
+
padding-top: @spacing-1;
|
|
189
|
+
}
|
|
165
190
|
}
|
|
166
191
|
|
|
167
192
|
.nav-drawer,
|
|
168
193
|
.nav-wide {
|
|
169
194
|
.nav-item {
|
|
170
195
|
flex-direction: row;
|
|
171
|
-
margin-left: @spacing-1;
|
|
172
|
-
margin-right: @spacing-1;
|
|
173
196
|
|
|
174
197
|
.nav-item-icon-wrapper {
|
|
175
198
|
flex: 1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface NotificationsContextType {
|
|
3
|
+
onNotificationsUpdate: (id: string, hasNotifications: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const useNotificationsContext: () => NotificationsContextType;
|
|
6
|
+
export declare const useNotificationsState: () => {
|
|
7
|
+
NotificationsContextProvider: FC<{
|
|
8
|
+
children?: import("react").ReactNode | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
hasNotifications: boolean;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=notifications-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-context.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/notifications-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,EAAE,EAOL,MAAM,OAAO,CAAC;AAEf,UAAU,wBAAwB;IAC9B,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1E;AAMD,eAAO,MAAM,uBAAuB,gCAAyC,CAAC;AAE9E,eAAO,MAAM,qBAAqB;;;;;CAuBjC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useRef, useState, } from 'react';
|
|
3
|
+
const NotificationsContext = createContext({
|
|
4
|
+
onNotificationsUpdate: () => { },
|
|
5
|
+
});
|
|
6
|
+
export const useNotificationsContext = () => useContext(NotificationsContext);
|
|
7
|
+
export const useNotificationsState = () => {
|
|
8
|
+
const [hasNotifications, setHasNotifications] = useState(false);
|
|
9
|
+
const items = useRef(new Set());
|
|
10
|
+
const onNotificationsUpdate = useCallback((id, hasNotifications) => {
|
|
11
|
+
if (hasNotifications && !items.current.has(id)) {
|
|
12
|
+
items.current.add(id);
|
|
13
|
+
setHasNotifications(!!items.current.size);
|
|
14
|
+
}
|
|
15
|
+
else if (!hasNotifications && items.current.has(id)) {
|
|
16
|
+
items.current.delete(id);
|
|
17
|
+
setHasNotifications(!!items.current.size);
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
const NotificationsContextProvider = useCallback(({ children }) => (_jsx(NotificationsContext.Provider, { value: { onNotificationsUpdate }, children: children })), [onNotificationsUpdate]);
|
|
21
|
+
return { NotificationsContextProvider, hasNotifications };
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=notifications-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-context.js","sourceRoot":"","sources":["../../../src/components/titan-layout/notifications-context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGH,aAAa,EACb,WAAW,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GACX,MAAM,OAAO,CAAC;AAMf,MAAM,oBAAoB,GAAG,aAAa,CAA2B;IACjE,qBAAqB,EAAE,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACtC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,GAAG,EAAU,CAAC,CAAC;IACxC,MAAM,qBAAqB,GAAG,WAAW,CAAC,CAAC,EAAU,EAAE,gBAAyB,EAAE,EAAE;QAChF,IAAI,gBAAgB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC7C,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACtB,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;aAAM,IAAI,CAAC,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YACpD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACzB,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,4BAA4B,GAA0B,WAAW,CACnE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACd,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,qBAAqB,EAAE,YAC1D,QAAQ,GACmB,CACnC,EACD,CAAC,qBAAqB,CAAC,CAC1B,CAAC;IAEF,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,CAAC;AAC9D,CAAC,CAAC"}
|
|
@@ -6,22 +6,26 @@ import { TitanLayoutLogoProps } from './layout-logo';
|
|
|
6
6
|
import { TitanLayoutSidebarLink, TitanLayoutSidebarTrigger } from './layout-sidebar-links';
|
|
7
7
|
type TitanLayoutChild = ReactElement<TitanLayoutContentProps> | ReactElement<TitanLayoutLogoProps>;
|
|
8
8
|
export type TitanLayoutProps = Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'style'> & {
|
|
9
|
-
|
|
9
|
+
/** layout appearance */
|
|
10
10
|
appearance?: 'legacy' | 'anvil1' | 'anvil2';
|
|
11
|
+
/** layout's content */
|
|
12
|
+
children?: TitanLayoutChild | TitanLayoutChild[];
|
|
13
|
+
/** show only content without side and top bars */
|
|
14
|
+
contentOnly?: boolean;
|
|
11
15
|
/** component used for navigation */
|
|
12
16
|
navigationComponent?: FC<NavLinkComponentProps>;
|
|
13
17
|
/** data for main navigation links */
|
|
14
18
|
navigationMainItems?: NavigationItemData[];
|
|
15
|
-
/** layout's content */
|
|
16
|
-
children?: TitanLayoutChild | TitanLayoutChild[];
|
|
17
19
|
state?: TitanLayoutState;
|
|
18
20
|
onStateChange?: (state: TitanLayoutState) => void;
|
|
19
21
|
header?: ReactElement;
|
|
22
|
+
top?: ReactElement;
|
|
23
|
+
sideTop?: ReactElement[];
|
|
20
24
|
profile?: ReactElement;
|
|
21
25
|
extraLinks?: ReactElement;
|
|
22
26
|
extraLinksTop?: ReactElement;
|
|
23
27
|
extraText?: string;
|
|
24
|
-
|
|
28
|
+
minContentWidth?: number;
|
|
25
29
|
};
|
|
26
30
|
export interface TitanLayoutContentProps {
|
|
27
31
|
children: ReactNode;
|
|
@@ -29,8 +33,8 @@ export interface TitanLayoutContentProps {
|
|
|
29
33
|
export declare const TitanLayout: FC<TitanLayoutProps> & {
|
|
30
34
|
Content: FC<TitanLayoutContentProps>;
|
|
31
35
|
Logo: FC<TitanLayoutLogoProps>;
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
Link: typeof TitanLayoutSidebarLink;
|
|
37
|
+
Trigger: typeof TitanLayoutSidebarTrigger;
|
|
34
38
|
};
|
|
35
39
|
export {};
|
|
36
40
|
//# sourceMappingURL=titan-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"titan-layout.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.tsx"],"names":[],"mappings":"AACA,OAAO,EAGH,wBAAwB,EACxB,EAAE,EAEF,YAAY,EACZ,SAAS,
|
|
1
|
+
{"version":3,"file":"titan-layout.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.tsx"],"names":[],"mappings":"AACA,OAAO,EAGH,wBAAwB,EACxB,EAAE,EAEF,YAAY,EACZ,SAAS,EAOZ,MAAM,OAAO,CAAC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CAC5B,CAAC;AA0TF,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,SAAS,CAAC;CACvB;AA4ED,eAAO,MAAM,WAAW;;;;;CAKtB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useState, } from 'react';
|
|
3
|
+
import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
4
|
import { DefaultNavLinkComponent } from '../../utils/navigation-context';
|
|
5
5
|
import { useTitanBreakpoint } from '../../utils/use-breakpoint';
|
|
6
6
|
import { LayoutContext, LayoutPlacementContext, } from './layout-context';
|
|
@@ -9,6 +9,7 @@ import { TitanLayoutLogo } from './layout-logo';
|
|
|
9
9
|
import { LayoutSidebar } from './layout-sidebar';
|
|
10
10
|
import { TitanLayoutSidebarLink, TitanLayoutSidebarTrigger } from './layout-sidebar-links';
|
|
11
11
|
import { InternalSideNavigationTrigger } from './layout-sidebar-links-internal';
|
|
12
|
+
import { useNotificationsState } from './notifications-context';
|
|
12
13
|
import * as Styles from './titan-layout.module.less';
|
|
13
14
|
const defaultSidebarContext = {
|
|
14
15
|
styles: {
|
|
@@ -45,9 +46,8 @@ const useLayoutChildren = (children) => useMemo(() => Children.toArray(children)
|
|
|
45
46
|
}, {
|
|
46
47
|
logo: _jsx(TitanLayoutLogo, {}),
|
|
47
48
|
}), [children]);
|
|
48
|
-
const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationComponent, header, profile, state, onStateChange, navigationMainItems, extraLinks, extraLinksTop, extraText,
|
|
49
|
+
const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, contentOnly, navigationComponent, header, top, profile, state, onStateChange, navigationMainItems, extraLinks, extraLinksTop, extraText, minContentWidth, sideTop, }) => {
|
|
49
50
|
const breakpoint = useTitanBreakpoint();
|
|
50
|
-
const isMobile = breakpoint.isMobile;
|
|
51
51
|
const context = useMemo(() => ({
|
|
52
52
|
NavigationComponent: navigationComponent !== null && navigationComponent !== void 0 ? navigationComponent : DefaultNavLinkComponent,
|
|
53
53
|
breakpoint,
|
|
@@ -57,17 +57,21 @@ const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationC
|
|
|
57
57
|
const variant = useVariant(appearance);
|
|
58
58
|
const [mobileDrawerOpened, setMobileDrawerOpened] = useState(false);
|
|
59
59
|
const { content, logo } = useLayoutChildren(children);
|
|
60
|
+
const { hasNotifications, NotificationsContextProvider } = useNotificationsState();
|
|
61
|
+
const [anvil2Styles, setAnvil2Styles] = useState({});
|
|
62
|
+
const updateIndicatorsHeight = useCallback((offset) => {
|
|
63
|
+
setAnvil2Styles({ '--offset': `calc(var(--nav-offset-top) + ${offset}px)` });
|
|
64
|
+
}, []);
|
|
65
|
+
const isMobile = breakpoint.isMobile;
|
|
66
|
+
const hasSideBar = !contentOnly && (!!(navigationMainItems === null || navigationMainItems === void 0 ? void 0 : navigationMainItems.length) || !!(sideTop === null || sideTop === void 0 ? void 0 : sideTop.length));
|
|
67
|
+
const hasTopBar = !contentOnly;
|
|
60
68
|
useEffect(() => {
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
if (variant.isAnvil1) {
|
|
70
|
+
const bodyClassName = 'of-hidden-i';
|
|
71
|
+
document.body.classList.add(bodyClassName);
|
|
72
|
+
return () => document.body.classList.remove(bodyClassName);
|
|
64
73
|
}
|
|
65
|
-
|
|
66
|
-
setMobileDrawerOpened(false);
|
|
67
|
-
};
|
|
68
|
-
document.addEventListener('click', listener);
|
|
69
|
-
return () => document.removeEventListener('click', listener);
|
|
70
|
-
}, [isMobile]);
|
|
74
|
+
}, [variant.isAnvil1]);
|
|
71
75
|
const onBurgerClick = useCallback((e) => {
|
|
72
76
|
setMobileDrawerOpened(true);
|
|
73
77
|
e.stopPropagation();
|
|
@@ -87,23 +91,102 @@ const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationC
|
|
|
87
91
|
submenuExpanded: expanded ? id : undefined,
|
|
88
92
|
});
|
|
89
93
|
}, [state, onStateChange]);
|
|
90
|
-
const
|
|
94
|
+
const hasMenuNotifications = useMemo(() => {
|
|
95
|
+
var _a;
|
|
96
|
+
try {
|
|
97
|
+
return ((_a = navigationMainItems === null || navigationMainItems === void 0 ? void 0 : navigationMainItems.some(item => {
|
|
98
|
+
var _a;
|
|
99
|
+
if (item.counter || ((_a = item.tag) === null || _a === void 0 ? void 0 : _a.value)) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
else if (item.submenu) {
|
|
103
|
+
return item.submenu.groups.some(group => group.links.some(link => { var _a; return !!link.counter || !!((_a = link.tag) === null || _a === void 0 ? void 0 : _a.value); }));
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
})) !== null && _a !== void 0 ? _a : false);
|
|
107
|
+
}
|
|
108
|
+
catch (_b) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}, [navigationMainItems]);
|
|
112
|
+
const limitContentWidth = useMemo(() => {
|
|
113
|
+
if (variant.isAnvil2 || !minContentWidth) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
if (breakpoint.width < minContentWidth) {
|
|
117
|
+
return minContentWidth;
|
|
118
|
+
}
|
|
119
|
+
}, [variant, minContentWidth, breakpoint.width]);
|
|
120
|
+
const contentStyles = useMemo(() => {
|
|
121
|
+
if (variant.isAnvil2) {
|
|
122
|
+
return anvil2Styles;
|
|
123
|
+
}
|
|
124
|
+
if (variant.isLegacy && limitContentWidth) {
|
|
125
|
+
return {
|
|
126
|
+
display: 'flex',
|
|
127
|
+
flexDirection: 'column',
|
|
128
|
+
minHeight: '100vh',
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}, [variant, anvil2Styles, limitContentWidth]);
|
|
91
132
|
const layoutClass = variant.isLegacy
|
|
92
133
|
? Styles.layoutLegacy
|
|
93
134
|
: variant.isAnvil1
|
|
94
135
|
? Styles.layoutAnvil1
|
|
95
136
|
: Styles.layoutAnvil2;
|
|
96
|
-
return (_jsx(LayoutContext.Provider, { value: context, children: _jsx(LayoutPlacementContext.Provider, { value: "unset", children: _jsxs("div", { id: id, className: classNames(Styles.layout, isMobile
|
|
97
|
-
|
|
98
|
-
: (state === null || state === void 0 ? void 0 : state.navCollapsed)
|
|
99
|
-
|
|
100
|
-
|
|
137
|
+
return (_jsx(LayoutContext.Provider, { value: context, children: _jsx(LayoutPlacementContext.Provider, { value: "unset", children: _jsxs("div", { id: id, className: classNames(Styles.layout, isMobile ? Styles.layoutMobile : Styles.layoutDesktop, {
|
|
138
|
+
[Styles.layoutTop]: hasTopBar,
|
|
139
|
+
[Styles.layoutNavSlim]: !isMobile && hasSideBar && (state === null || state === void 0 ? void 0 : state.navCollapsed),
|
|
140
|
+
[Styles.layoutNavWide]: !isMobile && hasSideBar && !(state === null || state === void 0 ? void 0 : state.navCollapsed),
|
|
141
|
+
}, layoutClass), style: contentStyles, children: [variant.isSequent && _jsx("div", { className: Styles.topPlaceholder }), hasTopBar && (_jsx(LayoutHeader, { className: Styles.top, logo: logo, profile: isMobile ? undefined : profile, center: top, rightText: isMobile ? undefined : extraText, right: _jsxs(Fragment, { children: [extraLinksTop, !isMobile && extraLinks] }), isMobile: isMobile, hasNotifications: hasNotifications || hasMenuNotifications, onBurgerClick: onBurgerClick })), hasSideBar && (_jsx(NotificationsContextProvider, { children: _jsx(LayoutSidebar, { className: Styles.side, mobile: breakpoint.isMobile, barExpanded: !(state === null || state === void 0 ? void 0 : state.navCollapsed), onBarExpandChange: onBarExpandChange, submenuExpanded: state === null || state === void 0 ? void 0 : state.submenuExpanded, onSubmenuExpandChange: onSubmenuExpandChange, drawerOpened: mobileDrawerOpened, onDrawerOpenChange: setMobileDrawerOpened, top: sideTop, mainItems: navigationMainItems, navigationComponent: context.NavigationComponent, bottom: isMobile ? (_jsxs(Fragment, { children: [profile, extraLinks, !!extraText && (_jsx(InternalSideNavigationTrigger, { id: "__extra_text", title: extraText, submenuExpanded: undefined, dataPrefix: "navigation-extra-text", tag: undefined, icon: undefined, iconActive: undefined }))] })) : undefined }) })), variant.isAnvil1 ? (_jsx(LayoutContentAnvil1, { header: header, minWidth: limitContentWidth, children: content })) : variant.isLegacy ? (_jsx(LayoutContentLegacy, { header: header, minWidth: limitContentWidth, children: content })) : (_jsx(LayoutContentAnvil2, { header: header, onHeaderHeightChange: updateIndicatorsHeight, children: content }))] }) }) }));
|
|
142
|
+
};
|
|
143
|
+
const TitanLayoutHeaderObserved = ({ children, heightChange }) => {
|
|
144
|
+
const ref = useRef(null);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (ref.current) {
|
|
147
|
+
const updatePosition = () => {
|
|
148
|
+
if (ref.current && heightChange) {
|
|
149
|
+
const pos = ref.current.getBoundingClientRect();
|
|
150
|
+
heightChange(pos.height);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const observer = new ResizeObserver(updatePosition);
|
|
154
|
+
observer.observe(ref.current);
|
|
155
|
+
updatePosition();
|
|
156
|
+
return () => observer.disconnect();
|
|
157
|
+
}
|
|
158
|
+
}, [heightChange]);
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
return () => {
|
|
161
|
+
heightChange === null || heightChange === void 0 ? void 0 : heightChange(0);
|
|
162
|
+
};
|
|
163
|
+
}, [heightChange]);
|
|
164
|
+
return (_jsx("div", { ref: ref, className: Styles.contentHeader, "data-cy": "layout-content-header", children: children }));
|
|
165
|
+
};
|
|
166
|
+
const TitanLayoutHeader = ({ children }) => {
|
|
167
|
+
return (_jsx("div", { className: Styles.contentHeader, "data-cy": "layout-content-header", children: children }));
|
|
168
|
+
};
|
|
169
|
+
const TitanLayoutContent = ({ children }) => children;
|
|
170
|
+
const LayoutContentAnvil2 = ({ children, header, onHeaderHeightChange }) => {
|
|
171
|
+
return (_jsxs(Fragment, { children: [_jsx(TitanLayoutHeaderObserved, { heightChange: onHeaderHeightChange, children: header }), children] }));
|
|
172
|
+
};
|
|
173
|
+
const LayoutContentAnvil1 = ({ children, header, minWidth }) => {
|
|
174
|
+
const innerContentStyles = useMemo(() => ({
|
|
175
|
+
...(minWidth ? { minWidth: `${minWidth}px` } : {}),
|
|
176
|
+
}), [minWidth]);
|
|
177
|
+
return (_jsxs(Fragment, { children: [_jsx(TitanLayoutHeader, { children: header }), _jsx("div", { className: classNames(Styles.content, { 'of-x-auto': !!minWidth }), "data-cy": "layout-content", children: _jsx("div", { className: "position-relative d-f flex-grow-1 flex-basis-0 of-hidden", style: innerContentStyles, children: children }) })] }));
|
|
178
|
+
};
|
|
179
|
+
const LayoutContentLegacy = ({ children, header, minWidth }) => {
|
|
180
|
+
const innerContentStyles = useMemo(() => ({
|
|
181
|
+
position: 'relative',
|
|
182
|
+
minWidth: `${minWidth}px`,
|
|
183
|
+
}), [minWidth]);
|
|
184
|
+
return (_jsxs(Fragment, { children: [_jsx(TitanLayoutHeader, { children: header }), minWidth ? (_jsx("div", { className: "of-x-auto flex-basis-0 flex-grow-1", children: _jsx("div", { style: innerContentStyles, children: children }) })) : (children)] }));
|
|
101
185
|
};
|
|
102
|
-
const TitanLayoutContent = ({ children }) => (_jsx("div", { className: Styles.content, children: children }));
|
|
103
186
|
export const TitanLayout = Object.assign(TitanLayoutComponent, {
|
|
104
187
|
Content: TitanLayoutContent,
|
|
105
188
|
Logo: TitanLayoutLogo,
|
|
106
|
-
|
|
107
|
-
|
|
189
|
+
Link: TitanLayoutSidebarLink,
|
|
190
|
+
Trigger: TitanLayoutSidebarTrigger,
|
|
108
191
|
});
|
|
109
192
|
//# sourceMappingURL=titan-layout.js.map
|