2018-02-15 15:23:28 +05:30
|
|
|
const controlClasses = {
|
2018-03-05 22:15:21 +05:30
|
|
|
Check: require('./check'),
|
2018-02-20 19:41:44 +05:30
|
|
|
Code: require('./code'),
|
2018-01-12 17:55:07 +05:30
|
|
|
Data: require('./data'),
|
2018-02-14 18:20:56 +05:30
|
|
|
Date: require('./date'),
|
|
|
|
Currency: require('./currency'),
|
2018-01-25 15:34:48 +05:30
|
|
|
Float: require('./float'),
|
2018-02-12 17:54:53 +05:30
|
|
|
Int: require('./int'),
|
2018-02-14 18:20:56 +05:30
|
|
|
Link: require('./link'),
|
2018-02-06 22:44:07 +05:30
|
|
|
Password: require('./password'),
|
2018-02-14 18:20:56 +05:30
|
|
|
Select: require('./select'),
|
|
|
|
Table: require('./table'),
|
|
|
|
Text: require('./text')
|
2018-01-12 17:55:07 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2018-02-08 15:08:47 +05:30
|
|
|
getControlClass(fieldtype) {
|
2018-02-15 15:23:28 +05:30
|
|
|
return controlClasses[fieldtype];
|
2018-01-12 17:55:07 +05:30
|
|
|
},
|
2018-02-08 15:08:47 +05:30
|
|
|
makeControl({field, form, parent}) {
|
2018-02-15 15:23:28 +05:30
|
|
|
const controlClass = this.getControlClass(field.fieldtype);
|
|
|
|
let control = new controlClass({field:field, form:form, parent:parent});
|
2018-01-12 17:55:07 +05:30
|
|
|
return control;
|
|
|
|
}
|
|
|
|
}
|