forked from formio/formio.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformFactory.js
40 lines (31 loc) · 969 Bytes
/
formFactory.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _formio = require('./formio.wizard');
var _formio2 = _interopRequireDefault(_formio);
var _formio3 = require('./formio.pdf');
var _formio4 = _interopRequireDefault(_formio3);
var _formio5 = require('./formio.form');
var _formio6 = _interopRequireDefault(_formio5);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Provided a form object, this will return the form instance.
*
* @param element
* @param form
* @param options
* @return {*}
*/
exports.default = function (element, form, options) {
var instance = null;
if (form.display === 'wizard') {
instance = new _formio2.default(element, options);
} else if (form.display === 'pdf') {
instance = new _formio4.default(element, options);
} else {
instance = new _formio6.default(element, options);
}
instance.form = form;
return instance;
};