From 4c4c75957dccf2c094872969c2eaea994e8b8c50 Mon Sep 17 00:00:00 2001 From: Shawn Dao Date: Mon, 17 Apr 2017 10:37:12 +0700 Subject: [PATCH 1/3] aot --- .gitignore | 9 +- dist/index.d.ts | 6 + dist/index.js | 39 ++++++ dist/index.js.map | 1 + dist/index.metadata.json | 1 + dist/src/wizard-step.component.d.ts | 16 +++ dist/src/wizard-step.component.js | 82 ++++++++++++ dist/src/wizard-step.component.js.map | 1 + dist/src/wizard-step.component.metadata.json | 1 + dist/src/wizard.component.d.ts | 21 +++ dist/src/wizard.component.js | 127 +++++++++++++++++++ dist/src/wizard.component.js.map | 1 + dist/src/wizard.component.metadata.json | 1 + package.json | 3 +- tsconfig-aot.json | 28 ++++ 15 files changed, 328 insertions(+), 9 deletions(-) create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map create mode 100644 dist/index.metadata.json create mode 100644 dist/src/wizard-step.component.d.ts create mode 100644 dist/src/wizard-step.component.js create mode 100644 dist/src/wizard-step.component.js.map create mode 100644 dist/src/wizard-step.component.metadata.json create mode 100644 dist/src/wizard.component.d.ts create mode 100644 dist/src/wizard.component.js create mode 100644 dist/src/wizard.component.js.map create mode 100644 dist/src/wizard.component.metadata.json create mode 100644 tsconfig-aot.json diff --git a/.gitignore b/.gitignore index 8073663..d96284c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ -dist/* -*.ngfactory.ts -*.ngsummary.json +aot/ # Coverage coverage/* @@ -9,11 +7,6 @@ coverage/* node_modules/* npm-debug.log -# TypeScript -*.js -*.map -*.d.ts - # JetBrains .idea .project diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..b226007 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,6 @@ +import { ModuleWithProviders } from '@angular/core'; +export * from './src/wizard.component'; +export * from './src/wizard-step.component'; +export declare class FormWizardModule { + static forRoot(): ModuleWithProviders; +} diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..6fe85eb --- /dev/null +++ b/dist/index.js @@ -0,0 +1,39 @@ +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; +}; +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { WizardComponent } from './src/wizard.component'; +import { WizardStepComponent } from './src/wizard-step.component'; +export * from './src/wizard.component'; +export * from './src/wizard-step.component'; +var FormWizardModule = FormWizardModule_1 = (function () { + function FormWizardModule() { + } + FormWizardModule.forRoot = function () { + return { + ngModule: FormWizardModule_1 + }; + }; + return FormWizardModule; +}()); +FormWizardModule = FormWizardModule_1 = __decorate([ + NgModule({ + imports: [ + CommonModule + ], + declarations: [ + WizardComponent, + WizardStepComponent + ], + exports: [ + WizardComponent, + WizardStepComponent + ] + }) +], FormWizardModule); +export { FormWizardModule }; +var FormWizardModule_1; diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..cae1c26 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAA8D;AAC9D,0CAA+C;AAC/C,2DAAyD;AACzD,qEAAkE;AAElE,4CAAuC;AACvC,iDAA4C;AAe5C,IAAa,gBAAgB;IAA7B;IAMA,CAAC;IALQ,wBAAO,GAAd;QACE,MAAM,CAAC;YACL,QAAQ,EAAE,kBAAgB;SAC3B,CAAC;IACJ,CAAC;IACH,uBAAC;AAAD,CAAC,AAND,IAMC;AANY,gBAAgB;IAb5B,eAAQ,CAAC;QACR,OAAO,EAAE;YACP,qBAAY;SACb;QACD,YAAY,EAAE;YACZ,kCAAe;YACf,2CAAmB;SACpB;QACD,OAAO,EAAE;YACP,kCAAe;YACf,2CAAmB;SACpB;KACF,CAAC;GACW,gBAAgB,CAM5B;AANY,4CAAgB"} \ No newline at end of file diff --git a/dist/index.metadata.json b/dist/index.metadata.json new file mode 100644 index 0000000..7c40fc4 --- /dev/null +++ b/dist/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":3,"metadata":{"FormWizardModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","module":"./src/wizard.component","name":"WizardComponent"},{"__symbolic":"reference","module":"./src/wizard-step.component","name":"WizardStepComponent"}],"exports":[{"__symbolic":"reference","module":"./src/wizard.component","name":"WizardComponent"},{"__symbolic":"reference","module":"./src/wizard-step.component","name":"WizardStepComponent"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"FormWizardModule"}}}}}},"exports":[{"from":"./src/wizard.component"},{"from":"./src/wizard-step.component"}]},{"__symbolic":"module","version":1,"metadata":{"FormWizardModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","module":"./src/wizard.component","name":"WizardComponent"},{"__symbolic":"reference","module":"./src/wizard-step.component","name":"WizardStepComponent"}],"exports":[{"__symbolic":"reference","module":"./src/wizard.component","name":"WizardComponent"},{"__symbolic":"reference","module":"./src/wizard-step.component","name":"WizardStepComponent"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"FormWizardModule"}}}}}},"exports":[{"from":"./src/wizard.component"},{"from":"./src/wizard-step.component"}]}] \ No newline at end of file diff --git a/dist/src/wizard-step.component.d.ts b/dist/src/wizard-step.component.d.ts new file mode 100644 index 0000000..2319ab3 --- /dev/null +++ b/dist/src/wizard-step.component.d.ts @@ -0,0 +1,16 @@ +import { OnInit, EventEmitter } from '@angular/core'; +export declare class WizardStepComponent implements OnInit { + title: string; + hidden: boolean; + isValid: boolean; + showNext: boolean; + showPrev: boolean; + onNext: EventEmitter; + onPrev: EventEmitter; + onComplete: EventEmitter; + private _isActive; + isDisabled: boolean; + constructor(); + ngOnInit(): void; + isActive: boolean; +} diff --git a/dist/src/wizard-step.component.js b/dist/src/wizard-step.component.js new file mode 100644 index 0000000..1b774e4 --- /dev/null +++ b/dist/src/wizard-step.component.js @@ -0,0 +1,82 @@ +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); +}; +import { Component, Input, Output, EventEmitter } from '@angular/core'; +var WizardStepComponent = (function () { + function WizardStepComponent() { + this.hidden = false; + this.isValid = true; + this.showNext = true; + this.showPrev = true; + this.onNext = new EventEmitter(); + this.onPrev = new EventEmitter(); + this.onComplete = new EventEmitter(); + this._isActive = false; + this.isDisabled = true; + } + WizardStepComponent.prototype.ngOnInit = function () { + }; + Object.defineProperty(WizardStepComponent.prototype, "isActive", { + get: function () { + return this._isActive; + }, + set: function (isActive) { + this._isActive = isActive; + this.isDisabled = false; + }, + enumerable: true, + configurable: true + }); + return WizardStepComponent; +}()); +__decorate([ + Input(), + __metadata("design:type", String) +], WizardStepComponent.prototype, "title", void 0); +__decorate([ + Input(), + __metadata("design:type", Boolean) +], WizardStepComponent.prototype, "hidden", void 0); +__decorate([ + Input(), + __metadata("design:type", Boolean) +], WizardStepComponent.prototype, "isValid", void 0); +__decorate([ + Input(), + __metadata("design:type", Boolean) +], WizardStepComponent.prototype, "showNext", void 0); +__decorate([ + Input(), + __metadata("design:type", Boolean) +], WizardStepComponent.prototype, "showPrev", void 0); +__decorate([ + Output(), + __metadata("design:type", EventEmitter) +], WizardStepComponent.prototype, "onNext", void 0); +__decorate([ + Output(), + __metadata("design:type", EventEmitter) +], WizardStepComponent.prototype, "onPrev", void 0); +__decorate([ + Output(), + __metadata("design:type", EventEmitter) +], WizardStepComponent.prototype, "onComplete", void 0); +__decorate([ + Input('isActive'), + __metadata("design:type", Boolean), + __metadata("design:paramtypes", [Boolean]) +], WizardStepComponent.prototype, "isActive", null); +WizardStepComponent = __decorate([ + Component({ + selector: 'wizard-step', + template: "\n
\n \n
\n " + }), + __metadata("design:paramtypes", []) +], WizardStepComponent); +export { WizardStepComponent }; diff --git a/dist/src/wizard-step.component.js.map b/dist/src/wizard-step.component.js.map new file mode 100644 index 0000000..f03a258 --- /dev/null +++ b/dist/src/wizard-step.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wizard-step.component.js","sourceRoot":"","sources":["../../src/wizard-step.component.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAA+E;AAW/E,IAAa,mBAAmB;IAc9B;QAZS,WAAM,GAAY,KAAK,CAAC;QACxB,YAAO,GAAY,IAAI,CAAC;QACxB,aAAQ,GAAY,IAAI,CAAC;QACzB,aAAQ,GAAY,IAAI,CAAC;QAExB,WAAM,GAAsB,IAAI,mBAAY,EAAO,CAAC;QACpD,WAAM,GAAsB,IAAI,mBAAY,EAAO,CAAC;QACpD,eAAU,GAAsB,IAAI,mBAAY,EAAO,CAAC;QAE1D,cAAS,GAAY,KAAK,CAAC;QACnC,eAAU,GAAY,IAAI,CAAC;IAEX,CAAC;IAEjB,sCAAQ,GAAR;IACA,CAAC;IAEkB,sBAAI,yCAAQ;aAK/B;YACE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;aAPkB,UAAa,QAAiB;YAC/C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAAA;IAMH,0BAAC;AAAD,CAAC,AA5BD,IA4BC;AA3BU;IAAR,YAAK,EAAE;;kDAAe;AACd;IAAR,YAAK,EAAE;;mDAAyB;AACxB;IAAR,YAAK,EAAE;;oDAAyB;AACxB;IAAR,YAAK,EAAE;;qDAA0B;AACzB;IAAR,YAAK,EAAE;;qDAA0B;AAExB;IAAT,aAAM,EAAE;8BAAS,mBAAY;mDAAgC;AACpD;IAAT,aAAM,EAAE;8BAAS,mBAAY;mDAAgC;AACpD;IAAT,aAAM,EAAE;8BAAa,mBAAY;uDAAgC;AAU/C;IAAlB,YAAK,CAAC,UAAU,CAAC;;;mDAGjB;AAtBU,mBAAmB;IAT/B,gBAAS,CAAC;QACT,QAAQ,EAAE,aAAa;QACvB,QAAQ,EACR,qFAIC;KACF,CAAC;;GACW,mBAAmB,CA4B/B;AA5BY,kDAAmB"} \ No newline at end of file diff --git a/dist/src/wizard-step.component.metadata.json b/dist/src/wizard-step.component.metadata.json new file mode 100644 index 0000000..ec2653a --- /dev/null +++ b/dist/src/wizard-step.component.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":3,"metadata":{"WizardStepComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"wizard-step","template":"\n
\n \n
\n "}]}],"members":{"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"hidden":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isValid":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"showNext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"showPrev":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onNext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onPrev":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onComplete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["isActive"]}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"WizardStepComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"wizard-step","template":"\n
\n \n
\n "}]}],"members":{"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"hidden":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"isValid":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"showNext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"showPrev":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onNext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onPrev":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onComplete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["isActive"]}]}]}}}}] \ No newline at end of file diff --git a/dist/src/wizard.component.d.ts b/dist/src/wizard.component.d.ts new file mode 100644 index 0000000..e652942 --- /dev/null +++ b/dist/src/wizard.component.d.ts @@ -0,0 +1,21 @@ +import { OnInit, EventEmitter, QueryList, AfterContentInit } from '@angular/core'; +import { WizardStepComponent } from './wizard-step.component'; +export declare class WizardComponent implements OnInit, AfterContentInit { + wizardSteps: QueryList; + private _steps; + private _isCompleted; + onStepChanged: EventEmitter; + constructor(); + ngOnInit(): void; + ngAfterContentInit(): void; + private readonly steps; + private readonly isCompleted; + private activeStep; + private readonly activeStepIndex; + private readonly hasNextStep; + private readonly hasPrevStep; + goToStep(step: WizardStepComponent): void; + next(): void; + previous(): void; + complete(): void; +} diff --git a/dist/src/wizard.component.js b/dist/src/wizard.component.js new file mode 100644 index 0000000..9015808 --- /dev/null +++ b/dist/src/wizard.component.js @@ -0,0 +1,127 @@ +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); +}; +import { Component, Output, EventEmitter, ContentChildren, QueryList } from '@angular/core'; +import { WizardStepComponent } from './wizard-step.component'; +var WizardComponent = (function () { + function WizardComponent() { + this._steps = []; + this._isCompleted = false; + this.onStepChanged = new EventEmitter(); + } + WizardComponent.prototype.ngOnInit = function () { + }; + WizardComponent.prototype.ngAfterContentInit = function () { + var _this = this; + this.wizardSteps.forEach(function (step) { return _this._steps.push(step); }); + this.steps[0].isActive = true; + }; + Object.defineProperty(WizardComponent.prototype, "steps", { + get: function () { + return this._steps.filter(function (step) { return !step.hidden; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WizardComponent.prototype, "isCompleted", { + get: function () { + return this._isCompleted; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WizardComponent.prototype, "activeStep", { + get: function () { + return this.steps.find(function (step) { return step.isActive; }); + }, + set: function (step) { + if (step !== this.activeStep && !step.isDisabled) { + this.activeStep.isActive = false; + step.isActive = true; + this.onStepChanged.emit(step); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WizardComponent.prototype, "activeStepIndex", { + get: function () { + return this.steps.indexOf(this.activeStep); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WizardComponent.prototype, "hasNextStep", { + get: function () { + return this.activeStepIndex < this.steps.length - 1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WizardComponent.prototype, "hasPrevStep", { + get: function () { + return this.activeStepIndex > 0; + }, + enumerable: true, + configurable: true + }); + WizardComponent.prototype.goToStep = function (step) { + if (!this.isCompleted) { + this.activeStep = step; + } + }; + WizardComponent.prototype.next = function () { + if (this.hasNextStep) { + var nextStep = this.steps[this.activeStepIndex + 1]; + this.activeStep.onNext.emit(); + nextStep.isDisabled = false; + this.activeStep = nextStep; + } + }; + WizardComponent.prototype.previous = function () { + if (this.hasPrevStep) { + var prevStep = this.steps[this.activeStepIndex - 1]; + this.activeStep.onPrev.emit(); + prevStep.isDisabled = false; + this.activeStep = prevStep; + } + }; + WizardComponent.prototype.complete = function () { + this.activeStep.onComplete.emit(); + this._isCompleted = true; + }; + return WizardComponent; +}()); +__decorate([ + ContentChildren(WizardStepComponent), + __metadata("design:type", QueryList) +], WizardComponent.prototype, "wizardSteps", void 0); +__decorate([ + Output(), + __metadata("design:type", EventEmitter) +], WizardComponent.prototype, "onStepChanged", void 0); +WizardComponent = __decorate([ + Component({ + selector: 'form-wizard', + template: "
\n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
", + styles: [ + '.card { height: 100%; }', + '.card-header { background-color: #fff; padding: 0; font-size: 1.25rem; }', + '.card-block { overflow-y: auto; }', + '.card-footer { background-color: #fff; border-top: 0 none; }', + '.nav-item { padding: 1rem 0rem; border-bottom: 0.5rem solid #ccc; }', + '.active { font-weight: bold; color: black; border-bottom-color: #1976D2 !important; }', + '.enabled { cursor: pointer; border-bottom-color: rgb(88, 162, 234); }', + '.disabled { color: #ccc; }', + '.completed { cursor: default; }' + ] + }), + __metadata("design:paramtypes", []) +], WizardComponent); +export { WizardComponent }; diff --git a/dist/src/wizard.component.js.map b/dist/src/wizard.component.js.map new file mode 100644 index 0000000..2c5c299 --- /dev/null +++ b/dist/src/wizard.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wizard.component.js","sourceRoot":"","sources":["../../src/wizard.component.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAsH;AACtH,iEAA8D;AAmC9D,IAAa,eAAe;IAU1B;QANQ,WAAM,GAA+B,EAAE,CAAC;QACxC,iBAAY,GAAY,KAAK,CAAC;QAGtC,kBAAa,GAAsC,IAAI,mBAAY,EAAuB,CAAC;IAE3E,CAAC;IAEjB,kCAAQ,GAAR;IACA,CAAC;IAED,4CAAkB,GAAlB;QAAA,iBAGC;QAFC,IAAI,CAAC,WAA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BAAS,CAAC;QACT,QAAQ,EAAE,aAAa;QACvB,QAAQ,EACR,siCAgBO;QAEP,MAAM,EAAE;YACN,yBAAyB;YACzB,0EAA0E;YAC1E,mCAAmC;YACnC,8DAA8D;YAC9D,qEAAqE;YACrE,uFAAuF;YACvF,uEAAuE;YACvE,4BAA4B;YAC5B,iCAAiC;SAClC;KACF,CAAC;;GACW,eAAe,CAiF3B;AAjFY,0CAAe"} \ No newline at end of file diff --git a/dist/src/wizard.component.metadata.json b/dist/src/wizard.component.metadata.json new file mode 100644 index 0000000..b7099e7 --- /dev/null +++ b/dist/src/wizard.component.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":3,"metadata":{"WizardComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"form-wizard","template":"
\n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
","styles":[".card { height: 100%; }",".card-header { background-color: #fff; padding: 0; font-size: 1.25rem; }",".card-block { overflow-y: auto; }",".card-footer { background-color: #fff; border-top: 0 none; }",".nav-item { padding: 1rem 0rem; border-bottom: 0.5rem solid #ccc; }",".active { font-weight: bold; color: black; border-bottom-color: #1976D2 !important; }",".enabled { cursor: pointer; border-bottom-color: rgb(88, 162, 234); }",".disabled { color: #ccc; }",".completed { cursor: default; }"]}]}],"members":{"wizardSteps":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren"},"arguments":[{"__symbolic":"reference","module":"./wizard-step.component","name":"WizardStepComponent"}]}]}],"onStepChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterContentInit":[{"__symbolic":"method"}],"goToStep":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"previous":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"WizardComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"form-wizard","template":"
\n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
","styles":[".card { height: 100%; }",".card-header { background-color: #fff; padding: 0; font-size: 1.25rem; }",".card-block { overflow-y: auto; }",".card-footer { background-color: #fff; border-top: 0 none; }",".nav-item { padding: 1rem 0rem; border-bottom: 0.5rem solid #ccc; }",".active { font-weight: bold; color: black; border-bottom-color: #1976D2 !important; }",".enabled { cursor: pointer; border-bottom-color: rgb(88, 162, 234); }",".disabled { color: #ccc; }",".completed { cursor: default; }"]}]}],"members":{"wizardSteps":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren"},"arguments":[{"__symbolic":"reference","module":"./wizard-step.component","name":"WizardStepComponent"}]}]}],"onStepChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterContentInit":[{"__symbolic":"method"}],"goToStep":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"previous":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/package.json b/package.json index 24d3c83..29e0e61 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "lint": "tslint src/**/*.ts", "test": "karma start karma.conf.js", "prepublish": "tsc", - "tsc": "tsc" + "tsc": "tsc", + "build:aot": "rimraf build && ngc -p tsconfig-aot.json" }, "repository": { "type": "git", diff --git a/tsconfig-aot.json b/tsconfig-aot.json new file mode 100644 index 0000000..17c5f6a --- /dev/null +++ b/tsconfig-aot.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "noImplicitAny": false, + "module": "es2015", + "target": "ES5", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": false, + "declaration": true, + "outDir": "./dist", + "typeRoots": [ + "node_modules/@types" + ] + }, + "files": [ + "index.ts" + ], + "exclude": [ + "node_modules", + "dist", + "**/*.spec.ts" + ], + "angularCompilerOptions": { + "genDir": "aot", + "strictMetadataEmit": true + } +} From 24356d1c6e39e2c651c140ecd7a7dd1d92f1a7de Mon Sep 17 00:00:00 2001 From: Shawn Dao Date: Tue, 18 Apr 2017 08:48:01 +0700 Subject: [PATCH 2/3] happy aot build --- dist/src/wizard.component.d.ts | 2 +- src/wizard.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/src/wizard.component.d.ts b/dist/src/wizard.component.d.ts index e652942..e19cc1b 100644 --- a/dist/src/wizard.component.d.ts +++ b/dist/src/wizard.component.d.ts @@ -8,7 +8,7 @@ export declare class WizardComponent implements OnInit, AfterContentInit { constructor(); ngOnInit(): void; ngAfterContentInit(): void; - private readonly steps; + readonly steps: Array; private readonly isCompleted; private activeStep; private readonly activeStepIndex; diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 20e8bb9..34e0d85 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -54,7 +54,7 @@ export class WizardComponent implements OnInit, AfterContentInit { this.steps[0].isActive = true; } - private get steps(): Array { + public get steps(): Array { return this._steps.filter(step => !step.hidden); } From 4466c37c6cf3678b414a2acc342533b55ff2b367 Mon Sep 17 00:00:00 2001 From: Juan Calderin Date: Mon, 17 Apr 2017 22:44:15 -0400 Subject: [PATCH 3/3] Adding variable for pagination at the top --- src/wizard.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 34e0d85..429eae8 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -1,10 +1,15 @@ -import { Component, OnInit, Output, EventEmitter, ContentChildren, QueryList, AfterContentInit } from '@angular/core'; +import { Component, OnInit, Output, Input, EventEmitter, ContentChildren, QueryList, AfterContentInit } from '@angular/core'; import { WizardStepComponent } from './wizard-step.component'; @Component({ selector: 'form-wizard', template: `
+