2
0
mirror of https://github.com/frappe/books.git synced 2024-12-24 20:00:29 +00:00
books/client/view/controls/index.js
2018-03-05 22:15:21 +05:30

25 lines
721 B
JavaScript

const controlClasses = {
Check: require('./check'),
Code: require('./code'),
Data: require('./data'),
Date: require('./date'),
Currency: require('./currency'),
Float: require('./float'),
Int: require('./int'),
Link: require('./link'),
Password: require('./password'),
Select: require('./select'),
Table: require('./table'),
Text: require('./text')
}
module.exports = {
getControlClass(fieldtype) {
return controlClasses[fieldtype];
},
makeControl({field, form, parent}) {
const controlClass = this.getControlClass(field.fieldtype);
let control = new controlClass({field:field, form:form, parent:parent});
return control;
}
}