ngx-eiffage-material 0.0.2
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 +63 -0
- package/fesm2022/ngx-eiffage-material.mjs +139 -0
- package/fesm2022/ngx-eiffage-material.mjs.map +1 -0
- package/index.d.ts +47 -0
- package/package.json +23 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# NgxEiffageMaterial
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.1.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build ngx-eiffage-material
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/ngx-eiffage-material
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, Component, output, computed, viewChild, effect } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/material/button';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import * as i5 from '@angular/material/icon';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import * as i2 from '@angular/material/progress-spinner';
|
|
8
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
9
|
+
import * as i1 from '@angular/material/card';
|
|
10
|
+
import { MatCardModule } from '@angular/material/card';
|
|
11
|
+
import * as i3 from '@angular/material/sort';
|
|
12
|
+
import { MatSortModule } from '@angular/material/sort';
|
|
13
|
+
import * as i2$1 from '@angular/material/table';
|
|
14
|
+
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
15
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
|
+
import * as i6 from '@angular/material/paginator';
|
|
17
|
+
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
18
|
+
|
|
19
|
+
class NgxLoadingButton {
|
|
20
|
+
isLoading = input.required(...(ngDevMode ? [{ debugName: "isLoading" }] : [])); //Indica si el botón está cargando
|
|
21
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : [])); //Texto del botón
|
|
22
|
+
matButton = input('filled', ...(ngDevMode ? [{ debugName: "matButton" }] : [])); //Tipo de botón
|
|
23
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : [])); //Tipo de acción del botón
|
|
24
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : [])); //Indica si el botón está deshabilitado
|
|
25
|
+
spinnerDiameter = input(24, ...(ngDevMode ? [{ debugName: "spinnerDiameter" }] : [])); //Diameter del spinner de carga
|
|
26
|
+
spinnerStrokeWidth = input(3, ...(ngDevMode ? [{ debugName: "spinnerStrokeWidth" }] : [])); //StrokeWidth del spinner de carga
|
|
27
|
+
//Por defecto es Primary
|
|
28
|
+
color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : [])); //Color del botón
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NgxLoadingButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: NgxLoadingButton, isStandalone: true, selector: "ngx-loading-button", inputs: { isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, matButton: { classPropertyName: "matButton", publicName: "matButton", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, spinnerDiameter: { classPropertyName: "spinnerDiameter", publicName: "spinnerDiameter", isSignal: true, isRequired: false, transformFunction: null }, spinnerStrokeWidth: { classPropertyName: "spinnerStrokeWidth", publicName: "spinnerStrokeWidth", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button\r\n class=\"loadingButton\"\r\n [matButton]=\"matButton()\"\r\n [type]=\"type()\"\r\n [disabled]=\"disabled() || isLoading()\"\r\n [class.isLoading]=\"isLoading()\"\r\n [class]=\"color() ?? ''\"\r\n>\r\n {{ label() }}\r\n</button>\r\n\r\n@if (isLoading()) {\r\n <mat-spinner\r\n class=\"spinnerLoadingButton\"\r\n [diameter]=\"spinnerDiameter()\"\r\n [strokeWidth]=\"spinnerStrokeWidth()\"\r\n />\r\n}\r\n", styles: [":host{display:inline-flex;position:relative}.loadingButton{width:100%}.spinnerLoadingButton{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.isLoading{--mat-button-filled-disabled-label-text-color: transparent;--mat-button-outlined-disabled-label-text-color: transparent;--mat-button-protected-disabled-label-text-color: transparent;--mat-button-text-disabled-label-text-color: transparent;--mat-button-tonal-disabled-label-text-color: transparent}.secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-outlined-state-layer-color: var(--mat-sys-secondary);--mat-button-outlined-ripple-color: var(--mat-sys-secondary-container);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-protected-state-layer-color: var(--mat-sys-secondary);--mat-button-protected-ripple-color: var(--mat-sys-secondary-container);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary);--mat-button-text-ripple-color: var(--mat-sys-secondary-container)}.secondarySpinner{--mat-progress-spinner-active-indicator-color: var(--mat-sys-secondary)}.tertiary{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-outlined-state-layer-color: var(--mat-sys-tertiary);--mat-button-outlined-ripple-color: var(--mat-sys-tertiary-container);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-state-layer-color: var(--mat-sys-tertiary);--mat-button-protected-ripple-color: var(--mat-sys-tertiary-container);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary);--mat-button-text-ripple-color: var(--mat-sys-tertiary-container)}.tertiarySpinner{--mat-progress-spinner-active-indicator-color: var(--mat-sys-tertiary)}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatIconModule }] });
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NgxLoadingButton, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{ selector: 'ngx-loading-button', imports: [
|
|
35
|
+
MatButtonModule,
|
|
36
|
+
MatProgressSpinnerModule,
|
|
37
|
+
MatIconModule,
|
|
38
|
+
], template: "<button\r\n class=\"loadingButton\"\r\n [matButton]=\"matButton()\"\r\n [type]=\"type()\"\r\n [disabled]=\"disabled() || isLoading()\"\r\n [class.isLoading]=\"isLoading()\"\r\n [class]=\"color() ?? ''\"\r\n>\r\n {{ label() }}\r\n</button>\r\n\r\n@if (isLoading()) {\r\n <mat-spinner\r\n class=\"spinnerLoadingButton\"\r\n [diameter]=\"spinnerDiameter()\"\r\n [strokeWidth]=\"spinnerStrokeWidth()\"\r\n />\r\n}\r\n", styles: [":host{display:inline-flex;position:relative}.loadingButton{width:100%}.spinnerLoadingButton{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.isLoading{--mat-button-filled-disabled-label-text-color: transparent;--mat-button-outlined-disabled-label-text-color: transparent;--mat-button-protected-disabled-label-text-color: transparent;--mat-button-text-disabled-label-text-color: transparent;--mat-button-tonal-disabled-label-text-color: transparent}.secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-outlined-state-layer-color: var(--mat-sys-secondary);--mat-button-outlined-ripple-color: var(--mat-sys-secondary-container);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-protected-state-layer-color: var(--mat-sys-secondary);--mat-button-protected-ripple-color: var(--mat-sys-secondary-container);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary);--mat-button-text-ripple-color: var(--mat-sys-secondary-container)}.secondarySpinner{--mat-progress-spinner-active-indicator-color: var(--mat-sys-secondary)}.tertiary{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-outlined-state-layer-color: var(--mat-sys-tertiary);--mat-button-outlined-ripple-color: var(--mat-sys-tertiary-container);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-state-layer-color: var(--mat-sys-tertiary);--mat-button-protected-ripple-color: var(--mat-sys-tertiary-container);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary);--mat-button-text-ripple-color: var(--mat-sys-tertiary-container)}.tertiarySpinner{--mat-progress-spinner-active-indicator-color: var(--mat-sys-tertiary)}\n"] }]
|
|
39
|
+
}] });
|
|
40
|
+
|
|
41
|
+
class CommonTableComponent {
|
|
42
|
+
//inputs
|
|
43
|
+
tableConfig = input.required(...(ngDevMode ? [{ debugName: "tableConfig" }] : [])); // Table configuration
|
|
44
|
+
tableData = input.required(...(ngDevMode ? [{ debugName: "tableData" }] : [])); // Table data
|
|
45
|
+
//outputs
|
|
46
|
+
create = output();
|
|
47
|
+
view = output();
|
|
48
|
+
update = output();
|
|
49
|
+
delete = output();
|
|
50
|
+
//computed
|
|
51
|
+
displayedColumns = computed(() => this.tableConfig().displayedColumns, ...(ngDevMode ? [{ debugName: "displayedColumns" }] : []));
|
|
52
|
+
datasource = computed(() => new MatTableDataSource(), ...(ngDevMode ? [{ debugName: "datasource" }] : []));
|
|
53
|
+
paginator = viewChild.required(MatPaginator);
|
|
54
|
+
constructor() {
|
|
55
|
+
effect(() => {
|
|
56
|
+
this.datasource().data = this.tableData();
|
|
57
|
+
this.datasource().paginator = this.paginator();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
getAllColumns() {
|
|
61
|
+
const columns = [...this.tableConfig().displayedColumns];
|
|
62
|
+
if (this.hasActions()) {
|
|
63
|
+
columns.push('actions');
|
|
64
|
+
}
|
|
65
|
+
return columns;
|
|
66
|
+
}
|
|
67
|
+
hasActions() {
|
|
68
|
+
return ((this.tableConfig().actions?.canView ||
|
|
69
|
+
this.tableConfig().actions?.canUpdate ||
|
|
70
|
+
this.tableConfig().actions?.canDelete) || false);
|
|
71
|
+
}
|
|
72
|
+
// Check if the action is a function or a boolean value to determine if it can be executed
|
|
73
|
+
canDoAction(action, row) {
|
|
74
|
+
const fnOrValue = this.tableConfig().actions?.[action];
|
|
75
|
+
if (typeof fnOrValue === 'function') {
|
|
76
|
+
return row !== undefined ? fnOrValue(row) : false;
|
|
77
|
+
}
|
|
78
|
+
return !!fnOrValue;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Actions methods
|
|
82
|
+
*/
|
|
83
|
+
onCreateClick() {
|
|
84
|
+
this.create.emit();
|
|
85
|
+
}
|
|
86
|
+
onViewClick(row) {
|
|
87
|
+
this.view.emit(row);
|
|
88
|
+
}
|
|
89
|
+
onUpdateClick(row) {
|
|
90
|
+
this.update.emit(row);
|
|
91
|
+
}
|
|
92
|
+
onDeleteClick(row) {
|
|
93
|
+
this.delete.emit(row);
|
|
94
|
+
}
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: CommonTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: CommonTableComponent, isStandalone: true, selector: "common-table", inputs: { tableConfig: { classPropertyName: "tableConfig", publicName: "tableConfig", isSignal: true, isRequired: true, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { create: "create", view: "view", update: "update", delete: "delete" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-card>\r\n <div class=\"tableContainer\">\r\n <div class=\"tableHeader\">\r\n <div class=\"tableHeader__title\">\r\n <span>{{ tableConfig().title }}</span>\r\n </div>\r\n <div class=\"tableHeader__buttons\">\r\n @if(canDoAction('canCreate')) {\r\n <button mat-raised-button type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n <span>Create</span>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n <div class=\"overflowTable\">\r\n <table mat-table class=\"mat-elevation-z8\" [dataSource]=\"datasource()\" class=\"customTable\" matSort>\r\n @for(column of tableConfig().tableColumns; track column.key) {\r\n <!-- Dynamically generate columns -->\r\n <ng-container [matColumnDef]=\"column.key\">\r\n <!-- Header cell definition -->\r\n <th mat-header-cell *matHeaderCellDef>{{ column.displayName }}</th>\r\n \r\n <!-- Data cell definition -->\r\n <td mat-cell *matCellDef=\"let row\">{{ row[column.key] }}</td>\r\n </ng-container>\r\n }\r\n\r\n <!-- Actions Column -->\r\n @if(hasActions()) {\r\n <ng-container matColumnDef=\"actions\">\r\n <th mat-header-cell *matHeaderCellDef>Actions</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n @if(canDoAction('canView', row)) {\r\n <button matIconButton (click)=\"onViewClick(row)\">\r\n <mat-icon>visibility</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canUpdate', row)) {\r\n <button matIconButton (click)=\"onUpdateClick(row)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canDelete', row)) {\r\n <button matIconButton (click)=\"onDeleteClick(row)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"getAllColumns()\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: getAllColumns();\"></tr>\r\n </table>\r\n <mat-paginator\r\n #paginator\r\n [length]=\"datasource().data.length\"\r\n [pageSize]=\"5\"\r\n [pageSizeOptions]=\"[5, 10, 25, 100]\"\r\n />\r\n </div>\r\n\r\n </div>\r\n</mat-card>", styles: [".tableContainer{display:flex;flex-direction:column;padding:16px 8px;gap:12px}.tableContainer .tableHeader{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 0 0 8px}.tableContainer .tableHeader__title{font-size:16px;font-weight:500}.tableContainer .tableHeader__buttons button{display:flex;flex-direction:row;align-items:center;padding:0 16px;height:28px;box-shadow:0 1px 2px #0000001a,0 1px 3px 2px #0000000d;border-radius:4px}.overflowTable{overflow-x:auto;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i6.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }] });
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: CommonTableComponent, decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{ selector: 'common-table', imports: [
|
|
101
|
+
MatCardModule,
|
|
102
|
+
MatTableModule,
|
|
103
|
+
MatSortModule,
|
|
104
|
+
MatButtonModule,
|
|
105
|
+
MatTooltipModule,
|
|
106
|
+
MatIconModule,
|
|
107
|
+
MatPaginatorModule
|
|
108
|
+
], template: "<mat-card>\r\n <div class=\"tableContainer\">\r\n <div class=\"tableHeader\">\r\n <div class=\"tableHeader__title\">\r\n <span>{{ tableConfig().title }}</span>\r\n </div>\r\n <div class=\"tableHeader__buttons\">\r\n @if(canDoAction('canCreate')) {\r\n <button mat-raised-button type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n <span>Create</span>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n <div class=\"overflowTable\">\r\n <table mat-table class=\"mat-elevation-z8\" [dataSource]=\"datasource()\" class=\"customTable\" matSort>\r\n @for(column of tableConfig().tableColumns; track column.key) {\r\n <!-- Dynamically generate columns -->\r\n <ng-container [matColumnDef]=\"column.key\">\r\n <!-- Header cell definition -->\r\n <th mat-header-cell *matHeaderCellDef>{{ column.displayName }}</th>\r\n \r\n <!-- Data cell definition -->\r\n <td mat-cell *matCellDef=\"let row\">{{ row[column.key] }}</td>\r\n </ng-container>\r\n }\r\n\r\n <!-- Actions Column -->\r\n @if(hasActions()) {\r\n <ng-container matColumnDef=\"actions\">\r\n <th mat-header-cell *matHeaderCellDef>Actions</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n @if(canDoAction('canView', row)) {\r\n <button matIconButton (click)=\"onViewClick(row)\">\r\n <mat-icon>visibility</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canUpdate', row)) {\r\n <button matIconButton (click)=\"onUpdateClick(row)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canDelete', row)) {\r\n <button matIconButton (click)=\"onDeleteClick(row)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"getAllColumns()\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: getAllColumns();\"></tr>\r\n </table>\r\n <mat-paginator\r\n #paginator\r\n [length]=\"datasource().data.length\"\r\n [pageSize]=\"5\"\r\n [pageSizeOptions]=\"[5, 10, 25, 100]\"\r\n />\r\n </div>\r\n\r\n </div>\r\n</mat-card>", styles: [".tableContainer{display:flex;flex-direction:column;padding:16px 8px;gap:12px}.tableContainer .tableHeader{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 0 0 8px}.tableContainer .tableHeader__title{font-size:16px;font-weight:500}.tableContainer .tableHeader__buttons button{display:flex;flex-direction:row;align-items:center;padding:0 16px;height:28px;box-shadow:0 1px 2px #0000001a,0 1px 3px 2px #0000000d;border-radius:4px}.overflowTable{overflow-x:auto;width:100%}\n"] }]
|
|
109
|
+
}], ctorParameters: () => [] });
|
|
110
|
+
|
|
111
|
+
class NgxBasicTable {
|
|
112
|
+
tableConfig = input.required(...(ngDevMode ? [{ debugName: "tableConfig" }] : []));
|
|
113
|
+
tableData = input.required(...(ngDevMode ? [{ debugName: "tableData" }] : []));
|
|
114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NgxBasicTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
115
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: NgxBasicTable, isStandalone: true, selector: "ngx-basic-table", inputs: { tableConfig: { classPropertyName: "tableConfig", publicName: "tableConfig", isSignal: true, isRequired: true, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<common-table [tableConfig]=\"tableConfig()\" [tableData]=\"tableData()\" />\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: CommonTableComponent, selector: "common-table", inputs: ["tableConfig", "tableData"], outputs: ["create", "view", "update", "delete"] }] });
|
|
116
|
+
}
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NgxBasicTable, decorators: [{
|
|
118
|
+
type: Component,
|
|
119
|
+
args: [{ selector: 'ngx-basic-table', imports: [MatCardModule, CommonTableComponent], template: "<common-table [tableConfig]=\"tableConfig()\" [tableData]=\"tableData()\" />\r\n" }]
|
|
120
|
+
}] });
|
|
121
|
+
|
|
122
|
+
class NgxPaginatedTable {
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NgxPaginatedTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
124
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: NgxPaginatedTable, isStandalone: true, selector: "ngx-paginated-table", ngImport: i0, template: "<p>ngx-paginated-table works!</p>\r\n", styles: [""] });
|
|
125
|
+
}
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NgxPaginatedTable, decorators: [{
|
|
127
|
+
type: Component,
|
|
128
|
+
args: [{ selector: 'ngx-paginated-table', imports: [], template: "<p>ngx-paginated-table works!</p>\r\n" }]
|
|
129
|
+
}] });
|
|
130
|
+
|
|
131
|
+
// export * from './lib/services/index';
|
|
132
|
+
// export * from './lib/utils/index';
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Generated bundle index. Do not edit.
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
export { NgxBasicTable, NgxLoadingButton, NgxPaginatedTable };
|
|
139
|
+
//# sourceMappingURL=ngx-eiffage-material.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-eiffage-material.mjs","sources":["../../../projects/ngx-eiffage-material/src/lib/components/ngx-loading-button/ngx-loading-button.component.ts","../../../projects/ngx-eiffage-material/src/lib/components/ngx-loading-button/ngx-loading-button.component.html","../../../projects/ngx-eiffage-material/src/lib/common/components/common-table/common-table.component.ts","../../../projects/ngx-eiffage-material/src/lib/common/components/common-table/common-table.component.html","../../../projects/ngx-eiffage-material/src/lib/components/ngx-basic-table/ngx-basic-table.component.ts","../../../projects/ngx-eiffage-material/src/lib/components/ngx-basic-table/ngx-basic-table.component.html","../../../projects/ngx-eiffage-material/src/lib/components/ngx-paginated-table/ngx-paginated-table.component.ts","../../../projects/ngx-eiffage-material/src/lib/components/ngx-paginated-table/ngx-paginated-table.component.html","../../../projects/ngx-eiffage-material/src/public-api.ts","../../../projects/ngx-eiffage-material/src/ngx-eiffage-material.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n input,\n output,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\n@Component({\n selector: 'ngx-loading-button',\n imports: [\n MatButtonModule,\n MatProgressSpinnerModule,\n MatIconModule,\n ],\n templateUrl: './ngx-loading-button.component.html',\n styleUrl: './ngx-loading-button.component.scss',\n})\nexport class NgxLoadingButton {\n isLoading = input.required<boolean>(); //Indica si el botón está cargando\n label = input.required<string>(); //Texto del botón\n matButton = input<'text' | 'filled' | 'elevated' | 'outlined' | 'tonal'>('filled'); //Tipo de botón\n type = input<'button' | 'submit' | 'reset'>('button'); //Tipo de acción del botón\n disabled = input<boolean>(false); //Indica si el botón está deshabilitado\n spinnerDiameter = input<number>(24) //Diameter del spinner de carga\n spinnerStrokeWidth = input<number>(3) //StrokeWidth del spinner de carga\n //Por defecto es Primary\n color = input<'secondary' | 'tertiary' | undefined>(undefined); //Color del botón\n\n /*\n No es necesario hacer el onClick, si queremos obtener un evento click,\n puedes hacerlo sobre la llamada al selector, es decir, sobre 'app-loading-button'\n */\n //onClick = output();\n}\n","<button\r\n class=\"loadingButton\"\r\n [matButton]=\"matButton()\"\r\n [type]=\"type()\"\r\n [disabled]=\"disabled() || isLoading()\"\r\n [class.isLoading]=\"isLoading()\"\r\n [class]=\"color() ?? ''\"\r\n>\r\n {{ label() }}\r\n</button>\r\n\r\n@if (isLoading()) {\r\n <mat-spinner\r\n class=\"spinnerLoadingButton\"\r\n [diameter]=\"spinnerDiameter()\"\r\n [strokeWidth]=\"spinnerStrokeWidth()\"\r\n />\r\n}\r\n","import { Component, computed, effect, input, output, viewChild } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatSortModule } from '@angular/material/sort';\r\nimport { MatTableDataSource, MatTableModule } from '@angular/material/table';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { ActionKey, TableConfig } from '../../../models';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';\r\n\r\n@Component({\r\n selector: 'common-table',\r\n imports: [\r\n MatCardModule,\r\n MatTableModule,\r\n MatSortModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n MatIconModule,\r\n MatPaginatorModule\r\n ],\r\n templateUrl: './common-table.component.html',\r\n styleUrl: './common-table.component.scss',\r\n})\r\nexport class CommonTableComponent<T> {\r\n //inputs\r\n readonly tableConfig = input.required<TableConfig>(); // Table configuration\r\n readonly tableData = input.required<T[]>(); // Table data\r\n\r\n //outputs\r\n create = output<void>();\r\n view = output<T>();\r\n update = output<T>();\r\n delete = output<T>();\r\n\r\n //computed\r\n readonly displayedColumns = computed<string[]>(() => this.tableConfig().displayedColumns);\r\n readonly datasource = computed<MatTableDataSource<T>>(() => new MatTableDataSource<T>());\r\n readonly paginator = viewChild.required(MatPaginator);\r\n\r\n\r\n constructor() {\r\n effect(() => {\r\n this.datasource().data = this.tableData();\r\n this.datasource().paginator = this.paginator();\r\n });\r\n }\r\n\r\n getAllColumns(): string[] {\r\n const columns = [...this.tableConfig().displayedColumns];\r\n if (this.hasActions()) {\r\n columns.push('actions');\r\n }\r\n return columns;\r\n }\r\n\r\n hasActions(): boolean {\r\n return (\r\n ((this.tableConfig().actions?.canView ||\r\n this.tableConfig().actions?.canUpdate ||\r\n this.tableConfig().actions?.canDelete) as boolean) || false\r\n );\r\n }\r\n\r\n // Check if the action is a function or a boolean value to determine if it can be executed\r\n canDoAction(action: ActionKey, row?: T): boolean {\r\n const fnOrValue = this.tableConfig().actions?.[action];\r\n if (typeof fnOrValue === 'function') {\r\n return row !== undefined ? (fnOrValue as (row: T) => boolean)(row) : false;\r\n }\r\n return !!fnOrValue;\r\n }\r\n\r\n /**\r\n * Actions methods\r\n */\r\n onCreateClick(): void {\r\n this.create.emit(); \r\n }\r\n\r\n onViewClick(row: T): void {\r\n this.view.emit(row);\r\n }\r\n\r\n onUpdateClick(row: T): void {\r\n this.update.emit(row);\r\n }\r\n\r\n onDeleteClick(row: T): void {\r\n this.delete.emit(row);\r\n }\r\n}\r\n","<mat-card>\r\n <div class=\"tableContainer\">\r\n <div class=\"tableHeader\">\r\n <div class=\"tableHeader__title\">\r\n <span>{{ tableConfig().title }}</span>\r\n </div>\r\n <div class=\"tableHeader__buttons\">\r\n @if(canDoAction('canCreate')) {\r\n <button mat-raised-button type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n <span>Create</span>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n <div class=\"overflowTable\">\r\n <table mat-table class=\"mat-elevation-z8\" [dataSource]=\"datasource()\" class=\"customTable\" matSort>\r\n @for(column of tableConfig().tableColumns; track column.key) {\r\n <!-- Dynamically generate columns -->\r\n <ng-container [matColumnDef]=\"column.key\">\r\n <!-- Header cell definition -->\r\n <th mat-header-cell *matHeaderCellDef>{{ column.displayName }}</th>\r\n \r\n <!-- Data cell definition -->\r\n <td mat-cell *matCellDef=\"let row\">{{ row[column.key] }}</td>\r\n </ng-container>\r\n }\r\n\r\n <!-- Actions Column -->\r\n @if(hasActions()) {\r\n <ng-container matColumnDef=\"actions\">\r\n <th mat-header-cell *matHeaderCellDef>Actions</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n @if(canDoAction('canView', row)) {\r\n <button matIconButton (click)=\"onViewClick(row)\">\r\n <mat-icon>visibility</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canUpdate', row)) {\r\n <button matIconButton (click)=\"onUpdateClick(row)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canDelete', row)) {\r\n <button matIconButton (click)=\"onDeleteClick(row)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"getAllColumns()\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: getAllColumns();\"></tr>\r\n </table>\r\n <mat-paginator\r\n #paginator\r\n [length]=\"datasource().data.length\"\r\n [pageSize]=\"5\"\r\n [pageSizeOptions]=\"[5, 10, 25, 100]\"\r\n />\r\n </div>\r\n\r\n </div>\r\n</mat-card>","import { Component, computed, input } from '@angular/core';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { CommonTableComponent } from '../../common/components/common-table/common-table.component';\r\nimport { TableConfig } from '../../models';\r\n\r\n@Component({\r\n selector: 'ngx-basic-table',\r\n imports: [MatCardModule, CommonTableComponent],\r\n templateUrl: './ngx-basic-table.component.html',\r\n styleUrl: './ngx-basic-table.component.scss'\r\n})\r\nexport class NgxBasicTable<T> {\r\n tableConfig = input.required<TableConfig>();\r\n tableData = input.required<T[]>();\r\n}\r\n","<common-table [tableConfig]=\"tableConfig()\" [tableData]=\"tableData()\" />\r\n","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'ngx-paginated-table',\r\n imports: [],\r\n templateUrl: './ngx-paginated-table.component.html',\r\n styleUrl: './ngx-paginated-table.component.scss'\r\n})\r\nexport class NgxPaginatedTable {\r\n\r\n}\r\n","<p>ngx-paginated-table works!</p>\r\n","export * from './lib/components/index';\r\nexport * from './lib/models/index';\r\n// export * from './lib/services/index';\r\n// export * from './lib/utils/index';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;MAoBa,gBAAgB,CAAA;AAC3B,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW,CAAC;AACtC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU,CAAC;AACjC,IAAA,SAAS,GAAG,KAAK,CAAwD,QAAQ,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAC;AACnF,IAAA,IAAI,GAAG,KAAK,CAAgC,QAAQ,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAC;AACtD,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAC;AACjC,IAAA,eAAe,GAAG,KAAK,CAAS,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAA;AACnC,IAAA,kBAAkB,GAAG,KAAK,CAAS,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,oBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAA;;AAErC,IAAA,KAAK,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iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,+ECR9B,uCACA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FDOa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,WACtB,EAAE,EAAA,QAAA,EAAA,uCAAA,EAAA;;;AEFb;AACA;;ACHA;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class NgxLoadingButton {
|
|
4
|
+
isLoading: _angular_core.InputSignal<boolean>;
|
|
5
|
+
label: _angular_core.InputSignal<string>;
|
|
6
|
+
matButton: _angular_core.InputSignal<"text" | "filled" | "elevated" | "outlined" | "tonal">;
|
|
7
|
+
type: _angular_core.InputSignal<"button" | "submit" | "reset">;
|
|
8
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
9
|
+
spinnerDiameter: _angular_core.InputSignal<number>;
|
|
10
|
+
spinnerStrokeWidth: _angular_core.InputSignal<number>;
|
|
11
|
+
color: _angular_core.InputSignal<"secondary" | "tertiary" | undefined>;
|
|
12
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxLoadingButton, never>;
|
|
13
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxLoadingButton, "ngx-loading-button", never, { "isLoading": { "alias": "isLoading"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "matButton": { "alias": "matButton"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "spinnerDiameter": { "alias": "spinnerDiameter"; "required": false; "isSignal": true; }; "spinnerStrokeWidth": { "alias": "spinnerStrokeWidth"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type ActionKey = 'canCreate' | 'canView' | 'canUpdate' | 'canDelete';
|
|
17
|
+
interface TableConfig {
|
|
18
|
+
title?: string;
|
|
19
|
+
displayedColumns: string[];
|
|
20
|
+
tableColumns: TableColumn[];
|
|
21
|
+
actions?: {
|
|
22
|
+
canCreate: boolean | (() => boolean);
|
|
23
|
+
canView: boolean | ((row: any) => boolean);
|
|
24
|
+
canUpdate: boolean | ((row: any) => boolean);
|
|
25
|
+
canDelete: boolean | ((row: any) => boolean);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
interface TableColumn {
|
|
29
|
+
displayName: string;
|
|
30
|
+
key: string;
|
|
31
|
+
isSortable?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class NgxBasicTable<T> {
|
|
35
|
+
tableConfig: _angular_core.InputSignal<TableConfig>;
|
|
36
|
+
tableData: _angular_core.InputSignal<T[]>;
|
|
37
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxBasicTable<any>, never>;
|
|
38
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxBasicTable<any>, "ngx-basic-table", never, { "tableConfig": { "alias": "tableConfig"; "required": true; "isSignal": true; }; "tableData": { "alias": "tableData"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare class NgxPaginatedTable {
|
|
42
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPaginatedTable, never>;
|
|
43
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxPaginatedTable, "ngx-paginated-table", never, {}, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { NgxBasicTable, NgxLoadingButton, NgxPaginatedTable };
|
|
47
|
+
export type { ActionKey, TableColumn, TableConfig };
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ngx-eiffage-material",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.1.0",
|
|
6
|
+
"@angular/core": "^20.1.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/ngx-eiffage-material.mjs",
|
|
13
|
+
"typings": "index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./index.d.ts",
|
|
20
|
+
"default": "./fesm2022/ngx-eiffage-material.mjs"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|