2018-01-12 17:55:07 +05:30
|
|
|
const control_classes = {
|
|
|
|
Data: require('./data'),
|
|
|
|
Text: require('./text'),
|
2018-01-23 17:56:40 +05:30
|
|
|
Select: require('./select'),
|
2018-01-25 15:34:48 +05:30
|
|
|
Link: require('./link'),
|
|
|
|
Float: require('./float'),
|
2018-02-02 14:51:20 +05:30
|
|
|
Currency: require('./currency'),
|
2018-02-06 22:44:07 +05:30
|
|
|
Password: require('./password'),
|
|
|
|
Table: require('./table')
|
2018-01-12 17:55:07 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2018-02-08 15:08:47 +05:30
|
|
|
getControlClass(fieldtype) {
|
2018-01-12 17:55:07 +05:30
|
|
|
return control_classes[fieldtype];
|
|
|
|
},
|
2018-02-08 15:08:47 +05:30
|
|
|
makeControl({field, form, parent}) {
|
|
|
|
const control_class = this.getControlClass(field.fieldtype);
|
2018-02-06 22:44:07 +05:30
|
|
|
let control = new control_class({field:field, form:form, parent:parent});
|
2018-01-12 17:55:07 +05:30
|
|
|
control.make();
|
|
|
|
return control;
|
|
|
|
}
|
|
|
|
}
|