source: trip-planner-front/node_modules/@angular/material/esm2015/grid-list/grid-tile.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 12.8 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { Component, ViewEncapsulation, ElementRef, Input, Optional, ContentChildren, QueryList, Directive, ChangeDetectionStrategy, Inject, } from '@angular/core';
9import { MatLine, setLines } from '@angular/material/core';
10import { coerceNumberProperty } from '@angular/cdk/coercion';
11import { MAT_GRID_LIST } from './grid-list-base';
12export class MatGridTile {
13 constructor(_element, _gridList) {
14 this._element = _element;
15 this._gridList = _gridList;
16 this._rowspan = 1;
17 this._colspan = 1;
18 }
19 /** Amount of rows that the grid tile takes up. */
20 get rowspan() { return this._rowspan; }
21 set rowspan(value) { this._rowspan = Math.round(coerceNumberProperty(value)); }
22 /** Amount of columns that the grid tile takes up. */
23 get colspan() { return this._colspan; }
24 set colspan(value) { this._colspan = Math.round(coerceNumberProperty(value)); }
25 /**
26 * Sets the style of the grid-tile element. Needs to be set manually to avoid
27 * "Changed after checked" errors that would occur with HostBinding.
28 */
29 _setStyle(property, value) {
30 this._element.nativeElement.style[property] = value;
31 }
32}
33MatGridTile.decorators = [
34 { type: Component, args: [{
35 selector: 'mat-grid-tile',
36 exportAs: 'matGridTile',
37 host: {
38 'class': 'mat-grid-tile',
39 // Ensures that the "rowspan" and "colspan" input value is reflected in
40 // the DOM. This is needed for the grid-tile harness.
41 '[attr.rowspan]': 'rowspan',
42 '[attr.colspan]': 'colspan'
43 },
44 template: "<div class=\"mat-grid-tile-content\">\n <ng-content></ng-content>\n</div>\n",
45 encapsulation: ViewEncapsulation.None,
46 changeDetection: ChangeDetectionStrategy.OnPush,
47 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-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"]
48 },] }
49];
50MatGridTile.ctorParameters = () => [
51 { type: ElementRef },
52 { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_GRID_LIST,] }] }
53];
54MatGridTile.propDecorators = {
55 rowspan: [{ type: Input }],
56 colspan: [{ type: Input }]
57};
58export class MatGridTileText {
59 constructor(_element) {
60 this._element = _element;
61 }
62 ngAfterContentInit() {
63 setLines(this._lines, this._element);
64 }
65}
66MatGridTileText.decorators = [
67 { type: Component, args: [{
68 selector: 'mat-grid-tile-header, mat-grid-tile-footer',
69 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",
70 changeDetection: ChangeDetectionStrategy.OnPush,
71 encapsulation: ViewEncapsulation.None
72 },] }
73];
74MatGridTileText.ctorParameters = () => [
75 { type: ElementRef }
76];
77MatGridTileText.propDecorators = {
78 _lines: [{ type: ContentChildren, args: [MatLine, { descendants: true },] }]
79};
80/**
81 * Directive whose purpose is to add the mat- CSS styling to this selector.
82 * @docs-private
83 */
84export class MatGridAvatarCssMatStyler {
85}
86MatGridAvatarCssMatStyler.decorators = [
87 { type: Directive, args: [{
88 selector: '[mat-grid-avatar], [matGridAvatar]',
89 host: { 'class': 'mat-grid-avatar' }
90 },] }
91];
92/**
93 * Directive whose purpose is to add the mat- CSS styling to this selector.
94 * @docs-private
95 */
96export class MatGridTileHeaderCssMatStyler {
97}
98MatGridTileHeaderCssMatStyler.decorators = [
99 { type: Directive, args: [{
100 selector: 'mat-grid-tile-header',
101 host: { 'class': 'mat-grid-tile-header' }
102 },] }
103];
104/**
105 * Directive whose purpose is to add the mat- CSS styling to this selector.
106 * @docs-private
107 */
108export class MatGridTileFooterCssMatStyler {
109}
110MatGridTileFooterCssMatStyler.decorators = [
111 { type: Directive, args: [{
112 selector: 'mat-grid-tile-footer',
113 host: { 'class': 'mat-grid-tile-footer' }
114 },] }
115];
116//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC10aWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2dyaWQtbGlzdC9ncmlkLXRpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUNMLFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsVUFBVSxFQUNWLEtBQUssRUFDTCxRQUFRLEVBQ1IsZUFBZSxFQUNmLFNBQVMsRUFFVCxTQUFTLEVBQ1QsdUJBQXVCLEVBQ3ZCLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUMsT0FBTyxFQUFF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