#486 display value widget support

This commit is contained in:
Denys Vuika
2016-07-27 15:35:41 +01:00
parent 38faf19ffe
commit 999f0f0f8b
6 changed files with 51 additions and 1 deletions

View File

@@ -37,6 +37,9 @@
<div *ngSwitchCase="'radio-buttons'">
<radio-buttons-widget [field]="field"></radio-buttons-widget>
</div>
<div *ngSwitchCase="'readonly'">
<display-value-widget [field]="field"></display-value-widget>
</div>
<div *ngSwitchDefault>
<span>UNKNOWN WIDGET TYPE: {{field.type}}</span>
</div>

View File

@@ -26,6 +26,7 @@ import { MultilineTextWidget } from './../multiline-text/multiline-text.widget';
import { DropdownWidget } from './../dropdown/dropdown.widget';
import { HyperlinkWidget } from './../hyperlink/hyperlink.widget';
import { RadioButtonsWidget } from './../radio-buttons/radio-buttons.widget';
import { DisplayValueWidget } from './../display-value/display-value.widget';
declare let __moduleName: string;
declare var componentHandler;
@@ -43,7 +44,8 @@ declare var componentHandler;
MultilineTextWidget,
DropdownWidget,
HyperlinkWidget,
RadioButtonsWidget
RadioButtonsWidget,
DisplayValueWidget
]
})
export class ContainerWidget implements AfterViewInit {

View File

@@ -0,0 +1,3 @@
.display-value-widget {
width: 100%;
}

View File

@@ -0,0 +1,9 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label display-value-widget">
<input class="mdl-textfield__input"
type="text"
[attr.id]="field.id"
[(ngModel)]="field.value"
disabled>
<label class="mdl-textfield__label" [attr.for]="field.id">{{field.name}}</label>
</div>

View File

@@ -0,0 +1,32 @@
/*!
* @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 } from '@angular/core';
import { WidgetComponent } from './../widget.component';
declare let __moduleName: string;
declare var componentHandler;
@Component({
moduleId: __moduleName,
selector: 'display-value-widget',
templateUrl: './display-value.widget.html',
styleUrls: ['./display-value.widget.css']
})
export class DisplayValueWidget extends WidgetComponent {
}

View File

@@ -28,6 +28,7 @@ export class FormFieldTypes {
static DROPDOWN: string = 'dropdown';
static HYPERLINK: string = 'hyperlink';
static RADIO_BUTTONS: string = 'radio-buttons';
static DISPLAY_VALUE: string = 'readonly';
}
export class FormWidgetModel {