@veloceapps/sdk 8.0.0-48 → 8.0.0-49

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 { Injectable, InjectionToken, NgModule, inject, Directive, Input, LOCALE_ID, Pipe } from '@angular/core';
3
- import { UUID, ConfigurationContextMode, ConfigurationContext, ConfigurationMode, ConfigurationTranslatorUtils, getUIDefinitionProperties, ChargeGroupUtils, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, parseJsonSafely, RuntimeModel, isLegacyUIDefinition, SalesforceIdUtils, EntityUtil, formatNumber } from '@veloceapps/core';
3
+ import { UUID, ConfigurationContextMode, ConfigurationContext, ConfigurationMode, ConfigurationTranslatorUtils, getUIDefinitionProperties, 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, RuntimeModel, isLegacyUIDefinition, SalesforceIdUtils, EntityUtil, formatNumber } from '@veloceapps/core';
4
4
  import * as i1 from '@veloceapps/api';
5
5
  import { PriceApiService, ContextApiService, ProductModelApiService, ConfigurationApiService } from '@veloceapps/api';
6
6
  import { BehaviorSubject, zip, noop, combineLatest, throwError, shareReplay as shareReplay$1, tap as tap$1, map as map$2, of, switchMap as switchMap$1, catchError as catchError$1, Subject, take as take$1, distinctUntilChanged } from 'rxjs';
@@ -1268,6 +1268,7 @@ class RuntimeSettingsService {
1268
1268
  const decimalsCount = priceScale !== null && priceScale !== '' && !isNaN(Number(priceScale)) && Number(priceScale) >= 0
1269
1269
  ? Number(priceScale)
1270
1270
  : DEFAULT_DECIMALS_COUNT;
1271
+ const actionCodeSettings = shoppingCartSettings?.STATUS_LABEL;
1271
1272
  return {
1272
1273
  currencySymbol: currencySettings.symbol,
1273
1274
  dateFormats: getSupportedDateFormats(dateFormat),
@@ -1279,6 +1280,9 @@ class RuntimeSettingsService {
1279
1280
  thousandsSeparator: thousandsSeparator !== undefined && ['.', ',', '', null].includes(thousandsSeparator)
1280
1281
  ? thousandsSeparator || ''
1281
1282
  : DEFAULT_THOUSANDS_SEPARATOR,
1283
+ actionCodeLabels: actionCodeSettings?.length
1284
+ ? actionCodeSettings.reduce((result, setting) => ({ ...result, [setting.status_label]: setting.custom_label }), {})
1285
+ : DEFAULT_ACTION_CODE_LABELS,
1282
1286
  };
1283
1287
  }
1284
1288
  getConfigurationSettings() {
@@ -1626,6 +1630,7 @@ const DEFAULT_FORMATTING_SETTINGS = {
1626
1630
  dateFormats: getSupportedDateFormats(DEFAULT_DATE_FORMAT),
1627
1631
  decimalSeparator: DEFAULT_DECIMAL_SEPARATOR,
1628
1632
  thousandsSeparator: DEFAULT_THOUSANDS_SEPARATOR,
1633
+ actionCodeLabels: DEFAULT_ACTION_CODE_LABELS,
1629
1634
  };
1630
1635
  class SdkCoreModule {
1631
1636
  }
@@ -1786,16 +1791,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1786
1791
  }]
1787
1792
  }] });
1788
1793
 
1794
+ class ActionCodePipe {
1795
+ constructor() {
1796
+ this.formattingSettings = inject(FORMATTING_SETTINGS_TOKEN, { optional: true })?.getFormattingSettings();
1797
+ }
1798
+ transform(actionCode) {
1799
+ return this.formattingSettings?.actionCodeLabels[actionCode] ?? actionCode;
1800
+ }
1801
+ }
1802
+ ActionCodePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1803
+ ActionCodePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, name: "vlActionCode" });
1804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActionCodePipe, decorators: [{
1805
+ type: Pipe,
1806
+ args: [{
1807
+ name: 'vlActionCode',
1808
+ }]
1809
+ }] });
1810
+
1789
1811
  class SdkPipesModule {
1790
1812
  }
1791
1813
  SdkPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1792
- SdkPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, declarations: [NumberPipe, PricePipe, DatePipe], exports: [NumberPipe, PricePipe, DatePipe] });
1814
+ SdkPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, declarations: [NumberPipe, PricePipe, DatePipe, ActionCodePipe], exports: [NumberPipe, PricePipe, DatePipe, ActionCodePipe] });
1793
1815
  SdkPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule });
1794
1816
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SdkPipesModule, decorators: [{
1795
1817
  type: NgModule,
1796
1818
  args: [{
1797
- declarations: [NumberPipe, PricePipe, DatePipe],
1798
- exports: [NumberPipe, PricePipe, DatePipe],
1819
+ declarations: [NumberPipe, PricePipe, DatePipe, ActionCodePipe],
1820
+ exports: [NumberPipe, PricePipe, DatePipe, ActionCodePipe],
1799
1821
  }]
1800
1822
  }] });
1801
1823
 
@@ -1803,5 +1825,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1803
1825
  * Generated bundle index. Do not edit.
1804
1826
  */
1805
1827
 
1806
- export { CalendarDirective, ConfigurationRuntimeService, ConfigurationService, ConfigurationState, ContextService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FORMATTING_SETTINGS_TOKEN, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, MetricsCalculationService, NumberPipe, PricePipe, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeSettingsService, RuntimeStep, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, UI_DEFINITION_VERSION, calculateCardinalityVariables, extractMetadata, filterOutTechnicalAttributes, findLineItem, findLineItemWithComparator, generateLineItem, generateModifiedAssetsMap, getAttributeValue, getAttributes, getDefaultLineItem, getGuidedSellingConfigurationRequest, getOriginParent, getRecommendedPrices, insertLineItem, isLineItemModified, isTechnicalAttribute, lineItem_utils as lineItemUtils, mapAttributes, multiplyLineItems, patchAttributes, recalculateCardinalityVariables, removeLineItem, replaceLineItem, upsertAttributes };
1828
+ export { ActionCodePipe, CalendarDirective, ConfigurationRuntimeService, ConfigurationService, ConfigurationState, ContextService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FORMATTING_SETTINGS_TOKEN, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, MetricsCalculationService, NumberPipe, PricePipe, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeSettingsService, RuntimeStep, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, UI_DEFINITION_VERSION, calculateCardinalityVariables, extractMetadata, filterOutTechnicalAttributes, findLineItem, findLineItemWithComparator, generateLineItem, generateModifiedAssetsMap, getAttributeValue, getAttributes, getDefaultLineItem, getGuidedSellingConfigurationRequest, getOriginParent, getRecommendedPrices, insertLineItem, isLineItemModified, isTechnicalAttribute, lineItem_utils as lineItemUtils, mapAttributes, multiplyLineItems, patchAttributes, recalculateCardinalityVariables, removeLineItem, replaceLineItem, upsertAttributes };
1807
1829
  //# sourceMappingURL=veloceapps-sdk-core.mjs.map