/
githubmirror
/
tabby
Обзор
Документация
Войти
/
githubmirror
/
tabby
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tabby-core/src/components/selfPositioning.component.ts
19 строк
752 B
Eugene
bootstrap 5 WIP (#7891)
26 фев 2023, 22:42
Не верифицирован
26 фев 2023, 22:42
1e5cfd1
Код
Авторство
О чём код?
import { HostBinding, ElementRef, Component } from '@angular/core' import { BaseComponent } from './base.component' @Component({}) export abstract class SelfPositioningComponent extends BaseComponent { @HostBinding('style.left') cssLeft = '' @HostBinding('style.top') cssTop = '' @HostBinding('style.width') cssWidth: string | null = null @HostBinding('style.height') cssHeight: string | null = null constructor (protected element: ElementRef) { super() } protected setDimensions (x: number, y: number, w: number, h: number, unit = '%'): void { this.cssLeft = `${x}${unit}` this.cssTop = `${y}${unit}` this.cssWidth = w ? `${w}${unit}` : null this.cssHeight = h ? `${h}${unit}` : null } }