@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,1198 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Directive, Inject, Input, NgModule } from '@angular/core';
3
+ import * as i2 from '@angular/cdk/bidi';
4
+ import { BidiModule } from '@angular/cdk/bidi';
5
+ import * as i1 from '@angular/flex-layout/core';
6
+ import { StyleBuilder, BaseDirective2, LAYOUT_CONFIG, ɵmultiply, validateBasis, CoreModule } from '@angular/flex-layout/core';
7
+ import { buildLayoutCSS, LAYOUT_VALUES, isFlowHorizontal, extendObject } from '@angular/flex-layout/_private-utils';
8
+ import { Subject } from 'rxjs';
9
+ import { takeUntil } from 'rxjs/operators';
10
+
11
+ /**
12
+ * @license
13
+ * Copyright Google LLC All Rights Reserved.
14
+ *
15
+ * Use of this source code is governed by an MIT-style license that can be
16
+ * found in the LICENSE file at https://angular.io/license
17
+ */
18
+ class LayoutStyleBuilder extends StyleBuilder {
19
+ buildStyles(input, { display }) {
20
+ const css = buildLayoutCSS(input);
21
+ return {
22
+ ...css,
23
+ display: display === 'none' ? display : css.display,
24
+ };
25
+ }
26
+ }
27
+ LayoutStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutStyleBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
28
+ LayoutStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutStyleBuilder, providedIn: 'root' });
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutStyleBuilder, decorators: [{
30
+ type: Injectable,
31
+ args: [{ providedIn: 'root' }]
32
+ }] });
33
+ const inputs$6 = [
34
+ 'fxLayout', 'fxLayout.xs', 'fxLayout.sm', 'fxLayout.md',
35
+ 'fxLayout.lg', 'fxLayout.xl', 'fxLayout.lt-sm', 'fxLayout.lt-md',
36
+ 'fxLayout.lt-lg', 'fxLayout.lt-xl', 'fxLayout.gt-xs', 'fxLayout.gt-sm',
37
+ 'fxLayout.gt-md', 'fxLayout.gt-lg'
38
+ ];
39
+ const selector$6 = `
40
+ [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md],
41
+ [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md],
42
+ [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm],
43
+ [fxLayout.gt-md], [fxLayout.gt-lg]
44
+ `;
45
+ /**
46
+ * 'layout' flexbox styling directive
47
+ * Defines the positioning flow direction for the child elements: row or column
48
+ * Optional values: column or row (default)
49
+ * @see https://css-tricks.com/almanac/properties/f/flex-direction/
50
+ *
51
+ */
52
+ class LayoutDirective extends BaseDirective2 {
53
+ constructor(elRef, styleUtils, styleBuilder, marshal, _config) {
54
+ super(elRef, styleBuilder, styleUtils, marshal);
55
+ this._config = _config;
56
+ this.DIRECTIVE_KEY = 'layout';
57
+ this.init();
58
+ }
59
+ updateWithValue(input) {
60
+ const detectLayoutDisplay = this._config.detectLayoutDisplay;
61
+ const display = detectLayoutDisplay ? this.styler.lookupStyle(this.nativeElement, 'display') : '';
62
+ this.styleCache = cacheMap.get(display) ?? new Map();
63
+ cacheMap.set(display, this.styleCache);
64
+ if (this.currentValue !== input) {
65
+ this.addStyles(input, { display });
66
+ this.currentValue = input;
67
+ }
68
+ }
69
+ }
70
+ LayoutDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutDirective, deps: [{ token: i0.ElementRef }, { token: i1.StyleUtils }, { token: LayoutStyleBuilder }, { token: i1.MediaMarshaller }, { token: LAYOUT_CONFIG }], target: i0.ɵɵFactoryTarget.Directive });
71
+ LayoutDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LayoutDirective, usesInheritance: true, ngImport: i0 });
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutDirective, decorators: [{
73
+ type: Directive
74
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.StyleUtils }, { type: LayoutStyleBuilder }, { type: i1.MediaMarshaller }, { type: undefined, decorators: [{
75
+ type: Inject,
76
+ args: [LAYOUT_CONFIG]
77
+ }] }]; } });
78
+ class DefaultLayoutDirective extends LayoutDirective {
79
+ constructor() {
80
+ super(...arguments);
81
+ this.inputs = inputs$6;
82
+ }
83
+ }
84
+ DefaultLayoutDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultLayoutDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
85
+ DefaultLayoutDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: DefaultLayoutDirective, selector: "\n [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md],\n [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md],\n [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm],\n [fxLayout.gt-md], [fxLayout.gt-lg]\n", inputs: { fxLayout: "fxLayout", "fxLayout.xs": "fxLayout.xs", "fxLayout.sm": "fxLayout.sm", "fxLayout.md": "fxLayout.md", "fxLayout.lg": "fxLayout.lg", "fxLayout.xl": "fxLayout.xl", "fxLayout.lt-sm": "fxLayout.lt-sm", "fxLayout.lt-md": "fxLayout.lt-md", "fxLayout.lt-lg": "fxLayout.lt-lg", "fxLayout.lt-xl": "fxLayout.lt-xl", "fxLayout.gt-xs": "fxLayout.gt-xs", "fxLayout.gt-sm": "fxLayout.gt-sm", "fxLayout.gt-md": "fxLayout.gt-md", "fxLayout.gt-lg": "fxLayout.gt-lg" }, usesInheritance: true, ngImport: i0 });
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultLayoutDirective, decorators: [{
87
+ type: Directive,
88
+ args: [{ selector: selector$6, inputs: inputs$6 }]
89
+ }] });
90
+ const cacheMap = new Map();
91
+
92
+ /**
93
+ * @license
94
+ * Copyright Google LLC All Rights Reserved.
95
+ *
96
+ * Use of this source code is governed by an MIT-style license that can be
97
+ * found in the LICENSE file at https://angular.io/license
98
+ */
99
+ const CLEAR_MARGIN_CSS = {
100
+ 'margin-left': null,
101
+ 'margin-right': null,
102
+ 'margin-top': null,
103
+ 'margin-bottom': null
104
+ };
105
+ class LayoutGapStyleBuilder extends StyleBuilder {
106
+ constructor(_styler, _config) {
107
+ super();
108
+ this._styler = _styler;
109
+ this._config = _config;
110
+ }
111
+ buildStyles(gapValue, parent) {
112
+ if (gapValue.endsWith(GRID_SPECIFIER)) {
113
+ gapValue = gapValue.slice(0, gapValue.indexOf(GRID_SPECIFIER));
114
+ gapValue = ɵmultiply(gapValue, this._config.multiplier);
115
+ // Add the margin to the host element
116
+ return buildGridMargin(gapValue, parent.directionality);
117
+ }
118
+ else {
119
+ return {};
120
+ }
121
+ }
122
+ sideEffect(gapValue, _styles, parent) {
123
+ const items = parent.items;
124
+ if (gapValue.endsWith(GRID_SPECIFIER)) {
125
+ gapValue = gapValue.slice(0, gapValue.indexOf(GRID_SPECIFIER));
126
+ gapValue = ɵmultiply(gapValue, this._config.multiplier);
127
+ // For each `element` children, set the padding
128
+ const paddingStyles = buildGridPadding(gapValue, parent.directionality);
129
+ this._styler.applyStyleToElements(paddingStyles, parent.items);
130
+ }
131
+ else {
132
+ gapValue = ɵmultiply(gapValue, this._config.multiplier);
133
+ gapValue = this.addFallbackUnit(gapValue);
134
+ const lastItem = items.pop();
135
+ // For each `element` children EXCEPT the last,
136
+ // set the margin right/bottom styles...
137
+ const gapCss = buildGapCSS(gapValue, parent);
138
+ this._styler.applyStyleToElements(gapCss, items);
139
+ // Clear all gaps for all visible elements
140
+ this._styler.applyStyleToElements(CLEAR_MARGIN_CSS, [lastItem]);
141
+ }
142
+ }
143
+ addFallbackUnit(value) {
144
+ return !isNaN(+value) ? `${value}${this._config.defaultUnit}` : value;
145
+ }
146
+ }
147
+ LayoutGapStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutGapStyleBuilder, deps: [{ token: i1.StyleUtils }, { token: LAYOUT_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
148
+ LayoutGapStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutGapStyleBuilder, providedIn: 'root' });
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutGapStyleBuilder, decorators: [{
150
+ type: Injectable,
151
+ args: [{ providedIn: 'root' }]
152
+ }], ctorParameters: function () { return [{ type: i1.StyleUtils }, { type: undefined, decorators: [{
153
+ type: Inject,
154
+ args: [LAYOUT_CONFIG]
155
+ }] }]; } });
156
+ const inputs$5 = [
157
+ 'fxLayoutGap', 'fxLayoutGap.xs', 'fxLayoutGap.sm', 'fxLayoutGap.md',
158
+ 'fxLayoutGap.lg', 'fxLayoutGap.xl', 'fxLayoutGap.lt-sm', 'fxLayoutGap.lt-md',
159
+ 'fxLayoutGap.lt-lg', 'fxLayoutGap.lt-xl', 'fxLayoutGap.gt-xs', 'fxLayoutGap.gt-sm',
160
+ 'fxLayoutGap.gt-md', 'fxLayoutGap.gt-lg'
161
+ ];
162
+ const selector$5 = `
163
+ [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md],
164
+ [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md],
165
+ [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm],
166
+ [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]
167
+ `;
168
+ /**
169
+ * 'layout-padding' styling directive
170
+ * Defines padding of child elements in a layout container
171
+ */
172
+ class LayoutGapDirective extends BaseDirective2 {
173
+ constructor(elRef, zone, directionality, styleUtils, styleBuilder, marshal) {
174
+ super(elRef, styleBuilder, styleUtils, marshal);
175
+ this.zone = zone;
176
+ this.directionality = directionality;
177
+ this.styleUtils = styleUtils;
178
+ this.layout = 'row'; // default flex-direction
179
+ this.DIRECTIVE_KEY = 'layout-gap';
180
+ this.observerSubject = new Subject();
181
+ const extraTriggers = [this.directionality.change, this.observerSubject.asObservable()];
182
+ this.init(extraTriggers);
183
+ this.marshal
184
+ .trackValue(this.nativeElement, 'layout')
185
+ .pipe(takeUntil(this.destroySubject))
186
+ .subscribe(this.onLayoutChange.bind(this));
187
+ }
188
+ /** Special accessor to query for all child 'element' nodes regardless of type, class, etc */
189
+ get childrenNodes() {
190
+ const obj = this.nativeElement.children;
191
+ const buffer = [];
192
+ // iterate backwards ensuring that length is an UInt32
193
+ for (let i = obj.length; i--;) {
194
+ buffer[i] = obj[i];
195
+ }
196
+ return buffer;
197
+ }
198
+ // *********************************************
199
+ // Lifecycle Methods
200
+ // *********************************************
201
+ ngAfterContentInit() {
202
+ this.buildChildObservable();
203
+ this.triggerUpdate();
204
+ }
205
+ ngOnDestroy() {
206
+ super.ngOnDestroy();
207
+ if (this.observer) {
208
+ this.observer.disconnect();
209
+ }
210
+ }
211
+ // *********************************************
212
+ // Protected methods
213
+ // *********************************************
214
+ /**
215
+ * Cache the parent container 'flex-direction' and update the 'margin' styles
216
+ */
217
+ onLayoutChange(matcher) {
218
+ const layout = matcher.value;
219
+ // Make sure to filter out 'wrap' option
220
+ const direction = layout.split(' ');
221
+ this.layout = direction[0];
222
+ if (!LAYOUT_VALUES.find(x => x === this.layout)) {
223
+ this.layout = 'row';
224
+ }
225
+ this.triggerUpdate();
226
+ }
227
+ /**
228
+ *
229
+ */
230
+ updateWithValue(value) {
231
+ // Gather all non-hidden Element nodes
232
+ const items = this.childrenNodes
233
+ .filter(el => el.nodeType === 1 && this.willDisplay(el))
234
+ .sort((a, b) => {
235
+ const orderA = +this.styler.lookupStyle(a, 'order');
236
+ const orderB = +this.styler.lookupStyle(b, 'order');
237
+ if (isNaN(orderA) || isNaN(orderB) || orderA === orderB) {
238
+ return 0;
239
+ }
240
+ else {
241
+ return orderA > orderB ? 1 : -1;
242
+ }
243
+ });
244
+ if (items.length > 0) {
245
+ const directionality = this.directionality.value;
246
+ const layout = this.layout;
247
+ if (layout === 'row' && directionality === 'rtl') {
248
+ this.styleCache = layoutGapCacheRowRtl;
249
+ }
250
+ else if (layout === 'row' && directionality !== 'rtl') {
251
+ this.styleCache = layoutGapCacheRowLtr;
252
+ }
253
+ else if (layout === 'column' && directionality === 'rtl') {
254
+ this.styleCache = layoutGapCacheColumnRtl;
255
+ }
256
+ else if (layout === 'column' && directionality !== 'rtl') {
257
+ this.styleCache = layoutGapCacheColumnLtr;
258
+ }
259
+ this.addStyles(value, { directionality, items, layout });
260
+ }
261
+ }
262
+ /** We need to override clearStyles because in most cases mru isn't populated */
263
+ clearStyles() {
264
+ const gridMode = Object.keys(this.mru).length > 0;
265
+ const childrenStyle = gridMode ? 'padding' :
266
+ getMarginType(this.directionality.value, this.layout);
267
+ // If there are styles on the parent remove them
268
+ if (gridMode) {
269
+ super.clearStyles();
270
+ }
271
+ // Then remove the children styles too
272
+ this.styleUtils.applyStyleToElements({ [childrenStyle]: '' }, this.childrenNodes);
273
+ }
274
+ /** Determine if an element will show or hide based on current activation */
275
+ willDisplay(source) {
276
+ const value = this.marshal.getValue(source, 'show-hide');
277
+ return value === true ||
278
+ (value === undefined && this.styleUtils.lookupStyle(source, 'display') !== 'none');
279
+ }
280
+ buildChildObservable() {
281
+ this.zone.runOutsideAngular(() => {
282
+ if (typeof MutationObserver !== 'undefined') {
283
+ this.observer = new MutationObserver((mutations) => {
284
+ const validatedChanges = (it) => {
285
+ return (it.addedNodes && it.addedNodes.length > 0) ||
286
+ (it.removedNodes && it.removedNodes.length > 0);
287
+ };
288
+ // update gap styles only for child 'added' or 'removed' events
289
+ if (mutations.some(validatedChanges)) {
290
+ this.observerSubject.next();
291
+ }
292
+ });
293
+ this.observer.observe(this.nativeElement, { childList: true });
294
+ }
295
+ });
296
+ }
297
+ }
298
+ LayoutGapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutGapDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i2.Directionality }, { token: i1.StyleUtils }, { token: LayoutGapStyleBuilder }, { token: i1.MediaMarshaller }], target: i0.ɵɵFactoryTarget.Directive });
299
+ LayoutGapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LayoutGapDirective, usesInheritance: true, ngImport: i0 });
300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutGapDirective, decorators: [{
301
+ type: Directive
302
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i2.Directionality }, { type: i1.StyleUtils }, { type: LayoutGapStyleBuilder }, { type: i1.MediaMarshaller }]; } });
303
+ class DefaultLayoutGapDirective extends LayoutGapDirective {
304
+ constructor() {
305
+ super(...arguments);
306
+ this.inputs = inputs$5;
307
+ }
308
+ }
309
+ DefaultLayoutGapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultLayoutGapDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
310
+ DefaultLayoutGapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: DefaultLayoutGapDirective, selector: "\n [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md],\n [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md],\n [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm],\n [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]\n", inputs: { fxLayoutGap: "fxLayoutGap", "fxLayoutGap.xs": "fxLayoutGap.xs", "fxLayoutGap.sm": "fxLayoutGap.sm", "fxLayoutGap.md": "fxLayoutGap.md", "fxLayoutGap.lg": "fxLayoutGap.lg", "fxLayoutGap.xl": "fxLayoutGap.xl", "fxLayoutGap.lt-sm": "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md": "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg": "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl": "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs": "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm": "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md": "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg": "fxLayoutGap.gt-lg" }, usesInheritance: true, ngImport: i0 });
311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultLayoutGapDirective, decorators: [{
312
+ type: Directive,
313
+ args: [{ selector: selector$5, inputs: inputs$5 }]
314
+ }] });
315
+ const layoutGapCacheRowRtl = new Map();
316
+ const layoutGapCacheColumnRtl = new Map();
317
+ const layoutGapCacheRowLtr = new Map();
318
+ const layoutGapCacheColumnLtr = new Map();
319
+ const GRID_SPECIFIER = ' grid';
320
+ function buildGridPadding(value, directionality) {
321
+ const [between, below] = value.split(' ');
322
+ const bottom = below ?? between;
323
+ let paddingRight = '0px', paddingBottom = bottom, paddingLeft = '0px';
324
+ if (directionality === 'rtl') {
325
+ paddingLeft = between;
326
+ }
327
+ else {
328
+ paddingRight = between;
329
+ }
330
+ return { 'padding': `0px ${paddingRight} ${paddingBottom} ${paddingLeft}` };
331
+ }
332
+ function buildGridMargin(value, directionality) {
333
+ const [between, below] = value.split(' ');
334
+ const bottom = below ?? between;
335
+ const minus = (str) => `-${str}`;
336
+ let marginRight = '0px', marginBottom = minus(bottom), marginLeft = '0px';
337
+ if (directionality === 'rtl') {
338
+ marginLeft = minus(between);
339
+ }
340
+ else {
341
+ marginRight = minus(between);
342
+ }
343
+ return { 'margin': `0px ${marginRight} ${marginBottom} ${marginLeft}` };
344
+ }
345
+ function getMarginType(directionality, layout) {
346
+ switch (layout) {
347
+ case 'column':
348
+ return 'margin-bottom';
349
+ case 'column-reverse':
350
+ return 'margin-top';
351
+ case 'row':
352
+ return directionality === 'rtl' ? 'margin-left' : 'margin-right';
353
+ case 'row-reverse':
354
+ return directionality === 'rtl' ? 'margin-right' : 'margin-left';
355
+ default:
356
+ return directionality === 'rtl' ? 'margin-left' : 'margin-right';
357
+ }
358
+ }
359
+ function buildGapCSS(gapValue, parent) {
360
+ const key = getMarginType(parent.directionality, parent.layout);
361
+ const margins = { ...CLEAR_MARGIN_CSS };
362
+ margins[key] = gapValue;
363
+ return margins;
364
+ }
365
+
366
+ /**
367
+ * @license
368
+ * Copyright Google LLC All Rights Reserved.
369
+ *
370
+ * Use of this source code is governed by an MIT-style license that can be
371
+ * found in the LICENSE file at https://angular.io/license
372
+ */
373
+ class FlexStyleBuilder extends StyleBuilder {
374
+ constructor(layoutConfig) {
375
+ super();
376
+ this.layoutConfig = layoutConfig;
377
+ }
378
+ buildStyles(input, parent) {
379
+ let [grow, shrink, ...basisParts] = input.split(' ');
380
+ let basis = basisParts.join(' ');
381
+ // The flex-direction of this element's flex container. Defaults to 'row'.
382
+ const direction = (parent.direction.indexOf('column') > -1) ? 'column' : 'row';
383
+ const max = isFlowHorizontal(direction) ? 'max-width' : 'max-height';
384
+ const min = isFlowHorizontal(direction) ? 'min-width' : 'min-height';
385
+ const hasCalc = String(basis).indexOf('calc') > -1;
386
+ const usingCalc = hasCalc || (basis === 'auto');
387
+ const isPercent = String(basis).indexOf('%') > -1 && !hasCalc;
388
+ const hasUnits = String(basis).indexOf('px') > -1 || String(basis).indexOf('rem') > -1 ||
389
+ String(basis).indexOf('em') > -1 || String(basis).indexOf('vw') > -1 ||
390
+ String(basis).indexOf('vh') > -1;
391
+ let isValue = (hasCalc || hasUnits);
392
+ grow = (grow == '0') ? 0 : grow;
393
+ shrink = (shrink == '0') ? 0 : shrink;
394
+ // make box inflexible when shrink and grow are both zero
395
+ // should not set a min when the grow is zero
396
+ // should not set a max when the shrink is zero
397
+ const isFixed = !grow && !shrink;
398
+ let css = {};
399
+ // flex-basis allows you to specify the initial/starting main-axis size of the element,
400
+ // before anything else is computed. It can either be a percentage or an absolute value.
401
+ // It is, however, not the breaking point for flex-grow/shrink properties
402
+ //
403
+ // flex-grow can be seen as this:
404
+ // 0: Do not stretch. Either size to element's content width, or obey 'flex-basis'.
405
+ // 1: (Default value). Stretch; will be the same size to all other flex items on
406
+ // the same row since they have a default value of 1.
407
+ // ≥2 (integer n): Stretch. Will be n times the size of other elements
408
+ // with 'flex-grow: 1' on the same row.
409
+ // Use `null` to clear existing styles.
410
+ const clearStyles = {
411
+ 'max-width': null,
412
+ 'max-height': null,
413
+ 'min-width': null,
414
+ 'min-height': null
415
+ };
416
+ switch (basis || '') {
417
+ case '':
418
+ const useColumnBasisZero = this.layoutConfig.useColumnBasisZero !== false;
419
+ basis = direction === 'row' ? '0%' : (useColumnBasisZero ? '0.000000001px' : 'auto');
420
+ break;
421
+ case 'initial': // default
422
+ case 'nogrow':
423
+ grow = 0;
424
+ basis = 'auto';
425
+ break;
426
+ case 'grow':
427
+ basis = '100%';
428
+ break;
429
+ case 'noshrink':
430
+ shrink = 0;
431
+ basis = 'auto';
432
+ break;
433
+ case 'auto':
434
+ break;
435
+ case 'none':
436
+ grow = 0;
437
+ shrink = 0;
438
+ basis = 'auto';
439
+ break;
440
+ default:
441
+ // Defaults to percentage sizing unless `px` is explicitly set
442
+ if (!isValue && !isPercent && !isNaN(basis)) {
443
+ basis = basis + '%';
444
+ }
445
+ // Fix for issue 280
446
+ if (basis === '0%') {
447
+ isValue = true;
448
+ }
449
+ if (basis === '0px') {
450
+ basis = '0%';
451
+ }
452
+ // fix issue #5345
453
+ if (hasCalc) {
454
+ css = extendObject(clearStyles, {
455
+ 'flex-grow': grow,
456
+ 'flex-shrink': shrink,
457
+ 'flex-basis': isValue ? basis : '100%'
458
+ });
459
+ }
460
+ else {
461
+ css = extendObject(clearStyles, {
462
+ 'flex': `${grow} ${shrink} ${isValue ? basis : '100%'}`
463
+ });
464
+ }
465
+ break;
466
+ }
467
+ if (!(css['flex'] || css['flex-grow'])) {
468
+ if (hasCalc) {
469
+ css = extendObject(clearStyles, {
470
+ 'flex-grow': grow,
471
+ 'flex-shrink': shrink,
472
+ 'flex-basis': basis
473
+ });
474
+ }
475
+ else {
476
+ css = extendObject(clearStyles, {
477
+ 'flex': `${grow} ${shrink} ${basis}`
478
+ });
479
+ }
480
+ }
481
+ // Fix for issues 277, 534, and 728
482
+ if (basis !== '0%' && basis !== '0px' && basis !== '0.000000001px' && basis !== 'auto') {
483
+ css[min] = isFixed || (isValue && grow) ? basis : null;
484
+ css[max] = isFixed || (!usingCalc && shrink) ? basis : null;
485
+ }
486
+ // Fix for issue 528
487
+ if (!css[min] && !css[max]) {
488
+ if (hasCalc) {
489
+ css = extendObject(clearStyles, {
490
+ 'flex-grow': grow,
491
+ 'flex-shrink': shrink,
492
+ 'flex-basis': basis
493
+ });
494
+ }
495
+ else {
496
+ css = extendObject(clearStyles, {
497
+ 'flex': `${grow} ${shrink} ${basis}`
498
+ });
499
+ }
500
+ }
501
+ else {
502
+ // Fix for issue 660
503
+ if (parent.hasWrap) {
504
+ css[hasCalc ? 'flex-basis' : 'flex'] = css[max] ?
505
+ (hasCalc ? css[max] : `${grow} ${shrink} ${css[max]}`) :
506
+ (hasCalc ? css[min] : `${grow} ${shrink} ${css[min]}`);
507
+ }
508
+ }
509
+ return extendObject(css, { 'box-sizing': 'border-box' });
510
+ }
511
+ }
512
+ FlexStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexStyleBuilder, deps: [{ token: LAYOUT_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
513
+ FlexStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexStyleBuilder, providedIn: 'root' });
514
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexStyleBuilder, decorators: [{
515
+ type: Injectable,
516
+ args: [{ providedIn: 'root' }]
517
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
518
+ type: Inject,
519
+ args: [LAYOUT_CONFIG]
520
+ }] }]; } });
521
+ const inputs$4 = [
522
+ 'fxFlex', 'fxFlex.xs', 'fxFlex.sm', 'fxFlex.md',
523
+ 'fxFlex.lg', 'fxFlex.xl', 'fxFlex.lt-sm', 'fxFlex.lt-md',
524
+ 'fxFlex.lt-lg', 'fxFlex.lt-xl', 'fxFlex.gt-xs', 'fxFlex.gt-sm',
525
+ 'fxFlex.gt-md', 'fxFlex.gt-lg'
526
+ ];
527
+ const selector$4 = `
528
+ [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md],
529
+ [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md],
530
+ [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm],
531
+ [fxFlex.gt-md], [fxFlex.gt-lg]
532
+ `;
533
+ /**
534
+ * Directive to control the size of a flex item using flex-basis, flex-grow, and flex-shrink.
535
+ * Corresponds to the css `flex` shorthand property.
536
+ *
537
+ * @see https://css-tricks.com/snippets/css/a-guide-to-flexbox/
538
+ */
539
+ class FlexDirective extends BaseDirective2 {
540
+ constructor(elRef, styleUtils, layoutConfig, styleBuilder, marshal) {
541
+ super(elRef, styleBuilder, styleUtils, marshal);
542
+ this.layoutConfig = layoutConfig;
543
+ this.marshal = marshal;
544
+ this.DIRECTIVE_KEY = 'flex';
545
+ this.direction = undefined;
546
+ this.wrap = undefined;
547
+ this.flexGrow = '1';
548
+ this.flexShrink = '1';
549
+ this.init();
550
+ }
551
+ get shrink() { return this.flexShrink; }
552
+ set shrink(value) {
553
+ this.flexShrink = value || '1';
554
+ this.triggerReflow();
555
+ }
556
+ get grow() { return this.flexGrow; }
557
+ set grow(value) {
558
+ this.flexGrow = value || '1';
559
+ this.triggerReflow();
560
+ }
561
+ ngOnInit() {
562
+ if (this.parentElement) {
563
+ this.marshal.trackValue(this.parentElement, 'layout')
564
+ .pipe(takeUntil(this.destroySubject))
565
+ .subscribe(this.onLayoutChange.bind(this));
566
+ this.marshal.trackValue(this.nativeElement, 'layout-align')
567
+ .pipe(takeUntil(this.destroySubject))
568
+ .subscribe(this.triggerReflow.bind(this));
569
+ }
570
+ }
571
+ /**
572
+ * Caches the parent container's 'flex-direction' and updates the element's style.
573
+ * Used as a handler for layout change events from the parent flex container.
574
+ */
575
+ onLayoutChange(matcher) {
576
+ const layout = matcher.value;
577
+ const layoutParts = layout.split(' ');
578
+ this.direction = layoutParts[0];
579
+ this.wrap = layoutParts[1] !== undefined && layoutParts[1] === 'wrap';
580
+ this.triggerUpdate();
581
+ }
582
+ /** Input to this is exclusively the basis input value */
583
+ updateWithValue(value) {
584
+ const addFlexToParent = this.layoutConfig.addFlexToParent !== false;
585
+ if (this.direction === undefined) {
586
+ this.direction = this.getFlexFlowDirection(this.parentElement, addFlexToParent);
587
+ }
588
+ if (this.wrap === undefined) {
589
+ this.wrap = this.hasWrap(this.parentElement);
590
+ }
591
+ const direction = this.direction;
592
+ const isHorizontal = direction.startsWith('row');
593
+ const hasWrap = this.wrap;
594
+ if (isHorizontal && hasWrap) {
595
+ this.styleCache = flexRowWrapCache;
596
+ }
597
+ else if (isHorizontal && !hasWrap) {
598
+ this.styleCache = flexRowCache;
599
+ }
600
+ else if (!isHorizontal && hasWrap) {
601
+ this.styleCache = flexColumnWrapCache;
602
+ }
603
+ else if (!isHorizontal && !hasWrap) {
604
+ this.styleCache = flexColumnCache;
605
+ }
606
+ const basis = String(value).replace(';', '');
607
+ const parts = validateBasis(basis, this.flexGrow, this.flexShrink);
608
+ this.addStyles(parts.join(' '), { direction, hasWrap });
609
+ }
610
+ /** Trigger a style reflow, usually based on a shrink/grow input event */
611
+ triggerReflow() {
612
+ const activatedValue = this.activatedValue;
613
+ if (activatedValue !== undefined) {
614
+ const parts = validateBasis(activatedValue + '', this.flexGrow, this.flexShrink);
615
+ this.marshal.updateElement(this.nativeElement, this.DIRECTIVE_KEY, parts.join(' '));
616
+ }
617
+ }
618
+ }
619
+ FlexDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexDirective, deps: [{ token: i0.ElementRef }, { token: i1.StyleUtils }, { token: LAYOUT_CONFIG }, { token: FlexStyleBuilder }, { token: i1.MediaMarshaller }], target: i0.ɵɵFactoryTarget.Directive });
620
+ FlexDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: FlexDirective, inputs: { shrink: ["fxShrink", "shrink"], grow: ["fxGrow", "grow"] }, usesInheritance: true, ngImport: i0 });
621
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexDirective, decorators: [{
622
+ type: Directive
623
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.StyleUtils }, { type: undefined, decorators: [{
624
+ type: Inject,
625
+ args: [LAYOUT_CONFIG]
626
+ }] }, { type: FlexStyleBuilder }, { type: i1.MediaMarshaller }]; }, propDecorators: { shrink: [{
627
+ type: Input,
628
+ args: ['fxShrink']
629
+ }], grow: [{
630
+ type: Input,
631
+ args: ['fxGrow']
632
+ }] } });
633
+ class DefaultFlexDirective extends FlexDirective {
634
+ constructor() {
635
+ super(...arguments);
636
+ this.inputs = inputs$4;
637
+ }
638
+ }
639
+ DefaultFlexDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
640
+ DefaultFlexDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: DefaultFlexDirective, selector: "\n [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md],\n [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md],\n [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm],\n [fxFlex.gt-md], [fxFlex.gt-lg]\n", inputs: { fxFlex: "fxFlex", "fxFlex.xs": "fxFlex.xs", "fxFlex.sm": "fxFlex.sm", "fxFlex.md": "fxFlex.md", "fxFlex.lg": "fxFlex.lg", "fxFlex.xl": "fxFlex.xl", "fxFlex.lt-sm": "fxFlex.lt-sm", "fxFlex.lt-md": "fxFlex.lt-md", "fxFlex.lt-lg": "fxFlex.lt-lg", "fxFlex.lt-xl": "fxFlex.lt-xl", "fxFlex.gt-xs": "fxFlex.gt-xs", "fxFlex.gt-sm": "fxFlex.gt-sm", "fxFlex.gt-md": "fxFlex.gt-md", "fxFlex.gt-lg": "fxFlex.gt-lg" }, usesInheritance: true, ngImport: i0 });
641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexDirective, decorators: [{
642
+ type: Directive,
643
+ args: [{ inputs: inputs$4, selector: selector$4 }]
644
+ }] });
645
+ const flexRowCache = new Map();
646
+ const flexColumnCache = new Map();
647
+ const flexRowWrapCache = new Map();
648
+ const flexColumnWrapCache = new Map();
649
+
650
+ /**
651
+ * @license
652
+ * Copyright Google LLC All Rights Reserved.
653
+ *
654
+ * Use of this source code is governed by an MIT-style license that can be
655
+ * found in the LICENSE file at https://angular.io/license
656
+ */
657
+ class FlexOrderStyleBuilder extends StyleBuilder {
658
+ buildStyles(value) {
659
+ return { order: (value && parseInt(value, 10)) || '' };
660
+ }
661
+ }
662
+ FlexOrderStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOrderStyleBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
663
+ FlexOrderStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOrderStyleBuilder, providedIn: 'root' });
664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOrderStyleBuilder, decorators: [{
665
+ type: Injectable,
666
+ args: [{ providedIn: 'root' }]
667
+ }] });
668
+ const inputs$3 = [
669
+ 'fxFlexOrder', 'fxFlexOrder.xs', 'fxFlexOrder.sm', 'fxFlexOrder.md',
670
+ 'fxFlexOrder.lg', 'fxFlexOrder.xl', 'fxFlexOrder.lt-sm', 'fxFlexOrder.lt-md',
671
+ 'fxFlexOrder.lt-lg', 'fxFlexOrder.lt-xl', 'fxFlexOrder.gt-xs', 'fxFlexOrder.gt-sm',
672
+ 'fxFlexOrder.gt-md', 'fxFlexOrder.gt-lg'
673
+ ];
674
+ const selector$3 = `
675
+ [fxFlexOrder], [fxFlexOrder.xs], [fxFlexOrder.sm], [fxFlexOrder.md],
676
+ [fxFlexOrder.lg], [fxFlexOrder.xl], [fxFlexOrder.lt-sm], [fxFlexOrder.lt-md],
677
+ [fxFlexOrder.lt-lg], [fxFlexOrder.lt-xl], [fxFlexOrder.gt-xs], [fxFlexOrder.gt-sm],
678
+ [fxFlexOrder.gt-md], [fxFlexOrder.gt-lg]
679
+ `;
680
+ /**
681
+ * 'flex-order' flexbox styling directive
682
+ * Configures the positional ordering of the element in a sorted layout container
683
+ * @see https://css-tricks.com/almanac/properties/o/order/
684
+ */
685
+ class FlexOrderDirective extends BaseDirective2 {
686
+ constructor(elRef, styleUtils, styleBuilder, marshal) {
687
+ super(elRef, styleBuilder, styleUtils, marshal);
688
+ this.DIRECTIVE_KEY = 'flex-order';
689
+ this.styleCache = flexOrderCache;
690
+ this.init();
691
+ }
692
+ }
693
+ FlexOrderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOrderDirective, deps: [{ token: i0.ElementRef }, { token: i1.StyleUtils }, { token: FlexOrderStyleBuilder }, { token: i1.MediaMarshaller }], target: i0.ɵɵFactoryTarget.Directive });
694
+ FlexOrderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: FlexOrderDirective, usesInheritance: true, ngImport: i0 });
695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOrderDirective, decorators: [{
696
+ type: Directive
697
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.StyleUtils }, { type: FlexOrderStyleBuilder }, { type: i1.MediaMarshaller }]; } });
698
+ const flexOrderCache = new Map();
699
+ class DefaultFlexOrderDirective extends FlexOrderDirective {
700
+ constructor() {
701
+ super(...arguments);
702
+ this.inputs = inputs$3;
703
+ }
704
+ }
705
+ DefaultFlexOrderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexOrderDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
706
+ DefaultFlexOrderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: DefaultFlexOrderDirective, selector: "\n [fxFlexOrder], [fxFlexOrder.xs], [fxFlexOrder.sm], [fxFlexOrder.md],\n [fxFlexOrder.lg], [fxFlexOrder.xl], [fxFlexOrder.lt-sm], [fxFlexOrder.lt-md],\n [fxFlexOrder.lt-lg], [fxFlexOrder.lt-xl], [fxFlexOrder.gt-xs], [fxFlexOrder.gt-sm],\n [fxFlexOrder.gt-md], [fxFlexOrder.gt-lg]\n", inputs: { fxFlexOrder: "fxFlexOrder", "fxFlexOrder.xs": "fxFlexOrder.xs", "fxFlexOrder.sm": "fxFlexOrder.sm", "fxFlexOrder.md": "fxFlexOrder.md", "fxFlexOrder.lg": "fxFlexOrder.lg", "fxFlexOrder.xl": "fxFlexOrder.xl", "fxFlexOrder.lt-sm": "fxFlexOrder.lt-sm", "fxFlexOrder.lt-md": "fxFlexOrder.lt-md", "fxFlexOrder.lt-lg": "fxFlexOrder.lt-lg", "fxFlexOrder.lt-xl": "fxFlexOrder.lt-xl", "fxFlexOrder.gt-xs": "fxFlexOrder.gt-xs", "fxFlexOrder.gt-sm": "fxFlexOrder.gt-sm", "fxFlexOrder.gt-md": "fxFlexOrder.gt-md", "fxFlexOrder.gt-lg": "fxFlexOrder.gt-lg" }, usesInheritance: true, ngImport: i0 });
707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexOrderDirective, decorators: [{
708
+ type: Directive,
709
+ args: [{ selector: selector$3, inputs: inputs$3 }]
710
+ }] });
711
+
712
+ /**
713
+ * @license
714
+ * Copyright Google LLC All Rights Reserved.
715
+ *
716
+ * Use of this source code is governed by an MIT-style license that can be
717
+ * found in the LICENSE file at https://angular.io/license
718
+ */
719
+ class FlexOffsetStyleBuilder extends StyleBuilder {
720
+ constructor(_config) {
721
+ super();
722
+ this._config = _config;
723
+ }
724
+ buildStyles(offset, parent) {
725
+ offset || (offset = '0');
726
+ offset = ɵmultiply(offset, this._config.multiplier);
727
+ const isPercent = String(offset).indexOf('%') > -1;
728
+ const isPx = String(offset).indexOf('px') > -1;
729
+ if (!isPx && !isPercent && !isNaN(+offset)) {
730
+ offset = `${offset}%`;
731
+ }
732
+ const horizontalLayoutKey = parent.isRtl ? 'margin-right' : 'margin-left';
733
+ const styles = isFlowHorizontal(parent.layout) ?
734
+ { [horizontalLayoutKey]: offset } : { 'margin-top': offset };
735
+ return styles;
736
+ }
737
+ }
738
+ FlexOffsetStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOffsetStyleBuilder, deps: [{ token: LAYOUT_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
739
+ FlexOffsetStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOffsetStyleBuilder, providedIn: 'root' });
740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOffsetStyleBuilder, decorators: [{
741
+ type: Injectable,
742
+ args: [{ providedIn: 'root' }]
743
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
744
+ type: Inject,
745
+ args: [LAYOUT_CONFIG]
746
+ }] }]; } });
747
+ const inputs$2 = [
748
+ 'fxFlexOffset', 'fxFlexOffset.xs', 'fxFlexOffset.sm', 'fxFlexOffset.md',
749
+ 'fxFlexOffset.lg', 'fxFlexOffset.xl', 'fxFlexOffset.lt-sm', 'fxFlexOffset.lt-md',
750
+ 'fxFlexOffset.lt-lg', 'fxFlexOffset.lt-xl', 'fxFlexOffset.gt-xs', 'fxFlexOffset.gt-sm',
751
+ 'fxFlexOffset.gt-md', 'fxFlexOffset.gt-lg'
752
+ ];
753
+ const selector$2 = `
754
+ [fxFlexOffset], [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md],
755
+ [fxFlexOffset.lg], [fxFlexOffset.xl], [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md],
756
+ [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl], [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm],
757
+ [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]
758
+ `;
759
+ /**
760
+ * 'flex-offset' flexbox styling directive
761
+ * Configures the 'margin-left' of the element in a layout container
762
+ */
763
+ class FlexOffsetDirective extends BaseDirective2 {
764
+ constructor(elRef, directionality, styleBuilder, marshal, styler) {
765
+ super(elRef, styleBuilder, styler, marshal);
766
+ this.directionality = directionality;
767
+ this.DIRECTIVE_KEY = 'flex-offset';
768
+ this.init([this.directionality.change]);
769
+ // Parent DOM `layout-gap` with affect the nested child with `flex-offset`
770
+ if (this.parentElement) {
771
+ this.marshal
772
+ .trackValue(this.parentElement, 'layout-gap')
773
+ .pipe(takeUntil(this.destroySubject))
774
+ .subscribe(this.triggerUpdate.bind(this));
775
+ }
776
+ }
777
+ // *********************************************
778
+ // Protected methods
779
+ // *********************************************
780
+ /**
781
+ * Using the current fxFlexOffset value, update the inline CSS
782
+ * NOTE: this will assign `margin-left` if the parent flex-direction == 'row',
783
+ * otherwise `margin-top` is used for the offset.
784
+ */
785
+ updateWithValue(value = '') {
786
+ // The flex-direction of this element's flex container. Defaults to 'row'.
787
+ const layout = this.getFlexFlowDirection(this.parentElement, true);
788
+ const isRtl = this.directionality.value === 'rtl';
789
+ if (layout === 'row' && isRtl) {
790
+ this.styleCache = flexOffsetCacheRowRtl;
791
+ }
792
+ else if (layout === 'row' && !isRtl) {
793
+ this.styleCache = flexOffsetCacheRowLtr;
794
+ }
795
+ else if (layout === 'column' && isRtl) {
796
+ this.styleCache = flexOffsetCacheColumnRtl;
797
+ }
798
+ else if (layout === 'column' && !isRtl) {
799
+ this.styleCache = flexOffsetCacheColumnLtr;
800
+ }
801
+ this.addStyles(value + '', { layout, isRtl });
802
+ }
803
+ }
804
+ FlexOffsetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOffsetDirective, deps: [{ token: i0.ElementRef }, { token: i2.Directionality }, { token: FlexOffsetStyleBuilder }, { token: i1.MediaMarshaller }, { token: i1.StyleUtils }], target: i0.ɵɵFactoryTarget.Directive });
805
+ FlexOffsetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: FlexOffsetDirective, usesInheritance: true, ngImport: i0 });
806
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexOffsetDirective, decorators: [{
807
+ type: Directive
808
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.Directionality }, { type: FlexOffsetStyleBuilder }, { type: i1.MediaMarshaller }, { type: i1.StyleUtils }]; } });
809
+ class DefaultFlexOffsetDirective extends FlexOffsetDirective {
810
+ constructor() {
811
+ super(...arguments);
812
+ this.inputs = inputs$2;
813
+ }
814
+ }
815
+ DefaultFlexOffsetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexOffsetDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
816
+ DefaultFlexOffsetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: DefaultFlexOffsetDirective, selector: "\n [fxFlexOffset], [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md],\n [fxFlexOffset.lg], [fxFlexOffset.xl], [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md],\n [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl], [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm],\n [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]\n", inputs: { fxFlexOffset: "fxFlexOffset", "fxFlexOffset.xs": "fxFlexOffset.xs", "fxFlexOffset.sm": "fxFlexOffset.sm", "fxFlexOffset.md": "fxFlexOffset.md", "fxFlexOffset.lg": "fxFlexOffset.lg", "fxFlexOffset.xl": "fxFlexOffset.xl", "fxFlexOffset.lt-sm": "fxFlexOffset.lt-sm", "fxFlexOffset.lt-md": "fxFlexOffset.lt-md", "fxFlexOffset.lt-lg": "fxFlexOffset.lt-lg", "fxFlexOffset.lt-xl": "fxFlexOffset.lt-xl", "fxFlexOffset.gt-xs": "fxFlexOffset.gt-xs", "fxFlexOffset.gt-sm": "fxFlexOffset.gt-sm", "fxFlexOffset.gt-md": "fxFlexOffset.gt-md", "fxFlexOffset.gt-lg": "fxFlexOffset.gt-lg" }, usesInheritance: true, ngImport: i0 });
817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexOffsetDirective, decorators: [{
818
+ type: Directive,
819
+ args: [{ selector: selector$2, inputs: inputs$2 }]
820
+ }] });
821
+ const flexOffsetCacheRowRtl = new Map();
822
+ const flexOffsetCacheColumnRtl = new Map();
823
+ const flexOffsetCacheRowLtr = new Map();
824
+ const flexOffsetCacheColumnLtr = new Map();
825
+
826
+ /**
827
+ * @license
828
+ * Copyright Google LLC All Rights Reserved.
829
+ *
830
+ * Use of this source code is governed by an MIT-style license that can be
831
+ * found in the LICENSE file at https://angular.io/license
832
+ */
833
+ class FlexAlignStyleBuilder extends StyleBuilder {
834
+ buildStyles(input) {
835
+ input = input || 'stretch';
836
+ const styles = {};
837
+ // Cross-axis
838
+ switch (input) {
839
+ case 'start':
840
+ styles['align-self'] = 'flex-start';
841
+ break;
842
+ case 'end':
843
+ styles['align-self'] = 'flex-end';
844
+ break;
845
+ default:
846
+ styles['align-self'] = input;
847
+ break;
848
+ }
849
+ return styles;
850
+ }
851
+ }
852
+ FlexAlignStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexAlignStyleBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
853
+ FlexAlignStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexAlignStyleBuilder, providedIn: 'root' });
854
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexAlignStyleBuilder, decorators: [{
855
+ type: Injectable,
856
+ args: [{ providedIn: 'root' }]
857
+ }] });
858
+ const inputs$1 = [
859
+ 'fxFlexAlign', 'fxFlexAlign.xs', 'fxFlexAlign.sm', 'fxFlexAlign.md',
860
+ 'fxFlexAlign.lg', 'fxFlexAlign.xl', 'fxFlexAlign.lt-sm', 'fxFlexAlign.lt-md',
861
+ 'fxFlexAlign.lt-lg', 'fxFlexAlign.lt-xl', 'fxFlexAlign.gt-xs', 'fxFlexAlign.gt-sm',
862
+ 'fxFlexAlign.gt-md', 'fxFlexAlign.gt-lg'
863
+ ];
864
+ const selector$1 = `
865
+ [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md],
866
+ [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md],
867
+ [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm],
868
+ [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]
869
+ `;
870
+ /**
871
+ * 'flex-align' flexbox styling directive
872
+ * Allows element-specific overrides for cross-axis alignments in a layout container
873
+ * @see https://css-tricks.com/almanac/properties/a/align-self/
874
+ */
875
+ class FlexAlignDirective extends BaseDirective2 {
876
+ constructor(elRef, styleUtils, styleBuilder, marshal) {
877
+ super(elRef, styleBuilder, styleUtils, marshal);
878
+ this.DIRECTIVE_KEY = 'flex-align';
879
+ this.styleCache = flexAlignCache;
880
+ this.init();
881
+ }
882
+ }
883
+ FlexAlignDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexAlignDirective, deps: [{ token: i0.ElementRef }, { token: i1.StyleUtils }, { token: FlexAlignStyleBuilder }, { token: i1.MediaMarshaller }], target: i0.ɵɵFactoryTarget.Directive });
884
+ FlexAlignDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: FlexAlignDirective, usesInheritance: true, ngImport: i0 });
885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexAlignDirective, decorators: [{
886
+ type: Directive
887
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.StyleUtils }, { type: FlexAlignStyleBuilder }, { type: i1.MediaMarshaller }]; } });
888
+ const flexAlignCache = new Map();
889
+ class DefaultFlexAlignDirective extends FlexAlignDirective {
890
+ constructor() {
891
+ super(...arguments);
892
+ this.inputs = inputs$1;
893
+ }
894
+ }
895
+ DefaultFlexAlignDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexAlignDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
896
+ DefaultFlexAlignDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: DefaultFlexAlignDirective, selector: "\n [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md],\n [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md],\n [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm],\n [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]\n", inputs: { fxFlexAlign: "fxFlexAlign", "fxFlexAlign.xs": "fxFlexAlign.xs", "fxFlexAlign.sm": "fxFlexAlign.sm", "fxFlexAlign.md": "fxFlexAlign.md", "fxFlexAlign.lg": "fxFlexAlign.lg", "fxFlexAlign.xl": "fxFlexAlign.xl", "fxFlexAlign.lt-sm": "fxFlexAlign.lt-sm", "fxFlexAlign.lt-md": "fxFlexAlign.lt-md", "fxFlexAlign.lt-lg": "fxFlexAlign.lt-lg", "fxFlexAlign.lt-xl": "fxFlexAlign.lt-xl", "fxFlexAlign.gt-xs": "fxFlexAlign.gt-xs", "fxFlexAlign.gt-sm": "fxFlexAlign.gt-sm", "fxFlexAlign.gt-md": "fxFlexAlign.gt-md", "fxFlexAlign.gt-lg": "fxFlexAlign.gt-lg" }, usesInheritance: true, ngImport: i0 });
897
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultFlexAlignDirective, decorators: [{
898
+ type: Directive,
899
+ args: [{ selector: selector$1, inputs: inputs$1 }]
900
+ }] });
901
+
902
+ /**
903
+ * @license
904
+ * Copyright Google LLC All Rights Reserved.
905
+ *
906
+ * Use of this source code is governed by an MIT-style license that can be
907
+ * found in the LICENSE file at https://angular.io/license
908
+ */
909
+ const FLEX_FILL_CSS = {
910
+ 'margin': 0,
911
+ 'width': '100%',
912
+ 'height': '100%',
913
+ 'min-width': '100%',
914
+ 'min-height': '100%'
915
+ };
916
+ class FlexFillStyleBuilder extends StyleBuilder {
917
+ buildStyles(_input) {
918
+ return FLEX_FILL_CSS;
919
+ }
920
+ }
921
+ FlexFillStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexFillStyleBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
922
+ FlexFillStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexFillStyleBuilder, providedIn: 'root' });
923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexFillStyleBuilder, decorators: [{
924
+ type: Injectable,
925
+ args: [{ providedIn: 'root' }]
926
+ }] });
927
+ /**
928
+ * 'fxFill' flexbox styling directive
929
+ * Maximizes width and height of element in a layout container
930
+ *
931
+ * NOTE: fxFill is NOT responsive API!!
932
+ */
933
+ class FlexFillDirective extends BaseDirective2 {
934
+ constructor(elRef, styleUtils, styleBuilder, marshal) {
935
+ super(elRef, styleBuilder, styleUtils, marshal);
936
+ this.styleCache = flexFillCache;
937
+ this.addStyles('');
938
+ }
939
+ }
940
+ FlexFillDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexFillDirective, deps: [{ token: i0.ElementRef }, { token: i1.StyleUtils }, { token: FlexFillStyleBuilder }, { token: i1.MediaMarshaller }], target: i0.ɵɵFactoryTarget.Directive });
941
+ FlexFillDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: FlexFillDirective, selector: "[fxFill], [fxFlexFill]", usesInheritance: true, ngImport: i0 });
942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexFillDirective, decorators: [{
943
+ type: Directive,
944
+ args: [{ selector: `[fxFill], [fxFlexFill]` }]
945
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.StyleUtils }, { type: FlexFillStyleBuilder }, { type: i1.MediaMarshaller }]; } });
946
+ const flexFillCache = new Map();
947
+
948
+ /**
949
+ * @license
950
+ * Copyright Google LLC All Rights Reserved.
951
+ *
952
+ * Use of this source code is governed by an MIT-style license that can be
953
+ * found in the LICENSE file at https://angular.io/license
954
+ */
955
+ class LayoutAlignStyleBuilder extends StyleBuilder {
956
+ buildStyles(align, parent) {
957
+ const css = {}, [mainAxis, crossAxis] = align.split(' ');
958
+ // Main axis
959
+ switch (mainAxis) {
960
+ case 'center':
961
+ css['justify-content'] = 'center';
962
+ break;
963
+ case 'space-around':
964
+ css['justify-content'] = 'space-around';
965
+ break;
966
+ case 'space-between':
967
+ css['justify-content'] = 'space-between';
968
+ break;
969
+ case 'space-evenly':
970
+ css['justify-content'] = 'space-evenly';
971
+ break;
972
+ case 'end':
973
+ case 'flex-end':
974
+ css['justify-content'] = 'flex-end';
975
+ break;
976
+ case 'start':
977
+ case 'flex-start':
978
+ default:
979
+ css['justify-content'] = 'flex-start'; // default main axis
980
+ break;
981
+ }
982
+ // Cross-axis
983
+ switch (crossAxis) {
984
+ case 'start':
985
+ case 'flex-start':
986
+ css['align-items'] = css['align-content'] = 'flex-start';
987
+ break;
988
+ case 'center':
989
+ css['align-items'] = css['align-content'] = 'center';
990
+ break;
991
+ case 'end':
992
+ case 'flex-end':
993
+ css['align-items'] = css['align-content'] = 'flex-end';
994
+ break;
995
+ case 'space-between':
996
+ css['align-content'] = 'space-between';
997
+ css['align-items'] = 'stretch';
998
+ break;
999
+ case 'space-around':
1000
+ css['align-content'] = 'space-around';
1001
+ css['align-items'] = 'stretch';
1002
+ break;
1003
+ case 'baseline':
1004
+ css['align-content'] = 'stretch';
1005
+ css['align-items'] = 'baseline';
1006
+ break;
1007
+ case 'stretch':
1008
+ default: // 'stretch'
1009
+ css['align-items'] = css['align-content'] = 'stretch'; // default cross axis
1010
+ break;
1011
+ }
1012
+ return extendObject(css, {
1013
+ 'display': parent.inline ? 'inline-flex' : 'flex',
1014
+ 'flex-direction': parent.layout,
1015
+ 'box-sizing': 'border-box',
1016
+ 'max-width': crossAxis === 'stretch' ?
1017
+ !isFlowHorizontal(parent.layout) ? '100%' : null : null,
1018
+ 'max-height': crossAxis === 'stretch' ?
1019
+ isFlowHorizontal(parent.layout) ? '100%' : null : null,
1020
+ });
1021
+ }
1022
+ }
1023
+ LayoutAlignStyleBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutAlignStyleBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1024
+ LayoutAlignStyleBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutAlignStyleBuilder, providedIn: 'root' });
1025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutAlignStyleBuilder, decorators: [{
1026
+ type: Injectable,
1027
+ args: [{ providedIn: 'root' }]
1028
+ }] });
1029
+ const inputs = [
1030
+ 'fxLayoutAlign', 'fxLayoutAlign.xs', 'fxLayoutAlign.sm', 'fxLayoutAlign.md',
1031
+ 'fxLayoutAlign.lg', 'fxLayoutAlign.xl', 'fxLayoutAlign.lt-sm', 'fxLayoutAlign.lt-md',
1032
+ 'fxLayoutAlign.lt-lg', 'fxLayoutAlign.lt-xl', 'fxLayoutAlign.gt-xs', 'fxLayoutAlign.gt-sm',
1033
+ 'fxLayoutAlign.gt-md', 'fxLayoutAlign.gt-lg'
1034
+ ];
1035
+ const selector = `
1036
+ [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md],
1037
+ [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md],
1038
+ [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm],
1039
+ [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]
1040
+ `;
1041
+ /**
1042
+ * 'layout-align' flexbox styling directive
1043
+ * Defines positioning of child elements along main and cross axis in a layout container
1044
+ * Optional values: {main-axis} values or {main-axis cross-axis} value pairs
1045
+ *
1046
+ * @see https://css-tricks.com/almanac/properties/j/justify-content/
1047
+ * @see https://css-tricks.com/almanac/properties/a/align-items/
1048
+ * @see https://css-tricks.com/almanac/properties/a/align-content/
1049
+ */
1050
+ class LayoutAlignDirective extends BaseDirective2 {
1051
+ constructor(elRef, styleUtils, styleBuilder, marshal) {
1052
+ super(elRef, styleBuilder, styleUtils, marshal);
1053
+ this.DIRECTIVE_KEY = 'layout-align';
1054
+ this.layout = 'row'; // default flex-direction
1055
+ this.inline = false; // default inline value
1056
+ this.init();
1057
+ this.marshal.trackValue(this.nativeElement, 'layout')
1058
+ .pipe(takeUntil(this.destroySubject))
1059
+ .subscribe(this.onLayoutChange.bind(this));
1060
+ }
1061
+ // *********************************************
1062
+ // Protected methods
1063
+ // *********************************************
1064
+ /**
1065
+ *
1066
+ */
1067
+ updateWithValue(value) {
1068
+ const layout = this.layout || 'row';
1069
+ const inline = this.inline;
1070
+ if (layout === 'row' && inline) {
1071
+ this.styleCache = layoutAlignHorizontalInlineCache;
1072
+ }
1073
+ else if (layout === 'row' && !inline) {
1074
+ this.styleCache = layoutAlignHorizontalCache;
1075
+ }
1076
+ else if (layout === 'row-reverse' && inline) {
1077
+ this.styleCache = layoutAlignHorizontalRevInlineCache;
1078
+ }
1079
+ else if (layout === 'row-reverse' && !inline) {
1080
+ this.styleCache = layoutAlignHorizontalRevCache;
1081
+ }
1082
+ else if (layout === 'column' && inline) {
1083
+ this.styleCache = layoutAlignVerticalInlineCache;
1084
+ }
1085
+ else if (layout === 'column' && !inline) {
1086
+ this.styleCache = layoutAlignVerticalCache;
1087
+ }
1088
+ else if (layout === 'column-reverse' && inline) {
1089
+ this.styleCache = layoutAlignVerticalRevInlineCache;
1090
+ }
1091
+ else if (layout === 'column-reverse' && !inline) {
1092
+ this.styleCache = layoutAlignVerticalRevCache;
1093
+ }
1094
+ this.addStyles(value, { layout, inline });
1095
+ }
1096
+ /**
1097
+ * Cache the parent container 'flex-direction' and update the 'flex' styles
1098
+ */
1099
+ onLayoutChange(matcher) {
1100
+ const layoutKeys = matcher.value.split(' ');
1101
+ this.layout = layoutKeys[0];
1102
+ this.inline = matcher.value.includes('inline');
1103
+ if (!LAYOUT_VALUES.find(x => x === this.layout)) {
1104
+ this.layout = 'row';
1105
+ }
1106
+ this.triggerUpdate();
1107
+ }
1108
+ }
1109
+ LayoutAlignDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutAlignDirective, deps: [{ token: i0.ElementRef }, { token: i1.StyleUtils }, { token: LayoutAlignStyleBuilder }, { token: i1.MediaMarshaller }], target: i0.ɵɵFactoryTarget.Directive });
1110
+ LayoutAlignDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LayoutAlignDirective, usesInheritance: true, ngImport: i0 });
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayoutAlignDirective, decorators: [{
1112
+ type: Directive
1113
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.StyleUtils }, { type: LayoutAlignStyleBuilder }, { type: i1.MediaMarshaller }]; } });
1114
+ class DefaultLayoutAlignDirective extends LayoutAlignDirective {
1115
+ constructor() {
1116
+ super(...arguments);
1117
+ this.inputs = inputs;
1118
+ }
1119
+ }
1120
+ DefaultLayoutAlignDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultLayoutAlignDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1121
+ DefaultLayoutAlignDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: DefaultLayoutAlignDirective, selector: "\n [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md],\n [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md],\n [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm],\n [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]\n", inputs: { fxLayoutAlign: "fxLayoutAlign", "fxLayoutAlign.xs": "fxLayoutAlign.xs", "fxLayoutAlign.sm": "fxLayoutAlign.sm", "fxLayoutAlign.md": "fxLayoutAlign.md", "fxLayoutAlign.lg": "fxLayoutAlign.lg", "fxLayoutAlign.xl": "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm": "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md": "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg": "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl": "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs": "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm": "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md": "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg": "fxLayoutAlign.gt-lg" }, usesInheritance: true, ngImport: i0 });
1122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: DefaultLayoutAlignDirective, decorators: [{
1123
+ type: Directive,
1124
+ args: [{ selector, inputs }]
1125
+ }] });
1126
+ const layoutAlignHorizontalCache = new Map();
1127
+ const layoutAlignVerticalCache = new Map();
1128
+ const layoutAlignHorizontalRevCache = new Map();
1129
+ const layoutAlignVerticalRevCache = new Map();
1130
+ const layoutAlignHorizontalInlineCache = new Map();
1131
+ const layoutAlignVerticalInlineCache = new Map();
1132
+ const layoutAlignHorizontalRevInlineCache = new Map();
1133
+ const layoutAlignVerticalRevInlineCache = new Map();
1134
+
1135
+ /**
1136
+ * @license
1137
+ * Copyright Google LLC All Rights Reserved.
1138
+ *
1139
+ * Use of this source code is governed by an MIT-style license that can be
1140
+ * found in the LICENSE file at https://angular.io/license
1141
+ */
1142
+ const ALL_DIRECTIVES = [
1143
+ DefaultLayoutDirective,
1144
+ DefaultLayoutGapDirective,
1145
+ DefaultLayoutAlignDirective,
1146
+ DefaultFlexOrderDirective,
1147
+ DefaultFlexOffsetDirective,
1148
+ FlexFillDirective,
1149
+ DefaultFlexAlignDirective,
1150
+ DefaultFlexDirective,
1151
+ ];
1152
+ /**
1153
+ * *****************************************************************
1154
+ * Define module for the Flex API
1155
+ * *****************************************************************
1156
+ */
1157
+ class FlexModule {
1158
+ }
1159
+ FlexModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1160
+ FlexModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexModule, declarations: [DefaultLayoutDirective,
1161
+ DefaultLayoutGapDirective,
1162
+ DefaultLayoutAlignDirective,
1163
+ DefaultFlexOrderDirective,
1164
+ DefaultFlexOffsetDirective,
1165
+ FlexFillDirective,
1166
+ DefaultFlexAlignDirective,
1167
+ DefaultFlexDirective], imports: [CoreModule, BidiModule], exports: [DefaultLayoutDirective,
1168
+ DefaultLayoutGapDirective,
1169
+ DefaultLayoutAlignDirective,
1170
+ DefaultFlexOrderDirective,
1171
+ DefaultFlexOffsetDirective,
1172
+ FlexFillDirective,
1173
+ DefaultFlexAlignDirective,
1174
+ DefaultFlexDirective] });
1175
+ FlexModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexModule, imports: [[CoreModule, BidiModule]] });
1176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FlexModule, decorators: [{
1177
+ type: NgModule,
1178
+ args: [{
1179
+ imports: [CoreModule, BidiModule],
1180
+ declarations: [...ALL_DIRECTIVES],
1181
+ exports: [...ALL_DIRECTIVES]
1182
+ }]
1183
+ }] });
1184
+
1185
+ /**
1186
+ * @license
1187
+ * Copyright Google LLC All Rights Reserved.
1188
+ *
1189
+ * Use of this source code is governed by an MIT-style license that can be
1190
+ * found in the LICENSE file at https://angular.io/license
1191
+ */
1192
+
1193
+ /**
1194
+ * Generated bundle index. Do not edit.
1195
+ */
1196
+
1197
+ export { DefaultFlexAlignDirective, DefaultFlexDirective, DefaultFlexOffsetDirective, DefaultFlexOrderDirective, DefaultLayoutAlignDirective, DefaultLayoutDirective, DefaultLayoutGapDirective, FlexAlignDirective, FlexAlignStyleBuilder, FlexDirective, FlexFillDirective, FlexFillStyleBuilder, FlexModule, FlexOffsetDirective, FlexOffsetStyleBuilder, FlexOrderDirective, FlexOrderStyleBuilder, FlexStyleBuilder, LayoutAlignDirective, LayoutAlignStyleBuilder, LayoutDirective, LayoutGapDirective, LayoutGapStyleBuilder, LayoutStyleBuilder };
1198
+ //# sourceMappingURL=angular-flex-layout-flex.mjs.map