2
0
mirror of https://github.com/frappe/books.git synced 2024-09-21 03:39:02 +00:00
books/client/view/controls/index.js

21 lines
573 B
JavaScript
Raw Normal View History

2018-01-12 12:25:07 +00:00
const control_classes = {
Data: require('./data'),
Text: require('./text'),
2018-01-23 12:26:40 +00:00
Select: require('./select'),
Link: require('./link'),
Float: require('./float'),
2018-02-02 09:21:20 +00:00
Currency: require('./currency'),
Password: require('./password')
2018-01-12 12:25:07 +00:00
}
module.exports = {
get_control_class(fieldtype) {
return control_classes[fieldtype];
},
make_control(field, parent) {
const control_class = this.get_control_class(field.fieldtype);
let control = new control_class(field, parent);
control.make();
return control;
}
}