import { A11yModule } from '@angular/cdk/a11y';
import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { CommonModule } from '@angular/common';
import { Component, HostBinding, inject, signal } from '@angular/core';
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { ButtonGroupDirective } from '@metad/ocap-angular/core';
import { assign } from '@metad/ocap-core';
import { FormlyModule } from '@ngx-formly/core';
import { TranslateModule } from '@ngx-translate/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/button";
import * as i2 from "@angular/cdk/a11y";
import * as i3 from "@ngx-formly/core";
import * as i4 from "@ngx-translate/core";
import * as i5 from "@angular/cdk/drag-drop";
export class CdkConfirmOptionsComponent {
    constructor() {
        this.data = inject(DIALOG_DATA);
        this.dialogRef = inject(DialogRef);
        this.isDialogContainer = true;
        this.formGroup = new FormGroup({});
        this.model = {};
        this.options = {};
        this.fields = signal(this.data.formFields);
        assign(this.model, this.data.value);
    }
    onModelChange(event) {
        //
    }
    apply() {
        this.dialogRef.close(this.model);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CdkConfirmOptionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CdkConfirmOptionsComponent, isStandalone: true, selector: "cdk-confirm-options", host: { properties: { "class.ngm-dialog-container": "this.isDialogContainer" }, classAttribute: "cdk-dialog-card" }, ngImport: i0, template: "<header cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle class=\"pb-2 cursor-move\">\n  <h4 class=\"text-xl pointer-events-none\">\n    {{data?.information}}\n  </h4>\n</header>\n\n<div class=\"mat-typography py-4 min-h-[100px]\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n  <formly-form class=\"w-full\"\n    [form]=\"formGroup\"\n    [fields]=\"fields()\"\n    [model]=\"model\"\n    (modelChange)=\"onModelChange($event)\"\n    [options]=\"options\"\n  />\n</div>\n\n<div class=\"w-full flex justify-end items-center\">\n  <div ngmButtonGroup>\n    <button mat-button mat-dialog-close>\n      {{ 'COMPONENTS.COMMON.CANCEL' | translate: {Default: 'Cancel'} }}\n    </button>\n    <button mat-raised-button color=\"accent\" cdkFocusInitial (click)=\"apply()\">\n      {{ 'COMPONENTS.COMMON.Confirm' | translate: {Default: 'Confirm'} }}\n    </button>\n  </div>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i3.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i5.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i5.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: ButtonGroupDirective, selector: "[ngmButtonGroup]" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CdkConfirmOptionsComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [
                        MatButtonModule,
                        A11yModule,
                        CommonModule,
                        FormsModule,
                        ReactiveFormsModule,
                        FormlyModule,
                        TranslateModule,
                        DragDropModule,
                        ButtonGroupDirective
                    ], selector: 'cdk-confirm-options', host: {
                        'class': 'cdk-dialog-card'
                    }, template: "<header cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle class=\"pb-2 cursor-move\">\n  <h4 class=\"text-xl pointer-events-none\">\n    {{data?.information}}\n  </h4>\n</header>\n\n<div class=\"mat-typography py-4 min-h-[100px]\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n  <formly-form class=\"w-full\"\n    [form]=\"formGroup\"\n    [fields]=\"fields()\"\n    [model]=\"model\"\n    (modelChange)=\"onModelChange($event)\"\n    [options]=\"options\"\n  />\n</div>\n\n<div class=\"w-full flex justify-end items-center\">\n  <div ngmButtonGroup>\n    <button mat-button mat-dialog-close>\n      {{ 'COMPONENTS.COMMON.CANCEL' | translate: {Default: 'Cancel'} }}\n    </button>\n    <button mat-raised-button color=\"accent\" cdkFocusInitial (click)=\"apply()\">\n      {{ 'COMPONENTS.COMMON.Confirm' | translate: {Default: 'Confirm'} }}\n    </button>\n  </div>\n</div>\n", styles: [":host{display:block}\n"] }]
        }], ctorParameters: () => [], propDecorators: { isDialogContainer: [{
                type: HostBinding,
                args: ['class.ngm-dialog-container']
            }] } });
//# sourceMappingURL=data:application/json;base64, 