angular2-swagger-form-field
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -1,134 +0,7 @@ | ||
declare module "src/enum.pipe" { | ||
import { PipeTransform } from '@angular/core'; | ||
export class EnumPipe implements PipeTransform { | ||
transform(value: Object, args: string[]): string[]; | ||
} | ||
} | ||
declare module "src/form-control-finder" { | ||
import { QueryList } from '@angular/core'; | ||
import { NgModel, FormControl } from '@angular/forms'; | ||
/** | ||
* The FormControlFinder tries to find a formControl in the given ngModelChildren. | ||
* The input element of a control must contain a formControlName directive. | ||
* If more than 1 control is found, the attached formControlName contents (the model's property name) must be the same (so the same validation rules are applicable). | ||
*/ | ||
export class FormControlFinder { | ||
/** | ||
* Try to find the formControl in the given collection. If found, return it. | ||
* If more than 1 control is found, check if the all contain the same formControlName. If not, throw an exception. | ||
* @param {ngModelChildren} QueryList<NgModel> the ngModel ContentChildren to inspect. | ||
* @returns {FormControl} Returns the found control or undefined (if not found) | ||
*/ | ||
static findFormControl(ngModelChildren: QueryList<NgModel>): FormControl; | ||
/** | ||
* checks if all items in the given array are the same | ||
* @param {any[]} array | ||
* @returns {boolean} true if all items in array are the same, throws error if not | ||
*/ | ||
private static checkArrayContainsSameNameValues(array); | ||
} | ||
} | ||
declare module "src/form-field.component" { | ||
import { OnInit, AfterContentInit, QueryList } from '@angular/core'; | ||
import { FormControl, NgModel } from '@angular/forms'; | ||
export class FormFieldComponent implements OnInit, AfterContentInit { | ||
ngModelChildren: QueryList<NgModel>; | ||
/** | ||
* The label to show before the field. | ||
*/ | ||
label: string; | ||
/** | ||
* The number of colunms to use for the Label. | ||
* Default 3. | ||
*/ | ||
labelCols: number; | ||
/** | ||
* The number of colunmns to use for the contents. | ||
* Bootstrap uses the allocated space to render an input field. | ||
* Default 2. | ||
*/ | ||
cols: number; | ||
/** | ||
* When set top true, ommit assiging the Bootstrap `form-group` class to the container element. | ||
* Default false. | ||
*/ | ||
noFormGroupClass: boolean; | ||
/** | ||
* Ommit the Boostrap `row` class to the container element. | ||
* Default false. | ||
*/ | ||
noRow: boolean; | ||
labelColClass: string; | ||
colClass: string; | ||
control: FormControl; | ||
constructor(); | ||
ngOnInit(): void; | ||
ngAfterContentInit(): void; | ||
} | ||
} | ||
declare module "src/form-input.component" { | ||
import { AfterContentInit, QueryList } from '@angular/core'; | ||
import { FormControl, NgModel, NgForm } from '@angular/forms'; | ||
export class FormInputComponent implements AfterContentInit { | ||
private ngForm; | ||
ngModelChildren: QueryList<NgModel>; | ||
/** | ||
* Optional: the control which needs to be validated | ||
* Only needs to be set if this FormInputControl is defined inside another component (like FormFieldComponent) | ||
* If not set, this FormInputComponents tries to find the attached control itself by inspecting it's content | ||
* trying to find elements with both an ngModel and ngControl directives. | ||
*/ | ||
control: FormControl; | ||
constructor(ngForm: NgForm); | ||
ngAfterContentInit(): void; | ||
readonly showErrors: boolean; | ||
} | ||
} | ||
declare module "src/validation-messages" { | ||
/** | ||
* Generic validation messages with placeholders, one per validation type. | ||
*/ | ||
export class ValidationMessages { | ||
/** | ||
* The individual validation messages with placeholders. | ||
*/ | ||
private static config; | ||
/** | ||
* Returns the validation message for the given validation type, identified by it's key. | ||
* @param {string} key the validation type | ||
* @returns {string} the validation message which belongs to the given type (key) | ||
*/ | ||
static getValidatorErrorMessage(key: string): any; | ||
/** | ||
* Overrule the validation message for the given validation type, identified by it's key, with the given message. | ||
* @param {string} key the validation type | ||
* @param {string} the validation message to use. Depending on the type, may contain the placeholders {required} and/or {actual}. | ||
*/ | ||
static setValidationErrorMessage(key: string, message: string): void; | ||
} | ||
} | ||
declare module "src/validation-messages.component" { | ||
import { FormControl } from '@angular/forms'; | ||
export class ValidationMessagesComponent { | ||
control: FormControl; | ||
constructor(); | ||
/** | ||
* Determine if the attached control has at least one validation error. If so, get the belonging validation message, fill in its placeholders and return it. | ||
* @returns {string} the composed validation message which belongs to the first validation error. | ||
*/ | ||
readonly errorMessage: any; | ||
} | ||
} | ||
declare module "src/swagger-form-field.module" { | ||
export class SwaggerFormFieldModule { | ||
} | ||
} | ||
declare module "components" { | ||
export { SwaggerFormFieldModule } from "src/swagger-form-field.module"; | ||
export { EnumPipe } from "src/enum.pipe"; | ||
export { FormControlFinder } from "src/form-control-finder"; | ||
export { FormFieldComponent } from "src/form-field.component"; | ||
export { FormInputComponent } from "src/form-input.component"; | ||
export { ValidationMessagesComponent } from "src/validation-messages.component"; | ||
export { ValidationMessages } from "src/validation-messages"; | ||
} | ||
export { SwaggerFormFieldModule } from './src/swagger-form-field.module'; | ||
export { EnumPipe } from './src/enum.pipe'; | ||
export { FormControlFinder } from './src/form-control-finder'; | ||
export { FormFieldComponent } from './src/form-field.component'; | ||
export { FormInputComponent } from './src/form-input.component'; | ||
export { ValidationMessagesComponent } from './src/validation-messages.component'; | ||
export { ValidationMessages } from './src/validation-messages'; |
@@ -1,497 +0,25 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
System.register("src/enum.pipe", ['@angular/core'], function(exports_1, context_1) { | ||
"use strict"; | ||
var __moduleName = context_1 && context_1.id; | ||
var core_1; | ||
var EnumPipe; | ||
return { | ||
setters:[ | ||
function (core_1_1) { | ||
core_1 = core_1_1; | ||
}], | ||
execute: function() { | ||
EnumPipe = (function () { | ||
function EnumPipe() { | ||
} | ||
EnumPipe.prototype.transform = function (value, args) { | ||
var result = []; | ||
for (var property in value) { | ||
if (value.hasOwnProperty(property)) { | ||
result.push(value[property]); | ||
} | ||
} | ||
//console.log('value', value, 'result', result); | ||
return result; | ||
}; | ||
EnumPipe = __decorate([ | ||
core_1.Pipe({ name: 'sfEnum' }), | ||
__metadata('design:paramtypes', []) | ||
], EnumPipe); | ||
return EnumPipe; | ||
}()); | ||
exports_1("EnumPipe", EnumPipe); | ||
} | ||
(function (factory) { | ||
if (typeof module === 'object' && typeof module.exports === 'object') { | ||
var v = factory(require, exports); if (v !== undefined) module.exports = v; | ||
} | ||
}); | ||
System.register("src/form-control-finder", ['@angular/forms'], function(exports_2, context_2) { | ||
"use strict"; | ||
var __moduleName = context_2 && context_2.id; | ||
var forms_1; | ||
var FormControlFinder; | ||
return { | ||
setters:[ | ||
function (forms_1_1) { | ||
forms_1 = forms_1_1; | ||
}], | ||
execute: function() { | ||
/** | ||
* The FormControlFinder tries to find a formControl in the given ngModelChildren. | ||
* The input element of a control must contain a formControlName directive. | ||
* If more than 1 control is found, the attached formControlName contents (the model's property name) must be the same (so the same validation rules are applicable). | ||
*/ | ||
FormControlFinder = (function () { | ||
function FormControlFinder() { | ||
} | ||
/** | ||
* Try to find the formControl in the given collection. If found, return it. | ||
* If more than 1 control is found, check if the all contain the same formControlName. If not, throw an exception. | ||
* @param {ngModelChildren} QueryList<NgModel> the ngModel ContentChildren to inspect. | ||
* @returns {FormControl} Returns the found control or undefined (if not found) | ||
*/ | ||
FormControlFinder.findFormControl = function (ngModelChildren) { | ||
// filter ngControlName directives (select only controls with ngControl properties, skip the ones with only ngModel) | ||
var controls = ngModelChildren.filter(function (ngModel) { return (ngModel instanceof forms_1.FormControlName); }); | ||
if (controls && controls.length > 0) { | ||
// all ngModelChildren must contain the same control (otherwise, validation will only occure to the first one) | ||
if (controls.length > 1) { | ||
FormControlFinder.checkArrayContainsSameNameValues(controls); | ||
} | ||
return controls[0].control; | ||
} | ||
}; | ||
/** | ||
* checks if all items in the given array are the same | ||
* @param {any[]} array | ||
* @returns {boolean} true if all items in array are the same, throws error if not | ||
*/ | ||
FormControlFinder.checkArrayContainsSameNameValues = function (array) { | ||
var firstName = array[0].name; | ||
for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { | ||
var element = array_1[_i]; | ||
if (element.name !== firstName) { | ||
console.log('More than one formControlName found in transcluded children. first:', firstName, ' second:', element.name); | ||
throw "More than one formControlName found in transcluded children (first=" + firstName + ", other=" + element.name + ")"; | ||
} | ||
} | ||
return true; | ||
}; | ||
return FormControlFinder; | ||
}()); | ||
exports_2("FormControlFinder", FormControlFinder); | ||
} | ||
else if (typeof define === 'function' && define.amd) { | ||
define(["require", "exports", './src/swagger-form-field.module', './src/enum.pipe', './src/form-control-finder', './src/form-field.component', './src/form-input.component', './src/validation-messages.component', './src/validation-messages'], factory); | ||
} | ||
}); | ||
System.register("src/form-field.component", ['@angular/core', '@angular/forms', "src/form-control-finder"], function(exports_3, context_3) { | ||
})(function (require, exports) { | ||
"use strict"; | ||
var __moduleName = context_3 && context_3.id; | ||
var core_2, forms_2, form_control_finder_1; | ||
var FormFieldComponent; | ||
return { | ||
setters:[ | ||
function (core_2_1) { | ||
core_2 = core_2_1; | ||
}, | ||
function (forms_2_1) { | ||
forms_2 = forms_2_1; | ||
}, | ||
function (form_control_finder_1_1) { | ||
form_control_finder_1 = form_control_finder_1_1; | ||
}], | ||
execute: function() { | ||
FormFieldComponent = (function () { | ||
function FormFieldComponent() { | ||
/** | ||
* The number of colunms to use for the Label. | ||
* Default 3. | ||
*/ | ||
this.labelCols = 3; | ||
/** | ||
* The number of colunmns to use for the contents. | ||
* Bootstrap uses the allocated space to render an input field. | ||
* Default 2. | ||
*/ | ||
this.cols = 2; | ||
/** | ||
* When set top true, ommit assiging the Bootstrap `form-group` class to the container element. | ||
* Default false. | ||
*/ | ||
this.noFormGroupClass = false; | ||
/** | ||
* Ommit the Boostrap `row` class to the container element. | ||
* Default false. | ||
*/ | ||
this.noRow = false; | ||
} | ||
FormFieldComponent.prototype.ngOnInit = function () { | ||
this.labelColClass = "col-sm-" + this.labelCols.toString(); | ||
this.colClass = "col-sm-" + this.cols.toString(); | ||
}; | ||
; | ||
FormFieldComponent.prototype.ngAfterContentInit = function () { | ||
// try to find the control in the content so it can be passed to the FormInputComponent | ||
this.control = form_control_finder_1.FormControlFinder.findFormControl(this.ngModelChildren); | ||
}; | ||
__decorate([ | ||
core_2.ContentChildren(forms_2.FormControlName), | ||
__metadata('design:type', core_2.QueryList) | ||
], FormFieldComponent.prototype, "ngModelChildren", void 0); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', String) | ||
], FormFieldComponent.prototype, "label", void 0); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Number) | ||
], FormFieldComponent.prototype, "labelCols", void 0); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Number) | ||
], FormFieldComponent.prototype, "cols", void 0); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Boolean) | ||
], FormFieldComponent.prototype, "noFormGroupClass", void 0); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Boolean) | ||
], FormFieldComponent.prototype, "noRow", void 0); | ||
FormFieldComponent = __decorate([ | ||
core_2.Component({ | ||
selector: 'sf-form-field', | ||
template: "\n<div [ngClass]=\"{'form-group': !noFormGroupClass, 'row': !noRow}\">\n <label *ngIf=\"labelCols > 0\" class=\"control-label\" [ngClass]=\"labelColClass\">{{label}}</label>\n <div [ngClass]=\"colClass\">\n <sf-form-input [control]=\"control\">\n <ng-content></ng-content>\n </sf-form-input>\n </div>\n</div>\n ", | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], FormFieldComponent); | ||
return FormFieldComponent; | ||
}()); | ||
exports_3("FormFieldComponent", FormFieldComponent); | ||
} | ||
} | ||
var swagger_form_field_module_1 = require('./src/swagger-form-field.module'); | ||
exports.SwaggerFormFieldModule = swagger_form_field_module_1.SwaggerFormFieldModule; | ||
var enum_pipe_1 = require('./src/enum.pipe'); | ||
exports.EnumPipe = enum_pipe_1.EnumPipe; | ||
var form_control_finder_1 = require('./src/form-control-finder'); | ||
exports.FormControlFinder = form_control_finder_1.FormControlFinder; | ||
var form_field_component_1 = require('./src/form-field.component'); | ||
exports.FormFieldComponent = form_field_component_1.FormFieldComponent; | ||
var form_input_component_1 = require('./src/form-input.component'); | ||
exports.FormInputComponent = form_input_component_1.FormInputComponent; | ||
var validation_messages_component_1 = require('./src/validation-messages.component'); | ||
exports.ValidationMessagesComponent = validation_messages_component_1.ValidationMessagesComponent; | ||
var validation_messages_1 = require('./src/validation-messages'); | ||
exports.ValidationMessages = validation_messages_1.ValidationMessages; | ||
}); | ||
System.register("src/form-input.component", ['@angular/core', '@angular/forms', "src/form-control-finder"], function(exports_4, context_4) { | ||
"use strict"; | ||
var __moduleName = context_4 && context_4.id; | ||
var core_3, forms_3, form_control_finder_2; | ||
var FormInputComponent; | ||
return { | ||
setters:[ | ||
function (core_3_1) { | ||
core_3 = core_3_1; | ||
}, | ||
function (forms_3_1) { | ||
forms_3 = forms_3_1; | ||
}, | ||
function (form_control_finder_2_1) { | ||
form_control_finder_2 = form_control_finder_2_1; | ||
}], | ||
execute: function() { | ||
FormInputComponent = (function () { | ||
function FormInputComponent(ngForm) { | ||
this.ngForm = ngForm; | ||
} | ||
FormInputComponent.prototype.ngAfterContentInit = function () { | ||
if (!this.control) { | ||
// no control passed in, Try to find the control in the ContentChildren | ||
this.control = form_control_finder_2.FormControlFinder.findFormControl(this.ngModelChildren); | ||
} | ||
}; | ||
Object.defineProperty(FormInputComponent.prototype, "showErrors", { | ||
get: function () { | ||
if (this.control) { | ||
return this.ngForm.submitted || (this.control.touched && !this.control.valid); | ||
} | ||
return false; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
__decorate([ | ||
core_3.ContentChildren(forms_3.FormControlName), | ||
__metadata('design:type', core_3.QueryList) | ||
], FormInputComponent.prototype, "ngModelChildren", void 0); | ||
__decorate([ | ||
core_3.Input(), | ||
__metadata('design:type', forms_3.FormControl) | ||
], FormInputComponent.prototype, "control", void 0); | ||
FormInputComponent = __decorate([ | ||
core_3.Component({ | ||
selector: 'sf-form-input', | ||
template: "\n<ng-content></ng-content>\n<span *ngIf=\"control\">\n <sf-validation-messages *ngIf=\"showErrors\" [control]=\"control\"></sf-validation-messages>\n</span>\n<!-- use this transclude placeholder to add custom validation messages -->\n<ng-content select=\"custom-messages\"></ng-content>\n ", | ||
}), | ||
__metadata('design:paramtypes', [forms_3.NgForm]) | ||
], FormInputComponent); | ||
return FormInputComponent; | ||
}()); | ||
exports_4("FormInputComponent", FormInputComponent); | ||
} | ||
} | ||
}); | ||
System.register("src/validation-messages", [], function(exports_5, context_5) { | ||
"use strict"; | ||
var __moduleName = context_5 && context_5.id; | ||
var ValidationMessages; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
/** | ||
* Generic validation messages with placeholders, one per validation type. | ||
*/ | ||
ValidationMessages = (function () { | ||
function ValidationMessages() { | ||
} | ||
/** | ||
* Returns the validation message for the given validation type, identified by it's key. | ||
* @param {string} key the validation type | ||
* @returns {string} the validation message which belongs to the given type (key) | ||
*/ | ||
ValidationMessages.getValidatorErrorMessage = function (key) { | ||
return ValidationMessages.config[key]; | ||
}; | ||
/** | ||
* Overrule the validation message for the given validation type, identified by it's key, with the given message. | ||
* @param {string} key the validation type | ||
* @param {string} the validation message to use. Depending on the type, may contain the placeholders {required} and/or {actual}. | ||
*/ | ||
ValidationMessages.setValidationErrorMessage = function (key, message) { | ||
ValidationMessages.config[key] = message; | ||
}; | ||
/** | ||
* The individual validation messages with placeholders. | ||
*/ | ||
ValidationMessages.config = { | ||
'required': 'Dit veld is verplicht', | ||
'minlength': 'Dit veld moet minimaal {{required}} karakters bevatten maar bevat er {{actual}}', | ||
'maxlength': 'Dit veld mag maximaal {{required}} karakters bevatten maar bevat er {{actual}}', | ||
'minValue': 'Dit veld mag minimaal {{required}} bevatten maar bevat {{actual}}', | ||
'maxValue': 'Dit veld mag maximaal {{required}} bevatten maar bevat {{actual}}', | ||
'email': 'Dit veld bevat een ongedlig email adres', | ||
'pattern': 'Dit veld bevat tenminste één ongeldig karakter (patroon is {{required}})', | ||
}; | ||
return ValidationMessages; | ||
}()); | ||
exports_5("ValidationMessages", ValidationMessages); | ||
} | ||
} | ||
}); | ||
System.register("src/validation-messages.component", ['@angular/core', '@angular/forms', "src/validation-messages"], function(exports_6, context_6) { | ||
"use strict"; | ||
var __moduleName = context_6 && context_6.id; | ||
var core_4, forms_4, validation_messages_1; | ||
var ValidationMessagesComponent; | ||
return { | ||
setters:[ | ||
function (core_4_1) { | ||
core_4 = core_4_1; | ||
}, | ||
function (forms_4_1) { | ||
forms_4 = forms_4_1; | ||
}, | ||
function (validation_messages_1_1) { | ||
validation_messages_1 = validation_messages_1_1; | ||
}], | ||
execute: function() { | ||
ValidationMessagesComponent = (function () { | ||
function ValidationMessagesComponent() { | ||
} | ||
Object.defineProperty(ValidationMessagesComponent.prototype, "errorMessage", { | ||
/** | ||
* Determine if the attached control has at least one validation error. If so, get the belonging validation message, fill in its placeholders and return it. | ||
* @returns {string} the composed validation message which belongs to the first validation error. | ||
*/ | ||
get: function () { | ||
if (this.control) { | ||
//console.log('ValidationMessagesComponent.errorMessage: control.validator=' + this.control.validator + '\n control.value=' + this.control.value + '\n control.errors=', this.control.errors); | ||
for (var propertyName in this.control.errors) { | ||
// If control has a error | ||
if (this.control.errors.hasOwnProperty(propertyName)) { | ||
// get the validation message for the error type | ||
var message = validation_messages_1.ValidationMessages.getValidatorErrorMessage(propertyName); | ||
// fill required and actual values based on the error type | ||
var required = void 0; | ||
var actual = void 0; | ||
if (propertyName === 'pattern') { | ||
required = this.control.errors[propertyName].requiredPattern.toString(); | ||
actual = this.control.errors[propertyName].actualValue.toString(); | ||
} | ||
else if (propertyName === 'minlength') { | ||
required = this.control.errors[propertyName].requiredLength.toString(); | ||
actual = this.control.errors[propertyName].actualLength.toString(); | ||
} | ||
else if (propertyName === 'maxlength') { | ||
required = this.control.errors[propertyName].requiredLength.toString(); | ||
actual = this.control.errors[propertyName].actualLength.toString(); | ||
} | ||
else if (propertyName === 'minValue') { | ||
required = this.control.errors[propertyName].required.toString(); | ||
actual = this.control.errors[propertyName].actual.toString(); | ||
} | ||
else if (propertyName === 'maxValue') { | ||
required = this.control.errors[propertyName].required.toString(); | ||
actual = this.control.errors[propertyName].actual.toString(); | ||
} | ||
// fill error message placeholders with the required and actual values | ||
if (required) { | ||
message = message.replace('{{required}}', required); | ||
} | ||
if (actual) { | ||
message = message.replace('{{actual}}', actual); | ||
} | ||
return message; | ||
} | ||
} | ||
} | ||
return null; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
__decorate([ | ||
core_4.Input(), | ||
__metadata('design:type', forms_4.FormControl) | ||
], ValidationMessagesComponent.prototype, "control", void 0); | ||
ValidationMessagesComponent = __decorate([ | ||
core_4.Component({ | ||
selector: 'sf-validation-messages', | ||
template: "<div *ngIf=\"errorMessage !== null\" class=\"error\">{{errorMessage}}</div>" | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], ValidationMessagesComponent); | ||
return ValidationMessagesComponent; | ||
}()); | ||
exports_6("ValidationMessagesComponent", ValidationMessagesComponent); | ||
} | ||
} | ||
}); | ||
System.register("src/swagger-form-field.module", ['@angular/core', '@angular/common', '@angular/forms', "src/enum.pipe", "src/form-field.component", "src/form-input.component", "src/validation-messages.component"], function(exports_7, context_7) { | ||
"use strict"; | ||
var __moduleName = context_7 && context_7.id; | ||
var core_5, common_1, forms_5, enum_pipe_1, form_field_component_1, form_input_component_1, validation_messages_component_1; | ||
var SwaggerFormFieldModule; | ||
return { | ||
setters:[ | ||
function (core_5_1) { | ||
core_5 = core_5_1; | ||
}, | ||
function (common_1_1) { | ||
common_1 = common_1_1; | ||
}, | ||
function (forms_5_1) { | ||
forms_5 = forms_5_1; | ||
}, | ||
function (enum_pipe_1_1) { | ||
enum_pipe_1 = enum_pipe_1_1; | ||
}, | ||
function (form_field_component_1_1) { | ||
form_field_component_1 = form_field_component_1_1; | ||
}, | ||
function (form_input_component_1_1) { | ||
form_input_component_1 = form_input_component_1_1; | ||
}, | ||
function (validation_messages_component_1_1) { | ||
validation_messages_component_1 = validation_messages_component_1_1; | ||
}], | ||
execute: function() { | ||
SwaggerFormFieldModule = (function () { | ||
function SwaggerFormFieldModule() { | ||
} | ||
SwaggerFormFieldModule = __decorate([ | ||
core_5.NgModule({ | ||
imports: [ | ||
common_1.CommonModule, | ||
forms_5.ReactiveFormsModule, | ||
], | ||
exports: [ | ||
// pipes | ||
enum_pipe_1.EnumPipe, | ||
// widgets | ||
form_field_component_1.FormFieldComponent, | ||
form_input_component_1.FormInputComponent, | ||
validation_messages_component_1.ValidationMessagesComponent, | ||
], | ||
declarations: [ | ||
// pipes | ||
enum_pipe_1.EnumPipe, | ||
// widgets | ||
form_field_component_1.FormFieldComponent, | ||
form_input_component_1.FormInputComponent, | ||
validation_messages_component_1.ValidationMessagesComponent, | ||
], | ||
providers: [ | ||
forms_5.FormBuilder, | ||
forms_5.NgForm, | ||
], | ||
schemas: [ | ||
core_5.NO_ERRORS_SCHEMA, | ||
], | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], SwaggerFormFieldModule); | ||
return SwaggerFormFieldModule; | ||
}()); | ||
exports_7("SwaggerFormFieldModule", SwaggerFormFieldModule); | ||
} | ||
} | ||
}); | ||
System.register("components", ["src/swagger-form-field.module", "src/enum.pipe", "src/form-control-finder", "src/form-field.component", "src/form-input.component", "src/validation-messages.component", "src/validation-messages"], function(exports_8, context_8) { | ||
"use strict"; | ||
var __moduleName = context_8 && context_8.id; | ||
return { | ||
setters:[ | ||
function (swagger_form_field_module_1_1) { | ||
exports_8({ | ||
"SwaggerFormFieldModule": swagger_form_field_module_1_1["SwaggerFormFieldModule"] | ||
}); | ||
}, | ||
function (enum_pipe_2_1) { | ||
exports_8({ | ||
"EnumPipe": enum_pipe_2_1["EnumPipe"] | ||
}); | ||
}, | ||
function (form_control_finder_3_1) { | ||
exports_8({ | ||
"FormControlFinder": form_control_finder_3_1["FormControlFinder"] | ||
}); | ||
}, | ||
function (form_field_component_2_1) { | ||
exports_8({ | ||
"FormFieldComponent": form_field_component_2_1["FormFieldComponent"] | ||
}); | ||
}, | ||
function (form_input_component_2_1) { | ||
exports_8({ | ||
"FormInputComponent": form_input_component_2_1["FormInputComponent"] | ||
}); | ||
}, | ||
function (validation_messages_component_2_1) { | ||
exports_8({ | ||
"ValidationMessagesComponent": validation_messages_component_2_1["ValidationMessagesComponent"] | ||
}); | ||
}, | ||
function (validation_messages_2_1) { | ||
exports_8({ | ||
"ValidationMessages": validation_messages_2_1["ValidationMessages"] | ||
}); | ||
}], | ||
execute: function() { | ||
} | ||
} | ||
}); | ||
//# sourceMappingURL=components.js.map |
{ | ||
"name": "angular2-swagger-form-field", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Angular 2 module with some components to build a model-driven form using the generated classes from the SwaggerTSGenerator.", | ||
@@ -8,4 +8,3 @@ "main": "components.ts", | ||
"build": "tcs", | ||
"deploy-test": "tsc && npm version patch", | ||
"deploy-patch": "tsc && npm version patch && npm publish" | ||
"publish-patch": "tsc && npm version patch && npm publish" | ||
}, | ||
@@ -32,3 +31,2 @@ "keywords": [ | ||
"@angular/router": "3.2.1", | ||
"angular2-notifications": "^0.4.46", | ||
"core-js": "^2.4.1", | ||
@@ -35,0 +33,0 @@ "reflect-metadata": "^0.1.3", |
@@ -8,3 +8,3 @@ # Angular2 Swagger FormField | ||
# Setup | ||
Download the moduel with npm: | ||
Download the module with npm: | ||
@@ -15,2 +15,19 @@ ```bash | ||
If you use SystemJS, add the module in `systemjs.config.js`: | ||
```javascript | ||
... | ||
map: { | ||
... | ||
'angular2-swagger-form-field': 'npm:angular2-swagger-form-field/bundles' | ||
... | ||
}, | ||
packages: { | ||
... | ||
'angular2-swagger-form-field': { defaultExtension: 'js' } | ||
... | ||
} | ||
``` | ||
Add the module to your AppModule: | ||
@@ -17,0 +34,0 @@ |
{ | ||
"compilerOptions": { | ||
"module": "system", | ||
"module": "umd", | ||
"target": "es5", | ||
@@ -8,3 +8,3 @@ "noImplicitAny": false, | ||
"emitDecoratorMetadata": true, | ||
"outFile": "bundles/components.js", | ||
"outDir": "bundles", | ||
"rootDir": ".", | ||
@@ -11,0 +11,0 @@ "sourceMap": true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
279925
13
39
193
1057
- Removedangular2-notifications@^0.4.46
- Removedangular2-notifications@0.4.53(transitive)