import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { Pipe, Injectable, Input, Component } from '@angular/core';
import { SdBadge } from '@sdcorejs/angular/components/badge';
import { DateUtilities } from '@sdcorejs/angular/utilities';
import { EMPTY_STR } from '@sdcorejs/utils/constants';
import { TranslatePipe } from '@sdcorejs/angular/i18n';

class ViewDateTimePipe {
    transform(value) {
        if (!value || !DateUtilities.isDate(value)) {
            return EMPTY_STR;
        }
        return DateUtilities.toFormat(value, 'HH:mm dd/MM/yyyy');
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ViewDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
    static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.17", ngImport: i0, type: ViewDateTimePipe, isStandalone: true, name: "viewDateTime" });
    static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ViewDateTimePipe, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ViewDateTimePipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'viewDateTime',
                    standalone: true,
                }]
        }, {
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }] });

class SdHistoryItem {
    items = [];
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdHistoryItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdHistoryItem, isStandalone: true, selector: "sd-history", inputs: { items: "items" }, ngImport: i0, template: "<div class=\"sd-history\">\n  <div class=\"history-container\">\n    <div class=\"history-line\"></div>\n    <div *ngFor=\"let item of items; let i = index\" class=\"history-item\">\n      <div class=\"dot\"></div>\n      <div class=\"card\">\n        <div class=\"header\">\n          <div class=\"title-wrapper\">\n            <span class=\"title\">{{ item.title }}</span>\n            <span class=\"status\">\n                @if (item?.status) {\n                  <sd-badge\n                  [icon]=\"item.status?.icon\"\n                  [title]=\"item.status?.title\"\n                  [color]=\"item.status?.color\"></sd-badge>\n                }\n            </span>\n          </div>\n            <span class=\"date\">{{ item?.date | viewDateTime }}</span>\n        </div>\n        <div class=\"meta\">\n          @if (item?.actor) {\n            <span>{{ 'core.component.history.by' | translate }} <strong>&#64;{{ item.actor }}</strong></span>\n          }\n          @if (item?.source) {\n            <span> &#183; {{ item.source }}</span>\n          }\n        </div>\n        <div class=\"description\">\n          {{ item?.description }}\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n", styles: [".sd-history{padding:16px}.history-container{position:relative;padding-left:20px;font-size:14px;line-height:20px;min-width:470px;max-width:100%}.history-line{position:absolute;left:8px;top:0;bottom:0;width:2px;background-color:#94b0ff}.history-item{position:relative;margin-bottom:16px;padding-left:10px}.history-item .dot{position:absolute;left:-16px;top:12px;width:12px;height:12px;background-color:#94b0ff;border-radius:50%}.history-item .card{background:#fff;border-radius:6px;box-shadow:0 2px 4px #0000001a;padding:8px 8px 8px 16px}.history-item .card .header{display:flex;justify-content:space-between;align-items:center}.history-item .card .header .title-wrapper{display:flex;align-items:flex-start;padding-right:8px}.history-item .card .header .title{margin-right:8px;color:#757575}.history-item .card .header .status{display:flex;align-items:center}.history-item .card .header .status mat-icon{margin-right:4px}.history-item .card .header .date{color:#757575;font-size:12px;line-height:16px}.history-item .card .meta{color:#757575}.history-item .card .meta strong{color:#000}.history-item .card .meta{margin-top:4px}.history-item .card .description{margin-top:4px;color:#000;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SdBadge, selector: "sd-badge", inputs: ["type", "color", "primary", "secondary", "success", "info", "warning", "error", "fontSet", "title", "description", "tooltip", "icon", "size"], outputs: ["click"] }, { kind: "pipe", type: ViewDateTimePipe, name: "viewDateTime" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdHistoryItem, decorators: [{
            type: Component,
            args: [{ selector: 'sd-history', imports: [CommonModule, SdBadge, ViewDateTimePipe, TranslatePipe], template: "<div class=\"sd-history\">\n  <div class=\"history-container\">\n    <div class=\"history-line\"></div>\n    <div *ngFor=\"let item of items; let i = index\" class=\"history-item\">\n      <div class=\"dot\"></div>\n      <div class=\"card\">\n        <div class=\"header\">\n          <div class=\"title-wrapper\">\n            <span class=\"title\">{{ item.title }}</span>\n            <span class=\"status\">\n                @if (item?.status) {\n                  <sd-badge\n                  [icon]=\"item.status?.icon\"\n                  [title]=\"item.status?.title\"\n                  [color]=\"item.status?.color\"></sd-badge>\n                }\n            </span>\n          </div>\n            <span class=\"date\">{{ item?.date | viewDateTime }}</span>\n        </div>\n        <div class=\"meta\">\n          @if (item?.actor) {\n            <span>{{ 'core.component.history.by' | translate }} <strong>&#64;{{ item.actor }}</strong></span>\n          }\n          @if (item?.source) {\n            <span> &#183; {{ item.source }}</span>\n          }\n        </div>\n        <div class=\"description\">\n          {{ item?.description }}\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n", styles: [".sd-history{padding:16px}.history-container{position:relative;padding-left:20px;font-size:14px;line-height:20px;min-width:470px;max-width:100%}.history-line{position:absolute;left:8px;top:0;bottom:0;width:2px;background-color:#94b0ff}.history-item{position:relative;margin-bottom:16px;padding-left:10px}.history-item .dot{position:absolute;left:-16px;top:12px;width:12px;height:12px;background-color:#94b0ff;border-radius:50%}.history-item .card{background:#fff;border-radius:6px;box-shadow:0 2px 4px #0000001a;padding:8px 8px 8px 16px}.history-item .card .header{display:flex;justify-content:space-between;align-items:center}.history-item .card .header .title-wrapper{display:flex;align-items:flex-start;padding-right:8px}.history-item .card .header .title{margin-right:8px;color:#757575}.history-item .card .header .status{display:flex;align-items:center}.history-item .card .header .status mat-icon{margin-right:4px}.history-item .card .header .date{color:#757575;font-size:12px;line-height:16px}.history-item .card .meta{color:#757575}.history-item .card .meta strong{color:#000}.history-item .card .meta{margin-top:4px}.history-item .card .description{margin-top:4px;color:#000;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"] }]
        }], propDecorators: { items: [{
                type: Input
            }] } });

/**
 * Generated bundle index. Do not edit.
 */

export { SdHistoryItem };
//# sourceMappingURL=sdcorejs-angular-components-history.mjs.map
