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

28 lines
838 B
JavaScript
Raw Normal View History

2018-02-15 09:53:28 +00:00
const controlClasses = {
2018-03-30 16:56:30 +00:00
Autocomplete: require('./autocomplete'),
2018-03-05 16:45:21 +00:00
Check: require('./check'),
2018-02-20 14:11:44 +00:00
Code: require('./code'),
2018-01-12 12:25:07 +00:00
Data: require('./data'),
2018-02-14 12:50:56 +00:00
Date: require('./date'),
2018-03-27 13:55:26 +00:00
DynamicLink: require('./dynamicLink'),
2018-02-14 12:50:56 +00:00
Currency: require('./currency'),
Float: require('./float'),
2018-03-30 16:56:30 +00:00
File: require('./file'),
2018-02-12 12:24:53 +00:00
Int: require('./int'),
2018-02-14 12:50:56 +00:00
Link: require('./link'),
2018-02-06 17:14:07 +00:00
Password: require('./password'),
2018-02-14 12:50:56 +00:00
Select: require('./select'),
Table: require('./table'),
Text: require('./text')
2018-01-12 12:25:07 +00:00
}
module.exports = {
2018-02-08 09:38:47 +00:00
getControlClass(fieldtype) {
2018-02-15 09:53:28 +00:00
return controlClasses[fieldtype];
2018-01-12 12:25:07 +00:00
},
2018-02-08 09:38:47 +00:00
makeControl({field, form, parent}) {
2018-02-15 09:53:28 +00:00
const controlClass = this.getControlClass(field.fieldtype);
let control = new controlClass({field:field, form:form, parent:parent});
2018-01-12 12:25:07 +00:00
return control;
}
}