forked from Meteor-Community-Packages/meteor-autoform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoform.js
29 lines (22 loc) · 1.12 KB
/
autoform.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
/* global AutoForm */
import { Tracker } from 'meteor/tracker'
import { FormPreserve } from './form-preserve'
import { FormData } from './autoform-formdata'
import { ArrayTracker } from './autoform-arrays'
AutoForm = AutoForm || {} // eslint-disable-line no-global-assign
// formPreserve is used to keep current form data across hot code
// reloads for any forms that are currently rendered
AutoForm.formPreserve = new FormPreserve('autoforms')
AutoForm.reactiveFormData = new FormData()
AutoForm._inputTypeDefinitions = {} // for storing input type definitions added by AutoForm.addInputType
AutoForm._formTypeDefinitions = {} // for storing submit type definitions added by AutoForm.addFormType
arrayTracker = new ArrayTracker() // eslint-disable-line no-global-assign
// Used by AutoForm._forceResetFormValues; temporary hack
AutoForm._destroyForm = {}
// reactive templates
globalDefaultTemplate = 'bootstrap3' // eslint-disable-line no-global-assign
defaultTypeTemplates = {} // eslint-disable-line no-global-assign
deps = { // eslint-disable-line no-global-assign
defaultTemplate: new Tracker.Dependency(),
defaultTypeTemplates: {}
}