| 1 |
if (!window.SequraFE) { |
| 2 |
window.SequraFE = {}; |
| 3 |
} |
| 4 |
|
| 5 |
(function () { |
| 6 |
function FormFactory() { |
| 7 |
/** |
| 8 |
* Instantiates page controller; |
| 9 |
* |
| 10 |
* @param {string} form |
| 11 |
* @param {Record<string, any>} data |
| 12 |
* @param {Record<string, any>} configuration |
| 13 |
*/ |
| 14 |
this.getInstance = (form, data, configuration) => { |
| 15 |
const name = form.charAt(0).toUpperCase() + form.slice(1) + 'Form'; |
| 16 |
|
| 17 |
return SequraFE[name] ? new SequraFE[name](data, configuration) : null; |
| 18 |
}; |
| 19 |
} |
| 20 |
|
| 21 |
SequraFE.formFactory = new FormFactory(); |
| 22 |
})(); |
| 23 |
|