diff --git a/demo-shell/resources/i18n/en.json b/demo-shell/resources/i18n/en.json
index fb92745f4f..624568b65b 100644
--- a/demo-shell/resources/i18n/en.json
+++ b/demo-shell/resources/i18n/en.json
@@ -55,6 +55,7 @@
"NODE-SELECTOR": "Node Selector",
"CONTENT_SERVICES": "Content Services",
"BREADCRUMB": "Breadcrumb",
+ "CARD_VIEW": "CardView",
"PROCESS_SERVICES": "Process Services",
"LOGIN": "Login",
"CUSTOM_SOURCES": "Custom Sources",
diff --git a/demo-shell/src/app/app.module.ts b/demo-shell/src/app/app.module.ts
index 186a552d28..65e7be4ced 100644
--- a/demo-shell/src/app/app.module.ts
+++ b/demo-shell/src/app/app.module.ts
@@ -55,6 +55,7 @@ import { BreadcrumbDemoComponent } from './components/breadcrumb-demo/breadcrumb
import { ContentNodeSelectorComponent } from './components/content-node-selector/content-node-selector.component';
import { NotificationsComponent } from './components/notifications/notifications.component';
import { ReportIssueComponent } from './components/report-issue/report-issue.component';
+import { CardViewComponent } from './components/card-view/card-view.component';
@NgModule({
imports: [
@@ -109,6 +110,7 @@ import { ReportIssueComponent } from './components/report-issue/report-issue.com
BlobPreviewComponent,
BreadcrumbDemoComponent,
NotificationsComponent,
+ CardViewComponent,
ContentNodeSelectorComponent,
ReportIssueComponent
],
diff --git a/demo-shell/src/app/app.routes.ts b/demo-shell/src/app/app.routes.ts
index bbf9f89188..cc77d65e77 100644
--- a/demo-shell/src/app/app.routes.ts
+++ b/demo-shell/src/app/app.routes.ts
@@ -50,6 +50,7 @@ import { DemoPermissionComponent } from './components/permissions/demo-permissio
import { BlobPreviewComponent } from './components/blob-preview/blob-preview.component';
import { BreadcrumbDemoComponent } from './components/breadcrumb-demo/breadcrumb-demo.component';
import { NotificationsComponent } from './components/notifications/notifications.component';
+import { CardViewComponent } from './components/card-view/card-view.component';
import { ContentNodeSelectorComponent } from './components/content-node-selector/content-node-selector.component';
import { ReportIssueComponent } from './components/report-issue/report-issue.component';
@@ -75,6 +76,16 @@ export const appRoutes: Routes = [
}
]
},
+ {
+ path: 'card-view',
+ component: AppLayoutComponent ,
+ children: [
+ {
+ path: '',
+ component: CardViewComponent
+ }
+ ]
+ },
{
path: '',
component: AppLayoutComponent,
diff --git a/demo-shell/src/app/components/app-layout/app-layout.component.ts b/demo-shell/src/app/components/app-layout/app-layout.component.ts
index b8301c234c..b5523c44c8 100644
--- a/demo-shell/src/app/components/app-layout/app-layout.component.ts
+++ b/demo-shell/src/app/components/app-layout/app-layout.component.ts
@@ -34,6 +34,7 @@ export class AppLayoutComponent implements OnInit {
{ href: '/files', icon: 'folder_open', title: 'APP_LAYOUT.CONTENT_SERVICES' },
{ href: '/breadcrumb', icon: 'label', title: 'APP_LAYOUT.BREADCRUMB' },
{ href: '/notifications', icon: 'alarm', title: 'APP_LAYOUT.NOTIFICATIONS'},
+ { href: '/card-view', icon: 'view_headline', title: 'APP_LAYOUT.CARD_VIEW'},
{ href: '/node-selector', icon: 'attachment', title: 'APP_LAYOUT.NODE-SELECTOR' },
{ href: '/activiti', icon: 'device_hub', title: 'APP_LAYOUT.PROCESS_SERVICES' },
{ href: '/login', icon: 'vpn_key', title: 'APP_LAYOUT.LOGIN' },
diff --git a/demo-shell/src/app/components/card-view/card-view.component.html b/demo-shell/src/app/components/card-view/card-view.component.html
new file mode 100644
index 0000000000..253a467f2c
--- /dev/null
+++ b/demo-shell/src/app/components/card-view/card-view.component.html
@@ -0,0 +1,16 @@
+
+
CardView Component
+
+
+
+
+
+
+
+
Changes log:
+
{{ log }}
+
+
+
diff --git a/demo-shell/src/app/components/card-view/card-view.component.scss b/demo-shell/src/app/components/card-view/card-view.component.scss
new file mode 100644
index 0000000000..04be8c427f
--- /dev/null
+++ b/demo-shell/src/app/components/card-view/card-view.component.scss
@@ -0,0 +1,28 @@
+.main-content {
+ padding: 0 15px;
+}
+
+.card-view {
+ width: 30%;
+ display: inline-block;
+}
+
+.console {
+ width: 60%;
+ display: inline-block;
+ vertical-align: top;
+ margin-left: 10px;
+ height: 500px;
+ overflow: scroll;
+ padding-bottom: 30px;
+
+ h3 {
+ margin-top: 0;
+ }
+
+ p {
+ display: block;
+ font-family: monospace, monospace;
+ margin: 0;
+ }
+}
\ No newline at end of file
diff --git a/demo-shell/src/app/components/card-view/card-view.component.ts b/demo-shell/src/app/components/card-view/card-view.component.ts
new file mode 100644
index 0000000000..810129d334
--- /dev/null
+++ b/demo-shell/src/app/components/card-view/card-view.component.ts
@@ -0,0 +1,123 @@
+/*!
+ * @license
+ * Copyright 2016 Alfresco Software, Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
+import {
+ CardViewTextItemModel,
+ CardViewDateItemModel,
+ CardViewDatetimeItemModel,
+ CardViewBoolItemModel,
+ CardViewIntItemModel,
+ CardViewFloatItemModel,
+ CardViewKeyValuePairsItemModel,
+ CardViewSelectItemModel,
+ CardViewUpdateService,
+ UpdateNotification
+} from '@alfresco/adf-core';
+import { of } from 'rxjs/observable/of';
+
+@Component({
+ templateUrl: './card-view.component.html',
+ styleUrls: ['./card-view.component.scss']
+})
+export class CardViewComponent implements OnInit {
+
+ @ViewChild('console') console: ElementRef;
+
+ properties: any;
+ logs: string[];
+
+ constructor(private cardViewUpdateService: CardViewUpdateService) {
+ this.logs = [];
+ this.properties = [
+ new CardViewTextItemModel({
+ label: 'CardView Text Item',
+ value: 'Spock',
+ key: 'name',
+ default: 'default bar' ,
+ multiline: false,
+ icon: 'icon',
+ editable: true
+ }),
+ new CardViewDateItemModel({
+ label: 'CardView Date Item',
+ value: new Date(),
+ key: 'date-of-birth',
+ default: new Date(),
+ format: 'DD.MM.YYYY',
+ editable: true
+ }),
+ new CardViewDatetimeItemModel({
+ label: 'CardView Datetime Item',
+ value: new Date(),
+ key: 'datetime-of-birth',
+ default: new Date(),
+ format: 'DD.MM.YYYY',
+ editable: true
+ }),
+ new CardViewBoolItemModel({
+ label: 'CardView Boolean Item',
+ value: true,
+ key: 'vulcanian',
+ default: false,
+ editable: true
+ }),
+ new CardViewIntItemModel({
+ label: 'CardView Int Item',
+ value: 213,
+ key: 'intelligence',
+ default: 1,
+ editable: true
+ }),
+ new CardViewFloatItemModel({
+ label: 'CardView Float Item',
+ value: 9.9,
+ key: 'mental-stability',
+ default: 0.0,
+ editable: true
+ }),
+ new CardViewKeyValuePairsItemModel({
+ label: 'CardView Key-Value Pairs Item',
+ value: [],
+ key: 'key-value-pairs',
+ editable: true
+ }),
+ new CardViewSelectItemModel({
+ label: 'CardView Select Item',
+ value: 'one',
+ options$: of([{ key: 'one', label: 'One' }, { key: 'two', label: 'Two' }]),
+ key: 'select',
+ editable: true
+ })
+ ];
+ }
+
+ ngOnInit() {
+ this.cardViewUpdateService.itemUpdated$.subscribe(this.onItemChange.bind(this));
+ }
+
+ onItemChange(notification: UpdateNotification) {
+ let value = notification.changed[notification.target.key];
+
+ if (notification.target.type === 'keyvaluepairs') {
+ value = JSON.stringify(value);
+ }
+
+ this.logs.push(`[${notification.target.label}] - ${value}`);
+ this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
+ }
+}
diff --git a/lib/core/card-view/components/card-view-selectitem/card-view-selectitem.component.scss b/lib/core/card-view/components/card-view-selectitem/card-view-selectitem.component.scss
new file mode 100644
index 0000000000..f3797bccfd
--- /dev/null
+++ b/lib/core/card-view/components/card-view-selectitem/card-view-selectitem.component.scss
@@ -0,0 +1,3 @@
+.mat-form-field-type-mat-select {
+ width: 100%;
+}
\ No newline at end of file
diff --git a/lib/core/card-view/components/card-view-selectitem/card-view-selectitem.component.ts b/lib/core/card-view/components/card-view-selectitem/card-view-selectitem.component.ts
index 87a080a658..64cf0169f6 100644
--- a/lib/core/card-view/components/card-view-selectitem/card-view-selectitem.component.ts
+++ b/lib/core/card-view/components/card-view-selectitem/card-view-selectitem.component.ts
@@ -24,7 +24,8 @@ import { MatSelectChange } from '@angular/material';
@Component({
selector: 'adf-card-view-selectitem',
- templateUrl: './card-view-selectitem.component.html'
+ templateUrl: './card-view-selectitem.component.html',
+ styleUrls: ['./card-view-selectitem.component.scss']
})
export class CardViewSelectItemComponent implements OnChanges {
@Input() property: CardViewSelectItemModel;