@vendure/admin-ui 1.6.2 → 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.
Files changed (48) hide show
  1. package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -1
  2. package/bundles/vendure-admin-ui-core.umd.js +48 -28
  3. package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
  4. package/bundles/vendure-admin-ui-order.umd.js +38 -18
  5. package/bundles/vendure-admin-ui-order.umd.js.map +1 -1
  6. package/core/common/generated-types.d.ts +2 -0
  7. package/core/common/version.d.ts +1 -1
  8. package/core/shared/components/custom-field-control/custom-field-control.component.d.ts +6 -2
  9. package/core/shared/components/facet-value-selector/facet-value-selector.component.d.ts +2 -1
  10. package/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.d.ts +2 -0
  11. package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +2 -1
  12. package/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.d.ts +10 -2
  13. package/core/shared/pipes/custom-field-label.pipe.d.ts +4 -10
  14. package/core/vendure-admin-ui-core.metadata.json +1 -1
  15. package/esm2015/catalog/components/product-variants-editor/product-variants-editor.component.js +1 -1
  16. package/esm2015/core/common/generated-types.js +1 -1
  17. package/esm2015/core/common/introspection-result.js +1 -1
  18. package/esm2015/core/common/utilities/configurable-operation-utils.js +3 -3
  19. package/esm2015/core/common/version.js +2 -2
  20. package/esm2015/core/shared/components/address-form/address-form.component.js +2 -2
  21. package/esm2015/core/shared/components/custom-field-control/custom-field-control.component.js +9 -3
  22. package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +5 -2
  23. package/esm2015/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.js +11 -2
  24. package/esm2015/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.js +15 -2
  25. package/esm2015/core/shared/pipes/custom-field-label.pipe.js +4 -19
  26. package/esm2015/order/components/order-detail/order-detail.component.js +31 -19
  27. package/esm2015/order/components/order-table/order-table.component.js +10 -2
  28. package/fesm2015/vendure-admin-ui-catalog.js.map +1 -1
  29. package/fesm2015/vendure-admin-ui-core.js +40 -25
  30. package/fesm2015/vendure-admin-ui-core.js.map +1 -1
  31. package/fesm2015/vendure-admin-ui-order.js +39 -19
  32. package/fesm2015/vendure-admin-ui-order.js.map +1 -1
  33. package/order/components/order-table/order-table.component.d.ts +1 -0
  34. package/order/vendure-admin-ui-order.metadata.json +1 -1
  35. package/package.json +2 -2
  36. package/static/i18n-messages/cs.json +683 -683
  37. package/static/i18n-messages/de.json +683 -683
  38. package/static/i18n-messages/en.json +684 -684
  39. package/static/i18n-messages/es.json +683 -683
  40. package/static/i18n-messages/fr.json +683 -683
  41. package/static/i18n-messages/it.json +683 -683
  42. package/static/i18n-messages/pl.json +683 -683
  43. package/static/i18n-messages/pt_BR.json +683 -683
  44. package/static/i18n-messages/pt_PT.json +683 -683
  45. package/static/i18n-messages/ru.json +683 -683
  46. package/static/i18n-messages/uk.json +683 -683
  47. package/static/i18n-messages/zh_Hans.json +683 -683
  48. package/static/i18n-messages/zh_Hant.json +683 -683
@@ -6487,7 +6487,7 @@
6487
6487
  */
6488
6488
  function getConfigArgValue(value) {
6489
6489
  try {
6490
- return value ? JSON.parse(value) : undefined;
6490
+ return value != null ? JSON.parse(value) : undefined;
6491
6491
  }
6492
6492
  catch (e) {
6493
6493
  return value;
@@ -6568,7 +6568,7 @@
6568
6568
  if (arg.list) {
6569
6569
  return [];
6570
6570
  }
6571
- if (arg.defaultValue) {
6571
+ if (arg.defaultValue != null) {
6572
6572
  return arg.defaultValue;
6573
6573
  }
6574
6574
  var type = arg.type;
@@ -6938,8 +6938,18 @@
6938
6938
  */
6939
6939
  var FacetValueFormInputComponent = /** @class */ (function () {
6940
6940
  function FacetValueFormInputComponent(dataService) {
6941
+ var _this = this;
6941
6942
  this.dataService = dataService;
6942
6943
  this.isListInput = true;
6944
+ this.valueTransformFn = function (values) {
6945
+ var isUsedInConfigArg = _this.config.__typename === 'ConfigArgDefinition';
6946
+ if (isUsedInConfigArg) {
6947
+ return JSON.stringify(values.map(function (s) { return s.id; }));
6948
+ }
6949
+ else {
6950
+ return values;
6951
+ }
6952
+ };
6943
6953
  }
6944
6954
  FacetValueFormInputComponent.prototype.ngOnInit = function () {
6945
6955
  this.facets$ = this.dataService.facet
@@ -6953,7 +6963,7 @@
6953
6963
  FacetValueFormInputComponent.decorators = [
6954
6964
  { type: i0.Component, args: [{
6955
6965
  selector: 'vdr-facet-value-form-input',
6956
- template: "<vdr-facet-value-selector\r\n *ngIf=\"facets$ | async as facets\"\r\n [readonly]=\"readonly\"\r\n [facets]=\"facets\"\r\n [formControl]=\"formControl\"\r\n></vdr-facet-value-selector>\r\n",
6966
+ template: "<vdr-facet-value-selector\r\n *ngIf=\"facets$ | async as facets\"\r\n [readonly]=\"readonly\"\r\n [facets]=\"facets\"\r\n [formControl]=\"formControl\"\r\n [transformControlValueAccessorValue]=\"valueTransformFn\"\r\n></vdr-facet-value-selector>\r\n",
6957
6967
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
6958
6968
  styles: [""]
6959
6969
  },] }
@@ -7416,7 +7426,8 @@
7416
7426
  * @docsPage default-inputs
7417
7427
  */
7418
7428
  var SelectFormInputComponent = /** @class */ (function () {
7419
- function SelectFormInputComponent() {
7429
+ function SelectFormInputComponent(dataService) {
7430
+ this.dataService = dataService;
7420
7431
  }
7421
7432
  Object.defineProperty(SelectFormInputComponent.prototype, "options", {
7422
7433
  get: function () {
@@ -7426,17 +7437,29 @@
7426
7437
  enumerable: false,
7427
7438
  configurable: true
7428
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
+ };
7429
7449
  return SelectFormInputComponent;
7430
7450
  }());
7431
7451
  SelectFormInputComponent.id = 'select-form-input';
7432
7452
  SelectFormInputComponent.decorators = [
7433
7453
  { type: i0.Component, args: [{
7434
7454
  selector: 'vdr-select-form-input',
7435
- 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",
7436
7456
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
7437
7457
  styles: ["select{width:100%}\n"]
7438
7458
  },] }
7439
7459
  ];
7460
+ SelectFormInputComponent.ctorParameters = function () { return [
7461
+ { type: DataService }
7462
+ ]; };
7440
7463
  SelectFormInputComponent.propDecorators = {
7441
7464
  readonly: [{ type: i0.Input }]
7442
7465
  };
@@ -7752,7 +7775,7 @@
7752
7775
  AddressFormComponent.decorators = [
7753
7776
  { type: i0.Component, args: [{
7754
7777
  selector: 'vdr-address-form',
7755
- template: "<form [formGroup]=\"formGroup\">\n <div class=\"clr-row\">\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.full-name' | translate }}</label>\n <input formControlName=\"fullName\" type=\"text\" clrInput />\n </clr-input-container>\n </div>\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.company' | translate }}</label>\n <input formControlName=\"company\" type=\"text\" clrInput />\n </clr-input-container>\n </div>\n </div>\n\n <div class=\"clr-row\">\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.street-line-1' | translate }}</label>\n <input formControlName=\"streetLine1\" type=\"text\" clrInput />\n </clr-input-container>\n </div>\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.street-line-2' | translate }}</label>\n <input formControlName=\"streetLine2\" type=\"text\" clrInput />\n </clr-input-container>\n </div>\n </div>\n <div class=\"clr-row\">\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.city' | translate }}</label>\n <input formControlName=\"city\" type=\"text\" clrInput />\n </clr-input-container>\n </div>\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.province' | translate }}</label>\n <input formControlName=\"province\" type=\"text\" clrInput />\n </clr-input-container>\n </div>\n </div>\n <div class=\"clr-row\">\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.postal-code' | translate }}</label>\n <input formControlName=\"postalCode\" type=\"text\" clrInput />\n </clr-input-container>\n </div>\n <div class=\"clr-col-md-4\">\n <clr-input-container>\n <label>{{ 'customer.country' | translate }}</label>\n <select name=\"countryCode\" formControlName=\"countryCode\" clrInput clrSelect>\n <option *ngFor=\"let country of availableCountries\" [value]=\"country.code\">\n {{ country.name }}\n </option>\n </select>\n </clr-input-container>\n </div>\n </div>\n <clr-input-container>\n <label>{{ 'customer.phone-number' | translate }}</label>\n <input formControlName=\"phoneNumber\" type=\"text\" clrInput />\n </clr-input-container>\n <section formGroupName=\"customFields\" *ngIf=\"formGroup.get('customFields') as customFieldsGroup\">\n <label>{{ 'common.custom-fields' | translate }}</label>\n <vdr-tabbed-custom-fields\n entityName=\"Address\"\n [customFields]=\"customFields\"\n [customFieldsFormGroup]=\"customFieldsGroup\"\n ></vdr-tabbed-custom-fields>\n </section>\n</form>\n",
7778
+ template: "<form [formGroup]=\"formGroup\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.full-name' | translate }}</label>\r\n <input formControlName=\"fullName\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n </div>\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.company' | translate }}</label>\r\n <input formControlName=\"company\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n </div>\r\n </div>\r\n\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.street-line-1' | translate }}</label>\r\n <input formControlName=\"streetLine1\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n </div>\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.street-line-2' | translate }}</label>\r\n <input formControlName=\"streetLine2\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n </div>\r\n </div>\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.city' | translate }}</label>\r\n <input formControlName=\"city\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n </div>\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.province' | translate }}</label>\r\n <input formControlName=\"province\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n </div>\r\n </div>\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.postal-code' | translate }}</label>\r\n <input formControlName=\"postalCode\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n </div>\r\n <div class=\"clr-col-md-4\">\r\n <clr-input-container>\r\n <label>{{ 'customer.country' | translate }}</label>\r\n <select name=\"countryCode\" formControlName=\"countryCode\" clrInput clrSelect>\r\n <option *ngFor=\"let country of availableCountries\" [value]=\"country.code\">\r\n {{ country.name }}\r\n </option>\r\n </select>\r\n </clr-input-container>\r\n </div>\r\n </div>\r\n <clr-input-container>\r\n <label>{{ 'customer.phone-number' | translate }}</label>\r\n <input formControlName=\"phoneNumber\" type=\"text\" clrInput />\r\n </clr-input-container>\r\n <section formGroupName=\"customFields\" *ngIf=\"formGroup.get('customFields') as customFieldsGroup\">\r\n <label>{{ 'common.custom-fields' | translate }}</label>\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Address\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"customFieldsGroup\"\r\n ></vdr-tabbed-custom-fields>\r\n </section>\r\n</form>\r\n",
7756
7779
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
7757
7780
  styles: [""]
7758
7781
  },] }
@@ -9065,6 +9088,14 @@
9065
9088
  this.readonly = false;
9066
9089
  this.hasCustomControl = false;
9067
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
+ };
9068
9099
  CustomFieldControlComponent.prototype.getFieldDefinition = function () {
9069
9100
  var config = Object.assign({}, this.customField);
9070
9101
  var id = this.customFieldComponentService.customFieldComponentExists(this.entityName, this.customField.name);
@@ -9087,7 +9118,7 @@
9087
9118
  CustomFieldControlComponent.decorators = [
9088
9119
  { type: i0.Component, args: [{
9089
9120
  selector: 'vdr-custom-field-control',
9090
- 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",
9091
9122
  styles: [":host{display:block;width:100%}:host .toggle-switch{margin-top:0;margin-bottom:0}\n"]
9092
9123
  },] }
9093
9124
  ];
@@ -10192,6 +10223,7 @@
10192
10223
  this.dataService = dataService;
10193
10224
  this.selectedValuesChange = new i0.EventEmitter();
10194
10225
  this.readonly = false;
10226
+ this.transformControlValueAccessorValue = function (value) { return value; };
10195
10227
  this.facetValues = [];
10196
10228
  this.disabled = false;
10197
10229
  this.toSelectorItem = function (facetValue) {
@@ -10212,7 +10244,8 @@
10212
10244
  }
10213
10245
  this.selectedValuesChange.emit(selected.map(function (s) { return s.value; }));
10214
10246
  if (this.onChangeFn) {
10215
- this.onChangeFn(JSON.stringify(selected.map(function (s) { return s.id; })));
10247
+ var transformedValue = this.transformControlValueAccessorValue(selected);
10248
+ this.onChangeFn(transformedValue);
10216
10249
  }
10217
10250
  };
10218
10251
  FacetValueSelectorComponent.prototype.registerOnChange = function (fn) {
@@ -10272,6 +10305,7 @@
10272
10305
  selectedValuesChange: [{ type: i0.Output }],
10273
10306
  facets: [{ type: i0.Input }],
10274
10307
  readonly: [{ type: i0.Input }],
10308
+ transformControlValueAccessorValue: [{ type: i0.Input }],
10275
10309
  ngSelect: [{ type: i0.ViewChild, args: [ngSelect.NgSelectComponent,] }]
10276
10310
  };
10277
10311
 
@@ -13074,33 +13108,22 @@
13074
13108
  * name/value if none are defined.
13075
13109
  */
13076
13110
  var CustomFieldLabelPipe = /** @class */ (function () {
13077
- function CustomFieldLabelPipe(dataService) {
13078
- var _this = this;
13079
- this.dataService = dataService;
13080
- this.subscription = dataService.client.uiState().stream$.subscribe(function (val) {
13081
- _this.uiLanguageCode = val.uiState.language;
13082
- });
13111
+ function CustomFieldLabelPipe() {
13083
13112
  }
13084
- CustomFieldLabelPipe.prototype.transform = function (value) {
13085
- var _this = this;
13113
+ CustomFieldLabelPipe.prototype.transform = function (value, uiLanguageCode) {
13086
13114
  if (!value) {
13087
13115
  return value;
13088
13116
  }
13089
13117
  var label = value.label;
13090
13118
  var name = this.isCustomFieldConfig(value) ? value.name : value.value;
13091
13119
  if (label) {
13092
- var match = label.find(function (l) { return l.languageCode === _this.uiLanguageCode; });
13120
+ var match = label.find(function (l) { return l.languageCode === uiLanguageCode; });
13093
13121
  return match ? match.value : label[0].value;
13094
13122
  }
13095
13123
  else {
13096
13124
  return name;
13097
13125
  }
13098
13126
  };
13099
- CustomFieldLabelPipe.prototype.ngOnDestroy = function () {
13100
- if (this.subscription) {
13101
- this.subscription.unsubscribe();
13102
- }
13103
- };
13104
13127
  CustomFieldLabelPipe.prototype.isCustomFieldConfig = function (input) {
13105
13128
  return input.hasOwnProperty('name');
13106
13129
  };
@@ -13109,12 +13132,9 @@
13109
13132
  CustomFieldLabelPipe.decorators = [
13110
13133
  { type: i0.Pipe, args: [{
13111
13134
  name: 'customFieldLabel',
13112
- pure: false,
13135
+ pure: true,
13113
13136
  },] }
13114
- ];
13115
- CustomFieldLabelPipe.ctorParameters = function () { return [
13116
- { type: DataService }
13117
- ]; };
13137
+ ];
13118
13138
 
13119
13139
  /**
13120
13140
  * @description
@@ -14570,7 +14590,7 @@
14570
14590
  }
14571
14591
 
14572
14592
  // Auto-generated by the set-version.js script.
14573
- var ADMIN_UI_VERSION = '1.6.2';
14593
+ var ADMIN_UI_VERSION = '1.6.5';
14574
14594
 
14575
14595
  /**
14576
14596
  * Responsible for registering dashboard widget components and querying for layouts.