Skip to content
Snippets Groups Projects
frame.component.ts 1.13 KiB
Newer Older
rhenck's avatar
rhenck committed
import { Component, Input } from '@angular/core';
import { FrameElement } from './frame-element';
rhenck's avatar
rhenck committed
import { ElementComponent } from '../../directives/element-component.directive';
rhenck's avatar
rhenck committed

@Component({
  selector: 'app-frame',
  template: `
    <div [class.center-content]="elementModel.positionProps.dynamicPositioning &&
                                 elementModel.positionProps.fixedSize"
         [style.width]="elementModel.positionProps.fixedSize ?
            elementModel.width + 'px' :
            'calc(100% - ' + (elementModel.borderWidth * 2) + 'px)'"
         [style.height]="elementModel.positionProps.fixedSize ?
            elementModel.height + 'px' :
            'calc(100% - ' + (elementModel.borderWidth * 2) + 'px)'"
rhenck's avatar
rhenck committed
         [style.border-style]="elementModel.borderStyle"
         [style.border-width.px]="elementModel.borderWidth"
rhenck's avatar
rhenck committed
         [style.border-color]="elementModel.borderColor"
         [style.border-radius.px]="elementModel.borderRadius"
         [style.background-color]="elementModel.surfaceProps.backgroundColor">
  </div>
  `
})
rhenck's avatar
rhenck committed
export class FrameComponent extends ElementComponent {
rhenck's avatar
rhenck committed
  @Input() elementModel!: FrameElement;
}