@genesislcap/foundation-header 14.219.0 → 14.219.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +220 -162
- package/dist/custom-elements.json +682 -152
- package/dist/dts/components/rapid-components.d.ts +5 -0
- package/dist/dts/components/rapid-components.d.ts.map +1 -0
- package/dist/dts/config/config.d.ts +2 -2
- package/dist/dts/config/config.d.ts.map +1 -1
- package/dist/dts/config/configure.d.ts.map +1 -1
- package/dist/dts/config/templates.d.ts +18 -1
- package/dist/dts/config/templates.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +86 -15
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts +22 -9
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/styles/colors.d.ts +1 -1
- package/dist/dts/styles/colors.d.ts.map +1 -1
- package/dist/dts/tags/tags.d.ts +13 -0
- package/dist/dts/tags/tags.d.ts.map +1 -1
- package/dist/dts/templates/rapid.template.d.ts +31 -0
- package/dist/dts/templates/rapid.template.d.ts.map +1 -0
- package/dist/esm/components/rapid-components.js +33 -0
- package/dist/esm/config/config.js +1 -1
- package/dist/esm/config/configure.js +4 -5
- package/dist/esm/config/templates.js +37 -9
- package/dist/esm/main/main.js +82 -21
- package/dist/esm/main/main.styles.js +2 -2
- package/dist/esm/main/main.template.js +99 -57
- package/dist/esm/styles/colors.js +1 -1
- package/dist/esm/tags/tags.js +27 -2
- package/dist/esm/templates/rapid.template.js +246 -0
- package/dist/foundation-header.api.json +88 -106
- package/dist/foundation-header.d.ts +122 -37
- package/docs/api/foundation-header.headerconfig.md +2 -2
- package/docs/api/foundation-header.md +2 -2
- package/docs/api/foundation-header.navigation.connectedcallback.md +2 -0
- package/docs/api/foundation-header.navigation.languageoptions.md +2 -0
- package/docs/api/foundation-header.navigation.logoalttext.md +7 -0
- package/docs/api/foundation-header.navigation.md +4 -6
- package/docs/api/foundation-header.navigation.navigateto.md +2 -2
- package/docs/api/foundation-header.navigation.selecttemplate.md +6 -2
- package/docs/api/foundation-header.navtemplate.md +3 -3
- package/docs/api/foundation-header.rapidheader.md +43 -0
- package/docs/api/foundation-header.rapidheader.selecttemplate.md +15 -0
- package/docs/api-report.md +28 -17
- package/docs/img/foundation-header-replaced-img.png +0 -0
- package/docs/img/foundation-header-sidebar.png +0 -0
- package/docs/img/foundation-header-standard.png +0 -0
- package/package.json +23 -24
- package/docs/api/foundation-header.navigation.ready.md +0 -11
- package/docs/api/foundation-header.navigation.sidenavopen.md +0 -11
- package/docs/api/foundation-header.zeroheader.md +0 -37
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
The Header micro front-end is a semi-batteries-included component. It consists of a navigation bar and flyout menu, with routing and account-logout capabilities.
|
|
8
8
|
|
|
9
|
+
### Customise
|
|
10
|
+
|
|
9
11
|
You can customise:
|
|
10
12
|
|
|
11
13
|
- the icon shown on the navigation bar and flyout menu (this shows the Genesis logo by default)
|
|
@@ -13,6 +15,8 @@ You can customise:
|
|
|
13
15
|
- the control buttons on the right-hand side of the navigation bar; these can be shown or hidden, and their behaviour controlled via event listeners
|
|
14
16
|
- the contents of the flyout menu
|
|
15
17
|
|
|
18
|
+
### Examples
|
|
19
|
+
|
|
16
20
|
Here is an example of the navigation bar with three navigation items, and all three control buttons shown.
|
|
17
21
|

|
|
18
22
|
|
|
@@ -24,96 +28,16 @@ In this next example, we have put a set of example options set in the flyout men
|
|
|
24
28
|
|
|
25
29
|
## Header set-up
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
A lot of the Genesis seed apps come with the Header set up by default. To verify, you can do a text search in the client code for the `<foundation-header>` tag.
|
|
30
|
-
|
|
31
|
-
In this case, you only need to do the customisations described in [customising the header](#customising-the-header).
|
|
32
|
-
|
|
33
|
-
:::tip
|
|
34
|
-
The `allRoutes` array, which you need to change to set the navigation buttons on the Header, is found in **client/web/src/routes/config.ts**.
|
|
35
|
-
:::
|
|
36
|
-
|
|
37
|
-
### Manual set-up
|
|
38
|
-
|
|
39
|
-
To enable this micro front-end in your application, follow the steps below.
|
|
40
|
-
|
|
41
|
-
1. Add `@genesislcap/foundation-header` as a dependency in your **package.json** file. Whenever you change the dependencies of your project, ensure you run the bootstrap command again. There is more information in the [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) page.
|
|
42
|
-
|
|
43
|
-
```javascript
|
|
44
|
-
{
|
|
45
|
-
...
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@genesislcap/foundation-header": "latest"
|
|
48
|
-
},
|
|
49
|
-
...
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
:::note
|
|
54
|
-
This page assumes you're already using the Login and Routing systems that are part of `foundation-ui` for the logout and routing functionality.
|
|
55
|
-
|
|
56
|
-
It is possible for you to set up routing manually, but that won't be covered in this tutorial.
|
|
57
|
-
:::
|
|
58
|
-
|
|
59
|
-
2. In the top-level class of your application, import the Navigation class and inject it as a dependency.
|
|
60
|
-
|
|
61
|
-
```javascript {1,6}
|
|
62
|
-
import { Navigation } from '@genesislcap/foundation-header';
|
|
63
|
-
|
|
64
|
-
@customElement({ name, template, styles })
|
|
65
|
-
export class MainApplication extends FASTElement {
|
|
66
|
-
@inject(MainRouterConfig) config!: MainRouterConfig;
|
|
67
|
-
@inject(Navigation) navigation!: Navigation;
|
|
68
|
-
|
|
69
|
-
...
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
:::tip
|
|
75
|
-
If you haven't used the `inject` annotation in your application yet, you'll need to get it from the `@microsoft/fast-foundation` package.
|
|
76
|
-
:::
|
|
77
|
-
|
|
78
|
-
3. Set a reference to the `navigation` object on the FAST router when you instantiate it; this enables you to set up navigation functionality from the navigation bar in the [navigation items step](#navigation-items).
|
|
79
|
-
```javascript
|
|
80
|
-
// fast-router will likely have other attributes such as :config too
|
|
81
|
-
const MainTemplate: ViewTemplate<MainApplication> = html`
|
|
82
|
-
<fast-router :navigation=${(x) => x.navigation}></fast-router>
|
|
83
|
-
`;
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
4. Add the `foundation-header` tag as part of the html that you set as the markup for the `defaultLayout` in your router configuration.
|
|
87
|
-
|
|
88
|
-
```javascript {3}
|
|
89
|
-
export const defaultLayout = new FASTElementLayout(html`
|
|
90
|
-
<div class="container">
|
|
91
|
-
<!-- show-luminance-toggle-button boolean attribute added to show that button on the navigation bar -->
|
|
92
|
-
<foundation-header show-luminance-toggle-button></foundation-header>
|
|
93
|
-
<!-- Other markup -->
|
|
94
|
-
</div>`);
|
|
95
|
-
|
|
96
|
-
export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
|
|
97
|
-
|
|
98
|
-
...
|
|
99
|
-
|
|
100
|
-
public configure() {
|
|
101
|
-
this.title = 'Example app';
|
|
102
|
-
this.defaultLayout = defaultLayout;
|
|
103
|
-
...
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Customising the header
|
|
31
|
+
A lot of the Genesis seed apps come with the Header set up by default. To verify, you can do a text search in the client code for the `<rapid-header>` tag.
|
|
109
32
|
|
|
110
33
|
### Icon
|
|
111
34
|
|
|
112
35
|
By default, the navigation bar and flyout menu show the Genesis logo. You can override this by setting the `logoSrc` attribute. For example:
|
|
113
36
|
|
|
114
37
|
```html
|
|
115
|
-
<
|
|
38
|
+
<rapid-header logoSrc="https://icotar.com/avatar/genesis"></rapid-header>
|
|
116
39
|
```
|
|
40
|
+
|
|
117
41
|
The `logoSrc` defines the image that you want to display. Adding this attribute updates the logo on both the flyout and navigation bar. If you want to keep the Genesis logo, just omit this attribute.
|
|
118
42
|
|
|
119
43
|
### Navigation items
|
|
@@ -122,31 +46,32 @@ You can add navigation items to the left-hand side of the navigation bar. For ea
|
|
|
122
46
|
|
|
123
47
|
```javascript
|
|
124
48
|
html`
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
49
|
+
<rapid-header>
|
|
50
|
+
<rapid-button
|
|
51
|
+
slot="routes"
|
|
52
|
+
value="1"
|
|
53
|
+
@click=${(x, c) => c.parent.navigation.navigateTo("home")}
|
|
54
|
+
>Home</rapid-button>
|
|
55
|
+
</rapid-header>`;
|
|
132
56
|
```
|
|
133
|
-
The `navigation` object referenced via the `parent` object is why the `navigation` object is added as an attribute to the `fast-router` in the [setup step](#header-set-up). From it, the `navigateTo` method can be called, which allows the user to navigate around the finished application from the navigation buttons.
|
|
134
57
|
|
|
135
|
-
|
|
58
|
+
The `navigation` object referenced via the `parent` object is why the `navigation` object is added as an attribute to the `router` in the [setup step](#header-set-up). From it, the `navigateTo` method can be called, which allows the user to navigate around the finished application from the navigation buttons.
|
|
59
|
+
|
|
60
|
+
Moving on from this basic example, a dynamic set of routes can be configured, using the `repeat` directive from `@genesislcap/web-core`.
|
|
136
61
|
|
|
137
62
|
1. Add the routes configuration into an array in the router configuration class.
|
|
138
63
|
|
|
139
64
|
```javascript
|
|
140
65
|
export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
|
|
141
66
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
67
|
+
// New configuration added to existing MainRouterConfig class
|
|
68
|
+
public allRoutes = [
|
|
69
|
+
{ index: 1, path: 'protected', title: 'Home', icon: 'home', variant: 'solid' },
|
|
70
|
+
{ index: 2, path: 'admin', title: 'Admin', icon: 'cog', variant: 'solid' },
|
|
71
|
+
{ index: 3, path: 'reporting', title: 'Reporting', variant: 'solid' },
|
|
72
|
+
];
|
|
148
73
|
|
|
149
|
-
|
|
74
|
+
...
|
|
150
75
|
}
|
|
151
76
|
```
|
|
152
77
|
|
|
@@ -154,30 +79,29 @@ export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
|
|
|
154
79
|
|
|
155
80
|
The following example creates a button with an associated logo for each of the three defined routes:
|
|
156
81
|
|
|
157
|
-
```javascript
|
|
158
82
|
html`
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
83
|
+
<rapid-header>
|
|
84
|
+
<div slot="routes">
|
|
85
|
+
${repeat(
|
|
86
|
+
(x) => x.config.allRoutes,
|
|
87
|
+
html`
|
|
88
|
+
<rapid-button
|
|
89
|
+
appearance="neutral-grey"
|
|
90
|
+
value="${(x) => x.index}"
|
|
91
|
+
@click=${(x, c) => c.parent.navigation.navigateTo(x.path)}
|
|
92
|
+
>
|
|
93
|
+
<rapid-icon variant="${(x) => x.variant}" name="${(x) => x.icon}"></rapid-icon>
|
|
94
|
+
${(x) => x.title}
|
|
95
|
+
</rapid-button>
|
|
96
|
+
`
|
|
97
|
+
)}
|
|
98
|
+
</div>
|
|
99
|
+
</rapid-header>`;
|
|
176
100
|
```
|
|
177
101
|
|
|
178
102
|
### Control buttons
|
|
179
103
|
|
|
180
|
-
There are three control buttons that can be shown or hidden on the right-hand side of the navigation bar (these are hidden by default). Each one of them is a boolean attribute that can be added where the `<
|
|
104
|
+
There are three control buttons that can be shown or hidden on the right-hand side of the navigation bar (these are hidden by default). Each one of them is a boolean attribute that can be added where the `<rapid-header>` tag is defined.
|
|
181
105
|
|
|
182
106
|
| Logo | Toggle Attribute | Dispatched Event |
|
|
183
107
|
|---------------|------------------------------|---------------------------|
|
|
@@ -190,79 +114,213 @@ Implementing the functionality of the buttons is up to the client. For example:
|
|
|
190
114
|
- Define the functionality of the event callback in the class of a class which is a parent to the router.
|
|
191
115
|
|
|
192
116
|
```javascript
|
|
193
|
-
export class MainApplication extends
|
|
117
|
+
export class MainApplication extends GenesisElement {
|
|
194
118
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
119
|
+
onMiscButtonPressed() {
|
|
120
|
+
// ... do something
|
|
121
|
+
}
|
|
122
|
+
//...
|
|
199
123
|
}
|
|
200
124
|
```
|
|
201
125
|
|
|
202
126
|
- Set the event listener in the parent html to call the defined functionality.
|
|
127
|
+
|
|
203
128
|
```javascript
|
|
204
|
-
// fast-router will likely have other attributes such as :config too
|
|
205
129
|
const MainTemplate: ViewTemplate<MainApplication> = html`
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
130
|
+
<foundation-router
|
|
131
|
+
:navigation=${(x) => x.navigation}
|
|
132
|
+
@misc-icon-clicked=${(x) => x.onMiscButtonPressed()}
|
|
133
|
+
>
|
|
134
|
+
</foundation-router>
|
|
211
135
|
`;
|
|
212
136
|
```
|
|
213
137
|
|
|
138
|
+
### Language Selector
|
|
139
|
+
|
|
140
|
+
The rapid-header component can display a language selector if the ```show-language-selector``` attribute is set. This allows users to switch between different languages within the application.
|
|
141
|
+
|
|
142
|
+
```html
|
|
143
|
+
<rapid-header show-language-selector></rapid-header>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
By default, the component uses the languageOptions object, which contains an availableLanguage array and a selectedLanguage property. These default options provide a list of available languages and the currently selected language.
|
|
147
|
+
|
|
148
|
+
You can also pass custom language options by providing an attribute with this data. Here is an example of how to set up the rapid-header component with the show-language-selector attribute and custom language options:
|
|
149
|
+
|
|
150
|
+
<rapid-header
|
|
151
|
+
show-language-selector
|
|
152
|
+
:languageOptions=${() => {
|
|
153
|
+
return { availableLanguages: ['en', 'es'], selectedLanguage: 'es' };
|
|
154
|
+
}}
|
|
155
|
+
></rapid-header>
|
|
156
|
+
|
|
214
157
|
### Menu contents
|
|
215
158
|
|
|
216
159
|
To set the content of the flyout menu, add the content in the html within an element that has the `slot="menu-contents"` attribute.
|
|
217
160
|
```html
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
</
|
|
161
|
+
<rapid-header>
|
|
162
|
+
<div slot="menu-contents">
|
|
163
|
+
<!-- Example markup -->
|
|
164
|
+
<p>GROUP SLOT</p>
|
|
165
|
+
<rapid-tree-view>
|
|
166
|
+
<rapid-tree-item>
|
|
167
|
+
<rapid-icon name="location-arrow"></rapid-icon>
|
|
168
|
+
Slot Tree Item
|
|
169
|
+
</rapid-tree-item>
|
|
170
|
+
<rapid-tree-item>
|
|
171
|
+
<rapid-icon name="location-arrow"></rapid-icon>
|
|
172
|
+
Slot Tree Item
|
|
173
|
+
</rapid-tree-item>
|
|
174
|
+
</rapid-tree-view>
|
|
175
|
+
<p>GROUP SLOT 2</p>
|
|
176
|
+
<rapid-tree-view>
|
|
177
|
+
<rapid-tree-item>
|
|
178
|
+
<rapid-icon name="location-arrow"></rapid-icon>
|
|
179
|
+
Slot Tree Item 2
|
|
180
|
+
</rapid-tree-item>
|
|
181
|
+
<rapid-tree-item>
|
|
182
|
+
<rapid-icon name="location-arrow"></rapid-icon>
|
|
183
|
+
Slot Tree Item 2
|
|
184
|
+
</rapid-tree-item>
|
|
185
|
+
</rapid-tree-view>
|
|
186
|
+
</div>
|
|
187
|
+
</rapid-header>
|
|
245
188
|
```
|
|
246
189
|
|
|
247
|
-
|
|
190
|
+
:::tip
|
|
191
|
+
The `allRoutes` array, which you need to change to set the navigation buttons on the Header, is found in **client/web/src/routes/config.ts**.
|
|
192
|
+
:::
|
|
248
193
|
|
|
249
|
-
|
|
194
|
+
## Manual Header set-up
|
|
250
195
|
|
|
251
|
-
|
|
196
|
+
If the rapid-header component has not been implemented in your project, follow the steps below to add this micro front-end to your application.
|
|
197
|
+
|
|
198
|
+
1. Add `@genesislcap/foundation-header` as a dependency in your **package.json** file. Whenever you change the dependencies of your project, ensure you run the bootstrap command again. There is more information in the [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) page.
|
|
252
199
|
|
|
253
200
|
```json
|
|
254
201
|
{
|
|
255
202
|
...
|
|
256
203
|
"dependencies": {
|
|
257
|
-
...
|
|
258
204
|
"@genesislcap/foundation-header": "latest"
|
|
259
|
-
...
|
|
260
205
|
},
|
|
261
206
|
...
|
|
262
207
|
}
|
|
263
208
|
```
|
|
264
209
|
|
|
265
|
-
|
|
210
|
+
:::note
|
|
211
|
+
This page assumes you're already using the Login and Routing systems that are part of `foundation-ui` for the logout and routing functionality.
|
|
212
|
+
|
|
213
|
+
It is possible for you to set up routing manually, but that won't be covered in this tutorial.
|
|
214
|
+
:::
|
|
215
|
+
|
|
216
|
+
2. In the top-level class of your application, import the Navigation class and inject it as a dependency.
|
|
217
|
+
|
|
218
|
+
```javascript {1,6}
|
|
219
|
+
import { GenesisElement, customElement, inject } from '@genesislcap/web-core';
|
|
220
|
+
import { Navigation } from '@genesislcap/foundation-header';
|
|
221
|
+
|
|
222
|
+
@customElement({ name, template, styles })
|
|
223
|
+
export class MainApplication extends GenesisElement {
|
|
224
|
+
@inject(MainRouterConfig) config!: MainRouterConfig;
|
|
225
|
+
@inject(Navigation) navigation!: Navigation;
|
|
226
|
+
|
|
227
|
+
//...
|
|
228
|
+
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
:::tip
|
|
233
|
+
If you haven't used the `inject` annotation in your application yet, you'll need to get it from the `@genesislcap/web-core` package.
|
|
234
|
+
:::
|
|
235
|
+
|
|
236
|
+
3. Set a reference to the `navigation` object on the foundation-router when you instantiate it; this enables you to set up navigation functionality from the navigation bar in the [navigation items step](#navigation-items).
|
|
237
|
+
|
|
238
|
+
```javascript
|
|
239
|
+
const MainTemplate: ViewTemplate<MainApplication> = html`
|
|
240
|
+
<foundation-router :navigation=${(x) => x.navigation}></foundation-router>
|
|
241
|
+
`;
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
4. Add the `rapid-header` tag as part of the html that you set as the markup for the `defaultLayout` in your router configuration.
|
|
245
|
+
|
|
246
|
+
```javascript {3}
|
|
247
|
+
export const defaultLayout = new GenesisElementLayout(html`
|
|
248
|
+
<div class="container">
|
|
249
|
+
<!-- show-luminance-toggle-button boolean attribute added to show that button on the navigation bar -->
|
|
250
|
+
<rapid-header show-luminance-toggle-button></rapid-header>
|
|
251
|
+
<!-- Other markup -->
|
|
252
|
+
</div>`);
|
|
253
|
+
|
|
254
|
+
export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
|
|
255
|
+
//...
|
|
256
|
+
|
|
257
|
+
public configure() {
|
|
258
|
+
this.title = 'Example app';
|
|
259
|
+
this.defaultLayout = defaultLayout;
|
|
260
|
+
//...
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## DOM API
|
|
266
|
+
|
|
267
|
+
Property and attribute binding examples for foundation-header micro-frontend.
|
|
268
|
+
|
|
269
|
+
### Attributes
|
|
270
|
+
|
|
271
|
+
| Attribute | Type | Use | Example |
|
|
272
|
+
|---|---|---|---|
|
|
273
|
+
| logo-src | `any` | Optional attribute which sets the source of the image in the navigation bar and flyout menu. The Genesis logo will be shown if this attribute is not provided. | `<foundation-header logo-src="path/to/logo.png">` |
|
|
274
|
+
| logo-alt-text | `string` | Optional attribute which controls the alt text of the logo. If this attribute is not set then the alt text is set to 'Corporate Logo'. | `<foundation-header logo-alt-text="My Logo">` |
|
|
275
|
+
| show-luminance-toggle-button | `boolean` | Boolean attribute which controls whether the navigation bar will display the luminance toggle icon. | `<foundation-header show-luminance-toggle-button>` |
|
|
276
|
+
| show-misc-toggle-button | `boolean` | Boolean attribute which controls whether the navigation bar will display the miscellaneous behaviour icon. | `<foundation-header show-misc-toggle-button>` |
|
|
277
|
+
| show-notification-button | `boolean` | Boolean attribute which controls whether the navigation bar will display the show notification icon. | `<foundation-header show-notification-button>` |
|
|
278
|
+
| show-connection-indicator | `boolean` | Boolean attribute which controls whether the navigation bar will display the connection indicator. | `<foundation-header show-connection-indicator>` |
|
|
279
|
+
| show-language-selector | `boolean` | Boolean attribute which controls whether the navigation bar will display the language selector. | `<foundation-header show-language-selector>` |
|
|
280
|
+
| hide-side-bar | `boolean` | Boolean attribute which controls whether the navigation bar will display the side bar. | `<foundation-header hide-side-bar>` |
|
|
281
|
+
|
|
282
|
+
### Properties
|
|
283
|
+
|
|
284
|
+
| Property | Type | Use | Example |
|
|
285
|
+
|---|---|---|---|
|
|
286
|
+
| userName | `string` | Username of the logged in user. | `<foundation-header ?userName="${(x) => x.userName}">` |
|
|
287
|
+
| languageOptions | `LanguageOptions` | Object which defines the language options to be displayed in the language selector. | `<foundation-header :languageOptions="${(x) => x.languageOptions}">` |
|
|
288
|
+
| routeButtons | `Array` | Array of objects which define the route buttons to be displayed in the navigation bar. | `<foundation-header :routeButtons="${(x) => x.routeButtons}">` |
|
|
289
|
+
| routeNavItems | `FoundationRouteNavItem[]` | Array of FoundationRouteNavItems which define the route buttons to be displayed in the navigation bar. | `<foundation-header :routeNavItems="${(x) => x.routeNavItems}">` |
|
|
290
|
+
|
|
291
|
+
### Slots
|
|
292
|
+
|
|
293
|
+
| Slot Name | Description |
|
|
294
|
+
|-----------------|-----------------------------------------------------------------------------|
|
|
295
|
+
| `menu-contents` | Slot for adding custom content to the flyout menu (side navigation). |
|
|
296
|
+
| `routes` | Slot for adding custom route buttons to the navigation bar. |
|
|
297
|
+
| `routes-end` | Slot for adding custom route buttons to the end of the navigation bar. |
|
|
298
|
+
|
|
299
|
+
### Parts
|
|
300
|
+
|
|
301
|
+
| Part Name | Description |
|
|
302
|
+
|-----------------|-----------------------------------------------------------------------------|
|
|
303
|
+
| `dynamic-template` | The element representing the dynamic template content. |
|
|
304
|
+
|
|
305
|
+
### Methods
|
|
306
|
+
|
|
307
|
+
| Method | Description |
|
|
308
|
+
|---|---|
|
|
309
|
+
| `logout` | Logs the user out of their session. |
|
|
310
|
+
| `navigateTo` | Changes the route of the current page. |
|
|
311
|
+
|
|
312
|
+
### Fired Events
|
|
313
|
+
|
|
314
|
+
| Event | Type | Description | Example |
|
|
315
|
+
|---|---|---|---|
|
|
316
|
+
| luminance-icon-clicked | `void` | Dispatched when the user clicks on the luminance toggle icon in the navigation bar. | `<foundation-header @luminance-icon-clicked="${(x) => x.handleLuminanceIconClick}">` |
|
|
317
|
+
| misc-icon-clicked | `void` | Dispatched when the user clicks on the miscellaneous behaviour icon in the navigation bar. | `<foundation-header @misc-icon-clicked="${(x) => x.handleMiscIconClick}">` |
|
|
318
|
+
| notification-icon-clicked | `void` | Dispatched when the user clicks on the notification icon in the navigation bar. | `<foundation-header @notification-icon-clicked="${(x) => x.handleNotificationIconClick}">` |
|
|
319
|
+
| language-changed | `void` | Dispatched when the user changes the language in the language selector. | `<foundation-header @language-changed="${(x) => x.handleLanguageChange}">` |
|
|
320
|
+
|
|
321
|
+
## Listened Events
|
|
322
|
+
|
|
323
|
+
This component doesn't listen to any events.
|
|
266
324
|
|
|
267
325
|
## License
|
|
268
326
|
|