diff --git a/demo-shell-ng2/app/components/files/files.component.css b/demo-shell-ng2/app/components/files/files.component.css new file mode 100644 index 0000000000..b7c0943425 --- /dev/null +++ b/demo-shell-ng2/app/components/files/files.component.css @@ -0,0 +1,17 @@ +/* small desktop */ +@media all and (max-width: 1200px) {} + +/* tablet */ +@media all and (max-width: 1024px) {} + + /* mobile phone */ +@media all and (max-width: 768px) { + + alfresco-document-list >>> th.desktop-only .cell-value { + display: none; + } + + alfresco-document-list >>> td.desktop-only .cell-value { + display: none; + } +} diff --git a/demo-shell-ng2/app/components/files/files.component.html b/demo-shell-ng2/app/components/files/files.component.html index 9d4c45d1a2..d6e89f92a3 100644 --- a/demo-shell-ng2/app/components/files/files.component.html +++ b/demo-shell-ng2/app/components/files/files.component.html @@ -31,13 +31,15 @@ --> + source="createdByUser.displayName" + class="desktop-only"> + format="medium" + class="desktop-only"> diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts index ff0569c166..7fea80212a 100644 --- a/demo-shell-ng2/app/components/files/files.component.ts +++ b/demo-shell-ng2/app/components/files/files.component.ts @@ -36,6 +36,7 @@ declare let __moduleName: string; moduleId: __moduleName, selector: 'files-component', templateUrl: './files.component.html', + styleUrls: ['./files.component.css'], directives: [ DOCUMENT_LIST_DIRECTIVES, MDL, diff --git a/ng2-components/ng2-alfresco-documentlist/README.md b/ng2-components/ng2-alfresco-documentlist/README.md index 425e2930ca..64eadcbdc5 100644 --- a/ng2-components/ng2-alfresco-documentlist/README.md +++ b/ng2-components/ng2-alfresco-documentlist/README.md @@ -519,6 +519,64 @@ export class MyView { ## Advanced usage and customization +### Hiding columns on small screens + +You can hide columns on small screens by means of custom CSS rules: + +```css +@media all and (max-width: 768px) { + + alfresco-document-list >>> th.desktop-only .cell-value { + display: none; + } + + alfresco-document-list >>> td.desktop-only .cell-value { + display: none; + } +} +``` + +Now you can declare columns and assign `desktop-only` class where needed: + +```html + + + + + + + + + + + + + + + + + +``` + +**Desktop View** + +![Responsive Desktop](docs/assets/responsive-desktop.png) + +**Mobile View** + +![Responsive Mobile](docs/assets/responsive-mobile.png) + ### Custom 'empty folder' template By default Document List provides the following content for the empty folder: @@ -628,19 +686,19 @@ npm install npm run build ``` -##Build the files and keep watching for changes +### Build the files and keep watching for changes - ```sh - $ npm run build:w - ``` +```sh +$ npm run build:w +``` -## Running unit tests +### Running unit tests ```sh npm test ``` -## Running unit tests in browser +### Running unit tests in browser ```sh npm test-browser @@ -649,7 +707,7 @@ npm test-browser This task rebuilds all the code, runs tslint, license checks and other quality check tools before performing unit testing. -## Code coverage +### Code coverage ```sh npm run coverage diff --git a/ng2-components/ng2-alfresco-documentlist/docs/assets/responsive-desktop.png b/ng2-components/ng2-alfresco-documentlist/docs/assets/responsive-desktop.png new file mode 100644 index 0000000000..ce57f0fc77 Binary files /dev/null and b/ng2-components/ng2-alfresco-documentlist/docs/assets/responsive-desktop.png differ diff --git a/ng2-components/ng2-alfresco-documentlist/docs/assets/responsive-mobile.png b/ng2-components/ng2-alfresco-documentlist/docs/assets/responsive-mobile.png new file mode 100644 index 0000000000..bf926dab4e Binary files /dev/null and b/ng2-components/ng2-alfresco-documentlist/docs/assets/responsive-mobile.png differ diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html index 99a60072ec..539323c6b7 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html @@ -15,8 +15,8 @@ [class.mdl-data-table__header--sorted-ascending]="sorting.key === col.source && sorting.direction === 'asc'" [class.mdl-data-table__header--sorted-descending]="sorting.key === col.source && sorting.direction === 'desc'" (click)="onColumnHeaderClick(col)"> - {{col.srTitle}} - {{col.title}} + {{col.srTitle}} + {{col.title}}