@dugararchit/flex-layout 13.0.0-dugararchit

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/README.md +7 -0
  2. package/_private-utils/angular-flex-layout-_private-utils.d.ts +5 -0
  3. package/_private-utils/auto-prefixer.d.ts +24 -0
  4. package/_private-utils/index.d.ts +10 -0
  5. package/_private-utils/layout-validator.d.ts +32 -0
  6. package/_private-utils/object-extend.d.ts +15 -0
  7. package/_private-utils/package.json +10 -0
  8. package/_private-utils/testing/angular-flex-layout-_private-utils-testing.d.ts +5 -0
  9. package/_private-utils/testing/custom-matchers.d.ts +65 -0
  10. package/_private-utils/testing/dom-tools.d.ts +47 -0
  11. package/_private-utils/testing/helpers.d.ts +24 -0
  12. package/_private-utils/testing/index.d.ts +10 -0
  13. package/_private-utils/testing/package.json +10 -0
  14. package/angular-flex-layout-13.0.0-beta.38.tgz +0 -0
  15. package/angular-flex-layout.d.ts +5 -0
  16. package/core/README.md +25 -0
  17. package/core/add-alias.d.ts +14 -0
  18. package/core/angular-flex-layout-core.d.ts +5 -0
  19. package/core/base/base2.d.ts +60 -0
  20. package/core/base/index.d.ts +8 -0
  21. package/core/basis-validator/basis-validator.d.ts +13 -0
  22. package/core/breakpoints/break-point-registry.d.ts +42 -0
  23. package/core/breakpoints/break-point.d.ts +14 -0
  24. package/core/breakpoints/break-points-token.d.ts +14 -0
  25. package/core/breakpoints/breakpoint-tools.d.ts +19 -0
  26. package/core/breakpoints/data/break-points.d.ts +12 -0
  27. package/core/breakpoints/data/orientation-break-points.d.ts +23 -0
  28. package/core/breakpoints/index.d.ts +12 -0
  29. package/core/browser-provider.d.ts +24 -0
  30. package/core/match-media/index.d.ts +9 -0
  31. package/core/match-media/match-media.d.ts +59 -0
  32. package/core/match-media/mock/mock-match-media.d.ts +92 -0
  33. package/core/media-change.d.ts +30 -0
  34. package/core/media-marshaller/media-marshaller.d.ts +123 -0
  35. package/core/media-marshaller/print-hook.d.ts +95 -0
  36. package/core/media-observer/index.d.ts +8 -0
  37. package/core/media-observer/media-observer.d.ts +115 -0
  38. package/core/media-trigger/index.d.ts +8 -0
  39. package/core/media-trigger/media-trigger.d.ts +73 -0
  40. package/core/module.d.ts +11 -0
  41. package/core/multiply/multiplier.d.ts +5 -0
  42. package/core/package.json +10 -0
  43. package/core/public-api.d.ts +25 -0
  44. package/core/sass/_layout-bp.scss +76 -0
  45. package/core/style-builder/style-builder.d.ts +21 -0
  46. package/core/style-utils/style-utils.d.ts +53 -0
  47. package/core/stylesheet-map/index.d.ts +8 -0
  48. package/core/stylesheet-map/stylesheet-map.d.ts +24 -0
  49. package/core/tokens/breakpoint-token.d.ts +10 -0
  50. package/core/tokens/index.d.ts +10 -0
  51. package/core/tokens/library-config.d.ts +26 -0
  52. package/core/tokens/server-token.d.ts +15 -0
  53. package/core/utils/array.d.ts +9 -0
  54. package/core/utils/index.d.ts +9 -0
  55. package/core/utils/sort.d.ts +15 -0
  56. package/esm2020/_private-utils/angular-flex-layout-_private-utils.mjs +5 -0
  57. package/esm2020/_private-utils/auto-prefixer.mjs +65 -0
  58. package/esm2020/_private-utils/index.mjs +11 -0
  59. package/esm2020/_private-utils/layout-validator.mjs +83 -0
  60. package/esm2020/_private-utils/object-extend.mjs +30 -0
  61. package/esm2020/_private-utils/testing/angular-flex-layout-_private-utils-testing.mjs +5 -0
  62. package/esm2020/_private-utils/testing/custom-matchers.mjs +201 -0
  63. package/esm2020/_private-utils/testing/dom-tools.mjs +101 -0
  64. package/esm2020/_private-utils/testing/helpers.mjs +43 -0
  65. package/esm2020/_private-utils/testing/index.mjs +11 -0
  66. package/esm2020/angular-flex-layout.mjs +5 -0
  67. package/esm2020/core/add-alias.mjs +23 -0
  68. package/esm2020/core/angular-flex-layout-core.mjs +5 -0
  69. package/esm2020/core/base/base2.mjs +131 -0
  70. package/esm2020/core/base/index.mjs +9 -0
  71. package/esm2020/core/basis-validator/basis-validator.mjs +48 -0
  72. package/esm2020/core/breakpoints/break-point-registry.mjs +76 -0
  73. package/esm2020/core/breakpoints/break-point.mjs +2 -0
  74. package/esm2020/core/breakpoints/break-points-token.mjs +30 -0
  75. package/esm2020/core/breakpoints/breakpoint-tools.mjs +53 -0
  76. package/esm2020/core/breakpoints/data/break-points.mjs +78 -0
  77. package/esm2020/core/breakpoints/data/orientation-break-points.mjs +40 -0
  78. package/esm2020/core/breakpoints/index.mjs +13 -0
  79. package/esm2020/core/browser-provider.mjs +41 -0
  80. package/esm2020/core/match-media/index.mjs +10 -0
  81. package/esm2020/core/match-media/match-media.mjs +186 -0
  82. package/esm2020/core/match-media/mock/mock-match-media.mjs +224 -0
  83. package/esm2020/core/media-change.mjs +25 -0
  84. package/esm2020/core/media-marshaller/media-marshaller.mjs +317 -0
  85. package/esm2020/core/media-marshaller/print-hook.mjs +265 -0
  86. package/esm2020/core/media-observer/index.mjs +9 -0
  87. package/esm2020/core/media-observer/media-observer.mjs +195 -0
  88. package/esm2020/core/media-trigger/index.mjs +9 -0
  89. package/esm2020/core/media-trigger/media-trigger.mjs +188 -0
  90. package/esm2020/core/module.mjs +27 -0
  91. package/esm2020/core/multiply/multiplier.mjs +16 -0
  92. package/esm2020/core/public-api.mjs +26 -0
  93. package/esm2020/core/style-builder/style-builder.mjs +15 -0
  94. package/esm2020/core/style-utils/style-utils.mjs +174 -0
  95. package/esm2020/core/stylesheet-map/index.mjs +9 -0
  96. package/esm2020/core/stylesheet-map/stylesheet-map.mjs +59 -0
  97. package/esm2020/core/tokens/breakpoint-token.mjs +13 -0
  98. package/esm2020/core/tokens/index.mjs +11 -0
  99. package/esm2020/core/tokens/library-config.mjs +30 -0
  100. package/esm2020/core/tokens/server-token.mjs +19 -0
  101. package/esm2020/core/utils/array.mjs +12 -0
  102. package/esm2020/core/utils/index.mjs +10 -0
  103. package/esm2020/core/utils/sort.mjs +20 -0
  104. package/esm2020/extended/angular-flex-layout-extended.mjs +5 -0
  105. package/esm2020/extended/class/class.mjs +88 -0
  106. package/esm2020/extended/img-src/img-src.mjs +106 -0
  107. package/esm2020/extended/module.mjs +45 -0
  108. package/esm2020/extended/public-api.mjs +13 -0
  109. package/esm2020/extended/show-hide/show-hide.mjs +176 -0
  110. package/esm2020/extended/style/style-transforms.mjs +76 -0
  111. package/esm2020/extended/style/style.mjs +130 -0
  112. package/esm2020/flex/angular-flex-layout-flex.mjs +5 -0
  113. package/esm2020/flex/flex/flex.mjs +291 -0
  114. package/esm2020/flex/flex-align/flex-align.mjs +80 -0
  115. package/esm2020/flex/flex-fill/flex-fill.mjs +50 -0
  116. package/esm2020/flex/flex-offset/flex-offset.mjs +121 -0
  117. package/esm2020/flex/flex-order/flex-order.mjs +66 -0
  118. package/esm2020/flex/layout/layout.mjs +86 -0
  119. package/esm2020/flex/layout-align/layout-align.mjs +194 -0
  120. package/esm2020/flex/layout-gap/layout-gap.mjs +282 -0
  121. package/esm2020/flex/module.mjs +62 -0
  122. package/esm2020/flex/public-api.mjs +17 -0
  123. package/esm2020/grid/align-columns/align-columns.mjs +137 -0
  124. package/esm2020/grid/align-rows/align-rows.mjs +119 -0
  125. package/esm2020/grid/angular-flex-layout-grid.mjs +5 -0
  126. package/esm2020/grid/area/area.mjs +67 -0
  127. package/esm2020/grid/areas/areas.mjs +86 -0
  128. package/esm2020/grid/auto/auto.mjs +89 -0
  129. package/esm2020/grid/column/column.mjs +67 -0
  130. package/esm2020/grid/columns/columns.mjs +96 -0
  131. package/esm2020/grid/gap/gap.mjs +85 -0
  132. package/esm2020/grid/grid-align/grid-align.mjs +111 -0
  133. package/esm2020/grid/module.mjs +73 -0
  134. package/esm2020/grid/public-api.mjs +20 -0
  135. package/esm2020/grid/row/row.mjs +67 -0
  136. package/esm2020/grid/rows/rows.mjs +96 -0
  137. package/esm2020/module.mjs +64 -0
  138. package/esm2020/public-api.mjs +20 -0
  139. package/esm2020/server/angular-flex-layout-server.mjs +5 -0
  140. package/esm2020/server/module.mjs +22 -0
  141. package/esm2020/server/public-api.mjs +10 -0
  142. package/esm2020/server/server-match-media.mjs +151 -0
  143. package/esm2020/server/server-provider.mjs +140 -0
  144. package/esm2020/version.mjs +11 -0
  145. package/extended/README.md +18 -0
  146. package/extended/angular-flex-layout-extended.d.ts +5 -0
  147. package/extended/class/class.d.ts +38 -0
  148. package/extended/img-src/img-src.d.ts +51 -0
  149. package/extended/module.d.ts +16 -0
  150. package/extended/package.json +10 -0
  151. package/extended/public-api.d.ts +12 -0
  152. package/extended/show-hide/show-hide.d.ts +61 -0
  153. package/extended/style/style-transforms.d.ts +36 -0
  154. package/extended/style/style.d.ts +45 -0
  155. package/fesm2015/angular-flex-layout-_private-utils-testing.mjs +357 -0
  156. package/fesm2015/angular-flex-layout-_private-utils-testing.mjs.map +1 -0
  157. package/fesm2015/angular-flex-layout-_private-utils.mjs +193 -0
  158. package/fesm2015/angular-flex-layout-_private-utils.mjs.map +1 -0
  159. package/fesm2015/angular-flex-layout-core.mjs +2331 -0
  160. package/fesm2015/angular-flex-layout-core.mjs.map +1 -0
  161. package/fesm2015/angular-flex-layout-extended.mjs +621 -0
  162. package/fesm2015/angular-flex-layout-extended.mjs.map +1 -0
  163. package/fesm2015/angular-flex-layout-flex.mjs +1206 -0
  164. package/fesm2015/angular-flex-layout-flex.mjs.map +1 -0
  165. package/fesm2015/angular-flex-layout-grid.mjs +1047 -0
  166. package/fesm2015/angular-flex-layout-grid.mjs.map +1 -0
  167. package/fesm2015/angular-flex-layout-server.mjs +324 -0
  168. package/fesm2015/angular-flex-layout-server.mjs.map +1 -0
  169. package/fesm2015/angular-flex-layout.mjs +94 -0
  170. package/fesm2015/angular-flex-layout.mjs.map +1 -0
  171. package/fesm2020/angular-flex-layout-_private-utils-testing.mjs +357 -0
  172. package/fesm2020/angular-flex-layout-_private-utils-testing.mjs.map +1 -0
  173. package/fesm2020/angular-flex-layout-_private-utils.mjs +192 -0
  174. package/fesm2020/angular-flex-layout-_private-utils.mjs.map +1 -0
  175. package/fesm2020/angular-flex-layout-core.mjs +2304 -0
  176. package/fesm2020/angular-flex-layout-core.mjs.map +1 -0
  177. package/fesm2020/angular-flex-layout-extended.mjs +612 -0
  178. package/fesm2020/angular-flex-layout-extended.mjs.map +1 -0
  179. package/fesm2020/angular-flex-layout-flex.mjs +1198 -0
  180. package/fesm2020/angular-flex-layout-flex.mjs.map +1 -0
  181. package/fesm2020/angular-flex-layout-grid.mjs +1047 -0
  182. package/fesm2020/angular-flex-layout-grid.mjs.map +1 -0
  183. package/fesm2020/angular-flex-layout-server.mjs +322 -0
  184. package/fesm2020/angular-flex-layout-server.mjs.map +1 -0
  185. package/fesm2020/angular-flex-layout.mjs +92 -0
  186. package/fesm2020/angular-flex-layout.mjs.map +1 -0
  187. package/flex/README.md +19 -0
  188. package/flex/angular-flex-layout-flex.d.ts +5 -0
  189. package/flex/flex/flex.d.ts +59 -0
  190. package/flex/flex-align/flex-align.d.ts +32 -0
  191. package/flex/flex-fill/flex-fill.d.ts +33 -0
  192. package/flex/flex-offset/flex-offset.d.ts +44 -0
  193. package/flex/flex-order/flex-order.d.ts +34 -0
  194. package/flex/layout/layout.d.ts +43 -0
  195. package/flex/layout-align/layout-align.d.ts +49 -0
  196. package/flex/layout-gap/layout-gap.d.ts +65 -0
  197. package/flex/module.d.ts +21 -0
  198. package/flex/package.json +10 -0
  199. package/flex/public-api.d.ts +16 -0
  200. package/grid/README.md +19 -0
  201. package/grid/align-columns/align-columns.d.ts +39 -0
  202. package/grid/align-rows/align-rows.d.ts +39 -0
  203. package/grid/angular-flex-layout-grid.d.ts +5 -0
  204. package/grid/area/area.d.ts +34 -0
  205. package/grid/areas/areas.d.ts +41 -0
  206. package/grid/auto/auto.d.ts +41 -0
  207. package/grid/column/column.d.ts +34 -0
  208. package/grid/columns/columns.d.ts +43 -0
  209. package/grid/gap/gap.d.ts +42 -0
  210. package/grid/grid-align/grid-align.d.ts +37 -0
  211. package/grid/module.d.ts +23 -0
  212. package/grid/package.json +10 -0
  213. package/grid/public-api.d.ts +19 -0
  214. package/grid/row/row.d.ts +34 -0
  215. package/grid/rows/rows.d.ts +43 -0
  216. package/module.d.ts +30 -0
  217. package/package.json +100 -0
  218. package/public-api.d.ts +18 -0
  219. package/server/README.md +23 -0
  220. package/server/angular-flex-layout-server.d.ts +5 -0
  221. package/server/module.d.ts +6 -0
  222. package/server/package.json +10 -0
  223. package/server/public-api.d.ts +9 -0
  224. package/server/server-match-media.d.ts +61 -0
  225. package/server/server-provider.d.ts +44 -0
  226. package/version.d.ts +10 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { NgZone, OnDestroy } from '@angular/core';
9
+ import { BehaviorSubject, Observable } from 'rxjs';
10
+ import { MediaChange } from '../media-change';
11
+ import * as i0 from "@angular/core";
12
+ /**
13
+ * MediaMonitor configures listeners to mediaQuery changes and publishes an Observable facade to
14
+ * convert mediaQuery change callbacks to subscriber notifications. These notifications will be
15
+ * performed within the ng Zone to trigger change detections and component updates.
16
+ *
17
+ * NOTE: both mediaQuery activations and de-activations are announced in notifications
18
+ */
19
+ export declare class MatchMedia implements OnDestroy {
20
+ protected _zone: NgZone;
21
+ protected _platformId: Object;
22
+ protected _document: any;
23
+ /** Initialize source with 'all' so all non-responsive APIs trigger style updates */
24
+ readonly source: BehaviorSubject<MediaChange>;
25
+ registry: Map<string, MediaQueryList>;
26
+ private readonly pendingRemoveListenerFns;
27
+ constructor(_zone: NgZone, _platformId: Object, _document: any);
28
+ /**
29
+ * Publish list of all current activations
30
+ */
31
+ get activations(): string[];
32
+ /**
33
+ * For the specified mediaQuery?
34
+ */
35
+ isActive(mediaQuery: string): boolean;
36
+ /**
37
+ * External observers can watch for all (or a specific) mql changes.
38
+ *
39
+ * If a mediaQuery is not specified, then ALL mediaQuery activations will
40
+ * be announced.
41
+ */
42
+ observe(): Observable<MediaChange>;
43
+ observe(mediaQueries: string[]): Observable<MediaChange>;
44
+ observe(mediaQueries: string[], filterOthers: boolean): Observable<MediaChange>;
45
+ /**
46
+ * Based on the BreakPointRegistry provider, register internal listeners for each unique
47
+ * mediaQuery. Each listener emits specific MediaChange data to observers
48
+ */
49
+ registerQuery(mediaQuery: string | string[]): MediaChange[];
50
+ ngOnDestroy(): void;
51
+ /**
52
+ * Call window.matchMedia() to build a MediaQueryList; which
53
+ * supports 0..n listeners for activation/deactivation
54
+ */
55
+ protected buildMQL(query: string): MediaQueryList;
56
+ protected _observable$: Observable<MediaChange>;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatchMedia, never>;
58
+ static ɵprov: i0.ɵɵInjectableDeclaration<MatchMedia>;
59
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { NgZone } from '@angular/core';
9
+ import { MatchMedia } from '../match-media';
10
+ import { BreakPointRegistry } from '../../breakpoints/break-point-registry';
11
+ import * as i0 from "@angular/core";
12
+ /**
13
+ * MockMatchMedia mocks calls to the Window API matchMedia with a build of a simulated
14
+ * MockMediaQueryListener. Methods are available to simulate an activation of a mediaQuery
15
+ * range and to clearAll mediaQuery listeners.
16
+ */
17
+ export declare class MockMatchMedia extends MatchMedia {
18
+ private _breakpoints;
19
+ autoRegisterQueries: boolean;
20
+ useOverlaps: boolean;
21
+ constructor(_zone: NgZone, _platformId: Object, _document: any, _breakpoints: BreakPointRegistry);
22
+ /** Easy method to clear all listeners for all mediaQueries */
23
+ clearAll(): void;
24
+ /** Feature to support manual, simulated activation of a mediaQuery. */
25
+ activate(mediaQuery: string, useOverlaps?: boolean): boolean;
26
+ /** Converts an optional mediaQuery alias to a specific, valid mediaQuery */
27
+ _validateQuery(queryOrAlias: string): string;
28
+ /**
29
+ * Manually onMediaChange any overlapping mediaQueries to simulate
30
+ * similar functionality in the window.matchMedia()
31
+ */
32
+ private _activateWithOverlaps;
33
+ /**
34
+ *
35
+ */
36
+ private _activateByAlias;
37
+ /**
38
+ *
39
+ */
40
+ private _activateByQuery;
41
+ /** Deactivate all current MQLs and reset the buffer */
42
+ private _deactivateAll;
43
+ /** Insure the mediaQuery is registered with MatchMedia */
44
+ private _registerMediaQuery;
45
+ /**
46
+ * Call window.matchMedia() to build a MediaQueryList; which
47
+ * supports 0..n listeners for activation/deactivation
48
+ */
49
+ protected buildMQL(query: string): MediaQueryList;
50
+ protected get hasActivated(): boolean;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockMatchMedia, never>;
52
+ static ɵprov: i0.ɵɵInjectableDeclaration<MockMatchMedia>;
53
+ }
54
+ /**
55
+ * Special internal class to simulate a MediaQueryList and
56
+ * - supports manual activation to simulate mediaQuery matching
57
+ * - manages listeners
58
+ */
59
+ export declare class MockMediaQueryList implements MediaQueryList {
60
+ private _mediaQuery;
61
+ private _isActive;
62
+ private _listeners;
63
+ get matches(): boolean;
64
+ get media(): string;
65
+ constructor(_mediaQuery: string);
66
+ /**
67
+ * Destroy the current list by deactivating the
68
+ * listeners and clearing the internal list
69
+ */
70
+ destroy(): void;
71
+ /** Notify all listeners that 'matches === TRUE' */
72
+ activate(): MockMediaQueryList;
73
+ /** Notify all listeners that 'matches === false' */
74
+ deactivate(): MockMediaQueryList;
75
+ /** Add a listener to our internal list to activate later */
76
+ addListener(listener: MediaQueryListListener): void;
77
+ /** Don't need to remove listeners in the testing environment */
78
+ removeListener(_: MediaQueryListListener | null): void;
79
+ addEventListener<K extends keyof MediaQueryListEventMap>(_: K, __: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, ___?: boolean | AddEventListenerOptions): void;
80
+ removeEventListener<K extends keyof MediaQueryListEventMap>(_: K, __: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, ___?: boolean | EventListenerOptions): void;
81
+ dispatchEvent(_: Event): boolean;
82
+ onchange: MediaQueryListListener;
83
+ }
84
+ /**
85
+ * Pre-configured provider for MockMatchMedia
86
+ */
87
+ export declare const MockMatchMediaProvider: {
88
+ provide: typeof MatchMedia;
89
+ useClass: typeof MockMatchMedia;
90
+ };
91
+ declare type MediaQueryListListener = ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null;
92
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export declare type MediaQuerySubscriber = (changes: MediaChange) => void;
9
+ /**
10
+ * Class instances emitted [to observers] for each mql notification
11
+ */
12
+ export declare class MediaChange {
13
+ matches: boolean;
14
+ mediaQuery: string;
15
+ mqAlias: string;
16
+ suffix: string;
17
+ priority: number;
18
+ property: string;
19
+ value: any;
20
+ /**
21
+ * @param matches whether the mediaQuery is currently activated
22
+ * @param mediaQuery e.g. (min-width: 600px) and (max-width: 959px)
23
+ * @param mqAlias e.g. gt-sm, md, gt-lg
24
+ * @param suffix e.g. GtSM, Md, GtLg
25
+ * @param priority the priority of activation for the given breakpoint
26
+ */
27
+ constructor(matches?: boolean, mediaQuery?: string, mqAlias?: string, suffix?: string, priority?: number);
28
+ /** Create an exact copy of the MediaChange */
29
+ clone(): MediaChange;
30
+ }
@@ -0,0 +1,123 @@
1
+ import { Observable } from 'rxjs';
2
+ import { BreakPoint } from '../breakpoints/break-point';
3
+ import { BreakPointRegistry } from '../breakpoints/break-point-registry';
4
+ import { MatchMedia } from '../match-media/match-media';
5
+ import { MediaChange } from '../media-change';
6
+ import { PrintHook } from './print-hook';
7
+ import * as i0 from "@angular/core";
8
+ declare type ClearCallback = () => void;
9
+ declare type UpdateCallback = (val: any) => void;
10
+ export interface ElementMatcher {
11
+ element: HTMLElement;
12
+ key: string;
13
+ value: any;
14
+ }
15
+ /**
16
+ * MediaMarshaller - register responsive values from directives and
17
+ * trigger them based on media query events
18
+ */
19
+ export declare class MediaMarshaller {
20
+ protected matchMedia: MatchMedia;
21
+ protected breakpoints: BreakPointRegistry;
22
+ protected hook: PrintHook;
23
+ private _useFallbacks;
24
+ private _activatedBreakpoints;
25
+ private elementMap;
26
+ private elementKeyMap;
27
+ private watcherMap;
28
+ private updateMap;
29
+ private clearMap;
30
+ private subject;
31
+ get activatedAlias(): string;
32
+ set activatedBreakpoints(bps: BreakPoint[]);
33
+ get activatedBreakpoints(): BreakPoint[];
34
+ set useFallbacks(value: boolean);
35
+ constructor(matchMedia: MatchMedia, breakpoints: BreakPointRegistry, hook: PrintHook);
36
+ /**
37
+ * Update styles on breakpoint activates or deactivates
38
+ * @param mc
39
+ */
40
+ onMediaChange(mc: MediaChange): void;
41
+ /**
42
+ * initialize the marshaller with necessary elements for delegation on an element
43
+ * @param element
44
+ * @param key
45
+ * @param updateFn optional callback so that custom bp directives don't have to re-provide this
46
+ * @param clearFn optional callback so that custom bp directives don't have to re-provide this
47
+ * @param extraTriggers other triggers to force style updates (e.g. layout, directionality, etc)
48
+ */
49
+ init(element: HTMLElement, key: string, updateFn?: UpdateCallback, clearFn?: ClearCallback, extraTriggers?: Observable<any>[]): void;
50
+ /**
51
+ * get the value for an element and key and optionally a given breakpoint
52
+ * @param element
53
+ * @param key
54
+ * @param bp
55
+ */
56
+ getValue(element: HTMLElement, key: string, bp?: string): any;
57
+ /**
58
+ * whether the element has values for a given key
59
+ * @param element
60
+ * @param key
61
+ */
62
+ hasValue(element: HTMLElement, key: string): boolean;
63
+ /**
64
+ * Set the value for an input on a directive
65
+ * @param element the element in question
66
+ * @param key the type of the directive (e.g. flex, layout-gap, etc)
67
+ * @param bp the breakpoint suffix (empty string = default)
68
+ * @param val the value for the breakpoint
69
+ */
70
+ setValue(element: HTMLElement, key: string, val: any, bp: string): void;
71
+ /** Track element value changes for a specific key */
72
+ trackValue(element: HTMLElement, key: string): Observable<ElementMatcher>;
73
+ /** update all styles for all elements on the current breakpoint */
74
+ updateStyles(): void;
75
+ /**
76
+ * clear the styles for a given element
77
+ * @param element
78
+ * @param key
79
+ */
80
+ clearElement(element: HTMLElement, key: string): void;
81
+ /**
82
+ * update a given element with the activated values for a given key
83
+ * @param element
84
+ * @param key
85
+ * @param value
86
+ */
87
+ updateElement(element: HTMLElement, key: string, value: any): void;
88
+ /**
89
+ * release all references to a given element
90
+ * @param element
91
+ */
92
+ releaseElement(element: HTMLElement): void;
93
+ /**
94
+ * trigger an update for a given element and key (e.g. layout)
95
+ * @param element
96
+ * @param key
97
+ */
98
+ triggerUpdate(element: HTMLElement, key?: string): void;
99
+ /** Cross-reference for HTMLElement with directive key */
100
+ private buildElementKeyMap;
101
+ /**
102
+ * Other triggers that should force style updates:
103
+ * - directionality
104
+ * - layout changes
105
+ * - mutationobserver updates
106
+ */
107
+ private watchExtraTriggers;
108
+ /** Breakpoint locator by mediaQuery */
109
+ private findByQuery;
110
+ /**
111
+ * get the fallback breakpoint for a given element, starting with the current breakpoint
112
+ * @param bpMap
113
+ * @param key
114
+ */
115
+ private getActivatedValues;
116
+ /**
117
+ * Watch for mediaQuery breakpoint activations
118
+ */
119
+ private observeActivations;
120
+ static ɵfac: i0.ɵɵFactoryDeclaration<MediaMarshaller, never>;
121
+ static ɵprov: i0.ɵɵInjectableDeclaration<MediaMarshaller>;
122
+ }
123
+ export {};
@@ -0,0 +1,95 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { OnDestroy } from '@angular/core';
9
+ import { MediaChange } from '../media-change';
10
+ import { BreakPoint } from '../breakpoints/break-point';
11
+ import { LayoutConfigOptions } from '../tokens/library-config';
12
+ import { BreakPointRegistry, OptionalBreakPoint } from '../breakpoints/break-point-registry';
13
+ import * as i0 from "@angular/core";
14
+ /**
15
+ * Interface to apply PrintHook to call anonymous `target.updateStyles()`
16
+ */
17
+ export interface HookTarget {
18
+ activatedBreakpoints: BreakPoint[];
19
+ updateStyles(): void;
20
+ }
21
+ export declare const BREAKPOINT_PRINT: {
22
+ alias: string;
23
+ mediaQuery: string;
24
+ priority: number;
25
+ };
26
+ /**
27
+ * PrintHook - Use to intercept print MediaQuery activations and force
28
+ * layouts to render with the specified print alias/breakpoint
29
+ *
30
+ * Used in MediaMarshaller and MediaObserver
31
+ */
32
+ export declare class PrintHook implements OnDestroy {
33
+ protected breakpoints: BreakPointRegistry;
34
+ protected layoutConfig: LayoutConfigOptions;
35
+ protected _document: any;
36
+ constructor(breakpoints: BreakPointRegistry, layoutConfig: LayoutConfigOptions, _document: any);
37
+ /** Add 'print' mediaQuery: to listen for matchMedia activations */
38
+ withPrintQuery(queries: string[]): string[];
39
+ /** Is the MediaChange event for any 'print' @media */
40
+ isPrintEvent(e: MediaChange): boolean;
41
+ /** What is the desired mqAlias to use while printing? */
42
+ get printAlias(): string[];
43
+ /** Lookup breakpoints associated with print aliases. */
44
+ get printBreakPoints(): BreakPoint[];
45
+ /** Lookup breakpoint associated with mediaQuery */
46
+ getEventBreakpoints({ mediaQuery }: MediaChange): BreakPoint[];
47
+ /** Update event with printAlias mediaQuery information */
48
+ updateEvent(event: MediaChange): MediaChange;
49
+ private registeredBeforeAfterPrintHooks;
50
+ private isPrintingBeforeAfterEvent;
51
+ private beforePrintEventListeners;
52
+ private afterPrintEventListeners;
53
+ private formerActivations;
54
+ registerBeforeAfterPrintHooks(target: HookTarget): void;
55
+ /**
56
+ * Prepare RxJS tap operator with partial application
57
+ * @return pipeable tap predicate
58
+ */
59
+ interceptEvents(target: HookTarget): (event: MediaChange) => void;
60
+ /** Stop mediaChange event propagation in event streams */
61
+ blockPropagation(): (event: MediaChange) => boolean;
62
+ /**
63
+ * Save current activateBreakpoints (for later restore)
64
+ * and substitute only the printAlias breakpoint
65
+ */
66
+ protected startPrinting(target: HookTarget, bpList: OptionalBreakPoint[]): void;
67
+ /** For any print de-activations, reset the entire print queue */
68
+ protected stopPrinting(target: HookTarget): void;
69
+ /**
70
+ * To restore pre-Print Activations, we must capture the proper
71
+ * list of breakpoint activations BEFORE print starts. OnBeforePrint()
72
+ * is supported; so 'print' mediaQuery activations are used as a fallback
73
+ * in browsers without `beforeprint` support.
74
+ *
75
+ * > But activated breakpoints are deactivated BEFORE 'print' activation.
76
+ *
77
+ * Let's capture all de-activations using the following logic:
78
+ *
79
+ * When not printing:
80
+ * - clear cache when activating non-print breakpoint
81
+ * - update cache (and sort) when deactivating
82
+ *
83
+ * When printing:
84
+ * - sort and save when starting print
85
+ * - restore as activatedTargets and clear when stop printing
86
+ */
87
+ collectActivations(target: HookTarget, event: MediaChange): void;
88
+ /** Teardown logic for the service. */
89
+ ngOnDestroy(): void;
90
+ private isPrinting;
91
+ private queue;
92
+ private deactivations;
93
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrintHook, never>;
94
+ static ɵprov: i0.ɵɵInjectableDeclaration<PrintHook>;
95
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export * from './media-observer';
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { OnDestroy } from '@angular/core';
9
+ import { Observable } from 'rxjs';
10
+ import { MediaChange } from '../media-change';
11
+ import { MatchMedia } from '../match-media/match-media';
12
+ import { PrintHook } from '../media-marshaller/print-hook';
13
+ import { BreakPointRegistry } from '../breakpoints/break-point-registry';
14
+ import * as i0 from "@angular/core";
15
+ /**
16
+ * MediaObserver enables applications to listen for 1..n mediaQuery activations and to determine
17
+ * if a mediaQuery is currently activated.
18
+ *
19
+ * Since a breakpoint change will first deactivate 1...n mediaQueries and then possibly activate
20
+ * 1..n mediaQueries, the MediaObserver will debounce notifications and report ALL *activations*
21
+ * in 1 event notification. The reported activations will be sorted in descending priority order.
22
+ *
23
+ * This class uses the BreakPoint Registry to inject alias information into the raw MediaChange
24
+ * notification. For custom mediaQuery notifications, alias information will not be injected and
25
+ * those fields will be ''.
26
+ *
27
+ * Note: Developers should note that only mediaChange activations (not de-activations)
28
+ * are announced by the MediaObserver.
29
+ *
30
+ * @usage
31
+ *
32
+ * // RxJS
33
+ * import { filter } from 'rxjs/operators';
34
+ * import { MediaObserver } from '@angular/flex-layout';
35
+ *
36
+ * @Component({ ... })
37
+ * export class AppComponent {
38
+ * status: string = '';
39
+ *
40
+ * constructor(mediaObserver: MediaObserver) {
41
+ * const media$ = mediaObserver.asObservable().pipe(
42
+ * filter((changes: MediaChange[]) => true) // silly noop filter
43
+ * );
44
+ *
45
+ * media$.subscribe((changes: MediaChange[]) => {
46
+ * let status = '';
47
+ * changes.forEach( change => {
48
+ * status += `'${change.mqAlias}' = (${change.mediaQuery}) <br/>` ;
49
+ * });
50
+ * this.status = status;
51
+ * });
52
+ *
53
+ * }
54
+ * }
55
+ */
56
+ export declare class MediaObserver implements OnDestroy {
57
+ protected breakpoints: BreakPointRegistry;
58
+ protected matchMedia: MatchMedia;
59
+ protected hook: PrintHook;
60
+ /**
61
+ * @deprecated Use `asObservable()` instead.
62
+ * @breaking-change 8.0.0-beta.25
63
+ * @deletion-target 10.0.0
64
+ */
65
+ readonly media$: Observable<MediaChange>;
66
+ /** Filter MediaChange notifications for overlapping breakpoints */
67
+ filterOverlaps: boolean;
68
+ constructor(breakpoints: BreakPointRegistry, matchMedia: MatchMedia, hook: PrintHook);
69
+ /**
70
+ * Completes the active subject, signalling to all complete for all
71
+ * MediaObserver subscribers
72
+ */
73
+ ngOnDestroy(): void;
74
+ /**
75
+ * Observe changes to current activation 'list'
76
+ */
77
+ asObservable(): Observable<MediaChange[]>;
78
+ /**
79
+ * Allow programmatic query to determine if one or more media query/alias match
80
+ * the current viewport size.
81
+ * @param value One or more media queries (or aliases) to check.
82
+ * @returns Whether any of the media queries match.
83
+ */
84
+ isActive(value: string | string[]): boolean;
85
+ /**
86
+ * Register all the mediaQueries registered in the BreakPointRegistry
87
+ * This is needed so subscribers can be auto-notified of all standard, registered
88
+ * mediaQuery activations
89
+ */
90
+ private watchActivations;
91
+ /**
92
+ * Only pass/announce activations (not de-activations)
93
+ *
94
+ * Since multiple-mediaQueries can be activation in a cycle,
95
+ * gather all current activations into a single list of changes to observers
96
+ *
97
+ * Inject associated (if any) alias information into the MediaChange event
98
+ * - Exclude mediaQuery activations for overlapping mQs. List bounded mQ ranges only
99
+ * - Exclude print activations that do not have an associated mediaQuery
100
+ *
101
+ * NOTE: the raw MediaChange events [from MatchMedia] do not
102
+ * contain important alias information; as such this info
103
+ * must be injected into the MediaChange
104
+ */
105
+ private buildObservable;
106
+ /**
107
+ * Find all current activations and prepare single list of activations
108
+ * sorted by descending priority.
109
+ */
110
+ private findAllActivations;
111
+ private readonly _media$;
112
+ private readonly destroyed$;
113
+ static ɵfac: i0.ɵɵFactoryDeclaration<MediaObserver, never>;
114
+ static ɵprov: i0.ɵɵInjectableDeclaration<MediaObserver>;
115
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export * from './media-trigger';
@@ -0,0 +1,73 @@
1
+ import { MatchMedia } from '../match-media/match-media';
2
+ import { BreakPointRegistry } from '../breakpoints/break-point-registry';
3
+ import { LayoutConfigOptions } from '../tokens/library-config';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Class
7
+ */
8
+ export declare class MediaTrigger {
9
+ protected breakpoints: BreakPointRegistry;
10
+ protected matchMedia: MatchMedia;
11
+ protected layoutConfig: LayoutConfigOptions;
12
+ protected _platformId: Object;
13
+ protected _document: any;
14
+ constructor(breakpoints: BreakPointRegistry, matchMedia: MatchMedia, layoutConfig: LayoutConfigOptions, _platformId: Object, _document: any);
15
+ /**
16
+ * Manually activate range of breakpoints
17
+ * @param list array of mediaQuery or alias strings
18
+ */
19
+ activate(list: string[]): void;
20
+ /**
21
+ * Restore original, 'real' breakpoints and emit events
22
+ * to trigger stream notification
23
+ */
24
+ restore(): void;
25
+ /**
26
+ * Whenever window resizes, immediately auto-restore original
27
+ * activations (if we are simulating activations)
28
+ */
29
+ private prepareAutoRestore;
30
+ /**
31
+ * Notify all matchMedia subscribers of de-activations
32
+ *
33
+ * Note: we must force 'matches' updates for
34
+ * future matchMedia::activation lookups
35
+ */
36
+ private deactivateAll;
37
+ /**
38
+ * Cache current activations as sorted, prioritized list of MediaChanges
39
+ */
40
+ private saveActivations;
41
+ /**
42
+ * Force set manual activations for specified mediaQuery list
43
+ */
44
+ private setActivations;
45
+ /**
46
+ * For specified mediaQuery list manually simulate activations or deactivations
47
+ */
48
+ private simulateMediaChanges;
49
+ /**
50
+ * Replace current registry with simulated registry...
51
+ * Note: this is required since MediaQueryList::matches is 'readOnly'
52
+ */
53
+ private forceRegistryMatches;
54
+ /**
55
+ * Save current MatchMedia::registry items.
56
+ */
57
+ private cacheRegistryMatches;
58
+ /**
59
+ * Restore original, 'true' registry
60
+ */
61
+ private restoreRegistryMatches;
62
+ /**
63
+ * Manually emit a MediaChange event via the MatchMedia to MediaMarshaller and MediaObserver
64
+ */
65
+ private emitChangeEvent;
66
+ private get currentActivations();
67
+ private hasCachedRegistryMatches;
68
+ private originalActivations;
69
+ private originalRegistry;
70
+ private resizeSubscription;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<MediaTrigger, never>;
72
+ static ɵprov: i0.ɵɵInjectableDeclaration<MediaTrigger>;
73
+ }
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * *****************************************************************
4
+ * Define module for common Angular Layout utilities
5
+ * *****************************************************************
6
+ */
7
+ export declare class CoreModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<CoreModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CoreModule, never, never, never>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<CoreModule>;
11
+ }
@@ -0,0 +1,5 @@
1
+ export interface Multiplier {
2
+ readonly unit: string;
3
+ readonly value: number;
4
+ }
5
+ export declare function multiply(value: string, multiplier?: Multiplier): string;
@@ -0,0 +1,10 @@
1
+ {
2
+ "module": "../fesm2015/angular-flex-layout-core.mjs",
3
+ "es2020": "../fesm2020/angular-flex-layout-core.mjs",
4
+ "esm2020": "../esm2020/core/angular-flex-layout-core.mjs",
5
+ "fesm2020": "../fesm2020/angular-flex-layout-core.mjs",
6
+ "fesm2015": "../fesm2015/angular-flex-layout-core.mjs",
7
+ "typings": "angular-flex-layout-core.d.ts",
8
+ "sideEffects": false,
9
+ "name": "@angular/flex-layout/core"
10
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export * from './module';
9
+ export * from './browser-provider';
10
+ export * from './media-change';
11
+ export * from './stylesheet-map/index';
12
+ export * from './tokens/index';
13
+ export * from './add-alias';
14
+ export * from './base/index';
15
+ export * from './breakpoints/index';
16
+ export { MatchMedia as ɵMatchMedia, MockMatchMedia as ɵMockMatchMedia, MockMatchMediaProvider as ɵMockMatchMediaProvider, } from './match-media/index';
17
+ export * from './media-observer/index';
18
+ export * from './media-trigger/index';
19
+ export * from './utils/index';
20
+ export * from './style-utils/style-utils';
21
+ export * from './style-builder/style-builder';
22
+ export * from './basis-validator/basis-validator';
23
+ export * from './media-marshaller/media-marshaller';
24
+ export * from './media-marshaller/print-hook';
25
+ export { Multiplier, multiply as ɵmultiply } from './multiply/multiplier';