2
0
mirror of https://github.com/frappe/books.git synced 2024-12-25 12:10:06 +00:00
books/client/view/controls/index.js
2018-02-06 22:45:17 +05:30

22 lines
638 B
JavaScript

const control_classes = {
Data: require('./data'),
Text: require('./text'),
Select: require('./select'),
Link: require('./link'),
Float: require('./float'),
Currency: require('./currency'),
Password: require('./password'),
Table: require('./table')
}
module.exports = {
get_control_class(fieldtype) {
return control_classes[fieldtype];
},
make_control({field, form, parent}) {
const control_class = this.get_control_class(field.fieldtype);
let control = new control_class({field:field, form:form, parent:parent});
control.make();
return control;
}
}