feat(offcanvas): added new module offcanvas.#6424
Conversation
…strap into offcanvas-module
|
Visit the preview URL for this PR (updated for commit 09612d1): https://ngx-bootstrap-demo--pr6424-offcanvas-module-0p77flqn.web.app (expires Mon, 10 Oct 2022 13:37:09 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## development #6424 +/- ##
===============================================
+ Coverage 76.42% 76.64% +0.22%
===============================================
Files 315 314 -1
Lines 10613 10568 -45
Branches 2924 2918 -6
===============================================
- Hits 8111 8100 -11
+ Misses 2501 2467 -34
Partials 1 1
Continue to review full report at Codecov.
|
| @HostListener('click', ['$event']) | ||
| onClickStop(event: MouseEvent): void { | ||
| const clickedInBackdrop = event.target === this._element.nativeElement && !this.clickStartedInContent; | ||
| console.log(clickedInBackdrop); |
There was a problem hiding this comment.
| console.log(clickedInBackdrop); | |
| console.log(clickedInBackdrop); |
| export class OffcanvasContainerComponent { | ||
| _config?: typeof OffcanvasConfig; | ||
| id = id++; | ||
| @ViewChild(OffcanvasDirective, {static: false}) public directive?: OffcanvasDirective; |
There was a problem hiding this comment.
| @ViewChild(OffcanvasDirective, {static: false}) public directive?: OffcanvasDirective; | |
| @ViewChild(OffcanvasDirective, {static: false}) public offcanvasDirective?: OffcanvasDirective; |
| @Directive({selector: '[offcanvas]', exportAs:'offcanvas'}) | ||
| export class OffcanvasDirective { | ||
| isOpen = false; | ||
| delayValue = 300; // it is necessary for showing several elements |
There was a problem hiding this comment.
| delayValue = 300; // it is necessary for showing several elements | |
| // it is necessary for showing several elements | |
| delayValue = 300; |
| backdropScrolling: boolean; | ||
| }; | ||
|
|
||
| export const OffcanvasConfig: OffcanvasConfigType = { |
|
|
||
| @Input() set config(value: OffcanvasConfigType | undefined) { | ||
| if (!value) { | ||
| this.config = Object.assign({}, OffcanvasConfig); |
There was a problem hiding this comment.
inject OffcanvasConfig as service, to allow app module configuration
| _config?: OffcanvasConfigType; | ||
|
|
||
| @Input() set config(value: OffcanvasConfigType | undefined) { | ||
| if (!value) { |
There was a problem hiding this comment.
just use as a value
const config = Object.assign({}, OffcanvasConfig, this.offcanvasConfig, value || {})
| @@ -0,0 +1,18 @@ | |||
| export type AvailablePlacement = 'start' | 'end' | 'top' | 'bottom'; | |||
| export type OffcanvasConfigType = { | |||
…moved backdrop into component-loader, added offcanvas for bs4
|
Visit the preview URL for this PR (updated for commit 85d15bf): https://ngx-bootstrap-demo--pr6424-offcanvas-module-x2gqtwla.web.app (expires Mon, 12 Dec 2022 11:11:00 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: ad45a8e01b9a4306733c914c8a4d7c9337cc4d07 |
feat(offcanvas): added new module offcanvas.