### File

`src/lib/table-select-controls/table-select-controls.component.ts`

### Metadata

changeDetection | `ChangeDetectionStrategy.OnPush`
selector | `rxap-table-select-controls`
imports | `MatButtonModule` `AsyncPipe`
styleUrls | `./table-select-controls.component.scss`
templateUrl | `./table-select-controls.component.html`

### Index

###### Properties
Public hasNotSelected$
###### Methods
Public cancel Public select

### Constructor

`constructor(selectRows: SelectRowService<any>, windowRef: WindowRef)`
Defined in src/lib/table-select-controls/table-select-controls.component.ts:25
Parameters :
Name | Type | Optional
selectRows | `SelectRowService<any>` | No
windowRef | `WindowRef` | No

### Methods

Public cancel
`cancel()`
Defined in src/lib/table-select-controls/table-select-controls.component.ts:37
Returns : `void`

Public select
`select()`
Defined in src/lib/table-select-controls/table-select-controls.component.ts:41
Returns : `void`

### Properties

Public hasNotSelected$
Type : `Observable<boolean>`
Defined in src/lib/table-select-controls/table-select-controls.component.ts:25

    import {
      ChangeDetectionStrategy,
      Component,
      Inject,
    } from '@angular/core';
    import type { WindowRef } from '@rxap/window-system';
    import { RXAP_WINDOW_REF } from '@rxap/window-system';
    import type { Observable } from 'rxjs';
    import { map } from 'rxjs/operators';
    import { SelectRowService } from '../select-row/select-row.service';
    import { AsyncPipe } from '@angular/common';
    import { MatButtonModule } from '@angular/material/button';

    @Component({
        selector: 'rxap-table-select-controls',
        templateUrl: './table-select-controls.component.html',
        styleUrls: ['./table-select-controls.component.scss'],
        changeDetection: ChangeDetectionStrategy.OnPush,
        imports: [
            MatButtonModule,
            AsyncPipe,
        ]
    })
    export class TableSelectControlsComponent {
      public hasNotSelected$: Observable<boolean>;

      constructor(
        private readonly selectRows: SelectRowService<any>,
        @Inject(RXAP_WINDOW_REF)
        private readonly windowRef: WindowRef,
      ) {
        this.hasNotSelected$ = this.selectRows.selectedRows$.pipe(
          map((selected) => selected.length === 0),
        );
      }

      public cancel() {
        this.windowRef.close();
      }

      public select() {
        this.windowRef.close(this.selectRows.selectedRows);
      }
    }

    <div class="flex flex-row gap-4">
      <button (click)="cancel()" class="grow-0" mat-stroked-button type="button">
        <ng-container i18n>Cancel</ng-container>
      </button>
      <button (click)="select()" [disabled]="hasNotSelected$ | async" class="grow-0" mat-raised-button type="button">
        <ng-container i18n>Select</ng-container>
      </button>
    </div>

`./table-select-controls.component.scss`

Legend
Html element
Component
Html element with directive

# results matching ""

# No results matching ""