-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
255 additions
and
120 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<input #inputValue autocomplete="off" class="mat-input-element mat-form-field-autofill-control" [attr.id]='id' | ||
<input #inputValue autocomplete="off" | ||
class="mat-mdc-input-element mat-mdc-form-field-input-control mdc-text-field__input" [attr.id]='id' | ||
[attr.placeholder]='placeholder' [disabled]='disabled' [required]='required' [attr.readonly]='readonly || null' | ||
[attr.aria-describedby]='_ariaDescribedby || null' [attr.aria-invalid]='errorState' | ||
[attr.aria-required]='required.toString()'> | ||
<div class="mat-form-field-suffix"> | ||
<button matSuffix mat-icon-button [color]="color" class="button-browse" (click)="openFilePicker($event)" type="button" | ||
[disabled]="disabled"> | ||
<div class="mat-mdc-form-field-suffix"> | ||
<button matSuffix mat-icon-button [color]="color" class="button-browse" (click)="openFilePicker($event)" type="button" | ||
[disabled]="disabled"> | ||
<mat-icon *ngIf="!_customIcon" class="ngx-mat-file-input--default-icon">attach_file</mat-icon> | ||
<ng-content select="[ngxMatFileInputIcon]"></ng-content> | ||
</button> | ||
</div> | ||
<input type="file" #inputFile (change)="handleFiles($event.target.files)" class="input-file" | ||
[multiple]="multiple" [accept]="accept"> | ||
<input type="file" #inputFile (change)="handleFiles($event.target.files)" class="input-file" [multiple]="multiple" | ||
[accept]="accept"> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,58 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { BreakpointObserver, Breakpoints } from "@angular/cdk/layout"; | ||
import { Component, OnDestroy, OnInit } from '@angular/core'; | ||
import { Subject } from 'rxjs'; | ||
import { takeUntil } from 'rxjs/operators'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'] | ||
}) | ||
export class AppComponent implements OnInit { | ||
export class AppComponent implements OnInit, OnDestroy { | ||
|
||
public nameApp = 'angular-material-components'; | ||
|
||
constructor() { | ||
isHandset: boolean; | ||
sidenavMode: 'side' | 'over' | 'push'; | ||
sidenavHasBackdrop: boolean; | ||
sidenavOpened: boolean; | ||
|
||
|
||
protected _destroyed = new Subject<void>(); | ||
|
||
constructor( | ||
protected breakpointObserver: BreakpointObserver | ||
) { | ||
this.breakpointObserver.observe([Breakpoints.XSmall]) | ||
.pipe(takeUntil(this._destroyed)) | ||
.subscribe(resp => { | ||
this.isHandset = resp?.matches; | ||
if (this.isHandset) { | ||
this.activateHandsetLayout(); | ||
} else { | ||
this.activateWebLayout(); | ||
} | ||
}) | ||
} | ||
|
||
ngOnInit() { | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this._destroyed.next(); | ||
this._destroyed.complete(); | ||
} | ||
|
||
protected activateHandsetLayout() { | ||
this.sidenavMode = 'over'; | ||
this.sidenavHasBackdrop = true; | ||
this.sidenavOpened = false; | ||
} | ||
|
||
protected activateWebLayout() { | ||
this.sidenavMode = 'side'; | ||
this.sidenavHasBackdrop = false; | ||
this.sidenavOpened = true; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
.row { | ||
display: block; | ||
padding: 5px; | ||
max-width: 200px; | ||
} | ||
} |
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
Oops, something went wrong.