@veloceapps/sdk 8.0.0-87 → 8.0.0-89

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, NgModule, inject, Directive, Input, LOCALE_ID, Pipe } from '@angular/core';
3
- import { UUID, ConfigurationContextMode, ConfigurationContext, ChargeGroupUtils, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, EntityUtil, formatNumber } from '@veloceapps/core';
3
+ import { UUID, ConfigurationContextMode, ConfigurationContext, ChargeGroupUtils, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, EntityUtil, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
4
4
  import { BehaviorSubject, zip, noop, combineLatest, map as map$2, tap as tap$1, throwError, shareReplay as shareReplay$1, of, switchMap as switchMap$1, catchError as catchError$1, Subject, take as take$1, distinctUntilChanged } from 'rxjs';
5
5
  import { map, filter, tap, switchMap, skip, take, shareReplay, catchError, finalize, first } from 'rxjs/operators';
6
6
  import * as i1 from '@veloceapps/api';
@@ -1606,11 +1606,6 @@ class SdkCoreModule {
1606
1606
  SdkCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1607
1607
  SdkCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, imports: [ConfigurationModule, FlowConfigurationModule] });
1608
1608
  SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkCoreModule, providers: [
1609
- ContextService,
1610
- QuoteDraftService,
1611
- ProductImagesService,
1612
- MetricsCalculationService,
1613
- RuntimeSettingsService,
1614
1609
  {
1615
1610
  provide: FORMATTING_SETTINGS_TOKEN,
1616
1611
  useExisting: RuntimeSettingsService,
@@ -1621,11 +1616,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1621
1616
  args: [{
1622
1617
  imports: [ConfigurationModule, FlowConfigurationModule],
1623
1618
  providers: [
1624
- ContextService,
1625
- QuoteDraftService,
1626
- ProductImagesService,
1627
- MetricsCalculationService,
1628
- RuntimeSettingsService,
1629
1619
  {
1630
1620
  provide: FORMATTING_SETTINGS_TOKEN,
1631
1621
  useExisting: RuntimeSettingsService,
@@ -1695,13 +1685,19 @@ class DatePipe {
1695
1685
  this.destroy$.next();
1696
1686
  this.destroy$.complete();
1697
1687
  }
1698
- transform(date) {
1688
+ transform(date, type = 'date') {
1699
1689
  var _a, _b;
1700
1690
  if (!date) {
1701
1691
  return '';
1702
1692
  }
1693
+ const dateFormat = ((_a = this.formattingSettings) === null || _a === void 0 ? void 0 : _a.dateFormats.datePipeFormat) || DEFAULT_DATE_FORMAT;
1694
+ const formatMap = {
1695
+ date: dateFormat,
1696
+ time: DEFAULT_TIME_FORMAT,
1697
+ datetime: `${dateFormat} ${DEFAULT_TIME_FORMAT}`,
1698
+ };
1703
1699
  try {
1704
- return formatDate(date, ((_a = this.formattingSettings) === null || _a === void 0 ? void 0 : _a.dateFormats.datePipeFormat) || DEFAULT_DATE_FORMAT, this.locale, (_b = this.defaultOptions) === null || _b === void 0 ? void 0 : _b.timezone);
1700
+ return formatDate(date, formatMap[type], this.locale, (_b = this.defaultOptions) === null || _b === void 0 ? void 0 : _b.timezone);
1705
1701
  }
1706
1702
  catch (error) {
1707
1703
  return new Date(date).toString();