mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#636 group picker placeholder widget
This commit is contained in:
@@ -49,6 +49,9 @@
|
||||
<div *ngSwitchCase="'typeahead'">
|
||||
<typeahead-widget [field]="field" (fieldChanged)="fieldChanged($event);"></typeahead-widget>
|
||||
</div>
|
||||
<div *ngSwitchCase="'functional-group'">
|
||||
<functional-group-widget [field]="field" (fieldChanged)="fieldChanged($event);"></functional-group-widget>
|
||||
</div>
|
||||
<div *ngSwitchDefault>
|
||||
<span>UNKNOWN WIDGET TYPE: {{field.type}}</span>
|
||||
</div>
|
||||
|
@@ -25,6 +25,8 @@ export class FormFieldTypes {
|
||||
static READONLY_TEXT: string = 'readonly-text';
|
||||
static UPLOAD: string = 'upload';
|
||||
static TYPEAHEAD: string = 'typeahead';
|
||||
static FUNCTIONAL_GROUP: string = 'functional-group';
|
||||
static PEOPLE: string = 'people';
|
||||
|
||||
static READONLY_TYPES: string[] = [
|
||||
FormFieldTypes.HYPERLINK,
|
||||
|
@@ -0,0 +1,3 @@
|
||||
.functional-group-widget {
|
||||
width: 100%;
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label functional-group-widget">
|
||||
<input class="mdl-textfield__input"
|
||||
type="text"
|
||||
[attr.id]="field.id"
|
||||
[(ngModel)]="value"
|
||||
(ngModelChange)="checkVisibility(field)"
|
||||
[disabled]="field.readOnly">
|
||||
<label class="mdl-textfield__label" [attr.for]="field.id">{{field.name}}</label>
|
||||
</div>
|
@@ -0,0 +1,44 @@
|
||||
/*!
|
||||
* @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 } from '@angular/core';
|
||||
import { WidgetComponent } from './../widget.component';
|
||||
|
||||
declare let __moduleName: string;
|
||||
declare var componentHandler;
|
||||
|
||||
@Component({
|
||||
moduleId: __moduleName,
|
||||
selector: 'functional-group-widget',
|
||||
templateUrl: './functional-group.widget.html',
|
||||
styleUrls: ['./functional-group.widget.css']
|
||||
})
|
||||
export class FunctionalGroupWidget extends WidgetComponent implements OnInit {
|
||||
|
||||
value: string;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
let group = this.field.value;
|
||||
if (group) {
|
||||
this.value = group.name;
|
||||
}
|
||||
}
|
||||
}
|
@@ -29,6 +29,7 @@ import { DisplayValueWidget } from './display-value/display-value.widget';
|
||||
import { DisplayTextWidget } from './display-text/display-text.widget';
|
||||
import { UploadWidget } from './upload/upload.widget';
|
||||
import { TypeaheadWidget } from './typeahead/typeahead.widget';
|
||||
import { FunctionalGroupWidget } from './functional-group/functional-group.widget';
|
||||
|
||||
// core
|
||||
export * from './widget.component';
|
||||
@@ -50,6 +51,7 @@ export * from './display-value/display-value.widget';
|
||||
export * from './display-text/display-text.widget';
|
||||
export * from './upload/upload.widget';
|
||||
export * from './typeahead/typeahead.widget';
|
||||
export * from './functional-group/functional-group.widget';
|
||||
|
||||
export const CONTAINER_WIDGET_DIRECTIVES: [any] = [
|
||||
TabsWidget,
|
||||
@@ -67,7 +69,8 @@ export const PRIMITIVE_WIDGET_DIRECTIVES: [any] = [
|
||||
DisplayValueWidget,
|
||||
DisplayTextWidget,
|
||||
UploadWidget,
|
||||
TypeaheadWidget
|
||||
TypeaheadWidget,
|
||||
FunctionalGroupWidget
|
||||
];
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user