@vendure/admin-ui 2.0.6 → 2.0.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 (102) hide show
  1. package/catalog/components/collection-detail/collection-detail.component.d.ts +3 -1
  2. package/catalog/components/create-product-variant-dialog/create-product-variant-dialog.component.d.ts +6 -4
  3. package/catalog/components/facet-detail/facet-detail.component.d.ts +3 -1
  4. package/catalog/components/product-detail/product-detail.component.d.ts +3 -1
  5. package/catalog/components/stock-location-detail/stock-location-detail.component.d.ts +3 -1
  6. package/core/common/utilities/custom-field-default-value.d.ts +6 -0
  7. package/core/common/version.d.ts +1 -1
  8. package/core/providers/data-table/data-table-filter-collection.d.ts +10 -6
  9. package/core/providers/data-table/data-table-filter.d.ts +13 -2
  10. package/core/public_api.d.ts +1 -0
  11. package/customer/components/customer-detail/customer-detail.component.d.ts +3 -1
  12. package/customer/components/customer-group-detail/customer-group-detail.component.d.ts +3 -1
  13. package/customer/components/customer-list/customer-list.component.d.ts +1 -0
  14. package/esm2022/catalog/components/asset-detail/asset-detail.component.mjs +3 -3
  15. package/esm2022/catalog/components/collection-detail/collection-detail.component.mjs +3 -3
  16. package/esm2022/catalog/components/collection-list/collection-list.component.mjs +2 -1
  17. package/esm2022/catalog/components/create-product-variant-dialog/create-product-variant-dialog.component.mjs +8 -5
  18. package/esm2022/catalog/components/facet-detail/facet-detail.component.mjs +3 -3
  19. package/esm2022/catalog/components/facet-list/facet-list.component.mjs +2 -1
  20. package/esm2022/catalog/components/product-detail/product-detail.component.mjs +3 -3
  21. package/esm2022/catalog/components/product-list/product-list.component.mjs +2 -7
  22. package/esm2022/catalog/components/product-variant-detail/product-variant-detail.component.mjs +3 -3
  23. package/esm2022/catalog/components/product-variant-list/product-variant-list.component.mjs +2 -7
  24. package/esm2022/catalog/components/product-variants-editor/product-variants-editor.component.mjs +1 -1
  25. package/esm2022/catalog/components/stock-location-detail/stock-location-detail.component.mjs +3 -3
  26. package/esm2022/catalog/components/stock-location-list/stock-location-list.component.mjs +2 -7
  27. package/esm2022/core/common/utilities/create-updated-translatable.mjs +5 -23
  28. package/esm2022/core/common/utilities/custom-field-default-value.mjs +28 -0
  29. package/esm2022/core/common/version.mjs +2 -2
  30. package/esm2022/core/components/channel-switcher/channel-switcher.component.mjs +3 -3
  31. package/esm2022/core/providers/dashboard-widget/register-dashboard-widget.mjs +1 -1
  32. package/esm2022/core/providers/data-table/data-table-filter-collection.mjs +51 -22
  33. package/esm2022/core/providers/data-table/data-table-filter.mjs +8 -1
  34. package/esm2022/core/providers/local-storage/local-storage.service.mjs +1 -1
  35. package/esm2022/core/public_api.mjs +2 -1
  36. package/esm2022/core/shared/components/asset-gallery/asset-gallery.component.mjs +3 -3
  37. package/esm2022/core/shared/components/card/card.component.mjs +1 -1
  38. package/esm2022/core/shared/components/chip/chip.component.mjs +2 -2
  39. package/esm2022/core/shared/components/data-table-2/data-table2.component.mjs +1 -1
  40. package/esm2022/core/shared/components/data-table-filter-label/data-table-filter-label.component.mjs +3 -3
  41. package/esm2022/core/shared/components/data-table-filters/data-table-filters.component.mjs +23 -4
  42. package/esm2022/core/shared/components/facet-value-chip/facet-value-chip.component.mjs +2 -2
  43. package/esm2022/core/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.mjs +2 -2
  44. package/esm2022/customer/components/customer-detail/customer-detail.component.mjs +3 -3
  45. package/esm2022/customer/components/customer-group-detail/customer-group-detail.component.mjs +3 -3
  46. package/esm2022/customer/components/customer-group-detail-dialog/customer-group-detail-dialog.component.mjs +3 -2
  47. package/esm2022/customer/components/customer-group-list/customer-group-list.component.mjs +2 -1
  48. package/esm2022/customer/components/customer-list/customer-list.component.mjs +34 -30
  49. package/esm2022/dashboard/components/dashboard-widget/dashboard-widget.component.mjs +1 -1
  50. package/esm2022/marketing/components/promotion-detail/promotion-detail.component.mjs +3 -3
  51. package/esm2022/marketing/components/promotion-list/promotion-list.component.mjs +2 -1
  52. package/esm2022/order/components/order-detail/order-detail.component.mjs +3 -3
  53. package/esm2022/order/components/order-list/order-list.component.mjs +2 -1
  54. package/esm2022/settings/components/admin-detail/admin-detail.component.mjs +3 -3
  55. package/esm2022/settings/components/administrator-list/administrator-list.component.mjs +2 -1
  56. package/esm2022/settings/components/channel-detail/channel-detail.component.mjs +10 -10
  57. package/esm2022/settings/components/channel-list/channel-list.component.mjs +2 -1
  58. package/esm2022/settings/components/country-detail/country-detail.component.mjs +3 -3
  59. package/esm2022/settings/components/country-list/country-list.component.mjs +3 -2
  60. package/esm2022/settings/components/global-settings/global-settings.component.mjs +3 -3
  61. package/esm2022/settings/components/payment-method-detail/payment-method-detail.component.mjs +3 -3
  62. package/esm2022/settings/components/payment-method-list/payment-method-list.component.mjs +2 -1
  63. package/esm2022/settings/components/profile/profile.component.mjs +3 -3
  64. package/esm2022/settings/components/role-list/role-list.component.mjs +2 -1
  65. package/esm2022/settings/components/seller-detail/seller-detail.component.mjs +3 -3
  66. package/esm2022/settings/components/seller-list/seller-list.component.mjs +2 -1
  67. package/esm2022/settings/components/shipping-method-detail/shipping-method-detail.component.mjs +3 -3
  68. package/esm2022/settings/components/shipping-method-list/shipping-method-list.component.mjs +2 -1
  69. package/esm2022/settings/components/tax-category-detail/tax-category-detail.component.mjs +3 -3
  70. package/esm2022/settings/components/tax-category-list/tax-category-list.component.mjs +2 -1
  71. package/esm2022/settings/components/tax-rate-detail/tax-rate-detail.component.mjs +3 -3
  72. package/esm2022/settings/components/tax-rate-list/tax-rate-list.component.mjs +2 -1
  73. package/esm2022/settings/components/zone-detail/zone-detail.component.mjs +3 -3
  74. package/esm2022/settings/components/zone-list/zone-list.component.mjs +2 -1
  75. package/fesm2022/vendure-admin-ui-catalog.mjs +19 -29
  76. package/fesm2022/vendure-admin-ui-catalog.mjs.map +1 -1
  77. package/fesm2022/vendure-admin-ui-core.mjs +121 -58
  78. package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
  79. package/fesm2022/vendure-admin-ui-customer.mjs +34 -29
  80. package/fesm2022/vendure-admin-ui-customer.mjs.map +1 -1
  81. package/fesm2022/vendure-admin-ui-dashboard.mjs.map +1 -1
  82. package/fesm2022/vendure-admin-ui-marketing.mjs +3 -2
  83. package/fesm2022/vendure-admin-ui-marketing.mjs.map +1 -1
  84. package/fesm2022/vendure-admin-ui-order.mjs +3 -2
  85. package/fesm2022/vendure-admin-ui-order.mjs.map +1 -1
  86. package/fesm2022/vendure-admin-ui-settings.mjs +30 -20
  87. package/fesm2022/vendure-admin-ui-settings.mjs.map +1 -1
  88. package/marketing/components/promotion-detail/promotion-detail.component.d.ts +3 -1
  89. package/order/components/order-detail/order-detail.component.d.ts +3 -1
  90. package/package.json +8 -8
  91. package/settings/components/admin-detail/admin-detail.component.d.ts +3 -1
  92. package/settings/components/channel-detail/channel-detail.component.d.ts +5 -3
  93. package/settings/components/country-detail/country-detail.component.d.ts +3 -1
  94. package/settings/components/global-settings/global-settings.component.d.ts +3 -1
  95. package/settings/components/payment-method-detail/payment-method-detail.component.d.ts +3 -1
  96. package/settings/components/profile/profile.component.d.ts +3 -1
  97. package/settings/components/seller-detail/seller-detail.component.d.ts +3 -1
  98. package/settings/components/shipping-method-detail/shipping-method-detail.component.d.ts +3 -1
  99. package/settings/components/tax-category-detail/tax-category-detail.component.d.ts +3 -1
  100. package/settings/components/tax-rate-detail/tax-rate-detail.component.d.ts +3 -1
  101. package/settings/components/zone-detail/zone-detail.component.d.ts +3 -1
  102. package/static/i18n-messages/it.json +169 -169
@@ -4,7 +4,7 @@ import * as i1$1 from '@angular/router';
4
4
  import { ROUTES, RouterModule } from '@angular/router';
5
5
  import { marker } from '@biesbjerg/ngx-translate-extract-marker';
6
6
  import * as i1 from '@vendure/admin-ui/core';
7
- import { findTranslation, DeletionResult, BaseDetailComponent, Permission, createUpdatedTranslatable, SelectionManager, getDefaultUiLanguage, BaseEntityResolver, PageComponent, CanDeactivateDetailGuard, DataService, createResolveData, FacetValueSelectorComponent, ASSET_FRAGMENT, TAG_FRAGMENT, TypedBaseDetailComponent, BaseListComponent, SortOrder, LogicalOperator, AssetPickerDialogComponent, AssetPreviewDialogComponent, DataTable2Component, COLLECTION_FRAGMENT, unicodePatternValidator, getConfigArgValue, encodeConfigArgValue, createBulkDeleteAction, ModalService, NotificationService, createBulkAssignToChannelAction, createBulkRemoveFromChannelAction, TypedBaseListComponent, GetCollectionListDocument, FACET_WITH_VALUES_FRAGMENT, GetFacetDetailDocument, getChannelCodeFromUserStatus, currentChannelIsNotDefault, GetFacetListDocument, GetStockLocationListDocument, ProductVariantListQueryDocument, PRODUCT_DETAIL_FRAGMENT, isMultiChannel, FacetValueFormInputComponent, ProductListQueryDocument, JobState, GetProductVariantsQuickJumpDocument, GlobalFlag, ProductVariantUpdateMutationDocument, CreateStockLocationDocument, UpdateStockLocationDocument, DeleteStockLocationsDocument, AssignStockLocationsToChannelDocument, RemoveStockLocationsFromChannelDocument, detailComponentWithResolver, GetProductDetailDocument, GetStockLocationDetailDocument, GetProductVariantDetailDocument, CollectionDetailQueryDocument, AssetDetailQueryDocument, SharedModule, PageService } from '@vendure/admin-ui/core';
7
+ import { findTranslation, DeletionResult, BaseDetailComponent, Permission, createUpdatedTranslatable, SelectionManager, getDefaultUiLanguage, BaseEntityResolver, PageComponent, CanDeactivateDetailGuard, DataService, createResolveData, FacetValueSelectorComponent, ASSET_FRAGMENT, TAG_FRAGMENT, TypedBaseDetailComponent, getCustomFieldsDefaults, BaseListComponent, SortOrder, LogicalOperator, AssetPickerDialogComponent, AssetPreviewDialogComponent, DataTable2Component, COLLECTION_FRAGMENT, unicodePatternValidator, getConfigArgValue, encodeConfigArgValue, createBulkDeleteAction, ModalService, NotificationService, createBulkAssignToChannelAction, createBulkRemoveFromChannelAction, TypedBaseListComponent, GetCollectionListDocument, FACET_WITH_VALUES_FRAGMENT, GetFacetDetailDocument, getChannelCodeFromUserStatus, currentChannelIsNotDefault, GetFacetListDocument, GetStockLocationListDocument, ProductVariantListQueryDocument, PRODUCT_DETAIL_FRAGMENT, isMultiChannel, FacetValueFormInputComponent, ProductListQueryDocument, JobState, GetProductVariantsQuickJumpDocument, GlobalFlag, ProductVariantUpdateMutationDocument, CreateStockLocationDocument, UpdateStockLocationDocument, DeleteStockLocationsDocument, AssignStockLocationsToChannelDocument, RemoveStockLocationsFromChannelDocument, detailComponentWithResolver, GetProductDetailDocument, GetStockLocationDetailDocument, GetProductVariantDetailDocument, CollectionDetailQueryDocument, AssetDetailQueryDocument, SharedModule, PageService } from '@vendure/admin-ui/core';
8
8
  import { shareReplay, mergeMap, map, switchMap, tap, take, startWith, debounceTime, takeUntil, finalize, distinctUntilChanged, filter, catchError, skip, switchMapTo, delay } from 'rxjs/operators';
9
9
  import * as i2 from '@angular/forms';
10
10
  import { UntypedFormGroup, UntypedFormArray, Validators, FormControl, NG_VALUE_ACCESSOR, FormGroup, UntypedFormControl } from '@angular/forms';
@@ -483,10 +483,12 @@ class CreateProductVariantDialogComponent {
483
483
  this.form = this.formBuilder.group({
484
484
  name: ['', Validators.required],
485
485
  sku: ['', Validators.required],
486
+ price: ['', Validators.required],
486
487
  options: this.formBuilder.record({}),
487
488
  });
488
489
  }
489
490
  ngOnInit() {
491
+ this.currencyCode = this.product.variants[0].currencyCode;
490
492
  for (const optionGroup of this.product.optionGroups) {
491
493
  this.form.get('options').addControl(optionGroup.code, new FormControl('', Validators.required));
492
494
  }
@@ -510,14 +512,15 @@ class CreateProductVariantDialogComponent {
510
512
  });
511
513
  }
512
514
  confirm() {
513
- const { name, sku, options } = this.form.value;
514
- if (!name || !sku || !options) {
515
+ const { name, sku, options, price } = this.form.value;
516
+ if (!name || !sku || !options || !price) {
515
517
  return;
516
518
  }
517
519
  const optionIds = Object.values(options).filter(notNullOrUndefined);
518
520
  this.resolveWith({
519
521
  productId: this.product.id,
520
522
  sku,
523
+ price: Number(price),
521
524
  optionIds,
522
525
  translations: [
523
526
  {
@@ -537,11 +540,11 @@ class CreateProductVariantDialogComponent {
537
540
  return this.product.optionGroups.find(og => og.code === code)?.id ?? '';
538
541
  }
539
542
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: CreateProductVariantDialogComponent, deps: [{ token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
540
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", type: CreateProductVariantDialogComponent, selector: "vdr-create-product-variant-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.create-product-variant' | translate }}\r\n</ng-template>\r\n<form [formGroup]=\"form\">\r\n <div formGroupName=\"options\" class=\"form-grid\">\r\n <vdr-form-field [label]=\"optionGroup.name\" *ngFor=\"let optionGroup of product.optionGroups\">\r\n <ng-select\r\n [items]=\"optionGroup.options\"\r\n [formControlName]=\"optionGroup.code\"\r\n bindLabel=\"name\"\r\n bindValue=\"id\"\r\n appendTo=\"body\"\r\n >\r\n </ng-select>\r\n </vdr-form-field>\r\n <clr-alert\r\n *ngIf=\"product.optionGroups.length === 0\"\r\n clrAlertType=\"warning\"\r\n [clrAlertClosable]=\"false\"\r\n class=\"form-grid-span\"\r\n >\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.cannot-create-variants-without-options' | translate }}\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div *ngIf=\"existingVariant\" class=\"mt-2\">\r\n <clr-alert clrAlertType=\"warning\" [clrAlertClosable]=\"false\" class=\"\">\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.product-variant-exists' | translate }}: {{ existingVariant.name }} ({{\r\n existingVariant.sku\r\n }})\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"form-grid mt-2\">\r\n <vdr-form-field [label]=\"'common.name' | translate\">\r\n <input type=\"text\" formControlName=\"name\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'catalog.sku' | translate\">\r\n <input type=\"text\" formControlName=\"sku\" />\r\n </vdr-form-field>\r\n </div>\r\n</form>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"confirm()\"\r\n class=\"btn btn-primary\"\r\n [disabled]=\"form.invalid || existingVariant || product.optionGroups.length === 0\"\r\n >\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "component", type: i3.ClrAlert, selector: "clr-alert", inputs: ["clrAlertSizeSmall", "clrAlertClosable", "clrAlertAppLevel", "clrCloseButtonAriaLabel", "clrAlertClosed", "clrAlertType", "clrAlertIcon"], outputs: ["clrAlertClosedChange"] }, { kind: "component", type: i3.ClrAlertItem, selector: "clr-alert-item" }, { kind: "directive", type: i3.ClrAlertText, selector: ".alert-text" }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: i5$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
543
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", type: CreateProductVariantDialogComponent, selector: "vdr-create-product-variant-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.create-product-variant' | translate }}\r\n</ng-template>\r\n<form [formGroup]=\"form\">\r\n <div formGroupName=\"options\" class=\"form-grid\">\r\n <vdr-form-field [label]=\"optionGroup.name\" *ngFor=\"let optionGroup of product.optionGroups\">\r\n <ng-select [items]=\"optionGroup.options\" [formControlName]=\"optionGroup.code\" bindLabel=\"name\"\r\n bindValue=\"id\" appendTo=\"body\">\r\n </ng-select>\r\n </vdr-form-field>\r\n <clr-alert *ngIf=\"product.optionGroups.length === 0\" clrAlertType=\"warning\" [clrAlertClosable]=\"false\"\r\n class=\"form-grid-span\">\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.cannot-create-variants-without-options' | translate }}\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div *ngIf=\"existingVariant\" class=\"mt-2\">\r\n <clr-alert clrAlertType=\"warning\" [clrAlertClosable]=\"false\" class=\"\">\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.product-variant-exists' | translate }}: {{ existingVariant.name }} ({{\r\n existingVariant.sku\r\n }})\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"form-grid mt-2\">\r\n <vdr-form-field [label]=\"'common.name' | translate\">\r\n <input type=\"text\" formControlName=\"name\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'catalog.sku' | translate\">\r\n <input type=\"text\" formControlName=\"sku\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'catalog.price' | translate\">\r\n <vdr-currency-input name=\"price\" [currencyCode]=\"currencyCode\" formControlName=\"price\" />\r\n </vdr-form-field>\r\n </div>\r\n</form>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"confirm()\" class=\"btn btn-primary\"\r\n [disabled]=\"form.invalid || existingVariant || product.optionGroups.length === 0\">\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>", styles: [""], dependencies: [{ kind: "component", type: i3.ClrAlert, selector: "clr-alert", inputs: ["clrAlertSizeSmall", "clrAlertClosable", "clrAlertAppLevel", "clrCloseButtonAriaLabel", "clrAlertClosed", "clrAlertType", "clrAlertIcon"], outputs: ["clrAlertClosedChange"] }, { kind: "component", type: i3.ClrAlertItem, selector: "clr-alert-item" }, { kind: "directive", type: i3.ClrAlertText, selector: ".alert-text" }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: i5$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.CurrencyInputComponent, selector: "vdr-currency-input", inputs: ["disabled", "readonly", "value", "currencyCode"], outputs: ["valueChange"] }, { kind: "component", type: i1.FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: i1.FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: i1.DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: i1.DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
541
544
  }
542
545
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: CreateProductVariantDialogComponent, decorators: [{
543
546
  type: Component,
544
- args: [{ selector: 'vdr-create-product-variant-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.create-product-variant' | translate }}\r\n</ng-template>\r\n<form [formGroup]=\"form\">\r\n <div formGroupName=\"options\" class=\"form-grid\">\r\n <vdr-form-field [label]=\"optionGroup.name\" *ngFor=\"let optionGroup of product.optionGroups\">\r\n <ng-select\r\n [items]=\"optionGroup.options\"\r\n [formControlName]=\"optionGroup.code\"\r\n bindLabel=\"name\"\r\n bindValue=\"id\"\r\n appendTo=\"body\"\r\n >\r\n </ng-select>\r\n </vdr-form-field>\r\n <clr-alert\r\n *ngIf=\"product.optionGroups.length === 0\"\r\n clrAlertType=\"warning\"\r\n [clrAlertClosable]=\"false\"\r\n class=\"form-grid-span\"\r\n >\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.cannot-create-variants-without-options' | translate }}\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div *ngIf=\"existingVariant\" class=\"mt-2\">\r\n <clr-alert clrAlertType=\"warning\" [clrAlertClosable]=\"false\" class=\"\">\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.product-variant-exists' | translate }}: {{ existingVariant.name }} ({{\r\n existingVariant.sku\r\n }})\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"form-grid mt-2\">\r\n <vdr-form-field [label]=\"'common.name' | translate\">\r\n <input type=\"text\" formControlName=\"name\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'catalog.sku' | translate\">\r\n <input type=\"text\" formControlName=\"sku\" />\r\n </vdr-form-field>\r\n </div>\r\n</form>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"confirm()\"\r\n class=\"btn btn-primary\"\r\n [disabled]=\"form.invalid || existingVariant || product.optionGroups.length === 0\"\r\n >\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n" }]
547
+ args: [{ selector: 'vdr-create-product-variant-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.create-product-variant' | translate }}\r\n</ng-template>\r\n<form [formGroup]=\"form\">\r\n <div formGroupName=\"options\" class=\"form-grid\">\r\n <vdr-form-field [label]=\"optionGroup.name\" *ngFor=\"let optionGroup of product.optionGroups\">\r\n <ng-select [items]=\"optionGroup.options\" [formControlName]=\"optionGroup.code\" bindLabel=\"name\"\r\n bindValue=\"id\" appendTo=\"body\">\r\n </ng-select>\r\n </vdr-form-field>\r\n <clr-alert *ngIf=\"product.optionGroups.length === 0\" clrAlertType=\"warning\" [clrAlertClosable]=\"false\"\r\n class=\"form-grid-span\">\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.cannot-create-variants-without-options' | translate }}\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div *ngIf=\"existingVariant\" class=\"mt-2\">\r\n <clr-alert clrAlertType=\"warning\" [clrAlertClosable]=\"false\" class=\"\">\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ 'catalog.product-variant-exists' | translate }}: {{ existingVariant.name }} ({{\r\n existingVariant.sku\r\n }})\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n </div>\r\n <div class=\"form-grid mt-2\">\r\n <vdr-form-field [label]=\"'common.name' | translate\">\r\n <input type=\"text\" formControlName=\"name\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'catalog.sku' | translate\">\r\n <input type=\"text\" formControlName=\"sku\" />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'catalog.price' | translate\">\r\n <vdr-currency-input name=\"price\" [currencyCode]=\"currencyCode\" formControlName=\"price\" />\r\n </vdr-form-field>\r\n </div>\r\n</form>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"confirm()\" class=\"btn btn-primary\"\r\n [disabled]=\"form.invalid || existingVariant || product.optionGroups.length === 0\">\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>" }]
545
548
  }], ctorParameters: function () { return [{ type: i2.FormBuilder }]; } });
546
549
 
547
550
  const OPTION_VALUE_INPUT_VALUE_ACCESSOR = {
@@ -1183,7 +1186,7 @@ class AssetDetailComponent extends TypedBaseDetailComponent {
1183
1186
  this.detailForm = new FormGroup({
1184
1187
  name: new FormControl(''),
1185
1188
  tags: new FormControl([]),
1186
- customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
1189
+ customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)),
1187
1190
  });
1188
1191
  }
1189
1192
  ngOnInit() {
@@ -1886,7 +1889,7 @@ class CollectionDetailComponent extends TypedBaseDetailComponent {
1886
1889
  visible: false,
1887
1890
  inheritFilters: true,
1888
1891
  filters: this.formBuilder.array([]),
1889
- customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
1892
+ customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)),
1890
1893
  });
1891
1894
  this.assetChanges = {};
1892
1895
  this.filters = [];
@@ -2291,6 +2294,7 @@ class CollectionListComponent extends TypedBaseListComponent {
2291
2294
  this.expandedIds = [];
2292
2295
  this.customFields = this.getCustomFieldConfig('Collection');
2293
2296
  this.filters = this.createFilterCollection()
2297
+ .addIdFilter()
2294
2298
  .addDateFilters()
2295
2299
  .addFilter({
2296
2300
  name: 'slug',
@@ -2741,7 +2745,7 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2741
2745
  code: ['', Validators.required],
2742
2746
  name: '',
2743
2747
  visible: true,
2744
- customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
2748
+ customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)),
2745
2749
  }),
2746
2750
  values: this.formBuilder.array([]),
2747
2751
  });
@@ -3187,6 +3191,7 @@ class FacetListComponent extends TypedBaseListComponent {
3187
3191
  this.displayLimit = {};
3188
3192
  this.customFields = this.getCustomFieldConfig('Facet');
3189
3193
  this.filters = this.createFilterCollection()
3194
+ .addIdFilter()
3190
3195
  .addDateFilters()
3191
3196
  .addFilter({
3192
3197
  name: 'visibility',
@@ -3371,6 +3376,7 @@ class ProductVariantListComponent extends TypedBaseListComponent {
3371
3376
  this.hideLanguageSelect = false;
3372
3377
  this.customFields = this.getCustomFieldConfig('ProductVariant');
3373
3378
  this.filters = this.createFilterCollection()
3379
+ .addIdFilter()
3374
3380
  .addDateFilters()
3375
3381
  .addFilters([
3376
3382
  {
@@ -3379,12 +3385,6 @@ class ProductVariantListComponent extends TypedBaseListComponent {
3379
3385
  label: marker('common.name'),
3380
3386
  filterField: 'name',
3381
3387
  },
3382
- {
3383
- name: 'id',
3384
- type: { kind: 'text' },
3385
- label: marker('common.id'),
3386
- filterField: 'id',
3387
- },
3388
3388
  {
3389
3389
  name: 'enabled',
3390
3390
  type: { kind: 'boolean' },
@@ -3481,7 +3481,7 @@ class ProductDetailComponent extends TypedBaseDetailComponent {
3481
3481
  slug: ['', unicodePatternValidator(/^[\p{Letter}0-9._-]+$/)],
3482
3482
  description: '',
3483
3483
  facetValueIds: [[]],
3484
- customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
3484
+ customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)),
3485
3485
  });
3486
3486
  this.assetChanges = {};
3487
3487
  this.createVariantsConfig = { groups: [], variants: [], stockLocationId: '' };
@@ -3890,14 +3890,9 @@ class ProductListComponent extends TypedBaseListComponent {
3890
3890
  this.pendingSearchIndexUpdates = 0;
3891
3891
  this.customFields = this.getCustomFieldConfig('Product');
3892
3892
  this.filters = this.createFilterCollection()
3893
+ .addIdFilter()
3893
3894
  .addDateFilters()
3894
3895
  .addFilters([
3895
- {
3896
- name: 'id',
3897
- type: { kind: 'text' },
3898
- label: marker('common.id'),
3899
- filterField: 'id',
3900
- },
3901
3896
  {
3902
3897
  name: 'enabled',
3903
3898
  type: { kind: 'boolean' },
@@ -4138,7 +4133,7 @@ class ProductVariantDetailComponent extends TypedBaseDetailComponent {
4138
4133
  outOfStockThreshold: 0,
4139
4134
  trackInventory: GlobalFlag.TRUE,
4140
4135
  facetValueIds: [],
4141
- customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
4136
+ customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)),
4142
4137
  });
4143
4138
  this.stockLevelsForm = this.formBuilder.array([]);
4144
4139
  this.pricesForm = this.formBuilder.array([]);
@@ -4554,7 +4549,7 @@ class StockLocationDetailComponent extends TypedBaseDetailComponent {
4554
4549
  this.detailForm = this.formBuilder.group({
4555
4550
  name: ['', Validators.required],
4556
4551
  description: [''],
4557
- customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
4552
+ customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)),
4558
4553
  });
4559
4554
  }
4560
4555
  ngOnInit() {
@@ -4723,14 +4718,9 @@ class StockLocationListComponent extends TypedBaseListComponent {
4723
4718
  super();
4724
4719
  this.customFields = this.getCustomFieldConfig('StockLocation');
4725
4720
  this.filters = this.createFilterCollection()
4721
+ .addIdFilter()
4726
4722
  .addDateFilters()
4727
4723
  .addFilters([
4728
- {
4729
- name: 'id',
4730
- type: { kind: 'text' },
4731
- label: marker('common.id'),
4732
- filterField: 'id',
4733
- },
4734
4724
  {
4735
4725
  name: 'enabled',
4736
4726
  type: { kind: 'text' },