Skip to content

Commit 7ef96c8

Browse files
authored
Add custom picker placeholder in headers (#11)
1 parent 313d4cb commit 7ef96c8

File tree

10 files changed

+30
-2
lines changed

10 files changed

+30
-2
lines changed

projects/ngx-appshell-example/src/app/screens/basic-shell/basic-shell.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
(userLoggedIn)="onUserLoggedIn()"
1515
(userLoggedOut)="onUserLoggedOut()"
1616
(userPick)="onUserPick($event)">
17+
<div id="extra-picker-ctn" ngProjectAs="extra-picker-header">
18+
<appshell-icon [icon]="'counter_3'"></appshell-icon>
19+
</div>
1720
<div id="extra-icons-ctn" ngProjectAs="extra-icons-header">
1821
<button class="extra-icon-btn" (click)="extraHeaderIconClick('1')"><appshell-icon [icon]="'counter_1'"></appshell-icon></button>
1922
<button class="extra-icon-btn" (click)="extraHeaderIconClick('2')"><appshell-icon [icon]="'counter_2'"></appshell-icon></button>

projects/ngx-appshell-example/src/app/screens/basic-shell/basic-shell.component.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ appshell-layout {
33
flex-direction: column;
44
min-height: 100vh;
55

6+
#extra-picker-ctn {
7+
display: flex;
8+
flex-direction: row;
9+
align-items: center;
10+
margin: 0 1rem;
11+
color: var(--header-link-color);
12+
font-size: .875rem;
13+
}
14+
615
#extra-icons-ctn {
716
display: flex;
817
flex-direction: row;

projects/ngx-appshell-example/src/app/screens/platform-shell/platform-shell.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
(userLoggedOut)="logout()"
1919
(userProjectPick)="projectPickerChanged($event)"
2020
(userSecondaryPick)="secondaryPickerChanged($event)">
21+
<div id="extra-picker-ctn" ngProjectAs="extra-picker-header">
22+
<appshell-icon [icon]="'counter_3'"></appshell-icon>
23+
</div>
2124
<div id="extra-icons-ctn" ngProjectAs="extra-icons-header">
2225
<button class="extra-icon-btn" (click)="extraHeaderIconClick('1')"><appshell-icon [icon]="'counter_1'"></appshell-icon></button>
2326
<button class="extra-icon-btn" (click)="extraHeaderIconClick('2')"><appshell-icon [icon]="'counter_2'"></appshell-icon></button>

projects/ngx-appshell-example/src/app/screens/platform-shell/platform-shell.component.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ appshell-platform-layout {
33
flex-direction: column;
44
min-height: 100vh;
55

6+
#extra-picker-ctn {
7+
display: flex;
8+
flex-direction: row;
9+
align-items: center;
10+
margin-right: 2rem;
11+
color: var(--header-link-color);
12+
font-size: .875rem;
13+
}
14+
615
#extra-icons-ctn {
716
display: flex;
817
flex-direction: row;

projects/ngx-appshell/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A comprehensive Angular library providing pre-built UI components, directives, and schematics for building modern enterprise applications with Material Design.
44

5-
**Version:** 19.0.13
5+
**Version:** 19.0.14
66
**Angular:** >=19.0.0
77

88
## Features

projects/ngx-appshell/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opendevstack/ngx-appshell",
3-
"version": "19.0.13",
3+
"version": "19.0.14",
44
"description": "A comprehensive Angular library providing pre-built UI components, directives, and schematics for building modern enterprise applications with Material Design.",
55
"author": "OpenDevStack",
66
"repository": {

projects/ngx-appshell/src/lib/components/appshell-header/appshell-header.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ <h1>{{applicationName()}}</h1>
2020
{{link.label}}
2121
</a>
2222
}
23+
<ng-content select="extra-picker"></ng-content>
2324
@if (picker()) {
2425
<appshell-header-picker [picker]="picker()!" (pick)="userPick.emit($event)" />
2526
}

projects/ngx-appshell/src/lib/components/appshell-layout/appshell-layout.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
(userLoggedIn)="userLoggedIn.emit()"
1313
(userLoggedOut)="userLoggedOut.emit()"
1414
(userPick)="userPick.emit($event)">
15+
<ng-content select="extra-picker-header" ngProjectAs="extra-picker"></ng-content>
1516
<ng-content select="extra-icons-header" ngProjectAs="extra-icons"></ng-content>
1617
</appshell-header>
1718

projects/ngx-appshell/src/lib/components/appshell-platform-header/appshell-platform-header.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<h1>{{ applicationName() }}</h1>
1616
</div>
1717

18+
<ng-content select="extra-picker"></ng-content>
1819

1920
@if (projectPicker() && projectPicker()?.label) {
2021
<appshell-header-picker

projects/ngx-appshell/src/lib/components/appshell-platform-layout/appshell-platform-layout.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
(platformPickerClick)="platformPickerClick.emit()"
1818
(userProjectPick)="userProjectPick.emit($event)"
1919
(userSecondaryPick)="userSecondaryPick.emit($event)">
20+
<ng-content select="extra-picker-header" ngProjectAs="extra-picker"></ng-content>
2021
<ng-content select="extra-icons-header" ngProjectAs="extra-icons"></ng-content>
2122
</appshell-platform-header>
2223

0 commit comments

Comments
 (0)