@c8y/ngx-components 1017.0.336 → 1017.0.343

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 * as i1 from '@angular/router';
4
4
  import { NavigationEnd, RouterModule as RouterModule$1, PRIMARY_OUTLET, ROUTES, RouterLinkActive, ROUTER_CONFIGURATION } from '@angular/router';
5
5
  import { merge, of, defer, combineLatest, race, isObservable, from, Subject, BehaviorSubject, NEVER, fromEvent, pipe, concat, Observable, throwError, timer, EMPTY, fromEventPattern, empty, ReplaySubject, forkJoin } from 'rxjs';
6
6
  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, withLatestFrom, finalize } from 'rxjs/operators';
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, transform, identity, flow, isNil, chunk, 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, transform, identity, flow, isNil, chunk, 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';
@@ -3450,8 +3450,8 @@ const ES_MAX_TIME_MILLISECONDS = 8640000000000000;
3450
3450
  * <span>{{ 8640000000000000 + 1 | c8yDate }}</span> <!-- e.g. after 13 Sep 275760, 03:00:00 --> ```
3451
3451
  */
3452
3452
  class DatePipe extends DatePipe$1 {
3453
- constructor(locale, translateService) {
3454
- super(locale);
3453
+ constructor(locale, translateService, defaultTimezone) {
3454
+ super(locale, defaultTimezone);
3455
3455
  this.translateService = translateService;
3456
3456
  }
3457
3457
  transform(value, format = 'medium', timezone, locale) {
@@ -3474,7 +3474,7 @@ class DatePipe extends DatePipe$1 {
3474
3474
  return result;
3475
3475
  }
3476
3476
  }
3477
- 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 });
3477
+ 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 });
3478
3478
  DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, name: "c8yDate" });
3479
3479
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DatePipe, decorators: [{
3480
3480
  type: Pipe,
@@ -3482,7 +3482,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
3482
3482
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
3483
3483
  type: Inject,
3484
3484
  args: [LOCALE_ID]
3485
- }] }, { type: i1$3.TranslateService }]; } });
3485
+ }] }, { type: i1$3.TranslateService }, { type: undefined, decorators: [{
3486
+ type: Inject,
3487
+ args: [DATE_PIPE_DEFAULT_TIMEZONE]
3488
+ }, {
3489
+ type: Optional
3490
+ }] }]; } });
3486
3491
 
3487
3492
  /**
3488
3493
  * A directive to determine if a dropdown should open to the top or as usual to the bottom.
@@ -6642,26 +6647,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
6642
6647
  class StringifyObjectPipe {
6643
6648
  constructor(c8yDatePipe) {
6644
6649
  this.c8yDatePipe = c8yDatePipe;
6650
+ this.isoDateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(([+-](\d{2}):(\d{2})|Z)?)$/;
6645
6651
  }
6646
6652
  transform(value) {
6647
6653
  if (!value) {
6648
6654
  return '';
6649
6655
  }
6650
- if (typeof value === 'object') {
6656
+ if (typeof value === 'object' && !isDate(value)) {
6651
6657
  return JSON.stringify(value);
6652
6658
  }
6653
- if (this.checkDateValidity(value)) {
6659
+ if (this.isDate(value)) {
6654
6660
  return this.c8yDatePipe.transform(value);
6655
6661
  }
6656
6662
  return value;
6657
6663
  }
6658
- checkDateValidity(value) {
6664
+ isDate(value) {
6659
6665
  if (!value)
6660
6666
  return false;
6661
- const isNumericOrFloating = /^-?\d+(\.\d+)?$/.test(value);
6662
- const parsedDate = new Date(value);
6663
- const isValidDate = !isNaN(Number(parsedDate)) && Object.prototype.toString.call(parsedDate) === '[object Date]';
6664
- return isValidDate && !isNumericOrFloating;
6667
+ if (isDate(value))
6668
+ return !isNaN(value);
6669
+ if (typeof value === 'string')
6670
+ return this.isoDateTimeRegex.test(value);
6671
+ return false;
6665
6672
  }
6666
6673
  }
6667
6674
  StringifyObjectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: StringifyObjectPipe, deps: [{ token: DatePipe }], target: i0.ɵɵFactoryTarget.Pipe });