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> <ng-container matColumnDef="actions" stickyEnd>
<th *matHeaderCellDef class="px-1 text-center" mat-header-cell></th> <th *matHeaderCellDef class="px-1 text-center" mat-header-cell></th>
<td *matCellDef="let element" class="px-1 text-center" mat-cell> <td *matCellDef="let element" class="px-1 text-center" mat-cell>
@if (showActions) { @if (showActions()) {
<button <button
class="mx-1 no-min-width px-2" class="mx-1 no-min-width px-2"
mat-button mat-button
@ -100,7 +100,7 @@
<tr <tr
*matFooterRowDef="displayedColumns" *matFooterRowDef="displayedColumns"
mat-footer-row mat-footer-row
[hidden]="!showActions" [hidden]="!showActions()"
></tr> ></tr>
</table> </table>
</form> </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() accountBalances: AccountBalancesResponse['balances'];
@Input() accountCurrency: string; @Input() accountCurrency: string;
@Input() accountId: string; @Input() accountId: string;
@Input() showActions = true;
@Output() accountBalanceCreated = new EventEmitter<CreateAccountBalanceDto>(); @Output() accountBalanceCreated = new EventEmitter<CreateAccountBalanceDto>();
@Output() accountBalanceDeleted = new EventEmitter<string>(); @Output() accountBalanceDeleted = new EventEmitter<string>();
@ -86,6 +85,7 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit {
public displayedColumns: string[] = ['date', 'value', 'actions']; public displayedColumns: string[] = ['date', 'value', 'actions'];
protected readonly locale = input(getLocale()); protected readonly locale = input(getLocale());
protected readonly showActions = input(true);
private dateAdapter = inject<DateAdapter<Date, string>>(DateAdapter); private dateAdapter = inject<DateAdapter<Date, string>>(DateAdapter);
private notificationService = inject(NotificationService); private notificationService = inject(NotificationService);

Loading…
Cancel
Save