From 8ca71dfad2040b9b21558dbc6fdc04ac588d2476 Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Sun, 15 Apr 2018 15:34:45 -0400 Subject: [PATCH 1/8] Text button replace for translate --- src/wizard.component.ts | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 8953f89a..d1359955 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -1,4 +1,4 @@ -import { Component, Output, EventEmitter, ContentChildren, QueryList, AfterContentInit } from '@angular/core'; +import { Component, Output, Input, EventEmitter, ContentChildren, QueryList, AfterContentInit } from '@angular/core'; import { WizardStepComponent } from './wizard-step.component'; @Component({ @@ -16,9 +16,9 @@ import { WizardStepComponent } from './wizard-step.component'; ` , @@ -44,6 +44,16 @@ export class WizardComponent implements AfterContentInit { @Output() onStepChanged: EventEmitter = new EventEmitter(); + @Input() + previousText: string = "Previous"; + + @Input() + nextText: string = "Next"; + + @Input() + doneText: string = "Done"; + + constructor() { } ngAfterContentInit() { @@ -111,5 +121,20 @@ export class WizardComponent implements AfterContentInit { this.activeStep.onComplete.emit(); this._isCompleted = true; } + /* + * + */ + public reset(force: boolean = false): void { + if (this._isCompleted || force){ + this.steps.forEach((step)=>{ + step.isValid = false; + step.isActive = false; + step.isDisabled = false; + }); + + this.steps[0].isActive = true; + this._isCompleted = false; + } + } } From 02c961581e035f237ccfa3e966abd96fb5ae1004 Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Sun, 15 Apr 2018 15:51:48 -0400 Subject: [PATCH 2/8] Modify README.MD new explain text buttons --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 11b6372a..c5d7cf3f 100644 --- a/README.MD +++ b/README.MD @@ -54,7 +54,7 @@ Once your library is imported, you can use form-wizard and wizard-step component ```xml - +

Step1

From f4c8abf45ecf5bd170519d41a51b78bba353489e Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Sun, 15 Apr 2018 15:55:10 -0400 Subject: [PATCH 3/8] Modify README.MD new explain text buttons --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index c5d7cf3f..87878eb1 100644 --- a/README.MD +++ b/README.MD @@ -54,7 +54,7 @@ Once your library is imported, you can use form-wizard and wizard-step component ```xml - +

Step1

From dd2e74ec376089e4155d02de80a35b67a499fb72 Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Sun, 15 Apr 2018 16:06:53 -0400 Subject: [PATCH 4/8] Fix method reset --- src/wizard.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wizard.component.ts b/src/wizard.component.ts index d1359955..8ab44224 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -126,13 +126,13 @@ export class WizardComponent implements AfterContentInit { */ public reset(force: boolean = false): void { if (this._isCompleted || force){ + this.activeStep = this.steps[0]; this.steps.forEach((step)=>{ - step.isValid = false; - step.isActive = false; - step.isDisabled = false; + step.isDisabled = true; }); - this.steps[0].isActive = true; + this.activeStep.isDisabled = false; + this.activeStep.isActive = true; this._isCompleted = false; } } From ed3345ac89f036ada5687e4cb07d9f21785002e3 Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Sun, 15 Apr 2018 22:53:22 -0400 Subject: [PATCH 5/8] Fix compatibility angular 4 and bootstrap 3 --- package.json | 2 +- src/wizard.component.ts | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 815f529e..45f9f6f3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "angular2-wizard", + "name": "@3dluis/angular2-wizard", "version": "0.3.0", "scripts": { "build": "ngc -p tsconfig.json", diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 8ab44224..1c8e1469 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -15,10 +15,10 @@ import { WizardStepComponent } from './wizard-step.component';
- ` , @@ -45,13 +45,13 @@ export class WizardComponent implements AfterContentInit { onStepChanged: EventEmitter = new EventEmitter(); @Input() - previousText: string = "Previous"; + previousText: string = 'Previous'; @Input() - nextText: string = "Next"; + nextText: string = 'Next'; @Input() - doneText: string = "Done"; + doneText: string = 'Done'; constructor() { } @@ -131,9 +131,13 @@ export class WizardComponent implements AfterContentInit { step.isDisabled = true; }); + this._isCompleted = false; this.activeStep.isDisabled = false; this.activeStep.isActive = true; - this._isCompleted = false; + + setTimeout(()=>{ + this._isCompleted = false; + }, 1000); } } From 7193392164bc484636226acdf5729fb1f9d36f6d Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Tue, 17 Nov 2020 11:52:02 -0400 Subject: [PATCH 6/8] Upgrade angular 5+ --- package.json | 31 ++++++++++++++++--------------- src/wizard-step.component.ts | 8 ++++++-- src/wizard.component.ts | 8 ++++++-- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 45f9f6f3..c2253047 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@3dluis/angular2-wizard", - "version": "0.3.0", + "version": "0.4.0", "scripts": { "build": "ngc -p tsconfig.json", "lint": "tslint src/**/*.ts", @@ -16,6 +16,7 @@ "name": "Maiyaporn Phanich", "email": "p.maiyaporn@gmail.com" }, + "typings": "./dist/index.d.ts", "keywords": [ "angular2-wizard", "form-wizard", @@ -33,18 +34,18 @@ "bootstrap": "^4.0.0-alpha.6" }, "devDependencies": { - "@angular/common": "^2.3.1", - "@angular/compiler": "^2.3.1", - "@angular/compiler-cli": "^2.3.1", - "@angular/core": "^2.3.1", - "@angular/platform-browser": "^2.3.1", - "@angular/platform-browser-dynamic": "^2.3.1", - "@angular/platform-server": "^2.3.1", + "@angular/common": "^4.0.2", + "@angular/compiler": "^4.0.2", + "@angular/compiler-cli": "^4.0.2", + "@angular/core": "^4.0.2", + "@angular/platform-browser": "^4.0.2", + "@angular/platform-browser-dynamic": "^4.0.2", + "@angular/platform-server": "^4.0.2", "@types/es6-shim": "^0.31.32", "@types/jasmine": "^2.5.42", - "@types/selenium-webdriver": "^2.53.39", + "@types/selenium-webdriver": "^3.0.1", "awesome-typescript-loader": "^3.0.4-rc.2", - "codelyzer": "^0.0.28", + "codelyzer": "^2.1.1", "istanbul-instrumenter-loader": "^2.0.0", "jasmine-core": "^2.5.2", "karma": "^1.4.1", @@ -55,13 +56,13 @@ "karma-remap-coverage": "^0.1.4", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^2.0.2", - "rxjs": "^5.0.1", - "source-map-loader": "^0.1.6", + "rxjs": "^5.1.0", + "source-map-loader": "^0.2.1", "ts-helpers": "^1.1.2", - "tslint": "^3.15.1", - "typescript": "^2.1.6", + "tslint": "~4.0.0", + "typescript": "^2.2.1", "webpack": "^2.2.1", - "zone.js": "0.7.2" + "zone.js": "0.8.5" }, "engines": { "node": ">=0.8.0" diff --git a/src/wizard-step.component.ts b/src/wizard-step.component.ts index 1c457dc3..f25cb113 100644 --- a/src/wizard-step.component.ts +++ b/src/wizard-step.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Output, EventEmitter } from '@angular/core'; +import {Component, Input, Output, EventEmitter, OnInit} from '@angular/core'; @Component({ selector: 'wizard-step', @@ -9,7 +9,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
` }) -export class WizardStepComponent { +export class WizardStepComponent implements OnInit { @Input() title: string; @Input() hidden: boolean = false; @Input() isValid: boolean = true; @@ -25,6 +25,10 @@ export class WizardStepComponent { constructor() { } + ngOnInit(){ + + } + @Input('isActive') set isActive(isActive: boolean) { this._isActive = isActive; diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 1c8e1469..69144dbe 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -1,4 +1,4 @@ -import { Component, Output, Input, EventEmitter, ContentChildren, QueryList, AfterContentInit } from '@angular/core'; +import {Component, Output, Input, EventEmitter, ContentChildren, QueryList, AfterContentInit, OnInit} from '@angular/core'; import { WizardStepComponent } from './wizard-step.component'; @Component({ @@ -34,7 +34,7 @@ import { WizardStepComponent } from './wizard-step.component'; '.completed { cursor: default; }' ] }) -export class WizardComponent implements AfterContentInit { +export class WizardComponent implements OnInit, AfterContentInit { @ContentChildren(WizardStepComponent) wizardSteps: QueryList; @@ -56,6 +56,10 @@ export class WizardComponent implements AfterContentInit { constructor() { } + ngOnInit(){ + + } + ngAfterContentInit() { this.wizardSteps.forEach(step => this._steps.push(step)); this.steps[0].isActive = true; From 911bea9ab8e2f75c196c0e964e5d27ab3987a914 Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Tue, 17 Nov 2020 12:06:53 -0400 Subject: [PATCH 7/8] Upgrade angular 5+ --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index c2253047..6f8247e6 100644 --- a/package.json +++ b/package.json @@ -66,5 +66,8 @@ }, "engines": { "node": ">=0.8.0" + }, + "_comment01": { + "typings": "./dist/index.d.ts" } } From b2a0a54dbf600478f03ccb22b13008e5676f9ec4 Mon Sep 17 00:00:00 2001 From: Luis Diaz Date: Tue, 17 Nov 2020 12:20:40 -0400 Subject: [PATCH 8/8] Upgrade angular 5+ --- src/wizard-step.component.spec.ts | 14 ++++++-------- src/wizard.component.spec.ts | 6 ++---- src/wizard.component.ts | 9 +++++---- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/wizard-step.component.spec.ts b/src/wizard-step.component.spec.ts index 31671b07..7fa600cf 100644 --- a/src/wizard-step.component.spec.ts +++ b/src/wizard-step.component.spec.ts @@ -14,15 +14,13 @@ describe('Wizard Step Component', () => { TestBed.compileComponents(); }); - describe('when create wizard step', () => { - it('should have a title', () => { - let fixture = TestBed.createComponent(WizardStepComponent); - fixture.componentInstance.title = 'Step1'; +it('should have a title', () => { + let fixture = TestBed.createComponent(WizardStepComponent); + fixture.componentInstance.title = 'Step1'; - fixture.detectChanges(); + fixture.detectChanges(); - expect(fixture.componentInstance.title).toBe('Step1'); - }); - }); + expect(fixture.componentInstance.title).toBe('Step1'); +}); }); diff --git a/src/wizard.component.spec.ts b/src/wizard.component.spec.ts index 7e2d6dee..f4029796 100644 --- a/src/wizard.component.spec.ts +++ b/src/wizard.component.spec.ts @@ -14,10 +14,8 @@ describe('Wizard Component', () => { TestBed.compileComponents(); }); - describe('', () => { - it('', () => { - let fixture = TestBed.createComponent(WizardComponent); - }); + it('should create the app', () => { + const fixture = TestBed.createComponent(WizardComponent); }); }); diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 69144dbe..e8c02b89 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -7,7 +7,8 @@ import { WizardStepComponent } from './wizard-step.component'; `
@@ -129,9 +130,9 @@ export class WizardComponent implements OnInit, AfterContentInit { * */ public reset(force: boolean = false): void { - if (this._isCompleted || force){ + if (this._isCompleted || force) { this.activeStep = this.steps[0]; - this.steps.forEach((step)=>{ + this.steps.forEach((step) => { step.isDisabled = true; }); @@ -139,7 +140,7 @@ export class WizardComponent implements OnInit, AfterContentInit { this.activeStep.isDisabled = false; this.activeStep.isActive = true; - setTimeout(()=>{ + setTimeout(() => { this._isCompleted = false; }, 1000); }