|
@@ -127,11 +127,6 @@ class CheckbuttonField extends SimpleField {
|
|
|
type = 'Checkbutton';
|
|
|
}
|
|
|
|
|
|
-class CheckbuttonGroup extends SimpleField {
|
|
|
- value: (string | boolean)[];
|
|
|
- type = 'CheckbuttonGroup';
|
|
|
-}
|
|
|
-
|
|
|
class DropdownModifiedInputField extends SimpleField {
|
|
|
type = 'DropdownModifiedInput';
|
|
|
modifiers: string[];
|
|
@@ -141,6 +136,30 @@ class DropdownModifiedInputField extends SimpleField {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// ---------------------------------------------------------------------------------------------------------------------
|
|
|
+// Custom FormGroup Component Models - render a series of FormControls
|
|
|
+
|
|
|
+class CheckbuttonGroup {
|
|
|
+ type = 'CheckbuttonGroup';
|
|
|
+ name: string;
|
|
|
+ label?: string;
|
|
|
+ groupName: string;
|
|
|
+ firstEnablesRest;
|
|
|
+ meta: CheckbuttonField[];
|
|
|
+ constructor(groupmeta: any) {
|
|
|
+ Object.assign(this, groupmeta);
|
|
|
+ if (!this.label) {
|
|
|
+ // If label is not supplied set it to the unCamelCased'n'Spaced name
|
|
|
+ // e.g. supervisorCardNumber --> Supervisor Card Number
|
|
|
+ this.label = this.name.replace(/([A-Z])/g, ' $1').replace(/^./, s => s.toUpperCase());
|
|
|
+ }
|
|
|
+ this.meta = [];
|
|
|
+ while (groupmeta.meta.length) {
|
|
|
+ this.meta.push( new CheckbuttonField(groupmeta.meta.shift()) );
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
// Kendo Form Component Models
|
|
|
|
|
@@ -158,7 +177,9 @@ class TimePickerField extends SimpleField {
|
|
|
|
|
|
export {
|
|
|
TextField, TextareaField, PasswordField, SelectField, RadioField,
|
|
|
- CheckbuttonField, CheckbuttonGroup, DropdownModifiedInputField, TimePickerField
|
|
|
+ CheckbuttonField, DropdownModifiedInputField,
|
|
|
+ CheckbuttonGroup,
|
|
|
+ TimePickerField
|
|
|
};
|
|
|
|
|
|
|