import { CommonModule } from '@angular/common';
import { Component, inject } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { NgmCommonModule, NgmSelectModule } from '@metad/ocap-angular/common';
import { DensityDirective } from '@metad/ocap-angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { NgmEntityPropertyComponent } from '../property/property.component';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@ngx-translate/core";
import * as i3 from "@angular/material/button";
import * as i4 from "@angular/material/dialog";
import * as i5 from "@angular/material/slide-toggle";
import * as i6 from "@angular/cdk/drag-drop";
import * as i7 from "@metad/ocap-angular/common";
import * as i8 from "@metad/ocap-angular/core";
export class NgmFormattingComponent {
    constructor() {
        this.data = inject(MAT_DIALOG_DATA);
        this.dialogRef = inject((MatDialogRef));
        this.formGroup = new FormGroup({
            shortNumber: new FormControl(false),
            decimal: new FormControl(null),
            unit: new FormControl(null),
            useUnderlyingUnit: new FormControl(false),
            digitsInfo: new FormControl(null),
        });
    }
    ngOnInit() {
        if (this.data) {
            this.formGroup.patchValue(this.data);
        }
    }
    onApply() {
        this.dialogRef.close(this.formGroup.value);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: NgmFormattingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: NgmFormattingComponent, isStandalone: true, selector: "ngm-formatting", host: { classAttribute: "ngm-dialog-container" }, ngImport: i0, template: "<header mat-dialog-title cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle>\n    <h4 style=\"pointer-events: none;\">\n        {{ 'Ngm.Entity.MeasureFormatting' | translate: {Default: \"Measure Formatting\"} }}\n    </h4>\n</header>\n\n<mat-dialog-content class=\"mat-typography\">\n    <form [formGroup]=\"formGroup\" class=\"flex flex-col justify-start items-stretch gap-2\">\n        <mat-slide-toggle formControlName=\"shortNumber\">\n            {{ 'Ngm.Entity.ShortNumber' | translate: {Default: \"Short Number\"} }}\n        </mat-slide-toggle>\n\n        <ngm-slider-input [label]=\"'Ngm.Entity.Decimals' | translate: {Default: 'Decimals'}\"\n            formControlName=\"decimal\"\n            color=\"accent\"\n            [max]=\"10\"\n        >\n        </ngm-slider-input>\n        <ngm-input [label]=\"'Ngm.Entity.DigitsInfo' | translate: {Default: 'Digits Info'}\"\n            formControlName=\"digitsInfo\"\n        ></ngm-input>\n        <ngm-input [label]=\"'Ngm.Entity.Unit' | translate: {Default: 'Unit'}\" formControlName=\"unit\"></ngm-input>\n\n        <!-- \u6682\u4E0D\u652F\u6301 <mat-checkbox formControlName=\"useUnderlyingUnit\">\n            {{ 'Ngm.Entity.UseUnderlyingUnit' | translate: {Default: \"Use Underlying Unit\"} }}\n        </mat-checkbox> -->\n        \n    </form>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n    <div ngmButtonGroup>\n        <button mat-button mat-dialog-close>\n            {{ 'Ngm.Common.Cancel' | translate: {Default: 'Cancel'} }}\n        </button>\n        <button mat-raised-button color=\"accent\" cdkFocusInitial (click)=\"onApply()\">\n            {{ 'Ngm.Common.Apply' | translate: {Default: 'Apply'} }}\n        </button>\n    </div>\n</mat-dialog-actions>\n", styles: [":host{overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i5.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: NgmCommonModule }, { kind: "directive", type: i6.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: i6.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i7.NgmSliderInputComponent, selector: "ngm-slider-input", inputs: ["disabled", "disableRipple", "color", "label", "unit", "displayWith", "max", "min", "step", "discrete", "autoScale"] }, { kind: "component", type: i7.NgmInputComponent, selector: "ngm-input", inputs: ["label", "placeholder", "type", "defaultValue", "valueKey", "options", "disabled"], outputs: ["blur"] }, { kind: "directive", type: i8.ButtonGroupDirective, selector: "[ngmButtonGroup]" }, { kind: "ngmodule", type: NgmSelectModule }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: NgmFormattingComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [
                        CommonModule,
                        ReactiveFormsModule,
                        TranslateModule,
                        MatButtonModule,
                        MatIconModule,
                        MatTooltipModule,
                        MatDialogModule,
                        MatSlideToggleModule,
                        NgmCommonModule,
                        NgmSelectModule,
                        DensityDirective,
                        NgmEntityPropertyComponent
                    ], selector: 'ngm-formatting', host: {
                        class: 'ngm-dialog-container'
                    }, template: "<header mat-dialog-title cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle>\n    <h4 style=\"pointer-events: none;\">\n        {{ 'Ngm.Entity.MeasureFormatting' | translate: {Default: \"Measure Formatting\"} }}\n    </h4>\n</header>\n\n<mat-dialog-content class=\"mat-typography\">\n    <form [formGroup]=\"formGroup\" class=\"flex flex-col justify-start items-stretch gap-2\">\n        <mat-slide-toggle formControlName=\"shortNumber\">\n            {{ 'Ngm.Entity.ShortNumber' | translate: {Default: \"Short Number\"} }}\n        </mat-slide-toggle>\n\n        <ngm-slider-input [label]=\"'Ngm.Entity.Decimals' | translate: {Default: 'Decimals'}\"\n            formControlName=\"decimal\"\n            color=\"accent\"\n            [max]=\"10\"\n        >\n        </ngm-slider-input>\n        <ngm-input [label]=\"'Ngm.Entity.DigitsInfo' | translate: {Default: 'Digits Info'}\"\n            formControlName=\"digitsInfo\"\n        ></ngm-input>\n        <ngm-input [label]=\"'Ngm.Entity.Unit' | translate: {Default: 'Unit'}\" formControlName=\"unit\"></ngm-input>\n\n        <!-- \u6682\u4E0D\u652F\u6301 <mat-checkbox formControlName=\"useUnderlyingUnit\">\n            {{ 'Ngm.Entity.UseUnderlyingUnit' | translate: {Default: \"Use Underlying Unit\"} }}\n        </mat-checkbox> -->\n        \n    </form>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n    <div ngmButtonGroup>\n        <button mat-button mat-dialog-close>\n            {{ 'Ngm.Common.Cancel' | translate: {Default: 'Cancel'} }}\n        </button>\n        <button mat-raised-button color=\"accent\" cdkFocusInitial (click)=\"onApply()\">\n            {{ 'Ngm.Common.Apply' | translate: {Default: 'Apply'} }}\n        </button>\n    </div>\n</mat-dialog-actions>\n", styles: [":host{overflow:hidden}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64, 