2017-09-14 12:37:36 +02:00
|
|
|
import { Rule } from '../../entities/common/rule';
|
|
|
|
import { FieldBase } from '../fields/field-base';
|
|
|
|
export class GroupBase<T>{
|
|
|
|
value: T;
|
|
|
|
key: string;
|
|
|
|
title: string;
|
|
|
|
rules: Rule[];
|
|
|
|
groupFields: FieldBase<T>[];
|
|
|
|
visible: boolean;
|
|
|
|
order:number;
|
|
|
|
controlType:string;
|
2017-09-28 17:05:46 +02:00
|
|
|
section:string;
|
2017-10-06 16:33:08 +02:00
|
|
|
style:string;
|
|
|
|
class: string;
|
2017-11-02 15:46:43 +01:00
|
|
|
page: number;
|
2017-11-14 19:46:34 +01:00
|
|
|
compositeFields: GroupBase<T>;
|
2017-10-06 16:33:08 +02:00
|
|
|
|
2017-09-14 12:37:36 +02:00
|
|
|
constructor(options: {
|
|
|
|
value?: T,
|
|
|
|
key?: string,
|
|
|
|
title?: string,
|
|
|
|
rules?: Rule[],
|
|
|
|
groupFields?: FieldBase<T>[],
|
|
|
|
visible?: boolean,
|
|
|
|
order?: number,
|
|
|
|
controlType?: string
|
2017-10-06 16:33:08 +02:00
|
|
|
section?: string,
|
|
|
|
style?:string
|
2017-11-02 15:46:43 +01:00
|
|
|
class?:string,
|
2017-11-14 19:46:34 +01:00
|
|
|
page?:number,
|
|
|
|
compositeFields?:GroupBase<T>
|
2017-09-14 12:37:36 +02:00
|
|
|
} = {}) {
|
|
|
|
this.value = options.value;
|
|
|
|
this.key = options.key || '';
|
|
|
|
this.title = options.title || '';
|
|
|
|
this.rules = options.rules;
|
|
|
|
this.groupFields = options.groupFields;
|
|
|
|
this.visible = options.visible;
|
|
|
|
this.order = options.order === undefined ? 1 : options.order;
|
|
|
|
this.controlType = options.controlType || '';
|
2017-09-28 17:05:46 +02:00
|
|
|
this.section = options.section || '';
|
2017-10-06 16:33:08 +02:00
|
|
|
this.style = options.style || '';
|
|
|
|
this.class = options.class || '';
|
2017-11-02 15:46:43 +01:00
|
|
|
this.page = options.page || 1;
|
2017-11-14 19:46:34 +01:00
|
|
|
this.compositeFields = options.compositeFields;
|
2017-09-14 12:37:36 +02:00
|
|
|
}
|
|
|
|
}
|