Skip to content

Commit

Permalink
Merge branch 'development' of github.com:svetoldo4444ka/ngx-bootstrap…
Browse files Browse the repository at this point in the history
… into docs-add-key-navigation-accordion
  • Loading branch information
svetoldo4444ka committed Mar 21, 2018
2 parents cb2bd45 + 4494459 commit 689f910
Show file tree
Hide file tree
Showing 23 changed files with 95 additions and 39 deletions.
3 changes: 1 addition & 2 deletions demo/src/app/components/+alerts/alerts-section.list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export const demoComponentContent: ContentSection[] = [
description: `<p>Alerts are available for any length of text, as well as an optional dismiss
button. For proper styling, use one of the four <strong>required</strong>
contextual classes (e.g., <code>.alert-success</code>). For inline
dismissal, use the <a routerLink="." fragment="dismissing"><code>dismiss
property</code></a>.</p>`,
dismissal, use the <code>dismissible</code> property.</p>`,
component: require('!!raw-loader?lang=typescript!./demos/basic/basic'),
html: require('!!raw-loader?lang=markup!./demos/basic/basic.html'),
outlet: DemoAlertBasicComponent
Expand Down
10 changes: 10 additions & 0 deletions demo/src/app/components/+collapse/collapse-section.list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CollapseDemoComponent } from './demos/basic/basic';
import { ToggleManualDemoComponent } from './demos/toggle-manual/toggle-manual';
import { CollapseDemoEventsComponent } from './demos/events/events';

import { ContentSection } from '../../docs/models/content-section.model';
import { DemoTopSectionComponent } from '../../docs/demo-section-components/demo-top-section/index';
Expand Down Expand Up @@ -30,6 +31,15 @@ export const demoComponentContent: ContentSection[] = [
html: require('!!raw-loader?lang=markup!./demos/basic/basic.html'),
outlet: CollapseDemoComponent
},
{
title: 'Events',
anchor: 'events',
component: require('!!raw-loader?lang=typescript!./demos/events/events'),
html: require('!!raw-loader?lang=markup!./demos/events/events.html'),
description: `Collapse directive exposes 2 events: <code>collapsed</code>, that fires when a content was hidden,
and <code>expanded</code>, that fires when a content was shown`,
outlet: CollapseDemoEventsComponent
},
{
title: 'Manual toggle',
anchor: 'manual-toggle',
Expand Down
5 changes: 1 addition & 4 deletions demo/src/app/components/+collapse/demos/basic/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
(click)="isCollapsed = !isCollapsed">Toggle collapse
</button>
<hr>
<div (collapsed)="collapsed($event)"
(expanded)="expanded($event)"
[collapse]="isCollapsed"
class="card card-block card-header">
<div [collapse]="isCollapsed" class="card card-block card-header">
<div class="well well-lg">Some content</div>
</div>
10 changes: 1 addition & 9 deletions demo/src/app/components/+collapse/demos/basic/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,5 @@ import { Component } from '@angular/core';
templateUrl: './basic.html'
})
export class CollapseDemoComponent {
isCollapsed: boolean = false;

collapsed(event: any): void {
console.log(event);
}

expanded(event: any): void {
console.log(event);
}
isCollapsed = false;
}
17 changes: 17 additions & 0 deletions demo/src/app/components/+collapse/demos/events/events.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="row">
<div class="col-md-3">
<button type="button" class="btn btn-primary"
(click)="isCollapsed = !isCollapsed">Toggle collapse
</button>
</div>
<div class="col-md-9">
<pre class="card card-block card-header">Event: {{message}}</pre>
</div>
</div>
<hr>
<div (collapsed)="collapsed()"
(expanded)="expanded()"
[collapse]="isCollapsed"
class="card card-block card-header">
<div class="well well-lg">Some content</div>
</div>
18 changes: 18 additions & 0 deletions demo/src/app/components/+collapse/demos/events/events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component } from '@angular/core';

@Component({
selector: 'collapse-demo-events',
templateUrl: './events.html'
})
export class CollapseDemoEventsComponent {
isCollapsed = false;
message: string;

collapsed(): void {
this.message = 'collapsed';
}

expanded(): void {
this.message = 'expanded';
}
}
2 changes: 2 additions & 0 deletions demo/src/app/components/+collapse/demos/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { CollapseDemoComponent } from './basic/basic';
import { ToggleManualDemoComponent } from './toggle-manual/toggle-manual';
import { CollapseDemoEventsComponent } from './events/events';
import { DemoAccessibilityComponent } from './accessibility/accessibility';

export const DEMO_COMPONENTS = [
CollapseDemoComponent,
CollapseDemoEventsComponent,
ToggleManualDemoComponent,
DemoAccessibilityComponent
];
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ export const demoComponentContent: ContentSection[] = [
outlet: DemoDatepickerMinMaxComponent
},
{
title: 'Disabled (scratch, WIP)',
title: 'Disabled',
anchor: 'disabled-datepicker',
component: require('!!raw-loader?lang=typescript!./demos/disabled/disabled.component.ts'),
html: require('!!raw-loader?lang=markup!./demos/disabled/disabled.component.html'),
description: `<p>If you want to disable datepicker set <code>isDisabled</code> property to true</p>`,
description: `<p>If you want to disable datepicker's or daterangepicker's content set <code>isDisabled</code> property to true</p>`,
outlet: DemoDatepickerDisabledComponent
},
{
Expand All @@ -160,7 +160,8 @@ export const demoComponentContent: ContentSection[] = [
component: require('!!raw-loader?lang=typescript!./demos/forms/forms.component.ts'),
html: require('!!raw-loader?lang=markup!./demos/forms/forms.component.html'),
description: `<p>Datepicker and daterangepicker can be used in forms. Keep in mind that
value of <code>ngModel</code> is <code>Date</code> object (array of 2 object for daterangepicker)</p>`,
value of <code>ngModel</code> is <code>Date</code> object for datepicker and array of 2
<code>Date</code> objects for daterangepicker</p>`,
outlet: DemoDatepickerFormsComponent
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>bsValue property sets initial state in this example</p>
<p><code>bsValue</code> property sets initial state in this example</p>
<div class="row">
<div class="col-xs-12 col-12 col-md-4 form-group">
<input type="text"
Expand All @@ -12,7 +12,7 @@
</div>
</div>

<p>ngModel property sets two-way data binding in this example</p>
<p><code>ngModel</code> property sets two-way data binding in this example</p>
<div class="row">
<div class="col-xs-12 col-12 col-md-4 form-group">
<input class="form-control" #drp="bsDaterangepicker" bsDaterangepicker [(ngModel)]="bsRangeValue">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<div class="row">
<div class="col-xs-12 col-12 col-sm-6 col-md-4 form-group">
<input class="form-control" placeholder="Datepicker" bsDatepicker #dp="bsDatepicker">
<input class="form-control" placeholder="Datepicker" bsDatepicker #dp="bsDatepicker"
[isDisabled]="isDisabled">
</div>
<div class="col-xs-12 col-12 col-sm-6 col-md-4 form-group">
<input class="form-control" placeholder="Daterangepicker" bsDaterangepicker #dpr="bsDaterangepicker">
<input class="form-control" placeholder="Daterangepicker" bsDaterangepicker #dpr="bsDaterangepicker"
[isDisabled]="isDisabled">
</div>
<div class="col-xs-12 col-12 col-sm-4 col-md-12 col-lg-4 form-group">
<button class="btn btn-success" (click)="toggleDisabling()">Toggle disabling</button>
</div>
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ import { Component } from '@angular/core';
})
export class DemoDatepickerDisabledComponent {
isDisabled = false;

toggleDisabling(): void {
this.isDisabled = !this.isDisabled;
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<div class="row">
<div class="col-xs-12 col-12 col-sm-6 col-md-3 form-group">
<label>The datepicker's placement is right</label>
<p>The datepicker's placement is right</p>
<input class="form-control"
placeholder="Datepicker"
bsDatepicker
placement="right">
</div>
<div class="col-xs-12 col-12 col-sm-6 col-md-3 form-group">
<label>The datepicker's placement is top</label>
<p>The datepicker's placement is top</p>
<input class="form-control"
placeholder="Datepicker"
bsDatepicker
placement="top">
</div>
<div class="col-xs-12 col-12 col-sm-6 col-md-3 form-group">
<label>The datepicker's placement is bottom</label>
<p>The datepicker's placement is bottom</p>
<input class="form-control"
placeholder="Datepicker"
bsDatepicker
placement="bottom">
</div>
<div class="col-xs-12 col-12 col-sm-6 col-md-3 form-group">
<label>The datepicker's placement is left</label>
<p>The datepicker's placement is left</p>
<input class="form-control"
placeholder="Datepicker"
bsDatepicker
Expand Down
2 changes: 1 addition & 1 deletion demo/src/app/components/+modal/demos/events/events.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<button type="button" class="btn btn-primary" (click)="showModal()">Open a modal</button>
<br><br>
<pre *ngFor="let message of messages">{{message}}</pre>
<pre class="card card-block card-header" *ngFor="let message of messages">{{message}}</pre>

<div class="modal fade" bsModal #modal="bs-modal" tabindex="-1" role="dialog"
aria-labelledby="mySmallModalLabel" aria-hidden="true"
Expand Down
8 changes: 7 additions & 1 deletion demo/src/app/components/+modal/demos/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { ModalDirective } from 'ngx-bootstrap/modal';

@Component({
selector: 'demo-modal-events',
templateUrl: './events.html'
templateUrl: './events.html',
styles: [`
.card {
margin-bottom: 0.75rem;
padding: 8px;
}
`]
})
export class DemoModalEventsComponent {
@ViewChild(ModalDirective) modal: ModalDirective;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<button type="button" class="btn btn-primary" (click)="openModal(template)">Open modal</button>
<br><br>
<pre>{{message}}</pre>
<pre class="card card-block card-header">{{message}}</pre>
<ng-template #template>
<div class="modal-body text-center">
<p>Do you want to confirm?</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<button type="button" class="btn btn-primary" (click)="openModal(template)">Open modal</button>
<br><br>
<pre *ngFor="let message of messages">{{message}}</pre>
<pre class="card card-block card-header" *ngFor="let message of messages">{{message}}</pre>
<ng-template #template>
<div class="modal-header">
<h4 class="modal-title pull-left">Modal</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import 'rxjs/add/observable/combineLatest';

@Component({
selector: 'demo-modal-service-events',
templateUrl: './service-events.html'
templateUrl: './service-events.html',
styles: [`
.card {
margin-bottom: 0.75rem;
padding: 8px;
}
`]
})
export class DemoModalServiceEventsComponent {
modalRef: BsModalRef;
Expand Down
4 changes: 2 additions & 2 deletions demo/src/ng-api-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ export const ngdoc: any = {
{
"name": "isDisabled",
"type": "boolean",
"description": "<p>Indicates whether datepicker is enabled or not</p>\n"
"description": "<p>Indicates whether datepicker&#39;s content is enabled or not</p>\n"
},
{
"name": "isOpen",
Expand Down Expand Up @@ -845,7 +845,7 @@ export const ngdoc: any = {
{
"name": "isDisabled",
"type": "boolean",
"description": "<p>Indicates whether daterangepicker is enabled or not</p>\n"
"description": "<p>Indicates whether daterangepicker&#39;s content is enabled or not</p>\n"
},
{
"name": "isOpen",
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/accordion-group.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<button class="btn btn-link" *ngIf="heading" [ngClass]="{'text-muted': isDisabled}">
{{ heading }}
</button>
<ng-content select="[accordion-heading]"></ng-content>
<ng-content select="[accordion-heading]"> </ng-content>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/bs-datepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class BsDatepickerDirective implements OnInit, OnDestroy, OnChanges {
*/
@Input() bsConfig: Partial<BsDatepickerConfig>;
/**
* Indicates whether datepicker is enabled or not
* Indicates whether datepicker's content is enabled or not
*/
@Input() isDisabled: boolean;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/bs-daterangepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class BsDaterangepickerDirective
*/
@Input() bsConfig: Partial<BsDaterangepickerConfig>;
/**
* Indicates whether daterangepicker is enabled or not
* Indicates whether daterangepicker's content is enabled or not
*/
@Input() isDisabled: boolean;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/monthpicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
</thead>
<tbody>
<tr *ngFor="let rowz of rows">
<td *ngFor="let dtz of rowz" class="text-center" role="gridcell" id="{{dtz.uid}}" [ngClass]="dtz.customClass">
<td *ngFor="let dtz of rowz" class="text-center" role="gridcell" [attr.id]="dtz.uid" [ngClass]="dtz.customClass">
<button type="button" style="min-width:100%;" class="btn btn-default"
[ngClass]="{'btn-link': isBs4 && !dtz.selected && !datePicker.isActive(dtz), 'btn-info': dtz.selected || (isBs4 && !dtz.selected && datePicker.isActive(dtz)), disabled: dtz.disabled, active: !isBs4 && datePicker.isActive(dtz)}"
[disabled]="dtz.disabled"
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/yearpicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
</thead>
<tbody>
<tr *ngFor="let rowz of rows">
<td *ngFor="let dtz of rowz" class="text-center" role="gridcell">
<td *ngFor="let dtz of rowz" class="text-center" role="gridcell" [attr.id]="dtz.uid">
<button type="button" style="min-width:100%;" class="btn btn-default"
[ngClass]="{'btn-link': isBs4 && !dtz.selected && !datePicker.isActive(dtz), 'btn-info': dtz.selected || (isBs4 && !dtz.selected && datePicker.isActive(dtz)), disabled: dtz.disabled, active: !isBs4 && datePicker.isActive(dtz)}"
[disabled]="dtz.disabled"
Expand Down

0 comments on commit 689f910

Please sign in to comment.