{"version":3,"file":"ngeenx-nx-angular-calendar-heatmap.mjs","sources":["../../../../../libs/features/nx-angular-calendar-heatmap/src/lib/components/nx-calendar-legend/nx-calendar-legend.component.ts","../../../../../libs/features/nx-angular-calendar-heatmap/src/lib/components/nx-calendar-legend/nx-calendar-legend.component.html","../../../../../libs/features/nx-angular-calendar-heatmap/src/lib/components/nx-calendar-heatmap/nx-calendar-heatmap.component.ts","../../../../../libs/features/nx-angular-calendar-heatmap/src/lib/components/nx-calendar-heatmap/nx-calendar-heatmap.component.html","../../../../../libs/features/nx-angular-calendar-heatmap/src/ngeenx-nx-angular-calendar-heatmap.ts"],"sourcesContent":["import { CommonModule } from \"@angular/common\";\r\nimport { Component, Input, OnInit, OnDestroy, OnChanges } from \"@angular/core\";\r\nimport {\r\n  ICalendarHeatmapOptions,\r\n  IHeatmapColor,\r\n  LevelsTippyUtils,\r\n} from \"@ngeenx/nx-calendar-heatmap-utils\";\r\n\r\n@Component({\r\n  selector: \"nx-heatmap-calendar-legend\",\r\n  templateUrl: \"./nx-calendar-legend.component.html\",\r\n  standalone: true,\r\n  imports: [CommonModule],\r\n})\r\nexport class NxCalendarLegendComponent implements OnInit, OnDestroy, OnChanges {\r\n  @Input() options!: ICalendarHeatmapOptions;\r\n  @Input() min = 0;\r\n  @Input() max = 100;\r\n  @Input() range = 100;\r\n  @Input() step = 20;\r\n  @Input() levels = 5;\r\n\r\n  public colors: IHeatmapColor[] = [];\r\n  private tippyUtils?: LevelsTippyUtils;\r\n\r\n  ngOnInit(): void {\r\n    this.updateLevelMap();\r\n    this.tippyUtils = new LevelsTippyUtils(this.options);\r\n    this.tippyUtils.init();\r\n  }\r\n\r\n  ngOnDestroy(): void {\r\n    this.tippyUtils?.destroy();\r\n  }\r\n\r\n  ngOnChanges() {\r\n    this.updateLevelMap();\r\n  }\r\n\r\n  private updateLevelMap(): void {\r\n    if (this.options.colors?.length) {\r\n      this.colors = this.options.colors;\r\n    } else {\r\n      this.colors = Array.from({ length: this.levels }, (_, i) => ({\r\n        min: i * this.step,\r\n        max: i * this.step,\r\n        isDefault: false,\r\n        className: `level-${i}`,\r\n      }));\r\n    }\r\n  }\r\n\r\n  getDayClass(value: number | undefined): string {\r\n    if (!this.options.colors?.length) {\r\n      if (value === 0 || value === undefined) return \"level-0\";\r\n\r\n      for (let i = 0; i < this.levels; i++) {\r\n        if (value <= this.min + this.step * (i + 1)) return `level-${i + 1}`;\r\n      }\r\n      return \"level-0\";\r\n    }\r\n\r\n    if (value !== undefined) {\r\n      for (const color of this.options.colors) {\r\n        if (color.min && color.max && value >= color.min && value <= color.max)\r\n          return color.className;\r\n      }\r\n    }\r\n\r\n    const defaultColor =\r\n      this.options.colors?.find((color: IHeatmapColor) => color.isDefault) ||\r\n      this.options.colors?.[0];\r\n    return defaultColor ? defaultColor.className : \"level-0\";\r\n  }\r\n\r\n  onMouseOver(event: MouseEvent, color: IHeatmapColor): void {\r\n    this.tippyUtils?.lazyLoadTooltip(event, color);\r\n  }\r\n}\r\n","<!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\r\n<div\r\n  class=\"heatmap-levels\"\r\n  [ngClass]=\"{\r\n    left: options.heatmapLegend?.direction === 'left',\r\n    right: options.heatmapLegend?.direction === 'right'\r\n  }\"\r\n>\r\n  <!-- Less -->\r\n  <span>{{ options.i18n?.less }}</span>\r\n\r\n  <!-- Level -->\r\n  <button\r\n    *ngFor=\"let color of colors; let i = index\"\r\n    class=\"day\"\r\n    [style.width.px]=\"(options.cellSize || 15) - 2\"\r\n    [style.height.px]=\"(options.cellSize || 15) - 2\"\r\n    [ngClass]=\"getDayClass(color.min)\"\r\n    (mouseover)=\"onMouseOver($event, color)\"\r\n  >\r\n    <!-- Level Button -->\r\n  </button>\r\n\r\n  <!-- More -->\r\n  <span>{{ options.i18n?.more }}</span>\r\n</div>\r\n","import { Component, Input, OnInit, OnDestroy, OnChanges } from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { DateTime } from \"luxon\";\r\nimport {\r\n  ICalendarHeatmapOptions,\r\n  IHeatmapDay,\r\n  HeatMapCalendarType,\r\n  IHeatmapColor,\r\n  DayTippyUtils,\r\n  HeatmapLevelsDirection,\r\n  CalendarUtils,\r\n} from \"@ngeenx/nx-calendar-heatmap-utils\";\r\nimport { NxCalendarLegendComponent } from \"../nx-calendar-legend/nx-calendar-legend.component\";\r\n\r\nconst defaultOptions: ICalendarHeatmapOptions = {\r\n  type: HeatMapCalendarType.YEARLY,\r\n  startDate: DateTime.now().startOf(\"year\"),\r\n  locale: \"en\",\r\n  tooltip: {\r\n    display: true,\r\n    unit: \"contribution\",\r\n    dateFormat: \"MMMM d\",\r\n  },\r\n  tippyProps: { placement: \"top\" },\r\n  heatmapLegend: {\r\n    display: true,\r\n    direction: HeatmapLevelsDirection.RIGHT,\r\n  },\r\n  i18n: {\r\n    on: \"on\",\r\n    less: \"less\",\r\n    more: \"more\",\r\n    noData: \"No\",\r\n    min: \"min\",\r\n    max: \"max\",\r\n  },\r\n};\r\n\r\n@Component({\r\n  imports: [CommonModule, NxCalendarLegendComponent],\r\n  selector: \"nx-heatmap-calendar\",\r\n  templateUrl: \"./nx-calendar-heatmap.component.html\",\r\n  standalone: true,\r\n})\r\nexport class NxCalendarHeatmapComponent\r\n  implements OnInit, OnDestroy, OnChanges\r\n{\r\n  @Input() options: ICalendarHeatmapOptions = {} as ICalendarHeatmapOptions;\r\n  @Input() data: IHeatmapDay[] = [];\r\n\r\n  public HeatMapCalendarType: typeof HeatMapCalendarType = HeatMapCalendarType;\r\n\r\n  levels = 5;\r\n  min = 0;\r\n  max = 0;\r\n  range = 0;\r\n  step = 0;\r\n\r\n  emptyCellStyle: any = {} as any;\r\n\r\n  mergedOptions: ICalendarHeatmapOptions = {} as ICalendarHeatmapOptions;\r\n  firstWeekOffsetDays: IHeatmapDay[] = [];\r\n  lastWeekOffsetDays: IHeatmapDay[] = [];\r\n  calendarUtils = new CalendarUtils(defaultOptions);\r\n  tippyUtils: DayTippyUtils | undefined;\r\n\r\n  ngOnInit() {\r\n    this.mergedOptions = { ...defaultOptions, ...this.options };\r\n    this.updateHeatmapData();\r\n    this.tippyUtils = new DayTippyUtils(this.mergedOptions);\r\n    this.tippyUtils.init();\r\n  }\r\n\r\n  ngOnChanges() {\r\n    this.mergedOptions = { ...defaultOptions, ...this.options };\r\n\r\n    this.updateHeatmapData();\r\n  }\r\n\r\n  ngOnDestroy() {\r\n    this.tippyUtils?.destroy();\r\n  }\r\n\r\n  updateHeatmapData() {\r\n    this.calendarUtils = new CalendarUtils(this.mergedOptions);\r\n\r\n    if (this.mergedOptions.i18n) {\r\n      this.mergedOptions.i18n.months =\r\n        this.calendarUtils.getLocalizedMonthNames(this.mergedOptions.locale);\r\n      this.mergedOptions.i18n.weekdays =\r\n        this.calendarUtils.getLocalizedWeekdayNames(this.mergedOptions.locale);\r\n    }\r\n\r\n    this.emptyCellStyle = {\r\n      height: `${this.mergedOptions.cellSize || 15}px`,\r\n      width: `${this.mergedOptions.cellSize || 15}px`,\r\n      ...this.mergedOptions.overWritedDayStyle,\r\n    };\r\n\r\n    this.levels = this.mergedOptions.colors?.length || 5;\r\n    this.range = 100;\r\n    this.step = this.range / this.levels;\r\n\r\n    const { type, startDate } = this.mergedOptions;\r\n    let endDate;\r\n\r\n    switch (type) {\r\n      case HeatMapCalendarType.WEEKLY:\r\n        endDate = startDate.plus({ days: 6 });\r\n        break;\r\n      case HeatMapCalendarType.MONTHLY:\r\n        endDate = startDate.endOf(\"month\");\r\n        break;\r\n      case HeatMapCalendarType.YEARLY:\r\n        endDate = startDate.endOf(\"year\");\r\n        break;\r\n    }\r\n\r\n    if (type !== HeatMapCalendarType.WEEKLY) {\r\n      this.firstWeekOffsetDays =\r\n        this.calendarUtils.calculateFirstWeekOffset(startDate);\r\n      this.lastWeekOffsetDays =\r\n        this.calendarUtils.calculateLastWeekOffset(endDate);\r\n    }\r\n  }\r\n\r\n  getGridPosition(index: number): object {\r\n    return this.calendarUtils.getGridPositionOfDay(\r\n      index,\r\n      this.firstWeekOffsetDays.length\r\n    );\r\n  }\r\n\r\n  getDayClass(value: number | undefined): string {\r\n    const baseClasses = `${this.mergedOptions.onClick ? \"clickable\" : \"\"}`;\r\n\r\n    if (!this.mergedOptions.colors?.length) {\r\n      if (value === 0 || value === undefined) return `${baseClasses} level-0`;\r\n\r\n      for (let i = 0; i < this.levels; i++) {\r\n        if (value <= this.min + this.step * (i + 1))\r\n          return `${baseClasses} level-${i + 1}`;\r\n      }\r\n      return `${baseClasses} level-0`;\r\n    }\r\n\r\n    if (value !== undefined) {\r\n      for (const color of this.mergedOptions.colors) {\r\n        if (color.min && color.max && value >= color.min && value <= color.max)\r\n          return color.className;\r\n      }\r\n    }\r\n\r\n    const defaultColor =\r\n      this.mergedOptions.colors?.find(\r\n        (color: IHeatmapColor) => color.isDefault\r\n      ) || this.mergedOptions.colors?.[0];\r\n    return defaultColor ? defaultColor.className : `${baseClasses} level-0`;\r\n  }\r\n\r\n  getEmptyDayClass(): string {\r\n    const defaultColor = this.mergedOptions.colors?.find(\r\n      (color) => color.isDefault\r\n    ) || { className: \"level-0\" };\r\n    return defaultColor.className;\r\n  }\r\n\r\n  onDayClick(day: IHeatmapDay) {\r\n    if (this.mergedOptions.onClick) this.mergedOptions.onClick(day);\r\n  }\r\n\r\n  onDayMouseOver(event: MouseEvent, day: IHeatmapDay) {\r\n    this.tippyUtils?.lazyLoadTooltip(event, day);\r\n  }\r\n}\r\n","<!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\r\n<!-- Calendar Container -->\r\n<div class=\"nx-calendar-heatmap\">\r\n  <!-- Body -->\r\n  <div class=\"body\">\r\n    <div class=\"weekdays-container\">\r\n      <!-- Weekdays -->\r\n      <div\r\n        *ngIf=\"mergedOptions.type !== HeatMapCalendarType.WEEKLY\"\r\n        class=\"weekdays\"\r\n      >\r\n        <span *ngFor=\"let weekday of mergedOptions.i18n?.weekdays\">\r\n          {{ weekday }}\r\n        </span>\r\n      </div>\r\n\r\n      <!-- Months -->\r\n      <div class=\"months-container\">\r\n        <!-- Yearly -->\r\n        <div\r\n          *ngIf=\"mergedOptions.type === HeatMapCalendarType.YEARLY\"\r\n          class=\"months\"\r\n        >\r\n          <span *ngFor=\"let month of mergedOptions.i18n?.months\">{{\r\n            month\r\n          }}</span>\r\n        </div>\r\n\r\n        <!-- Monthly -->\r\n        <div\r\n          *ngIf=\"mergedOptions.type === HeatMapCalendarType.MONTHLY\"\r\n          class=\"months\"\r\n        >\r\n          <span class=\"centered\">\r\n            {{\r\n              calendarUtils.getLocalizedMonthName(\r\n                mergedOptions.startDate,\r\n                mergedOptions.locale\r\n              )\r\n            }}\r\n          </span>\r\n        </div>\r\n\r\n        <!-- Calendar Grid -->\r\n        <div\r\n          class=\"heatmap-grid\"\r\n          [ngClass]=\"{\r\n            monthly: mergedOptions.type === HeatMapCalendarType.MONTHLY\r\n          }\"\r\n        >\r\n          <!-- First Week Empty Days -->\r\n          <ng-container *ngIf=\"!mergedOptions.hideEmptyDays\">\r\n            <button\r\n              *ngFor=\"let day of firstWeekOffsetDays\"\r\n              class=\"day\"\r\n              [ngClass]=\"getEmptyDayClass()\"\r\n              [ngStyle]=\"emptyCellStyle\"\r\n              (mouseover)=\"onDayMouseOver($event, day)\"\r\n            >\r\n              <!-- Empty Day Button -->\r\n            </button>\r\n          </ng-container>\r\n\r\n          <!-- Available Days -->\r\n          <button\r\n            *ngFor=\"let day of data; let i = index\"\r\n            class=\"day\"\r\n            [ngClass]=\"getDayClass(day.count)\"\r\n            [ngStyle]=\"getGridPosition(i)\"\r\n            (click)=\"onDayClick(day)\"\r\n            (mouseover)=\"onDayMouseOver($event, day)\"\r\n          >\r\n            <!-- Day Button -->\r\n          </button>\r\n\r\n          <!-- Last Week Empty Days -->\r\n          <ng-container *ngIf=\"!mergedOptions.hideEmptyDays\">\r\n            <button\r\n              *ngFor=\"let day of lastWeekOffsetDays\"\r\n              class=\"day\"\r\n              [ngClass]=\"getEmptyDayClass()\"\r\n              [ngStyle]=\"emptyCellStyle\"\r\n              (mouseover)=\"onDayMouseOver($event, day)\"\r\n            >\r\n              <!-- Empty Day Button -->\r\n            </button>\r\n          </ng-container>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n\r\n  <!-- Footer -->\r\n  <div *ngIf=\"mergedOptions.heatmapLegend?.display\" class=\"footer\">\r\n    <div class=\"footer-content\">\r\n      <ng-content select=\"[footerContent]\"></ng-content>\r\n    </div>\r\n\r\n    <div class=\"legend\">\r\n      <nx-heatmap-calendar-legend\r\n        [options]=\"mergedOptions\"\r\n        [min]=\"min\"\r\n        [max]=\"max\"\r\n        [range]=\"range\"\r\n        [step]=\"step\"\r\n        [levels]=\"levels\"\r\n      ></nx-heatmap-calendar-legend>\r\n    </div>\r\n  </div>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,yBAAyB,CAAA;AAC3B,IAAA,OAAO,CAA2B;IAClC,GAAG,GAAG,CAAC,CAAC;IACR,GAAG,GAAG,GAAG,CAAC;IACV,KAAK,GAAG,GAAG,CAAC;IACZ,IAAI,GAAG,EAAE,CAAC;IACV,MAAM,GAAG,CAAC,CAAC;IAEb,MAAM,GAAoB,EAAE,CAAC;AAC5B,IAAA,UAAU,CAAoB;IAEtC,QAAQ,GAAA;QACN,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACrD,QAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;KACxB;IAED,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC;KAC5B;IAED,WAAW,GAAA;QACT,IAAI,CAAC,cAAc,EAAE,CAAC;KACvB;IAEO,cAAc,GAAA;QACpB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE;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