import { __decorate } from "tslib";
/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
import { DatePipe, NgTemplateOutlet } from '@angular/common';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { InputBoolean } from 'ng-zorro-antd/core/util';
import { NzIconModule } from 'ng-zorro-antd/icon';
import * as i0 from "@angular/core";
import * as i1 from "ng-zorro-antd/icon";
export class NzCronExpressionPreviewComponent {
    constructor(cdr) {
        this.cdr = cdr;
        this.TimeList = [];
        this.visible = true;
        this.nzSemantic = null;
        this.loadMorePreview = new EventEmitter();
        this.isExpand = true;
    }
    setExpand() {
        this.isExpand = !this.isExpand;
        this.cdr.markForCheck();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzCronExpressionPreviewComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: NzCronExpressionPreviewComponent, isStandalone: true, selector: "nz-cron-expression-preview", inputs: { TimeList: "TimeList", visible: "visible", locale: "locale", nzSemantic: "nzSemantic" }, outputs: { loadMorePreview: "loadMorePreview" }, exportAs: ["nzCronExpressionPreview"], ngImport: i0, template: ` <div class="ant-collapse ant-collapse-borderless ant-cron-expression-preview">
    <div class="ant-cron-expression-preview-dateTime" [class.ant-cron-expression-preview-dateTime-center]="!isExpand">
      @if (visible) {
        @if (!nzSemantic) {
          {{ TimeList[0] | date: 'YYYY-MM-dd HH:mm:ss' }}
        } @else {
          <ng-template [ngTemplateOutlet]="nzSemantic" />
        }
      } @else {
        {{ locale.cronError }}
      }
    </div>
    @if (visible && !isExpand) {
      <div class="ant-cron-expression-preview-content">
        <ul class="ant-cron-expression-preview-list">
          @for (item of TimeList; track item) {
            <li>
              {{ item | date: 'YYYY-MM-dd HH:mm:ss' }}
            </li>
          }
          <li><a (click)="loadMorePreview.emit()">···</a></li>
        </ul>
      </div>
    }

    <ul class="ant-cron-expression-preview-icon">
      @if (isExpand) {
        <li><span nz-icon nzType="down" nzTheme="outline" (click)="setExpand()"></span></li>
      } @else {
        <li><span nz-icon nzType="up" nzTheme="outline" (click)="setExpand()"></span></li>
      }
    </ul>
  </div>`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
__decorate([
    InputBoolean()
], NzCronExpressionPreviewComponent.prototype, "visible", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzCronExpressionPreviewComponent, decorators: [{
            type: Component,
            args: [{
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    encapsulation: ViewEncapsulation.None,
                    selector: 'nz-cron-expression-preview',
                    exportAs: 'nzCronExpressionPreview',
                    template: ` <div class="ant-collapse ant-collapse-borderless ant-cron-expression-preview">
    <div class="ant-cron-expression-preview-dateTime" [class.ant-cron-expression-preview-dateTime-center]="!isExpand">
      @if (visible) {
        @if (!nzSemantic) {
          {{ TimeList[0] | date: 'YYYY-MM-dd HH:mm:ss' }}
        } @else {
          <ng-template [ngTemplateOutlet]="nzSemantic" />
        }
      } @else {
        {{ locale.cronError }}
      }
    </div>
    @if (visible && !isExpand) {
      <div class="ant-cron-expression-preview-content">
        <ul class="ant-cron-expression-preview-list">
          @for (item of TimeList; track item) {
            <li>
              {{ item | date: 'YYYY-MM-dd HH:mm:ss' }}
            </li>
          }
          <li><a (click)="loadMorePreview.emit()">···</a></li>
        </ul>
      </div>
    }

    <ul class="ant-cron-expression-preview-icon">
      @if (isExpand) {
        <li><span nz-icon nzType="down" nzTheme="outline" (click)="setExpand()"></span></li>
      } @else {
        <li><span nz-icon nzType="up" nzTheme="outline" (click)="setExpand()"></span></li>
      }
    </ul>
  </div>`,
                    imports: [NgTemplateOutlet, DatePipe, NzIconModule],
                    standalone: true
                }]
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { TimeList: [{
                type: Input
            }], visible: [{
                type: Input
            }], locale: [{
                type: Input
            }], nzSemantic: [{
                type: Input
            }], loadMorePreview: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 