@c8y/ngx-components 1017.0.338 → 1017.0.345

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.
Files changed (28) hide show
  1. package/core/common/date.pipe.d.ts +2 -2
  2. package/core/common/stringify-object.pipe.d.ts +2 -1
  3. package/ecosystem/packages/deploy-application/deploy-application.component.d.ts +6 -5
  4. package/ecosystem/shared/ecosystem.constants.d.ts +2 -0
  5. package/ecosystem/shared/ecosystem.model.d.ts +3 -1
  6. package/ecosystem/shared/ecosystem.service.d.ts +11 -5
  7. package/esm2020/core/common/date.pipe.mjs +12 -7
  8. package/esm2020/core/common/stringify-object.pipe.mjs +11 -8
  9. package/esm2020/ecosystem/application-properties/application-properties.component.mjs +3 -3
  10. package/esm2020/ecosystem/applications/install-from-package/install-from-package.component.mjs +2 -2
  11. package/esm2020/ecosystem/packages/deploy-application/deploy-application.component.mjs +26 -81
  12. package/esm2020/ecosystem/shared/ecosystem.constants.mjs +5 -3
  13. package/esm2020/ecosystem/shared/ecosystem.model.mjs +3 -1
  14. package/esm2020/ecosystem/shared/ecosystem.service.mjs +121 -24
  15. package/fesm2015/c8y-ngx-components-ecosystem-shared.mjs +139 -27
  16. package/fesm2015/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
  17. package/fesm2015/c8y-ngx-components-ecosystem.mjs +23 -77
  18. package/fesm2015/c8y-ngx-components-ecosystem.mjs.map +1 -1
  19. package/fesm2015/c8y-ngx-components.mjs +20 -13
  20. package/fesm2015/c8y-ngx-components.mjs.map +1 -1
  21. package/fesm2020/c8y-ngx-components-ecosystem-shared.mjs +126 -25
  22. package/fesm2020/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
  23. package/fesm2020/c8y-ngx-components-ecosystem.mjs +23 -78
  24. package/fesm2020/c8y-ngx-components-ecosystem.mjs.map +1 -1
  25. package/fesm2020/c8y-ngx-components.mjs +20 -13
  26. package/fesm2020/c8y-ngx-components.mjs.map +1 -1
  27. package/locales/locales.pot +15 -3
  28. package/package.json +2 -2
@@ -4,7 +4,7 @@ import { merge, of, defer, combineLatest, race, isObservable, from, Subject, Beh
4
4
  import { filter, startWith, switchMap, map, distinctUntilChanged, shareReplay, scan, tap, catchError, takeUntil, debounceTime, first as first$1, concatMap, take, delay, retryWhen, combineLatest as combineLatest$1, mergeMap, every as every$1, toArray, merge as merge$1, debounce, share, expand, finalize, withLatestFrom } from 'rxjs/operators';
5
5
  import * as i1 from '@angular/router';
6
6
  import { NavigationEnd, RouterModule as RouterModule$1, PRIMARY_OUTLET, ROUTES, RouterLinkActive, ROUTER_CONFIGURATION } from '@angular/router';
7
- import { castArray, flatten, uniq, sortBy, groupBy, camelCase, isUndefined, throttle as throttle$1, keys, get, each, mapValues, mapKeys, isString, isNaN as isNaN$1, isFinite, forEach, every, first, map as map$1, assign, upperFirst, memoize as memoize$1, property, some, find as find$1, entries, omitBy, flatMap, filter as filter$1, isEqual, snakeCase, matches, reduce, union, isEmpty, orderBy, clone, omit, pick, isEqualWith, escape as escape$1, escapeRegExp, assignWith, set as set$1, findIndex, cloneDeep, uniqBy, flow, isNil, chunk, transform, identity, without, indexOf, parseInt as parseInt$1, isFunction, kebabCase, forOwn } from 'lodash-es';
7
+ import { castArray, flatten, uniq, sortBy, groupBy, camelCase, isUndefined, throttle as throttle$1, keys, get, each, mapValues, mapKeys, isString, isNaN as isNaN$1, isFinite, forEach, every, first, map as map$1, assign, upperFirst, memoize as memoize$1, property, some, find as find$1, entries, omitBy, isDate, flatMap, filter as filter$1, isEqual, snakeCase, matches, reduce, union, isEmpty, orderBy, clone, omit, pick, isEqualWith, escape as escape$1, escapeRegExp, assignWith, set as set$1, findIndex, cloneDeep, uniqBy, flow, isNil, chunk, transform, identity, without, indexOf, parseInt as parseInt$1, isFunction, kebabCase, forOwn } from 'lodash-es';
8
8
  import * as i1$a from 'ngx-bootstrap/collapse';
9
9
  import { CollapseModule } from 'ngx-bootstrap/collapse';
10
10
  import * as i1$7 from 'ngx-bootstrap/dropdown';
@@ -12,7 +12,7 @@ import { BsDropdownModule, BsDropdownDirective } from 'ngx-bootstrap/dropdown';
12
12
  import * as i2 from '@angular/cdk/scrolling';
13
13
  import { VIRTUAL_SCROLL_STRATEGY, ScrollingModule } from '@angular/cdk/scrolling';
14
14
  import * as i1$5 from '@angular/common';
15
- import { formatDate, registerLocaleData, DatePipe as DatePipe$1, DecimalPipe, CommonModule as CommonModule$1, DOCUMENT } from '@angular/common';
15
+ import { formatDate, registerLocaleData, DatePipe as DatePipe$1, DATE_PIPE_DEFAULT_TIMEZONE, DecimalPipe, CommonModule as CommonModule$1, DOCUMENT } from '@angular/common';
16
16
  import * as i1$1 from '@c8y/ngx-components/api';
17
17
  import { DataModule, InventoryService as InventoryService$1 } from '@c8y/ngx-components/api';
18
18
  import * as i1$8 from 'ngx-bootstrap/tooltip';
@@ -3477,8 +3477,8 @@ const ES_MAX_TIME_MILLISECONDS = 8640000000000000;
3477
3477
  * <span>{{ 8640000000000000 + 1 | c8yDate }}</span> <!-- e.g. after 13 Sep 275760, 03:00:00 --> ```
3478
3478
  */
3479
3479
  class DatePipe extends DatePipe$1 {
3480
- constructor(locale, translateService) {
3481
- super(locale);
3480
+ constructor(locale, translateService, defaultTimezone) {
3481
+ super(locale, defaultTimezone);
3482
3482
  this.translateService = translateService;
3483
3483
  }
3484
3484
  transform(value, format = 'medium', timezone, locale) {
@@ -3501,7 +3501,7 @@ class DatePipe extends DatePipe$1 {
3501
3501
  return result;
3502
3502
  }
3503
3503
  }
3504
- DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, deps: [{ token: LOCALE_ID }, { token: i1$3.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
3504
+ DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, deps: [{ token: LOCALE_ID }, { token: i1$3.TranslateService }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
3505
3505
  DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, name: "c8yDate" });
3506
3506
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, decorators: [{
3507
3507
  type: Pipe,
@@ -3510,7 +3510,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
3510
3510
  return [{ type: undefined, decorators: [{
3511
3511
  type: Inject,
3512
3512
  args: [LOCALE_ID]
3513
- }] }, { type: i1$3.TranslateService }];
3513
+ }] }, { type: i1$3.TranslateService }, { type: undefined, decorators: [{
3514
+ type: Inject,
3515
+ args: [DATE_PIPE_DEFAULT_TIMEZONE]
3516
+ }, {
3517
+ type: Optional
3518
+ }] }];
3514
3519
  } });
3515
3520
 
3516
3521
  /**
@@ -6624,26 +6629,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
6624
6629
  class StringifyObjectPipe {
6625
6630
  constructor(c8yDatePipe) {
6626
6631
  this.c8yDatePipe = c8yDatePipe;
6632
+ this.isoDateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(([+-](\d{2}):(\d{2})|Z)?)$/;
6627
6633
  }
6628
6634
  transform(value) {
6629
6635
  if (!value) {
6630
6636
  return '';
6631
6637
  }
6632
- if (typeof value === 'object') {
6638
+ if (typeof value === 'object' && !isDate(value)) {
6633
6639
  return JSON.stringify(value);
6634
6640
  }
6635
- if (this.checkDateValidity(value)) {
6641
+ if (this.isDate(value)) {
6636
6642
  return this.c8yDatePipe.transform(value);
6637
6643
  }
6638
6644
  return value;
6639
6645
  }
6640
- checkDateValidity(value) {
6646
+ isDate(value) {
6641
6647
  if (!value)
6642
6648
  return false;
6643
- const isNumericOrFloating = /^-?\d+(\.\d+)?$/.test(value);
6644
- const parsedDate = new Date(value);
6645
- const isValidDate = !isNaN(Number(parsedDate)) && Object.prototype.toString.call(parsedDate) === '[object Date]';
6646
- return isValidDate && !isNumericOrFloating;
6649
+ if (isDate(value))
6650
+ return !isNaN(value);
6651
+ if (typeof value === 'string')
6652
+ return this.isoDateTimeRegex.test(value);
6653
+ return false;
6647
6654
  }
6648
6655
  }
6649
6656
  StringifyObjectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: StringifyObjectPipe, deps: [{ token: DatePipe }], target: i0.ɵɵFactoryTarget.Pipe });