@angular/material 21.0.0-next.9 → 21.0.0-rc.0
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.
- package/core/tokens/_classes.scss +1 -1
- package/core/tokens/m2/_md-sys-color.scss +17 -17
- package/fesm2022/_animation-chunk.mjs +10 -16
- package/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs +68 -164
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs +56 -19
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs +24 -31
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs +1224 -1017
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs +243 -187
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs +350 -575
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs +56 -107
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs +59 -19
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs +83 -43
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs +348 -311
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs +23 -39
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs +36 -10
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs +71 -134
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs +504 -600
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs +120 -138
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs +36 -10
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs +37 -10
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs +810 -888
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs +62 -86
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +965 -1126
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs +38 -54
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +321 -272
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs +10 -24
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +349 -344
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs +60 -94
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs +76 -125
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +752 -662
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +263 -158
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs +19 -33
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs +576 -272
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs +71 -123
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +515 -477
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs +201 -344
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +2552 -2289
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs +14 -28
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +357 -328
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs +15 -25
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4826 -4563
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs +93 -129
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +810 -829
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs +10 -11
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +119 -43
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs +74 -130
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +703 -515
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs +16 -33
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs +118 -179
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -10
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs +65 -113
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +559 -494
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs +148 -127
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +325 -351
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs +59 -99
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs +457 -520
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs +251 -434
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs +1522 -1204
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs +0 -5
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +159 -228
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +1338 -1343
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs +55 -79
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +381 -309
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs +12 -21
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +224 -169
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs +13 -23
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +235 -160
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs +133 -208
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +712 -679
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs +83 -117
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs +1116 -1246
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs +54 -120
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1078 -995
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs +57 -92
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +369 -279
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs +90 -138
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +1651 -1716
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs +40 -87
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +763 -714
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs +45 -66
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +419 -344
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs +78 -154
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +790 -498
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs +120 -213
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs +1026 -684
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +125 -197
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2351 -2028
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs +113 -172
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1019 -826
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +16 -27
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +163 -78
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs +41 -52
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +36 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +86 -162
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +638 -466
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/expansion.d.ts +4 -2
- package/types/menu-testing.d.ts +2 -0
- package/types/select.d.ts +1 -1
- package/types/timepicker.d.ts +1 -0
package/fesm2022/grid-list.mjs
CHANGED
|
@@ -7,533 +7,598 @@ import { InjectionToken, inject, ElementRef, Component, ViewEncapsulation, Chang
|
|
|
7
7
|
import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
8
8
|
import 'rxjs/operators';
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* Injection token used to provide a grid list to a tile and to avoid circular imports.
|
|
12
|
-
* @docs-private
|
|
13
|
-
*/
|
|
14
10
|
const MAT_GRID_LIST = new InjectionToken('MAT_GRID_LIST');
|
|
15
11
|
|
|
16
12
|
class MatGridTile {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
13
|
+
_element = inject(ElementRef);
|
|
14
|
+
_gridList = inject(MAT_GRID_LIST, {
|
|
15
|
+
optional: true
|
|
16
|
+
});
|
|
17
|
+
_rowspan = 1;
|
|
18
|
+
_colspan = 1;
|
|
19
|
+
constructor() {}
|
|
20
|
+
get rowspan() {
|
|
21
|
+
return this._rowspan;
|
|
22
|
+
}
|
|
23
|
+
set rowspan(value) {
|
|
24
|
+
this._rowspan = Math.round(coerceNumberProperty(value));
|
|
25
|
+
}
|
|
26
|
+
get colspan() {
|
|
27
|
+
return this._colspan;
|
|
28
|
+
}
|
|
29
|
+
set colspan(value) {
|
|
30
|
+
this._colspan = Math.round(coerceNumberProperty(value));
|
|
31
|
+
}
|
|
32
|
+
_setStyle(property, value) {
|
|
33
|
+
this._element.nativeElement.style[property] = value;
|
|
34
|
+
}
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
36
|
+
minVersion: "12.0.0",
|
|
37
|
+
version: "20.2.0-next.2",
|
|
38
|
+
ngImport: i0,
|
|
39
|
+
type: MatGridTile,
|
|
40
|
+
deps: [],
|
|
41
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
42
|
+
});
|
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
44
|
+
minVersion: "14.0.0",
|
|
45
|
+
version: "20.2.0-next.2",
|
|
46
|
+
type: MatGridTile,
|
|
47
|
+
isStandalone: true,
|
|
48
|
+
selector: "mat-grid-tile",
|
|
49
|
+
inputs: {
|
|
50
|
+
rowspan: "rowspan",
|
|
51
|
+
colspan: "colspan"
|
|
52
|
+
},
|
|
53
|
+
host: {
|
|
54
|
+
properties: {
|
|
55
|
+
"attr.rowspan": "rowspan",
|
|
56
|
+
"attr.colspan": "colspan"
|
|
57
|
+
},
|
|
58
|
+
classAttribute: "mat-grid-tile"
|
|
59
|
+
},
|
|
60
|
+
exportAs: ["matGridTile"],
|
|
61
|
+
ngImport: i0,
|
|
62
|
+
template: "<div class=\"mat-grid-tile-content\">\n <ng-content></ng-content>\n</div>\n",
|
|
63
|
+
styles: [".mat-grid-list{display:block;position:relative}.mat-grid-tile{display:block;position:absolute;overflow:hidden}.mat-grid-tile .mat-grid-tile-header,.mat-grid-tile .mat-grid-tile-footer{display:flex;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.38);overflow:hidden;padding:0 16px;position:absolute;left:0;right:0}.mat-grid-tile .mat-grid-tile-header>*,.mat-grid-tile .mat-grid-tile-footer>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-tile-header.mat-2-line,.mat-grid-tile .mat-grid-tile-footer.mat-2-line{height:68px}.mat-grid-tile .mat-grid-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden}.mat-grid-tile .mat-grid-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-list-text:empty{display:none}.mat-grid-tile .mat-grid-tile-header{top:0}.mat-grid-tile .mat-grid-tile-footer{bottom:0}.mat-grid-tile .mat-grid-avatar{padding-right:16px}[dir=rtl] .mat-grid-tile .mat-grid-avatar{padding-right:0;padding-left:16px}.mat-grid-tile .mat-grid-avatar:empty{display:none}.mat-grid-tile-header{font-size:var(--mat-grid-list-tile-header-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-header .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-header .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-header-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-footer{font-size:var(--mat-grid-list-tile-footer-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-footer .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-footer .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-footer-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-content{top:0;left:0;right:0;bottom:0;position:absolute;display:flex;align-items:center;justify-content:center;height:100%;padding:0;margin:0}\n"],
|
|
64
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
65
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
66
|
+
});
|
|
45
67
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
69
|
+
minVersion: "12.0.0",
|
|
70
|
+
version: "20.2.0-next.2",
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
type: MatGridTile,
|
|
73
|
+
decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{
|
|
76
|
+
selector: 'mat-grid-tile',
|
|
77
|
+
exportAs: 'matGridTile',
|
|
78
|
+
host: {
|
|
79
|
+
'class': 'mat-grid-tile',
|
|
80
|
+
'[attr.rowspan]': 'rowspan',
|
|
81
|
+
'[attr.colspan]': 'colspan'
|
|
82
|
+
},
|
|
83
|
+
encapsulation: ViewEncapsulation.None,
|
|
84
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
85
|
+
template: "<div class=\"mat-grid-tile-content\">\n <ng-content></ng-content>\n</div>\n",
|
|
86
|
+
styles: [".mat-grid-list{display:block;position:relative}.mat-grid-tile{display:block;position:absolute;overflow:hidden}.mat-grid-tile .mat-grid-tile-header,.mat-grid-tile .mat-grid-tile-footer{display:flex;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.38);overflow:hidden;padding:0 16px;position:absolute;left:0;right:0}.mat-grid-tile .mat-grid-tile-header>*,.mat-grid-tile .mat-grid-tile-footer>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-tile-header.mat-2-line,.mat-grid-tile .mat-grid-tile-footer.mat-2-line{height:68px}.mat-grid-tile .mat-grid-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden}.mat-grid-tile .mat-grid-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-list-text:empty{display:none}.mat-grid-tile .mat-grid-tile-header{top:0}.mat-grid-tile .mat-grid-tile-footer{bottom:0}.mat-grid-tile .mat-grid-avatar{padding-right:16px}[dir=rtl] .mat-grid-tile .mat-grid-avatar{padding-right:0;padding-left:16px}.mat-grid-tile .mat-grid-avatar:empty{display:none}.mat-grid-tile-header{font-size:var(--mat-grid-list-tile-header-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-header .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-header .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-header-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-footer{font-size:var(--mat-grid-list-tile-footer-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-footer .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-footer .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-footer-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-content{top:0;left:0;right:0;bottom:0;position:absolute;display:flex;align-items:center;justify-content:center;height:100%;padding:0;margin:0}\n"]
|
|
87
|
+
}]
|
|
88
|
+
}],
|
|
89
|
+
ctorParameters: () => [],
|
|
90
|
+
propDecorators: {
|
|
91
|
+
rowspan: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}],
|
|
94
|
+
colspan: [{
|
|
95
|
+
type: Input
|
|
96
|
+
}]
|
|
97
|
+
}
|
|
98
|
+
});
|
|
60
99
|
class MatGridTileText {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
100
|
+
_element = inject(ElementRef);
|
|
101
|
+
_lines;
|
|
102
|
+
constructor() {}
|
|
103
|
+
ngAfterContentInit() {
|
|
104
|
+
setLines(this._lines, this._element);
|
|
105
|
+
}
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
107
|
+
minVersion: "12.0.0",
|
|
108
|
+
version: "20.2.0-next.2",
|
|
109
|
+
ngImport: i0,
|
|
110
|
+
type: MatGridTileText,
|
|
111
|
+
deps: [],
|
|
112
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
113
|
+
});
|
|
114
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
115
|
+
minVersion: "14.0.0",
|
|
116
|
+
version: "20.2.0-next.2",
|
|
117
|
+
type: MatGridTileText,
|
|
118
|
+
isStandalone: true,
|
|
119
|
+
selector: "mat-grid-tile-header, mat-grid-tile-footer",
|
|
120
|
+
queries: [{
|
|
121
|
+
propertyName: "_lines",
|
|
122
|
+
predicate: MatLine,
|
|
123
|
+
descendants: true
|
|
124
|
+
}],
|
|
125
|
+
ngImport: i0,
|
|
126
|
+
template: "<ng-content select=\"[mat-grid-avatar], [matGridAvatar]\"></ng-content>\n<div class=\"mat-grid-list-text\"><ng-content select=\"[mat-line], [matLine]\"></ng-content></div>\n<ng-content></ng-content>\n",
|
|
127
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
128
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
129
|
+
});
|
|
69
130
|
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
132
|
+
minVersion: "12.0.0",
|
|
133
|
+
version: "20.2.0-next.2",
|
|
134
|
+
ngImport: i0,
|
|
135
|
+
type: MatGridTileText,
|
|
136
|
+
decorators: [{
|
|
137
|
+
type: Component,
|
|
138
|
+
args: [{
|
|
139
|
+
selector: 'mat-grid-tile-header, mat-grid-tile-footer',
|
|
140
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
141
|
+
encapsulation: ViewEncapsulation.None,
|
|
142
|
+
template: "<ng-content select=\"[mat-grid-avatar], [matGridAvatar]\"></ng-content>\n<div class=\"mat-grid-list-text\"><ng-content select=\"[mat-line], [matLine]\"></ng-content></div>\n<ng-content></ng-content>\n"
|
|
143
|
+
}]
|
|
144
|
+
}],
|
|
145
|
+
ctorParameters: () => [],
|
|
146
|
+
propDecorators: {
|
|
147
|
+
_lines: [{
|
|
148
|
+
type: ContentChildren,
|
|
149
|
+
args: [MatLine, {
|
|
150
|
+
descendants: true
|
|
151
|
+
}]
|
|
152
|
+
}]
|
|
153
|
+
}
|
|
154
|
+
});
|
|
81
155
|
class MatGridAvatarCssMatStyler {
|
|
82
|
-
|
|
83
|
-
|
|
156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
157
|
+
minVersion: "12.0.0",
|
|
158
|
+
version: "20.2.0-next.2",
|
|
159
|
+
ngImport: i0,
|
|
160
|
+
type: MatGridAvatarCssMatStyler,
|
|
161
|
+
deps: [],
|
|
162
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
163
|
+
});
|
|
164
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
165
|
+
minVersion: "14.0.0",
|
|
166
|
+
version: "20.2.0-next.2",
|
|
167
|
+
type: MatGridAvatarCssMatStyler,
|
|
168
|
+
isStandalone: true,
|
|
169
|
+
selector: "[mat-grid-avatar], [matGridAvatar]",
|
|
170
|
+
host: {
|
|
171
|
+
classAttribute: "mat-grid-avatar"
|
|
172
|
+
},
|
|
173
|
+
ngImport: i0
|
|
174
|
+
});
|
|
84
175
|
}
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
177
|
+
minVersion: "12.0.0",
|
|
178
|
+
version: "20.2.0-next.2",
|
|
179
|
+
ngImport: i0,
|
|
180
|
+
type: MatGridAvatarCssMatStyler,
|
|
181
|
+
decorators: [{
|
|
182
|
+
type: Directive,
|
|
183
|
+
args: [{
|
|
184
|
+
selector: '[mat-grid-avatar], [matGridAvatar]',
|
|
185
|
+
host: {
|
|
186
|
+
'class': 'mat-grid-avatar'
|
|
187
|
+
}
|
|
188
|
+
}]
|
|
189
|
+
}]
|
|
190
|
+
});
|
|
96
191
|
class MatGridTileHeaderCssMatStyler {
|
|
97
|
-
|
|
98
|
-
|
|
192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
193
|
+
minVersion: "12.0.0",
|
|
194
|
+
version: "20.2.0-next.2",
|
|
195
|
+
ngImport: i0,
|
|
196
|
+
type: MatGridTileHeaderCssMatStyler,
|
|
197
|
+
deps: [],
|
|
198
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
199
|
+
});
|
|
200
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
201
|
+
minVersion: "14.0.0",
|
|
202
|
+
version: "20.2.0-next.2",
|
|
203
|
+
type: MatGridTileHeaderCssMatStyler,
|
|
204
|
+
isStandalone: true,
|
|
205
|
+
selector: "mat-grid-tile-header",
|
|
206
|
+
host: {
|
|
207
|
+
classAttribute: "mat-grid-tile-header"
|
|
208
|
+
},
|
|
209
|
+
ngImport: i0
|
|
210
|
+
});
|
|
99
211
|
}
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
213
|
+
minVersion: "12.0.0",
|
|
214
|
+
version: "20.2.0-next.2",
|
|
215
|
+
ngImport: i0,
|
|
216
|
+
type: MatGridTileHeaderCssMatStyler,
|
|
217
|
+
decorators: [{
|
|
218
|
+
type: Directive,
|
|
219
|
+
args: [{
|
|
220
|
+
selector: 'mat-grid-tile-header',
|
|
221
|
+
host: {
|
|
222
|
+
'class': 'mat-grid-tile-header'
|
|
223
|
+
}
|
|
224
|
+
}]
|
|
225
|
+
}]
|
|
226
|
+
});
|
|
111
227
|
class MatGridTileFooterCssMatStyler {
|
|
112
|
-
|
|
113
|
-
|
|
228
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
229
|
+
minVersion: "12.0.0",
|
|
230
|
+
version: "20.2.0-next.2",
|
|
231
|
+
ngImport: i0,
|
|
232
|
+
type: MatGridTileFooterCssMatStyler,
|
|
233
|
+
deps: [],
|
|
234
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
235
|
+
});
|
|
236
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
237
|
+
minVersion: "14.0.0",
|
|
238
|
+
version: "20.2.0-next.2",
|
|
239
|
+
type: MatGridTileFooterCssMatStyler,
|
|
240
|
+
isStandalone: true,
|
|
241
|
+
selector: "mat-grid-tile-footer",
|
|
242
|
+
host: {
|
|
243
|
+
classAttribute: "mat-grid-tile-footer"
|
|
244
|
+
},
|
|
245
|
+
ngImport: i0
|
|
246
|
+
});
|
|
114
247
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
248
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
249
|
+
minVersion: "12.0.0",
|
|
250
|
+
version: "20.2.0-next.2",
|
|
251
|
+
ngImport: i0,
|
|
252
|
+
type: MatGridTileFooterCssMatStyler,
|
|
253
|
+
decorators: [{
|
|
254
|
+
type: Directive,
|
|
255
|
+
args: [{
|
|
256
|
+
selector: 'mat-grid-tile-footer',
|
|
257
|
+
host: {
|
|
258
|
+
'class': 'mat-grid-tile-footer'
|
|
259
|
+
}
|
|
260
|
+
}]
|
|
261
|
+
}]
|
|
262
|
+
});
|
|
122
263
|
|
|
123
|
-
/**
|
|
124
|
-
* RegExp that can be used to check whether a value will
|
|
125
|
-
* be allowed inside a CSS `calc()` expression.
|
|
126
|
-
*/
|
|
127
264
|
const cssCalcAllowedValue = /^-?\d+((\.\d+)?[A-Za-z%$]?)+$/;
|
|
128
|
-
/**
|
|
129
|
-
* Sets the style properties for an individual tile, given the position calculated by the
|
|
130
|
-
* Tile Coordinator.
|
|
131
|
-
* @docs-private
|
|
132
|
-
*/
|
|
133
265
|
class TileStyler {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
getBaseTileSize(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
getTilePosition(baseSize, offset) {
|
|
177
|
-
// The position comes the size of a 1x1 tile plus gutter for each previous tile in the
|
|
178
|
-
// row/column (offset).
|
|
179
|
-
return offset === 0 ? '0' : calc(`(${baseSize} + ${this._gutterSize}) * ${offset}`);
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Gets the actual size of a tile, e.g., width or height, taking rowspan or colspan into account.
|
|
183
|
-
* @param baseSize Base size of a 1x1 tile (as computed in getBaseTileSize).
|
|
184
|
-
* @param span The tile's rowspan or colspan.
|
|
185
|
-
* @return Size of the tile as a CSS calc() expression.
|
|
186
|
-
*/
|
|
187
|
-
getTileSize(baseSize, span) {
|
|
188
|
-
return `(${baseSize} * ${span}) + (${span - 1} * ${this._gutterSize})`;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Sets the style properties to be applied to a tile for the given row and column index.
|
|
192
|
-
* @param tile Tile to which to apply the styling.
|
|
193
|
-
* @param rowIndex Index of the tile's row.
|
|
194
|
-
* @param colIndex Index of the tile's column.
|
|
195
|
-
*/
|
|
196
|
-
setStyle(tile, rowIndex, colIndex) {
|
|
197
|
-
// Percent of the available horizontal space that one column takes up.
|
|
198
|
-
let percentWidthPerTile = 100 / this._cols;
|
|
199
|
-
// Fraction of the vertical gutter size that each column takes up.
|
|
200
|
-
// For example, if there are 5 columns, each column uses 4/5 = 0.8 times the gutter width.
|
|
201
|
-
let gutterWidthFractionPerTile = (this._cols - 1) / this._cols;
|
|
202
|
-
this.setColStyles(tile, colIndex, percentWidthPerTile, gutterWidthFractionPerTile);
|
|
203
|
-
this.setRowStyles(tile, rowIndex, percentWidthPerTile, gutterWidthFractionPerTile);
|
|
204
|
-
}
|
|
205
|
-
/** Sets the horizontal placement of the tile in the list. */
|
|
206
|
-
setColStyles(tile, colIndex, percentWidth, gutterWidth) {
|
|
207
|
-
// Base horizontal size of a column.
|
|
208
|
-
let baseTileWidth = this.getBaseTileSize(percentWidth, gutterWidth);
|
|
209
|
-
// The width and horizontal position of each tile is always calculated the same way, but the
|
|
210
|
-
// height and vertical position depends on the rowMode.
|
|
211
|
-
let side = this._direction === 'rtl' ? 'right' : 'left';
|
|
212
|
-
tile._setStyle(side, this.getTilePosition(baseTileWidth, colIndex));
|
|
213
|
-
tile._setStyle('width', calc(this.getTileSize(baseTileWidth, tile.colspan)));
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Calculates the total size taken up by gutters across one axis of a list.
|
|
217
|
-
*/
|
|
218
|
-
getGutterSpan() {
|
|
219
|
-
return `${this._gutterSize} * (${this._rowspan} - 1)`;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Calculates the total size taken up by tiles across one axis of a list.
|
|
223
|
-
* @param tileHeight Height of the tile.
|
|
224
|
-
*/
|
|
225
|
-
getTileSpan(tileHeight) {
|
|
226
|
-
return `${this._rowspan} * ${this.getTileSize(tileHeight, 1)}`;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Calculates the computed height and returns the correct style property to set.
|
|
230
|
-
* This method can be implemented by each type of TileStyler.
|
|
231
|
-
* @docs-private
|
|
232
|
-
*/
|
|
233
|
-
getComputedHeight() {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
266
|
+
_gutterSize;
|
|
267
|
+
_rows = 0;
|
|
268
|
+
_rowspan = 0;
|
|
269
|
+
_cols;
|
|
270
|
+
_direction;
|
|
271
|
+
init(gutterSize, tracker, cols, direction) {
|
|
272
|
+
this._gutterSize = normalizeUnits(gutterSize);
|
|
273
|
+
this._rows = tracker.rowCount;
|
|
274
|
+
this._rowspan = tracker.rowspan;
|
|
275
|
+
this._cols = cols;
|
|
276
|
+
this._direction = direction;
|
|
277
|
+
}
|
|
278
|
+
getBaseTileSize(sizePercent, gutterFraction) {
|
|
279
|
+
return `(${sizePercent}% - (${this._gutterSize} * ${gutterFraction}))`;
|
|
280
|
+
}
|
|
281
|
+
getTilePosition(baseSize, offset) {
|
|
282
|
+
return offset === 0 ? '0' : calc(`(${baseSize} + ${this._gutterSize}) * ${offset}`);
|
|
283
|
+
}
|
|
284
|
+
getTileSize(baseSize, span) {
|
|
285
|
+
return `(${baseSize} * ${span}) + (${span - 1} * ${this._gutterSize})`;
|
|
286
|
+
}
|
|
287
|
+
setStyle(tile, rowIndex, colIndex) {
|
|
288
|
+
let percentWidthPerTile = 100 / this._cols;
|
|
289
|
+
let gutterWidthFractionPerTile = (this._cols - 1) / this._cols;
|
|
290
|
+
this.setColStyles(tile, colIndex, percentWidthPerTile, gutterWidthFractionPerTile);
|
|
291
|
+
this.setRowStyles(tile, rowIndex, percentWidthPerTile, gutterWidthFractionPerTile);
|
|
292
|
+
}
|
|
293
|
+
setColStyles(tile, colIndex, percentWidth, gutterWidth) {
|
|
294
|
+
let baseTileWidth = this.getBaseTileSize(percentWidth, gutterWidth);
|
|
295
|
+
let side = this._direction === 'rtl' ? 'right' : 'left';
|
|
296
|
+
tile._setStyle(side, this.getTilePosition(baseTileWidth, colIndex));
|
|
297
|
+
tile._setStyle('width', calc(this.getTileSize(baseTileWidth, tile.colspan)));
|
|
298
|
+
}
|
|
299
|
+
getGutterSpan() {
|
|
300
|
+
return `${this._gutterSize} * (${this._rowspan} - 1)`;
|
|
301
|
+
}
|
|
302
|
+
getTileSpan(tileHeight) {
|
|
303
|
+
return `${this._rowspan} * ${this.getTileSize(tileHeight, 1)}`;
|
|
304
|
+
}
|
|
305
|
+
getComputedHeight() {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
236
308
|
}
|
|
237
|
-
/**
|
|
238
|
-
* This type of styler is instantiated when the user passes in a fixed row height.
|
|
239
|
-
* Example `<mat-grid-list cols="3" rowHeight="100px">`
|
|
240
|
-
* @docs-private
|
|
241
|
-
*/
|
|
242
309
|
class FixedTileStyler extends TileStyler {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
310
|
+
fixedRowHeight;
|
|
311
|
+
constructor(fixedRowHeight) {
|
|
312
|
+
super();
|
|
313
|
+
this.fixedRowHeight = fixedRowHeight;
|
|
314
|
+
}
|
|
315
|
+
init(gutterSize, tracker, cols, direction) {
|
|
316
|
+
super.init(gutterSize, tracker, cols, direction);
|
|
317
|
+
this.fixedRowHeight = normalizeUnits(this.fixedRowHeight);
|
|
318
|
+
if (!cssCalcAllowedValue.test(this.fixedRowHeight) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
319
|
+
throw Error(`Invalid value "${this.fixedRowHeight}" set as rowHeight.`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
setRowStyles(tile, rowIndex) {
|
|
323
|
+
tile._setStyle('top', this.getTilePosition(this.fixedRowHeight, rowIndex));
|
|
324
|
+
tile._setStyle('height', calc(this.getTileSize(this.fixedRowHeight, tile.rowspan)));
|
|
325
|
+
}
|
|
326
|
+
getComputedHeight() {
|
|
327
|
+
return ['height', calc(`${this.getTileSpan(this.fixedRowHeight)} + ${this.getGutterSpan()}`)];
|
|
328
|
+
}
|
|
329
|
+
reset(list) {
|
|
330
|
+
list._setListStyle(['height', null]);
|
|
331
|
+
if (list._tiles) {
|
|
332
|
+
list._tiles.forEach(tile => {
|
|
333
|
+
tile._setStyle('top', null);
|
|
334
|
+
tile._setStyle('height', null);
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
272
338
|
}
|
|
273
|
-
/**
|
|
274
|
-
* This type of styler is instantiated when the user passes in a width:height ratio
|
|
275
|
-
* for the row height. Example `<mat-grid-list cols="3" rowHeight="3:1">`
|
|
276
|
-
* @docs-private
|
|
277
|
-
*/
|
|
278
339
|
class RatioTileStyler extends TileStyler {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
_parseRatio(value) {
|
|
309
|
-
const ratioParts = value.split(':');
|
|
310
|
-
if (ratioParts.length !== 2 && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
311
|
-
throw Error(`mat-grid-list: invalid ratio given for row-height: "${value}"`);
|
|
312
|
-
}
|
|
313
|
-
this.rowHeightRatio = parseFloat(ratioParts[0]) / parseFloat(ratioParts[1]);
|
|
314
|
-
}
|
|
340
|
+
rowHeightRatio;
|
|
341
|
+
baseTileHeight;
|
|
342
|
+
constructor(value) {
|
|
343
|
+
super();
|
|
344
|
+
this._parseRatio(value);
|
|
345
|
+
}
|
|
346
|
+
setRowStyles(tile, rowIndex, percentWidth, gutterWidth) {
|
|
347
|
+
let percentHeightPerTile = percentWidth / this.rowHeightRatio;
|
|
348
|
+
this.baseTileHeight = this.getBaseTileSize(percentHeightPerTile, gutterWidth);
|
|
349
|
+
tile._setStyle('marginTop', this.getTilePosition(this.baseTileHeight, rowIndex));
|
|
350
|
+
tile._setStyle('paddingTop', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
|
|
351
|
+
}
|
|
352
|
+
getComputedHeight() {
|
|
353
|
+
return ['paddingBottom', calc(`${this.getTileSpan(this.baseTileHeight)} + ${this.getGutterSpan()}`)];
|
|
354
|
+
}
|
|
355
|
+
reset(list) {
|
|
356
|
+
list._setListStyle(['paddingBottom', null]);
|
|
357
|
+
list._tiles.forEach(tile => {
|
|
358
|
+
tile._setStyle('marginTop', null);
|
|
359
|
+
tile._setStyle('paddingTop', null);
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
_parseRatio(value) {
|
|
363
|
+
const ratioParts = value.split(':');
|
|
364
|
+
if (ratioParts.length !== 2 && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
365
|
+
throw Error(`mat-grid-list: invalid ratio given for row-height: "${value}"`);
|
|
366
|
+
}
|
|
367
|
+
this.rowHeightRatio = parseFloat(ratioParts[0]) / parseFloat(ratioParts[1]);
|
|
368
|
+
}
|
|
315
369
|
}
|
|
316
|
-
/**
|
|
317
|
-
* This type of styler is instantiated when the user selects a "fit" row height mode.
|
|
318
|
-
* In other words, the row height will reflect the total height of the container divided
|
|
319
|
-
* by the number of rows. Example `<mat-grid-list cols="3" rowHeight="fit">`
|
|
320
|
-
*
|
|
321
|
-
* @docs-private
|
|
322
|
-
*/
|
|
323
370
|
class FitTileStyler extends TileStyler {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
}
|
|
371
|
+
setRowStyles(tile, rowIndex) {
|
|
372
|
+
let percentHeightPerTile = 100 / this._rowspan;
|
|
373
|
+
let gutterHeightPerTile = (this._rows - 1) / this._rows;
|
|
374
|
+
let baseTileHeight = this.getBaseTileSize(percentHeightPerTile, gutterHeightPerTile);
|
|
375
|
+
tile._setStyle('top', this.getTilePosition(baseTileHeight, rowIndex));
|
|
376
|
+
tile._setStyle('height', calc(this.getTileSize(baseTileHeight, tile.rowspan)));
|
|
377
|
+
}
|
|
378
|
+
reset(list) {
|
|
379
|
+
if (list._tiles) {
|
|
380
|
+
list._tiles.forEach(tile => {
|
|
381
|
+
tile._setStyle('top', null);
|
|
382
|
+
tile._setStyle('height', null);
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}
|
|
342
386
|
}
|
|
343
|
-
/** Wraps a CSS string in a calc function */
|
|
344
387
|
function calc(exp) {
|
|
345
|
-
|
|
388
|
+
return `calc(${exp})`;
|
|
346
389
|
}
|
|
347
|
-
/** Appends pixels to a CSS string if no units are given. */
|
|
348
390
|
function normalizeUnits(value) {
|
|
349
|
-
|
|
391
|
+
return value.match(/([A-Za-z%]+)$/) ? value : `${value}px`;
|
|
350
392
|
}
|
|
351
393
|
|
|
352
|
-
// TODO(kara): Conditional (responsive) column count / row size.
|
|
353
|
-
// TODO(kara): Re-layout on window resize / media change (debounced).
|
|
354
|
-
// TODO(kara): gridTileHeader and gridTileFooter.
|
|
355
394
|
const MAT_FIT_MODE = 'fit';
|
|
356
395
|
class MatGridList {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
396
|
+
_element = inject(ElementRef);
|
|
397
|
+
_dir = inject(Directionality, {
|
|
398
|
+
optional: true
|
|
399
|
+
});
|
|
400
|
+
_cols;
|
|
401
|
+
_tileCoordinator;
|
|
402
|
+
_rowHeight;
|
|
403
|
+
_gutter = '1px';
|
|
404
|
+
_tileStyler;
|
|
405
|
+
_tiles;
|
|
406
|
+
constructor() {}
|
|
407
|
+
get cols() {
|
|
408
|
+
return this._cols;
|
|
409
|
+
}
|
|
410
|
+
set cols(value) {
|
|
411
|
+
this._cols = Math.max(1, Math.round(coerceNumberProperty(value)));
|
|
412
|
+
}
|
|
413
|
+
get gutterSize() {
|
|
414
|
+
return this._gutter;
|
|
415
|
+
}
|
|
416
|
+
set gutterSize(value) {
|
|
417
|
+
this._gutter = `${value == null ? '' : value}`;
|
|
418
|
+
}
|
|
419
|
+
get rowHeight() {
|
|
420
|
+
return this._rowHeight;
|
|
421
|
+
}
|
|
422
|
+
set rowHeight(value) {
|
|
423
|
+
const newValue = `${value == null ? '' : value}`;
|
|
424
|
+
if (newValue !== this._rowHeight) {
|
|
425
|
+
this._rowHeight = newValue;
|
|
426
|
+
this._setTileStyler(this._rowHeight);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
ngOnInit() {
|
|
430
|
+
this._checkCols();
|
|
431
|
+
this._checkRowHeight();
|
|
432
|
+
}
|
|
433
|
+
ngAfterContentChecked() {
|
|
434
|
+
this._layoutTiles();
|
|
435
|
+
}
|
|
436
|
+
_checkCols() {
|
|
437
|
+
if (!this.cols && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
438
|
+
throw Error(`mat-grid-list: must pass in number of columns. ` + `Example: <mat-grid-list cols="3">`);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
_checkRowHeight() {
|
|
442
|
+
if (!this._rowHeight) {
|
|
443
|
+
this._setTileStyler('1:1');
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
_setTileStyler(rowHeight) {
|
|
447
|
+
if (this._tileStyler) {
|
|
448
|
+
this._tileStyler.reset(this);
|
|
449
|
+
}
|
|
450
|
+
if (rowHeight === MAT_FIT_MODE) {
|
|
451
|
+
this._tileStyler = new FitTileStyler();
|
|
452
|
+
} else if (rowHeight && rowHeight.indexOf(':') > -1) {
|
|
453
|
+
this._tileStyler = new RatioTileStyler(rowHeight);
|
|
454
|
+
} else {
|
|
455
|
+
this._tileStyler = new FixedTileStyler(rowHeight);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
_layoutTiles() {
|
|
459
|
+
if (!this._tileCoordinator) {
|
|
460
|
+
this._tileCoordinator = new TileCoordinator();
|
|
461
|
+
}
|
|
462
|
+
const tracker = this._tileCoordinator;
|
|
463
|
+
const tiles = this._tiles.filter(tile => !tile._gridList || tile._gridList === this);
|
|
464
|
+
const direction = this._dir ? this._dir.value : 'ltr';
|
|
465
|
+
this._tileCoordinator.update(this.cols, tiles);
|
|
466
|
+
this._tileStyler.init(this.gutterSize, tracker, this.cols, direction);
|
|
467
|
+
tiles.forEach((tile, index) => {
|
|
468
|
+
const pos = tracker.positions[index];
|
|
469
|
+
this._tileStyler.setStyle(tile, pos.row, pos.col);
|
|
470
|
+
});
|
|
471
|
+
this._setListStyle(this._tileStyler.getComputedHeight());
|
|
472
|
+
}
|
|
473
|
+
_setListStyle(style) {
|
|
474
|
+
if (style) {
|
|
475
|
+
this._element.nativeElement.style[style[0]] = style[1];
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
479
|
+
minVersion: "12.0.0",
|
|
480
|
+
version: "20.2.0-next.2",
|
|
481
|
+
ngImport: i0,
|
|
482
|
+
type: MatGridList,
|
|
483
|
+
deps: [],
|
|
484
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
485
|
+
});
|
|
486
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
487
|
+
minVersion: "14.0.0",
|
|
488
|
+
version: "20.2.0-next.2",
|
|
489
|
+
type: MatGridList,
|
|
490
|
+
isStandalone: true,
|
|
491
|
+
selector: "mat-grid-list",
|
|
492
|
+
inputs: {
|
|
493
|
+
cols: "cols",
|
|
494
|
+
gutterSize: "gutterSize",
|
|
495
|
+
rowHeight: "rowHeight"
|
|
496
|
+
},
|
|
497
|
+
host: {
|
|
498
|
+
properties: {
|
|
499
|
+
"attr.cols": "cols"
|
|
500
|
+
},
|
|
501
|
+
classAttribute: "mat-grid-list"
|
|
502
|
+
},
|
|
503
|
+
providers: [{
|
|
504
|
+
provide: MAT_GRID_LIST,
|
|
505
|
+
useExisting: MatGridList
|
|
506
|
+
}],
|
|
507
|
+
queries: [{
|
|
508
|
+
propertyName: "_tiles",
|
|
509
|
+
predicate: MatGridTile,
|
|
510
|
+
descendants: true
|
|
511
|
+
}],
|
|
512
|
+
exportAs: ["matGridList"],
|
|
513
|
+
ngImport: i0,
|
|
514
|
+
template: "<div>\n <ng-content></ng-content>\n</div>",
|
|
515
|
+
styles: [".mat-grid-list{display:block;position:relative}.mat-grid-tile{display:block;position:absolute;overflow:hidden}.mat-grid-tile .mat-grid-tile-header,.mat-grid-tile .mat-grid-tile-footer{display:flex;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.38);overflow:hidden;padding:0 16px;position:absolute;left:0;right:0}.mat-grid-tile .mat-grid-tile-header>*,.mat-grid-tile .mat-grid-tile-footer>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-tile-header.mat-2-line,.mat-grid-tile .mat-grid-tile-footer.mat-2-line{height:68px}.mat-grid-tile .mat-grid-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden}.mat-grid-tile .mat-grid-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-list-text:empty{display:none}.mat-grid-tile .mat-grid-tile-header{top:0}.mat-grid-tile .mat-grid-tile-footer{bottom:0}.mat-grid-tile .mat-grid-avatar{padding-right:16px}[dir=rtl] .mat-grid-tile .mat-grid-avatar{padding-right:0;padding-left:16px}.mat-grid-tile .mat-grid-avatar:empty{display:none}.mat-grid-tile-header{font-size:var(--mat-grid-list-tile-header-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-header .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-header .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-header-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-footer{font-size:var(--mat-grid-list-tile-footer-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-footer .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-footer .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-footer-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-content{top:0;left:0;right:0;bottom:0;position:absolute;display:flex;align-items:center;justify-content:center;height:100%;padding:0;margin:0}\n"],
|
|
516
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
517
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
518
|
+
});
|
|
469
519
|
}
|
|
470
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
520
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
521
|
+
minVersion: "12.0.0",
|
|
522
|
+
version: "20.2.0-next.2",
|
|
523
|
+
ngImport: i0,
|
|
524
|
+
type: MatGridList,
|
|
525
|
+
decorators: [{
|
|
526
|
+
type: Component,
|
|
527
|
+
args: [{
|
|
528
|
+
selector: 'mat-grid-list',
|
|
529
|
+
exportAs: 'matGridList',
|
|
530
|
+
host: {
|
|
531
|
+
'class': 'mat-grid-list',
|
|
532
|
+
'[attr.cols]': 'cols'
|
|
533
|
+
},
|
|
534
|
+
providers: [{
|
|
535
|
+
provide: MAT_GRID_LIST,
|
|
536
|
+
useExisting: MatGridList
|
|
537
|
+
}],
|
|
538
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
539
|
+
encapsulation: ViewEncapsulation.None,
|
|
540
|
+
template: "<div>\n <ng-content></ng-content>\n</div>",
|
|
541
|
+
styles: [".mat-grid-list{display:block;position:relative}.mat-grid-tile{display:block;position:absolute;overflow:hidden}.mat-grid-tile .mat-grid-tile-header,.mat-grid-tile .mat-grid-tile-footer{display:flex;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.38);overflow:hidden;padding:0 16px;position:absolute;left:0;right:0}.mat-grid-tile .mat-grid-tile-header>*,.mat-grid-tile .mat-grid-tile-footer>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-tile-header.mat-2-line,.mat-grid-tile .mat-grid-tile-footer.mat-2-line{height:68px}.mat-grid-tile .mat-grid-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden}.mat-grid-tile .mat-grid-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-grid-tile .mat-grid-list-text:empty{display:none}.mat-grid-tile .mat-grid-tile-header{top:0}.mat-grid-tile .mat-grid-tile-footer{bottom:0}.mat-grid-tile .mat-grid-avatar{padding-right:16px}[dir=rtl] .mat-grid-tile .mat-grid-avatar{padding-right:0;padding-left:16px}.mat-grid-tile .mat-grid-avatar:empty{display:none}.mat-grid-tile-header{font-size:var(--mat-grid-list-tile-header-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-header .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-header .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-header-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-footer{font-size:var(--mat-grid-list-tile-footer-primary-text-size, var(--mat-sys-body-large))}.mat-grid-tile-footer .mat-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;box-sizing:border-box}.mat-grid-tile-footer .mat-line:nth-child(n+2){font-size:var(--mat-grid-list-tile-footer-secondary-text-size, var(--mat-sys-body-medium))}.mat-grid-tile-content{top:0;left:0;right:0;bottom:0;position:absolute;display:flex;align-items:center;justify-content:center;height:100%;padding:0;margin:0}\n"]
|
|
542
|
+
}]
|
|
543
|
+
}],
|
|
544
|
+
ctorParameters: () => [],
|
|
545
|
+
propDecorators: {
|
|
546
|
+
_tiles: [{
|
|
547
|
+
type: ContentChildren,
|
|
548
|
+
args: [MatGridTile, {
|
|
549
|
+
descendants: true
|
|
550
|
+
}]
|
|
551
|
+
}],
|
|
552
|
+
cols: [{
|
|
553
|
+
type: Input
|
|
554
|
+
}],
|
|
555
|
+
gutterSize: [{
|
|
556
|
+
type: Input
|
|
557
|
+
}],
|
|
558
|
+
rowHeight: [{
|
|
559
|
+
type: Input
|
|
560
|
+
}]
|
|
561
|
+
}
|
|
562
|
+
});
|
|
493
563
|
|
|
494
564
|
class MatGridListModule {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
565
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
566
|
+
minVersion: "12.0.0",
|
|
567
|
+
version: "20.2.0-next.2",
|
|
568
|
+
ngImport: i0,
|
|
569
|
+
type: MatGridListModule,
|
|
570
|
+
deps: [],
|
|
571
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
572
|
+
});
|
|
573
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
574
|
+
minVersion: "14.0.0",
|
|
575
|
+
version: "20.2.0-next.2",
|
|
576
|
+
ngImport: i0,
|
|
577
|
+
type: MatGridListModule,
|
|
578
|
+
imports: [MatLineModule, MatGridList, MatGridTile, MatGridTileText, MatGridTileHeaderCssMatStyler, MatGridTileFooterCssMatStyler, MatGridAvatarCssMatStyler],
|
|
579
|
+
exports: [BidiModule, MatGridList, MatGridTile, MatGridTileText, MatLineModule, MatGridTileHeaderCssMatStyler, MatGridTileFooterCssMatStyler, MatGridAvatarCssMatStyler]
|
|
580
|
+
});
|
|
581
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
582
|
+
minVersion: "12.0.0",
|
|
583
|
+
version: "20.2.0-next.2",
|
|
584
|
+
ngImport: i0,
|
|
585
|
+
type: MatGridListModule,
|
|
586
|
+
imports: [MatLineModule, BidiModule, MatLineModule]
|
|
587
|
+
});
|
|
512
588
|
}
|
|
513
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
BidiModule,
|
|
527
|
-
MatGridList,
|
|
528
|
-
MatGridTile,
|
|
529
|
-
MatGridTileText,
|
|
530
|
-
MatLineModule,
|
|
531
|
-
MatGridTileHeaderCssMatStyler,
|
|
532
|
-
MatGridTileFooterCssMatStyler,
|
|
533
|
-
MatGridAvatarCssMatStyler,
|
|
534
|
-
],
|
|
535
|
-
}]
|
|
536
|
-
}] });
|
|
589
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
590
|
+
minVersion: "12.0.0",
|
|
591
|
+
version: "20.2.0-next.2",
|
|
592
|
+
ngImport: i0,
|
|
593
|
+
type: MatGridListModule,
|
|
594
|
+
decorators: [{
|
|
595
|
+
type: NgModule,
|
|
596
|
+
args: [{
|
|
597
|
+
imports: [MatLineModule, MatGridList, MatGridTile, MatGridTileText, MatGridTileHeaderCssMatStyler, MatGridTileFooterCssMatStyler, MatGridAvatarCssMatStyler],
|
|
598
|
+
exports: [BidiModule, MatGridList, MatGridTile, MatGridTileText, MatLineModule, MatGridTileHeaderCssMatStyler, MatGridTileFooterCssMatStyler, MatGridAvatarCssMatStyler]
|
|
599
|
+
}]
|
|
600
|
+
}]
|
|
601
|
+
});
|
|
537
602
|
|
|
538
603
|
export { MatGridAvatarCssMatStyler, MatGridList, MatGridListModule, MatGridTile, MatGridTileFooterCssMatStyler, MatGridTileHeaderCssMatStyler, MatGridTileText, MatLine };
|
|
539
604
|
//# sourceMappingURL=grid-list.mjs.map
|