@ganpatiinfo/gids-web-dom-reference 4.0.0 → 6.0.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/CHANGELOG.md +57 -0
- package/dist/components/GidsHeading/GidsHeading.d.ts +2 -2
- package/dist/components/GidsHeading/GidsHeading.d.ts.map +1 -1
- package/dist/components/GidsHeading/GidsHeading.js +6 -7
- package/dist/components/GidsHeading/GidsHeading.js.map +1 -1
- package/dist/components/GidsLogo/GidsLogo.d.ts +1 -1
- package/dist/components/GidsLogo/GidsLogo.d.ts.map +1 -1
- package/dist/components/GidsLogo/GidsLogo.js +5 -2
- package/dist/components/GidsLogo/GidsLogo.js.map +1 -1
- package/dist/components/GidsScrim/GidsScrim.d.ts +7 -0
- package/dist/components/GidsScrim/GidsScrim.d.ts.map +1 -0
- package/dist/components/GidsScrim/GidsScrim.js +12 -0
- package/dist/components/GidsScrim/GidsScrim.js.map +1 -0
- package/dist/components/GidsSegmentedControl/GidsSegmentedControl.d.ts +3 -3
- package/dist/components/GidsSegmentedControl/GidsSegmentedControl.d.ts.map +1 -1
- package/dist/components/GidsSegmentedControl/GidsSegmentedControl.js +2 -2
- package/dist/components/GidsSegmentedControl/GidsSegmentedControl.js.map +1 -1
- package/dist/components/GidsSegmentedTabItem/GidsSegmentedTabItem.d.ts +3 -3
- package/dist/components/GidsSegmentedTabItem/GidsSegmentedTabItem.d.ts.map +1 -1
- package/dist/components/GidsSegmentedTabItem/GidsSegmentedTabItem.js +24 -2
- package/dist/components/GidsSegmentedTabItem/GidsSegmentedTabItem.js.map +1 -1
- package/dist/components/GidsSideMenu/GidsSideMenu.d.ts +7 -0
- package/dist/components/GidsSideMenu/GidsSideMenu.d.ts.map +1 -0
- package/dist/components/GidsSideMenu/GidsSideMenu.js +13 -0
- package/dist/components/GidsSideMenu/GidsSideMenu.js.map +1 -0
- package/dist/components/GidsSideMenuHeader/GidsSideMenuHeader.d.ts +9 -0
- package/dist/components/GidsSideMenuHeader/GidsSideMenuHeader.d.ts.map +1 -0
- package/dist/components/GidsSideMenuHeader/GidsSideMenuHeader.js +29 -0
- package/dist/components/GidsSideMenuHeader/GidsSideMenuHeader.js.map +1 -0
- package/dist/components/GidsSideMenuItem/GidsSideMenuItem.d.ts +8 -0
- package/dist/components/GidsSideMenuItem/GidsSideMenuItem.d.ts.map +1 -0
- package/dist/components/GidsSideMenuItem/GidsSideMenuItem.js +62 -0
- package/dist/components/GidsSideMenuItem/GidsSideMenuItem.js.map +1 -0
- package/dist/components/GidsSideNavigation/GidsSideNavigation.d.ts +9 -0
- package/dist/components/GidsSideNavigation/GidsSideNavigation.d.ts.map +1 -0
- package/dist/components/GidsSideNavigation/GidsSideNavigation.js +36 -0
- package/dist/components/GidsSideNavigation/GidsSideNavigation.js.map +1 -0
- package/dist/components/GidsTopNavigation/GidsTopNavigation.d.ts +1 -1
- package/dist/components/GidsTopNavigation/GidsTopNavigation.d.ts.map +1 -1
- package/dist/components/GidsTopNavigation/GidsTopNavigation.js +17 -5
- package/dist/components/GidsTopNavigation/GidsTopNavigation.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/GidsHeading/GidsHeading.ts +13 -6
- package/src/components/GidsLogo/GidsLogo.ts +6 -0
- package/src/components/GidsScrim/GidsScrim.ts +25 -0
- package/src/components/GidsSegmentedControl/GidsSegmentedControl.ts +5 -3
- package/src/components/GidsSegmentedTabItem/GidsSegmentedTabItem.ts +37 -3
- package/src/components/GidsSideMenu/GidsSideMenu.ts +31 -0
- package/src/components/GidsSideMenuHeader/GidsSideMenuHeader.ts +71 -0
- package/src/components/GidsSideMenuItem/GidsSideMenuItem.ts +108 -0
- package/src/components/GidsSideNavigation/GidsSideNavigation.ts +97 -0
- package/src/components/GidsTopNavigation/GidsTopNavigation.ts +28 -5
- package/src/index.ts +5 -0
|
@@ -3,11 +3,14 @@ import { appendAsChildren, } from '../../utils/domUtils.js';
|
|
|
3
3
|
import { GidsSearchBarDom, } from '../GidsSearchBar/GidsSearchBar.js';
|
|
4
4
|
import { GidsSegmentedControlDom, } from '../GidsSegmentedControl/GidsSegmentedControl.js';
|
|
5
5
|
import { GidsLogoDom } from '../GidsLogo/GidsLogo.js';
|
|
6
|
+
import { GidsDividerDom } from '../GidsDivider/GidsDivider.js';
|
|
6
7
|
const { getGidsTopNavigationClassNames } = GidsTopNavigationWebUtils;
|
|
7
8
|
export const GidsTopNavigationDom = (props) => {
|
|
8
|
-
const { isDefaultLeftContentRender = true, isDefaultMiddleContentRender = true, isDefaultRightContentRender = true, leftContent, middleContent, rightContent, src, imgHeight = '100', href, clickable, onPress, width, tabItems = [], extraClasses, ...rest } = props;
|
|
9
|
+
const { isDefaultLeftContentRender = true, isDefaultMiddleContentRender = true, isDefaultRightContentRender = true, leftContent, middleContent, rightContent, src, imgHeight = '100', href, clickable, onPress, width, tabItems = [], extraClasses, invertedInDarkMode, invertedInLightMode, dividerVisible = true, topNavigationAppearance = 'default', ...rest } = props;
|
|
9
10
|
const topNavigation = document.createElement('nav');
|
|
10
|
-
topNavigation.className = getGidsTopNavigationClassNames(extraClasses);
|
|
11
|
+
topNavigation.className = getGidsTopNavigationClassNames({ topNavigationAppearance }, extraClasses);
|
|
12
|
+
const topNavigationWrapper = document.createElement('div');
|
|
13
|
+
topNavigationWrapper.className = 'gids-top-navigation__wrapper';
|
|
11
14
|
const leftContentContainer = document.createElement('div');
|
|
12
15
|
leftContentContainer.className = 'gids-top-navigation__left-content';
|
|
13
16
|
if (leftContent || isDefaultLeftContentRender) {
|
|
@@ -21,9 +24,11 @@ export const GidsTopNavigationDom = (props) => {
|
|
|
21
24
|
alt: 'logo-img',
|
|
22
25
|
href: href && href !== '' ? href : '/',
|
|
23
26
|
clickable,
|
|
27
|
+
invertedInDarkMode,
|
|
28
|
+
invertedInLightMode,
|
|
24
29
|
}));
|
|
25
30
|
}
|
|
26
|
-
|
|
31
|
+
topNavigationWrapper.appendChild(leftContentContainer);
|
|
27
32
|
}
|
|
28
33
|
const middleContentContainer = document.createElement('div');
|
|
29
34
|
middleContentContainer.className = 'gids-top-navigation__middle-content';
|
|
@@ -39,7 +44,7 @@ export const GidsTopNavigationDom = (props) => {
|
|
|
39
44
|
...rest,
|
|
40
45
|
}));
|
|
41
46
|
}
|
|
42
|
-
|
|
47
|
+
topNavigationWrapper.appendChild(middleContentContainer);
|
|
43
48
|
}
|
|
44
49
|
const rightContentContainer = document.createElement('div');
|
|
45
50
|
rightContentContainer.className = 'gids-top-navigation__right-content';
|
|
@@ -54,7 +59,14 @@ export const GidsTopNavigationDom = (props) => {
|
|
|
54
59
|
onPress,
|
|
55
60
|
}));
|
|
56
61
|
}
|
|
57
|
-
|
|
62
|
+
topNavigationWrapper.appendChild(rightContentContainer);
|
|
63
|
+
}
|
|
64
|
+
topNavigation.appendChild(topNavigationWrapper);
|
|
65
|
+
if (dividerVisible) {
|
|
66
|
+
const dividerWrapper = document.createElement('div');
|
|
67
|
+
dividerWrapper.className = 'gids-top-navigation__divider-wrapper';
|
|
68
|
+
dividerWrapper.appendChild(GidsDividerDom({ orientation: 'horizontal' }));
|
|
69
|
+
topNavigation.appendChild(dividerWrapper);
|
|
58
70
|
}
|
|
59
71
|
return topNavigation;
|
|
60
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GidsTopNavigation.js","sourceRoot":"","sources":["../../../src/components/GidsTopNavigation/GidsTopNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,gBAAgB,GAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,GAEjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,uBAAuB,GAExB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"GidsTopNavigation.js","sourceRoot":"","sources":["../../../src/components/GidsTopNavigation/GidsTopNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,gBAAgB,GAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,GAEjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,uBAAuB,GAExB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,EAAE,8BAA8B,EAAE,GAAG,yBAAyB,CAAC;AAmBrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,KAAgC,EACnB,EAAE;IACf,MAAM,EACJ,0BAA0B,GAAG,IAAI,EACjC,4BAA4B,GAAG,IAAI,EACnC,2BAA2B,GAAG,IAAI,EAClC,WAAW,EACX,aAAa,EACb,YAAY,EACZ,GAAG,EACH,SAAS,GAAG,KAAK,EACjB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,KAAK,EACL,QAAQ,GAAG,EAAE,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GAAG,IAAI,EACrB,uBAAuB,GAAG,SAAS,EACnC,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpD,aAAa,CAAC,SAAS,GAAG,8BAA8B,CACtD,EAAE,uBAAuB,EAAE,EAC3B,YAAY,CACb,CAAC;IAEF,MAAM,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3D,oBAAoB,CAAC,SAAS,GAAG,8BAA8B,CAAC;IAEhE,MAAM,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,K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C,CAAC;IAEvE,IAAI,YAAY,IAAI,2BAA2B,EAAE,CAAC;QAChD,IAAI,YAAY,EAAE,CAAC;YACjB,gBAAgB,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,2BAA2B,EAAE,CAAC;YAChC,qBAAqB,CAAC,MAAM,CAC1B,uBAAuB,CAAC;gBACtB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW;gBAClC,QAAQ,EAAE,QAAQ;gBAClB,OAAO;aACR,CAAC,CACH,CAAC;QACJ,CAAC;QACD,oBAAoB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAC1D,CAAC;IAED,aAAa,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAEhD,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACrD,cAAc,CAAC,SAAS,GAAG,sCAAsC,CAAC;QAClE,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;QAC1E,aAAa,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,11 @@ export * from './components/GidsOverlayProvider/GidsOverlayProvider.js';
|
|
|
59
59
|
export * from './components/GidsSnackbar/GidsSnackbar.js';
|
|
60
60
|
export * from './components/_GidsNotificationContainer/GidsNotificationContainer.js';
|
|
61
61
|
export * from './components/GidsNotification/GidsNotification.js';
|
|
62
|
+
export * from './components/GidsSideMenuItem/GidsSideMenuItem.js';
|
|
63
|
+
export * from './components/GidsScrim/GidsScrim.js';
|
|
64
|
+
export * from './components/GidsSideMenuHeader/GidsSideMenuHeader.js';
|
|
65
|
+
export * from './components/GidsSideMenu/GidsSideMenu.js';
|
|
66
|
+
export * from './components/GidsSideNavigation/GidsSideNavigation.js';
|
|
62
67
|
/**
|
|
63
68
|
* Utilities
|
|
64
69
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AACtE,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,+CAA+C,CAAC;AAC9D,cAA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
|
export * from './components/GidsSnackbar/GidsSnackbar.js';
|
|
60
60
|
export * from './components/_GidsNotificationContainer/GidsNotificationContainer.js';
|
|
61
61
|
export * from './components/GidsNotification/GidsNotification.js';
|
|
62
|
+
export * from './components/GidsSideMenuItem/GidsSideMenuItem.js';
|
|
63
|
+
export * from './components/GidsScrim/GidsScrim.js';
|
|
64
|
+
export * from './components/GidsSideMenuHeader/GidsSideMenuHeader.js';
|
|
65
|
+
export * from './components/GidsSideMenu/GidsSideMenu.js';
|
|
66
|
+
export * from './components/GidsSideNavigation/GidsSideNavigation.js';
|
|
62
67
|
/**
|
|
63
68
|
* Utilities
|
|
64
69
|
*/
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,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AAC;AACrF,cAAc,mDAAmD,CAAC;AAClE,cAAc,mDAAmD,CAAC;AAClE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uDAAuD,CAAC;AAEtE;;GAEG;AACH,cAAc,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ganpatiinfo/gids-web-dom-reference",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "DOM for components reference implementations",
|
|
6
6
|
"homepage": "https://ganpatiinfosystem.vercel.app/",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"directory": "packages/private/web-dom-reference"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ganpatiinfo/gids-core-shared": "
|
|
28
|
-
"@ganpatiinfo/gids-web-shared": "
|
|
27
|
+
"@ganpatiinfo/gids-core-shared": "6.0.0",
|
|
28
|
+
"@ganpatiinfo/gids-web-shared": "6.0.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@ganpatiinfo/gids-web-theme-interface": "3.1.0",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
type GidsHeadingWebProps,
|
|
3
|
+
GidsHeadingWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
3
5
|
import {
|
|
4
6
|
appendAsChildren,
|
|
5
7
|
DomChildren,
|
|
@@ -7,9 +9,12 @@ import {
|
|
|
7
9
|
} from '../../utils/domUtils.js';
|
|
8
10
|
import { GidsButtonGroupDom } from '../GidsButtonGroup/GidsButtonGroup.js';
|
|
9
11
|
|
|
10
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
getGidsHeadingClassNames,
|
|
14
|
+
getGidsHeadingSupportingTextTypographyClass,
|
|
15
|
+
} = GidsHeadingWebUtils;
|
|
11
16
|
|
|
12
|
-
export interface GidsHeadingDomProps extends
|
|
17
|
+
export interface GidsHeadingDomProps extends GidsHeadingWebProps<
|
|
13
18
|
DomChildren,
|
|
14
19
|
DomNodeOrString
|
|
15
20
|
> {
|
|
@@ -20,6 +25,7 @@ export const GidsHeadingDom = (props: GidsHeadingDomProps): HTMLDivElement => {
|
|
|
20
25
|
const {
|
|
21
26
|
heading,
|
|
22
27
|
supportingText,
|
|
28
|
+
supportingTextTypography,
|
|
23
29
|
level = 'section',
|
|
24
30
|
children,
|
|
25
31
|
extraClasses,
|
|
@@ -48,10 +54,11 @@ export const GidsHeadingDom = (props: GidsHeadingDomProps): HTMLDivElement => {
|
|
|
48
54
|
if (supportingText) {
|
|
49
55
|
if (typeof supportingText === 'string') {
|
|
50
56
|
const supportingTextEl = document.createElement('span');
|
|
51
|
-
supportingTextEl.className =
|
|
57
|
+
supportingTextEl.className = `${
|
|
52
58
|
level === 'section'
|
|
53
59
|
? 'gids-heading__supporting-text-section'
|
|
54
|
-
: 'gids-heading__supporting-text-group'
|
|
60
|
+
: 'gids-heading__supporting-text-group'
|
|
61
|
+
} ${getGidsHeadingSupportingTextTypographyClass(supportingTextTypography)}`;
|
|
55
62
|
supportingTextEl.textContent = supportingText;
|
|
56
63
|
|
|
57
64
|
appendAsChildren(contentContainer, supportingTextEl);
|
|
@@ -28,6 +28,8 @@ export const GidsLogoDom = ({
|
|
|
28
28
|
imgClasses,
|
|
29
29
|
imgProps,
|
|
30
30
|
imgHeight = '100',
|
|
31
|
+
invertedInDarkMode,
|
|
32
|
+
invertedInLightMode,
|
|
31
33
|
...restProps
|
|
32
34
|
}: GidsLogoDomProps): HTMLAnchorElement => {
|
|
33
35
|
const linkElement = document.createElement('a');
|
|
@@ -44,6 +46,10 @@ export const GidsLogoDom = ({
|
|
|
44
46
|
const imgElement = document.createElement('img');
|
|
45
47
|
imgElement.className = clsx(
|
|
46
48
|
`gids-logo__img gids-logo__img-height-${imgHeight}`,
|
|
49
|
+
{
|
|
50
|
+
'gids-logo__inverted-img-in-dark': invertedInDarkMode,
|
|
51
|
+
'gids-logo__inverted-img-in-light': invertedInLightMode,
|
|
52
|
+
},
|
|
47
53
|
imgClasses,
|
|
48
54
|
);
|
|
49
55
|
imgElement.setAttribute('src', src);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type GidsScrimWebProps,
|
|
3
|
+
GidsScrimWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { appendAsChildren, type DomChildren } from '../../utils/domUtils.js';
|
|
6
|
+
|
|
7
|
+
const { getGidsScrimClassNames } = GidsScrimWebUtils;
|
|
8
|
+
|
|
9
|
+
export interface GidsScrimDomProps extends GidsScrimWebProps<DomChildren> {
|
|
10
|
+
extraClasses?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const GidsScrimDom = ({
|
|
14
|
+
children,
|
|
15
|
+
extraClasses,
|
|
16
|
+
}: GidsScrimDomProps): HTMLElement => {
|
|
17
|
+
const scrimEl = document.createElement('gids-scrim');
|
|
18
|
+
scrimEl.className = getGidsScrimClassNames(extraClasses);
|
|
19
|
+
|
|
20
|
+
if (children) {
|
|
21
|
+
appendAsChildren(scrimEl, children);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return scrimEl;
|
|
25
|
+
};
|
|
@@ -6,14 +6,15 @@ import {
|
|
|
6
6
|
type ClassValue,
|
|
7
7
|
GidsSegmentedControlWebUtils,
|
|
8
8
|
} from '@ganpatiinfo/gids-web-shared';
|
|
9
|
-
import { type DomNodeOrString } from '../../utils/domUtils.js';
|
|
9
|
+
import { DomChildren, type DomNodeOrString } from '../../utils/domUtils.js';
|
|
10
10
|
import { GidsSegmentedTabItemDom } from '../GidsSegmentedTabItem/GidsSegmentedTabItem.js';
|
|
11
11
|
|
|
12
12
|
const { getGidsSegmentedControlClassNames } = GidsSegmentedControlWebUtils;
|
|
13
13
|
|
|
14
14
|
export interface GidsSegmentedControlDomProps extends GidsSegmentedControlCommonProps<
|
|
15
15
|
DomNodeOrString,
|
|
16
|
-
string
|
|
16
|
+
string,
|
|
17
|
+
DomChildren
|
|
17
18
|
> {
|
|
18
19
|
onPress?: (props: GidsSegmentedTabItemPressedReturnedProps) => void;
|
|
19
20
|
className?: ClassValue;
|
|
@@ -24,6 +25,7 @@ export const GidsSegmentedControlDom = ({
|
|
|
24
25
|
tabItems,
|
|
25
26
|
onPress,
|
|
26
27
|
className,
|
|
28
|
+
defaultSelectedIndex,
|
|
27
29
|
}: GidsSegmentedControlDomProps): HTMLDivElement => {
|
|
28
30
|
const segmentedControl = document.createElement('div');
|
|
29
31
|
segmentedControl.className = getGidsSegmentedControlClassNames(
|
|
@@ -42,7 +44,7 @@ export const GidsSegmentedControlDom = ({
|
|
|
42
44
|
// Determine if this tab is selected
|
|
43
45
|
// Priority: 1. The newly clicked index, 2. The initial tabItem.selected state
|
|
44
46
|
|
|
45
|
-
let isSelected =
|
|
47
|
+
let isSelected = defaultSelectedIndex === index;
|
|
46
48
|
if (selectedIndex !== undefined && selectedIndex !== null) {
|
|
47
49
|
isSelected = index === selectedIndex;
|
|
48
50
|
} else {
|
|
@@ -7,20 +7,27 @@ import {
|
|
|
7
7
|
GidsSegmentedTabItemWebUtils,
|
|
8
8
|
} from '@ganpatiinfo/gids-web-shared';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
appendAsChildren,
|
|
12
|
+
DomChildren,
|
|
13
|
+
type DomNodeOrString,
|
|
14
|
+
} from '../../utils/domUtils.js';
|
|
11
15
|
import { GidsBadgeDom } from '../GidsBadge/GidsBadge.js';
|
|
12
16
|
|
|
13
17
|
const { getGidsSegmentedTabItemClassNames } = GidsSegmentedTabItemWebUtils;
|
|
14
18
|
|
|
15
19
|
export interface GidsSegmentedTabItemDomProps extends GidsSegmentedTabItemCommonProps<
|
|
16
20
|
DomNodeOrString,
|
|
17
|
-
string
|
|
21
|
+
string,
|
|
22
|
+
DomChildren
|
|
18
23
|
> {
|
|
19
24
|
onPress?: (props: GidsSegmentedTabItemPressedReturnedProps) => void;
|
|
20
25
|
className?: ClassValue;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
export const GidsSegmentedTabItemDom = ({
|
|
29
|
+
leadingIcon,
|
|
30
|
+
trailingIcon,
|
|
24
31
|
index,
|
|
25
32
|
label,
|
|
26
33
|
selected = false,
|
|
@@ -32,8 +39,17 @@ export const GidsSegmentedTabItemDom = ({
|
|
|
32
39
|
width = 'intrinsic',
|
|
33
40
|
}: GidsSegmentedTabItemDomProps): HTMLButtonElement => {
|
|
34
41
|
const segmentedTabItem = document.createElement('button');
|
|
42
|
+
|
|
43
|
+
let isIconOnly = false;
|
|
44
|
+
if (
|
|
45
|
+
(leadingIcon && !trailingIcon && (!label || label === '') && !badge) ||
|
|
46
|
+
(!leadingIcon && trailingIcon && (!label || label === '') && !badge)
|
|
47
|
+
) {
|
|
48
|
+
isIconOnly = true;
|
|
49
|
+
}
|
|
50
|
+
|
|
35
51
|
segmentedTabItem.className = getGidsSegmentedTabItemClassNames(
|
|
36
|
-
{ selected, width },
|
|
52
|
+
{ selected, width, isIconOnly },
|
|
37
53
|
className,
|
|
38
54
|
);
|
|
39
55
|
segmentedTabItem.setAttribute('data-gids-segmented-item', 'true');
|
|
@@ -47,6 +63,15 @@ export const GidsSegmentedTabItemDom = ({
|
|
|
47
63
|
}
|
|
48
64
|
});
|
|
49
65
|
|
|
66
|
+
if (leadingIcon) {
|
|
67
|
+
const leadingIconContainer = document.createElement('div');
|
|
68
|
+
leadingIconContainer.className = clsx('gids-segmented-tab-item__icons', {
|
|
69
|
+
'gids-segmented-tab-item__selected-icons': selected,
|
|
70
|
+
});
|
|
71
|
+
appendAsChildren(leadingIconContainer, leadingIcon);
|
|
72
|
+
segmentedTabItem.appendChild(leadingIconContainer);
|
|
73
|
+
}
|
|
74
|
+
|
|
50
75
|
if (label && label !== '') {
|
|
51
76
|
if (typeof label === 'string') {
|
|
52
77
|
const labelElement = document.createElement('label');
|
|
@@ -60,6 +85,15 @@ export const GidsSegmentedTabItemDom = ({
|
|
|
60
85
|
}
|
|
61
86
|
}
|
|
62
87
|
|
|
88
|
+
if (trailingIcon) {
|
|
89
|
+
const trailingIconContainer = document.createElement('div');
|
|
90
|
+
trailingIconContainer.className = clsx('gids-segmented-tab-item__icons', {
|
|
91
|
+
'gids-segmented-tab-item__selected-icons': selected,
|
|
92
|
+
});
|
|
93
|
+
appendAsChildren(trailingIconContainer, trailingIcon);
|
|
94
|
+
segmentedTabItem.appendChild(trailingIconContainer);
|
|
95
|
+
}
|
|
96
|
+
|
|
63
97
|
if (badge) {
|
|
64
98
|
segmentedTabItem.appendChild(
|
|
65
99
|
GidsBadgeDom({
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsSideMenuWebProps,
|
|
3
|
+
GidsSideMenuWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { appendAsChildren, DomChildren } from '../../utils/domUtils.js';
|
|
6
|
+
|
|
7
|
+
const { getGidsSideMenuClassNames } = GidsSideMenuWebUtils;
|
|
8
|
+
|
|
9
|
+
export interface GidsSideMenuDomProps extends GidsSideMenuWebProps<DomChildren> {
|
|
10
|
+
sideMenuExtraClasses?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const GidsSideMenuDom = ({
|
|
14
|
+
children,
|
|
15
|
+
sideMenuAppearance = 'default',
|
|
16
|
+
sideMenuExtraClasses,
|
|
17
|
+
}: GidsSideMenuDomProps): HTMLDivElement => {
|
|
18
|
+
const sideMenu = document.createElement('div');
|
|
19
|
+
sideMenu.className = getGidsSideMenuClassNames(
|
|
20
|
+
{ sideMenuAppearance },
|
|
21
|
+
sideMenuExtraClasses,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
sideMenu.setAttribute('side-menu-appearance', sideMenuAppearance);
|
|
25
|
+
|
|
26
|
+
if (children) {
|
|
27
|
+
appendAsChildren(sideMenu, children);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return sideMenu;
|
|
31
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsSideMenuHeaderWebProps,
|
|
3
|
+
GidsSideMenuHeaderWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { type HtmlInputAttributes } from '../GidsInput/GidsInput.js';
|
|
6
|
+
import {
|
|
7
|
+
GidsSearchBarDom,
|
|
8
|
+
GidsSearchBarDomProps,
|
|
9
|
+
} from '../GidsSearchBar/GidsSearchBar.js';
|
|
10
|
+
import { appendAsChildren, DomChildren } from '../../utils/domUtils.js';
|
|
11
|
+
import { GidsDividerDom } from '../GidsDivider/GidsDivider.js';
|
|
12
|
+
|
|
13
|
+
const { getGidsSideMenuHeaderClassNames } = GidsSideMenuHeaderWebUtils;
|
|
14
|
+
|
|
15
|
+
export interface GidsSideMenuHeaderDomProps
|
|
16
|
+
extends
|
|
17
|
+
GidsSideMenuHeaderWebProps<DomChildren, Element, HtmlInputAttributes>,
|
|
18
|
+
Pick<
|
|
19
|
+
GidsSearchBarDomProps,
|
|
20
|
+
| 'wrapperClass'
|
|
21
|
+
| 'onGidsSearchBarClear'
|
|
22
|
+
| 'className'
|
|
23
|
+
| 'onBlur'
|
|
24
|
+
| 'onChange'
|
|
25
|
+
| 'onFocus'
|
|
26
|
+
| 'onInput'
|
|
27
|
+
> {
|
|
28
|
+
headerClasses?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const GidsSideMenuHeaderDom = ({
|
|
32
|
+
headerAppearance,
|
|
33
|
+
headerDividedByDivider = true,
|
|
34
|
+
customChildren,
|
|
35
|
+
searchVisible = true,
|
|
36
|
+
onGidsSearchBarClear,
|
|
37
|
+
headerClasses,
|
|
38
|
+
...restProps
|
|
39
|
+
}: GidsSideMenuHeaderDomProps) => {
|
|
40
|
+
const sideMenuHeader = document.createElement('div');
|
|
41
|
+
sideMenuHeader.className = getGidsSideMenuHeaderClassNames(
|
|
42
|
+
{ headerAppearance },
|
|
43
|
+
headerClasses,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const sideMenuContentWrapper = document.createElement('div');
|
|
47
|
+
sideMenuContentWrapper.className = 'gids-side-menu-header__content-wrapper';
|
|
48
|
+
|
|
49
|
+
if (customChildren) {
|
|
50
|
+
appendAsChildren(sideMenuContentWrapper, customChildren);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (searchVisible) {
|
|
54
|
+
const searchBarEl = document.createElement('div');
|
|
55
|
+
searchBarEl.className = 'gids-side-menu-header__search-bar';
|
|
56
|
+
searchBarEl.append(
|
|
57
|
+
GidsSearchBarDom({
|
|
58
|
+
...restProps,
|
|
59
|
+
onGidsSearchBarClear: onGidsSearchBarClear,
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
sideMenuContentWrapper.appendChild(searchBarEl);
|
|
63
|
+
}
|
|
64
|
+
sideMenuHeader.appendChild(sideMenuContentWrapper);
|
|
65
|
+
|
|
66
|
+
if (headerDividedByDivider) {
|
|
67
|
+
sideMenuHeader.append(GidsDividerDom({ orientation: 'horizontal' }));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return sideMenuHeader;
|
|
71
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type GidsSideMenuItemOnPressEvent,
|
|
3
|
+
type GidsSideMenuItemWebProps,
|
|
4
|
+
GidsSideMenuItemWebUtils,
|
|
5
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
6
|
+
import {
|
|
7
|
+
appendAsChildren,
|
|
8
|
+
DomChildren,
|
|
9
|
+
DomNodeOrString,
|
|
10
|
+
} from '../../utils/domUtils.js';
|
|
11
|
+
import { GidsBadgeDom } from '../GidsBadge/GidsBadge.js';
|
|
12
|
+
import { GidsIconDom } from '../GidsIcon/GidsIcon.js';
|
|
13
|
+
import { GidsSideMenuItemCommonUtils } from '@ganpatiinfo/gids-core-shared';
|
|
14
|
+
import { IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
15
|
+
|
|
16
|
+
const { getGidsSideMenuItemClassNames } = GidsSideMenuItemWebUtils;
|
|
17
|
+
const { getSideMenuTrailingIcon } = GidsSideMenuItemCommonUtils;
|
|
18
|
+
|
|
19
|
+
export interface GidsSideMenuItemDomProps extends GidsSideMenuItemWebProps<
|
|
20
|
+
DomNodeOrString,
|
|
21
|
+
DomChildren,
|
|
22
|
+
DomChildren
|
|
23
|
+
> {
|
|
24
|
+
extraClasses?: string;
|
|
25
|
+
onPressSideMenuItem?: GidsSideMenuItemOnPressEvent;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const GidsSideMenuItemDom = ({
|
|
29
|
+
appearance = 'default',
|
|
30
|
+
index = 0,
|
|
31
|
+
selected,
|
|
32
|
+
isLeadingDotVisible = false,
|
|
33
|
+
leadingDotAppearance = 'information',
|
|
34
|
+
leadingAccessory,
|
|
35
|
+
trailingAccessory,
|
|
36
|
+
leadingIcon,
|
|
37
|
+
trailingIcon,
|
|
38
|
+
isTrailingArrowVisible = false,
|
|
39
|
+
trailingArrowDirection = 'right',
|
|
40
|
+
children,
|
|
41
|
+
extraClasses,
|
|
42
|
+
onPressSideMenuItem,
|
|
43
|
+
}: GidsSideMenuItemDomProps): HTMLDivElement => {
|
|
44
|
+
const sideMenuItem = document.createElement('div');
|
|
45
|
+
sideMenuItem.className = getGidsSideMenuItemClassNames(
|
|
46
|
+
{ selected, appearance },
|
|
47
|
+
extraClasses,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
sideMenuItem.setAttribute('index', `${index}`);
|
|
51
|
+
|
|
52
|
+
if (leadingAccessory) {
|
|
53
|
+
appendAsChildren(sideMenuItem, leadingAccessory);
|
|
54
|
+
} else {
|
|
55
|
+
if (isLeadingDotVisible) {
|
|
56
|
+
sideMenuItem.append(
|
|
57
|
+
GidsBadgeDom({
|
|
58
|
+
appearance: leadingDotAppearance,
|
|
59
|
+
type: 'dot',
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (leadingIcon) {
|
|
66
|
+
appendAsChildren(sideMenuItem, leadingIcon);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (children) {
|
|
70
|
+
const textEl = document.createElement('span');
|
|
71
|
+
textEl.className = 'gids-side-menu-item__label';
|
|
72
|
+
if (typeof children === 'string') {
|
|
73
|
+
textEl.textContent = children;
|
|
74
|
+
} else {
|
|
75
|
+
textEl.appendChild(children);
|
|
76
|
+
}
|
|
77
|
+
appendAsChildren(sideMenuItem, textEl);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (trailingAccessory) {
|
|
81
|
+
appendAsChildren(sideMenuItem, trailingAccessory);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (trailingIcon) {
|
|
85
|
+
appendAsChildren(sideMenuItem, trailingIcon);
|
|
86
|
+
} else {
|
|
87
|
+
if (isTrailingArrowVisible) {
|
|
88
|
+
sideMenuItem.append(
|
|
89
|
+
GidsIconDom({
|
|
90
|
+
name: getSideMenuTrailingIcon<IconName>(trailingArrowDirection),
|
|
91
|
+
size: 'md',
|
|
92
|
+
alt: '',
|
|
93
|
+
appearance: 'regular',
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (onPressSideMenuItem) {
|
|
100
|
+
sideMenuItem.addEventListener('click', () => {
|
|
101
|
+
onPressSideMenuItem({
|
|
102
|
+
selectedIndex: index,
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return sideMenuItem;
|
|
108
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsSideNavigationWebProps,
|
|
3
|
+
GidsSideNavigationWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { DomChildren } from '../../utils/domUtils.js';
|
|
6
|
+
import { HtmlInputAttributes } from '../GidsInput/GidsInput.js';
|
|
7
|
+
import {
|
|
8
|
+
type GidsSideMenuHeaderDomProps,
|
|
9
|
+
GidsSideMenuHeaderDom,
|
|
10
|
+
} from '../GidsSideMenuHeader/GidsSideMenuHeader.js';
|
|
11
|
+
import { GidsSideMenuDom } from '../GidsSideMenu/GidsSideMenu.js';
|
|
12
|
+
|
|
13
|
+
const { getGidsSideNavigationClassNames } = GidsSideNavigationWebUtils;
|
|
14
|
+
|
|
15
|
+
export interface GidsSideNavigationDomProps
|
|
16
|
+
extends
|
|
17
|
+
GidsSideNavigationWebProps<
|
|
18
|
+
DomChildren,
|
|
19
|
+
DomChildren,
|
|
20
|
+
Element,
|
|
21
|
+
HtmlInputAttributes
|
|
22
|
+
>,
|
|
23
|
+
Pick<
|
|
24
|
+
GidsSideMenuHeaderDomProps,
|
|
25
|
+
| 'headerClasses'
|
|
26
|
+
| 'wrapperClass'
|
|
27
|
+
| 'onGidsSearchBarClear'
|
|
28
|
+
| 'className'
|
|
29
|
+
| 'onBlur'
|
|
30
|
+
| 'onChange'
|
|
31
|
+
| 'onFocus'
|
|
32
|
+
| 'onInput'
|
|
33
|
+
> {
|
|
34
|
+
extraSideNavigationClasses?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const GidsSideNavigationDom = ({
|
|
38
|
+
sideNavigationAppearance = 'default',
|
|
39
|
+
headerDividedByDivider = true,
|
|
40
|
+
headerClasses,
|
|
41
|
+
extraSideNavigationClasses,
|
|
42
|
+
customHeaderChildren,
|
|
43
|
+
isHeaderVisible = true,
|
|
44
|
+
searchVisible = true,
|
|
45
|
+
children,
|
|
46
|
+
onGidsSearchBarClear,
|
|
47
|
+
onBlur,
|
|
48
|
+
onChange,
|
|
49
|
+
onFocus,
|
|
50
|
+
onInput,
|
|
51
|
+
...restProps
|
|
52
|
+
}: GidsSideNavigationDomProps): HTMLElement => {
|
|
53
|
+
const sideNav = document.createElement('nav');
|
|
54
|
+
|
|
55
|
+
// FIX: Force set the physical HTML attributes so Stencil is forced to read them on boot
|
|
56
|
+
sideNav.setAttribute('side-navigation-appearance', sideNavigationAppearance);
|
|
57
|
+
sideNav.setAttribute('is-header-visible', String(isHeaderVisible));
|
|
58
|
+
sideNav.setAttribute('search-visible', String(searchVisible));
|
|
59
|
+
sideNav.setAttribute(
|
|
60
|
+
'header-divided-by-divider',
|
|
61
|
+
String(headerDividedByDivider),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
sideNav.className = getGidsSideNavigationClassNames(
|
|
65
|
+
{ sideNavigationAppearance },
|
|
66
|
+
extraSideNavigationClasses,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (isHeaderVisible) {
|
|
70
|
+
sideNav.append(
|
|
71
|
+
GidsSideMenuHeaderDom({
|
|
72
|
+
searchVisible,
|
|
73
|
+
headerClasses,
|
|
74
|
+
headerAppearance: sideNavigationAppearance,
|
|
75
|
+
customChildren: customHeaderChildren,
|
|
76
|
+
onBlur,
|
|
77
|
+
onChange,
|
|
78
|
+
onFocus,
|
|
79
|
+
onInput,
|
|
80
|
+
onGidsSearchBarClear,
|
|
81
|
+
headerDividedByDivider,
|
|
82
|
+
...restProps,
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (children) {
|
|
88
|
+
sideNav.append(
|
|
89
|
+
GidsSideMenuDom({
|
|
90
|
+
children,
|
|
91
|
+
sideMenuAppearance: sideNavigationAppearance,
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return sideNav;
|
|
97
|
+
};
|