2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/client/view/controls/index.js
Rushabh Mehta 1b42e46462 ui fixes
2018-02-15 15:23:28 +05:30

23 lines
661 B
JavaScript

const controlClasses = {
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;
}
}