Merge branch 'release/3.4' into develop

This commit is contained in:
Lorenz Hilpert
2024-12-06 10:45:48 +01:00
22 changed files with 158 additions and 1265 deletions

View File

@@ -1,2 +0,0 @@
<div class="scanner-container" #scanContainer></div>
<button class="close-scanner" type="button" (click)="close()">Scan abbrechen</button>

View File

@@ -1,5 +1,4 @@
import { Component, ChangeDetectionStrategy, ElementRef, ViewChild, NgZone, AfterViewInit, OnDestroy, inject } from '@angular/core';
import { UiModalService } from '@ui/modal';
import { Component, ChangeDetectionStrategy, ElementRef, ViewChild, NgZone, AfterViewInit, OnDestroy } from '@angular/core';
import { BarcodeCapture, BarcodeCaptureSettings, Symbology } from 'scandit-web-datacapture-barcode';
import { Camera, DataCaptureContext, DataCaptureView, FrameSourceState } from 'scandit-web-datacapture-core';

View File

@@ -28,13 +28,17 @@ export class ScanditScanAdapter implements ScanAdapter {
async init(): Promise<boolean> {
if (this._environmentService.isTablet()) {
await configure({
licenseKey: this._config.get('licence.scandit'),
libraryLocation: new URL('scandit', document.baseURI).toString(),
moduleLoaders: [barcodeCaptureLoader()],
});
try {
await configure({
licenseKey: this._config.get('licence.scandit'),
libraryLocation: new URL('scandit', document.baseURI).toString(),
moduleLoaders: [barcodeCaptureLoader()],
});
return true;
return true;
} catch (error) {
console.error('ScanditScanAdapter.init', error);
}
}
return false;

View File

@@ -73,7 +73,7 @@
},
"checkForUpdates": 3600000,
"licence": {
"scandit": "AqeFthV/MMKEPoQNIB3vSLYDthFhJ0F03QQtH+4f/ivCRKdYPjxnMU94RVMEaldhNTQj5sB8mJVNWq0vbHCzqul36KcLdG0kwFfBiXAoEkfOe2bRGTCX4bASLuwfHVv8+AG+Pwdhelf3XMcIvnrGkiR91EmRGeebiiVX448H6U+WdyXJtns/W/ZgdMZBGUHA4WsG9Ct5SyLGaeGYI1iK8LZtpKzLBcsvYwOkDeI4IjIuOZpMpy6CzmBAHQlAHWKmwjDizWwB2rU2BZ6i+3H99mpvSz9PCWm9PS+Jr30Me13bb+Oz5zHxeMdoJtZNIhsTgWyVErUlcuceNIibrDj84L4qfmHKPQtalW10+w9ODwRIS+nLCWOpo9we+UCsFgMJLX3lH0ZIXEWEZjAxhzXmdxxGEcroQQXAIH3PsN8RUSuaC6PPOirvKmZUbW3XUun+vmxMWxhDyGwnat9CpDpQ+CpsyPECaUEkbkVEg/Mq42QxVHF25UgZ37c5gN0wHNAjal/HSpZfLBzDeC5Y/iKqgKhjf68Bf7lnOBYokWFUxBRdcKLhtz3nGNZL3UpabCULf2J5lOZ0Mj8hdC+P4UNZMCRVEs4UR9pqHEoJVdQ5KMO8cXcvKGxGG4hT9UNNbk9o+jNWOlhCribVTmkj6kmInB8zDFkceKy3HUSC8p9TlzjxfBpzN0oVMG9DIlkTWh3nryr4lDJimIz4AriI6Xft3NJgiIkUVAjsTHl33IRz7jwyQOzyUR197o0ojRwvLpm3zkHwap4lyvMz7SoYhKoyN66Aul3K5iic8hVVUuriChEZyIwYml71vAfIpmwZC5GVF5XJBT1r0OG+xmJbH6sae0gOnMpFyed3R+BH/AU2OY9nrnTNLN83pk8huK7BPQVnpAQqU76IrZP5GAyd1GNRi9WWJo4mHefe/9/x22lfHg7BELhOXoJlDZWoj4uOYJVVycQD/ninQMtwkry/9VEOQmrg76bRVbz2OZ3RFDw/AXBd+1jA0K7gIP9G5dN4x2NjNbzPE4gMhHvNi+vUy8x+1uHRQdBzI/F7EkuFb59eKZYe1EHTofnzGofZUgiuXMDDVTi8dE80PmFRCTnNvEtK8rRcBFSqWxeX1u5h+PR8btTagOH0hNCNWUaVYpIcHXvKP5gFFluPy5+RR3TRXYhBKOeb+Q2uxrowwVJs2FOxwfORtKXti8pGIw9bVZk9yNCqafPuURqGKMw/e+H8ElIWaiWH2mcY9dDKN6lBhOdKYjhKQZ/4t9H+ZbyeKzebH8habpAZEDdN0fbqDMwWTD+eKo02s5wOzJ+0z4BpDszMd2acvQ1GVrF0KajpReco2FE+AQpbxHM2KQfKqiDHOUd02nG9AHjKRf/xUTySpD8pG3DvPZC+ImqQZN/t7/IegQptgrezq2w2y0L89sgNnnhRopaMRt/sPSirTXh/NA=="
"scandit": "ATSVF4WBEUdWFabwSBws+xhCeCSCzgKZVEUjDXt0v6EpJHyN7lNmjMNmg8S+ADBh6h/Wn6Vl1b8TDhw3Fl1ZdkFoQ88zZUgagRY9vKpAjzimETtcVmzAA05W498GYgSr42+q4P9dkGO1RPdcOXqAgZZpNlsaQnyP1WjOMvgRRouwBxnoVCwkir8//kLxJaHPJKSYQNcTdRNMgqNPq/vUwdYVrzg26ltn7eC5imeXyYuQH3u2L4TVuRjr3SDVqsv7lnybh3ijg3dLoI93atUBuxbmzvoWzyb2mxrchJ9DaxrBy0igV2qFzzF1R6QvlNTyvN9HyUvZ0/sPS1DqOoql9bqG7ibyGOdRa2/vfIDTLbVEIaym8yQzErBBqthjviCub2pYXGX+ai9xXufuqRDyX29uCafxSv6sQsnVcEnuLEmP6gdmGBMVvH/WEZHnGn6bQpfWwFIGRZZKM+SxTdToJanj3jxNF/pO445/YZWJBDRT5nP55gESsrwiTXbb+i9lY4Hx7srEQJR07lJWASfKGX6IJtUaIstl7KnO6VI72XI2Zo01SAQAOw7m5+70LgYN1woYoAcziCSFyuIfJavGF0zd1cAu95Cwo0E8+y/YcAO3jwEqFE8oH7PkqKEf4XbF166quTf3AmVQJ8Q6lfSqWlZTps/dDGCAOe3Z63drIbh2bu3A/49bjT1TS7RFK5QvkKCtrM8zOS1DhEDjPPNR84BD/vbpjehHUlG6i7xlTwhmYblQR1oMUpfqrHqX5b9Lg2qADH+AfKRJ7Xd/kPSXdEw7MvJaZFpv9VuiFlUv37EyQBopyFhWYxRU9Kb1XfmkxpO+TCovzmEbKpWxi8KBYOdbX3QaNBW6HQLEd79+H8E="
},
"gender": {
"0": "Keine Anrede",

View File

@@ -73,7 +73,7 @@
<ui-icon [rotate]="dropdown.opened ? '270deg' : '90deg'" icon="arrow_head"></ui-icon>
</button>
<ui-dropdown #statusDropdown yPosition="above" xPosition="after" [xOffset]="8">
<button uiDropdownItem *ngFor="let reason of reorderReasons$ | async" (click)="selectedReason = reason.value">
<button uiDropdownItem *ngFor="let reason of reorderReasons$ | async" (click)="selectedReason = reason.value; dropdown.close()">
{{ reason.value }}
</button>
</ui-dropdown>

View File

@@ -164,6 +164,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
this.store.deliveryAvailability$,
this.store.deliveryDigAvailability$,
this.store.deliveryB2BAvailability$,
this.store.downloadAvailability$,
]).pipe(
map((availabilities) => {
return availabilities?.some((availability) => (availability as any)?.priceMaintained) ?? false;
@@ -177,8 +178,9 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
this.store.deliveryAvailability$,
this.store.deliveryDigAvailability$,
this.store.deliveryB2BAvailability$,
this.store.downloadAvailability$,
]).pipe(
map(([item, takeAway, pickUp, delivery, deliveryDig, deliveryB2B]) => {
map(([item, takeAway, pickUp, delivery, deliveryDig, deliveryB2B, download]) => {
const hasPickupOrTakeaway = takeAway?.inStock || pickUp?.inStock;
if (hasPickupOrTakeaway && item?.catalogAvailability?.price?.value?.value) {
@@ -201,6 +203,10 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
return deliveryB2B.price;
}
if (download?.price?.value?.value) {
return download.price;
}
return null;
}),
);

View File

@@ -166,6 +166,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
if (!isEqual(cleanQueryParams, this.cleanupQueryParams(this.searchService.filter.getQueryParams()))) {
await this.searchService.setDefaultFilter(queryParams);
const data = await this.getCachedData(processId, queryParams, selectedBranch?.id);
if (data.items?.length > 0) {
this.searchService.setItems(data.items);
this.searchService.setHits(data.hits);
@@ -392,15 +393,14 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
});
}
getCachedData(processId: number, params: Record<string, string> = {}, branchId: number) {
async getCachedData(processId: number, params: Record<string, string> = {}, branchId: number) {
const qparams = this.cleanupQueryParams({ ...params, processId: String(processId), branchId: String(branchId) });
const cacheData = await this.cache.get<{
items: ItemDTO[];
hits: number;
}>(qparams);
return (
this.cache.get<{
items: ItemDTO[];
hits: number;
}>(qparams) || { items: [], hits: 0 }
);
return cacheData ?? { items: [], hits: 0 };
}
cleanupQueryParams(params: Record<string, string> = {}) {

View File

@@ -34,7 +34,11 @@
></page-pickup-shelf-details-item>
</ng-container>
<page-pickup-shelf-details-tags class="mb-px-2" *ngIf="showTagsComponent$ | async"></page-pickup-shelf-details-tags>
<page-pickup-shelf-details-tags
(selectedChange)="changeSelectedCompartmentInfo($event)"
class="mb-px-2"
*ngIf="showTagsComponent$ | async"
></page-pickup-shelf-details-tags>
<ng-container *ngIf="fetchingCoverItems$ | async; else coverItemsTmpl">
<div class="bg-white grid grid-flow-col gap-5 justify-center items-center h-40">

View File

@@ -1,4 +1,4 @@
import { Component, ChangeDetectionStrategy, inject, OnInit, AfterViewInit, ViewChild, effect, untracked } from '@angular/core';
import { Component, ChangeDetectionStrategy, inject, OnInit, ViewChild, effect, untracked } from '@angular/core';
import { PickupShelfDetailsBaseComponent } from '../../pickup-shelf-details-base.component';
import { AsyncPipe, NgFor, NgIf } from '@angular/common';
import { PickUpShelfDetailsHeaderComponent } from '../../shared/pickup-shelf-details-header/pickup-shelf-details-header.component';
@@ -10,7 +10,7 @@ import { UiSpinnerModule } from '@ui/spinner';
import { OnInitDirective } from '@shared/directives/element-lifecycle';
import { PickupShelfInNavigationService } from '@shared/services/navigation';
import { BehaviorSubject, asapScheduler, combineLatest } from 'rxjs';
import { distinctUntilChanged, map, shareReplay } from 'rxjs/operators';
import { distinctUntilChanged, filter, map, shareReplay, tap, throttleTime } from 'rxjs/operators';
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
@@ -42,7 +42,7 @@ import { SkeletonLoaderComponent } from '@shared/components/loader';
SkeletonLoaderComponent,
],
})
export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseComponent implements OnInit, AfterViewInit {
export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseComponent implements OnInit {
runCheckTrigger = inject(RunCheckTrigger);
@ViewChild(PickUpShelfDetailsTagsComponent, { static: false })
@@ -52,7 +52,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
order$ = this.store.order$;
$customerNumber = toSignal(this.store.customerNumber$);
$customerNumber = toSignal(this.store.customerNumber$.pipe(distinctUntilChanged()));
orderItems$ = this.store.orderItems$.pipe(shareReplay(1));
@@ -104,6 +104,14 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
map(([compartmentInfo, changeActionDisabled]) => !!compartmentInfo || changeActionDisabled),
);
customerNumberAndSelevtedOrderItemIdsChanges$ = combineLatest([this.store.customerNumber$, this.store.selectedOrderItem$]).pipe(
filter(([_, selectedOrderItem]) => !!selectedOrderItem),
distinctUntilChanged((a, b) => isEqual(a, b)),
map(([customerNumber, selectedOrderItem]) => ({ customerNumber, selectedOrderItem })),
);
$customerNumberAndSelevtedOrderItemIdsChanges = toSignal(this.customerNumberAndSelevtedOrderItemIdsChanges$);
constructor(
private _uiModal: UiModalService,
private _activatedRoute: ActivatedRoute,
@@ -111,8 +119,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
super();
effect(() => {
const customerNumber = this.$customerNumber();
this.$orderItems();
const { customerNumber } = this.$customerNumberAndSelevtedOrderItemIdsChanges();
if (customerNumber) {
untracked(() => {
@@ -146,14 +153,8 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
// });
}
ngAfterViewInit() {
this._registerPickUpShelfDetailsTagsComponentChanges();
}
private _registerPickUpShelfDetailsTagsComponentChanges() {
this.orderItems$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((_) => {
this.pickUpShelfDetailsTags?.registerOnChange((compartmentInfo) => (this.store.selectedCompartmentInfo = compartmentInfo));
});
changeSelectedCompartmentInfo(compartmentInfo: string) {
this.store.selectedCompartmentInfo = compartmentInfo;
}
async handleAction({

View File

@@ -205,6 +205,7 @@ export class PickUpShelfInListComponent implements OnInit, AfterViewInit {
}
loadMore() {
console.log('loadMore');
this.store.fetchMoreList();
}
}

View File

@@ -33,9 +33,8 @@
</ng-container>
<page-pickup-shelf-details-tags
(selectedChange)="setSelectedCompartmentInfo($event)"
*ngIf="showTagsComponent$ | async"
[ngModel]="selectedCompartmentInfo$ | async"
(ngModelChange)="setSelectedCompartmentInfo($event)"
></page-pickup-shelf-details-tags>
</div>

View File

@@ -75,10 +75,6 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
map(([orderItems, fetchingItems]) => orderItems?.length === 0 && fetchingItems),
);
selectedCompartmentInfo = this.store.selectedCompartmentInfo;
selectedCompartmentInfo$ = this.store.selectedCompartmentInfo$;
showTagsComponent$ = this.store.showTagsComponent$;
changeActionLoader$ = new BehaviorSubject<string>(undefined);

View File

@@ -2,26 +2,26 @@
<button
class="page-pickup-shelf-details-tags__tag"
type="button"
[class.selected]="tag === (selected$ | async) && !inputFocus.focused"
[class.selected]="tag === $selected() && !inputFocus.focused"
*ngFor="let tag of defaultTags"
(click)="setCompartmentInfo(tag)"
>
{{ tag }}
</button>
<button
(click)="inputFocus.focus()"
(click)="inputFocus.focus(); $selected.set($inputValue())"
type="button"
class="page-pickup-shelf-details-tags__tag"
[class.selected]="(inputValue$ | async) === (selected$ | async) && (inputValue$ | async)"
[class.selected]="$inputValue() === $selected() && !!$inputValue()"
>
<input
#inputFocus="uiFocus"
uiFocus
type="text"
[ngModel]="inputValue$ | async"
(ngModelChange)="inputValueSubject.next($event); setCompartmentInfo(inputValue)"
[ngModel]="$inputValue()"
(ngModelChange)="$inputValue.set($event); setCompartmentInfo($event)"
placeholder="..."
[size]="controlSize$ | async"
[size]="$controlSize()"
maxlength="15"
/>
</button>

View File

@@ -1,9 +1,7 @@
import { AsyncPipe, NgFor } from '@angular/common';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, forwardRef } from '@angular/core';
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
import { NgFor } from '@angular/common';
import { ChangeDetectionStrategy, Component, computed, model } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { UiCommonModule } from '@ui/common';
import { BehaviorSubject, Subscription } from 'rxjs';
import { first, map } from 'rxjs/operators';
@Component({
selector: 'page-pickup-shelf-details-tags',
@@ -12,72 +10,28 @@ import { first, map } from 'rxjs/operators';
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'page-pickup-shelf-details-tags' },
standalone: true,
imports: [NgFor, UiCommonModule, FormsModule, AsyncPipe],
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PickUpShelfDetailsTagsComponent), multi: true }],
imports: [NgFor, UiCommonModule, FormsModule],
})
export class PickUpShelfDetailsTagsComponent implements OnInit, OnDestroy, ControlValueAccessor {
selected$ = new BehaviorSubject<string>('');
export class PickUpShelfDetailsTagsComponent {
$selected = model<string>(undefined, { alias: 'selected' });
$inputValue = model<string>(undefined, { alias: 'inputValue' });
readonly defaultTags = ['Maxi', 'Mini', 'Kleinkram', 'Nonbook', 'Kalender'];
inputValueSubject = new BehaviorSubject<string>('');
inputValue$ = this.inputValueSubject.asObservable();
disabled = false;
private onChange = (value: string) => {};
private onTouched = () => {};
get inputValue() {
return this.inputValueSubject.value;
}
controlSize$ = this.inputValue$.pipe(map((value) => (value ? Math.min(value?.length, 15) : 3)));
private subscription = new Subscription();
constructor(private _cdr: ChangeDetectorRef) {}
writeValue(obj: any): void {
this.selected$.next(obj);
this._cdr.markForCheck();
}
registerOnChange(fn: any): void {
this.onChange = fn;
}
registerOnTouched(fn: any): void {
this.onTouched = fn;
}
setDisabledState?(isDisabled: boolean): void {
this.disabled = isDisabled;
}
ngOnInit() {
this.subscription.add(
this.selected$.pipe(map((selected) => (this.defaultTags.includes(selected) ? '' : selected))).subscribe(this.inputValueSubject),
);
}
ngOnDestroy() {
this.inputValueSubject.unsubscribe();
this.subscription.unsubscribe();
}
async setCompartmentInfo(compartmentInfo: string) {
const currentCompartmentInfo = await this.selected$.pipe(first()).toPromise();
if (currentCompartmentInfo === compartmentInfo) {
this.onChange(undefined);
this.selected$.next(undefined);
} else {
this.onChange(compartmentInfo);
this.selected$.next(compartmentInfo);
$controlSize = computed(() => {
const value = this.$inputValue();
if (!!value) {
return Math.min(value.length, 15);
}
return 3;
});
this._cdr.markForCheck();
setCompartmentInfo(compartmentInfo: string) {
const currentCompartmentInfo = this.$selected();
if (currentCompartmentInfo === compartmentInfo) {
this.$selected.set(undefined);
} else {
this.$selected.set(compartmentInfo);
}
}
}

View File

@@ -1,3 +1,4 @@
import moment from 'moment';
import { PickupShelfDetailsState } from './pickup-shelf-details.state';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
@@ -125,18 +126,15 @@ export const selectLatestCompartmentCodeAndInfoForOrder = (s: PickupShelfDetails
// Ticket #4397 - Sortieren und Filtern der angezeigten CoverItems nach latestCompartmentCode und Info
const coverItem = coverItems
// Item should have the processing status 128 "eingetroffen"
?.filter((a) => a.processingStatus === 128)
// Items should be ready for pick up today
?.filter((a) => {
if (a.readyForPickUp) {
const readyForPickUp = new Date(a.readyForPickUp);
const today = new Date(Date.now());
const readyForPickUp = moment(a.readyForPickUp);
const today = moment.now();
// May use dateAdapter utility functions here to check if the date is the same
return (
(readyForPickUp.getFullYear() - today.getFullYear() ||
readyForPickUp.getMonth() - today.getMonth() ||
readyForPickUp.getDate() - today.getDate()) === 0
);
return readyForPickUp.isSame(today, 'day');
}
return false;
})
@@ -277,4 +275,9 @@ export const selectCustomerNumber = (s: PickupShelfDetailsState) => {
export const selectFetchingCoverOrderItems = (s: PickupShelfDetailsState) => s.fetchingCoverOrderItems ?? false;
export const selectCoverOrderItems = (s: PickupShelfDetailsState) => s.coverOrderItems ?? [];
export const selectCoverOrderItems = (s: PickupShelfDetailsState) => {
const coverItems = s.coverOrderItems ?? [];
const selected = selectedOrderItem(s);
return coverItems.filter((item) => item.buyerNumber === selected?.buyerNumber);
};

View File

@@ -20,7 +20,7 @@ import {
} from '@swagger/oms';
import { PickupShelfIOService, PickupShelfService } from '@domain/pickup-shelf';
import { Injectable, inject } from '@angular/core';
import { delayWhen, distinctUntilChanged, filter, map, mergeMap, switchMap, take, tap, withLatestFrom } from 'rxjs/operators';
import { distinctUntilChanged, filter, map, mergeMap, switchMap, tap, withLatestFrom } from 'rxjs/operators';
import { UiModalService } from '@ui/modal';
import { CrmCustomerService } from '@domain/crm';
import * as Selectors from './pickup-shelf-details.selectors';
@@ -59,18 +59,12 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
return this.get(Selectors.selectFetchingOrder);
}
// orderItems$ = this.select(Selectors.selectOrderItems);
// get orderItems() {
// return this.get(Selectors.selectOrderItems);
// }
orderItems$ = combineLatest([
this.select(Selectors.selectOrderItems),
this.select((s) => s).pipe(switchMap((s) => this._listStore.itemsForPreview$(s))),
]).pipe(
map(([orderItems, itemsForPreview]) => (orderItems?.length ? orderItems : itemsForPreview)),
distinctUntilChanged(isEqual),
distinctUntilChanged((a, b) => isEqual(a, b)),
);
get orderItems() {
@@ -723,7 +717,7 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
);
private beforeFetchCoverOrderItems = () => {
this.patchState({ fetchingCoverOrderItems: true });
this.patchState({ fetchingCoverOrderItems: true, coverOrderItems: [] });
};
updateOrderItemSubsetLoading(orderItemSubsetLoading: boolean) {

View File

@@ -40,7 +40,7 @@
<ui-icon class="ml-4" [rotate]="dropdown.opened ? '270deg' : '90deg'" icon="arrow_head"></ui-icon>
</button>
<ui-dropdown #reasonDropdown class="font-bold" yPosition="below" xPosition="after" [xOffset]="8">
<button uiDropdownItem *ngFor="let reason of returnReasons$ | async" (click)="reasonChanged(reason)">
<button uiDropdownItem *ngFor="let reason of returnReasons$ | async" (click)="reasonChanged(reason); dropdown.close()">
{{ reason }}
</button>
</ui-dropdown>

View File

@@ -46,6 +46,7 @@ export class SelectOptionComponent<T = any> implements FocusableOption {
select(event: Event): void {
event.preventDefault();
event.stopPropagation();
this._onSelect(this.value);
}
}

View File

@@ -12,16 +12,18 @@ import {
HostListener,
ElementRef,
HostBinding,
AfterContentInit,
OnDestroy,
AfterContentInit,
inject,
DestroyRef,
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { SelectOptionComponent } from './select-option.component';
import { IconComponent } from '@shared/components/icon';
import { BaseFormControlDirective } from '@shared/components/form-control';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { NgIf } from '@angular/common';
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
@Component({
selector: 'shared-select',
@@ -34,7 +36,9 @@ import { NgIf } from '@angular/common';
imports: [IconComponent, NgIf],
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }],
})
export class SelectComponent<T = any> extends BaseFormControlDirective implements ControlValueAccessor, AfterContentInit, OnDestroy {
export class SelectComponent<T = any> extends BaseFormControlDirective implements AfterContentInit, ControlValueAccessor, OnDestroy {
private destroyRef = inject(DestroyRef);
@ContentChildren(SelectOptionComponent)
options: QueryList<SelectOptionComponent>;
@@ -101,13 +105,15 @@ export class SelectComponent<T = any> extends BaseFormControlDirective implement
super();
}
ngAfterContentInit() {
this.options.changes.pipe(takeUntil(this._onDestroy$)).subscribe(() => {
ngAfterContentInit(): void {
this.options.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
this.options.forEach((option) => {
option.registerOnSelect((value) => this.setValue(value));
});
});
this._cdr.markForCheck();
this.options.forEach((option) => {
option.registerOnSelect((value) => this.setValue(value));
});
}
@@ -158,6 +164,10 @@ export class SelectComponent<T = any> extends BaseFormControlDirective implement
this._open = true;
this._forceClose = false;
this._cdr.markForCheck();
this.options.forEach((option) => {
option.registerOnSelect((value) => this.setValue(value));
});
}
close() {

View File

@@ -11,7 +11,7 @@ export class ScrollContainerDirective {
@Output()
scrolledToBottom = new EventEmitter<void>();
private _delta: number = 0;
private _delta: number = 50;
@Input()
set delta(value: NumberInput) {

View File

@@ -12,7 +12,7 @@ variables:
value: '3'
# Minor Version einstellen
- name: 'Minor'
value: '3'
value: '4'
- name: 'Patch'
value: "$[counter(format('{0}.{1}', variables['Major'], variables['Minor']),0)]"
- name: 'BuildUniqueID'

1173
package-lock.json generated
View File

File diff suppressed because it is too large Load Diff