Angular 5.0.1 & Angular Material 5.0.0-rc0 compatibility (wip)

This commit is contained in:
Sercan Yemen 2017-11-12 22:36:14 +03:00
parent 06679343a4
commit 7f357306eb
18 changed files with 148 additions and 117 deletions

92
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "fuse2",
"version": "1.2.0",
"version": "1.2.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -43,17 +43,17 @@
}
},
"@angular/animations": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-5.0.0.tgz",
"integrity": "sha1-ta0ZnGf5P3WVREd+/+ZnnhVJkfs=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-5.0.1.tgz",
"integrity": "sha1-qSsrGGpuWjGp8VhJEd1qp+FsXeE=",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/cdk": {
"version": "2.0.0-beta.12",
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-2.0.0-beta.12.tgz",
"integrity": "sha1-OiQ8tiuT9OA5EgunD5ANyeI1Yi4=",
"version": "5.0.0-rc0",
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-5.0.0-rc0.tgz",
"integrity": "sha512-wZg/mzHisiTieVt7Q/YNPB+r07PHvjoAT3+0mwyIP7wuC00W8BJLPhTZd/tIM5q7Nd69kuA1HSx1qLkcmlCZkw==",
"requires": {
"tslib": "1.8.0"
}
@ -124,25 +124,25 @@
}
},
"@angular/common": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-5.0.0.tgz",
"integrity": "sha1-+W1mpRe5ldG6mygwnxXC41lnWCU=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-5.0.1.tgz",
"integrity": "sha1-QwBas8i4/68Xaq+zuGupMcPkvfk=",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/compiler": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-5.0.0.tgz",
"integrity": "sha1-uf+/GMijnYt9rOxHMZOpDiTMK8k=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-5.0.1.tgz",
"integrity": "sha1-f9TH+ku770wUaWL6lGuCczCmyO0=",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/compiler-cli": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-5.0.0.tgz",
"integrity": "sha1-Dsu5N9hKT43ZTwwqR7B9LkaUyFM=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-5.0.1.tgz",
"integrity": "sha1-Um3BuzlPsWrZFmAe6pqgDrRLT/8=",
"dev": true,
"requires": {
"chokidar": "1.7.0",
@ -152,9 +152,9 @@
}
},
"@angular/core": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-5.0.0.tgz",
"integrity": "sha1-T5dqIl993fNJkvLK2CTJVDpG9Mg=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-5.0.1.tgz",
"integrity": "sha1-pKdK/H4gWNMLgmPrbWbarOn0J7o=",
"requires": {
"tslib": "1.8.0"
}
@ -168,55 +168,55 @@
}
},
"@angular/forms": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-5.0.0.tgz",
"integrity": "sha1-x/3fo1OWdZrphSkgowzdqMQe0d4=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-5.0.1.tgz",
"integrity": "sha1-afMDxME9o8qg3mNDdYg4i2rWKyE=",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/http": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/http/-/http-5.0.0.tgz",
"integrity": "sha1-Byiivgz7sHhyfF64fUyF1T/smlE=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/http/-/http-5.0.1.tgz",
"integrity": "sha1-NQy99jz6yJOWE9dT/wce1YpgVhs=",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/language-service": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-5.0.0.tgz",
"integrity": "sha1-bMu2n0dXJw3QTsWFfTdjSy8CxAw=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-5.0.1.tgz",
"integrity": "sha1-hp4J29bj2VwRfAYtId0f2SCtRNY=",
"dev": true
},
"@angular/material": {
"version": "2.0.0-beta.12",
"resolved": "https://registry.npmjs.org/@angular/material/-/material-2.0.0-beta.12.tgz",
"integrity": "sha1-cbbQt7AhiR5dDjaIwdS9eMdFf1g=",
"version": "5.0.0-rc0",
"resolved": "https://registry.npmjs.org/@angular/material/-/material-5.0.0-rc0.tgz",
"integrity": "sha512-ZW9gy3c8l2NbFfX9DRYSW+i67pPoL9DZoMCb16STQlhdDfwwAWNpjGF0etXkXw30hDnRCMGVVJVU+45cNXJspA==",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/platform-browser": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-5.0.0.tgz",
"integrity": "sha1-xwOPfN6AcFtiAUiXIx4YLuyXb+0=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-5.0.1.tgz",
"integrity": "sha1-FIld0w7Sow7nuZx2t2R0j0bBqGI=",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/platform-browser-dynamic": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-5.0.0.tgz",
"integrity": "sha1-iH4QbIsQOwQVz2FWpCXabYP0yJ0=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-5.0.1.tgz",
"integrity": "sha1-Fttn1S1FMVY6sVQpxr3+GLwb7cg=",
"requires": {
"tslib": "1.8.0"
}
},
"@angular/router": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-5.0.0.tgz",
"integrity": "sha1-/ktSGmc4QIvOMPk6U0mRQMk6T3Y=",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-5.0.1.tgz",
"integrity": "sha1-msCPKTAu9gzf08eBDZbCZd7EY9Y=",
"requires": {
"tslib": "1.8.0"
}
@ -268,9 +268,9 @@
"integrity": "sha512-918ksaRl8RvGWGOjpUCywTS1MnLTqHki53XXibyhZkmHGSP5yLkcArBAFhFLvtQTTbuX8KSz2WFKxwaJ3JuJFw=="
},
"@swimlane/ngx-datatable": {
"version": "10.4.0",
"resolved": "https://registry.npmjs.org/@swimlane/ngx-datatable/-/ngx-datatable-10.4.0.tgz",
"integrity": "sha512-wTV/64vEGPFlcpE+ezTN18baOsNXyfLLvdmhEoaDQt2OJtTKtNxJkze24w71utoJxutQRrfHJUVSkAF4CLNckA=="
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/@swimlane/ngx-datatable/-/ngx-datatable-11.0.3.tgz",
"integrity": "sha512-feJ9Ep0xddgC1IuNEqxWcTnoSPc3drzY+Bn27RFq+ztXYf3mHsLMxerMqFyVaLPnMrZKttZ7MX48gXzOkSVavw=="
},
"@types/jasmine": {
"version": "2.5.54",
@ -6425,9 +6425,9 @@
}
},
"moment": {
"version": "2.19.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.19.1.tgz",
"integrity": "sha1-VtoaLRy/AdOLfhr8McELz6GSkWc="
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.19.2.tgz",
"integrity": "sha512-Rf6jiHPEfxp9+dlzxPTmRHbvoFXsh2L/U8hOupUMpnuecHQmI6cF6lUbJl3QqKPko1u6ujO+FxtcajLVfLpAtA=="
},
"move-concurrently": {
"version": "1.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "fuse2",
"version": "1.2.0",
"version": "1.2.1",
"license": "",
"scripts": {
"ng": "ng",
@ -16,21 +16,21 @@
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.2",
"@angular/animations": "5.0.0",
"@angular/cdk": "2.0.0-beta.12",
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/core": "5.0.0",
"@angular/animations": "5.0.1",
"@angular/cdk": "5.0.0-rc0",
"@angular/common": "5.0.1",
"@angular/compiler": "5.0.1",
"@angular/core": "5.0.1",
"@angular/flex-layout": "2.0.0-beta.10",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/material": "2.0.0-beta.12",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@angular/router": "5.0.0",
"@angular/forms": "5.0.1",
"@angular/http": "5.0.1",
"@angular/material": "5.0.0-rc0",
"@angular/platform-browser": "5.0.1",
"@angular/platform-browser-dynamic": "5.0.1",
"@angular/router": "5.0.1",
"@ngx-translate/core": "8.0.0",
"@swimlane/ngx-charts": "6.1.0",
"@swimlane/ngx-datatable": "10.4.0",
"@swimlane/ngx-datatable": "11.0.3",
"@withinpixels/ngx-dnd": "3.1.0",
"angular-calendar": "0.21.3",
"angular-in-memory-web-api": "0.5.1",
@ -41,7 +41,7 @@
"hammerjs": "2.0.8",
"highlight.js": "9.12.0",
"intl": "1.2.5",
"moment": "2.19.1",
"moment": "2.19.2",
"ngx-color-picker": "4.4.0",
"ngx-cookie-service": "1.0.9",
"perfect-scrollbar": "1.0.3",
@ -51,8 +51,8 @@
},
"devDependencies": {
"@angular/cli": "1.5.0",
"@angular/compiler-cli": "5.0.0",
"@angular/language-service": "5.0.0",
"@angular/compiler-cli": "5.0.1",
"@angular/language-service": "5.0.1",
"@angularclass/hmr": "2.1.3",
"@types/jasmine": "2.5.54",
"@types/jasminewd2": "2.0.3",

View File

@ -2,7 +2,7 @@
type="button"
class="mat-elevation-z1"
[matMenuTriggerFor]="colorMenu"
(onMenuOpen)="onMenuOpen()"
(menuOpened)="onMenuOpen()"
[ngClass]="'mat-'+selectedPalette+'-'+selectedHue+'-bg'">
<mat-icon>palette</mat-icon>
</button>

View File

@ -26,7 +26,7 @@
</div>
<button mat-icon-button [matMenuTriggerFor]="addMenu" matTooltip="Click to add/remove shortcut"
(onMenuOpen)="onMenuOpen()">
(menuOpened)="onMenuOpen()">
<mat-icon class="amber-600-fg">star</mat-icon>
</button>

View File

@ -149,7 +149,9 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
onMenuOpen()
{
this.searchInputField.nativeElement.focus();
setTimeout(() => {
this.searchInputField.nativeElement.focus();
});
}
showMobileShortcutsPanel()

View File

@ -59,3 +59,8 @@ mat-sidenav-container {
width: 14px;
height: 7px;
}
// Fix: "Input underlines has wrong color opacity value"
.mat-form-field-underline {
background-color: rgba(0, 0, 0, 0.12);
}

View File

@ -4,7 +4,7 @@
<mat-toolbar>
<!-- TOOLBAR TOP -->
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<mat-toolbar-row fxLayout="row" fxLayoutAlign="space-between center">
<!-- USER AVATAR WRAPPER -->
<div class="avatar-wrapper">
@ -16,7 +16,8 @@
alt="{{user.name}}"/>
<!-- / USER AVATAR -->
<mat-icon class="s-16 status" [ngClass]="user.status" [matMenuTriggerFor]="userStatusMenu"></mat-icon>
<mat-icon class="s-16 status" [ngClass]="user.status"
[matMenuTriggerFor]="userStatusMenu"></mat-icon>
<!-- USER STATUS -->
<mat-menu id="user-status-menu" #userStatusMenu="matMenu">
@ -69,7 +70,8 @@
</button>
</mat-menu>
</div>
</div>
</mat-toolbar-row>
<!-- / TOOLBAR TOP -->
<!-- TOOLBAR BOTTOM -->

View File

@ -5,20 +5,19 @@
<mat-toolbar>
<!-- TOOLBAR TOP -->
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<mat-toolbar-row fxLayout="row" fxLayoutAlign="space-between center">
<button mat-button class="mat-icon-button" (click)="changeLeftSidenavView('chats')" aria-label="back">
<mat-icon>arrow_back</mat-icon>
</button>
</div>
</mat-toolbar-row>
<!-- / TOOLBAR TOP -->
<!-- TOOLBAR BOTTOM -->
<mat-toolbar-row class="toolbar-bottom" fxLayout="column" fxLayoutAlign="center center">
<img [src]="user.avatar" class="avatar user-avatar huge" alt="{{user.name}}"/>
<div class="user-name my-8">{{user.name}}</div>
</mat-toolbar-row>

View File

@ -5,7 +5,7 @@
<mat-toolbar>
<!-- TOOLBAR TOP -->
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<mat-toolbar-row fxLayout="row" fxLayoutAlign="space-between center">
<div>Contact Info</div>
@ -13,7 +13,7 @@
<mat-icon>close</mat-icon>
</button>
</div>
</mat-toolbar-row>
<!-- / TOOLBAR TOP -->
<!-- TOOLBAR BOTTOM -->
@ -37,9 +37,9 @@
<mat-card>
<mat-form-field fxFlex>
<textarea matInput placeholder="Mood" name="mood"
[value]="contact.mood" rows="3" disabled>
</textarea>
<textarea matInput placeholder="Mood" name="mood"
[value]="contact.mood" rows="3" disabled>
</textarea>
</mat-form-field>
</mat-card>

View File

@ -1,13 +1,13 @@
<div class="dialog-content-wrapper">
<mat-toolbar matDialogTitle class="mat-accent m-0">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<mat-toolbar-row fxLayout="row" fxLayoutAlign="space-between center">
<span class="title dialog-title">{{dialogTitle}}</span>
<button mat-button class="mat-icon-button"
(click)="dialogRef.close()"
aria-label="Close dialog">
<mat-icon>close</mat-icon>
</button>
</div>
</mat-toolbar-row>
<mat-toolbar-row class="toolbar-bottom py-8 py-sm-16" fxLayout="column" fxLayoutAlign="center center">
<img [src]="contact.avatar" class=" avatar contact-avatar huge"

View File

@ -1,4 +1,4 @@
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { ContactsService } from '../contacts.service';
import { Observable } from 'rxjs/Observable';
import { FuseContactsContactFormDialogComponent } from '../contact-form/contact-form.component';
@ -7,6 +7,7 @@ import { FuseConfirmDialogComponent } from '../../../../../core/components/confi
import { FormGroup } from '@angular/forms';
import { DataSource } from '@angular/cdk/collections';
import { fuseAnimations } from '../../../../../core/animations';
import { Subscription } from 'rxjs/Subscription';
@Component({
selector : 'fuse-contacts-contact-list',
@ -14,7 +15,7 @@ import { fuseAnimations } from '../../../../../core/animations';
styleUrls : ['./contact-list.component.scss'],
animations : fuseAnimations
})
export class FuseContactsContactListComponent implements OnInit
export class FuseContactsContactListComponent implements OnInit, OnDestroy
{
@ViewChild('dialogContent') dialogContent: TemplateRef<any>;
@ -25,6 +26,10 @@ export class FuseContactsContactListComponent implements OnInit
selectedContacts: any[];
checkboxes: {};
onContactsChangedSubscription: Subscription;
onSelectedContactsChangedSubscription: Subscription;
onUserDataChangedSubscription: Subscription;
dialogRef: any;
confirmDialogRef: MatDialogRef<FuseConfirmDialogComponent>;
@ -34,27 +39,30 @@ export class FuseContactsContactListComponent implements OnInit
public dialog: MatDialog
)
{
this.contactsService.onContactsChanged.subscribe(contacts => {
this.onContactsChangedSubscription =
this.contactsService.onContactsChanged.subscribe(contacts => {
this.contacts = contacts;
this.contacts = contacts;
this.checkboxes = {};
contacts.map(contact => {
this.checkboxes[contact.id] = false;
this.checkboxes = {};
contacts.map(contact => {
this.checkboxes[contact.id] = false;
});
});
});
this.contactsService.onSelectedContactsChanged.subscribe(selectedContacts => {
for ( const id in this.checkboxes )
{
this.checkboxes[id] = selectedContacts.includes(id);
}
this.selectedContacts = selectedContacts;
});
this.onSelectedContactsChangedSubscription =
this.contactsService.onSelectedContactsChanged.subscribe(selectedContacts => {
for ( const id in this.checkboxes )
{
this.checkboxes[id] = selectedContacts.includes(id);
}
this.selectedContacts = selectedContacts;
});
this.contactsService.onUserDataChanged.subscribe(user => {
this.user = user;
});
this.onUserDataChangedSubscription =
this.contactsService.onUserDataChanged.subscribe(user => {
this.user = user;
});
}
@ -63,6 +71,13 @@ export class FuseContactsContactListComponent implements OnInit
this.dataSource = new FilesDataSource(this.contactsService);
}
ngOnDestroy()
{
this.onContactsChangedSubscription.unsubscribe();
this.onSelectedContactsChangedSubscription.unsubscribe();
this.onUserDataChangedSubscription.unsubscribe();
}
editContact(contact)
{
this.dialogRef = this.dialog.open(FuseContactsContactFormDialogComponent, {

View File

@ -90,7 +90,7 @@
formControlName="categories">
<mat-chip *ngFor="let category of product.categories"
removable="true" (remove)="product.removeCategory(category)">
removable="true" (removed)="product.removeCategory(category)">
{{category}}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>
@ -109,7 +109,7 @@
formControlName="tags">
<mat-chip *ngFor="let tag of product.tags"
removable="true" (remove)="product.removeTag(tag)">
removable="true" (removed)="product.removeTag(tag)">
{{tag}}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>

View File

@ -71,7 +71,7 @@
<!-- CHECKLIST -->
<div class="due-date " fxFlex="0 1 auto">
<button mat-icon-button class="" [matMenuTriggerFor]="checklistMenu" #checklistMenuTrigger="matMenuTrigger" (onMenuOpen)="onChecklistMenuOpen()">
<button mat-icon-button class="" [matMenuTriggerFor]="checklistMenu" #checklistMenuTrigger="matMenuTrigger" (menuOpened)="onChecklistMenuOpen()">
<mat-icon>check_box</mat-icon>
</button>

View File

@ -20,6 +20,10 @@
.mat-form-field-flex {
align-items: center;
.mat-form-field-infix {
display: none;
}
.mat-input-element {
display: none;
}

View File

@ -48,12 +48,13 @@ export class FuseTodoDetailsComponent implements OnInit, OnDestroy
this.todoForm = this.createTodoForm();
this.onFormChange = this.todoForm.valueChanges
.debounceTime(500)
.distinctUntilChanged()
.subscribe(data => {
this.todoService.updateTodo(data);
});
this.onFormChange =
this.todoForm.valueChanges
.debounceTime(500)
.distinctUntilChanged()
.subscribe(data => {
this.todoService.updateTodo(data);
});
}
});
@ -65,15 +66,16 @@ export class FuseTodoDetailsComponent implements OnInit, OnDestroy
});
// Subscribe to update on tag change
this.onNewTodoClicked = this.todoService.onNewTodoClicked
.subscribe(() => {
this.todo = new Todo({});
this.todo.id = FuseUtils.generateGUID();
this.formType = 'new';
this.todoForm = this.createTodoForm();
this.focusTitleField();
this.todoService.onCurrentTodoChanged.next([this.todo, 'new']);
});
this.onNewTodoClicked =
this.todoService.onNewTodoClicked
.subscribe(() => {
this.todo = new Todo({});
this.todo.id = FuseUtils.generateGUID();
this.formType = 'new';
this.todoForm = this.createTodoForm();
this.focusTitleField();
this.todoService.onCurrentTodoChanged.next([this.todo, 'new']);
});
}
focusTitleField()

View File

@ -5,7 +5,7 @@
</mat-icon>
<mat-checkbox [(ngModel)]="selected" (ngModelChange)="onSelectedChange()"
class="mr-16" fxFlex="0 1 auto">
class="mr-16" fxFlex="0 1 auto" (click)="$event.stopPropagation()">
</mat-checkbox>
<div fxLayout="row" fxLayoutAlign="start center" fxFlex>

View File

@ -1,7 +1,9 @@
<div class="dialog-content-wrapper">
<mat-toolbar matDialogTitle class="mat-accent m-0">
<span class="title dialog-title">{{data.article.title}}</span>
<mat-toolbar-row>
<span class="title dialog-title">{{data.article.title}}</span>
</mat-toolbar-row>
</mat-toolbar>
<div mat-dialog-content class="p-24 m-0" fusePerfectScrollbar>

View File

@ -25,7 +25,7 @@
<!-- CONTENT -->
<div class="content">
<mat-tab-group class="color-tabs" dynamicHeight="true" (selectChange)="selectColor($event)">
<mat-tab-group class="color-tabs" dynamicHeight="true" (selectedTabChange)="selectColor($event)">
<mat-tab *ngFor="let color of ['primary', 'accent', 'warn']" label="{{color}}">
<ng-template mat-tab-label>