@vendure/admin-ui 2.1.6 → 2.2.0-next.1

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 (78) hide show
  1. package/catalog/catalog.module.d.ts +4 -3
  2. package/catalog/components/create-facet-value-dialog/create-facet-value-dialog.component.d.ts +19 -0
  3. package/catalog/components/facet-detail/facet-detail.component.d.ts +9 -12
  4. package/catalog/components/product-variant-list/product-variant-list.component.d.ts +2 -2
  5. package/catalog/public_api.d.ts +1 -0
  6. package/core/common/generated-types.d.ts +104 -43
  7. package/core/common/utilities/interpolate-description.d.ts +1 -1
  8. package/core/common/version.d.ts +1 -1
  9. package/core/components/app-shell/app-shell.component.d.ts +1 -0
  10. package/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.d.ts +9 -3
  11. package/core/core.module.d.ts +1 -1
  12. package/core/providers/currency/currency.service.d.ts +10 -0
  13. package/core/providers/i18n/i18n.service.d.ts +6 -0
  14. package/core/public_api.d.ts +1 -0
  15. package/core/shared/components/chart/chart.component.d.ts +3 -0
  16. package/core/shared/components/chart/tooltip-plugin.d.ts +16 -1
  17. package/core/shared/components/configurable-input/configurable-input.component.d.ts +3 -0
  18. package/core/shared/components/currency-input/currency-input.component.d.ts +6 -3
  19. package/core/shared/pipes/locale-currency.pipe.d.ts +5 -2
  20. package/esm2022/catalog/catalog.module.mjs +17 -3
  21. package/esm2022/catalog/components/create-facet-value-dialog/create-facet-value-dialog.component.mjs +44 -0
  22. package/esm2022/catalog/components/facet-detail/facet-detail.component.mjs +85 -120
  23. package/esm2022/catalog/components/facet-list/facet-list.component.mjs +5 -2
  24. package/esm2022/catalog/components/product-list/product-list.component.mjs +26 -14
  25. package/esm2022/catalog/components/product-variant-list/product-variant-list.component.mjs +36 -15
  26. package/esm2022/catalog/components/variant-price-detail/variant-price-detail.component.mjs +1 -1
  27. package/esm2022/catalog/public_api.mjs +2 -1
  28. package/esm2022/core/common/generated-types.mjs +5 -5
  29. package/esm2022/core/common/utilities/interpolate-description.mjs +3 -3
  30. package/esm2022/core/common/version.mjs +2 -2
  31. package/esm2022/core/components/app-shell/app-shell.component.mjs +15 -10
  32. package/esm2022/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.mjs +42 -273
  33. package/esm2022/core/core.module.mjs +13 -5
  34. package/esm2022/core/data/definitions/facet-definitions.mjs +2 -2
  35. package/esm2022/core/data/definitions/settings-definitions.mjs +2 -1
  36. package/esm2022/core/providers/currency/currency.service.mjs +21 -0
  37. package/esm2022/core/providers/i18n/i18n.service.mjs +11 -1
  38. package/esm2022/core/providers/localization/localization.service.mjs +4 -4
  39. package/esm2022/core/public_api.mjs +2 -1
  40. package/esm2022/core/shared/components/chart/chart.component.mjs +12 -5
  41. package/esm2022/core/shared/components/chart/tooltip-plugin.mjs +6 -14
  42. package/esm2022/core/shared/components/configurable-input/configurable-input.component.mjs +15 -13
  43. package/esm2022/core/shared/components/currency-input/currency-input.component.mjs +17 -14
  44. package/esm2022/core/shared/pipes/locale-currency.pipe.mjs +11 -7
  45. package/esm2022/dashboard/widgets/order-summary-widget/order-summary-widget.component.mjs +4 -4
  46. package/esm2022/react/react-hooks/use-query.mjs +61 -1
  47. package/fesm2022/vendure-admin-ui-catalog.mjs +197 -148
  48. package/fesm2022/vendure-admin-ui-catalog.mjs.map +1 -1
  49. package/fesm2022/vendure-admin-ui-core.mjs +130 -317
  50. package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
  51. package/fesm2022/vendure-admin-ui-dashboard.mjs +3 -3
  52. package/fesm2022/vendure-admin-ui-dashboard.mjs.map +1 -1
  53. package/fesm2022/vendure-admin-ui-react.mjs +61 -1
  54. package/fesm2022/vendure-admin-ui-react.mjs.map +1 -1
  55. package/package.json +14 -14
  56. package/react/react-hooks/use-query.d.ts +59 -0
  57. package/settings/components/administrator-list/administrator-list.component.d.ts +2 -0
  58. package/settings/components/stock-location-list/stock-location-list.component.d.ts +1 -1
  59. package/static/i18n-messages/ar.json +1 -2
  60. package/static/i18n-messages/cs.json +1 -2
  61. package/static/i18n-messages/de.json +1 -2
  62. package/static/i18n-messages/en.json +1 -2
  63. package/static/i18n-messages/es.json +1 -2
  64. package/static/i18n-messages/fa.json +3 -4
  65. package/static/i18n-messages/fr.json +1 -2
  66. package/static/i18n-messages/he.json +1 -2
  67. package/static/i18n-messages/hr.json +1 -2
  68. package/static/i18n-messages/it.json +2 -3
  69. package/static/i18n-messages/nb.json +795 -0
  70. package/static/i18n-messages/ne.json +2 -3
  71. package/static/i18n-messages/pl.json +1 -2
  72. package/static/i18n-messages/pt_BR.json +1 -1
  73. package/static/i18n-messages/pt_PT.json +1 -2
  74. package/static/i18n-messages/ru.json +1 -2
  75. package/static/i18n-messages/uk.json +1 -2
  76. package/static/i18n-messages/zh_Hans.json +1 -2
  77. package/static/i18n-messages/zh_Hant.json +1 -2
  78. package/static/vendure-ui-config.json +262 -6
@@ -4,11 +4,12 @@ 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, 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, FACET_WITH_VALUE_LIST_FRAGMENT, GetFacetListDocument, GetStockLocationListDocument, ProductVariantListQueryDocument, PRODUCT_DETAIL_FRAGMENT, isMultiChannel, FacetValueFormInputComponent, ProductListQueryDocument, JobState, GetProductVariantsQuickJumpDocument, GlobalFlag, ProductVariantUpdateMutationDocument, detailComponentWithResolver, GetProductDetailDocument, 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_VALUE_LIST_FRAGMENT, GetFacetDetailDocument, getChannelCodeFromUserStatus, currentChannelIsNotDefault, GetFacetListDocument, GetStockLocationListDocument, ProductVariantListQueryDocument, PRODUCT_DETAIL_FRAGMENT, isMultiChannel, FacetValueFormInputComponent, ProductListQueryDocument, JobState, GetProductVariantsQuickJumpDocument, GlobalFlag, ProductVariantUpdateMutationDocument, detailComponentWithResolver, GetProductDetailDocument, GetProductVariantDetailDocument, CollectionDetailQueryDocument, AssetDetailQueryDocument, SharedModule, PageService } from '@vendure/admin-ui/core';
8
+ import { SortOrder as SortOrder$1 } from '@vendure/common/lib/generated-types';
8
9
  import { shareReplay, mergeMap, map, switchMap, tap, take, startWith, debounceTime, takeUntil, finalize, distinctUntilChanged, filter, catchError, delay, skip, switchMapTo } from 'rxjs/operators';
9
10
  import * as i2 from '@angular/forms';
10
11
  import { UntypedFormGroup, UntypedFormArray, Validators, FormControl, NG_VALUE_ACCESSOR, FormGroup, UntypedFormControl } from '@angular/forms';
11
- import { forkJoin, of, throwError, combineLatest, Subject, EMPTY, BehaviorSubject, from, lastValueFrom, merge, Observable, concat } from 'rxjs';
12
+ import { forkJoin, of, throwError, combineLatest, Subject, EMPTY, BehaviorSubject, from, lastValueFrom, merge, concat } from 'rxjs';
12
13
  import { normalizeString } from '@vendure/common/lib/normalize-string';
13
14
  import { notNullOrUndefined, generateAllCombinations } from '@vendure/common/lib/shared-utils';
14
15
  import * as i3 from '@clr/angular';
@@ -2711,13 +2712,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
2711
2712
  args: [{ selector: 'vdr-confirm-variant-deletion-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.confirm-deletion-of-unused-variants-title' | translate }}\r\n</ng-template>\r\n{{ 'catalog.confirm-deletion-of-unused-variants-body' | translate }}\r\n<ul>\r\n <li *ngFor=\"let variant of variants\">{{ variant.name }} ({{ variant.sku }})</li>\r\n</ul>\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 {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n" }]
2712
2713
  }] });
2713
2714
 
2715
+ class CreateFacetValueDialogComponent {
2716
+ constructor(formBuilder) {
2717
+ this.formBuilder = formBuilder;
2718
+ this.form = this.formBuilder.group({
2719
+ name: ['', Validators.required],
2720
+ code: ['', Validators.required],
2721
+ });
2722
+ }
2723
+ updateCode() {
2724
+ const nameControl = this.form.get('name');
2725
+ const codeControl = this.form.get('code');
2726
+ if (nameControl && codeControl && codeControl.pristine) {
2727
+ codeControl.setValue(normalizeString(`${nameControl.value}`, '-'));
2728
+ }
2729
+ }
2730
+ confirm() {
2731
+ const { name, code } = this.form.value;
2732
+ if (!name || !code) {
2733
+ return;
2734
+ }
2735
+ this.resolveWith({
2736
+ facetId: this.facetId,
2737
+ code,
2738
+ translations: [{ languageCode: this.languageCode, name }],
2739
+ });
2740
+ }
2741
+ cancel() {
2742
+ this.resolveWith();
2743
+ }
2744
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: CreateFacetValueDialogComponent, deps: [{ token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
2745
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: CreateFacetValueDialogComponent, selector: "vdr-create-facet-value-dialog", ngImport: i0, template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.create-facet-value' | translate }}\r\n</ng-template>\r\n<div class=\"form-grid\" [formGroup]=\"form\">\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input id=\"name\" type=\"text\" formControlName=\"name\" (input)=\"updateCode()\" />\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'common.code' | translate\"\r\n for=\"code\"\r\n >\r\n <input\r\n id=\"code\"\r\n type=\"text\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n</div>\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\" [disabled]=\"form.invalid\">\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ 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: "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 }); }
2746
+ }
2747
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: CreateFacetValueDialogComponent, decorators: [{
2748
+ type: Component,
2749
+ args: [{ selector: 'vdr-create-facet-value-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.create-facet-value' | translate }}\r\n</ng-template>\r\n<div class=\"form-grid\" [formGroup]=\"form\">\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input id=\"name\" type=\"text\" formControlName=\"name\" (input)=\"updateCode()\" />\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'common.code' | translate\"\r\n for=\"code\"\r\n >\r\n <input\r\n id=\"code\"\r\n type=\"text\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n</div>\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\" [disabled]=\"form.invalid\">\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n" }]
2750
+ }], ctorParameters: function () { return [{ type: i2.FormBuilder }]; } });
2751
+
2714
2752
  const FACET_DETAIL_QUERY = gql `
2715
- query GetFacetDetail($id: ID!) {
2753
+ query GetFacetDetail($id: ID!, $facetValueListOptions: FacetValueListOptions) {
2716
2754
  facet(id: $id) {
2717
- ...FacetWithValues
2755
+ ...FacetWithValueList
2718
2756
  }
2719
2757
  }
2720
- ${FACET_WITH_VALUES_FRAGMENT}
2758
+ ${FACET_WITH_VALUE_LIST_FRAGMENT}
2721
2759
  `;
2722
2760
  class FacetDetailComponent extends TypedBaseDetailComponent {
2723
2761
  constructor(changeDetector, dataService, formBuilder, notificationService, modalService) {
@@ -2740,25 +2778,19 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2740
2778
  });
2741
2779
  this.currentPage = 1;
2742
2780
  this.itemsPerPage = 10;
2781
+ this.totalItems = 0;
2743
2782
  this.filterControl = new FormControl('');
2744
2783
  this.values$ = new BehaviorSubject([]);
2745
- this.filteredValues$ = new Observable();
2746
2784
  this.updatePermission = [Permission.UpdateCatalog, Permission.UpdateFacet];
2747
2785
  }
2748
2786
  ngOnInit() {
2749
2787
  this.init();
2750
- this.filteredValues$ = combineLatest([
2751
- this.values$,
2752
- this.filterControl.valueChanges.pipe(startWith('')),
2753
- ]).pipe(map(([values, filterTerm]) => {
2754
- const filterString = filterTerm?.toLowerCase().trim();
2755
- return filterString
2756
- ? values.filter(v => v.name.toLowerCase().includes(filterString) ||
2757
- v.code.toLowerCase().includes(filterString))
2758
- : values;
2759
- }), tap(() => {
2788
+ this.filterControl.valueChanges
2789
+ .pipe(debounceTime(200), takeUntil(this.destroy$))
2790
+ .subscribe(filterTerm => {
2760
2791
  this.currentPage = 1;
2761
- }));
2792
+ this.fetchFacetValues(this.currentPage, this.itemsPerPage, filterTerm);
2793
+ });
2762
2794
  }
2763
2795
  ngOnDestroy() {
2764
2796
  this.destroy();
@@ -2783,31 +2815,30 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2783
2815
  return !!this.detailForm.get(['values', index, 'customFields', name]);
2784
2816
  }
2785
2817
  addFacetValue() {
2786
- const valuesFormRecord = this.detailForm.get('values');
2787
- if (valuesFormRecord) {
2788
- const id = this.createTempId();
2789
- const valueGroup = this.formBuilder.group({
2790
- id,
2791
- name: ['', Validators.required],
2792
- code: '',
2793
- customFields: this.formBuilder.group({}),
2794
- });
2795
- const newValue = { id, name: '', code: '' };
2796
- if (this.customValueFields.length) {
2797
- const customValueFieldsGroup = new UntypedFormGroup({});
2798
- newValue.customFields = {};
2799
- for (const fieldDef of this.customValueFields) {
2800
- const key = fieldDef.name;
2801
- customValueFieldsGroup.addControl(key, new UntypedFormControl());
2802
- }
2803
- valueGroup.addControl('customFields', customValueFieldsGroup);
2818
+ this.modalService
2819
+ .fromComponent(CreateFacetValueDialogComponent, {
2820
+ locals: {
2821
+ languageCode: this.languageCode,
2822
+ facetId: this.id,
2823
+ },
2824
+ })
2825
+ .pipe(switchMap(result => {
2826
+ if (!result) {
2827
+ return EMPTY;
2804
2828
  }
2805
- valuesFormRecord.addControl(id, valueGroup);
2806
- const values = this.values$.value;
2807
- const endOfPageIndex = this.currentPage * this.itemsPerPage - 1;
2808
- values.splice(endOfPageIndex, 0, newValue);
2809
- this.values$.next(values);
2810
- }
2829
+ else {
2830
+ return this.dataService.facet.createFacetValues([result]);
2831
+ }
2832
+ }))
2833
+ .subscribe(result => {
2834
+ if (result.createFacetValues) {
2835
+ this.notificationService.success(marker('common.notify-create-success'), {
2836
+ entity: 'FacetValue',
2837
+ });
2838
+ this.currentPage = 1;
2839
+ this.fetchFacetValues(this.currentPage, this.itemsPerPage);
2840
+ }
2841
+ });
2811
2842
  }
2812
2843
  create() {
2813
2844
  const facetForm = this.detailForm.get('facet');
@@ -2823,7 +2854,6 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2823
2854
  name: '',
2824
2855
  code: '',
2825
2856
  translations: [],
2826
- values: [],
2827
2857
  }, facetForm, this.languageCode);
2828
2858
  this.dataService.facet.createFacet(newFacet).subscribe(data => {
2829
2859
  this.notificationService.success(marker('common.notify-create-success'), { entity: 'Facet' });
@@ -2843,19 +2873,13 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2843
2873
  const facetForm = this.detailForm.get('facet');
2844
2874
  const updateOperations = [];
2845
2875
  if (facetForm && facetForm.dirty) {
2846
- const newFacet = this.getUpdatedFacet(facet, facetForm, languageCode);
2847
- if (newFacet) {
2848
- updateOperations.push(this.dataService.facet.updateFacet(newFacet));
2876
+ const updatedFacetInput = this.getUpdatedFacet(facet, facetForm, languageCode);
2877
+ if (updatedFacetInput) {
2878
+ updateOperations.push(this.dataService.facet.updateFacet(updatedFacetInput));
2849
2879
  }
2850
2880
  }
2851
2881
  if (valuesFormRecord && valuesFormRecord.dirty) {
2852
- const createdValues = this.getCreatedFacetValues(facet, valuesFormRecord, languageCode);
2853
- if (createdValues.length) {
2854
- updateOperations.push(this.dataService.facet.createFacetValues(createdValues).pipe(switchMap(() => this.dataService.query(GetFacetDetailDocument, {
2855
- id: this.id,
2856
- }).single$)));
2857
- }
2858
- const updatedValues = this.getUpdatedFacetValues(facet, valuesFormRecord, languageCode);
2882
+ const updatedValues = this.getUpdatedFacetValues(valuesFormRecord, languageCode);
2859
2883
  if (updatedValues.length) {
2860
2884
  updateOperations.push(this.dataService.facet.updateFacetValues(updatedValues));
2861
2885
  }
@@ -2873,16 +2897,6 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2873
2897
  });
2874
2898
  }
2875
2899
  deleteFacetValue(facetValueId) {
2876
- if (this.isTempId(facetValueId)) {
2877
- // deleting a newly-added (not persisted) FacetValue
2878
- const valuesFormRecord = this.detailForm.get('values');
2879
- if (valuesFormRecord) {
2880
- valuesFormRecord.removeControl(facetValueId);
2881
- }
2882
- const values = this.values$.value;
2883
- this.values$.next(values.filter(v => v.id !== facetValueId));
2884
- return;
2885
- }
2886
2900
  this.showModalAndDelete(facetValueId)
2887
2901
  .pipe(switchMap(response => {
2888
2902
  if (response.result === DeletionResult.DELETED) {
@@ -2897,13 +2911,10 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2897
2911
  }).single$
2898
2912
  : []))
2899
2913
  .subscribe(() => {
2900
- const valuesFormRecord = this.detailForm.get('values');
2901
- if (valuesFormRecord) {
2902
- valuesFormRecord.removeControl(facetValueId);
2903
- }
2904
2914
  this.notificationService.success(marker('common.notify-delete-success'), {
2905
2915
  entity: 'FacetValue',
2906
2916
  });
2917
+ this.fetchFacetValues(this.currentPage, this.itemsPerPage, this.filterControl.value);
2907
2918
  }, err => {
2908
2919
  this.notificationService.error(marker('common.notify-delete-error'), {
2909
2920
  entity: 'FacetValue',
@@ -2922,6 +2933,35 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2922
2933
  })
2923
2934
  .pipe(switchMap(result => result ? this.dataService.facet.deleteFacetValues([facetValueId], !!message) : EMPTY), map(result => result.deleteFacetValues[0]));
2924
2935
  }
2936
+ setCurrentPage(newPage) {
2937
+ this.currentPage = newPage;
2938
+ this.fetchFacetValues(this.currentPage, this.itemsPerPage, this.filterControl.value);
2939
+ }
2940
+ setItemsPerPage(itemsPerPage) {
2941
+ this.itemsPerPage = itemsPerPage;
2942
+ this.fetchFacetValues(this.currentPage, this.itemsPerPage, this.filterControl.value);
2943
+ }
2944
+ fetchFacetValues(currentPage, itemsPerPage, filterTerm) {
2945
+ this.dataService
2946
+ .query(FACET_DETAIL_QUERY, {
2947
+ id: this.id,
2948
+ facetValueListOptions: {
2949
+ take: itemsPerPage,
2950
+ skip: (currentPage - 1) * itemsPerPage,
2951
+ sort: {
2952
+ createdAt: SortOrder$1.DESC,
2953
+ },
2954
+ ...(filterTerm ? { filter: { name: { contains: filterTerm } } } : {}),
2955
+ },
2956
+ })
2957
+ .single$.subscribe(({ facet }) => {
2958
+ if (facet) {
2959
+ this.values$.next([...facet.valueList.items]);
2960
+ this.totalItems = facet.valueList.totalItems;
2961
+ this.setFacetValueFormValues(facet, this.languageCode);
2962
+ }
2963
+ });
2964
+ }
2925
2965
  /**
2926
2966
  * Sets the values of the form on changes to the facet or current language.
2927
2967
  */
@@ -2937,9 +2977,13 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2937
2977
  if (this.customFields.length) {
2938
2978
  this.setCustomFieldFormValues(this.customFields, this.detailForm.get(['facet', 'customFields']), facet, currentTranslation);
2939
2979
  }
2980
+ this.values$.next([...facet.valueList.items]);
2981
+ this.totalItems = facet.valueList.totalItems;
2982
+ this.setFacetValueFormValues(facet, languageCode);
2983
+ }
2984
+ setFacetValueFormValues(facet, languageCode) {
2940
2985
  const currentValuesFormGroup = this.detailForm.get('values');
2941
- this.values$.next([...facet.values]);
2942
- facet.values.forEach(value => {
2986
+ facet.valueList.items.forEach(value => {
2943
2987
  const valueTranslation = findTranslation(value, languageCode);
2944
2988
  const group = {
2945
2989
  id: value.id,
@@ -2947,12 +2991,7 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2947
2991
  name: valueTranslation ? valueTranslation.name : '',
2948
2992
  };
2949
2993
  let valueControl = currentValuesFormGroup.get(value.id);
2950
- if (valueControl) {
2951
- valueControl.get('id')?.setValue(group.id);
2952
- valueControl.get('code')?.setValue(group.code);
2953
- valueControl.get('name')?.setValue(group.name);
2954
- }
2955
- else {
2994
+ if (!valueControl) {
2956
2995
  valueControl = this.formBuilder.group(group);
2957
2996
  currentValuesFormGroup.addControl(value.id, valueControl);
2958
2997
  }
@@ -2998,50 +3037,18 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
2998
3037
  input.isPrivate = !facetFormGroup.value.visible;
2999
3038
  return input;
3000
3039
  }
3001
- /**
3002
- * Given an array of facet values and the values from the detailForm, this method creates a new array
3003
- * which can be persisted to the API via a createFacetValues mutation.
3004
- */
3005
- getCreatedFacetValues(facet, valuesFormRecord, languageCode) {
3006
- return Object.values(valuesFormRecord.controls)
3007
- .filter(c => c.value.id && this.isTempId(c.value.id))
3008
- .map(c => c.value)
3009
- .map(value => createUpdatedTranslatable({
3010
- translatable: { ...value, translations: [] },
3011
- updatedFields: value ?? {},
3012
- customFieldConfig: this.customValueFields,
3013
- languageCode,
3014
- defaultTranslation: {
3015
- languageCode,
3016
- name: '',
3017
- },
3018
- }))
3019
- .map(input => ({
3020
- facetId: facet.id,
3021
- code: input.code ?? '',
3022
- ...input,
3023
- id: undefined,
3024
- }));
3025
- }
3026
3040
  /**
3027
3041
  * Given an array of facet values and the values from the detailForm, this method creates a new array
3028
3042
  * which can be persisted to the API via an updateFacetValues mutation.
3029
3043
  */
3030
- getUpdatedFacetValues(facet, valuesFormGroup, languageCode) {
3031
- const dirtyValues = facet.values.filter(v => {
3032
- const formRow = valuesFormGroup.get(v.id);
3033
- return formRow && formRow.dirty && formRow.value.id;
3034
- });
3044
+ getUpdatedFacetValues(valuesFormGroup, languageCode) {
3035
3045
  const dirtyValueValues = Object.values(valuesFormGroup.controls)
3036
- .filter(c => c.dirty && !this.isTempId(c.value.id))
3046
+ .filter(c => c.dirty)
3037
3047
  .map(c => c.value);
3038
- if (dirtyValues.length !== dirtyValueValues.length) {
3039
- throw new Error(marker(`error.facet-value-form-values-do-not-match`));
3040
- }
3041
- return dirtyValues
3048
+ return dirtyValueValues
3042
3049
  .map((value, i) => createUpdatedTranslatable({
3043
3050
  translatable: value,
3044
- updatedFields: dirtyValueValues[i],
3051
+ updatedFields: value,
3045
3052
  customFieldConfig: this.customValueFields,
3046
3053
  languageCode,
3047
3054
  defaultTranslation: {
@@ -3051,18 +3058,12 @@ class FacetDetailComponent extends TypedBaseDetailComponent {
3051
3058
  }))
3052
3059
  .filter(notNullOrUndefined);
3053
3060
  }
3054
- createTempId() {
3055
- return `temp-${Math.random().toString(36).substr(2, 9)}`;
3056
- }
3057
- isTempId(id) {
3058
- return id.startsWith('temp-');
3059
- }
3060
3061
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FacetDetailComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.DataService }, { token: i2.FormBuilder }, { token: i1.NotificationService }, { token: i1.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
3061
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FacetDetailComponent, selector: "vdr-facet-detail", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [disabled]=\"isNew$ | async\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"facet-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n *ngIf=\"isNew$ | async; else updateButton\"\r\n (click)=\"create()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.create' | translate }}\r\n </button>\r\n <ng-template #updateButton>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </ng-template>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<form class=\"form\" [formGroup]=\"detailForm\">\r\n <vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar formGroupName=\"facet\">\r\n <vdr-card>\r\n <vdr-form-field [label]=\"'catalog.visibility' | translate\" for=\"visibility\">\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n [vdrDisabled]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"visible\"\r\n id=\"visibility\"\r\n />\r\n <label class=\"visible-toggle\">\r\n <ng-container *ngIf=\"detailForm.value.facet?.visible; else private\">{{\r\n 'catalog.public' | translate\r\n }}</ng-container>\r\n <ng-template #private>{{ 'catalog.private' | translate }}</ng-template>\r\n </label>\r\n </clr-toggle-wrapper>\r\n </vdr-form-field>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <vdr-page-block>\r\n <vdr-card formGroupName=\"facet\">\r\n <div class=\"form-grid\">\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateCode(entity?.code, $event.target.value)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.code' | translate\" for=\"code\">\r\n <input\r\n id=\"code\"\r\n type=\"text\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Facet\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('facet.customFields')\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </vdr-card>\r\n\r\n <vdr-custom-detail-component-host\r\n locationId=\"facet-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card\r\n *ngIf=\"!(isNew$ | async)\"\r\n [title]=\"'catalog.facet-values' | translate\"\r\n [paddingX]=\"false\"\r\n >\r\n <ng-template vdrCardControls>\r\n <input\r\n type=\"text\"\r\n class=\"mr-3\"\r\n [formControl]=\"filterControl\"\r\n [placeholder]=\"'catalog.filter-by-name' | translate\"\r\n />\r\n </ng-template>\r\n <ng-container *ngIf=\"filteredValues$ | async as filteredValues\">\r\n <table class=\"facet-values-list table\" formArrayName=\"values\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>{{ 'common.code' | translate }}</th>\r\n <ng-container *ngIf=\"customValueFields.length\">\r\n <th>{{ 'common.custom-fields' | translate }}</th>\r\n </ng-container>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n class=\"facet-value\"\r\n *ngFor=\"\r\n let value of filteredValues\r\n | paginate\r\n : {\r\n currentPage: currentPage,\r\n itemsPerPage: itemsPerPage,\r\n totalItems: filteredValues.length\r\n };\r\n let i = index\r\n \"\r\n [formGroup]=\"detailForm.get(['values', value.id])\"\r\n >\r\n <td class=\"align-middle\">\r\n <vdr-entity-info [entity]=\"value\"></vdr-entity-info>\r\n </td>\r\n <td class=\"align-middle\">\r\n <input\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateValueCode(value.code, $event.target.value, value.id)\"\r\n />\r\n </td>\r\n <td class=\"align-middle\">\r\n <input type=\"text\" formControlName=\"code\" />\r\n </td>\r\n <td class=\"\" *ngIf=\"customValueFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"FacetValue\"\r\n [customFields]=\"customValueFields\"\r\n [compact]=\"true\"\r\n [customFieldsFormGroup]=\"\r\n detailForm.get(['values', value.id, 'customFields'])\r\n \"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </td>\r\n <td class=\"align-middle\">\r\n <vdr-dropdown>\r\n <button type=\"button\" class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteFacetValue(value.id)\"\r\n [disabled]=\"!(updatePermission | hasPermission)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div class=\"pagination-wrapper\">\r\n <vdr-items-per-page-controls\r\n [itemsPerPage]=\"itemsPerPage\"\r\n (itemsPerPageChange)=\"itemsPerPage = $event\"\r\n ></vdr-items-per-page-controls>\r\n <vdr-pagination-controls\r\n [currentPage]=\"currentPage\"\r\n [itemsPerPage]=\"itemsPerPage\"\r\n [totalItems]=\"filteredValues.length\"\r\n (pageChange)=\"currentPage = $event\"\r\n ></vdr-pagination-controls>\r\n </div>\r\n </ng-container>\r\n <div>\r\n <button\r\n type=\"button\"\r\n class=\"button m-3\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateFacet']\"\r\n (click)=\"addFacetValue()\"\r\n >\r\n <clr-icon shape=\"add\"></clr-icon>\r\n {{ 'catalog.add-facet-value' | translate }}\r\n </button>\r\n </div>\r\n </vdr-card>\r\n </vdr-page-block>\r\n </vdr-page-detail-layout>\r\n</form>\r\n", styles: [".visible-toggle{margin-top:-3px!important}tr.facet-value td{vertical-align:middle}.pagination-wrapper{display:flex;justify-content:space-between;padding:var(--card-padding)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i3.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i3.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { 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.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["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: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.ItemsPerPageControlsComponent, selector: "vdr-items-per-page-controls", inputs: ["itemsPerPage"], outputs: ["itemsPerPageChange"] }, { kind: "component", type: i1.PaginationControlsComponent, selector: "vdr-pagination-controls", inputs: ["id", "currentPage", "itemsPerPage", "totalItems"], outputs: ["pageChange"] }, { 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: "component", type: i1.LanguageSelectorComponent, selector: "vdr-language-selector", inputs: ["currentLanguageCode", "availableLanguageCodes", "disabled"], outputs: ["languageCodeChange"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "directive", type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "directive", type: i1.DisabledDirective, selector: "[vdrDisabled]", inputs: ["vdrDisabled"] }, { kind: "component", type: i1.EntityInfoComponent, selector: "vdr-entity-info", inputs: ["small", "entity"] }, { kind: "component", type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "component", type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: i1.PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: i1.PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: i1.PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "directive", type: i1.CardControlsDirective, selector: "[vdrCardControls]" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5$2.PaginatePipe, name: "paginate" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.HasPermissionPipe, name: "hasPermission" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3062
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: FacetDetailComponent, selector: "vdr-facet-detail", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [disabled]=\"isNew$ | async\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"facet-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n *ngIf=\"isNew$ | async; else updateButton\"\r\n (click)=\"create()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.create' | translate }}\r\n </button>\r\n <ng-template #updateButton>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </ng-template>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<form class=\"form\" [formGroup]=\"detailForm\">\r\n <vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar formGroupName=\"facet\">\r\n <vdr-card>\r\n <vdr-form-field [label]=\"'catalog.visibility' | translate\" for=\"visibility\">\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n [vdrDisabled]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"visible\"\r\n id=\"visibility\"\r\n />\r\n <label class=\"visible-toggle\">\r\n <ng-container *ngIf=\"detailForm.value.facet?.visible; else private\">{{\r\n 'catalog.public' | translate\r\n }}</ng-container>\r\n <ng-template #private>{{ 'catalog.private' | translate }}</ng-template>\r\n </label>\r\n </clr-toggle-wrapper>\r\n </vdr-form-field>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <vdr-page-block>\r\n <vdr-card formGroupName=\"facet\">\r\n <div class=\"form-grid\">\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateCode(entity?.code, $event.target.value)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.code' | translate\" for=\"code\">\r\n <input\r\n id=\"code\"\r\n type=\"text\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Facet\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('facet.customFields')\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </vdr-card>\r\n\r\n <vdr-custom-detail-component-host\r\n locationId=\"facet-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card\r\n *ngIf=\"!(isNew$ | async)\"\r\n [title]=\"'catalog.facet-values' | translate\"\r\n [paddingX]=\"false\"\r\n >\r\n <ng-template vdrCardControls>\r\n <input\r\n type=\"text\"\r\n class=\"mr-3\"\r\n [formControl]=\"filterControl\"\r\n [placeholder]=\"'catalog.filter-by-name' | translate\"\r\n />\r\n </ng-template>\r\n <ng-container *ngIf=\"values$ | async as filteredValues\">\r\n <table class=\"facet-values-list table\" formArrayName=\"values\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>{{ 'common.code' | translate }}</th>\r\n <ng-container *ngIf=\"customValueFields.length\">\r\n <th>{{ 'common.custom-fields' | translate }}</th>\r\n </ng-container>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n class=\"facet-value\"\r\n *ngFor=\"\r\n let value of filteredValues\r\n | paginate\r\n : {\r\n currentPage: currentPage,\r\n itemsPerPage: itemsPerPage,\r\n totalItems: totalItems,\r\n };\r\n let i = index\r\n \"\r\n [formGroup]=\"detailForm.get(['values', value.id])\"\r\n >\r\n <td class=\"align-middle\">\r\n <vdr-entity-info [entity]=\"value\"></vdr-entity-info>\r\n </td>\r\n <td class=\"align-middle\">\r\n <input\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateValueCode(value.code, $event.target.value, value.id)\"\r\n />\r\n </td>\r\n <td class=\"align-middle\">\r\n <input type=\"text\" formControlName=\"code\" />\r\n </td>\r\n <td class=\"\" *ngIf=\"customValueFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"FacetValue\"\r\n [customFields]=\"customValueFields\"\r\n [compact]=\"true\"\r\n [customFieldsFormGroup]=\"\r\n detailForm.get(['values', value.id, 'customFields'])\r\n \"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </td>\r\n <td class=\"align-middle\">\r\n <vdr-dropdown>\r\n <button type=\"button\" class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteFacetValue(value.id)\"\r\n [disabled]=\"!(updatePermission | hasPermission)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div class=\"pagination-wrapper\">\r\n <vdr-items-per-page-controls\r\n [itemsPerPage]=\"itemsPerPage\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n ></vdr-items-per-page-controls>\r\n <vdr-pagination-controls\r\n [currentPage]=\"currentPage\"\r\n [itemsPerPage]=\"itemsPerPage\"\r\n [totalItems]=\"totalItems\"\r\n (pageChange)=\"setCurrentPage($event)\"\r\n ></vdr-pagination-controls>\r\n </div>\r\n </ng-container>\r\n <div>\r\n <button\r\n type=\"button\"\r\n class=\"button m-3\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateFacet']\"\r\n (click)=\"addFacetValue()\"\r\n >\r\n <clr-icon shape=\"add\"></clr-icon>\r\n {{ 'catalog.add-facet-value' | translate }}\r\n </button>\r\n </div>\r\n </vdr-card>\r\n </vdr-page-block>\r\n </vdr-page-detail-layout>\r\n</form>\r\n", styles: [".visible-toggle{margin-top:-3px!important}tr.facet-value td{vertical-align:middle}.pagination-wrapper{display:flex;justify-content:space-between;padding:var(--card-padding)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i3.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i3.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { 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.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["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: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.ItemsPerPageControlsComponent, selector: "vdr-items-per-page-controls", inputs: ["itemsPerPage"], outputs: ["itemsPerPageChange"] }, { kind: "component", type: i1.PaginationControlsComponent, selector: "vdr-pagination-controls", inputs: ["id", "currentPage", "itemsPerPage", "totalItems"], outputs: ["pageChange"] }, { 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: "component", type: i1.LanguageSelectorComponent, selector: "vdr-language-selector", inputs: ["currentLanguageCode", "availableLanguageCodes", "disabled"], outputs: ["languageCodeChange"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "directive", type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "directive", type: i1.DisabledDirective, selector: "[vdrDisabled]", inputs: ["vdrDisabled"] }, { kind: "component", type: i1.EntityInfoComponent, selector: "vdr-entity-info", inputs: ["small", "entity"] }, { kind: "component", type: i1.TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "component", type: i1.CustomDetailComponentHostComponent, selector: "vdr-custom-detail-component-host", inputs: ["locationId", "entity$", "detailForm"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "component", type: i1.PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: i1.PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: i1.PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: i1.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "directive", type: i1.CardControlsDirective, selector: "[vdrCardControls]" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5$2.PaginatePipe, name: "paginate" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.HasPermissionPipe, name: "hasPermission" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3062
3063
  }
3063
3064
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: FacetDetailComponent, decorators: [{
3064
3065
  type: Component,
3065
- args: [{ selector: 'vdr-facet-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [disabled]=\"isNew$ | async\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"facet-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n *ngIf=\"isNew$ | async; else updateButton\"\r\n (click)=\"create()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.create' | translate }}\r\n </button>\r\n <ng-template #updateButton>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </ng-template>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<form class=\"form\" [formGroup]=\"detailForm\">\r\n <vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar formGroupName=\"facet\">\r\n <vdr-card>\r\n <vdr-form-field [label]=\"'catalog.visibility' | translate\" for=\"visibility\">\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n [vdrDisabled]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"visible\"\r\n id=\"visibility\"\r\n />\r\n <label class=\"visible-toggle\">\r\n <ng-container *ngIf=\"detailForm.value.facet?.visible; else private\">{{\r\n 'catalog.public' | translate\r\n }}</ng-container>\r\n <ng-template #private>{{ 'catalog.private' | translate }}</ng-template>\r\n </label>\r\n </clr-toggle-wrapper>\r\n </vdr-form-field>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <vdr-page-block>\r\n <vdr-card formGroupName=\"facet\">\r\n <div class=\"form-grid\">\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateCode(entity?.code, $event.target.value)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.code' | translate\" for=\"code\">\r\n <input\r\n id=\"code\"\r\n type=\"text\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Facet\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('facet.customFields')\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </vdr-card>\r\n\r\n <vdr-custom-detail-component-host\r\n locationId=\"facet-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card\r\n *ngIf=\"!(isNew$ | async)\"\r\n [title]=\"'catalog.facet-values' | translate\"\r\n [paddingX]=\"false\"\r\n >\r\n <ng-template vdrCardControls>\r\n <input\r\n type=\"text\"\r\n class=\"mr-3\"\r\n [formControl]=\"filterControl\"\r\n [placeholder]=\"'catalog.filter-by-name' | translate\"\r\n />\r\n </ng-template>\r\n <ng-container *ngIf=\"filteredValues$ | async as filteredValues\">\r\n <table class=\"facet-values-list table\" formArrayName=\"values\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>{{ 'common.code' | translate }}</th>\r\n <ng-container *ngIf=\"customValueFields.length\">\r\n <th>{{ 'common.custom-fields' | translate }}</th>\r\n </ng-container>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n class=\"facet-value\"\r\n *ngFor=\"\r\n let value of filteredValues\r\n | paginate\r\n : {\r\n currentPage: currentPage,\r\n itemsPerPage: itemsPerPage,\r\n totalItems: filteredValues.length\r\n };\r\n let i = index\r\n \"\r\n [formGroup]=\"detailForm.get(['values', value.id])\"\r\n >\r\n <td class=\"align-middle\">\r\n <vdr-entity-info [entity]=\"value\"></vdr-entity-info>\r\n </td>\r\n <td class=\"align-middle\">\r\n <input\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateValueCode(value.code, $event.target.value, value.id)\"\r\n />\r\n </td>\r\n <td class=\"align-middle\">\r\n <input type=\"text\" formControlName=\"code\" />\r\n </td>\r\n <td class=\"\" *ngIf=\"customValueFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"FacetValue\"\r\n [customFields]=\"customValueFields\"\r\n [compact]=\"true\"\r\n [customFieldsFormGroup]=\"\r\n detailForm.get(['values', value.id, 'customFields'])\r\n \"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </td>\r\n <td class=\"align-middle\">\r\n <vdr-dropdown>\r\n <button type=\"button\" class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteFacetValue(value.id)\"\r\n [disabled]=\"!(updatePermission | hasPermission)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div class=\"pagination-wrapper\">\r\n <vdr-items-per-page-controls\r\n [itemsPerPage]=\"itemsPerPage\"\r\n (itemsPerPageChange)=\"itemsPerPage = $event\"\r\n ></vdr-items-per-page-controls>\r\n <vdr-pagination-controls\r\n [currentPage]=\"currentPage\"\r\n [itemsPerPage]=\"itemsPerPage\"\r\n [totalItems]=\"filteredValues.length\"\r\n (pageChange)=\"currentPage = $event\"\r\n ></vdr-pagination-controls>\r\n </div>\r\n </ng-container>\r\n <div>\r\n <button\r\n type=\"button\"\r\n class=\"button m-3\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateFacet']\"\r\n (click)=\"addFacetValue()\"\r\n >\r\n <clr-icon shape=\"add\"></clr-icon>\r\n {{ 'catalog.add-facet-value' | translate }}\r\n </button>\r\n </div>\r\n </vdr-card>\r\n </vdr-page-block>\r\n </vdr-page-detail-layout>\r\n</form>\r\n", styles: [".visible-toggle{margin-top:-3px!important}tr.facet-value td{vertical-align:middle}.pagination-wrapper{display:flex;justify-content:space-between;padding:var(--card-padding)}\n"] }]
3066
+ args: [{ selector: 'vdr-facet-detail', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [disabled]=\"isNew$ | async\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"facet-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n *ngIf=\"isNew$ | async; else updateButton\"\r\n (click)=\"create()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.create' | translate }}\r\n </button>\r\n <ng-template #updateButton>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </ng-template>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<form class=\"form\" [formGroup]=\"detailForm\">\r\n <vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar formGroupName=\"facet\">\r\n <vdr-card>\r\n <vdr-form-field [label]=\"'catalog.visibility' | translate\" for=\"visibility\">\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n [vdrDisabled]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"visible\"\r\n id=\"visibility\"\r\n />\r\n <label class=\"visible-toggle\">\r\n <ng-container *ngIf=\"detailForm.value.facet?.visible; else private\">{{\r\n 'catalog.public' | translate\r\n }}</ng-container>\r\n <ng-template #private>{{ 'catalog.private' | translate }}</ng-template>\r\n </label>\r\n </clr-toggle-wrapper>\r\n </vdr-form-field>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"entity$ | async as entity\" [entity]=\"entity\" />\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <vdr-page-block>\r\n <vdr-card formGroupName=\"facet\">\r\n <div class=\"form-grid\">\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateCode(entity?.code, $event.target.value)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.code' | translate\" for=\"code\">\r\n <input\r\n id=\"code\"\r\n type=\"text\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n </div>\r\n </vdr-card>\r\n <vdr-card [title]=\"'common.custom-fields' | translate\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Facet\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get('facet.customFields')\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </vdr-card>\r\n\r\n <vdr-custom-detail-component-host\r\n locationId=\"facet-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n\r\n <vdr-card\r\n *ngIf=\"!(isNew$ | async)\"\r\n [title]=\"'catalog.facet-values' | translate\"\r\n [paddingX]=\"false\"\r\n >\r\n <ng-template vdrCardControls>\r\n <input\r\n type=\"text\"\r\n class=\"mr-3\"\r\n [formControl]=\"filterControl\"\r\n [placeholder]=\"'catalog.filter-by-name' | translate\"\r\n />\r\n </ng-template>\r\n <ng-container *ngIf=\"values$ | async as filteredValues\">\r\n <table class=\"facet-values-list table\" formArrayName=\"values\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>{{ 'common.code' | translate }}</th>\r\n <ng-container *ngIf=\"customValueFields.length\">\r\n <th>{{ 'common.custom-fields' | translate }}</th>\r\n </ng-container>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n class=\"facet-value\"\r\n *ngFor=\"\r\n let value of filteredValues\r\n | paginate\r\n : {\r\n currentPage: currentPage,\r\n itemsPerPage: itemsPerPage,\r\n totalItems: totalItems,\r\n };\r\n let i = index\r\n \"\r\n [formGroup]=\"detailForm.get(['values', value.id])\"\r\n >\r\n <td class=\"align-middle\">\r\n <vdr-entity-info [entity]=\"value\"></vdr-entity-info>\r\n </td>\r\n <td class=\"align-middle\">\r\n <input\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateValueCode(value.code, $event.target.value, value.id)\"\r\n />\r\n </td>\r\n <td class=\"align-middle\">\r\n <input type=\"text\" formControlName=\"code\" />\r\n </td>\r\n <td class=\"\" *ngIf=\"customValueFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"FacetValue\"\r\n [customFields]=\"customValueFields\"\r\n [compact]=\"true\"\r\n [customFieldsFormGroup]=\"\r\n detailForm.get(['values', value.id, 'customFields'])\r\n \"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </td>\r\n <td class=\"align-middle\">\r\n <vdr-dropdown>\r\n <button type=\"button\" class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteFacetValue(value.id)\"\r\n [disabled]=\"!(updatePermission | hasPermission)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div class=\"pagination-wrapper\">\r\n <vdr-items-per-page-controls\r\n [itemsPerPage]=\"itemsPerPage\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n ></vdr-items-per-page-controls>\r\n <vdr-pagination-controls\r\n [currentPage]=\"currentPage\"\r\n [itemsPerPage]=\"itemsPerPage\"\r\n [totalItems]=\"totalItems\"\r\n (pageChange)=\"setCurrentPage($event)\"\r\n ></vdr-pagination-controls>\r\n </div>\r\n </ng-container>\r\n <div>\r\n <button\r\n type=\"button\"\r\n class=\"button m-3\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateFacet']\"\r\n (click)=\"addFacetValue()\"\r\n >\r\n <clr-icon shape=\"add\"></clr-icon>\r\n {{ 'catalog.add-facet-value' | translate }}\r\n </button>\r\n </div>\r\n </vdr-card>\r\n </vdr-page-block>\r\n </vdr-page-detail-layout>\r\n</form>\r\n", styles: [".visible-toggle{margin-top:-3px!important}tr.facet-value td{vertical-align:middle}.pagination-wrapper{display:flex;justify-content:space-between;padding:var(--card-padding)}\n"] }]
3066
3067
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.DataService }, { type: i2.FormBuilder }, { type: i1.NotificationService }, { type: i1.ModalService }]; } });
3067
3068
 
3068
3069
  const deleteFacetsBulkAction = createBulkDeleteAction({
@@ -3186,7 +3187,7 @@ const removeFacetsFromChannelBulkAction2 = {
3186
3187
  };
3187
3188
 
3188
3189
  const FACET_LIST_QUERY = gql `
3189
- query GetFacetList($options: FacetListOptions) {
3190
+ query GetFacetList($options: FacetListOptions, $facetValueListOptions: FacetValueListOptions) {
3190
3191
  facets(options: $options) {
3191
3192
  items {
3192
3193
  ...FacetWithValueList
@@ -3240,6 +3241,9 @@ class FacetListComponent extends TypedBaseListComponent {
3240
3241
  },
3241
3242
  sort: this.sorts.createSortInput(),
3242
3243
  },
3244
+ facetValueListOptions: {
3245
+ take: 100,
3246
+ },
3243
3247
  }),
3244
3248
  refreshListOnChanges: [this.filters.valueChanges, this.sorts.valueChanges],
3245
3249
  });
@@ -3440,29 +3444,50 @@ class ProductVariantListComponent extends TypedBaseListComponent {
3440
3444
  this.configure({
3441
3445
  document: ProductVariantListQueryDocument,
3442
3446
  getItems: data => data.productVariants,
3443
- setVariables: (skip, take) => ({
3444
- options: {
3445
- skip,
3446
- take,
3447
- filter: {
3448
- sku: {
3449
- contains: this.searchTermControl.value,
3447
+ setVariables: (skip, take) => {
3448
+ const searchTerm = this.searchTermControl.value;
3449
+ const filterParam = { _and: [] };
3450
+ const filterInput = this.filters.createFilterInput();
3451
+ if (Object.keys(filterInput).length) {
3452
+ filterParam._and?.push(filterInput);
3453
+ }
3454
+ if (searchTerm) {
3455
+ filterParam._and?.push({
3456
+ _or: [
3457
+ {
3458
+ name: { contains: searchTerm },
3459
+ },
3460
+ {
3461
+ sku: { contains: searchTerm },
3462
+ },
3463
+ ],
3464
+ });
3465
+ }
3466
+ if (this.productId) {
3467
+ filterParam._and?.push({
3468
+ productId: {
3469
+ eq: this.productId,
3450
3470
  },
3451
- ...this.filters.createFilterInput(),
3452
- ...(this.productId ? { productId: { eq: this.productId } } : {}),
3471
+ });
3472
+ }
3473
+ return {
3474
+ options: {
3475
+ skip,
3476
+ take,
3477
+ filter: filterParam,
3478
+ sort: this.sorts.createSortInput(),
3453
3479
  },
3454
- sort: this.sorts.createSortInput(),
3455
- },
3456
- }),
3480
+ };
3481
+ },
3457
3482
  refreshListOnChanges: [this.sorts.valueChanges, this.filters.valueChanges],
3458
3483
  });
3459
3484
  }
3460
3485
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ProductVariantListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3461
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ProductVariantListComponent, selector: "vdr-product-variant-list", inputs: { productId: "productId", hideLanguageSelect: "hideLanguageSelect", dataTableId: "dataTableId" }, usesInheritance: true, ngImport: i0, template: "<vdr-page-block *ngIf=\"!hideLanguageSelect\">\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n [id]=\"dataTableId || 'product-variant-list'\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-variant-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n />\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'catalog.filter-by-sku' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-variant=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"variant.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-variant=\"item\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog/products', variant.productId, 'variants', variant.id]\"\r\n ><span>{{ variant.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.sku' | translate\" id=\"sku\" [sort]=\"sorts.get('sku')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngIf=\"variant.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!variant.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.price' | translate\" id=\"price\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('price')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.price | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.price-with-tax' | translate\" id=\"price-with-tax\" [sort]=\"sorts.get('priceWithTax')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.priceWithTax | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n\r\n <vdr-dt2-column [heading]=\"'catalog.stock-on-hand' | translate\" id=\"stock-on-hand\" [hiddenByDefault]=\"false\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngFor=\"let stockLevel of variant.stockLevels\" [title]=\"stockLevel.stockLocation?.name\">\r\n <div class=\"flex center\">\r\n <div>\r\n {{ stockLevel.stockOnHand\r\n }}<span class=\"ml-1\" *ngIf=\"stockLevel.stockAllocated\"\r\n >({{ stockLevel.stockAllocated }} allocated)</span\r\n >\r\n </div>\r\n </div>\r\n </vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column *ngFor=\"let field of customFields\" [customField]=\"field\" [sorts]=\"sorts\" />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { 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: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.LanguageSelectorComponent, selector: "vdr-language-selector", inputs: ["currentLanguageCode", "availableLanguageCodes", "disabled"], outputs: ["languageCodeChange"] }, { kind: "component", type: i1.BulkActionMenuComponent, selector: "vdr-bulk-action-menu", inputs: ["locationId", "selectionManager", "hostComponent"] }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTable2SearchComponent, selector: "vdr-dt2-search", inputs: ["searchTermControl", "searchTermPlaceholder"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }] }); }
3486
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ProductVariantListComponent, selector: "vdr-product-variant-list", inputs: { productId: "productId", hideLanguageSelect: "hideLanguageSelect", dataTableId: "dataTableId" }, usesInheritance: true, ngImport: i0, template: "<vdr-page-block *ngIf=\"!hideLanguageSelect\">\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n [id]=\"dataTableId || 'product-variant-list'\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-variant-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n />\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'settings.search-by-product-name-or-sku' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-variant=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"variant.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-variant=\"item\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog/products', variant.productId, 'variants', variant.id]\"\r\n ><span>{{ variant.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.sku' | translate\" id=\"sku\" [sort]=\"sorts.get('sku')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngIf=\"variant.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!variant.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.price' | translate\" id=\"price\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('price')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.price | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.price-with-tax' | translate\" id=\"price-with-tax\" [sort]=\"sorts.get('priceWithTax')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.priceWithTax | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n\r\n <vdr-dt2-column [heading]=\"'catalog.stock-on-hand' | translate\" id=\"stock-on-hand\" [hiddenByDefault]=\"false\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngFor=\"let stockLevel of variant.stockLevels\" [title]=\"stockLevel.stockLocation?.name\">\r\n <div class=\"flex center\">\r\n <div>\r\n {{ stockLevel.stockOnHand\r\n }}<span class=\"ml-1\" *ngIf=\"stockLevel.stockAllocated\"\r\n >({{ stockLevel.stockAllocated }} allocated)</span\r\n >\r\n </div>\r\n </div>\r\n </vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column *ngFor=\"let field of customFields\" [customField]=\"field\" [sorts]=\"sorts\" />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { 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: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.LanguageSelectorComponent, selector: "vdr-language-selector", inputs: ["currentLanguageCode", "availableLanguageCodes", "disabled"], outputs: ["languageCodeChange"] }, { kind: "component", type: i1.BulkActionMenuComponent, selector: "vdr-bulk-action-menu", inputs: ["locationId", "selectionManager", "hostComponent"] }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTable2SearchComponent, selector: "vdr-dt2-search", inputs: ["searchTermControl", "searchTermPlaceholder"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: i1.LocaleCurrencyPipe, name: "localeCurrency" }] }); }
3462
3487
  }
3463
3488
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ProductVariantListComponent, decorators: [{
3464
3489
  type: Component,
3465
- args: [{ selector: 'vdr-product-variant-list', template: "<vdr-page-block *ngIf=\"!hideLanguageSelect\">\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n [id]=\"dataTableId || 'product-variant-list'\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-variant-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n />\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'catalog.filter-by-sku' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-variant=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"variant.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-variant=\"item\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog/products', variant.productId, 'variants', variant.id]\"\r\n ><span>{{ variant.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.sku' | translate\" id=\"sku\" [sort]=\"sorts.get('sku')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngIf=\"variant.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!variant.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.price' | translate\" id=\"price\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('price')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.price | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.price-with-tax' | translate\" id=\"price-with-tax\" [sort]=\"sorts.get('priceWithTax')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.priceWithTax | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n\r\n <vdr-dt2-column [heading]=\"'catalog.stock-on-hand' | translate\" id=\"stock-on-hand\" [hiddenByDefault]=\"false\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngFor=\"let stockLevel of variant.stockLevels\" [title]=\"stockLevel.stockLocation?.name\">\r\n <div class=\"flex center\">\r\n <div>\r\n {{ stockLevel.stockOnHand\r\n }}<span class=\"ml-1\" *ngIf=\"stockLevel.stockAllocated\"\r\n >({{ stockLevel.stockAllocated }} allocated)</span\r\n >\r\n </div>\r\n </div>\r\n </vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column *ngFor=\"let field of customFields\" [customField]=\"field\" [sorts]=\"sorts\" />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"] }]
3490
+ args: [{ selector: 'vdr-product-variant-list', template: "<vdr-page-block *ngIf=\"!hideLanguageSelect\">\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n [id]=\"dataTableId || 'product-variant-list'\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-variant-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n />\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'settings.search-by-product-name-or-sku' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-variant=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"variant.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-variant=\"item\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog/products', variant.productId, 'variants', variant.id]\"\r\n ><span>{{ variant.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.sku' | translate\" id=\"sku\" [sort]=\"sorts.get('sku')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.sku }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngIf=\"variant.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!variant.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.price' | translate\" id=\"price\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('price')\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n {{ variant.price | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.price-with-tax' | translate\" id=\"price-with-tax\" [sort]=\"sorts.get('priceWithTax')\">\r\n <ng-template let-variant=\"item\">\r\n {{ variant.priceWithTax | localeCurrency : variant.currencyCode }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n\r\n <vdr-dt2-column [heading]=\"'catalog.stock-on-hand' | translate\" id=\"stock-on-hand\" [hiddenByDefault]=\"false\">\r\n <ng-template let-variant=\"item\">\r\n <vdr-chip *ngFor=\"let stockLevel of variant.stockLevels\" [title]=\"stockLevel.stockLocation?.name\">\r\n <div class=\"flex center\">\r\n <div>\r\n {{ stockLevel.stockOnHand\r\n }}<span class=\"ml-1\" *ngIf=\"stockLevel.stockAllocated\"\r\n >({{ stockLevel.stockAllocated }} allocated)</span\r\n >\r\n </div>\r\n </div>\r\n </vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column *ngFor=\"let field of customFields\" [customField]=\"field\" [sorts]=\"sorts\" />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"] }]
3466
3491
  }], ctorParameters: function () { return []; }, propDecorators: { productId: [{
3467
3492
  type: Input
3468
3493
  }], hideLanguageSelect: [{
@@ -3968,19 +3993,31 @@ class ProductListComponent extends TypedBaseListComponent {
3968
3993
  this.configure({
3969
3994
  document: ProductListQueryDocument,
3970
3995
  getItems: data => data.products,
3971
- setVariables: (skip, take) => ({
3972
- options: {
3973
- skip,
3974
- take,
3975
- filter: {
3996
+ setVariables: (skip, take) => {
3997
+ const searchTerm = this.searchTermControl.value;
3998
+ let filterInput = this.filters.createFilterInput();
3999
+ if (searchTerm) {
4000
+ filterInput = {
3976
4001
  name: {
3977
- contains: this.searchTermControl.value,
4002
+ contains: searchTerm,
3978
4003
  },
3979
- ...this.filters.createFilterInput(),
4004
+ sku: {
4005
+ contains: searchTerm,
4006
+ },
4007
+ };
4008
+ }
4009
+ return {
4010
+ options: {
4011
+ skip,
4012
+ take,
4013
+ filter: {
4014
+ ...(filterInput ?? {}),
4015
+ },
4016
+ filterOperator: searchTerm ? LogicalOperator.OR : LogicalOperator.AND,
4017
+ sort: this.sorts.createSortInput(),
3980
4018
  },
3981
- sort: this.sorts.createSortInput(),
3982
- },
3983
- }),
4019
+ };
4020
+ },
3984
4021
  refreshListOnChanges: [this.sorts.valueChanges, this.filters.valueChanges],
3985
4022
  });
3986
4023
  }
@@ -4027,11 +4064,11 @@ class ProductListComponent extends TypedBaseListComponent {
4027
4064
  });
4028
4065
  }
4029
4066
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ProductListComponent, deps: [{ token: i1.DataService }, { token: i1.ModalService }, { token: i1.NotificationService }, { token: i1.JobQueueService }], target: i0.ɵɵFactoryTarget.Component }); }
4030
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ProductListComponent, selector: "vdr-products-list", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"product-list\"></vdr-action-bar-items>\r\n <a\r\n class=\"button primary mr-1\"\r\n [routerLink]=\"['./create']\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateProduct']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-new-product' | translate }}\r\n </a>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button type=\"button\" vdrDropdownItem (click)=\"rebuildSearchIndex()\">\r\n <clr-icon shape=\"refresh\" class=\"\"></clr-icon>\r\n {{ 'catalog.rebuild-search-index' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n id=\"product-list\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n ></vdr-bulk-action-menu>\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'catalog.filter-by-name' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-product=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"product.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-product=\"item\">\r\n <a class=\"button-ghost\" [routerLink]=\"['./', product.id]\"\r\n ><span>{{ product.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.slug' | translate\" id=\"slug\" [sort]=\"sorts.get('slug')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.slug }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-product=\"item\">\r\n <vdr-chip *ngIf=\"product.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!product.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.number-of-variants' | translate\" id=\"number-of-variants\">\r\n <ng-template let-product=\"item\">\r\n {{ 'catalog.variant-count' | translate : { count: product.variantList?.totalItems } }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of customFields\"\r\n [customField]=\"customField\"\r\n [sorts]=\"sorts\"\r\n />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { 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: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.LanguageSelectorComponent, selector: "vdr-language-selector", inputs: ["currentLanguageCode", "availableLanguageCodes", "disabled"], outputs: ["languageCodeChange"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "directive", type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.BulkActionMenuComponent, selector: "vdr-bulk-action-menu", inputs: ["locationId", "selectionManager", "hostComponent"] }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTable2SearchComponent, selector: "vdr-dt2-search", inputs: ["searchTermControl", "searchTermPlaceholder"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }] }); }
4067
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ProductListComponent, selector: "vdr-products-list", usesInheritance: true, ngImport: i0, template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"product-list\"></vdr-action-bar-items>\r\n <a\r\n class=\"button primary mr-1\"\r\n [routerLink]=\"['./create']\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateProduct']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-new-product' | translate }}\r\n </a>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button type=\"button\" vdrDropdownItem (click)=\"rebuildSearchIndex()\">\r\n <clr-icon shape=\"refresh\" class=\"\"></clr-icon>\r\n {{ 'catalog.rebuild-search-index' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n id=\"product-list\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n ></vdr-bulk-action-menu>\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'settings.search-by-product-name-or-sku' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-product=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"product.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-product=\"item\">\r\n <a class=\"button-ghost\" [routerLink]=\"['./', product.id]\"\r\n ><span>{{ product.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.slug' | translate\" id=\"slug\" [sort]=\"sorts.get('slug')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.slug }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-product=\"item\">\r\n <vdr-chip *ngIf=\"product.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!product.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.number-of-variants' | translate\" id=\"number-of-variants\">\r\n <ng-template let-product=\"item\">\r\n {{ 'catalog.variant-count' | translate : { count: product.variantList?.totalItems } }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of customFields\"\r\n [customField]=\"customField\"\r\n [sorts]=\"sorts\"\r\n />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"], dependencies: [{ kind: "directive", type: i3.ClrIconCustomTag, selector: "clr-icon" }, { 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: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.LanguageSelectorComponent, selector: "vdr-language-selector", inputs: ["currentLanguageCode", "availableLanguageCodes", "disabled"], outputs: ["languageCodeChange"] }, { kind: "component", type: i1.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i1.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i1.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i1.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "directive", type: i1.IfPermissionsDirective, selector: "[vdrIfPermissions]", inputs: ["vdrIfPermissions", "vdrIfPermissionsElse"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.BulkActionMenuComponent, selector: "vdr-bulk-action-menu", inputs: ["locationId", "selectionManager", "hostComponent"] }, { kind: "component", type: i1.DataTable2Component, selector: "vdr-data-table-2", inputs: ["id", "items", "itemsPerPage", "currentPage", "totalItems", "emptyStateLabel", "filters", "activeIndex"], outputs: ["pageChange", "itemsPerPageChange"] }, { kind: "component", type: i1.DataTable2ColumnComponent, selector: "vdr-dt2-column", inputs: ["id", "expand", "heading", "align", "sort", "optional", "hiddenByDefault", "orderable"], exportAs: ["row"] }, { kind: "component", type: i1.DataTable2SearchComponent, selector: "vdr-dt2-search", inputs: ["searchTermControl", "searchTermPlaceholder"] }, { kind: "component", type: i1.DataTableCustomFieldColumnComponent, selector: "vdr-dt2-custom-field-column", inputs: ["customField", "sorts"], exportAs: ["row"] }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.AssetPreviewPipe, name: "assetPreview" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }] }); }
4031
4068
  }
4032
4069
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ProductListComponent, decorators: [{
4033
4070
  type: Component,
4034
- args: [{ selector: 'vdr-products-list', template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"product-list\"></vdr-action-bar-items>\r\n <a\r\n class=\"button primary mr-1\"\r\n [routerLink]=\"['./create']\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateProduct']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-new-product' | translate }}\r\n </a>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button type=\"button\" vdrDropdownItem (click)=\"rebuildSearchIndex()\">\r\n <clr-icon shape=\"refresh\" class=\"\"></clr-icon>\r\n {{ 'catalog.rebuild-search-index' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n id=\"product-list\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n ></vdr-bulk-action-menu>\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'catalog.filter-by-name' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-product=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"product.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-product=\"item\">\r\n <a class=\"button-ghost\" [routerLink]=\"['./', product.id]\"\r\n ><span>{{ product.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.slug' | translate\" id=\"slug\" [sort]=\"sorts.get('slug')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.slug }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-product=\"item\">\r\n <vdr-chip *ngIf=\"product.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!product.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.number-of-variants' | translate\" id=\"number-of-variants\">\r\n <ng-template let-product=\"item\">\r\n {{ 'catalog.variant-count' | translate : { count: product.variantList?.totalItems } }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of customFields\"\r\n [customField]=\"customField\"\r\n [sorts]=\"sorts\"\r\n />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"] }]
4071
+ args: [{ selector: 'vdr-products-list', template: "<vdr-page-block>\r\n <vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"product-list\"></vdr-action-bar-items>\r\n <a\r\n class=\"button primary mr-1\"\r\n [routerLink]=\"['./create']\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateProduct']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-new-product' | translate }}\r\n </a>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button type=\"button\" vdrDropdownItem (click)=\"rebuildSearchIndex()\">\r\n <clr-icon shape=\"refresh\" class=\"\"></clr-icon>\r\n {{ 'catalog.rebuild-search-index' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </vdr-ab-right>\r\n </vdr-action-bar>\r\n</vdr-page-block>\r\n<vdr-data-table-2\r\n class=\"mt-2\"\r\n id=\"product-list\"\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [filters]=\"filters\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-bulk-action-menu\r\n locationId=\"product-list\"\r\n [hostComponent]=\"this\"\r\n [selectionManager]=\"selectionManager\"\r\n ></vdr-bulk-action-menu>\r\n <vdr-dt2-search\r\n [searchTermControl]=\"searchTermControl\"\r\n [searchTermPlaceholder]=\"'settings.search-by-product-name-or-sku' | translate\"\r\n />\r\n <vdr-dt2-column [heading]=\"'common.id' | translate\" id=\"id\" [hiddenByDefault]=\"true\" [sort]=\"sorts.get('id')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.id }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.created-at' | translate\" id=\"created-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('createdAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.createdAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column\r\n [heading]=\"'common.updated-at' | translate\" id=\"updated-at\"\r\n [hiddenByDefault]=\"true\"\r\n [sort]=\"sorts.get('updatedAt')\"\r\n >\r\n <ng-template let-product=\"item\">\r\n {{ product.updatedAt | localeDate : 'short' }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.image' | translate\" id=\"image\">\r\n <ng-template let-product=\"item\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"product.featuredAsset as asset; else imagePlaceholder\"\r\n [src]=\"asset | assetPreview : 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.name' | translate\" id=\"name\" [optional]=\"false\" [sort]=\"sorts.get('name')\">\r\n <ng-template let-product=\"item\">\r\n <a class=\"button-ghost\" [routerLink]=\"['./', product.id]\"\r\n ><span>{{ product.name }}</span\r\n ><clr-icon shape=\"arrow right\"\r\n /></a>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.slug' | translate\" id=\"slug\" [sort]=\"sorts.get('slug')\">\r\n <ng-template let-product=\"item\">\r\n {{ product.slug }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'common.enabled' | translate\" id=\"enabled\">\r\n <ng-template let-product=\"item\">\r\n <vdr-chip *ngIf=\"product.enabled\" colorType=\"success\">{{\r\n 'common.enabled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip *ngIf=\"!product.enabled\" colorType=\"warning\">{{\r\n 'common.disabled' | translate\r\n }}</vdr-chip>\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-column [heading]=\"'catalog.number-of-variants' | translate\" id=\"number-of-variants\">\r\n <ng-template let-product=\"item\">\r\n {{ 'catalog.variant-count' | translate : { count: product.variantList?.totalItems } }}\r\n </ng-template>\r\n </vdr-dt2-column>\r\n <vdr-dt2-custom-field-column\r\n *ngFor=\"let customField of customFields\"\r\n [customField]=\"customField\"\r\n [sorts]=\"sorts\"\r\n />\r\n</vdr-data-table-2>\r\n", styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;margin-top:calc(var(--space-unit) * -1);margin-bottom:calc(var(--space-unit) * -1);background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%}vdr-product-search-input{min-width:300px}@media screen and (max-width: 768px){vdr-product-search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-inline-end:24px}.sku{color:var(--color-text-300)}\n"] }]
4035
4072
  }], ctorParameters: function () { return [{ type: i1.DataService }, { type: i1.ModalService }, { type: i1.NotificationService }, { type: i1.JobQueueService }]; } });
4036
4073
 
4037
4074
  class VariantPriceDetailComponent {
@@ -4610,6 +4647,7 @@ const CATALOG_COMPONENTS = [
4610
4647
  CreateProductVariantDialogComponent,
4611
4648
  CreateProductOptionGroupDialogComponent,
4612
4649
  ProductVariantQuickJumpComponent,
4650
+ CreateFacetValueDialogComponent,
4613
4651
  ];
4614
4652
  class CatalogModule {
4615
4653
  static { this.hasRegisteredTabsAndBulkActions = false; }
@@ -4698,6 +4736,15 @@ class CatalogModule {
4698
4736
  component: detailComponentWithResolver({
4699
4737
  component: FacetDetailComponent,
4700
4738
  query: GetFacetDetailDocument,
4739
+ variables: {
4740
+ facetValueListOptions: {
4741
+ take: 10,
4742
+ skip: 0,
4743
+ sort: {
4744
+ createdAt: SortOrder$1.DESC,
4745
+ },
4746
+ },
4747
+ },
4701
4748
  entityKey: 'facet',
4702
4749
  getBreadcrumbs: entity => [
4703
4750
  {
@@ -4789,7 +4836,8 @@ class CatalogModule {
4789
4836
  ProductVariantDetailComponent,
4790
4837
  CreateProductVariantDialogComponent,
4791
4838
  CreateProductOptionGroupDialogComponent,
4792
- ProductVariantQuickJumpComponent], imports: [SharedModule, i1$1.RouterModule], exports: [ProductListComponent,
4839
+ ProductVariantQuickJumpComponent,
4840
+ CreateFacetValueDialogComponent], imports: [SharedModule, i1$1.RouterModule], exports: [ProductListComponent,
4793
4841
  ProductDetailComponent,
4794
4842
  FacetListComponent,
4795
4843
  FacetDetailComponent,
@@ -4820,7 +4868,8 @@ class CatalogModule {
4820
4868
  ProductVariantDetailComponent,
4821
4869
  CreateProductVariantDialogComponent,
4822
4870
  CreateProductOptionGroupDialogComponent,
4823
- ProductVariantQuickJumpComponent] }); }
4871
+ ProductVariantQuickJumpComponent,
4872
+ CreateFacetValueDialogComponent] }); }
4824
4873
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: CatalogModule, providers: [
4825
4874
  {
4826
4875
  provide: ROUTES,
@@ -5066,5 +5115,5 @@ const PRODUCT_VARIANT_LIST_QUERY = gql `
5066
5115
  * Generated bundle index. Do not edit.
5067
5116
  */
5068
5117
 
5069
- export { ASSET_DETAIL_QUERY, ApplyFacetDialogComponent, AssetDetailComponent, AssetListComponent, AssetsComponent, AssignProductsToChannelDialogComponent, BulkAddFacetValuesDialogComponent, COLLECTION_DETAIL_QUERY, CatalogModule, CollectionBreadcrumbPipe, CollectionContentsComponent, CollectionDataTableComponent, CollectionDetailComponent, CollectionListComponent, CollectionTreeComponent, CollectionTreeNodeComponent, CollectionTreeService, ConfirmVariantDeletionDialogComponent, CreateProductOptionGroupDialogComponent, CreateProductVariantDialogComponent, FACET_DETAIL_QUERY, FACET_LIST_QUERY, FacetDetailComponent, FacetListComponent, GET_PRODUCTS_WITH_FACET_VALUES_BY_IDS, GET_PRODUCT_DETAIL, GET_VARIANTS_WITH_FACET_VALUES_BY_IDS, GenerateProductVariantsComponent, GeneratedVariant, MoveCollectionsDialogComponent, OPTION_VALUE_INPUT_VALUE_ACCESSOR, OptionValueInputComponent, PRODUCT_LIST_QUERY, PRODUCT_VARIANT_DETAIL_QUERY, PRODUCT_VARIANT_DETAIL_QUERY_PRODUCT_VARIANT_FRAGMENT, PRODUCT_VARIANT_LIST_QUERY, PRODUCT_VARIANT_UPDATE_MUTATION, ProductDetailComponent, ProductDetailService, ProductListComponent, ProductOptionsEditorComponent, ProductVariantDetailComponent, ProductVariantListComponent, ProductVariantQuickJumpComponent, ProductVariantsEditorComponent, ProductVariantsResolver, ProductVariantsTableComponent, UPDATE_PRODUCTS_BULK, UPDATE_VARIANTS_BULK, UpdateProductOptionDialogComponent, VariantPriceDetailComponent, arrayToTree, assignCollectionsToChannelBulkAction, assignFacetValuesToProductsBulkAction, assignFacetsToChannelBulkAction, assignProductVariantsToChannelBulkAction, assignProductsToChannelBulkAction, createRoutes, deleteCollectionsBulkAction, deleteFacetsBulkAction, deleteProductVariantsBulkAction, deleteProductsBulkAction, moveCollectionsBulkAction, productOptionsEditorBreadcrumb, removeCollectionsFromChannelBulkAction, removeFacetsFromChannelBulkAction, removeFacetsFromChannelBulkAction2, removeProductVariantsFromChannelBulkAction, removeProductsFromChannelBulkAction, replaceLast };
5118
+ export { ASSET_DETAIL_QUERY, ApplyFacetDialogComponent, AssetDetailComponent, AssetListComponent, AssetsComponent, AssignProductsToChannelDialogComponent, BulkAddFacetValuesDialogComponent, COLLECTION_DETAIL_QUERY, CatalogModule, CollectionBreadcrumbPipe, CollectionContentsComponent, CollectionDataTableComponent, CollectionDetailComponent, CollectionListComponent, CollectionTreeComponent, CollectionTreeNodeComponent, CollectionTreeService, ConfirmVariantDeletionDialogComponent, CreateFacetValueDialogComponent, CreateProductOptionGroupDialogComponent, CreateProductVariantDialogComponent, FACET_DETAIL_QUERY, FACET_LIST_QUERY, FacetDetailComponent, FacetListComponent, GET_PRODUCTS_WITH_FACET_VALUES_BY_IDS, GET_PRODUCT_DETAIL, GET_VARIANTS_WITH_FACET_VALUES_BY_IDS, GenerateProductVariantsComponent, GeneratedVariant, MoveCollectionsDialogComponent, OPTION_VALUE_INPUT_VALUE_ACCESSOR, OptionValueInputComponent, PRODUCT_LIST_QUERY, PRODUCT_VARIANT_DETAIL_QUERY, PRODUCT_VARIANT_DETAIL_QUERY_PRODUCT_VARIANT_FRAGMENT, PRODUCT_VARIANT_LIST_QUERY, PRODUCT_VARIANT_UPDATE_MUTATION, ProductDetailComponent, ProductDetailService, ProductListComponent, ProductOptionsEditorComponent, ProductVariantDetailComponent, ProductVariantListComponent, ProductVariantQuickJumpComponent, ProductVariantsEditorComponent, ProductVariantsResolver, ProductVariantsTableComponent, UPDATE_PRODUCTS_BULK, UPDATE_VARIANTS_BULK, UpdateProductOptionDialogComponent, VariantPriceDetailComponent, arrayToTree, assignCollectionsToChannelBulkAction, assignFacetValuesToProductsBulkAction, assignFacetsToChannelBulkAction, assignProductVariantsToChannelBulkAction, assignProductsToChannelBulkAction, createRoutes, deleteCollectionsBulkAction, deleteFacetsBulkAction, deleteProductVariantsBulkAction, deleteProductsBulkAction, moveCollectionsBulkAction, productOptionsEditorBreadcrumb, removeCollectionsFromChannelBulkAction, removeFacetsFromChannelBulkAction, removeFacetsFromChannelBulkAction2, removeProductVariantsFromChannelBulkAction, removeProductsFromChannelBulkAction, replaceLast };
5070
5119
  //# sourceMappingURL=vendure-admin-ui-catalog.mjs.map