import { Component, Input, ViewEncapsulation } from '@angular/core';
import { Section } from '../../../forms/page/data-detail-view/section';
import { SectionType } from '../../../forms/page/common/widget-enums';
import { DetailViewType } from '../../../forms/page/common/detail-view-enums';
import * as i0 from "@angular/core";
function SectionComponent_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0, 3);
    i0.ɵɵelement(1, "dynamic-data-view", 4);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const sectionField_r1 = i0.ɵɵnextContext().$implicit;
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("viewType", ctx_r2.detailViewType.SectionField)("fxFlex.gt-md", sectionField_r1.colSpan)("fxFlex.lt-md", 100)("sectionField", sectionField_r1)("baseUrl", ctx_r2.baseUrl)("formObjectId", ctx_r2.formObjectId)("axonatorX1Url", ctx_r2.axonatorX1Url);
} }
function SectionComponent_ng_container_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0, 3);
    i0.ɵɵelement(1, "dynamic-data-view", 5);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const sectionField_r1 = i0.ɵɵnextContext().$implicit;
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("viewType", ctx_r3.detailViewType.Section)("section", sectionField_r1)("baseUrl", ctx_r3.baseUrl)("axonatorX1Url", ctx_r3.axonatorX1Url)("formObjectId", ctx_r3.formObjectId);
} }
function SectionComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, SectionComponent_ng_container_1_ng_container_1_Template, 2, 7, "ng-container", 2);
    i0.ɵɵtemplate(2, SectionComponent_ng_container_1_ng_container_2_Template, 2, 5, "ng-container", 2);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const sectionField_r1 = ctx.$implicit;
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", sectionField_r1.type === ctx_r0.sectionType.sectionField);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", sectionField_r1.type === ctx_r0.sectionType.section);
} }
const _c0 = function (a0) { return { "border-1 ": a0 }; };
export class SectionComponent {
    constructor() {
        this.sectionType = Object.assign({}, SectionType);
        this.detailViewType = Object.assign({}, DetailViewType);
    }
    ngOnInit() {
        this.section.isCollapsible = this.section.isCollapsible;
    }
    showBorder() {
        this.section.showPrompt = !this.section?.showPrompt;
        this.section.showBorder = !this.section?.showBorder;
    }
}
SectionComponent.ɵfac = function SectionComponent_Factory(t) { return new (t || SectionComponent)(); };
SectionComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SectionComponent, selectors: [["app-section"]], inputs: { section: "section", baseUrl: "baseUrl", formObjectId: "formObjectId", axonatorX1Url: "axonatorX1Url" }, decls: 2, vars: 4, consts: [["fxLayout", "row wrap", "fxLayoutAlign", "start center", "fxFlex", "100", 1, "flex-row-gap", "overflow-hidden", 3, "ngClass"], [4, "ngFor", "ngForOf"], ["class", "border-box", 4, "ngIf"], [1, "border-box"], [1, "flex-width", 3, "viewType", "fxFlex.gt-md", "fxFlex.lt-md", "sectionField", "baseUrl", "formObjectId", "axonatorX1Url"], ["fxFlex", "100", 1, "flex-width", 3, "viewType", "section", "baseUrl", "axonatorX1Url", "formObjectId"]], template: function SectionComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "mat-card", 0);
        i0.ɵɵtemplate(1, SectionComponent_ng_container_1_Template, 3, 2, "ng-container", 1);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0, ctx.section.showBorder));
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngForOf", ctx.section == null ? null : ctx.section.sections);
    } }, styles: ["app-section .flex-row-gap{row-gap:25px}app-section mat-card{column-gap:.5%}@media screen and (max-width: 768px){app-section{padding-right:0}}\n"], encapsulation: 2 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SectionComponent, [{
        type: Component,
        args: [{ selector: 'app-section', encapsulation: ViewEncapsulation.None, template: "<mat-card [ngClass]=\"{ 'border-1 ': section.showBorder}\" fxLayout=\"row wrap\"  fxLayoutAlign=\"start center\" fxFlex=\"100\" class=\"flex-row-gap overflow-hidden\">\n    <ng-container *ngFor=\"let sectionField of section?.sections\">\n      <ng-container *ngIf=\"sectionField.type === sectionType.sectionField\"   class=\"border-box\">\n        <dynamic-data-view      [viewType]=\"detailViewType.SectionField\" [fxFlex.gt-md]=\"sectionField.colSpan\" [fxFlex.lt-md]=\"100\" [sectionField]= \"sectionField\" [baseUrl] =\"baseUrl\" [formObjectId] = \"formObjectId\" [axonatorX1Url] =\"axonatorX1Url\" class=\"flex-width\" ></dynamic-data-view>\n      </ng-container>\n      <ng-container  *ngIf=\"sectionField.type === sectionType.section\"   class=\"border-box\">\n        <dynamic-data-view [viewType]=\"detailViewType.Section\"  [section]= \"sectionField\" fxFlex=\"100\" [baseUrl] =\"baseUrl\" [axonatorX1Url] =\"axonatorX1Url\" [formObjectId] = \"formObjectId\"  class=\"flex-width\"></dynamic-data-view>\n      </ng-container>\n    </ng-container>\n</mat-card>\n", styles: ["app-section .flex-row-gap{row-gap:25px}app-section mat-card{column-gap:.5%}@media screen and (max-width: 768px){app-section{padding-right:0}}\n"] }]
    }], function () { return []; }, { section: [{
            type: Input
        }], baseUrl: [{
            type: Input
        }], formObjectId: [{
            type: Input
        }], axonatorX1Url: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 