Skip to content

Commit

Permalink
Rewritten; Upgrade to Angular 6
Browse files Browse the repository at this point in the history
  • Loading branch information
freemanlam committed Jul 31, 2018
1 parent 758b48c commit c6899c8
Show file tree
Hide file tree
Showing 34 changed files with 1,937 additions and 1,702 deletions.
36 changes: 0 additions & 36 deletions .angular-cli.json

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ Angular Material grid list with responsive columns to show data in grid or list.
[https://freemanlam.github.io/ng-mat-responsive-grid-list/](https://freemanlam.github.io/ng-mat-responsive-grid-list/)

## Dependencies
- Angular 5.2.4
- Angular 6.1
- @angular/material
- @angular/flex-layout

## Demo
```yarn start```

## Build and Use
This package is not in npm registry.

Run ```yarn build``` then ```yarn add {relative-path}/ng-mat-responsive-grid-list/dist/ng-mat-responsive-grid-list-v0.0.2.tgz``` in your project.
Run ```yarn build``` then ```yarn add {relative-path}/ng-mat-responsive-grid-list/dist/ng-mat-responsive-grid-list-v0.0.4.tgz``` in your project.
89 changes: 89 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-mat-responsive-grid-list": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ng-mat-responsive-grid-list:build"
},
"configurations": {
"production": {
"browserTarget": "ng-mat-responsive-grid-list:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ng-mat-responsive-grid-list:build"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json"
],
"exclude": []
}
}
}
},
"ng-mat-responsive-grid-list-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application"
}
},
"defaultProject": "ng-mat-responsive-grid-list",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
Binary file added build/ng-mat-responsive-grid-list-v0.0.4.tgz
Binary file not shown.
35 changes: 6 additions & 29 deletions docs/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

@angular/[email protected]
MIT
MIT
[email protected]
Apache-2.0
Apache-2.0

[email protected].20
[email protected].26
MIT
The MIT License

Copyright (c) 2016 Google, Inc.
Copyright (c) 2016-2018 Google, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -46,27 +46,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

[email protected]
MIT
Copyright JS Foundation and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE.
14 changes: 13 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><base href="https://freemanlam.github.io/ng-mat-responsive-grid-list/"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ng-mat-responsive-grid-list</title><link href="styles.40589b27a2c09aceab7a.bundle.css" rel="stylesheet"/></head><body><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet"><my-app>loading</my-app><script type="text/javascript" src="inline.819722cc768433b73f57.bundle.js"></script><script type="text/javascript" src="polyfills.80803065a9afeab23d18.bundle.js"></script><script type="text/javascript" src="main.c95c8b7d34944fb68adf.bundle.js"></script></body></html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="https://freemanlam.github.io/ng-mat-responsive-grid-list/">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>ng-mat-responsive-grid-list</title>
<link rel="stylesheet" href="styles.7cfb866f4abff27d4173.css"></head>
<body>
<app-root>loading</app-root>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.0d4c0c4103fc6009e87b.js"></script><script type="text/javascript" src="main.da18d012bec64eca8c8c.js"></script></body>
</html>
1 change: 0 additions & 1 deletion docs/inline.819722cc768433b73f57.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.c95c8b7d34944fb68adf.bundle.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/main.da18d012bec64eca8c8c.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/polyfills.0d4c0c4103fc6009e87b.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/polyfills.80803065a9afeab23d18.bundle.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/runtime.a66f828dca56eeb90e02.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docs/styles.40589b27a2c09aceab7a.bundle.css

This file was deleted.

1 change: 1 addition & 0 deletions docs/styles.7cfb866f4abff27d4173.css

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"name": "ng-mat-responsive-grid-list",
"description": "",
"version": "0.0.3",
"version": "0.0.4",
"license": "MIT",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"start": "ng serve --aot",
"build:demo": "ng build --prod --output-path ./docs --base-href \"https://freemanlam.github.io/ng-mat-responsive-grid-list/\"",
"build:lib": "yarn packagr && cd dist && yarn pack",
"packagr": "ng-packagr -p ./src/lib/ng-package.json"
},
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/cdk": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/flex-layout": "2.0.0-beta.12",
"@angular/forms": "^5.2.4",
"@angular/material": "5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/animations": "^6.1.0",
"@angular/cdk": "^6.0.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/material": "^6.0.0",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"core-js": "^2.4.1",
"rxjs": "^5.5.6",
"rxjs": "^6.2.2",
"web-animations-js": "2.3.1",
"zone.js": "^0.8.19"
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/cli": "1.6.6",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@angular-devkit/build-angular": "~0.7.0",
"@angular/cli": "^6.1.1",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/node": "~6.0.60",
"codelyzer": "~4.0.1",
"ng-packagr": "^2.0.0",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
"typescript": "~2.9.2"
}
}
45 changes: 18 additions & 27 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
<mat-toolbar color="primary">
<span>Angular Material Responsive Grid List</span>
<span>Angular Material Grid List Responsive</span>
<span class="example-spacer"></span>
<a mat-button target="_blank" rel="noopener" href="https://github.com/freemanlam/ng-mat-responsive-grid-list">Github</a>
</mat-toolbar>

<div class="content">
Cols: {{cols}}
<button mat-button type="button" (click)="isGrid = !isGrid">isGrid = {{isGrid}}</button>
<p class="mat-body">Cols: {{cols}}</p>

<grid-list [grid]="isGrid" [data]="[1,2,3,4,5]" (colsChange)="cols = $event" [gutterSize]="'8px'">
<ng-template #itemTpl let-item="item">
<grid-list-item icon="folder" [name]="item" (onClick)="onItemClick(item)">
<button mat-icon-button [matMenuTriggerFor]="menu">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu" xPosition="before" overlapTrigger="false">
<button mat-menu-item (click)="doAction('A', item)">
<mat-icon>dialpad</mat-icon>
<span>Redial</span>
</button>
<button mat-menu-item (click)="doAction('B', item)" disabled>
<mat-icon>voicemail</mat-icon>
<span>Check voicemail</span>
</button>
<button mat-menu-item (click)="doAction('C', item)">
<mat-icon>notifications_off</mat-icon>
<span>Disable alerts</span>
</button>
</mat-menu>
</grid-list-item>
</ng-template>
</grid-list>
</div>
<mat-slide-toggle [checked]="responsive"
(change)="responsive = !responsive">
Responsive
</mat-slide-toggle>

<mat-grid-list
[responsive]="responsive"
(responsiveColsChange)="cols = $event">
<mat-grid-tile style="background:red">1</mat-grid-tile>
<mat-grid-tile style="background: orange">2</mat-grid-tile>
<mat-grid-tile style="background: yellow">3</mat-grid-tile>
<mat-grid-tile style="background: green">4</mat-grid-tile>
<mat-grid-tile style="background: cyan">5</mat-grid-tile>
<mat-grid-tile style="background: blue">6</mat-grid-tile>
</mat-grid-list>
</div>
4 changes: 0 additions & 4 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
padding: 1em;
}

.example-icon {
padding: 0 14px;
}

.example-spacer {
flex: 1 1 auto;
}
20 changes: 11 additions & 9 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { Component } from '@angular/core';

@Component({
selector: 'my-app',
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
isGrid = true;
cols: number;

onItemClick(item: string) {
console.debug(`onItemClick: ${item}`);
}
folders = [
{ name: 'Folder 1', link: '#1' },
{ name: 'Folder 2', link: '#2' },
{ name: 'Folder 3', link: '#3' },
{ name: 'Folder 4', link: '#4' },
{ name: 'Folder 5', link: '#5' }
];

responsive = true;
cols = 1;

doAction(action: string, value: any) {
console.debug(`action ${action}: ${value}`);
}
}
Loading

0 comments on commit c6899c8

Please sign in to comment.