-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into days-disabled-datepicker-5638
- Loading branch information
Showing
43 changed files
with
863 additions
and
372 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
11 changes: 11 additions & 0 deletions
11
demo/src/app/components/+carousel/demos/animated/animated.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,11 @@ | ||
<carousel [isAnimated]="true"> | ||
<slide> | ||
<img src="assets/images/nature/1.jpg" alt="first slide" style="display: block; width: 100%;"> | ||
</slide> | ||
<slide> | ||
<img src="assets/images/nature/2.jpg" alt="second slide" style="display: block; width: 100%;"> | ||
</slide> | ||
<slide> | ||
<img src="assets/images/nature/3.jpg" alt="third slide" style="display: block; width: 100%;"> | ||
</slide> | ||
</carousel> |
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,7 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-carousel-animated', | ||
templateUrl: './animated.html' | ||
}) | ||
export class DemoCarouseAnimatedComponent {} |
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
16 changes: 15 additions & 1 deletion
16
demo/src/app/components/+modal/demos/accessibility/accessibility.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 |
---|---|---|
@@ -1 +1,15 @@ | ||
<p>Be sure to add <code class="highlighter-rouge">role="dialog"</code> and <code class="highlighter-rouge">aria-labelledby="..."</code>, referencing the modal title, to <code class="highlighter-rouge">.modal</code>, and <code class="highlighter-rouge">role="document"</code> to the <code class="highlighter-rouge">.modal-dialog</code> itself. Additionally, you may give a description of your modal dialog with <code class="highlighter-rouge">aria-describedby</code> on <code class="highlighter-rouge">.modal</code>.</p> | ||
<button type="button" class="btn btn-primary" (click)="openModal(template)">Create template modal</button> | ||
|
||
<ng-template #template> | ||
<div class="modal-header"> | ||
<h4 class="modal-title pull-left" id="my-modal-title">Modal title</h4> | ||
<button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<div id="my-modal-description"> | ||
This is a modal. | ||
</div> | ||
</div> | ||
</ng-template> |
15 changes: 13 additions & 2 deletions
15
demo/src/app/components/+modal/demos/accessibility/accessibility.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 |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, TemplateRef } from '@angular/core'; | ||
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; | ||
|
||
@Component({ | ||
selector: 'demo-accessibility', | ||
templateUrl: './accessibility.html' | ||
}) | ||
export class DemoAccessibilityComponent {} | ||
export class DemoAccessibilityComponent { | ||
modalRef: BsModalRef; | ||
constructor(private modalService: BsModalService) {} | ||
|
||
openModal(template: TemplateRef<any>) { | ||
this.modalRef = this.modalService.show(template, { | ||
ariaDescribedby: 'my-modal-description', | ||
ariaLabelledBy: 'my-modal-title' | ||
}); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
demo/src/app/components/+typeahead/demos/cancel-on-focus-lost/cancel-on-focus-lost.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,11 @@ | ||
<pre class="card card-block card-header">Model: {{asyncSelected | json}}</pre> | ||
|
||
<input [(ngModel)]="asyncSelected" | ||
[typeahead]="dataSource" | ||
(typeaheadLoading)="changeTypeaheadLoading($event)" | ||
(typeaheadOnSelect)="typeaheadOnSelect($event)" | ||
[typeaheadOptionsLimit]="7" | ||
typeaheadOptionField="name" | ||
placeholder="Locations loaded with timeout" | ||
class="form-control"> | ||
<div *ngIf="typeaheadLoading">Loading</div> |
102 changes: 102 additions & 0 deletions
102
demo/src/app/components/+typeahead/demos/cancel-on-focus-lost/cancel-on-focus-lost.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,102 @@ | ||
import { Component } from '@angular/core'; | ||
import { Observable, of } from 'rxjs'; | ||
import { TypeaheadMatch } from 'ngx-bootstrap/typeahead'; | ||
import { mergeMap, delay } from 'rxjs/operators'; | ||
import { TypeaheadConfig } from 'ngx-bootstrap/typeahead'; | ||
|
||
export function getTypeaheadConfig(): TypeaheadConfig { | ||
return Object.assign(new TypeaheadConfig(), { cancelRequestOnFocusLost: true }); | ||
} | ||
|
||
@Component({ | ||
selector: 'demo-typeahead-cancel-on-focus-lost', | ||
templateUrl: './cancel-on-focus-lost.html', | ||
providers: [{ provide: TypeaheadConfig, useFactory: getTypeaheadConfig }] | ||
}) | ||
export class DemoTypeaheadCancelRequestOnFocusLostComponent { | ||
asyncSelected: string; | ||
typeaheadLoading: boolean; | ||
typeaheadNoResults: boolean; | ||
dataSource: Observable<any>; | ||
statesComplex: any[] = [ | ||
{ id: 1, name: 'Alabama', region: 'South' }, | ||
{ id: 2, name: 'Alaska', region: 'West' }, | ||
{ id: 3, name: 'Arizona', region: 'West' }, | ||
{ id: 4, name: 'Arkansas', region: 'South' }, | ||
{ id: 5, name: 'California', region: 'West' }, | ||
{ id: 6, name: 'Colorado', region: 'West' }, | ||
{ id: 7, name: 'Connecticut', region: 'Northeast' }, | ||
{ id: 8, name: 'Delaware', region: 'South' }, | ||
{ id: 9, name: 'Florida', region: 'South' }, | ||
{ id: 10, name: 'Georgia', region: 'South' }, | ||
{ id: 11, name: 'Hawaii', region: 'West' }, | ||
{ id: 12, name: 'Idaho', region: 'West' }, | ||
{ id: 13, name: 'Illinois', region: 'Midwest' }, | ||
{ id: 14, name: 'Indiana', region: 'Midwest' }, | ||
{ id: 15, name: 'Iowa', region: 'Midwest' }, | ||
{ id: 16, name: 'Kansas', region: 'Midwest' }, | ||
{ id: 17, name: 'Kentucky', region: 'South' }, | ||
{ id: 18, name: 'Louisiana', region: 'South' }, | ||
{ id: 19, name: 'Maine', region: 'Northeast' }, | ||
{ id: 21, name: 'Maryland', region: 'South' }, | ||
{ id: 22, name: 'Massachusetts', region: 'Northeast' }, | ||
{ id: 23, name: 'Michigan', region: 'Midwest' }, | ||
{ id: 24, name: 'Minnesota', region: 'Midwest' }, | ||
{ id: 25, name: 'Mississippi', region: 'South' }, | ||
{ id: 26, name: 'Missouri', region: 'Midwest' }, | ||
{ id: 27, name: 'Montana', region: 'West' }, | ||
{ id: 28, name: 'Nebraska', region: 'Midwest' }, | ||
{ id: 29, name: 'Nevada', region: 'West' }, | ||
{ id: 30, name: 'New Hampshire', region: 'Northeast' }, | ||
{ id: 31, name: 'New Jersey', region: 'Northeast' }, | ||
{ id: 32, name: 'New Mexico', region: 'West' }, | ||
{ id: 33, name: 'New York', region: 'Northeast' }, | ||
{ id: 34, name: 'North Dakota', region: 'Midwest' }, | ||
{ id: 35, name: 'North Carolina', region: 'South' }, | ||
{ id: 36, name: 'Ohio', region: 'Midwest' }, | ||
{ id: 37, name: 'Oklahoma', region: 'South' }, | ||
{ id: 38, name: 'Oregon', region: 'West' }, | ||
{ id: 39, name: 'Pennsylvania', region: 'Northeast' }, | ||
{ id: 40, name: 'Rhode Island', region: 'Northeast' }, | ||
{ id: 41, name: 'South Carolina', region: 'South' }, | ||
{ id: 42, name: 'South Dakota', region: 'Midwest' }, | ||
{ id: 43, name: 'Tennessee', region: 'South' }, | ||
{ id: 44, name: 'Texas', region: 'South' }, | ||
{ id: 45, name: 'Utah', region: 'West' }, | ||
{ id: 46, name: 'Vermont', region: 'Northeast' }, | ||
{ id: 47, name: 'Virginia', region: 'South' }, | ||
{ id: 48, name: 'Washington', region: 'South' }, | ||
{ id: 49, name: 'West Virginia', region: 'South' }, | ||
{ id: 50, name: 'Wisconsin', region: 'Midwest' }, | ||
{ id: 51, name: 'Wyoming', region: 'West' } | ||
]; | ||
|
||
constructor() { | ||
this.dataSource = Observable.create((observer: any) => { | ||
// Runs on every search | ||
observer.next(this.asyncSelected); | ||
}) | ||
.pipe( | ||
mergeMap((token: string) => this.getStatesAsObservable(token)), | ||
delay(1000) | ||
); | ||
} | ||
|
||
getStatesAsObservable(token: string): Observable<any> { | ||
const query = new RegExp(token, 'i'); | ||
|
||
return of( | ||
this.statesComplex.filter((state: any) => { | ||
return query.test(state.name); | ||
}) | ||
); | ||
} | ||
|
||
changeTypeaheadLoading(e: boolean): void { | ||
this.typeaheadLoading = e; | ||
} | ||
|
||
typeaheadOnSelect(e: TypeaheadMatch): void { | ||
console.log('Selected value: ', e.value); | ||
} | ||
} |
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
Oops, something went wrong.