mirror of
https://github.com/frappe/books.git
synced 2024-11-10 15:50:56 +00:00
23 lines
660 B
JavaScript
23 lines
660 B
JavaScript
const control_classes = {
|
|
Data: require('./data'),
|
|
Text: require('./text'),
|
|
Select: require('./select'),
|
|
Link: require('./link'),
|
|
Float: require('./float'),
|
|
Int: require('./int'),
|
|
Currency: require('./currency'),
|
|
Password: require('./password'),
|
|
Table: require('./table')
|
|
}
|
|
|
|
module.exports = {
|
|
getControlClass(fieldtype) {
|
|
return control_classes[fieldtype];
|
|
},
|
|
makeControl({field, form, parent}) {
|
|
const control_class = this.getControlClass(field.fieldtype);
|
|
let control = new control_class({field:field, form:form, parent:parent});
|
|
control.make();
|
|
return control;
|
|
}
|
|
} |