@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
@@ -8569,7 +8569,7 @@ JsonEditorFormInputComponent.propDecorators = {
8569
8569
  */
8570
8570
  function getConfigArgValue(value) {
8571
8571
  try {
8572
- return value ? JSON.parse(value) : undefined;
8572
+ return value != null ? JSON.parse(value) : undefined;
8573
8573
  }
8574
8574
  catch (e) {
8575
8575
  return value;
@@ -8639,7 +8639,7 @@ function getDefaultConfigArgValue(arg) {
8639
8639
  if (arg.list) {
8640
8640
  return [];
8641
8641
  }
8642
- if (arg.defaultValue) {
8642
+ if (arg.defaultValue != null) {
8643
8643
  return arg.defaultValue;
8644
8644
  }
8645
8645
  const type = arg.type;
@@ -8975,6 +8975,15 @@ class FacetValueFormInputComponent {
8975
8975
  constructor(dataService) {
8976
8976
  this.dataService = dataService;
8977
8977
  this.isListInput = true;
8978
+ this.valueTransformFn = (values) => {
8979
+ const isUsedInConfigArg = this.config.__typename === 'ConfigArgDefinition';
8980
+ if (isUsedInConfigArg) {
8981
+ return JSON.stringify(values.map(s => s.id));
8982
+ }
8983
+ else {
8984
+ return values;
8985
+ }
8986
+ };
8978
8987
  }
8979
8988
  ngOnInit() {
8980
8989
  this.facets$ = this.dataService.facet
@@ -8987,7 +8996,7 @@ FacetValueFormInputComponent.id = 'facet-value-form-input';
8987
8996
  FacetValueFormInputComponent.decorators = [
8988
8997
  { type: Component, args: [{
8989
8998
  selector: 'vdr-facet-value-form-input',
8990
- 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",
8999
+ 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",
8991
9000
  changeDetection: ChangeDetectionStrategy.OnPush,
8992
9001
  styles: [""]
8993
9002
  },] }
@@ -9401,20 +9410,32 @@ RichTextFormInputComponent.decorators = [
9401
9410
  * @docsPage default-inputs
9402
9411
  */
9403
9412
  class SelectFormInputComponent {
9413
+ constructor(dataService) {
9414
+ this.dataService = dataService;
9415
+ }
9404
9416
  get options() {
9405
9417
  var _a;
9406
9418
  return ((_a = this.config.ui) === null || _a === void 0 ? void 0 : _a.options) || this.config.options;
9407
9419
  }
9420
+ ngOnInit() {
9421
+ this.uiLanguage$ = this.dataService.client.uiState().mapStream(({ uiState }) => uiState.language);
9422
+ }
9423
+ trackByFn(index, item) {
9424
+ return item.value;
9425
+ }
9408
9426
  }
9409
9427
  SelectFormInputComponent.id = 'select-form-input';
9410
9428
  SelectFormInputComponent.decorators = [
9411
9429
  { type: Component, args: [{
9412
9430
  selector: 'vdr-select-form-input',
9413
- 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",
9431
+ 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",
9414
9432
  changeDetection: ChangeDetectionStrategy.OnPush,
9415
9433
  styles: ["select{width:100%}\n"]
9416
9434
  },] }
9417
9435
  ];
9436
+ SelectFormInputComponent.ctorParameters = () => [
9437
+ { type: DataService }
9438
+ ];
9418
9439
  SelectFormInputComponent.propDecorators = {
9419
9440
  readonly: [{ type: Input }]
9420
9441
  };
@@ -9704,7 +9725,7 @@ class AddressFormComponent {
9704
9725
  AddressFormComponent.decorators = [
9705
9726
  { type: Component, args: [{
9706
9727
  selector: 'vdr-address-form',
9707
- 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",
9728
+ 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",
9708
9729
  changeDetection: ChangeDetectionStrategy.OnPush,
9709
9730
  styles: [""]
9710
9731
  },] }
@@ -10917,6 +10938,11 @@ class CustomFieldControlComponent {
10917
10938
  this.readonly = false;
10918
10939
  this.hasCustomControl = false;
10919
10940
  }
10941
+ ngOnInit() {
10942
+ this.uiLanguage$ = this.dataService.client
10943
+ .uiState()
10944
+ .stream$.pipe(map(({ uiState }) => uiState.language));
10945
+ }
10920
10946
  getFieldDefinition() {
10921
10947
  const config = Object.assign({}, this.customField);
10922
10948
  const id = this.customFieldComponentService.customFieldComponentExists(this.entityName, this.customField.name);
@@ -10938,7 +10964,7 @@ class CustomFieldControlComponent {
10938
10964
  CustomFieldControlComponent.decorators = [
10939
10965
  { type: Component, args: [{
10940
10966
  selector: 'vdr-custom-field-control',
10941
- 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",
10967
+ 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",
10942
10968
  styles: [":host{display:block;width:100%}:host .toggle-switch{margin-top:0;margin-bottom:0}\n"]
10943
10969
  },] }
10944
10970
  ];
@@ -12010,6 +12036,7 @@ class FacetValueSelectorComponent {
12010
12036
  this.dataService = dataService;
12011
12037
  this.selectedValuesChange = new EventEmitter();
12012
12038
  this.readonly = false;
12039
+ this.transformControlValueAccessorValue = value => value;
12013
12040
  this.facetValues = [];
12014
12041
  this.disabled = false;
12015
12042
  this.toSelectorItem = (facetValue) => {
@@ -12030,7 +12057,8 @@ class FacetValueSelectorComponent {
12030
12057
  }
12031
12058
  this.selectedValuesChange.emit(selected.map(s => s.value));
12032
12059
  if (this.onChangeFn) {
12033
- this.onChangeFn(JSON.stringify(selected.map(s => s.id)));
12060
+ const transformedValue = this.transformControlValueAccessorValue(selected);
12061
+ this.onChangeFn(transformedValue);
12034
12062
  }
12035
12063
  }
12036
12064
  registerOnChange(fn) {
@@ -12089,6 +12117,7 @@ FacetValueSelectorComponent.propDecorators = {
12089
12117
  selectedValuesChange: [{ type: Output }],
12090
12118
  facets: [{ type: Input }],
12091
12119
  readonly: [{ type: Input }],
12120
+ transformControlValueAccessorValue: [{ type: Input }],
12092
12121
  ngSelect: [{ type: ViewChild, args: [NgSelectComponent,] }]
12093
12122
  };
12094
12123
 
@@ -14667,31 +14696,20 @@ ChannelLabelPipe.decorators = [
14667
14696
  * name/value if none are defined.
14668
14697
  */
14669
14698
  class CustomFieldLabelPipe {
14670
- constructor(dataService) {
14671
- this.dataService = dataService;
14672
- this.subscription = dataService.client.uiState().stream$.subscribe(val => {
14673
- this.uiLanguageCode = val.uiState.language;
14674
- });
14675
- }
14676
- transform(value) {
14699
+ transform(value, uiLanguageCode) {
14677
14700
  if (!value) {
14678
14701
  return value;
14679
14702
  }
14680
14703
  const { label } = value;
14681
14704
  const name = this.isCustomFieldConfig(value) ? value.name : value.value;
14682
14705
  if (label) {
14683
- const match = label.find(l => l.languageCode === this.uiLanguageCode);
14706
+ const match = label.find(l => l.languageCode === uiLanguageCode);
14684
14707
  return match ? match.value : label[0].value;
14685
14708
  }
14686
14709
  else {
14687
14710
  return name;
14688
14711
  }
14689
14712
  }
14690
- ngOnDestroy() {
14691
- if (this.subscription) {
14692
- this.subscription.unsubscribe();
14693
- }
14694
- }
14695
14713
  isCustomFieldConfig(input) {
14696
14714
  return input.hasOwnProperty('name');
14697
14715
  }
@@ -14699,11 +14717,8 @@ class CustomFieldLabelPipe {
14699
14717
  CustomFieldLabelPipe.decorators = [
14700
14718
  { type: Pipe, args: [{
14701
14719
  name: 'customFieldLabel',
14702
- pure: false,
14720
+ pure: true,
14703
14721
  },] }
14704
- ];
14705
- CustomFieldLabelPipe.ctorParameters = () => [
14706
- { type: DataService }
14707
14722
  ];
14708
14723
 
14709
14724
  /**
@@ -16059,7 +16074,7 @@ function patchObject(obj, patch) {
16059
16074
  }
16060
16075
 
16061
16076
  // Auto-generated by the set-version.js script.
16062
- const ADMIN_UI_VERSION = '1.6.2';
16077
+ const ADMIN_UI_VERSION = '1.6.5';
16063
16078
 
16064
16079
  /**
16065
16080
  * Responsible for registering dashboard widget components and querying for layouts.