2
0
mirror of https://github.com/frappe/books.git synced 2025-01-27 00:58:35 +00:00

22 lines
633 B
JavaScript
Raw Normal View History

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'),
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;
}
}