ngx-redi-core 1.1.2 → 1.1.3
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.
- package/README.md +24 -24
- package/RediGrid/ng-package.json +7 -6
- package/RediGrid/public-api.ts +2 -2
- package/RediGrid/src/modules/redi-grid/redi-grid.component.html +20 -20
- package/RediGrid/src/modules/redi-grid/redi-grid.component.spec.ts +23 -23
- package/RediGrid/src/modules/redi-grid/redi-grid.component.ts +66 -66
- package/RediGrid/src/modules/redi-grid.module.ts +18 -18
- package/RediTable/ng-package.json +5 -5
- package/RediTable/public-api.ts +2 -2
- package/RediTable/src/modules/redi-table/redi-table.component.html +50 -50
- package/RediTable/src/modules/redi-table/redi-table.component.spec.ts +22 -22
- package/RediTable/src/modules/redi-table/redi-table.component.ts +173 -173
- package/RediTable/src/modules/redi-table.module.ts +28 -28
- package/Security/src/modules/security-web-intercept/interceptors/redi-secure.interceptor.spec.ts +16 -16
- package/Security/src/modules/security-web-intercept/interceptors/redi-secure.interceptor.ts +214 -214
- package/Security/src/modules/security-web-intercept/models/secure-factory.model.spec.ts +7 -7
- package/Security/src/modules/security-web-intercept/models/secure-factory.model.ts +28 -28
- package/Security/src/modules/security-web-intercept/models/tipo-operacion.enum.ts +19 -19
- package/Security/src/modules/security-web-intercept/services/cifrado.service.spec.ts +16 -16
- package/Security/src/modules/security-web-intercept/services/cifrado.service.ts +32 -32
- package/Security/src/modules/security.module.ts +13 -15
- package/index.ts +1 -1
- package/ng-package.json +7 -20
- package/package.json +12 -23
- package/public-api.ts +4 -4
- package/tsconfig.lib.json +14 -14
- package/tsconfig.lib.prod.json +10 -10
- package/tsconfig.spec.json +14 -14
- package/RediGrid/index.ts +0 -2
- package/RediTable/index.ts +0 -2
- package/Security/index.ts +0 -2
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# NgxRediCore
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project ngx-redi-core` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-redi-core`.
|
|
8
|
-
> Note: Don't forget to add `--project ngx-redi-core` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build ngx-redi-core` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build ngx-redi-core`, go to the dist folder `cd dist/ngx-redi-core` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test ngx-redi-core` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
1
|
+
# NgxRediCore
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project ngx-redi-core` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-redi-core`.
|
|
8
|
+
> Note: Don't forget to add `--project ngx-redi-core` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build ngx-redi-core` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build ngx-redi-core`, go to the dist folder `cd dist/ngx-redi-core` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test ngx-redi-core` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
package/RediGrid/ng-package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
|
4
|
+
"lib": {
|
|
5
|
+
"entryFile": "public-api.ts"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/RediGrid/public-api.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./src/modules/redi-grid.module";
|
|
1
|
+
|
|
2
|
+
export * from "./src/modules/redi-grid.module";
|
|
3
3
|
export * from "./src/modules/redi-grid/redi-grid.component"
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<div class="container">
|
|
2
|
-
<cdk-virtual-scroll-viewport #scrollViewport itemSize="25">
|
|
3
|
-
<table>
|
|
4
|
-
<thead>
|
|
5
|
-
<tr>
|
|
6
|
-
<th [style.top]="inverseOfTranslation" *ngIf="enumerate">
|
|
7
|
-
<th [style.top]="inverseOfTranslation" *ngFor="let col of dataGrid.cols">{{col.value}}</th>
|
|
8
|
-
</tr>
|
|
9
|
-
</thead>
|
|
10
|
-
<tbody>
|
|
11
|
-
<tr *cdkVirtualFor="let row of dataGrid.rows;let rowNum = index">
|
|
12
|
-
<td *ngIf="enumerate">{{rowNum+1}}</td>
|
|
13
|
-
<td *ngFor="let cell of row; let colNum=index">
|
|
14
|
-
<input *ngIf="editable" type="text" [value]="cell.value" (focusout)="updateData(rowNum,colNum,$event)" />
|
|
15
|
-
{{!editable?cell.value:''}}
|
|
16
|
-
</td>
|
|
17
|
-
</tr>
|
|
18
|
-
</tbody>
|
|
19
|
-
</table>
|
|
20
|
-
</cdk-virtual-scroll-viewport>
|
|
1
|
+
<div class="container">
|
|
2
|
+
<cdk-virtual-scroll-viewport #scrollViewport itemSize="25">
|
|
3
|
+
<table>
|
|
4
|
+
<thead>
|
|
5
|
+
<tr>
|
|
6
|
+
<th [style.top]="inverseOfTranslation" *ngIf="enumerate">
|
|
7
|
+
<th [style.top]="inverseOfTranslation" *ngFor="let col of dataGrid.cols">{{col.value}}</th>
|
|
8
|
+
</tr>
|
|
9
|
+
</thead>
|
|
10
|
+
<tbody>
|
|
11
|
+
<tr *cdkVirtualFor="let row of dataGrid.rows;let rowNum = index">
|
|
12
|
+
<td *ngIf="enumerate">{{rowNum+1}}</td>
|
|
13
|
+
<td *ngFor="let cell of row; let colNum=index">
|
|
14
|
+
<input *ngIf="editable" type="text" [value]="cell.value" (focusout)="updateData(rowNum,colNum,$event)" />
|
|
15
|
+
{{!editable?cell.value:''}}
|
|
16
|
+
</td>
|
|
17
|
+
</tr>
|
|
18
|
+
</tbody>
|
|
19
|
+
</table>
|
|
20
|
+
</cdk-virtual-scroll-viewport>
|
|
21
21
|
</div>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { RediGridComponent } from './redi-grid.component';
|
|
4
|
-
|
|
5
|
-
describe('SpreadsheetComponent', () => {
|
|
6
|
-
let component: RediGridComponent;
|
|
7
|
-
let fixture: ComponentFixture<RediGridComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [RediGridComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(RediGridComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RediGridComponent } from './redi-grid.component';
|
|
4
|
+
|
|
5
|
+
describe('SpreadsheetComponent', () => {
|
|
6
|
+
let component: RediGridComponent;
|
|
7
|
+
let fixture: ComponentFixture<RediGridComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [RediGridComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(RediGridComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
2
|
-
import { AfterViewInit, Component, Input, ViewChild } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: '
|
|
6
|
-
templateUrl: './redi-grid.component.html',
|
|
7
|
-
styleUrls: ['./redi-grid.component.css']
|
|
8
|
-
})
|
|
9
|
-
export class RediGridComponent implements AfterViewInit {
|
|
10
|
-
@Input()
|
|
11
|
-
dataGrid: DataGrid;
|
|
12
|
-
|
|
13
|
-
@Input()
|
|
14
|
-
enumerate: boolean;
|
|
15
|
-
|
|
16
|
-
@Input()
|
|
17
|
-
editable: boolean;
|
|
18
|
-
|
|
19
|
-
constructor() {
|
|
20
|
-
this.dataGrid = {} as DataGrid;
|
|
21
|
-
this.enumerate = false;
|
|
22
|
-
this.editable = false;
|
|
23
|
-
}
|
|
24
|
-
ngAfterViewInit(): void {
|
|
25
|
-
if (this.dataGrid) {
|
|
26
|
-
this.editable = this.dataGrid.editable || false;
|
|
27
|
-
this.enumerate = this.dataGrid.enumerate || false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@ViewChild(CdkVirtualScrollViewport, { static: false })
|
|
32
|
-
public viewPort!: CdkVirtualScrollViewport;
|
|
33
|
-
public get inverseOfTranslation(): string {
|
|
34
|
-
if (!this.viewPort || !this.viewPort["_renderedContentOffset"]) {
|
|
35
|
-
return "-0px";
|
|
36
|
-
}
|
|
37
|
-
let offset = this.viewPort["_renderedContentOffset"];
|
|
38
|
-
return `-${offset}px`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
updateData(indexRow: number, indexCol: number, event: Event): void {
|
|
42
|
-
if (this.dataGrid && this.dataGrid.rows) {
|
|
43
|
-
let inputControl: HTMLInputElement = event.target as HTMLInputElement;
|
|
44
|
-
this.dataGrid.rows[indexRow][indexCol] = { value: inputControl.value };
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface Cell {
|
|
50
|
-
col?: number;
|
|
51
|
-
row?: number;
|
|
52
|
-
isValid?: boolean;
|
|
53
|
-
maxLength?: number;
|
|
54
|
-
value?: string;
|
|
55
|
-
}
|
|
56
|
-
export interface DataGrid {
|
|
57
|
-
cols: Array<Cell>;
|
|
58
|
-
rows: Array<Array<Cell>>;
|
|
59
|
-
enumerate?: boolean;
|
|
60
|
-
size?: Size;
|
|
61
|
-
editable?: boolean
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface Size {
|
|
65
|
-
width?: number;
|
|
66
|
-
heigth?: number;
|
|
1
|
+
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
2
|
+
import { AfterViewInit, Component, Input, ViewChild } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'mf-spreadsheet',
|
|
6
|
+
templateUrl: './redi-grid.component.html',
|
|
7
|
+
styleUrls: ['./redi-grid.component.css']
|
|
8
|
+
})
|
|
9
|
+
export class RediGridComponent implements AfterViewInit {
|
|
10
|
+
@Input()
|
|
11
|
+
dataGrid: DataGrid;
|
|
12
|
+
|
|
13
|
+
@Input()
|
|
14
|
+
enumerate: boolean;
|
|
15
|
+
|
|
16
|
+
@Input()
|
|
17
|
+
editable: boolean;
|
|
18
|
+
|
|
19
|
+
constructor() {
|
|
20
|
+
this.dataGrid = {} as DataGrid;
|
|
21
|
+
this.enumerate = false;
|
|
22
|
+
this.editable = false;
|
|
23
|
+
}
|
|
24
|
+
ngAfterViewInit(): void {
|
|
25
|
+
if (this.dataGrid) {
|
|
26
|
+
this.editable = this.dataGrid.editable || false;
|
|
27
|
+
this.enumerate = this.dataGrid.enumerate || false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@ViewChild(CdkVirtualScrollViewport, { static: false })
|
|
32
|
+
public viewPort!: CdkVirtualScrollViewport;
|
|
33
|
+
public get inverseOfTranslation(): string {
|
|
34
|
+
if (!this.viewPort || !this.viewPort["_renderedContentOffset"]) {
|
|
35
|
+
return "-0px";
|
|
36
|
+
}
|
|
37
|
+
let offset = this.viewPort["_renderedContentOffset"];
|
|
38
|
+
return `-${offset}px`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
updateData(indexRow: number, indexCol: number, event: Event): void {
|
|
42
|
+
if (this.dataGrid && this.dataGrid.rows) {
|
|
43
|
+
let inputControl: HTMLInputElement = event.target as HTMLInputElement;
|
|
44
|
+
this.dataGrid.rows[indexRow][indexCol] = { value: inputControl.value };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface Cell {
|
|
50
|
+
col?: number;
|
|
51
|
+
row?: number;
|
|
52
|
+
isValid?: boolean;
|
|
53
|
+
maxLength?: number;
|
|
54
|
+
value?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface DataGrid {
|
|
57
|
+
cols: Array<Cell>;
|
|
58
|
+
rows: Array<Array<Cell>>;
|
|
59
|
+
enumerate?: boolean;
|
|
60
|
+
size?: Size;
|
|
61
|
+
editable?: boolean
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface Size {
|
|
65
|
+
width?: number;
|
|
66
|
+
heigth?: number;
|
|
67
67
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { RediGridComponent } from './redi-grid/redi-grid.component';
|
|
4
|
-
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@NgModule({
|
|
9
|
-
declarations: [RediGridComponent],
|
|
10
|
-
imports: [
|
|
11
|
-
CommonModule,
|
|
12
|
-
ScrollingModule
|
|
13
|
-
],
|
|
14
|
-
exports:[
|
|
15
|
-
RediGridComponent
|
|
16
|
-
]
|
|
17
|
-
})
|
|
18
|
-
export class RediGridModule { }
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { RediGridComponent } from './redi-grid/redi-grid.component';
|
|
4
|
+
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@NgModule({
|
|
9
|
+
declarations: [RediGridComponent],
|
|
10
|
+
imports: [
|
|
11
|
+
CommonModule,
|
|
12
|
+
ScrollingModule
|
|
13
|
+
],
|
|
14
|
+
exports:[
|
|
15
|
+
RediGridComponent
|
|
16
|
+
]
|
|
17
|
+
})
|
|
18
|
+
export class RediGridModule { }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"lib": {
|
|
4
|
-
"entryFile": "public-api.ts"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
+
"lib": {
|
|
4
|
+
"entryFile": "public-api.ts"
|
|
5
|
+
}
|
|
6
6
|
}
|
package/RediTable/public-api.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./src/modules/redi-table.module";
|
|
1
|
+
|
|
2
|
+
export * from "./src/modules/redi-table.module";
|
|
3
3
|
export * from "./src/modules/redi-table/redi-table.component"
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
<div class="container">
|
|
2
|
-
<div *ngIf="enableFilter">
|
|
3
|
-
<mat-icon>
|
|
4
|
-
<input placeholder="Filtro" (keyup)="applyFilter($event)" />
|
|
5
|
-
</div>
|
|
6
|
-
<div class="section">
|
|
7
|
-
<table mat-table [dataSource]="dataSource" matSort>
|
|
8
|
-
<ng-container *ngIf="selectRows" matColumnDef="select">
|
|
9
|
-
<th mat-header-cell *matHeaderCellDef>
|
|
10
|
-
<mat-checkbox (change)="$event ? toggleAllRows() : null"
|
|
11
|
-
[checked]="dataTable.selection.hasValue() && isAllSelected()"
|
|
12
|
-
[indeterminate]="dataTable.selection.hasValue() && !isAllSelected()"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
column.key}} </th>
|
|
28
|
-
<td mat-cell *matCellDef="let element"> {{element[column.key]}} </td>
|
|
29
|
-
</ng-container>
|
|
30
|
-
</ng-container>
|
|
31
|
-
<ng-container *ngIf="
|
|
32
|
-
<th mat-header-cell *matHeaderCellDef aria-label="row actions"> </th>
|
|
33
|
-
<td mat-cell *matCellDef="let element">
|
|
34
|
-
<button mat-icon-button color="primary" *ngFor="let action of dataTable.actions"
|
|
35
|
-
(click)="action.action(element,dataSource)">
|
|
36
|
-
<mat-icon>{{action.icon || 'apps'}}</mat-icon>
|
|
37
|
-
</button>
|
|
38
|
-
</td>
|
|
39
|
-
</ng-container>
|
|
40
|
-
|
|
41
|
-
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
|
|
42
|
-
<tr mat-row *matRowDef="let row; columns: displayedColumns;let rowNum = index" [class.odd]="rowNum%2"
|
|
43
|
-
[class.even]="!(rowNum%2)"></tr>
|
|
44
|
-
</table>
|
|
45
|
-
|
|
46
|
-
</div>
|
|
47
|
-
<div [ngClass]="paginateData?'visible':'hidden'">
|
|
48
|
-
<mat-paginator [pageSizeOptions]="[5,10,20,50,100]" showFirstLastButtons aria-label="Seleccione una pagina">
|
|
49
|
-
</mat-paginator>
|
|
50
|
-
</div>
|
|
1
|
+
<div class="container">
|
|
2
|
+
<div *ngIf="enableFilter">
|
|
3
|
+
<mat-icon>search</mat-icon>
|
|
4
|
+
<input placeholder="Filtro" (keyup)="applyFilter($event)" />
|
|
5
|
+
</div>
|
|
6
|
+
<div class="section">
|
|
7
|
+
<table mat-table [dataSource]="dataSource" matSort>
|
|
8
|
+
<ng-container *ngIf="selectRows" matColumnDef="select">
|
|
9
|
+
<th mat-header-cell *matHeaderCellDef>
|
|
10
|
+
<mat-checkbox (change)="$event ? toggleAllRows() : null"
|
|
11
|
+
[checked]="dataTable.selection.hasValue() && isAllSelected()"
|
|
12
|
+
[indeterminate]="dataTable.selection.hasValue() && !isAllSelected()"
|
|
13
|
+
[aria-label]="checkboxLabel()">
|
|
14
|
+
</mat-checkbox>
|
|
15
|
+
</th>
|
|
16
|
+
<td mat-cell *matCellDef="let row">
|
|
17
|
+
<mat-checkbox (click)="$event.stopPropagation()"
|
|
18
|
+
(change)="$event ? dataTable.selection.toggle(row) : null"
|
|
19
|
+
[checked]="dataTable.selection.isSelected(row)" [aria-label]="checkboxLabel(row)">
|
|
20
|
+
</mat-checkbox>
|
|
21
|
+
</td>
|
|
22
|
+
</ng-container>
|
|
23
|
+
|
|
24
|
+
<ng-container>
|
|
25
|
+
<ng-container [matColumnDef]="column.key" *ngFor="let column of colsEntities">
|
|
26
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header [attr.disabled]="isSortActive()"> {{column.label ||
|
|
27
|
+
column.key}} </th>
|
|
28
|
+
<td mat-cell *matCellDef="let element"> {{element[column.key]}} </td>
|
|
29
|
+
</ng-container>
|
|
30
|
+
</ng-container>
|
|
31
|
+
<ng-container *ngIf="actions" matColumnDef="actions" stickyEnd>
|
|
32
|
+
<th mat-header-cell *matHeaderCellDef aria-label="row actions"> </th>
|
|
33
|
+
<td mat-cell *matCellDef="let element">
|
|
34
|
+
<button mat-icon-button color="primary" *ngFor="let action of dataTable.actions"
|
|
35
|
+
(click)="action.action(element,dataSource)">
|
|
36
|
+
<mat-icon>{{action.icon || 'apps'}}</mat-icon>
|
|
37
|
+
</button>
|
|
38
|
+
</td>
|
|
39
|
+
</ng-container>
|
|
40
|
+
|
|
41
|
+
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
|
|
42
|
+
<tr mat-row *matRowDef="let row; columns: displayedColumns;let rowNum = index" [class.odd]="rowNum%2"
|
|
43
|
+
[class.even]="!(rowNum%2)"></tr>
|
|
44
|
+
</table>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
<div [ngClass]="paginateData?'visible':'hidden'">
|
|
48
|
+
<mat-paginator [pageSizeOptions]="[5,10,20,50,100]" showFirstLastButtons aria-label="Seleccione una pagina">
|
|
49
|
+
</mat-paginator>
|
|
50
|
+
</div>
|
|
51
51
|
</div>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { RediTableComponent } from './redi-table.component';
|
|
4
|
-
|
|
5
|
-
describe('TableComponent', () => {
|
|
6
|
-
let component: RediTableComponent<any>;
|
|
7
|
-
let fixture: ComponentFixture<RediTableComponent<any>>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [RediTableComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
fixture = TestBed.createComponent(RediTableComponent);
|
|
15
|
-
component = fixture.componentInstance;
|
|
16
|
-
fixture.detectChanges();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should create', () => {
|
|
20
|
-
expect(component).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RediTableComponent } from './redi-table.component';
|
|
4
|
+
|
|
5
|
+
describe('TableComponent', () => {
|
|
6
|
+
let component: RediTableComponent<any>;
|
|
7
|
+
let fixture: ComponentFixture<RediTableComponent<any>>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [RediTableComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
fixture = TestBed.createComponent(RediTableComponent);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
fixture.detectChanges();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should create', () => {
|
|
20
|
+
expect(component).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
});
|