Browse Source

feat(lib): make showActions an input signal

pull/6352/head
KenTandrian 1 month ago
parent
commit
20bd0cef2c
  1. 4
      libs/ui/src/lib/account-balances/account-balances.component.html
  2. 2
      libs/ui/src/lib/account-balances/account-balances.component.ts

4
libs/ui/src/lib/account-balances/account-balances.component.html

@ -58,7 +58,7 @@
<ng-container matColumnDef="actions" stickyEnd>
<th *matHeaderCellDef class="px-1 text-center" mat-header-cell></th>
<td *matCellDef="let element" class="px-1 text-center" mat-cell>
@if (showActions) {
@if (showActions()) {
<button
class="mx-1 no-min-width px-2"
mat-button
@ -100,7 +100,7 @@
<tr
*matFooterRowDef="displayedColumns"
mat-footer-row
[hidden]="!showActions"
[hidden]="!showActions()"
></tr>
</table>
</form>

2
libs/ui/src/lib/account-balances/account-balances.component.ts

@ -67,7 +67,6 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit {
@Input() accountBalances: AccountBalancesResponse['balances'];
@Input() accountCurrency: string;
@Input() accountId: string;
@Input() showActions = true;
@Output() accountBalanceCreated = new EventEmitter<CreateAccountBalanceDto>();
@Output() accountBalanceDeleted = new EventEmitter<string>();
@ -86,6 +85,7 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit {
public displayedColumns: string[] = ['date', 'value', 'actions'];
protected readonly locale = input(getLocale());
protected readonly showActions = input(true);
private dateAdapter = inject<DateAdapter<Date, string>>(DateAdapter);
private notificationService = inject(NotificationService);

Loading…
Cancel
Save