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 { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, EventEmitter } from '@angular/core';
import { InputBoolean } from 'ng-zorro-antd/core/util';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "ng-zorro-antd/icon";
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: "16.2.5", ngImport: i0, type: NzCronExpressionPreviewComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: NzCronExpressionPreviewComponent, 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">
      <ng-container *ngIf="visible; else cronError">
        <ng-container *ngIf="!nzSemantic; else semanticTemplate">
          {{ TimeList[0] | date: 'YYYY-MM-dd HH:mm:ss' }}
        </ng-container>
        <ng-template #semanticTemplate [ngTemplateOutlet]="nzSemantic"></ng-template>
      </ng-container>
      <ng-template #cronError>{{ locale.cronError }}</ng-template>
    </div>
    <div *ngIf="visible" class="ant-cron-expression-preview-content">
      <div class="ant-cron-expression-preview-content-date">
        <ng-container *ngIf="!isExpand">
          <ul class="ant-cron-expression-preview-list">
            <li *ngFor="let item of TimeList">
              {{ item | date: 'YYYY-MM-dd HH:mm:ss' }}
            </li>
            <li><a (click)="loadMorePreview.emit()">···</a></li>
          </ul>
        </ng-container>
      </div>
      <ul class="ant-cron-expression-preview-icon">
        <li *ngIf="isExpand"><span nz-icon nzType="down" nzTheme="outline" (click)="setExpand()"></span></li>
        <li *ngIf="!isExpand"><span nz-icon nzType="up" nzTheme="outline" (click)="setExpand()"></span></li>
      </ul>
    </div>
  </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
__decorate([
    InputBoolean()
], NzCronExpressionPreviewComponent.prototype, "visible", void 0);
export { NzCronExpressionPreviewComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", 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">
      <ng-container *ngIf="visible; else cronError">
        <ng-container *ngIf="!nzSemantic; else semanticTemplate">
          {{ TimeList[0] | date: 'YYYY-MM-dd HH:mm:ss' }}
        </ng-container>
        <ng-template #semanticTemplate [ngTemplateOutlet]="nzSemantic"></ng-template>
      </ng-container>
      <ng-template #cronError>{{ locale.cronError }}</ng-template>
    </div>
    <div *ngIf="visible" class="ant-cron-expression-preview-content">
      <div class="ant-cron-expression-preview-content-date">
        <ng-container *ngIf="!isExpand">
          <ul class="ant-cron-expression-preview-list">
            <li *ngFor="let item of TimeList">
              {{ item | date: 'YYYY-MM-dd HH:mm:ss' }}
            </li>
            <li><a (click)="loadMorePreview.emit()">···</a></li>
          </ul>
        </ng-container>
      </div>
      <ul class="ant-cron-expression-preview-icon">
        <li *ngIf="isExpand"><span nz-icon nzType="down" nzTheme="outline" (click)="setExpand()"></span></li>
        <li *ngIf="!isExpand"><span nz-icon nzType="up" nzTheme="outline" (click)="setExpand()"></span></li>
      </ul>
    </div>
  </div>`
                }]
        }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { TimeList: [{
                type: Input
            }], visible: [{
                type: Input
            }], locale: [{
                type: Input
            }], nzSemantic: [{
                type: Input
            }], loadMorePreview: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 