import { AXDataSource } from '@acorex/cdk/common';
import * as i1 from '@acorex/components/button';
import { AXButtonModule } from '@acorex/components/button';
import * as i1$1 from '@acorex/components/data-table';
import { AXDataTableModule } from '@acorex/components/data-table';
import * as i2 from '@acorex/components/decorators';
import { AXDecoratorModule } from '@acorex/components/decorators';
import { AXBasePageComponent } from '@acorex/components/page';
import * as i0 from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';

class AXPTabularDataPopupComponent extends AXBasePageComponent {
    constructor() {
        super(...arguments);
        this.dataSource = new AXDataSource({
            load: async () => {
                const items = this.items;
                return {
                    items: items,
                    total: items.length,
                };
            },
            pageSize: 1,
            key: 'gridItem',
        });
    }
    onClose() {
        this.close();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPTabularDataPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: AXPTabularDataPopupComponent, isStandalone: true, selector: "axp-tabular-data-view-popup", usesInheritance: true, ngImport: i0, template: `
    <ax-data-table class="ax-m-4" #grid [paging]="false" [dataSource]="dataSource">
      @for (column of columns; track $index) {
        <ax-text-column [dataField]="column.name" [caption]="column.title"></ax-text-column>
      }
    </ax-data-table>
    <ax-footer
      ><div class="ax-flex ax-w-full ax-justify-end">
        <ax-button color="primary" [text]="'Okay'" (onClick)="onClose()"></ax-button></div
    ></ax-footer>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i1$1.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "rowDetailsTemplate", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: i1$1.AXDataTableTextColumnComponent, selector: "ax-text-column", inputs: ["width", "caption", "allowSorting", "allowResizing", "fixed", "customExpandIcon", "customCollapseIcon", "dataField", "expandHandler", "wrapText", "cellTemplate", "footerTemplate", "headerTemplate", "format", "formatOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPTabularDataPopupComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'axp-tabular-data-view-popup',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    template: `
    <ax-data-table class="ax-m-4" #grid [paging]="false" [dataSource]="dataSource">
      @for (column of columns; track $index) {
        <ax-text-column [dataField]="column.name" [caption]="column.title"></ax-text-column>
      }
    </ax-data-table>
    <ax-footer
      ><div class="ax-flex ax-w-full ax-justify-end">
        <ax-button color="primary" [text]="'Okay'" (onClick)="onClose()"></ax-button></div
    ></ax-footer>
  `,
                    imports: [AXDecoratorModule, AXButtonModule, AXDataTableModule],
                }]
        }] });

export { AXPTabularDataPopupComponent };
//# sourceMappingURL=acorex-platform-layout-widgets-tabular-data-view-popup.component--rzP7scF.mjs.map
