ngx-redi-core 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
2
2
  import { AfterViewInit, Component, Input, ViewChild } from '@angular/core';
3
3
 
4
4
  @Component({
5
- selector: 'mf-spreadsheet',
5
+ selector: 'redi-grid',
6
6
  templateUrl: './redi-grid.component.html',
7
7
  styleUrls: ['./redi-grid.component.css']
8
8
  })
@@ -2,8 +2,5 @@
2
2
  "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3
3
  "lib": {
4
4
  "entryFile": "public-api.ts"
5
- },
6
- "allowedNonPeerDependencies": [
7
- "@angular/material"
8
- ]
5
+ }
9
6
  }
@@ -9,8 +9,7 @@
9
9
  <th mat-header-cell *matHeaderCellDef>
10
10
  <mat-checkbox (change)="$event ? toggleAllRows() : null"
11
11
  [checked]="dataTable.selection.hasValue() && isAllSelected()"
12
- [indeterminate]="dataTable.selection.hasValue() && !isAllSelected()"
13
- [aria-label]="checkboxLabel()">
12
+ [indeterminate]="dataTable.selection.hasValue() && !isAllSelected()">
14
13
  </mat-checkbox>
15
14
  </th>
16
15
  <td mat-cell *matCellDef="let row">
@@ -29,7 +28,7 @@
29
28
  <td mat-cell *matCellDef="let element"> {{element[column.key]}} </td>
30
29
  </ng-container>
31
30
  </ng-container>
32
- <ng-container *ngIf="actions" matColumnDef="actions" stickyEnd>
31
+ <ng-container *ngIf="showActions()" matColumnDef="actions" stickyEnd>
33
32
  <th mat-header-cell *matHeaderCellDef aria-label="row actions">&nbsp;</th>
34
33
  <td mat-cell *matCellDef="let element">
35
34
  <button mat-icon-button color="primary" *ngFor="let action of dataTable.actions"
@@ -22,8 +22,6 @@ export class RediTableComponent<T> implements AfterViewInit, OnChanges {
22
22
  @Input()
23
23
  public sortData: boolean = false;
24
24
 
25
- public actions: boolean = false;
26
-
27
25
  @Input()
28
26
  public dataTable: DataTable<T>;
29
27
 
@@ -101,8 +99,7 @@ export class RediTableComponent<T> implements AfterViewInit, OnChanges {
101
99
  }
102
100
  }
103
101
  this.displayedColumns.push(...this.colsEntities.map(item => { return item.key }));
104
- this.actions = this.dataTable.actions && this.dataTable.actions.length > 0;
105
- if (this.actions) {
102
+ if (this.showActions()) {
106
103
  this.displayedColumns.push('actions')
107
104
  }
108
105
  this.dataSource.sort = this.sort;
@@ -110,6 +107,10 @@ export class RediTableComponent<T> implements AfterViewInit, OnChanges {
110
107
  this.translatePaginator();
111
108
  }
112
109
 
110
+ public showActions(): boolean {
111
+ return this.dataTable.actions && this.dataTable.actions.length > 0;
112
+ }
113
+
113
114
  private translatePaginator() {
114
115
  this.paginator._intl.itemsPerPageLabel = 'Elementos por pagina';
115
116
  this.paginator._intl.firstPageLabel = 'Primera pagina';
@@ -123,9 +124,8 @@ export class RediTableComponent<T> implements AfterViewInit, OnChanges {
123
124
  }
124
125
 
125
126
  isSortActive() {
126
- if (!this.sortData) {
127
+ if (!this.sortData && this.sort) {
127
128
  this.sort.direction = '';
128
- this.sort
129
129
  }
130
130
  return !this.sortData
131
131
  }
@@ -143,7 +143,7 @@ export class RediTableComponent<T> implements AfterViewInit, OnChanges {
143
143
  const numRows = this.dataSource.data.length;
144
144
  return numSelected === numRows;
145
145
  }
146
-
146
+
147
147
  checkboxLabel(row?: any): string {
148
148
  if (!row) {
149
149
  return `${this.isAllSelected() ? 'deselect' : 'select'} all`;
package/package.json CHANGED
@@ -1,17 +1,37 @@
1
1
  {
2
2
  "name": "ngx-redi-core",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "peerDependencies": {
5
+ "@angular/cdk": "^15.2.9",
6
+ "@angular/animations": "^15.2.9",
5
7
  "@angular/common": "^15.2.9",
8
+ "@angular/compiler": "^15.2.9",
6
9
  "@angular/core": "^15.2.9",
7
- "@angular-devkit/build-angular": "^15.2.8"
10
+ "@angular/forms": "^15.2.9",
11
+ "@angular/material": "^15.2.9",
12
+ "@angular/platform-browser": "^15.2.9",
13
+ "@angular/platform-browser-dynamic": "^15.2.9",
14
+ "@angular/router": "^15.2.9",
15
+ "rxjs": "~7.8.1",
16
+ "zone.js": "~0.13.0"
8
17
  },
9
18
  "dependencies": {
10
19
  "tslib": "^2.5.0"
11
20
  },
12
21
  "devDependencies": {
13
- "@angular/cdk": "^15.2.9"
22
+ "@angular/cdk": "^15.2.9",
23
+ "@angular/animations": "^15.2.9",
24
+ "@angular/common": "^15.2.9",
25
+ "@angular/compiler": "^15.2.9",
26
+ "@angular/core": "^15.2.9",
27
+ "@angular/forms": "^15.2.9",
28
+ "@angular/material": "^15.2.9",
29
+ "@angular/platform-browser": "^15.2.9",
30
+ "@angular/platform-browser-dynamic": "^15.2.9",
31
+ "@angular/router": "^15.2.9",
32
+ "rxjs": "~7.8.1",
33
+ "zone.js": "~0.13.0"
14
34
  },
15
35
  "sideEffects": false,
16
36
  "allowedNonPeerDependencies": []
17
- }
37
+ }