Skip to content

Commit

Permalink
Merge branch 'development' into docs-add-key-navigation-accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSurmay authored Mar 15, 2018
2 parents cb2bd45 + be14f34 commit 9194279
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 28 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 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;
}
}
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/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 9194279

Please sign in to comment.