-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(offcanvas): added new module offcanvas. #6424
base: development
Are you sure you want to change the base?
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.
|
@@ -91,6 +91,7 @@ export class ModalContainerComponent implements OnInit, OnDestroy { | |||
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ViewChild(OffcanvasDirective, {static: false}) public directive?: OffcanvasDirective; | |
@ViewChild(OffcanvasDirective, {static: false}) public offcanvasDirective?: OffcanvasDirective; |
src/offcanvas/offcanvas.directive.ts
Outdated
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delayValue = 300; // it is necessary for showing several elements | |
// it is necessary for showing several elements | |
delayValue = 300; |
src/offcanvas/offcanvas.config.ts
Outdated
backdropScrolling: boolean; | ||
}; | ||
|
||
export const OffcanvasConfig: OffcanvasConfigType = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be injectable
src/offcanvas/offcanvas.directive.ts
Outdated
|
||
@Input() set config(value: OffcanvasConfigType | undefined) { | ||
if (!value) { | ||
this.config = Object.assign({}, OffcanvasConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial
…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.