Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
build: Fixes #343 build on Windows by adding explicit type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ermin-muratovic committed Dec 16, 2019
1 parent b7b9b5f commit 2d520dc
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 29 deletions.
19 changes: 13 additions & 6 deletions components/core/src/animations/error-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
* limitations under the License.
*/

import { animation, animate, style } from '@angular/animations';
import {
animation,
animate,
style,
AnimationReferenceMetadata,
} from '@angular/animations';

export const DT_ERROR_ENTER_ANIMATION = animation([
export const DT_ERROR_ENTER_ANIMATION: AnimationReferenceMetadata = animation([
style({ opacity: 0, transform: 'scaleY(0)' }),
animate('150ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
]);

export const DT_ERROR_ENTER_DELAYED_ANIMATION = animation([
style({ opacity: 0, transform: 'scaleY(0)' }),
animate(`250ms 150ms cubic-bezier(0.55, 0, 0.55, 0.2)`),
]);
export const DT_ERROR_ENTER_DELAYED_ANIMATION: AnimationReferenceMetadata = animation(
[
style({ opacity: 0, transform: 'scaleY(0)' }),
animate(`250ms 150ms cubic-bezier(0.55, 0, 0.55, 0.2)`),
],
);
13 changes: 7 additions & 6 deletions components/expandable-panel/src/expandable-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
ViewEncapsulation,
} from '@angular/core';
import { filter } from 'rxjs/operators';
import { Observable } from 'rxjs';

@Component({
selector: 'dt-expandable-panel',
Expand Down Expand Up @@ -123,14 +124,14 @@ export class DtExpandablePanel {
>();

/** @internal Event emitted when the panel is expanded. */
@Output('expanded') readonly _panelExpanded = this.expandChange.pipe(
filter(v => v),
);
@Output('expanded') readonly _panelExpanded: Observable<
boolean
> = this.expandChange.pipe(filter(v => v));

/** @internal Event emitted when the panel is collapsed. */
@Output('collapsed') readonly _panelCollapsed = this.expandChange.pipe(
filter(v => !v),
);
@Output('collapsed') readonly _panelCollapsed: Observable<
boolean
> = this.expandChange.pipe(filter(v => !v));
/**
* Event emitted when the panel has been opened.
* @deprecated Use expandChange instead.
Expand Down
13 changes: 7 additions & 6 deletions components/expandable-text/src/expandable-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
ViewEncapsulation,
} from '@angular/core';
import { filter } from 'rxjs/operators';
import { Observable } from 'rxjs';

/**
* Provides basic expand/collaps functionality for
Expand Down Expand Up @@ -69,15 +70,15 @@ export class DtExpandableText {

/** @internal Event emitted when text is expanded */
// tslint:disable-next-line: dt-annotate-internal-fields
@Output('expanded') readonly _textExpanded = this.expandChanged.pipe(
filter(v => v),
);
@Output('expanded') readonly _textExpanded: Observable<
boolean
> = this.expandChanged.pipe(filter(v => v));

/** @internal Event emitted when text is collapsed */
// tslint:disable-next-line: dt-annotate-internal-fields
@Output('collapsed') readonly _textCollapsed = this.expandChanged.pipe(
filter(v => !v),
);
@Output('collapsed') readonly _textCollapsed: Observable<
boolean
> = this.expandChanged.pipe(filter(v => !v));

constructor(private _changeDetectorRef: ChangeDetectorRef) {}

Expand Down
14 changes: 7 additions & 7 deletions components/secondary-nav/src/section/secondary-nav-section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
Output,
ViewEncapsulation,
} from '@angular/core';
import { Subject } from 'rxjs';
import { Observable, Subject } from 'rxjs';
import { filter } from 'rxjs/operators';

@Directive({
Expand Down Expand Up @@ -117,14 +117,14 @@ export class DtSecondaryNavSection {
@Output() readonly expandChange = new EventEmitter<boolean>();

/** @internal Event emitted when the section is expanded. */
@Output('expanded') readonly _sectionExpand = this.expandChange.pipe(
filter(v => v),
);
@Output('expanded') readonly _sectionExpand: Observable<
boolean
> = this.expandChange.pipe(filter(v => v));

/** @internal Event emitted when the section is collapsed. */
@Output('collapsed') readonly _sectionCollapse = this.expandChange.pipe(
filter(v => !v),
);
@Output('collapsed') readonly _sectionCollapse: Observable<
boolean
> = this.expandChange.pipe(filter(v => !v));

/** @internal Subject used to communicate programmatic change of section opening and closing */
_sectionExpandChange$: Subject<DtSecondaryNavSection> = new Subject();
Expand Down
9 changes: 5 additions & 4 deletions components/table/src/expandable/expandable-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import {
ViewChild,
ViewEncapsulation,
} from '@angular/core';
import { Subscription } from 'rxjs';

import { Observable, Subscription } from 'rxjs';
import { filter, startWith } from 'rxjs/operators';

import {
Expand Down Expand Up @@ -143,9 +144,9 @@ export class DtExpandableRow extends DtRow
filter(changeEvent => changeEvent.row.expanded),
);
/** @internal Event emitted when the row is collapsed. */
@Output('collapsed') readonly _collapsedStream = this.expandChange.pipe(
filter(changeEvent => !changeEvent.row.expanded),
);
@Output('collapsed') readonly _collapsedStream: Observable<
DtExpandableRowChangeEvent
> = this.expandChange.pipe(filter(changeEvent => !changeEvent.row.expanded));

@ViewChild('dtExpandableRow', { static: true }) private _rowRef: ElementRef;

Expand Down

0 comments on commit 2d520dc

Please sign in to comment.