Constructor function

required options:
name (form name attribute)

optional options:
on (validation event),
templates ('handlebars like' placeholder for form messages)

@param {Object} options
491507
function Avowal(options) {
    var opts = options || {};
    opts.templates = opts.templates || {};

    if (!opts.name) {
      fail('form name attribute needed.');
    }

    this.form = document.querySelector('form[name=' + opts.name + ']');
    if (!this.form) {
      fail('form "' + opts.name + '" not found.');
    }

    this._state = {};
    this._cache = {};
    this._lifecycle = {};
    this._statusMessages = {};
    this._templates = {
      success: opts.templates.success || '<span>{{message}}</span>',
      error: opts.templates.error || '<span>{{message}}</span>'
    };

    this._initEventDelegation(opts.on || 'input');
  }
1064088
function (name, opts) {
            var self = this;
            if (typeof name === 'string') {
                if (self.hasAttr(name)) {
                    // if attribute does not have default value, then set to undefined
                    return self.set(name, getDefAttrVal(self, name), opts);
                } else {
                    return self;
                }
            }
            opts = /**@type Object
         @ignore*/
            name;
            var attrs = self.getAttrs(), values = {};    // reset all
            // reset all
            for (name in attrs) {
                values[name] = getDefAttrVal(self, name);
            }
            self.set(values, opts);
            return self;
        }
82568
function(attrs, options) {
    var validationErrors = BaseModel.__super__.validate.apply(this, arguments);
    if (validationErrors) return new ValidationError({
      errors: validationErrors
    });
  }
1282244
function(template, options){
			var payload = { data: {}, template_id: template };

			// Add root attributes to the payload root
			for(var attr in rootAttributes){
				if(!rootAttributes.hasOwnProperty(attr)){
					continue;
				}
				if(typeof options[attr] === 'undefined'){
					continue;
				}
				var key = rootAttributes[attr],
					val = options[attr];
				payload[key] = val;
				delete options[attr];
			}

			// Add any left over attribtues to the data object
			for(attr in options){
				if(!options.hasOwnProperty(attr)){
					continue;
				}
				payload.data[attr] = options[attr]
			}

			// Add to the list of emails
			this.mails.push(payload);
		}
261158
function (Handler, name) {
        if (!_.isFunction(Handler.init)) {
            throw new Error('The handler for "' + name + '" does not have an "init" function, which is necessary');
        }

        if (!_.isFunction(Handler.pre)) {
            throw new Error('The handler for "' + name + '" does not have a "pre" function, which is necessary');
        }

        if (!_.isFunction(Handler.post)) {
            throw new Error('The handler for "' + name + '" does not have a "post" function, which is necessary');
        }

        if (!_.isFunction(Handler.sign)) {
            throw new Error('The handler for "' + name + '" does not have a "sign" function, which is necessary');
        }

        Object.defineProperty(Handler, AUTH_TYPE_PROP, {
            value: name,
            configurable: false,
            enumerable: false,
            writable: false
        });

        AuthLoader.handlers[name] = Handler;
    }
1157991
function (options) {
        options = options || {};
        var qs = '';
        if (typeof options === 'string') {
            qs = options;
            options = this.parseOptions(qs);
        }

        for (var key in options) {
            if (!(key in DEFAULT_OPTIONS)) {
                throw new Error('No such option.');
            }
        }
        if (qs.length && !Object.keys(options).length) {
            throw new Error('Invalid argument syntax.');
        }

        this.options = extend(DEFAULT_OPTIONS, options);
    }
1321801
function(attrs, options) {
      var error = this.validate(attrs);
      if (error) {
        if (options.error) {
          options.error(this, error, options);
        } else {
          this.trigger('error', this, error, options);
        }
        return false;
      }
      return true;
    }
388633
function(options) {
      if (this.options) options = _.extend({}, this.options, options);
      for (var i = 0, l = viewOptions.length; i < l; i++) {
        var attr = viewOptions[i];
        if (options[attr]) this[attr] = options[attr];
      }
      this.options = options;
    }
1194913
function Validator(options) {
  options = options || {};

  this.cwd = options.cwd || process.cwd();
  this.debug = !!options.debug;
}
618068
function(name) {
		var args = arguments;
		args[0] = this.eventName(name);
		$.fn.on.apply(this.$el, args);
	}
311086
function inputUserAttrs(name, inputAttrs) {
    const { class: classname, className, ...attrs } = inputAttrs
    let textAttrs = {
      id: name + '-' + data.lastID,
      title: attrs.description || attrs.label || name.toUpperCase(),
      name: name,
      type: attrs.type || 'text',
      className: [`fld-${name}`, (classname || className || '').trim()],
    }
    const label = `<label for="${textAttrs.id}">${i18n[name] || ''}</label>`

    const optionInputs = ['checkbox', 'checkbox-group', 'radio-group']
    if (!optionInputs.includes(textAttrs.type)) {
      textAttrs.className.push('form-control')
    }

    textAttrs = Object.assign({}, attrs, textAttrs)
    const textInput = `<input ${attrString(textAttrs)}>`
    const inputWrap = `<div class="input-wrap">${textInput}</div>`
    return `<div class="form-group ${name}-wrap">${label}${inputWrap}</div>`
  }
64973
function(option) {
          var flattened, attrs, error, invalidAttrs;

          option = option || getOptionsAttrs(options, view);

          if(_.isString(option)){
            attrs = [option];
          } else if(_.isArray(option)) {
            attrs = option;
          }
          if (attrs) {
            flattened = flatten(this.attributes);
            //Loop through all associated views
            _.each(this.associatedViews, function(view) {
              _.each(attrs, function (attr) {
                error = validateAttr(this, attr, flattened[attr], _.extend({}, this.attributes));
                if (error) {
                  options.invalid(view, attr, error, options.selector);
                  invalidAttrs = invalidAttrs || {};
                  invalidAttrs[attr] = error;
                } else {
                  options.valid(view, attr, options.selector);
                }
              }, this);
            }, this);
          }

          if(option === true) {
            invalidAttrs = this.validate();
          }
          if (invalidAttrs) {
            this.trigger('invalid', this, invalidAttrs, {validationError: invalidAttrs});
          }
          return attrs ? !invalidAttrs : this.validation ? this._isValid : true;
        }
658314
function(formName) {
        var currentFieldsValidations,
            currentFieldsValue,
            currentValidationMethodAndParameters,
            i;

        this.currentForm = formName;
        this.errors = {};

        for (var fieldName in this.validationInformation[formName]) {
            this.currentField = fieldName;
            currentFieldsValidations = this.validationInformation[formName][fieldName];
            currentFieldsValue = this.utils.getFieldsValue(this.currentForm, this.currentField);

            for (i = 0; i < currentFieldsValidations.length; i++) {
                var method,
                    parameters = [];

                currentValidationMethodAndParameters = this.getValidationMethodAndParameters(currentFieldsValidations[i]);
                method = currentValidationMethodAndParameters[0];

                // Here we check to see if our parameters actually exist and if it does then store it.
                if (currentValidationMethodAndParameters.length === 2) {
                    parameters = currentValidationMethodAndParameters[1];
                }

                if (! this.callValidationMethodWithParameters(method, parameters, currentFieldsValue)) {
                    parameters.shift();
                    this.messages.addValidationErrorMessage(method, parameters);
                }
            }
        }

        // If there are no errors populated in the errors property then we passed.
        return this.utils.isEmptyObject(this.errors);
    }
1256133
function validate(options) {
    const schema = joi.object().keys({
        actionName: joi.string().required(),
        authKey: joi.string().required(),
        modelName: joi.string().required(),
        acl: joi.object(),
        aclContextName: joi.string().required()
    });
    const errorMsg = 'Invalid rule options: ';
    const aclContext = options.acl[options.aclContextName];
    joi.assert(options, schema, errorMsg);
    joi.assert(aclContext, joi.func().required(), errorMsg);
    return true;
}
153873
function(element, options) {
        this.name = name;
        this.$ = $(element);
        this.id = $.zui.uuid();
        this.selectOrder = 1;
        this.selections = {};

        this.getOptions(options);
        this._init();
    }
385365
function(options, cb) {
  var form = options.form;

  //The submission needs to be initialised with a form.
  if (!form) {
    return cb("No form entered.");
  }

  return cb(undefined, new Submission({form: form, formId: form._id}));
}
189367
function(attributes, constraints, options) {
      options = v.extend({}, v.async.options, options);

      var WrapErrors = options.wrapErrors || function(errors) {
        return errors;
      };

      // Removes unknown attributes
      if (options.cleanAttributes !== false) {
        attributes = v.cleanAttributes(attributes, constraints);
      }

      var results = v.runValidations(attributes, constraints, options);

      return new v.Promise(function(resolve, reject) {
        v.waitForResults(results).then(function() {
          var errors = v.processValidationResults(results, options);
          if (errors) {
            reject(new WrapErrors(errors, options, attributes, constraints));
          } else {
            resolve(attributes);
          }
        }, function(err) {
          reject(err);
        });
      });
    }