@vendure/admin-ui 1.6.4 → 1.6.5

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.
@@ -7426,7 +7426,8 @@
7426
7426
  * @docsPage default-inputs
7427
7427
  */
7428
7428
  var SelectFormInputComponent = /** @class */ (function () {
7429
- function SelectFormInputComponent() {
7429
+ function SelectFormInputComponent(dataService) {
7430
+ this.dataService = dataService;
7430
7431
  }
7431
7432
  Object.defineProperty(SelectFormInputComponent.prototype, "options", {
7432
7433
  get: function () {
@@ -7436,17 +7437,29 @@
7436
7437
  enumerable: false,
7437
7438
  configurable: true
7438
7439
  });
7440
+ SelectFormInputComponent.prototype.ngOnInit = function () {
7441
+ this.uiLanguage$ = this.dataService.client.uiState().mapStream(function (_b) {
7442
+ var uiState = _b.uiState;
7443
+ return uiState.language;
7444
+ });
7445
+ };
7446
+ SelectFormInputComponent.prototype.trackByFn = function (index, item) {
7447
+ return item.value;
7448
+ };
7439
7449
  return SelectFormInputComponent;
7440
7450
  }());
7441
7451
  SelectFormInputComponent.id = 'select-form-input';
7442
7452
  SelectFormInputComponent.decorators = [
7443
7453
  { type: i0.Component, args: [{
7444
7454
  selector: 'vdr-select-form-input',
7445
- 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",
7455
+ template: "<select clrSelect [formControl]=\"formControl\" [vdrDisabled]=\"readonly\">\r\n <option *ngIf=\"config.nullable\" [ngValue]=\"null\"></option>\r\n <option *ngFor=\"let option of options;trackBy:trackByFn\" [ngValue]=\"option.value\">\r\n {{ (option | customFieldLabel:(uiLanguage$ | async)) || option.label || option.value }}\r\n </option>\r\n</select>\r\n",
7446
7456
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
7447
7457
  styles: ["select{width:100%}\n"]
7448
7458
  },] }
7449
7459
  ];
7460
+ SelectFormInputComponent.ctorParameters = function () { return [
7461
+ { type: DataService }
7462
+ ]; };
7450
7463
  SelectFormInputComponent.propDecorators = {
7451
7464
  readonly: [{ type: i0.Input }]
7452
7465
  };
@@ -9075,6 +9088,14 @@
9075
9088
  this.readonly = false;
9076
9089
  this.hasCustomControl = false;
9077
9090
  }
9091
+ CustomFieldControlComponent.prototype.ngOnInit = function () {
9092
+ this.uiLanguage$ = this.dataService.client
9093
+ .uiState()
9094
+ .stream$.pipe(operators.map(function (_a) {
9095
+ var uiState = _a.uiState;
9096
+ return uiState.language;
9097
+ }));
9098
+ };
9078
9099
  CustomFieldControlComponent.prototype.getFieldDefinition = function () {
9079
9100
  var config = Object.assign({}, this.customField);
9080
9101
  var id = this.customFieldComponentService.customFieldComponentExists(this.entityName, this.customField.name);
@@ -9097,7 +9118,7 @@
9097
9118
  CustomFieldControlComponent.decorators = [
9098
9119
  { type: i0.Component, args: [{
9099
9120
  selector: 'vdr-custom-field-control',
9100
- template: "<div class=\"clr-form-control\" *ngIf=\"compact\">\r\n <label for=\"basic\" class=\"clr-control-label\">{{ customField | customFieldLabel }}</label>\r\n <div class=\"clr-control-container\">\r\n <div class=\"clr-input-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"inputs\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n<vdr-form-field [label]=\"customField | customFieldLabel\" [for]=\"customField.name\" *ngIf=\"!compact\">\r\n <ng-container *ngTemplateOutlet=\"inputs\"></ng-container>\r\n</vdr-form-field>\r\n\r\n<ng-template #inputs>\r\n <ng-container [formGroup]=\"formGroup\">\r\n <vdr-dynamic-form-input\r\n [formControlName]=\"customField.name\"\r\n [readonly]=\"readonly || customField.readonly\"\r\n [control]=\"formGroup.get(customField.name)\"\r\n [def]=\"getFieldDefinition()\"\r\n >\r\n </vdr-dynamic-form-input>\r\n </ng-container>\r\n</ng-template>\r\n",
9121
+ template: "<div class=\"clr-form-control\" *ngIf=\"compact\">\r\n <label for=\"basic\" class=\"clr-control-label\">{{ customField | customFieldLabel:(uiLanguage$ | async) }}</label>\r\n <div class=\"clr-control-container\">\r\n <div class=\"clr-input-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"inputs\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n<vdr-form-field [label]=\"customField | customFieldLabel:(uiLanguage$ | async)\" [for]=\"customField.name\" *ngIf=\"!compact\">\r\n <ng-container *ngTemplateOutlet=\"inputs\"></ng-container>\r\n</vdr-form-field>\r\n\r\n<ng-template #inputs>\r\n <ng-container [formGroup]=\"formGroup\">\r\n <vdr-dynamic-form-input\r\n [formControlName]=\"customField.name\"\r\n [readonly]=\"readonly || customField.readonly\"\r\n [control]=\"formGroup.get(customField.name)\"\r\n [def]=\"getFieldDefinition()\"\r\n >\r\n </vdr-dynamic-form-input>\r\n </ng-container>\r\n</ng-template>\r\n",
9101
9122
  styles: [":host{display:block;width:100%}:host .toggle-switch{margin-top:0;margin-bottom:0}\n"]
9102
9123
  },] }
9103
9124
  ];
@@ -13087,33 +13108,22 @@
13087
13108
  * name/value if none are defined.
13088
13109
  */
13089
13110
  var CustomFieldLabelPipe = /** @class */ (function () {
13090
- function CustomFieldLabelPipe(dataService) {
13091
- var _this = this;
13092
- this.dataService = dataService;
13093
- this.subscription = dataService.client.uiState().stream$.subscribe(function (val) {
13094
- _this.uiLanguageCode = val.uiState.language;
13095
- });
13111
+ function CustomFieldLabelPipe() {
13096
13112
  }
13097
- CustomFieldLabelPipe.prototype.transform = function (value) {
13098
- var _this = this;
13113
+ CustomFieldLabelPipe.prototype.transform = function (value, uiLanguageCode) {
13099
13114
  if (!value) {
13100
13115
  return value;
13101
13116
  }
13102
13117
  var label = value.label;
13103
13118
  var name = this.isCustomFieldConfig(value) ? value.name : value.value;
13104
13119
  if (label) {
13105
- var match = label.find(function (l) { return l.languageCode === _this.uiLanguageCode; });
13120
+ var match = label.find(function (l) { return l.languageCode === uiLanguageCode; });
13106
13121
  return match ? match.value : label[0].value;
13107
13122
  }
13108
13123
  else {
13109
13124
  return name;
13110
13125
  }
13111
13126
  };
13112
- CustomFieldLabelPipe.prototype.ngOnDestroy = function () {
13113
- if (this.subscription) {
13114
- this.subscription.unsubscribe();
13115
- }
13116
- };
13117
13127
  CustomFieldLabelPipe.prototype.isCustomFieldConfig = function (input) {
13118
13128
  return input.hasOwnProperty('name');
13119
13129
  };
@@ -13122,12 +13132,9 @@
13122
13132
  CustomFieldLabelPipe.decorators = [
13123
13133
  { type: i0.Pipe, args: [{
13124
13134
  name: 'customFieldLabel',
13125
- pure: false,
13135
+ pure: true,
13126
13136
  },] }
13127
- ];
13128
- CustomFieldLabelPipe.ctorParameters = function () { return [
13129
- { type: DataService }
13130
- ]; };
13137
+ ];
13131
13138
 
13132
13139
  /**
13133
13140
  * @description
@@ -14583,7 +14590,7 @@
14583
14590
  }
14584
14591
 
14585
14592
  // Auto-generated by the set-version.js script.
14586
- var ADMIN_UI_VERSION = '1.6.4';
14593
+ var ADMIN_UI_VERSION = '1.6.5';
14587
14594
 
14588
14595
  /**
14589
14596
  * Responsible for registering dashboard widget components and querying for layouts.