@c8y/ngx-components 1018.0.147 → 1018.0.151

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 (30) 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/application-properties/update-application-modal/update-application-modal.component.d.ts +0 -2
  4. package/ecosystem/packages/deploy-application/deploy-application.component.d.ts +7 -6
  5. package/ecosystem/shared/ecosystem.constants.d.ts +3 -1
  6. package/ecosystem/shared/ecosystem.model.d.ts +3 -1
  7. package/ecosystem/shared/ecosystem.service.d.ts +11 -5
  8. package/esm2020/core/common/date.pipe.mjs +12 -7
  9. package/esm2020/core/common/stringify-object.pipe.mjs +11 -8
  10. package/esm2020/ecosystem/application-properties/application-properties.component.mjs +6 -4
  11. package/esm2020/ecosystem/application-properties/update-application-modal/update-application-modal.component.mjs +11 -22
  12. package/esm2020/ecosystem/applications/install-from-package/install-from-package.component.mjs +2 -2
  13. package/esm2020/ecosystem/packages/deploy-application/deploy-application.component.mjs +28 -85
  14. package/esm2020/ecosystem/shared/ecosystem.constants.mjs +5 -3
  15. package/esm2020/ecosystem/shared/ecosystem.model.mjs +3 -1
  16. package/esm2020/ecosystem/shared/ecosystem.service.mjs +121 -24
  17. package/fesm2015/c8y-ngx-components-ecosystem-shared.mjs +139 -27
  18. package/fesm2015/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
  19. package/fesm2015/c8y-ngx-components-ecosystem.mjs +110 -179
  20. package/fesm2015/c8y-ngx-components-ecosystem.mjs.map +1 -1
  21. package/fesm2015/c8y-ngx-components.mjs +20 -13
  22. package/fesm2015/c8y-ngx-components.mjs.map +1 -1
  23. package/fesm2020/c8y-ngx-components-ecosystem-shared.mjs +126 -25
  24. package/fesm2020/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
  25. package/fesm2020/c8y-ngx-components-ecosystem.mjs +110 -176
  26. package/fesm2020/c8y-ngx-components-ecosystem.mjs.map +1 -1
  27. package/fesm2020/c8y-ngx-components.mjs +20 -13
  28. package/fesm2020/c8y-ngx-components.mjs.map +1 -1
  29. package/locales/locales.pot +15 -3
  30. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe, Injectable, InjectFlags, InjectionToken, Optional, Inject, isDevMode, EventEmitter, Directive, NgModule, LOCALE_ID, HostListener, Input, Component, Output, HostBinding, forwardRef, TemplateRef, SecurityContext, APP_INITIALIZER, Self, SkipSelf, NgModuleRef, createNgModuleRef, ViewChild, ContentChild, Attribute, ViewContainerRef, ContentChildren, ElementRef, Host, ViewChildren, Injector, importProvidersFrom, ChangeDetectionStrategy, SimpleChange, Type } from '@angular/core';
3
- import { isNaN as isNaN$1, isFinite, castArray, flatten, uniq, sortBy, groupBy, camelCase, isUndefined, throttle as throttle$1, keys, get, each, mapValues, mapKeys, isString, forEach, assign, find, negate, upperFirst, memoize as memoize$1, property, some, entries, omitBy, min, every, first as first$1, map as map$1, orderBy, flatMap, isEmpty, reduce, union, filter as filter$1, isEqual, snakeCase, matches, cloneDeep, uniqBy, clone, toNumber, isEqualWith, escape as escape$1, escapeRegExp, assignWith, set, findIndex, omit, pick, flow, isNil, chunk, transform, identity, without, indexOf, parseInt as parseInt$1, kebabCase, forOwn } from 'lodash-es';
3
+ import { isNaN as isNaN$1, isFinite, castArray, flatten, uniq, sortBy, groupBy, camelCase, isUndefined, throttle as throttle$1, keys, get, each, mapValues, mapKeys, isString, forEach, assign, find, negate, upperFirst, memoize as memoize$1, property, some, entries, omitBy, min, every, first as first$1, map as map$1, isDate, orderBy, flatMap, isEmpty, reduce, union, filter as filter$1, isEqual, snakeCase, matches, cloneDeep, uniqBy, clone, toNumber, isEqualWith, escape as escape$1, escapeRegExp, assignWith, set, findIndex, omit, pick, flow, isNil, chunk, transform, identity, without, indexOf, parseInt as parseInt$1, kebabCase, forOwn } from 'lodash-es';
4
4
  import { merge, of, defer, combineLatest, race, isObservable, from, Subject, BehaviorSubject, fromEvent, pipe, NEVER, concat, throwError, Observable, EMPTY, timer, fromEventPattern, empty, forkJoin, ReplaySubject } from 'rxjs';
5
5
  import { map, distinctUntilChanged, filter, startWith, switchMap, scan, take, shareReplay, debounceTime, tap, catchError, takeUntil, mergeMap, first, share, retryWhen, delay, concatMap, debounce, sample, withLatestFrom, every as every$1, toArray, merge as merge$1, expand, finalize } from 'rxjs/operators';
6
6
  import { __awaiter, __decorate, __metadata } from 'tslib';
7
7
  import * as i2 from '@angular/cdk/scrolling';
8
8
  import { VIRTUAL_SCROLL_STRATEGY, ScrollingModule } from '@angular/cdk/scrolling';
9
9
  import * as i3 from '@angular/common';
10
- import { formatDate, registerLocaleData, DatePipe as DatePipe$1, DecimalPipe, CommonModule as CommonModule$1, DOCUMENT } from '@angular/common';
10
+ import { formatDate, registerLocaleData, DatePipe as DatePipe$1, DATE_PIPE_DEFAULT_TIMEZONE, DecimalPipe, CommonModule as CommonModule$1, DOCUMENT } from '@angular/common';
11
11
  import * as i1 from '@c8y/ngx-components/api';
12
12
  import { DataModule, InventoryService as InventoryService$1 } from '@c8y/ngx-components/api';
13
13
  import * as i1$7 from 'ngx-bootstrap/tooltip';
@@ -3406,8 +3406,8 @@ const ES_MAX_TIME_MILLISECONDS = 8640000000000000;
3406
3406
  * <span>{{ 8640000000000000 + 1 | c8yDate }}</span> <!-- e.g. after 13 Sep 275760, 03:00:00 --> ```
3407
3407
  */
3408
3408
  class DatePipe extends DatePipe$1 {
3409
- constructor(locale, translateService) {
3410
- super(locale);
3409
+ constructor(locale, translateService, defaultTimezone) {
3410
+ super(locale, defaultTimezone);
3411
3411
  this.translateService = translateService;
3412
3412
  }
3413
3413
  transform(value, format = 'medium', timezone, locale) {
@@ -3430,7 +3430,7 @@ class DatePipe extends DatePipe$1 {
3430
3430
  return result;
3431
3431
  }
3432
3432
  }
3433
- DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, deps: [{ token: LOCALE_ID }, { token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
3433
+ DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, deps: [{ token: LOCALE_ID }, { token: i1$2.TranslateService }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
3434
3434
  DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, name: "c8yDate" });
3435
3435
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, decorators: [{
3436
3436
  type: Pipe,
@@ -3439,7 +3439,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
3439
3439
  return [{ type: undefined, decorators: [{
3440
3440
  type: Inject,
3441
3441
  args: [LOCALE_ID]
3442
- }] }, { type: i1$2.TranslateService }];
3442
+ }] }, { type: i1$2.TranslateService }, { type: undefined, decorators: [{
3443
+ type: Inject,
3444
+ args: [DATE_PIPE_DEFAULT_TIMEZONE]
3445
+ }, {
3446
+ type: Optional
3447
+ }] }];
3443
3448
  } });
3444
3449
 
3445
3450
  /**
@@ -6445,26 +6450,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
6445
6450
  class StringifyObjectPipe {
6446
6451
  constructor(c8yDatePipe) {
6447
6452
  this.c8yDatePipe = c8yDatePipe;
6453
+ this.isoDateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(([+-](\d{2}):(\d{2})|Z)?)$/;
6448
6454
  }
6449
6455
  transform(value) {
6450
6456
  if (!value) {
6451
6457
  return '';
6452
6458
  }
6453
- if (typeof value === 'object') {
6459
+ if (typeof value === 'object' && !isDate(value)) {
6454
6460
  return JSON.stringify(value);
6455
6461
  }
6456
- if (this.checkDateValidity(value)) {
6462
+ if (this.isDate(value)) {
6457
6463
  return this.c8yDatePipe.transform(value);
6458
6464
  }
6459
6465
  return value;
6460
6466
  }
6461
- checkDateValidity(value) {
6467
+ isDate(value) {
6462
6468
  if (!value)
6463
6469
  return false;
6464
- const isNumericOrFloating = /^-?\d+(\.\d+)?$/.test(value);
6465
- const parsedDate = new Date(value);
6466
- const isValidDate = !isNaN(Number(parsedDate)) && Object.prototype.toString.call(parsedDate) === '[object Date]';
6467
- return isValidDate && !isNumericOrFloating;
6470
+ if (isDate(value))
6471
+ return !isNaN(value);
6472
+ if (typeof value === 'string')
6473
+ return this.isoDateTimeRegex.test(value);
6474
+ return false;
6468
6475
  }
6469
6476
  }
6470
6477
  StringifyObjectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: StringifyObjectPipe, deps: [{ token: DatePipe }], target: i0.ɵɵFactoryTarget.Pipe });