function stdFormObj(name, schema, options) {
	options = options || {};

	// The Object.assign used to be a angular.copy. Should work though.
	const f =
		options.global && options.global.formDefaults
			? Object.assign({}, options.global.formDefaults)
			: {};
	if (options.global && options.global.supressPropertyTitles === true) {
		f.title = schema.title;
	} else {
		f.title = schema.title || name;
	}

	if (schema.description) {
		f.description = schema.description;
	}
	if (options.required === true || schema.required === true) {
		f.required = true;
	}
	if (schema.maxLength) {
		f.maxlength = schema.maxLength;
	}
	if (schema.minLength) {
		f.minlength = schema.minLength;
	}
	if (schema.readOnly || schema.readonly) {
		f.readonly = true;
	}
	if (schema.minimum) {
		f.minimum = schema.minimum + (schema.exclusiveMinimum ? 1 : 0);
	}
	if (schema.maximum) {
		f.maximum = schema.maximum - (schema.exclusiveMaximum ? 1 : 0);
	}

	// Non standard attributes (DONT USE DEPRECATED)
	// If you must set stuff like this in the schema use the x-schema-form attribute
	if (schema.validationMessage) {
		f.validationMessage = schema.validationMessage;
	}
	if (schema.enumNames) {
		f.titleMap = canonicalTitleMap(schema.enumNames, schema['enum']);
	}
	f.schema = schema;

	// Ng model options doesn't play nice with undefined, might be defined
	// globally though
	f.ngModelOptions = f.ngModelOptions || {};

	return f;
}
/**
 * Creates a form object with all common properties
 */
Creates a form object with all common properties
Creates a form object with all common properties
function stdFormObj(name, schema, options) {
	options = options || {};
	const f =
		options.global && options.global.formDefaults
			? Object.assign({}, options.global.formDefaults)
			: {};
	if (options.global && options.global.supressPropertyTitles === true) {
		f.title = schema.title;
	} else {
		f.title = schema.title || name;
	}
	if (schema.description) {
		f.description = schema.description;
	}
	if (options.required === true || schema.required === true) {
		f.required = true;
	}
	if (schema.maxLength) {
		f.maxlength = schema.maxLength;
	}
	if (schema.minLength) {
		f.minlength = schema.minLength;
	}
	if (schema.readOnly || schema.readonly) {
		f.readonly = true;
	}
	if (schema.minimum) {
		f.minimum = schema.minimum + (schema.exclusiveMinimum ? 1 : 0);
	}
	if (schema.maximum) {
		f.maximum = schema.maximum - (schema.exclusiveMaximum ? 1 : 0);
	}
	if (schema.validationMessage) {
		f.validationMessage = schema.validationMessage;
	}
	if (schema.enumNames) {
		f.titleMap = canonicalTitleMap(schema.enumNames, schema['enum']);
	}
	f.schema = schema;
	f.ngModelOptions = f.ngModelOptions || {};
	return f;
}
function stdFormObj ( name , schema , options ) { options = options || { } ; const f = options . global && options . global . formDefaults ? Object . assign ( { } , options . global . formDefaults ) : { } ; if ( options . global && options . global . supressPropertyTitles === true ) { f . title = schema . title ; } else { f . title = schema . title || name ; } if ( schema . description ) { f . description = schema . description ; } if ( options . required === true || schema . required === true ) { f . required = true ; } if ( schema . maxLength ) { f . maxlength = schema . maxLength ; } if ( schema . minLength ) { f . minlength = schema . minLength ; } if ( schema . readOnly || schema . readonly ) { f . readonly = true ; } if ( schema . minimum ) { f . minimum = schema . minimum + ( schema . exclusiveMinimum ? 1 : 0 ) ; } if ( schema . maximum ) { f . maximum = schema . maximum - ( schema . exclusiveMaximum ? 1 : 0 ) ; } if ( schema . validationMessage ) { f . validationMessage = schema . validationMessage ; } if ( schema . enumNames ) { f . titleMap = canonicalTitleMap ( schema . enumNames , schema [ 'enum' ] ) ; } f . schema = schema ; f . ngModelOptions = f . ngModelOptions || { } ; return f ; }
Creates a form object with all common properties
Creates a form object with all common properties
// The Object.assign used to be a angular.copy. Should work though. // Non standard attributes (DONT USE DEPRECATED) // If you must set stuff like this in the schema use the x-schema-form attribute // Ng model options doesn't play nice with undefined, might be defined // globally though