import { Component, Input } from "@angular/core";
import * as i0 from "@angular/core";
import * as i1 from "../../services/model.service";
import * as i2 from "@angular/common";
import * as i3 from "../sti-component";
import * as i4 from "../sti-editable-content.component";
import * as i5 from "../svg.components/svg.checkbox.component";
export class StiCheckBoxComponent {
    get align() {
        return "start";
    }
    constructor(model) {
        this.model = model;
    }
    disableDrag(event) {
        this.model.canDrag = false;
    }
    changeState() {
        this.element.isChecked = !this.element.isChecked;
        this.model.formEvents.next({ name: "ValueChanged" });
    }
    ngOnInit() { }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: StiCheckBoxComponent, deps: [{ token: i1.StiModelService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: StiCheckBoxComponent, selector: "sti-checkbox-component", inputs: { element: "element", isClone: "isClone" }, ngImport: i0, template: `
    <sti-component [element]="element" [isClone]="isClone" class="sti-check-box">
      <sti-editable-content-component
        *ngIf="element?.label.value?.length > 0 && element?.isLabelTopAlignment()"
        [editableContent]="element.label"
        [style.align-self]="align"
        [style.text-align]="element?.getContentAlign()"
        [required]="element.required"
        [hideEmpty]="element.showLabelPlaceholder(model?.selectedComponent?.element == element)"
        [style.width]="element?.getLabelWidth()"
      ></sti-editable-content-component>
      <table [style.width]="'100%'" [style.height]="'max-content'" [style.margin-top.px]="element?.getTopMargin()">
        <tr>
          <td
            *ngIf="element?.label.value?.length > 0 && !element?.isLabelTopAlignment()"
            [style.display]="'flex'"
            [style.height]="'100%'"
            [style.width]="element?.getLabelWidth()"
            [style.align-items]="element?.getVerticalAlignment()"
          >
            <sti-editable-content-component
              *ngIf="element?.label.value?.length > 0"
              [editableContent]="element?.label"
              [required]="element.required"
              [style.text-align]="element?.getContentAlign()"
              [style.width]="element?.getLabelWidth()"
              [hideEmpty]="element?.showLabelPlaceholder(model?.selectedComponent?.element == element)"
            ></sti-editable-content-component>
          </td>
          <td [style.width]="'100%'" [style.maxWidth.px]="element.maxWidth + 1">
            <sti-svg-checkbox-component
              [element]="element"
              [tabIndex]="element['tabIndex']"
              [id]="element?.name"
              [text]="element?.text"
              [state]="element?.isChecked"
              (buttonClick)="changeState()"
            ></sti-svg-checkbox-component>
          </td>
        </tr>
        <tr *ngIf="element?.description.value?.length > 0">
          <td *ngIf="element?.label.value?.length > 0 && !element?.isLabelTopAlignment()"></td>
          <td [style.maxWidth.px]="element.maxWidth + 1">
            <sti-editable-content-component
              *ngIf="element?.description.value?.length > 0"
              [editableContent]="element.description"
            >
            </sti-editable-content-component>
          </td>
        </tr>
      </table>
    </sti-component>
    <style>
      table {
        border-spacing: 0;
      }
      tr {
        height: max-content;
        padding: 0;
        margin: 0;
      }
      td {
        height: 100%;
        padding: 0;
        margin: 0;
      }
    </style>
  `, isInline: true, styles: ["\n      table {\n        border-spacing: 0;\n      }\n      tr {\n        height: max-content;\n        padding: 0;\n        margin: 0;\n      }\n      td {\n        height: 100%;\n        padding: 0;\n        margin: 0;\n      }\n    "], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.StiComponent, selector: "sti-component", inputs: ["element", "class", "isClone", "borderArea"] }, { kind: "component", type: i4.StiEditableContentComponent, selector: "sti-editable-content-component", inputs: ["editableContent", "displayContent", "required", "eParent", "hideEmpty", "active", "alignment", "isTableTotalHeader", "disablePadding", "fromButton", "parentCursor", "isTableHeader"] }, { kind: "component", type: i5.StiSvgCheckBoxComponent, selector: "sti-svg-checkbox-component", inputs: ["element", "id", "text", "state", "useCustomOption", "disablePlaceHolder", "tabIndex"], outputs: ["buttonClick"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: StiCheckBoxComponent, decorators: [{
            type: Component,
            args: [{
                    selector: "sti-checkbox-component",
                    template: `
    <sti-component [element]="element" [isClone]="isClone" class="sti-check-box">
      <sti-editable-content-component
        *ngIf="element?.label.value?.length > 0 && element?.isLabelTopAlignment()"
        [editableContent]="element.label"
        [style.align-self]="align"
        [style.text-align]="element?.getContentAlign()"
        [required]="element.required"
        [hideEmpty]="element.showLabelPlaceholder(model?.selectedComponent?.element == element)"
        [style.width]="element?.getLabelWidth()"
      ></sti-editable-content-component>
      <table [style.width]="'100%'" [style.height]="'max-content'" [style.margin-top.px]="element?.getTopMargin()">
        <tr>
          <td
            *ngIf="element?.label.value?.length > 0 && !element?.isLabelTopAlignment()"
            [style.display]="'flex'"
            [style.height]="'100%'"
            [style.width]="element?.getLabelWidth()"
            [style.align-items]="element?.getVerticalAlignment()"
          >
            <sti-editable-content-component
              *ngIf="element?.label.value?.length > 0"
              [editableContent]="element?.label"
              [required]="element.required"
              [style.text-align]="element?.getContentAlign()"
              [style.width]="element?.getLabelWidth()"
              [hideEmpty]="element?.showLabelPlaceholder(model?.selectedComponent?.element == element)"
            ></sti-editable-content-component>
          </td>
          <td [style.width]="'100%'" [style.maxWidth.px]="element.maxWidth + 1">
            <sti-svg-checkbox-component
              [element]="element"
              [tabIndex]="element['tabIndex']"
              [id]="element?.name"
              [text]="element?.text"
              [state]="element?.isChecked"
              (buttonClick)="changeState()"
            ></sti-svg-checkbox-component>
          </td>
        </tr>
        <tr *ngIf="element?.description.value?.length > 0">
          <td *ngIf="element?.label.value?.length > 0 && !element?.isLabelTopAlignment()"></td>
          <td [style.maxWidth.px]="element.maxWidth + 1">
            <sti-editable-content-component
              *ngIf="element?.description.value?.length > 0"
              [editableContent]="element.description"
            >
            </sti-editable-content-component>
          </td>
        </tr>
      </table>
    </sti-component>
    <style>
      table {
        border-spacing: 0;
      }
      tr {
        height: max-content;
        padding: 0;
        margin: 0;
      }
      td {
        height: 100%;
        padding: 0;
        margin: 0;
      }
    </style>
  `,
                }]
        }], ctorParameters: function () { return [{ type: i1.StiModelService }]; }, propDecorators: { element: [{
                type: Input
            }], isClone: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 