2019-09-03 19:31:16 +03:00
|
|
|
///
|
|
|
|
|
/// Copyright © 2016-2019 The Thingsboard Authors
|
|
|
|
|
///
|
|
|
|
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
/// you may not use this file except in compliance with the License.
|
|
|
|
|
/// You may obtain a copy of the License at
|
|
|
|
|
///
|
|
|
|
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
///
|
|
|
|
|
/// Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
/// See the License for the specific language governing permissions and
|
|
|
|
|
/// limitations under the License.
|
|
|
|
|
///
|
|
|
|
|
|
2019-09-05 21:15:40 +03:00
|
|
|
import {
|
|
|
|
|
AfterViewInit,
|
|
|
|
|
Component,
|
|
|
|
|
Input,
|
|
|
|
|
OnChanges,
|
|
|
|
|
OnInit,
|
|
|
|
|
QueryList,
|
|
|
|
|
SimpleChanges,
|
|
|
|
|
ViewChild,
|
|
|
|
|
ViewChildren
|
|
|
|
|
} from '@angular/core';
|
2019-09-03 19:31:16 +03:00
|
|
|
import { Store } from '@ngrx/store';
|
|
|
|
|
import { AppState } from '@core/core.state';
|
|
|
|
|
import { PageComponent } from '@shared/components/page.component';
|
|
|
|
|
import { AuthUser } from '@shared/models/user.model';
|
|
|
|
|
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
|
2019-09-10 15:12:10 +03:00
|
|
|
import { Timewindow, toHistoryTimewindow } from '@shared/models/time/time.models';
|
2019-09-03 19:31:16 +03:00
|
|
|
import { TimeService } from '@core/services/time.service';
|
|
|
|
|
import { GridsterComponent, GridsterConfig, GridsterItemComponent } from 'angular-gridster2';
|
2019-09-05 21:15:40 +03:00
|
|
|
import {
|
|
|
|
|
DashboardCallbacks,
|
|
|
|
|
DashboardWidget,
|
|
|
|
|
IDashboardComponent,
|
2019-09-20 20:30:43 +03:00
|
|
|
WidgetsData,
|
|
|
|
|
DashboardWidgets
|
2019-09-05 21:15:40 +03:00
|
|
|
} from '../../models/dashboard-component.models';
|
2019-09-12 19:58:42 +03:00
|
|
|
import { merge, Observable, ReplaySubject, Subject } from 'rxjs';
|
2019-09-03 19:31:16 +03:00
|
|
|
import { map, share, tap } from 'rxjs/operators';
|
2019-09-20 20:30:43 +03:00
|
|
|
import { WidgetLayout, WidgetLayouts } from '@shared/models/dashboard.models';
|
2019-09-03 19:31:16 +03:00
|
|
|
import { DialogService } from '@core/services/dialog.service';
|
2019-09-10 15:12:10 +03:00
|
|
|
import { animatedScroll, deepClone, isDefined } from '@app/core/utils';
|
2019-09-05 21:15:40 +03:00
|
|
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
2019-09-03 19:31:16 +03:00
|
|
|
import { MediaBreakpoints } from '@shared/models/constants';
|
2019-09-05 21:15:40 +03:00
|
|
|
import { IAliasController, IStateController } from '@app/core/api/widget-api.models';
|
2019-09-20 20:30:43 +03:00
|
|
|
import { Widget } from '@app/shared/models/widget.models';
|
2019-09-03 19:31:16 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'tb-dashboard',
|
|
|
|
|
templateUrl: './dashboard.component.html',
|
|
|
|
|
styleUrls: ['./dashboard.component.scss']
|
|
|
|
|
})
|
2019-09-05 21:15:40 +03:00
|
|
|
export class DashboardComponent extends PageComponent implements IDashboardComponent, OnInit, AfterViewInit, OnChanges {
|
2019-09-03 19:31:16 +03:00
|
|
|
|
|
|
|
|
authUser: AuthUser;
|
|
|
|
|
|
|
|
|
|
@Input()
|
2019-09-20 20:30:43 +03:00
|
|
|
widgets: Array<Widget>;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
widgetLayouts: WidgetLayouts;
|
2019-09-05 21:15:40 +03:00
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
callbacks: DashboardCallbacks;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
aliasController: IAliasController;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
stateController: IStateController;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
columns: number;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
horizontalMargin: number;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
verticalMargin: number;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
isEdit: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
autofillHeight: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
mobileAutofillHeight: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
mobileRowHeight: number;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
isMobile: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
isMobileDisabled: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
isEditActionEnabled: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
isExportActionEnabled: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
isRemoveActionEnabled: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
dashboardStyle: {[klass: string]: any};
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
dashboardClass: string;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
ignoreLoading: boolean;
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
|
dashboardTimewindow: Timewindow;
|
2019-09-03 19:31:16 +03:00
|
|
|
|
2019-09-12 19:58:42 +03:00
|
|
|
dashboardTimewindowChangedSubject: Subject<Timewindow> = new ReplaySubject<Timewindow>();
|
|
|
|
|
|
|
|
|
|
dashboardTimewindowChanged = this.dashboardTimewindowChangedSubject.asObservable();
|
|
|
|
|
|
2019-09-10 15:12:10 +03:00
|
|
|
originalDashboardTimewindow: Timewindow;
|
|
|
|
|
|
2019-09-03 19:31:16 +03:00
|
|
|
gridsterOpts: GridsterConfig;
|
|
|
|
|
|
|
|
|
|
highlightedMode = false;
|
|
|
|
|
highlightedWidget: DashboardWidget = null;
|
|
|
|
|
selectedWidget: DashboardWidget = null;
|
|
|
|
|
|
|
|
|
|
isWidgetExpanded = false;
|
|
|
|
|
isMobileSize = false;
|
|
|
|
|
|
|
|
|
|
@ViewChild('gridster', {static: true}) gridster: GridsterComponent;
|
|
|
|
|
|
|
|
|
|
@ViewChildren(GridsterItemComponent) gridsterItems: QueryList<GridsterItemComponent>;
|
|
|
|
|
|
2019-09-20 20:30:43 +03:00
|
|
|
dashboardLoading = true;
|
2019-09-03 19:31:16 +03:00
|
|
|
|
2019-09-20 20:30:43 +03:00
|
|
|
dashboardWidgets = new DashboardWidgets(this);
|
2019-09-03 19:31:16 +03:00
|
|
|
|
|
|
|
|
constructor(protected store: Store<AppState>,
|
|
|
|
|
private timeService: TimeService,
|
|
|
|
|
private dialogService: DialogService,
|
|
|
|
|
private breakpointObserver: BreakpointObserver) {
|
|
|
|
|
super(store);
|
|
|
|
|
this.authUser = getCurrentAuthUser(store);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
2019-09-05 21:15:40 +03:00
|
|
|
if (!this.dashboardTimewindow) {
|
|
|
|
|
this.dashboardTimewindow = this.timeService.defaultTimewindow();
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
this.gridsterOpts = {
|
|
|
|
|
gridType: 'scrollVertical',
|
|
|
|
|
keepFixedHeightInMobile: true,
|
|
|
|
|
pushItems: false,
|
|
|
|
|
swap: false,
|
|
|
|
|
maxRows: 100,
|
2019-09-05 21:15:40 +03:00
|
|
|
minCols: this.columns ? this.columns : 24,
|
2019-09-03 19:31:16 +03:00
|
|
|
outerMargin: true,
|
2019-09-05 21:15:40 +03:00
|
|
|
outerMarginLeft: this.horizontalMargin ? this.horizontalMargin : 10,
|
|
|
|
|
outerMarginRight: this.horizontalMargin ? this.horizontalMargin : 10,
|
|
|
|
|
outerMarginTop: this.verticalMargin ? this.verticalMargin : 10,
|
|
|
|
|
outerMarginBottom: this.horizontalMargin ? this.horizontalMargin : 10,
|
2019-09-03 19:31:16 +03:00
|
|
|
minItemCols: 1,
|
|
|
|
|
minItemRows: 1,
|
|
|
|
|
defaultItemCols: 8,
|
|
|
|
|
defaultItemRows: 6,
|
2019-09-05 21:15:40 +03:00
|
|
|
resizable: {enabled: this.isEdit},
|
|
|
|
|
draggable: {enabled: this.isEdit},
|
2019-09-20 20:30:43 +03:00
|
|
|
itemChangeCallback: item => this.dashboardWidgets.sortWidgets()
|
2019-09-03 19:31:16 +03:00
|
|
|
};
|
|
|
|
|
|
2019-09-05 21:15:40 +03:00
|
|
|
this.updateMobileOpts();
|
2019-09-03 19:31:16 +03:00
|
|
|
|
2019-09-05 21:15:40 +03:00
|
|
|
this.breakpointObserver
|
|
|
|
|
.observe(MediaBreakpoints['gt-sm']).subscribe(
|
2019-09-03 19:31:16 +03:00
|
|
|
() => {
|
2019-09-05 21:15:40 +03:00
|
|
|
this.updateMobileOpts();
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
);
|
2019-09-20 20:30:43 +03:00
|
|
|
|
|
|
|
|
this.updateWidgets();
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
|
2019-09-05 21:15:40 +03:00
|
|
|
ngOnChanges(changes: SimpleChanges): void {
|
|
|
|
|
let updateMobileOpts = false;
|
|
|
|
|
let updateLayoutOpts = false;
|
|
|
|
|
let updateEditingOpts = false;
|
2019-09-20 20:30:43 +03:00
|
|
|
let updateWidgets = false;
|
2019-09-05 21:15:40 +03:00
|
|
|
for (const propName of Object.keys(changes)) {
|
|
|
|
|
const change = changes[propName];
|
|
|
|
|
if (!change.firstChange && change.currentValue !== change.previousValue) {
|
|
|
|
|
if (['isMobile', 'isMobileDisabled', 'autofillHeight', 'mobileAutofillHeight', 'mobileRowHeight'].includes(propName)) {
|
|
|
|
|
updateMobileOpts = true;
|
|
|
|
|
} else if (['horizontalMargin', 'verticalMargin'].includes(propName)) {
|
|
|
|
|
updateLayoutOpts = true;
|
|
|
|
|
} else if (propName === 'isEdit') {
|
|
|
|
|
updateEditingOpts = true;
|
2019-09-20 20:30:43 +03:00
|
|
|
} else if (['widgets', 'widgetLayouts'].includes(propName)) {
|
|
|
|
|
updateWidgets = true;
|
2019-09-05 21:15:40 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-20 20:30:43 +03:00
|
|
|
if (updateWidgets) {
|
|
|
|
|
this.updateWidgets();
|
|
|
|
|
}
|
2019-09-05 21:15:40 +03:00
|
|
|
if (updateMobileOpts) {
|
|
|
|
|
this.updateMobileOpts();
|
|
|
|
|
}
|
|
|
|
|
if (updateLayoutOpts) {
|
|
|
|
|
this.updateLayoutOpts();
|
|
|
|
|
}
|
|
|
|
|
if (updateEditingOpts) {
|
|
|
|
|
this.updateEditingOpts();
|
|
|
|
|
}
|
|
|
|
|
if (updateMobileOpts || updateLayoutOpts || updateEditingOpts) {
|
|
|
|
|
this.notifyGridsterOptionsChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-20 20:30:43 +03:00
|
|
|
private updateWidgets() {
|
|
|
|
|
this.dashboardWidgets.setWidgets(this.widgets, this.widgetLayouts);
|
|
|
|
|
this.dashboardLoading = false;
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void {
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-12 19:58:42 +03:00
|
|
|
onUpdateTimewindow(startTimeMs: number, endTimeMs: number, interval?: number): void {
|
2019-09-10 15:12:10 +03:00
|
|
|
if (!this.originalDashboardTimewindow) {
|
|
|
|
|
this.originalDashboardTimewindow = deepClone(this.dashboardTimewindow);
|
|
|
|
|
}
|
|
|
|
|
this.dashboardTimewindow = toHistoryTimewindow(this.dashboardTimewindow,
|
|
|
|
|
startTimeMs, endTimeMs, interval, this.timeService);
|
2019-09-12 19:58:42 +03:00
|
|
|
this.dashboardTimewindowChangedSubject.next(this.dashboardTimewindow);
|
2019-09-10 15:12:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onResetTimewindow(): void {
|
|
|
|
|
if (this.originalDashboardTimewindow) {
|
|
|
|
|
this.dashboardTimewindow = deepClone(this.originalDashboardTimewindow);
|
|
|
|
|
this.originalDashboardTimewindow = null;
|
2019-09-12 19:58:42 +03:00
|
|
|
this.dashboardTimewindowChangedSubject.next(this.dashboardTimewindow);
|
2019-09-10 15:12:10 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-03 19:31:16 +03:00
|
|
|
isAutofillHeight(): boolean {
|
|
|
|
|
if (this.isMobileSize) {
|
2019-09-05 21:15:40 +03:00
|
|
|
return isDefined(this.mobileAutofillHeight) ? this.mobileAutofillHeight : false;
|
2019-09-03 19:31:16 +03:00
|
|
|
} else {
|
2019-09-05 21:15:40 +03:00
|
|
|
return isDefined(this.autofillHeight) ? this.autofillHeight : false;
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openDashboardContextMenu($event: Event) {
|
|
|
|
|
// TODO:
|
|
|
|
|
// this.dialogService.todo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openWidgetContextMenu($event: Event, widget: DashboardWidget) {
|
|
|
|
|
// TODO:
|
|
|
|
|
// this.dialogService.todo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onWidgetFullscreenChanged(expanded: boolean, widget: DashboardWidget) {
|
|
|
|
|
this.isWidgetExpanded = expanded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widgetMouseDown($event: Event, widget: DashboardWidget) {
|
2019-09-05 21:15:40 +03:00
|
|
|
if (this.callbacks && this.callbacks.onWidgetMouseDown) {
|
|
|
|
|
this.callbacks.onWidgetMouseDown($event, widget.widget);
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widgetClicked($event: Event, widget: DashboardWidget) {
|
2019-09-05 21:15:40 +03:00
|
|
|
if (this.callbacks && this.callbacks.onWidgetClicked) {
|
|
|
|
|
this.callbacks.onWidgetClicked($event, widget.widget);
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
editWidget($event: Event, widget: DashboardWidget) {
|
|
|
|
|
if ($event) {
|
|
|
|
|
$event.stopPropagation();
|
|
|
|
|
}
|
2019-09-05 21:15:40 +03:00
|
|
|
if (this.isEditActionEnabled && this.callbacks && this.callbacks.onEditWidget) {
|
|
|
|
|
this.callbacks.onEditWidget($event, widget.widget);
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exportWidget($event: Event, widget: DashboardWidget) {
|
|
|
|
|
if ($event) {
|
|
|
|
|
$event.stopPropagation();
|
|
|
|
|
}
|
2019-09-05 21:15:40 +03:00
|
|
|
if (this.isExportActionEnabled && this.callbacks && this.callbacks.onExportWidget) {
|
|
|
|
|
this.callbacks.onExportWidget($event, widget.widget);
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
removeWidget($event: Event, widget: DashboardWidget) {
|
|
|
|
|
if ($event) {
|
|
|
|
|
$event.stopPropagation();
|
|
|
|
|
}
|
2019-09-05 21:15:40 +03:00
|
|
|
if (this.isRemoveActionEnabled && this.callbacks && this.callbacks.onRemoveWidget) {
|
2019-09-23 20:35:31 +03:00
|
|
|
this.callbacks.onRemoveWidget($event, widget.widget).subscribe(
|
|
|
|
|
(result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.dashboardWidgets.removeWidget(widget.widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
highlightWidget(widget: DashboardWidget, delay?: number) {
|
|
|
|
|
if (!this.highlightedMode || this.highlightedWidget !== widget) {
|
|
|
|
|
this.highlightedMode = true;
|
|
|
|
|
this.highlightedWidget = widget;
|
|
|
|
|
this.scrollToWidget(widget, delay);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectWidget(widget: DashboardWidget, delay?: number) {
|
|
|
|
|
if (this.selectedWidget !== widget) {
|
|
|
|
|
this.selectedWidget = widget;
|
|
|
|
|
this.scrollToWidget(widget, delay);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resetHighlight() {
|
|
|
|
|
this.highlightedMode = false;
|
|
|
|
|
this.highlightedWidget = null;
|
|
|
|
|
this.selectedWidget = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isHighlighted(widget: DashboardWidget) {
|
|
|
|
|
return (this.highlightedMode && this.highlightedWidget === widget) || (this.selectedWidget === widget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isNotHighlighted(widget: DashboardWidget) {
|
|
|
|
|
return this.highlightedMode && this.highlightedWidget !== widget;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scrollToWidget(widget: DashboardWidget, delay?: number) {
|
|
|
|
|
if (this.gridsterItems) {
|
|
|
|
|
const gridsterItem = this.gridsterItems.find((item => item.item === widget));
|
|
|
|
|
const offset = (this.gridster.curHeight - gridsterItem.height) / 2;
|
|
|
|
|
let scrollTop = gridsterItem.top;
|
|
|
|
|
if (offset > 0) {
|
|
|
|
|
scrollTop -= offset;
|
|
|
|
|
}
|
|
|
|
|
const parentElement = this.gridster.el as HTMLElement;
|
|
|
|
|
animatedScroll(parentElement, scrollTop, delay);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-05 21:15:40 +03:00
|
|
|
private updateMobileOpts() {
|
2019-09-03 19:31:16 +03:00
|
|
|
this.isMobileSize = this.checkIsMobileSize();
|
|
|
|
|
const mobileBreakPoint = this.isMobileSize ? 20000 : 0;
|
|
|
|
|
this.gridsterOpts.mobileBreakpoint = mobileBreakPoint;
|
|
|
|
|
const rowSize = this.detectRowSize(this.isMobileSize);
|
|
|
|
|
if (this.gridsterOpts.fixedRowHeight !== rowSize) {
|
|
|
|
|
this.gridsterOpts.fixedRowHeight = rowSize;
|
|
|
|
|
}
|
|
|
|
|
if (this.isAutofillHeight()) {
|
|
|
|
|
this.gridsterOpts.gridType = 'fit';
|
|
|
|
|
} else {
|
|
|
|
|
this.gridsterOpts.gridType = this.isMobileSize ? 'fixed' : 'scrollVertical';
|
|
|
|
|
}
|
2019-09-05 21:15:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private updateLayoutOpts() {
|
|
|
|
|
this.gridsterOpts.outerMarginLeft = this.horizontalMargin ? this.horizontalMargin : 10;
|
|
|
|
|
this.gridsterOpts.outerMarginRight = this.horizontalMargin ? this.horizontalMargin : 10;
|
|
|
|
|
this.gridsterOpts.outerMarginTop = this.verticalMargin ? this.verticalMargin : 10;
|
|
|
|
|
this.gridsterOpts.outerMarginBottom = this.horizontalMargin ? this.horizontalMargin : 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private updateEditingOpts() {
|
|
|
|
|
this.gridsterOpts.resizable.enabled = this.isEdit;
|
|
|
|
|
this.gridsterOpts.draggable.enabled = this.isEdit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private notifyGridsterOptionsChanged() {
|
2019-09-03 19:31:16 +03:00
|
|
|
if (this.gridster && this.gridster.options) {
|
|
|
|
|
this.gridster.optionsChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private detectRowSize(isMobile: boolean): number | null {
|
|
|
|
|
let rowHeight = null;
|
|
|
|
|
if (!this.isAutofillHeight()) {
|
|
|
|
|
if (isMobile) {
|
2019-09-05 21:15:40 +03:00
|
|
|
rowHeight = isDefined(this.mobileRowHeight) ? this.mobileRowHeight : 70;
|
2019-09-03 19:31:16 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return rowHeight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private checkIsMobileSize(): boolean {
|
2019-09-05 21:15:40 +03:00
|
|
|
const isMobileDisabled = this.isMobileDisabled === true;
|
|
|
|
|
let isMobileSize = this.isMobile === true && !isMobileDisabled;
|
2019-09-03 19:31:16 +03:00
|
|
|
if (!isMobileSize && !isMobileDisabled) {
|
|
|
|
|
isMobileSize = !this.breakpointObserver.isMatched(MediaBreakpoints['gt-sm']);
|
|
|
|
|
}
|
|
|
|
|
return isMobileSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|