diff --git a/CHANGELOG.md b/CHANGELOG.md index afeaf3f..cea4e20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.6.0](https://github.com/ngneat/dialog/compare/v1.5.0...v1.6.0) (2021-03-21) + + +### Features + +* allow multiple classes to be set from windowClass ([5ac3297](https://github.com/ngneat/dialog/commit/5ac3297fb664c4cd104b00648ebe21f09df55e72)) +* allow multiple classes to be set from windowClass ([d60ee41](https://github.com/ngneat/dialog/commit/d60ee4142436137e2d0c6ce2f75848796e8b717b)) + ## [1.5.0](https://github.com/ngneat/dialog/compare/v1.4.1...v1.5.0) (2021-03-16) diff --git a/projects/ngneat/dialog/package.json b/projects/ngneat/dialog/package.json index d347282..3808c4e 100644 --- a/projects/ngneat/dialog/package.json +++ b/projects/ngneat/dialog/package.json @@ -1,6 +1,6 @@ { "name": "@ngneat/dialog", - "version": "1.5.0", + "version": "1.6.0", "schematics": "./schematics/collection.json", "description": "Simple to use, highly customizable, and powerful modal for Angular Apps", "dependencies": { diff --git a/projects/ngneat/dialog/src/lib/dialog.component.spec.ts b/projects/ngneat/dialog/src/lib/dialog.component.spec.ts index 8c7734c..a945aa8 100644 --- a/projects/ngneat/dialog/src/lib/dialog.component.spec.ts +++ b/projects/ngneat/dialog/src/lib/dialog.component.spec.ts @@ -215,4 +215,13 @@ describe('DialogComponent', () => { expect(host).toBeTruthy(); expect(host).toBe(spectator.fixture.nativeElement); }); + + it('should set multiple classes from windowClass at host element', () => { + spectator = createComponent(withConfig({ windowClass: ' test-class-1 test-class-2 ' })); + + const host = spectator.query('.test-class-1.test-class-2', { root: true }); + + expect(host).toBeTruthy(); + expect(host).toBe(spectator.fixture.nativeElement); + }); }); diff --git a/projects/ngneat/dialog/src/lib/dialog.component.ts b/projects/ngneat/dialog/src/lib/dialog.component.ts index 1ef3954..7e4d4d2 100644 --- a/projects/ngneat/dialog/src/lib/dialog.component.ts +++ b/projects/ngneat/dialog/src/lib/dialog.component.ts @@ -74,7 +74,8 @@ export class DialogComponent implements OnInit, OnDestroy { this.nodes.forEach(node => host.appendChild(node)); if (config.windowClass) { - host.classList.add(config.windowClass); + const classNames = config.windowClass.split(/\s/).filter(x => x); + classNames.forEach(name => host.classList.add(name)); } }