@angular2-material/grid-list
Advanced tools
+77
-14
| { | ||
| "name": "@angular2-material/grid-list", | ||
| "version": "2.0.0-alpha.8-2", | ||
| "_args": [ | ||
| [ | ||
| { | ||
| "raw": "@angular2-material/grid-list", | ||
| "scope": "@angular2-material", | ||
| "escapedName": "@angular2-material%2fgrid-list", | ||
| "name": "@angular2-material/grid-list", | ||
| "rawSpec": "", | ||
| "spec": "latest", | ||
| "type": "tag" | ||
| }, | ||
| "/private/tmp/old-packages" | ||
| ] | ||
| ], | ||
| "_from": "@angular2-material/grid-list@latest", | ||
| "_id": "@angular2-material/grid-list@2.0.0-alpha.8-3", | ||
| "_inCache": true, | ||
| "_installable": true, | ||
| "_location": "/@angular2-material/grid-list", | ||
| "_nodeVersion": "5.7.0", | ||
| "_npmOperationalInternal": { | ||
| "host": "packages-16-east.internal.npmjs.com", | ||
| "tmp": "tmp/grid-list-2.0.0-alpha.8-3.tgz_1473988787187_0.4211394365411252" | ||
| }, | ||
| "_npmUser": { | ||
| "name": "angular2-material", | ||
| "email": "angular-core+npm@google.com" | ||
| }, | ||
| "_npmVersion": "3.7.5", | ||
| "_phantomChildren": {}, | ||
| "_requested": { | ||
| "raw": "@angular2-material/grid-list", | ||
| "scope": "@angular2-material", | ||
| "escapedName": "@angular2-material%2fgrid-list", | ||
| "name": "@angular2-material/grid-list", | ||
| "rawSpec": "", | ||
| "spec": "latest", | ||
| "type": "tag" | ||
| }, | ||
| "_requiredBy": [ | ||
| "#USER" | ||
| ], | ||
| "_resolved": "https://registry.npmjs.org/@angular2-material/grid-list/-/grid-list-2.0.0-alpha.8-3.tgz", | ||
| "_shasum": "92291eb658055cd77e811906f8fabb9932911176", | ||
| "_shrinkwrap": null, | ||
| "_spec": "@angular2-material/grid-list", | ||
| "_where": "/private/tmp/old-packages", | ||
| "bugs": { | ||
| "url": "https://github.com/angular/material2/issues" | ||
| }, | ||
| "dependencies": {}, | ||
| "description": "Angular 2 Material grid list", | ||
| "main": "./grid-list.umd.js", | ||
| "module": "./index.js", | ||
| "typings": "./index.d.ts", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/angular/material2.git" | ||
| "devDependencies": {}, | ||
| "directories": {}, | ||
| "dist": { | ||
| "shasum": "92291eb658055cd77e811906f8fabb9932911176", | ||
| "tarball": "https://registry.npmjs.org/@angular2-material/grid-list/-/grid-list-2.0.0-alpha.8-3.tgz" | ||
| }, | ||
| "homepage": "https://github.com/angular/material2#readme", | ||
| "keywords": [ | ||
@@ -22,9 +71,23 @@ "angular", | ||
| "license": "MIT", | ||
| "bugs": { | ||
| "url": "https://github.com/angular/material2/issues" | ||
| "main": "./grid-list.umd.js", | ||
| "maintainers": [ | ||
| { | ||
| "name": "angular2-material", | ||
| "email": "angular-core+npm@google.com" | ||
| } | ||
| ], | ||
| "module": "./index.js", | ||
| "name": "@angular2-material/grid-list", | ||
| "optionalDependencies": {}, | ||
| "peerDependencies": { | ||
| "@angular2-material/core": "2.0.0-alpha.8-3" | ||
| }, | ||
| "homepage": "https://github.com/angular/material2#readme", | ||
| "peerDependencies": { | ||
| "@angular2-material/core": "2.0.0-alpha.8-2" | ||
| } | ||
| "readme": "ERROR: No README data found!", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/angular/material2.git" | ||
| }, | ||
| "scripts": {}, | ||
| "typings": "./index.d.ts", | ||
| "version": "2.0.0-alpha.8-3" | ||
| } |
+5
-118
@@ -1,118 +0,5 @@ | ||
| # md-grid-list | ||
| `md-grid-list` is an alternative list view that arranges cells into grid-based layout. | ||
| See Material Design spec [here](https://www.google.com/design/spec/components/grid-lists.html). | ||
| ## Usage | ||
| ### Simple grid list | ||
| To use `md-grid-list`, import the MdGridList module into your application's NgModule: | ||
| *my-app-module.ts* | ||
| ```ts | ||
| import {MdGridListModule} from '@angular2-material/gridlist/gridlist'; | ||
| @NgModule({ | ||
| imports: [MdGridListModule], | ||
| ... | ||
| }) | ||
| export class MyAppModule {} | ||
| ``` | ||
| In your template, create an `md-grid-list` element and specify the number of columns you want for | ||
| your grid using the `cols` property (this is the only mandatory attribute). | ||
| You can define each tile using an `md-grid-tile` element, passing any tile content between its tags. | ||
| Tiles are greedily placed in the first position of the grid that fits them, so row count depends on | ||
| how many tiles can fit in each row, given the col count and the colspan/rowspan of each tile. | ||
| ```html | ||
| <md-grid-list cols="4" [style.background]="'lightblue'"> | ||
| <md-grid-tile>One</md-grid-tile> | ||
| <md-grid-tile>Two</md-grid-tile> | ||
| <md-grid-tile>Three</md-grid-tile> | ||
| <md-grid-tile>Four</md-grid-tile> | ||
| </md-grid-list> | ||
| ``` | ||
| Output: | ||
| <img src="https://material.angularjs.org/material2_assets/grid-list/basic-grid-list.png"> | ||
| ## Grid list config | ||
| ####`cols` | ||
| The `cols` property controls the number of columns displayed in your grid. It must be set or the | ||
| grid list will not be able to generate your layout. | ||
| Ex: `<md-grid-list cols="3">...` | ||
| Default: There is no reasonable default value for this, so if it is unspecified, the grid list will | ||
| throw an error. | ||
| ####`rowHeight` | ||
| Row height for the list can be calculated in three ways: | ||
| 1. **Fixed height**: The height can be in `px`, `em`, or `rem`. If no units are specified, `px` | ||
| units are assumed. | ||
| Ex: `<md-grid-list cols="3" rowHeight="100px">...` | ||
| 2. **Ratio**: This ratio is width:height, and must be passed in with a colon, not a decimal. | ||
| Ex: `<md-grid-list cols="3" rowHeight="4:3">...`. | ||
| 3. **Fit**: This mode automatically divides the available height by the number of rows. Please note | ||
| the height of the grid-list or its container must be set. | ||
| Ex: `<md-grid-list cols="3" rowHeight="fit">...` | ||
| Defaults to a 1:1 ratio of width:height. | ||
| ####`gutterSize` | ||
| Gutter size can be set to any `px`, `em`, or `rem` value with the `gutterSize` property. If no | ||
| units are specified, `px` units are assumed. | ||
| Ex: `<md-grid-list cols="3" gutterSize="4px">...` | ||
| Defaults to `1px`. | ||
| ## Grid tile config | ||
| You can set the rowspan and colspan of each tile individually, using the `rowspan` and `colspan` | ||
| properties. If not set, they both default to `1`. | ||
| ```html | ||
| <md-grid-list cols="4" rowHeight="100px"> | ||
| <md-grid-tile *ngFor="let tile of tiles" [colspan]="tile.cols" [rowspan]="tile.rows" | ||
| [style.background]="tile.color"> | ||
| {{tile.text}} | ||
| </md-grid-tile> | ||
| </md-grid-list> | ||
| ``` | ||
| ```javascript | ||
| ... | ||
| export class MyComp { | ||
| tiles: any[] = [ | ||
| {text: 'One', cols: 3, rows: 1, color: 'lightblue'}, | ||
| {text: 'Two', cols: 1, rows: 2, color: 'lightgreen'}, | ||
| {text: 'Three', cols: 1, rows: 1, color: 'lightpink'}, | ||
| {text: 'Four', cols: 2, rows: 1, color: '#DDBDF1'}, | ||
| ]; | ||
| } | ||
| ``` | ||
| Output: | ||
| <img src="https://material.angularjs.org/material2_assets/grid-list/fancy-grid-list.png"> | ||
| ## TODO | ||
| - Grid tile headers and footers | ||
| - Responsive sizing support | ||
| This package was used early in the pre-release development cycle of Angular Material v2, but has no | ||
| longer been used since September of 2016. Development of Angular Material now occurs under scoped | ||
| npm package @angular/material. Visit https://material.angular.io for the latest information and | ||
| instructions for using Angular Material or check out the latest source code | ||
| from https://github.com/angular/material2. |
132462
-0.84%6
-94.96%