Skip to content
Snippets Groups Projects
frame.component.ts 828 B
Newer Older
  • Learn to ignore specific revisions
  • 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: 'aspect-frame',
    
    rhenck's avatar
    rhenck committed
      template: `
    
        <div [style.width]="'calc(100% - ' + (elementModel.borderWidth * 2) + 'px)'"
             [style.height]="'calc(100% - ' + (elementModel.borderWidth * 2) + 'px)'"
    
             [style.border-style]="elementModel.borderStyle"
             [style.border-width.px]="elementModel.borderWidth"
             [style.border-color]="elementModel.borderColor"
             [style.border-radius.px]="elementModel.borderRadius"
             [style.background-color]="elementModel.surfaceProps.backgroundColor">
    
    rhenck's avatar
    rhenck committed
      `
    })
    
    rhenck's avatar
    rhenck committed
    export class FrameComponent extends ElementComponent {
    
    rhenck's avatar
    rhenck committed
      @Input() elementModel!: FrameElement;
    }