Skip to content

Commit

Permalink
refactor(tabs): use readonly for attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjulian committed Nov 22, 2024
1 parent 3363fe4 commit 9950745
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions libs/ui/tabs/helm/src/lib/hlm-tabs-paginated-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,25 @@ import { listVariants } from './hlm-tabs-list.component';
},
})
export class HlmTabsPaginatedListComponent extends BrnTabsPaginatedListDirective {
public _items = contentChildren(BrnTabsTriggerDirective, { descendants: false });
public _itemsChanges = toObservable(this._items);
public readonly _items = contentChildren(BrnTabsTriggerDirective, { descendants: false });
public readonly _itemsChanges = toObservable(this._items);

public _tabListContainer = viewChild.required<ElementRef<HTMLElement>>('tabListContainer');
public _tabList = viewChild.required<ElementRef<HTMLElement>>('tabList');
public _tabListInner = viewChild.required<ElementRef<HTMLElement>>('tabListInner');
public _nextPaginator = viewChild.required<ElementRef<HTMLElement>>('nextPaginator');
public _previousPaginator = viewChild.required<ElementRef<HTMLElement>>('previousPaginator');
public readonly _tabListContainer = viewChild.required<ElementRef<HTMLElement>>('tabListContainer');
public readonly _tabList = viewChild.required<ElementRef<HTMLElement>>('tabList');
public readonly _tabListInner = viewChild.required<ElementRef<HTMLElement>>('tabListInner');
public readonly _nextPaginator = viewChild.required<ElementRef<HTMLElement>>('nextPaginator');
public readonly _previousPaginator = viewChild.required<ElementRef<HTMLElement>>('previousPaginator');

public readonly userClass = input<ClassValue>('', { alias: 'class' });
protected _computedClass = computed(() => hlm('flex overflow-hidden relative flex-shrink-0', this.userClass()));
protected readonly _computedClass = computed(() =>
hlm('flex overflow-hidden relative flex-shrink-0', this.userClass()),
);

public readonly tabLisClass = input<ClassValue>('', { alias: 'class' });
protected _tabListClass = computed(() => hlm(listVariants(), this.tabLisClass()));
protected readonly _tabListClass = computed(() => hlm(listVariants(), this.tabLisClass()));

public readonly paginationButtonClass = input<ClassValue>('', { alias: 'class' });
protected _paginationButtonClass = computed(() =>
protected readonly _paginationButtonClass = computed(() =>
hlm(
'relative z-[2] select-none data-[pagination=previous]:pr-1 data-[pagination=next]:pl-1 disabled:cursor-default',
buttonVariants({ variant: 'ghost', size: 'icon' }),
Expand Down

0 comments on commit 9950745

Please sign in to comment.