platformcommons-web-lib 1.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/commons-shared-web-ui-1.0.0.tgz +0 -0
- package/documentation/alert.md +123 -0
- package/documentation/button-dropdown.md +126 -0
- package/documentation/button.md +184 -0
- package/documentation/cards-usage-guidelines.md +131 -0
- package/documentation/configurable-form.md +605 -0
- package/documentation/confirmation-modal.md +250 -0
- package/documentation/filter-sidebar.md +178 -0
- package/documentation/filter-table-selector.md +228 -0
- package/documentation/form-builder.md +597 -0
- package/documentation/form-components.md +384 -0
- package/documentation/nav.md +427 -0
- package/documentation/pagination.md +181 -0
- package/documentation/side-nav-documentation.md +169 -0
- package/documentation/smart-form.md +2177 -0
- package/documentation/smart-table.md +1198 -0
- package/documentation/snackbar.md +118 -0
- package/documentation/style-externalization.md +88 -0
- package/documentation/summary-card.md +279 -0
- package/ng-package.json +28 -0
- package/package.json +54 -0
- package/src/lib/modules/alert/alert.models.ts +6 -0
- package/src/lib/modules/alert/alert.module.ts +16 -0
- package/src/lib/modules/alert/alert.theme.scss +85 -0
- package/src/lib/modules/alert/components/alert/alert.component.html +27 -0
- package/src/lib/modules/alert/components/alert/alert.component.scss +92 -0
- package/src/lib/modules/alert/components/alert/alert.component.ts +81 -0
- package/src/lib/modules/button/button.models.ts +13 -0
- package/src/lib/modules/button/button.module.ts +16 -0
- package/src/lib/modules/button/button.theme.scss +121 -0
- package/src/lib/modules/button/components/button/button.component.html +22 -0
- package/src/lib/modules/button/components/button/button.component.scss +88 -0
- package/src/lib/modules/button/components/button/button.component.ts +67 -0
- package/src/lib/modules/button-dropdown/button-dropdown.models.ts +26 -0
- package/src/lib/modules/button-dropdown/button-dropdown.module.ts +22 -0
- package/src/lib/modules/button-dropdown/button-dropdown.theme.scss +87 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +41 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +135 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +160 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.html +294 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.scss +503 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.ts +628 -0
- package/src/lib/modules/configurable-form/configurable-form.examples.ts +154 -0
- package/src/lib/modules/configurable-form/configurable-form.model.ts +131 -0
- package/src/lib/modules/configurable-form/configurable-form.module.ts +19 -0
- package/src/lib/modules/configurable-form/configurable-form.theme.scss +78 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +77 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +395 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +266 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +71 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +20 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.theme.scss +87 -0
- package/src/lib/modules/filter/components/filter/filter.component.html +131 -0
- package/src/lib/modules/filter/components/filter/filter.component.scss +245 -0
- package/src/lib/modules/filter/components/filter/filter.component.ts +216 -0
- package/src/lib/modules/filter/filter.models.ts +88 -0
- package/src/lib/modules/filter/filter.module.ts +24 -0
- package/src/lib/modules/filter/filter.theme.scss +92 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +112 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +186 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +163 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +95 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +24 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.theme.scss +38 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +73 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +321 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +361 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +91 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +22 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.theme.scss +36 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +63 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +496 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +445 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +75 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +210 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +55 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +25 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +82 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +95 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +20 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +37 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +94 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +46 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +102 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +50 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +35 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +67 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +34 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +68 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +113 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +74 -0
- package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +533 -0
- package/src/lib/modules/form-builder/form-builder.module.ts +36 -0
- package/src/lib/modules/form-builder/form-builder.theme.scss +212 -0
- package/src/lib/modules/form-builder/index.ts +9 -0
- package/src/lib/modules/form-builder/models/builder.models.ts +7 -0
- package/src/lib/modules/form-builder/models/field-configurator.models.ts +38 -0
- package/src/lib/modules/form-builder/models/field-selection.models.ts +51 -0
- package/src/lib/modules/form-builder/services/field-configurator.service.ts +258 -0
- package/src/lib/modules/form-builder/services/field-selection.service.ts +300 -0
- package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +652 -0
- package/src/lib/modules/form-builder/tokens/builder.tokens.ts +10 -0
- package/src/lib/modules/form-builder/utils/constants.ts +43 -0
- package/src/lib/modules/form-components/components/checkbox/_theme.scss +63 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +29 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +111 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +207 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +35 -0
- package/src/lib/modules/form-components/components/datepicker/_theme.scss +82 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +42 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +115 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +267 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +45 -0
- package/src/lib/modules/form-components/components/dropdown/_theme.scss +91 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +74 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +252 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +377 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +53 -0
- package/src/lib/modules/form-components/components/input/_theme.scss +77 -0
- package/src/lib/modules/form-components/components/input/input.component.html +51 -0
- package/src/lib/modules/form-components/components/input/input.component.scss +128 -0
- package/src/lib/modules/form-components/components/input/input.component.ts +250 -0
- package/src/lib/modules/form-components/components/input/input.models.ts +55 -0
- package/src/lib/modules/form-components/components/radio/_theme.scss +61 -0
- package/src/lib/modules/form-components/components/radio/radio.component.html +22 -0
- package/src/lib/modules/form-components/components/radio/radio.component.scss +107 -0
- package/src/lib/modules/form-components/components/radio/radio.component.ts +181 -0
- package/src/lib/modules/form-components/components/radio/radio.models.ts +39 -0
- package/src/lib/modules/form-components/components/search/_theme.scss +73 -0
- package/src/lib/modules/form-components/components/search/search.component.html +15 -0
- package/src/lib/modules/form-components/components/search/search.component.scss +87 -0
- package/src/lib/modules/form-components/components/search/search.component.ts +213 -0
- package/src/lib/modules/form-components/components/search/search.models.ts +40 -0
- package/src/lib/modules/form-components/components/toggle/_theme.scss +45 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.html +15 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.scss +81 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.ts +166 -0
- package/src/lib/modules/form-components/components/toggle/toggle.models.ts +27 -0
- package/src/lib/modules/form-components/directives/click-outside.directive.ts +22 -0
- package/src/lib/modules/form-components/form-components.module.ts +41 -0
- package/src/lib/modules/form-components/form-components.theme.scss +25 -0
- package/src/lib/modules/material/material.module.ts +94 -0
- package/src/lib/modules/nav/components/nav/nav.component.html +34 -0
- package/src/lib/modules/nav/components/nav/nav.component.scss +171 -0
- package/src/lib/modules/nav/components/nav/nav.component.ts +82 -0
- package/src/lib/modules/nav/nav.models.ts +31 -0
- package/src/lib/modules/nav/nav.module.ts +17 -0
- package/src/lib/modules/nav/nav.theme.scss +86 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.html +52 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.scss +155 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.ts +109 -0
- package/src/lib/modules/pagination/pagination.module.ts +17 -0
- package/src/lib/modules/pagination/pagination.theme.scss +66 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +56 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +342 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +135 -0
- package/src/lib/modules/side-nav/side-nav.models.ts +38 -0
- package/src/lib/modules/side-nav/side-nav.module.ts +16 -0
- package/src/lib/modules/side-nav/side-nav.theme.scss +111 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.html +1109 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +1860 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +2232 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.html +64 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +209 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +119 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +253 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +689 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +1087 -0
- package/src/lib/modules/smart-form/index.ts +10 -0
- package/src/lib/modules/smart-form/models/form-schema.model.ts +700 -0
- package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +21 -0
- package/src/lib/modules/smart-form/services/expression.service.ts +75 -0
- package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +65 -0
- package/src/lib/modules/smart-form/smart-form.examples.ts +1324 -0
- package/src/lib/modules/smart-form/smart-form.module.ts +36 -0
- package/src/lib/modules/smart-form/smart-form.theme.scss +890 -0
- package/src/lib/modules/smart-form/utils/translation.utils.ts +82 -0
- package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +25 -0
- package/src/lib/modules/smart-form/utils/validation.utils.ts +98 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +283 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +685 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +1118 -0
- package/src/lib/modules/smart-table/models/table-config.model.ts +202 -0
- package/src/lib/modules/smart-table/smart-table.module.ts +30 -0
- package/src/lib/modules/smart-table/smart-table.theme.scss +335 -0
- package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +22 -0
- package/src/lib/modules/smart-table/utils/smart-table.utils.ts +18 -0
- package/src/lib/modules/snackbar/components/snackbar.component.html +41 -0
- package/src/lib/modules/snackbar/components/snackbar.component.scss +99 -0
- package/src/lib/modules/snackbar/components/snackbar.component.ts +18 -0
- package/src/lib/modules/snackbar/models/snackbar.models.ts +10 -0
- package/src/lib/modules/snackbar/services/snackbar.service.ts +40 -0
- package/src/lib/modules/snackbar/snackbar.module.ts +11 -0
- package/src/lib/modules/snackbar/snackbar.theme.scss +93 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +47 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +199 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +126 -0
- package/src/lib/modules/summary-card/summary-card.module.ts +18 -0
- package/src/lib/modules/summary-card/summary-card.theme.scss +176 -0
- package/src/lib/shared-ui.module.ts +44 -0
- package/src/lib/styles/global.scss +152 -0
- package/src/lib/styles/utilities.scss +250 -0
- package/src/lib/utils/constants.ts +11 -0
- package/src/lib/utils/storage.utils.ts +37 -0
- package/src/lib/utils/string.utils.ts +23 -0
- package/src/lib/utils/translation.utils.ts +87 -0
- package/src/public-api.ts +104 -0
- package/tsconfig.lib.json +15 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Side Navigation Component (`lib-side-nav`)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
The `lib-side-nav` component provides a reusable, configurable sidebar navigation drawer for micro-frontends (MFEs). It supports nested items, role-based access control (RBAC) filtering, dynamic label mapping for internationalization (i18n), and customizable themes.
|
|
5
|
+
|
|
6
|
+
By handling data transformations like deep cloning and label mapping internally, the component ensures that consuming MFEs remain lightweight and declarative.
|
|
7
|
+
|
|
8
|
+
## Input Configuration
|
|
9
|
+
|
|
10
|
+
| Property | Type | Default | Description |
|
|
11
|
+
|---|---|---|---|
|
|
12
|
+
| `[sections]` | `SideNavSection[]` | `[]` | Array of section configurations, each containing a heading and an array of `SideNavItem`s. |
|
|
13
|
+
| `[userRoles]` | `string[]` | `undefined` | Array of roles for the current user. Used to filter out nav items that the user does not have access to. |
|
|
14
|
+
| `[labels]` | `{ [key: string]: string }` | `undefined` | Key-value dictionary object used for dynamically translating item headings, labels, and tooltips. |
|
|
15
|
+
| `[activeId]` | `string` | `undefined` | The `id` of the currently active navigation item to highlight. |
|
|
16
|
+
| `[styleConfig]` | `SideNavStyleConfig` | `undefined` | Allows passing an object to override color rules. Alternatively, use CSS variables on `:root` or `:host`. |
|
|
17
|
+
| `[(collapsed)]` | `boolean` | `false` | Controls whether the side nav is open or collapsed into an icons-only view. Supports two-way binding. |
|
|
18
|
+
| `[width]` | `string` | `undefined` | Width of the expanded side nav. Overrides the `--cc-side-nav-width` CSS variable. |
|
|
19
|
+
| `[collapsedWidth]` | `string` | `undefined` | Width of the collapsed side nav. Overrides `--cc-side-nav-collapsed-width` CSS variable. |
|
|
20
|
+
| `[showCollapseToggle]` | `boolean` | `true` | Whether to display the collapse/expand toggle button. |
|
|
21
|
+
| `[hideIconsWhenExpanded]` | `boolean` | `false` | If true, hides icons when the side nav is expanded, showing only text. |
|
|
22
|
+
| `[showTooltips]` | `boolean` | `false` | Enables tooltips when the nav is expanded. Tooltips are **always shown automatically when collapsed** regardless of this value. |
|
|
23
|
+
| `[tooltipPosition]` | `TooltipPosition` | `'right'` | Position of the tooltips relative to the items. |
|
|
24
|
+
|
|
25
|
+
## Outputs
|
|
26
|
+
|
|
27
|
+
| Output | Event Type | Description |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| `(itemClicked)` | `EventEmitter<SideNavItem>` | Emitted when a user clicks a nav item (that isn't disabled). |
|
|
30
|
+
| `(collapsedChange)` | `EventEmitter<boolean>` | Emitted when the user toggles the collapse state. |
|
|
31
|
+
|
|
32
|
+
## Expected JSON Configuration Format
|
|
33
|
+
|
|
34
|
+
The input `sections` array should be built utilizing the following `SideNavSection` interface structure (usually fetched from a JSON file):
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"sections": [
|
|
39
|
+
{
|
|
40
|
+
"heading": "MAIN_NAVIGATION_HEADING_KEY",
|
|
41
|
+
"items": [
|
|
42
|
+
{
|
|
43
|
+
"id": "dashboard",
|
|
44
|
+
"labelKey": "DASHBOARD_LABEL_KEY",
|
|
45
|
+
"icon": "fa fa-home",
|
|
46
|
+
"route": "/dashboard",
|
|
47
|
+
"roles": ["admin", "user"]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "settings",
|
|
51
|
+
"labelKey": "SETTINGS_LABEL_KEY",
|
|
52
|
+
"icon": "settings",
|
|
53
|
+
"route": "/settings",
|
|
54
|
+
"roles": ["admin"]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
*Note: The component will automatically translate `MAIN_NAVIGATION_HEADING_KEY`, `DASHBOARD_LABEL_KEY` etc. substituting them using the provided `[labels]` dictionary.*
|
|
63
|
+
|
|
64
|
+
## Example Usage in an MFE
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<lib-side-nav
|
|
68
|
+
[sections]="navSections"
|
|
69
|
+
[labels]="labelsMap"
|
|
70
|
+
[activeId]="currentRouteId"
|
|
71
|
+
[(collapsed)]="isNavCollapsed"
|
|
72
|
+
(itemClicked)="onNavClick($event)">
|
|
73
|
+
</lib-side-nav>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
export class ExampleHomeComponent implements OnInit {
|
|
78
|
+
navSections: SideNavSection[] = [];
|
|
79
|
+
labelsMap: any = {};
|
|
80
|
+
isNavCollapsed = false;
|
|
81
|
+
currentRouteId = 'dashboard';
|
|
82
|
+
|
|
83
|
+
constructor(private assetService: AssetService, private labelService: LabelService) {}
|
|
84
|
+
|
|
85
|
+
ngOnInit() {
|
|
86
|
+
// 1. Load labels
|
|
87
|
+
this.labelService.labels$.subscribe(labels => this.labelsMap = labels);
|
|
88
|
+
|
|
89
|
+
// 2. Load the raw side-nav structure JSON; don't map labels manually!
|
|
90
|
+
this.assetService.getStaticContents('side-nav.json').subscribe(res => {
|
|
91
|
+
this.navSections = res.sections || [];
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
onNavClick(item: SideNavItem) {
|
|
96
|
+
if (item.route) {
|
|
97
|
+
// Navigate
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## CSS Variable Theming
|
|
104
|
+
|
|
105
|
+
All visual tokens are exposed as CSS custom properties. Override them on `:root` or a parent selector, or pass them via `[styleConfig]`.
|
|
106
|
+
|
|
107
|
+
### Container & Layout
|
|
108
|
+
|
|
109
|
+
| CSS Variable | `styleConfig` key | Default | Description |
|
|
110
|
+
|---|---|---|---|
|
|
111
|
+
| `--cc-side-nav-bg` | `bg` | `#F9C80E0D` | Background colour of the nav |
|
|
112
|
+
| `--cc-side-nav-width` | `width` | `220px` | Expanded width |
|
|
113
|
+
| `--cc-side-nav-collapsed-width` | `collapsedWidth` | `56px` | Collapsed (icon-only) width |
|
|
114
|
+
| `--cc-side-nav-font-family` | `fontFamily` | `'Poppins', sans-serif` | Font family for all text |
|
|
115
|
+
|
|
116
|
+
### Items
|
|
117
|
+
|
|
118
|
+
| CSS Variable | `styleConfig` key | Default | Description |
|
|
119
|
+
|---|---|---|---|
|
|
120
|
+
| `--cc-side-nav-item-color` | `itemColor` | `#5F6368` | Inactive item text/icon colour |
|
|
121
|
+
| `--cc-side-nav-item-hover-bg` | `itemHoverBg` | `rgba(#E63E30, 0.05)` | Inactive item hover background |
|
|
122
|
+
| `--cc-side-nav-active-bg` | `activeBg` | `#E63E30` | Active item background |
|
|
123
|
+
| `--cc-side-nav-active-color` | `activeColor` | `#FFFFFF` | Active item text/icon colour |
|
|
124
|
+
| `--cc-side-nav-active-hover-bg` | `activeHoverBg` | `#D4382B` | Active item hover background |
|
|
125
|
+
| `--cc-side-nav-heading-color` | `headingColor` | `#3C4043` | Section heading colour |
|
|
126
|
+
|
|
127
|
+
### Toggle Pill
|
|
128
|
+
|
|
129
|
+
| CSS Variable | `styleConfig` key | Default | Description |
|
|
130
|
+
|---|---|---|---|
|
|
131
|
+
| `--cc-side-nav-toggle-bg` | `toggleBg` | `#ffffff` | Collapse/expand button background |
|
|
132
|
+
| `--cc-side-nav-toggle-border-color` | `toggleBorderColor` | `rgba(0,0,0,0.1)` | Collapse/expand button border colour |
|
|
133
|
+
|
|
134
|
+
### Tooltip
|
|
135
|
+
|
|
136
|
+
Tooltips appear automatically when the nav is **collapsed**. When expanded, they only show if `[showTooltips]="true"` is set. The tooltip displays to the `right` of the icon with a left-pointing arrow caret.
|
|
137
|
+
|
|
138
|
+
| CSS Variable | `styleConfig` key | Default | Description |
|
|
139
|
+
|---|---|---|---|
|
|
140
|
+
| `--cc-side-nav-tooltip-bg` | `tooltipBg` | `#1e1e2d` | Tooltip background (also used for the arrow caret colour) |
|
|
141
|
+
| `--cc-side-nav-tooltip-color` | `tooltipColor` | `#FFFFFF` | Tooltip text colour |
|
|
142
|
+
| `--cc-side-nav-tooltip-font-size` | — | `12px` | Tooltip font size |
|
|
143
|
+
| `--cc-side-nav-tooltip-font-weight` | `tooltipFontWeight` | `500` | Tooltip font weight |
|
|
144
|
+
| `--cc-side-nav-tooltip-letter-spacing` | `tooltipLetterSpacing` | `0.2px` | Tooltip letter spacing |
|
|
145
|
+
| `--cc-side-nav-tooltip-padding` | — | `8px 14px` | Tooltip inner padding |
|
|
146
|
+
| `--cc-side-nav-tooltip-border-radius` | — | `6px` | Tooltip border radius |
|
|
147
|
+
| `--cc-side-nav-tooltip-shadow` | `tooltipShadow` | `0 4px 12px rgba(0,0,0,0.35)` | Tooltip box shadow |
|
|
148
|
+
| `--cc-side-nav-tooltip-offset` | `tooltipOffset` | `20px` | Gap between the icon and the tooltip box |
|
|
149
|
+
|
|
150
|
+
**Example — override via CSS:**
|
|
151
|
+
```scss
|
|
152
|
+
lib-side-nav {
|
|
153
|
+
--cc-side-nav-tooltip-bg: #2c2c3e;
|
|
154
|
+
--cc-side-nav-toggle-bg: #f5f5f5;
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Example — override via `[styleConfig]`:**
|
|
159
|
+
```html
|
|
160
|
+
<lib-side-nav
|
|
161
|
+
[styleConfig]="{ tooltipBg: '#2c2c3e', toggleBg: '#f5f5f5' }"
|
|
162
|
+
...>
|
|
163
|
+
</lib-side-nav>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Best Practices
|
|
167
|
+
- **Do not map or clone data in the MFE**: Let `lib-side-nav` handle filtering by roles and transforming JSON data. You should pass the raw JSON array to `[sections]` and the translation dictionary to `[labels]`.
|
|
168
|
+
- **Use CSS Variables for theming**: While `[styleConfig]` is provided, setting `--cc-side-nav-width` and other variables in an MFE's SCSS provides better design system scalability.
|
|
169
|
+
- **Lazy Load Labels**: If the language is updated dynamically, simply pass a new `labels` ref to the component—it handles `ngOnChanges()` automatically and re-renders the translated text.
|