@leanix/components 0.4.742 → 0.4.744

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ import { CdkStepper, CdkStepperModule } from '@angular/cdk/stepper';
16
16
  import * as i1$1 from '@angular/cdk/bidi';
17
17
  import { registerIcon } from '@ui5/webcomponents-base/dist/asset-registries/Icons.js';
18
18
  import Color from 'color';
19
- import { format, distanceInWords, startOfDay } from 'date-fns';
19
+ import { isValid, format, formatDistance, startOfDay } from 'date-fns';
20
20
  import DOMPurify from 'dompurify';
21
21
  import { isArray, isEqual, split, uniqueId, pick, intersection, isNil, curry } from 'lodash-es';
22
22
  import { Renderer, marked } from 'marked';
@@ -73,9 +73,9 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
73
73
  const DATE_FORMATS = new InjectionToken('DATE_FORMATS', {
74
74
  providedIn: 'root',
75
75
  factory: () => ({
76
- getDateFormat: () => 'YYYY-MM-DD',
77
- getDateTimeFormat: () => 'YYYY-MM-DD HH:mm',
78
- getDateTimeFormatWithSeconds: () => 'YYYY-MM-DD HH:mm:ss'
76
+ getDateFormat: () => 'yyyy-MM-dd',
77
+ getDateTimeFormat: () => 'yyyy-MM-dd HH:mm',
78
+ getDateTimeFormatWithSeconds: () => 'yyyy-MM-dd HH:mm:ss'
79
79
  })
80
80
  });
81
81
  const DATE_FN_LOCALE = new InjectionToken('DATE_FN_LOCALE');
@@ -1902,8 +1902,15 @@ class CustomDatePipe {
1902
1902
  this.getDateFnLocale = getDateFnLocale;
1903
1903
  }
1904
1904
  transform(value, f) {
1905
+ if (!value) {
1906
+ return '';
1907
+ }
1908
+ const date = value instanceof Date ? value : new Date(value);
1909
+ if (!isValid(date)) {
1910
+ return '';
1911
+ }
1905
1912
  const locale = this.getDateFnLocale ? this.getDateFnLocale() : null;
1906
- return value ? format(value, f, { locale }) : '';
1913
+ return format(date, f, { locale });
1907
1914
  }
1908
1915
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomDatePipe, deps: [{ token: DATE_FN_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
1909
1916
  static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: CustomDatePipe, isStandalone: true, name: "lxDate" }); }
@@ -2024,8 +2031,15 @@ class LxTimeAgo {
2024
2031
  this.getDateFnLocale = inject(DATE_FN_LOCALE, { optional: true });
2025
2032
  }
2026
2033
  transform(input) {
2034
+ if (!input) {
2035
+ return '';
2036
+ }
2037
+ const date = typeof input === 'string' ? new Date(input) : input;
2038
+ if (!isValid(date)) {
2039
+ return '';
2040
+ }
2027
2041
  const locale = this.getDateFnLocale ? this.getDateFnLocale() : null;
2028
- return distanceInWords(new Date(), input, { locale, addSuffix: true });
2042
+ return formatDistance(date, new Date(), { locale, addSuffix: true });
2029
2043
  }
2030
2044
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LxTimeAgo, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2031
2045
  static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: LxTimeAgo, isStandalone: true, name: "lxTimeAgo" }); }
@@ -4575,6 +4589,9 @@ function isValidDateString(dateString) {
4575
4589
  /* format method is monkey-patched in date-input component, leaving this implementation as dummy */
4576
4590
  class DateFormatter {
4577
4591
  format(date, format$1, locale) {
4592
+ if (!locale || typeof locale === 'string') {
4593
+ return format(date, format$1);
4594
+ }
4578
4595
  return format(date, format$1, { locale });
4579
4596
  }
4580
4597
  }
@@ -5516,12 +5533,12 @@ class DatepickerConfig {
5516
5533
  this.minMode = 'day';
5517
5534
  this.maxMode = 'year';
5518
5535
  this.showWeeks = true;
5519
- this.formatDay = 'DD';
5536
+ this.formatDay = 'dd';
5520
5537
  this.formatMonth = 'MMMM';
5521
- this.formatYear = 'YYYY';
5538
+ this.formatYear = 'yyyy';
5522
5539
  this.formatDayHeader = 'dd';
5523
- this.formatDayTitle = 'MMMM YYYY';
5524
- this.formatMonthTitle = 'YYYY';
5540
+ this.formatDayTitle = 'MMMM yyyy';
5541
+ this.formatMonthTitle = 'yyyy';
5525
5542
  this.onlyCurrentMonth = false;
5526
5543
  this.monthColLimit = 3;
5527
5544
  this.yearColLimit = 5;
@@ -5768,17 +5785,17 @@ class DateInputComponent {
5768
5785
  /** If false week numbers will be hidden */
5769
5786
  this.showWeeks = true;
5770
5787
  /** Format of day in month */
5771
- this.formatDay = 'DD';
5788
+ this.formatDay = 'dd';
5772
5789
  /** Format of month in year */
5773
5790
  this.formatMonth = 'MMMM';
5774
5791
  /** Format of year in year range */
5775
- this.formatYear = 'YYYY';
5792
+ this.formatYear = 'yyyy';
5776
5793
  /** Format of day in week header */
5777
5794
  this.formatDayHeader = 'dd';
5778
5795
  /** Format of title when selecting day */
5779
- this.formatDayTitle = 'MMMM YYYY';
5796
+ this.formatDayTitle = 'MMMM yyyy';
5780
5797
  /** Format of title when selecting month */
5781
- this.formatMonthTitle = 'YYYY';
5798
+ this.formatMonthTitle = 'yyyy';
5782
5799
  /** Starting day of the week from 0-6 (0=Sunday, ..., 6=Saturday) public */
5783
5800
  this.startingDay = 0;
5784
5801
  /** Number of years displayed in year selection */