@vendure/admin-ui 1.4.3 → 1.4.7

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 (51) hide show
  1. package/bundles/vendure-admin-ui-catalog.umd.js +68 -28
  2. package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -1
  3. package/bundles/vendure-admin-ui-core.umd.js +101 -40
  4. package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
  5. package/bundles/vendure-admin-ui-dashboard.umd.js.map +1 -1
  6. package/bundles/vendure-admin-ui-settings.umd.js +1 -1
  7. package/bundles/vendure-admin-ui-settings.umd.js.map +1 -1
  8. package/catalog/components/facet-detail/facet-detail.component.d.ts +7 -2
  9. package/catalog/vendure-admin-ui-catalog.metadata.json +1 -1
  10. package/core/common/generated-types.d.ts +7 -7
  11. package/core/common/version.d.ts +1 -1
  12. package/core/data/utils/remove-readonly-custom-fields.d.ts +12 -3
  13. package/core/providers/i18n/i18n.service.d.ts +3 -1
  14. package/core/shared/directives/if-default-channel-active.directive.d.ts +1 -1
  15. package/core/shared/directives/if-multichannel.directive.d.ts +1 -1
  16. package/core/shared/pipes/locale-base.pipe.d.ts +5 -0
  17. package/core/vendure-admin-ui-core.metadata.json +1 -1
  18. package/esm2015/catalog/components/facet-detail/facet-detail.component.js +44 -16
  19. package/esm2015/catalog/components/product-list/product-list.component.js +2 -2
  20. package/esm2015/core/common/base-detail.component.js +4 -4
  21. package/esm2015/core/common/generated-types.js +1 -1
  22. package/esm2015/core/common/introspection-result.js +1 -1
  23. package/esm2015/core/common/utilities/create-updated-translatable.js +1 -1
  24. package/esm2015/core/common/version.js +2 -2
  25. package/esm2015/core/components/main-nav/main-nav.component.js +3 -3
  26. package/esm2015/core/data/utils/remove-readonly-custom-fields.js +15 -3
  27. package/esm2015/core/providers/i18n/i18n.service.js +14 -5
  28. package/esm2015/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.js +2 -2
  29. package/esm2015/core/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.js +3 -2
  30. package/esm2015/core/shared/directives/if-default-channel-active.directive.js +2 -2
  31. package/esm2015/core/shared/directives/if-multichannel.directive.js +2 -2
  32. package/esm2015/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.js +2 -2
  33. package/esm2015/core/shared/pipes/asset-preview.pipe.js +2 -2
  34. package/esm2015/core/shared/pipes/locale-base.pipe.js +23 -1
  35. package/esm2015/core/shared/pipes/locale-currency-name.pipe.js +4 -4
  36. package/esm2015/core/shared/pipes/locale-currency.pipe.js +2 -2
  37. package/esm2015/core/shared/pipes/locale-date.pipe.js +2 -2
  38. package/esm2015/core/shared/pipes/locale-language-name.pipe.js +2 -3
  39. package/esm2015/core/shared/pipes/locale-region-name.pipe.js +2 -3
  40. package/esm2015/dashboard/widgets/latest-orders-widget/latest-orders-widget.component.js +1 -1
  41. package/esm2015/settings/components/channel-list/channel-list.component.js +2 -2
  42. package/fesm2015/vendure-admin-ui-catalog.js +44 -16
  43. package/fesm2015/vendure-admin-ui-catalog.js.map +1 -1
  44. package/fesm2015/vendure-admin-ui-core.js +66 -26
  45. package/fesm2015/vendure-admin-ui-core.js.map +1 -1
  46. package/fesm2015/vendure-admin-ui-dashboard.js.map +1 -1
  47. package/fesm2015/vendure-admin-ui-settings.js +1 -1
  48. package/fesm2015/vendure-admin-ui-settings.js.map +1 -1
  49. package/package.json +11 -11
  50. package/settings/vendure-admin-ui-settings.metadata.json +1 -1
  51. package/static/i18n-messages/pt_PT.json +22 -22
@@ -932,13 +932,46 @@
932
932
  * To be used before submitting the entity for a create or update request.
933
933
  */
934
934
  function removeReadonlyCustomFields(variables, customFieldConfig) {
935
- if (variables.input) {
936
- removeReadonly(variables.input, customFieldConfig);
935
+ var e_2, _a, e_3, _b;
936
+ if (!Array.isArray(variables)) {
937
+ if (Array.isArray(variables.input)) {
938
+ try {
939
+ for (var _c = __values(variables.input), _d = _c.next(); !_d.done; _d = _c.next()) {
940
+ var input = _d.value;
941
+ removeReadonly(input, customFieldConfig);
942
+ }
943
+ }
944
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
945
+ finally {
946
+ try {
947
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
948
+ }
949
+ finally { if (e_2) throw e_2.error; }
950
+ }
951
+ }
952
+ else {
953
+ removeReadonly(variables.input, customFieldConfig);
954
+ }
955
+ }
956
+ else {
957
+ try {
958
+ for (var variables_1 = __values(variables), variables_1_1 = variables_1.next(); !variables_1_1.done; variables_1_1 = variables_1.next()) {
959
+ var input = variables_1_1.value;
960
+ removeReadonly(input, customFieldConfig);
961
+ }
962
+ }
963
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
964
+ finally {
965
+ try {
966
+ if (variables_1_1 && !variables_1_1.done && (_b = variables_1.return)) _b.call(variables_1);
967
+ }
968
+ finally { if (e_3) throw e_3.error; }
969
+ }
937
970
  }
938
971
  return removeReadonly(variables, customFieldConfig);
939
972
  }
940
973
  function removeReadonly(input, customFieldConfig) {
941
- var e_2, _a, e_3, _b;
974
+ var e_4, _a, e_5, _b;
942
975
  try {
943
976
  for (var customFieldConfig_1 = __values(customFieldConfig), customFieldConfig_1_1 = customFieldConfig_1.next(); !customFieldConfig_1_1.done; customFieldConfig_1_1 = customFieldConfig_1.next()) {
944
977
  var field = customFieldConfig_1_1.value;
@@ -946,7 +979,7 @@
946
979
  if (field.type === 'localeString') {
947
980
  if (hasTranslations(input)) {
948
981
  try {
949
- for (var _c = (e_3 = void 0, __values(input.translations)), _d = _c.next(); !_d.done; _d = _c.next()) {
982
+ for (var _c = (e_5 = void 0, __values(input.translations)), _d = _c.next(); !_d.done; _d = _c.next()) {
950
983
  var translation = _d.value;
951
984
  if (hasCustomFields$1(translation) &&
952
985
  translation.customFields[field.name] !== undefined) {
@@ -954,12 +987,12 @@
954
987
  }
955
988
  }
956
989
  }
957
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
990
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
958
991
  finally {
959
992
  try {
960
993
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
961
994
  }
962
- finally { if (e_3) throw e_3.error; }
995
+ finally { if (e_5) throw e_5.error; }
963
996
  }
964
997
  }
965
998
  }
@@ -971,12 +1004,12 @@
971
1004
  }
972
1005
  }
973
1006
  }
974
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1007
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
975
1008
  finally {
976
1009
  try {
977
1010
  if (customFieldConfig_1_1 && !customFieldConfig_1_1.done && (_a = customFieldConfig_1.return)) _a.call(customFieldConfig_1);
978
1011
  }
979
- finally { if (e_2) throw e_2.error; }
1012
+ finally { if (e_4) throw e_4.error; }
980
1013
  }
981
1014
  return input;
982
1015
  }
@@ -3506,9 +3539,11 @@
3506
3539
  { type: ServerConfigService }
3507
3540
  ]; };
3508
3541
 
3542
+ /** @dynamic */
3509
3543
  var I18nService = /** @class */ (function () {
3510
- function I18nService(ngxTranslate) {
3544
+ function I18nService(ngxTranslate, document) {
3511
3545
  this.ngxTranslate = ngxTranslate;
3546
+ this.document = document;
3512
3547
  this._availableLanguages = [];
3513
3548
  }
3514
3549
  Object.defineProperty(I18nService.prototype, "availableLanguages", {
@@ -3528,7 +3563,11 @@
3528
3563
  * Set the UI language
3529
3564
  */
3530
3565
  I18nService.prototype.setLanguage = function (language) {
3566
+ var _a;
3531
3567
  this.ngxTranslate.use(language);
3568
+ if ((_a = this.document) === null || _a === void 0 ? void 0 : _a.documentElement) {
3569
+ this.document.documentElement.lang = language;
3570
+ }
3532
3571
  };
3533
3572
  /**
3534
3573
  * Set the available UI languages
@@ -3544,14 +3583,15 @@
3544
3583
  };
3545
3584
  return I18nService;
3546
3585
  }());
3547
- I18nService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function I18nService_Factory() { return new I18nService(i0__namespace.ɵɵinject(i1__namespace$1.TranslateService)); }, token: I18nService, providedIn: "root" });
3586
+ I18nService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function I18nService_Factory() { return new I18nService(i0__namespace.ɵɵinject(i1__namespace$1.TranslateService), i0__namespace.ɵɵinject(i1__namespace.DOCUMENT)); }, token: I18nService, providedIn: "root" });
3548
3587
  I18nService.decorators = [
3549
3588
  { type: i0.Injectable, args: [{
3550
3589
  providedIn: 'root',
3551
3590
  },] }
3552
3591
  ];
3553
3592
  I18nService.ctorParameters = function () { return [
3554
- { type: i1$2.TranslateService }
3593
+ { type: i1$2.TranslateService },
3594
+ { type: Document, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
3555
3595
  ]; };
3556
3596
 
3557
3597
  /**
@@ -5025,8 +5065,8 @@
5025
5065
  MainNavComponent.decorators = [
5026
5066
  { type: i0.Component, args: [{
5027
5067
  selector: 'vdr-main-nav',
5028
- template: "<nav class=\"sidenav\" [clr-nav-level]=\"2\">\r\n <section class=\"sidenav-content\">\r\n <ng-container *ngFor=\"let section of navBuilderService.navMenuConfig$ | async\">\r\n <section\r\n class=\"nav-group\"\r\n [attr.data-section-id]=\"section.id\"\r\n [class.collapsible]=\"section.collapsible\"\r\n *ngIf=\"shouldDisplayLink(section)\"\r\n >\r\n <vdr-ui-extension-point [locationId]=\"section.id\" api=\"navMenu\" [topPx]=\"-6\" [leftPx]=\"8\">\r\n <ng-container *ngIf=\"navBuilderService.sectionBadges[section.id] | async as sectionBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"sectionBadge !== 'none'\"\r\n [type]=\"sectionBadge\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <input [id]=\"section.id\" type=\"checkbox\" [checked]=\"section.collapsedByDefault\" />\r\n <label [for]=\"section.id\">{{ section.label | translate }}</label>\r\n <ul class=\"nav-list\">\r\n <ng-container *ngFor=\"let item of section.items\">\r\n <li *ngIf=\"shouldDisplayLink(item)\">\r\n <a\r\n class=\"nav-link\"\r\n [attr.data-item-id]=\"section.id\"\r\n [routerLink]=\"getRouterLink(item)\"\r\n routerLinkActive=\"active\"\r\n >\r\n <ng-container *ngIf=\"item.statusBadge | async as itemBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"itemBadge.type !== 'none'\"\r\n [type]=\"itemBadge.type\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <clr-icon [attr.shape]=\"item.icon || 'block'\" size=\"20\"></clr-icon>\r\n {{ item.label | translate }}\r\n </a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </vdr-ui-extension-point>\r\n </section>\r\n </ng-container>\r\n </section>\r\n</nav>\r\n",
5029
- styles: [":host{order:-1;background-color:var(--clr-nav-background-color)}nav.sidenav{height:100%;width:10.8rem;border-right-color:var(--clr-sidenav-border-color)}.nav-list clr-icon{margin-right:12px}.nav-group,.nav-link{position:relative}.nav-group vdr-status-badge{left:10px;top:6px}.nav-link vdr-status-badge{left:25px;top:3px}\n"]
5068
+ template: "<nav class=\"sidenav\" [clr-nav-level]=\"2\">\r\n <section class=\"sidenav-content\">\r\n <ng-container *ngFor=\"let section of navBuilderService.navMenuConfig$ | async\">\r\n <section\r\n class=\"nav-group\"\r\n [attr.data-section-id]=\"section.id\"\r\n [class.collapsible]=\"section.collapsible\"\r\n *ngIf=\"shouldDisplayLink(section)\"\r\n >\r\n <vdr-ui-extension-point [locationId]=\"section.id\" api=\"navMenu\" [topPx]=\"-6\" [leftPx]=\"8\">\r\n <ng-container *ngIf=\"navBuilderService.sectionBadges[section.id] | async as sectionBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"sectionBadge !== 'none'\"\r\n [type]=\"sectionBadge\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <input [id]=\"section.id\" type=\"checkbox\" [checked]=\"section.collapsedByDefault\" />\r\n <label class=\"nav-group-header\" [for]=\"section.id\">{{ section.label | translate }}</label>\r\n <ul class=\"nav-list\">\r\n <ng-container *ngFor=\"let item of section.items\">\r\n <li *ngIf=\"shouldDisplayLink(item)\">\r\n <a\r\n class=\"nav-link\"\r\n [attr.data-item-id]=\"section.id\"\r\n [routerLink]=\"getRouterLink(item)\"\r\n routerLinkActive=\"active\"\r\n >\r\n <ng-container *ngIf=\"item.statusBadge | async as itemBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"itemBadge.type !== 'none'\"\r\n [type]=\"itemBadge.type\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <clr-icon [attr.shape]=\"item.icon || 'block'\" size=\"20\"></clr-icon>\r\n {{ item.label | translate }}\r\n </a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </vdr-ui-extension-point>\r\n </section>\r\n </ng-container>\r\n </section>\r\n</nav>\r\n",
5069
+ styles: [":host{order:-1;background-color:var(--clr-nav-background-color)}nav.sidenav{height:100%;width:10.8rem;border-right-color:var(--clr-sidenav-border-color)}.sidenav .nav-group .nav-list{margin:0}.sidenav .nav-group .nav-group-header{margin:0;line-height:1.2}.sidenav .nav-group .nav-link{display:inline-flex;line-height:1rem;padding-right:.6rem}.nav-list clr-icon{flex-shrink:0;margin-right:12px}.nav-group{-webkit-hyphens:auto;hyphens:auto}.nav-group,.nav-link{position:relative}.nav-group vdr-status-badge{left:10px;top:6px}.nav-link vdr-status-badge{left:25px;top:3px}\n"]
5030
5070
  },] }
5031
5071
  ];
5032
5072
  MainNavComponent.ctorParameters = function () { return [
@@ -6769,7 +6809,7 @@
6769
6809
  SelectFormInputComponent.decorators = [
6770
6810
  { type: i0.Component, args: [{
6771
6811
  selector: 'vdr-select-form-input',
6772
- template: "<select clrSelect [formControl]=\"formControl\" [vdrDisabled]=\"readonly\">\r\n <option *ngIf=\"config.nullable\" [ngValue]=\"null\"></option>\r\n <option *ngFor=\"let option of options\" [value]=\"option.value\">\r\n {{ (option | customFieldLabel) || option.label || option.value }}\r\n </option>\r\n</select>\r\n",
6812
+ template: "<select clrSelect [formControl]=\"formControl\" [vdrDisabled]=\"readonly\">\r\n <option *ngIf=\"config.nullable\" [ngValue]=\"null\"></option>\r\n <option *ngFor=\"let option of options\" [ngValue]=\"option.value\">\r\n {{ (option | customFieldLabel) || option.label || option.value }}\r\n </option>\r\n</select>\r\n",
6773
6813
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
6774
6814
  styles: ["select{width:100%}\n"]
6775
6815
  },] }
@@ -11106,7 +11146,7 @@
11106
11146
  };
11107
11147
  ProsemirrorService.prototype.getStateFromText = function (text) {
11108
11148
  var div = document.createElement('div');
11109
- div.innerHTML = text;
11149
+ div.innerHTML = text !== null && text !== void 0 ? text : '';
11110
11150
  return prosemirrorState.EditorState.create({
11111
11151
  doc: prosemirrorModel.DOMParser.fromSchema(this.mySchema).parse(div),
11112
11152
  plugins: this.configurePlugins({ schema: this.mySchema, floatingMenu: false }),
@@ -11297,7 +11337,8 @@
11297
11337
  this.tabbedCustomFields = this.groupByTabs(this.customFields);
11298
11338
  };
11299
11339
  TabbedCustomFieldsComponent.prototype.customFieldIsSet = function (name) {
11300
- return !!this.customFieldsFormGroup.get(name);
11340
+ var _a;
11341
+ return !!((_a = this.customFieldsFormGroup) === null || _a === void 0 ? void 0 : _a.get(name));
11301
11342
  };
11302
11343
  TabbedCustomFieldsComponent.prototype.groupByTabs = function (customFieldConfigs) {
11303
11344
  var e_1, _d;
@@ -11652,7 +11693,7 @@
11652
11693
  }
11653
11694
  Object.defineProperty(IfDefaultChannelActiveDirective.prototype, "vdrIfMultichannelElse", {
11654
11695
  /**
11655
- * A template to show if the current user does not have the speicified permission.
11696
+ * A template to show if the current user does not have the specified permission.
11656
11697
  */
11657
11698
  set: function (templateRef) {
11658
11699
  this.setElseTemplate(templateRef);
@@ -11711,7 +11752,7 @@
11711
11752
  }
11712
11753
  Object.defineProperty(IfMultichannelDirective.prototype, "vdrIfMultichannelElse", {
11713
11754
  /**
11714
- * A template to show if the current user does not have the speicified permission.
11755
+ * A template to show if the current user does not have the specified permission.
11715
11756
  */
11716
11757
  set: function (templateRef) {
11717
11758
  this.setElseTemplate(templateRef);
@@ -12468,7 +12509,7 @@
12468
12509
  if (!asset) {
12469
12510
  return '';
12470
12511
  }
12471
- if (!asset.preview || typeof asset.preview !== 'string') {
12512
+ if (asset.preview == null || typeof asset.preview !== 'string') {
12472
12513
  throw new Error("Expected an Asset, got " + JSON.stringify(asset));
12473
12514
  }
12474
12515
  var fp = asset.focalPoint ? "&fpx=" + asset.focalPoint.x + "&fpy=" + asset.focalPoint.y : '';
@@ -12736,8 +12777,8 @@
12736
12777
  this.subscription = dataService.client
12737
12778
  .uiState()
12738
12779
  .mapStream(function (data) { return data.uiState; })
12739
- .subscribe(function (_a) {
12740
- var language = _a.language, locale = _a.locale;
12780
+ .subscribe(function (_b) {
12781
+ var language = _b.language, locale = _b.locale;
12741
12782
  _this.locale = language.replace(/_/g, '-');
12742
12783
  if (locale) {
12743
12784
  _this.locale += "-" + locale;
@@ -12751,6 +12792,28 @@
12751
12792
  this.subscription.unsubscribe();
12752
12793
  }
12753
12794
  };
12795
+ /**
12796
+ * Returns the active locale after attempting to ensure that the locale string
12797
+ * is valid for the Intl API.
12798
+ */
12799
+ LocaleBasePipe.prototype.getActiveLocale = function (localeOverride) {
12800
+ var _a;
12801
+ var locale = typeof localeOverride === 'string' ? localeOverride : (_a = this.locale) !== null && _a !== void 0 ? _a : 'en';
12802
+ var hyphenated = locale === null || locale === void 0 ? void 0 : locale.replace(/_/g, '-');
12803
+ // Check for a double-region string, containing 2 region codes like
12804
+ // pt-BR-BR, which is invalid. In this case, the second region is used
12805
+ // and the first region discarded. This would only ever be an issue for
12806
+ // those languages where the translation file itself encodes the region,
12807
+ // as in pt_BR & pt_PT.
12808
+ var matches = hyphenated === null || hyphenated === void 0 ? void 0 : hyphenated.match(/^([a-zA-Z_-]+)(-[A-Z][A-Z])(-[A-Z][A-z])$/);
12809
+ if (matches === null || matches === void 0 ? void 0 : matches.length) {
12810
+ var overriddenLocale = matches[1] + matches[3];
12811
+ return overriddenLocale;
12812
+ }
12813
+ else {
12814
+ return hyphenated;
12815
+ }
12816
+ };
12754
12817
  return LocaleBasePipe;
12755
12818
  }());
12756
12819
  LocaleBasePipe.decorators = [
@@ -12779,7 +12842,7 @@
12779
12842
  }
12780
12843
  LocaleCurrencyNamePipe.prototype.transform = function (value, display, locale) {
12781
12844
  if (display === void 0) { display = 'full'; }
12782
- var _a, _b;
12845
+ var _a;
12783
12846
  if (value == null || value === '') {
12784
12847
  return '';
12785
12848
  }
@@ -12788,7 +12851,7 @@
12788
12851
  }
12789
12852
  var name = '';
12790
12853
  var symbol = '';
12791
- var activeLocale = typeof locale === 'string' ? locale : (_a = this.locale) !== null && _a !== void 0 ? _a : 'en';
12854
+ var activeLocale = this.getActiveLocale(locale);
12792
12855
  // Awaiting TS types for this API: https://github.com/microsoft/TypeScript/pull/44022/files
12793
12856
  var DisplayNames = Intl.DisplayNames;
12794
12857
  if (display === 'full' || display === 'name') {
@@ -12802,7 +12865,7 @@
12802
12865
  currency: value,
12803
12866
  currencyDisplay: 'symbol',
12804
12867
  }).formatToParts();
12805
- symbol = ((_b = parts.find(function (p) { return p.type === 'currency'; })) === null || _b === void 0 ? void 0 : _b.value) || value;
12868
+ symbol = ((_a = parts.find(function (p) { return p.type === 'currency'; })) === null || _a === void 0 ? void 0 : _a.value) || value;
12806
12869
  }
12807
12870
  return display === 'full' ? name + " (" + symbol + ")" : display === 'name' ? name : symbol;
12808
12871
  };
@@ -12843,7 +12906,7 @@
12843
12906
  }
12844
12907
  var _a = __read(args, 2), currencyCode = _a[0], locale = _a[1];
12845
12908
  if (typeof value === 'number' && typeof currencyCode === 'string') {
12846
- var activeLocale = typeof locale === 'string' ? locale : this.locale;
12909
+ var activeLocale = this.getActiveLocale(locale);
12847
12910
  var majorUnits = value / 100;
12848
12911
  return new Intl.NumberFormat(activeLocale, { style: 'currency', currency: currencyCode }).format(majorUnits);
12849
12912
  }
@@ -12886,7 +12949,7 @@
12886
12949
  }
12887
12950
  var _a = __read(args, 2), format = _a[0], locale = _a[1];
12888
12951
  if (this.locale || typeof locale === 'string') {
12889
- var activeLocale = typeof locale === 'string' ? locale : this.locale;
12952
+ var activeLocale = this.getActiveLocale(locale);
12890
12953
  var date = value instanceof Date ? value : typeof value === 'string' ? new Date(value) : undefined;
12891
12954
  if (date) {
12892
12955
  var options = this.getOptionsForFormat(typeof format === 'string' ? format : 'medium');
@@ -12962,14 +13025,13 @@
12962
13025
  return _super.call(this, dataService, changeDetectorRef) || this;
12963
13026
  }
12964
13027
  LocaleLanguageNamePipe.prototype.transform = function (value, locale) {
12965
- var _a;
12966
13028
  if (value == null || value === '') {
12967
13029
  return '';
12968
13030
  }
12969
13031
  if (typeof value !== 'string') {
12970
13032
  return "Invalid language code \"" + value + "\"";
12971
13033
  }
12972
- var activeLocale = typeof locale === 'string' ? locale : (_a = this.locale) !== null && _a !== void 0 ? _a : 'en';
13034
+ var activeLocale = this.getActiveLocale(locale);
12973
13035
  // Awaiting TS types for this API: https://github.com/microsoft/TypeScript/pull/44022/files
12974
13036
  var DisplayNames = Intl.DisplayNames;
12975
13037
  try {
@@ -13009,14 +13071,13 @@
13009
13071
  return _super.call(this, dataService, changeDetectorRef) || this;
13010
13072
  }
13011
13073
  LocaleRegionNamePipe.prototype.transform = function (value, locale) {
13012
- var _a;
13013
13074
  if (value == null || value === '') {
13014
13075
  return '';
13015
13076
  }
13016
13077
  if (typeof value !== 'string') {
13017
13078
  return "Invalid region code \"" + value + "\"";
13018
13079
  }
13019
- var activeLocale = typeof locale === 'string' ? locale : (_a = this.locale) !== null && _a !== void 0 ? _a : 'en';
13080
+ var activeLocale = this.getActiveLocale(locale);
13020
13081
  // Awaiting TS types for this API: https://github.com/microsoft/TypeScript/pull/44022/files
13021
13082
  var DisplayNames = Intl.DisplayNames;
13022
13083
  try {
@@ -13599,8 +13660,8 @@
13599
13660
  this.availableLanguages$ = this.serverConfigService.getAvailableLanguages();
13600
13661
  rxjs.combineLatest(this.entity$, this.languageCode$)
13601
13662
  .pipe(operators.takeUntil(this.destroy$))
13602
- .subscribe(function (_c) {
13603
- var _d = __read(_c, 2), entity = _d[0], languageCode = _d[1];
13663
+ .subscribe(function (_d) {
13664
+ var _e = __read(_d, 2), entity = _e[0], languageCode = _e[1];
13604
13665
  _this.setFormValues(entity, languageCode);
13605
13666
  _this.detailForm.markAsPristine();
13606
13667
  });
@@ -13617,15 +13678,15 @@
13617
13678
  return this.detailForm && this.detailForm.pristine;
13618
13679
  };
13619
13680
  BaseDetailComponent.prototype.setCustomFieldFormValues = function (customFields, formGroup, entity, currentTranslation) {
13620
- var e_1, _c;
13621
- var _a, _b;
13681
+ var e_1, _d;
13682
+ var _a, _b, _c;
13622
13683
  try {
13623
13684
  for (var customFields_1 = __values(customFields), customFields_1_1 = customFields_1.next(); !customFields_1_1.done; customFields_1_1 = customFields_1.next()) {
13624
13685
  var fieldDef = customFields_1_1.value;
13625
13686
  var key = fieldDef.name;
13626
13687
  var value = fieldDef.type === 'localeString'
13627
- ? (_a = currentTranslation.customFields) === null || _a === void 0 ? void 0 : _a[key]
13628
- : (_b = entity.customFields) === null || _b === void 0 ? void 0 : _b[key];
13688
+ ? (_b = (_a = currentTranslation) === null || _a === void 0 ? void 0 : _a.customFields) === null || _b === void 0 ? void 0 : _b[key]
13689
+ : (_c = entity.customFields) === null || _c === void 0 ? void 0 : _c[key];
13629
13690
  var control = formGroup === null || formGroup === void 0 ? void 0 : formGroup.get(key);
13630
13691
  if (control) {
13631
13692
  control.patchValue(value);
@@ -13635,7 +13696,7 @@
13635
13696
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
13636
13697
  finally {
13637
13698
  try {
13638
- if (customFields_1_1 && !customFields_1_1.done && (_c = customFields_1.return)) _c.call(customFields_1);
13699
+ if (customFields_1_1 && !customFields_1_1.done && (_d = customFields_1.return)) _d.call(customFields_1);
13639
13700
  }
13640
13701
  finally { if (e_1) throw e_1.error; }
13641
13702
  }
@@ -13644,10 +13705,10 @@
13644
13705
  return this.serverConfigService.getCustomFieldsFor(key);
13645
13706
  };
13646
13707
  BaseDetailComponent.prototype.setQueryParam = function (key, value) {
13647
- var _c;
13708
+ var _d;
13648
13709
  this.router.navigate([
13649
13710
  './',
13650
- Object.assign(Object.assign({}, this.route.snapshot.params), (_c = {}, _c[key] = value, _c)),
13711
+ Object.assign(Object.assign({}, this.route.snapshot.params), (_d = {}, _d[key] = value, _d)),
13651
13712
  ], {
13652
13713
  relativeTo: this.route,
13653
13714
  queryParamsHandling: 'merge',
@@ -13985,7 +14046,7 @@
13985
14046
  }
13986
14047
 
13987
14048
  // Auto-generated by the set-version.js script.
13988
- var ADMIN_UI_VERSION = '1.4.3';
14049
+ var ADMIN_UI_VERSION = '1.4.7';
13989
14050
 
13990
14051
  /**
13991
14052
  * Responsible for registering dashboard widget components and querying for layouts.