diff --git a/package-lock.json b/package-lock.json index b021ebc09..06ea16c08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "flex-layout-srcs", - "version": "5.0.0-beta.13", + "version": "5.0.0-beta.14", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2393,7 +2393,7 @@ }, "compression": { "version": "1.7.2", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.2.tgz", + "resolved": "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz", "integrity": "sha1-qv+81qr4VLROuygDU9WtFlH1mmk=", "dev": true, "requires": { @@ -4505,7 +4505,7 @@ }, "event-stream": { "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "dev": true, "requires": { @@ -13748,7 +13748,7 @@ }, "onetime": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "dev": true }, diff --git a/package.json b/package.json index 1ec855ba8..0c38aa867 100644 --- a/package.json +++ b/package.json @@ -127,4 +127,4 @@ "typescript": "~2.6.2", "uglify-js": "^2.8.14" } -} \ No newline at end of file +} diff --git a/src/lib/core/module.ts b/src/lib/core/module.ts index 7fcafe4f4..55f21a55a 100644 --- a/src/lib/core/module.ts +++ b/src/lib/core/module.ts @@ -15,6 +15,7 @@ import {MATCH_MEDIA_PROVIDER} from './match-media/match-media-provider'; import {BROWSER_PROVIDER} from './browser-provider'; import {StyleUtils} from './style-utils/style-utils'; import {STYLESHEET_MAP_PROVIDER} from './stylesheet-map/stylesheet-map-provider'; +import {FLEX_STYLES_PROVIDER} from './tokens/flex-styles-token'; /** * ***************************************************************** @@ -32,6 +33,7 @@ import {STYLESHEET_MAP_PROVIDER} from './stylesheet-map/stylesheet-map-provider' STYLESHEET_MAP_PROVIDER, StyleUtils, BROWSER_PROVIDER, + FLEX_STYLES_PROVIDER, ] }) export class CoreModule { diff --git a/src/lib/core/tokens/flex-styles-token.ts b/src/lib/core/tokens/flex-styles-token.ts index 848c9b700..d8d04222e 100644 --- a/src/lib/core/tokens/flex-styles-token.ts +++ b/src/lib/core/tokens/flex-styles-token.ts @@ -9,3 +9,12 @@ import {InjectionToken} from '@angular/core'; export const ADD_FLEX_STYLES = new InjectionToken( 'Flex Layout token, should flex stylings be applied to parents automatically'); + +/** + * @deprecated + * @deletion-target v6.0.0-beta.15 + */ +export const FLEX_STYLES_PROVIDER = { + provide: ADD_FLEX_STYLES, + useValue: true +}; diff --git a/src/lib/flex/flex/flex.spec.ts b/src/lib/flex/flex/flex.spec.ts index dae78c970..f4c3d652c 100644 --- a/src/lib/flex/flex/flex.spec.ts +++ b/src/lib/flex/flex/flex.spec.ts @@ -219,7 +219,7 @@ describe('flex directive', () => { } }); - it('should not work with non-direct-parent fxLayouts', async(() => { + it('should work with non-direct-parent fxLayouts', async(() => { componentWithTemplate(`
@@ -235,7 +235,7 @@ describe('flex directive', () => { // The parent flex-direction not found; // A flex-direction should have been auto-injected to the parent... // fallback to 'row' and set child width styles accordingly - expectEl(parent).not.toHaveStyle({'flex-direction': 'row'}, styler); + expectEl(parent).toHaveStyle({'flex-direction': 'row'}, styler); expectEl(element).toHaveStyle({'min-width': '40px'}, styler); expectEl(element).not.toHaveStyle({'min-height': '40px'}, styler); }); @@ -686,7 +686,7 @@ describe('flex directive', () => { ); }); - describe('with flex token enabled', () => { + describe('with flex token disabled', () => { beforeEach(() => { jasmine.addMatchers(customMatchers); @@ -697,7 +697,7 @@ describe('flex directive', () => { providers: [ MockMatchMediaProvider, {provide: SERVER_TOKEN, useValue: true}, - {provide: ADD_FLEX_STYLES, useValue: true}, + {provide: ADD_FLEX_STYLES, useValue: false}, ] }); }); @@ -718,7 +718,7 @@ describe('flex directive', () => { // The parent flex-direction not found; // A flex-direction should have been auto-injected to the parent... // fallback to 'row' and set child width styles accordingly - expectEl(parent).toHaveStyle({'flex-direction': 'row'}, styler); + expectEl(parent).not.toHaveStyle({'flex-direction': 'row'}, styler); expectEl(element).toHaveStyle({'min-width': '40px'}, styler); expectEl(element).not.toHaveStyle({'min-height': '40px'}, styler); }); @@ -758,7 +758,7 @@ describe('flex directive', () => { // The parent flex-direction not found; // A flex-direction should have been auto-injected to the parent... // fallback to 'row' and set child width styles accordingly - expectEl(parent).not.toHaveStyle({'-webkit-flex-direction': 'row'}, styler); + expect(parent.nativeElement.getAttribute('style')).not.toContain('-webkit-flex-direction'); expectEl(element).toHaveStyle({'min-width': '40px'}, styler); expectEl(element).not.toHaveStyle({'min-height': '40px'}, styler); });