-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(window): add window buttons configuration (#2762)
- Loading branch information
1 parent
bcf7b65
commit 9dcd40e
Showing
11 changed files
with
157 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/playground/with-layout/window/window-controls.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<nb-card> | ||
<nb-card-body> | ||
|
||
<p class="subtitle config-title">Buttons config:</p> | ||
<nb-checkbox [(checked)]="minimize">Minimize</nb-checkbox> | ||
<nb-checkbox [(checked)]="maximize">Maximize</nb-checkbox> | ||
<nb-checkbox [(checked)]="fullScreen">Full Screen</nb-checkbox> | ||
|
||
<button (click)="openWindow()" nbButton class="open-window">Open window</button> | ||
|
||
</nb-card-body> | ||
</nb-card> |
12 changes: 12 additions & 0 deletions
12
src/playground/with-layout/window/window-controls.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.config-title { | ||
margin-top: 0; | ||
margin-bottom: 0.25rem; | ||
} | ||
|
||
nb-checkbox { | ||
display: block; | ||
} | ||
|
||
.open-window { | ||
margin-top: 1rem; | ||
} |
28 changes: 28 additions & 0 deletions
28
src/playground/with-layout/window/window-controls.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { NbWindowControlButtonsConfig, NbWindowService } from '@nebular/theme'; | ||
|
||
import { FormComponent } from './components/form.component'; | ||
|
||
@Component({ | ||
templateUrl: 'window-controls.component.html', | ||
styleUrls: ['./window.scss', './window-controls.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class WindowControlsComponent { | ||
|
||
minimize = true; | ||
maximize = true; | ||
fullScreen = true; | ||
|
||
constructor(private windowService: NbWindowService) { } | ||
|
||
openWindow() { | ||
const buttonsConfig: NbWindowControlButtonsConfig = { | ||
minimize: this.minimize, | ||
maximize: this.maximize, | ||
fullScreen: this.fullScreen, | ||
}; | ||
|
||
this.windowService.open(FormComponent, { title: `Window`, buttons: buttonsConfig }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters