@competer/primeng-table 0.0.0-stage → 19.1.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.
- package/README.md +174 -3
- package/fesm2022/competer-primeng-table.mjs +2562 -0
- package/fesm2022/competer-primeng-table.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/column-selector/column-selector.d.ts +53 -0
- package/lib/components/ecs-primeng-table/ecs-primeng-table.d.ts +199 -0
- package/lib/components/ecs-primeng-table/ecs-primeng-table.service.d.ts +51 -0
- package/lib/components/export-excel/export-excel.d.ts +49 -0
- package/lib/components/export-excel/export-excel.service.d.ts +6 -0
- package/lib/components/table-button/table-button.d.ts +16 -0
- package/lib/components/table-cell/table-cell.d.ts +67 -0
- package/lib/components/table-predefined-filters/table-predefined-filters.d.ts +39 -0
- package/lib/components/views-management/views-management.d.ts +34 -0
- package/lib/enums/cell-display.enum.d.ts +5 -0
- package/lib/enums/cell-overflow-behaviour.enum.d.ts +12 -0
- package/lib/enums/data-align-horizontal.enum.d.ts +14 -0
- package/lib/enums/data-align-vertical.enum.d.ts +14 -0
- package/lib/enums/data-type.enum.enum.d.ts +19 -0
- package/lib/enums/device-type.enum.d.ts +6 -0
- package/lib/enums/frozen-column-align.enum.d.ts +15 -0
- package/lib/enums/index.d.ts +8 -0
- package/lib/enums/table-view-save-mode.enum.d.ts +17 -0
- package/lib/interfaces/columns-metadata.interface.d.ts +65 -0
- package/lib/interfaces/excel-export-request.interface.d.ts +20 -0
- package/lib/interfaces/index.d.ts +10 -0
- package/lib/interfaces/predefined-filter.interface.d.ts +101 -0
- package/lib/interfaces/table-button.interface.d.ts +75 -0
- package/lib/interfaces/table-configuration.interface.d.ts +23 -0
- package/lib/interfaces/table-options.interface.d.ts +591 -0
- package/lib/interfaces/table-paged-response.interface.d.ts +16 -0
- package/lib/interfaces/table-query-request.interface.d.ts +28 -0
- package/lib/interfaces/table-view-data.interface.d.ts +26 -0
- package/lib/interfaces/table-view.interface.d.ts +15 -0
- package/lib/pipes/ui-translate.pipe.d.ts +13 -0
- package/lib/services/http.service.d.ts +34 -0
- package/lib/services/i18n.service.d.ts +18 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/notification.service.d.ts +23 -0
- package/lib/services/table-state.service.d.ts +28 -0
- package/lib/utils/create-table-options.d.ts +5 -0
- package/lib/utils/data-align-horizontal-as-text.d.ts +11 -0
- package/lib/utils/data-align-vertical-as-text.d.ts +11 -0
- package/lib/utils/data-type-as-text.d.ts +11 -0
- package/lib/utils/frozen-column-align-as-text.d.ts +11 -0
- package/lib/utils/highlight-text.d.ts +17 -0
- package/lib/utils/index.d.ts +6 -0
- package/package.json +48 -3
- package/public-api.d.ts +9 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HttpHeaders, HttpResponse } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Abstract service for handling HTTP requests for **ECS Primeng table**.
|
|
6
|
+
*
|
|
7
|
+
* Provides a consistent interface for making GET and POST requests to the backend.
|
|
8
|
+
* Implementations must define how requests are executed, including error handling,
|
|
9
|
+
* headers, and response processing.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class ECSPrimengTableHttpService {
|
|
12
|
+
/**
|
|
13
|
+
* Performs a GET request to the specified service endpoint.
|
|
14
|
+
*
|
|
15
|
+
* @template T The expected response type.
|
|
16
|
+
* @param servicePoint The endpoint URL or path for the GET request.
|
|
17
|
+
* @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
|
|
18
|
+
* @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
|
|
19
|
+
*/
|
|
20
|
+
abstract handleHttpGetRequest<T>(servicePoint: string, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
21
|
+
/**
|
|
22
|
+
* Performs a POST request to the specified service endpoint.
|
|
23
|
+
*
|
|
24
|
+
* @template T The expected response type.
|
|
25
|
+
* @param servicePoint The endpoint URL or path for the POST request.
|
|
26
|
+
* @param data The payload to send in the POST request body.
|
|
27
|
+
* @param httpOptions Optional HTTP headers to include in the request.
|
|
28
|
+
* @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
|
|
29
|
+
* @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
|
|
30
|
+
*/
|
|
31
|
+
abstract handleHttpPostRequest<T>(servicePoint: string, data: any, httpOptions?: HttpHeaders | null, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableHttpService, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableHttpService>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/** Translates UI text only; never changes column keys, data or persisted view names. */
|
|
3
|
+
export declare class ECSPrimengTableI18nService {
|
|
4
|
+
private readonly translate;
|
|
5
|
+
private readonly prime;
|
|
6
|
+
private readonly destroyRef;
|
|
7
|
+
private readonly parser;
|
|
8
|
+
private connected;
|
|
9
|
+
private primeDefaults;
|
|
10
|
+
private appliedPrimeTranslations;
|
|
11
|
+
readonly changes: import("rxjs").Observable<import("@ngx-translate/core").LangChangeEvent | import("@ngx-translate/core").TranslationChangeEvent | import("@ngx-translate/core").FallbackLangChangeEvent>;
|
|
12
|
+
text(key: string | null | undefined, params?: Record<string, any>): string;
|
|
13
|
+
/** Optional dictionary section "primeng" configures the application's shared PrimeNG locale. */
|
|
14
|
+
connectPrimeNG(): void;
|
|
15
|
+
private syncPrimeNG;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableI18nService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableI18nService>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract service for handling notifications in **ECS Primeng table**.
|
|
4
|
+
*
|
|
5
|
+
* Provides a consistent interface for displaying and clearing toast notifications.
|
|
6
|
+
* Implementations must define how the notifications are managed.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class ECSPrimengTableNotificationService {
|
|
9
|
+
/**
|
|
10
|
+
* Displays a toast notification.
|
|
11
|
+
*
|
|
12
|
+
* @param severity The severity level of the notification (e.g., 'success', 'info', 'warn', 'error').
|
|
13
|
+
* @param title The title of the toast message.
|
|
14
|
+
* @param message The detailed message of the toast.
|
|
15
|
+
*/
|
|
16
|
+
abstract showToast(severity: string, title: string, message: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Clears all currently displayed toast notifications.
|
|
19
|
+
*/
|
|
20
|
+
abstract clearToasts(): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableNotificationService, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableNotificationService>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { FilterMetadata, SortMeta } from 'primeng/api';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Transient query state only; rows and row selections are never cached. */
|
|
5
|
+
export interface ITableNavigationState {
|
|
6
|
+
configurationUrl: string;
|
|
7
|
+
dataUrl: string;
|
|
8
|
+
filters: Record<string, FilterMetadata | FilterMetadata[]>;
|
|
9
|
+
multiSortMeta: SortMeta[];
|
|
10
|
+
globalSearchText: string | null;
|
|
11
|
+
currentPage: number;
|
|
12
|
+
currentRowsPerPage: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Provide on the parent COMPONENT containing the list and detail router outlet.
|
|
16
|
+
* Do not provide at application/root level or on the list component itself.
|
|
17
|
+
* Destroying that parent ends the scope and discards all its table states.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ECSPrimengTableStateService implements OnDestroy {
|
|
20
|
+
private readonly states;
|
|
21
|
+
private destroyed;
|
|
22
|
+
get(key: string): ITableNavigationState | undefined;
|
|
23
|
+
set(key: string, state: ITableNavigationState): void;
|
|
24
|
+
clear(key?: string): void;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableStateService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableStateService>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataAlignHorizontal } from "../enums";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a `DataAlignHorizontal` enum value to its corresponding CSS text alignment string.
|
|
4
|
+
*
|
|
5
|
+
* @param dataAlignHorizontal - The horizontal alignment enum value.
|
|
6
|
+
* @returns The CSS text alignment string ('left', 'center', or 'right').
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* If an unknown value is provided, the function defaults to 'center'.
|
|
10
|
+
*/
|
|
11
|
+
export declare function dataAlignHorizontalAsText(dataAlignHorizontal: DataAlignHorizontal): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataAlignVertical } from "../enums";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a `DataAlignVertical` enum value to its corresponding CSS vertical alignment string.
|
|
4
|
+
*
|
|
5
|
+
* @param dataAlignVertical - The vertical alignment enum value.
|
|
6
|
+
* @returns The CSS vertical alignment string ('top', 'middle', or 'bottom').
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* If an unknown value is provided, the function defaults to 'middle'.
|
|
10
|
+
*/
|
|
11
|
+
export declare function dataAlignVerticalAsText(dataAlignVertical: DataAlignVertical): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataType } from "../enums";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a `DataType` enum value to its corresponding string representation.
|
|
4
|
+
*
|
|
5
|
+
* @param dataType - The data type enum value.
|
|
6
|
+
* @returns The string representation of the data type ('text', 'numeric', 'boolean', or 'date').
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* If an unknown value is provided, the function defaults to 'text'.
|
|
10
|
+
*/
|
|
11
|
+
export declare function dataTypeAsText(dataType: DataType): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FrozenColumnAlign } from "../enums";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a `FrozenColumnAlign` enum value to its corresponding CSS alignment string.
|
|
4
|
+
*
|
|
5
|
+
* @param frozenColumnAlign - The frozen column alignment enum value.
|
|
6
|
+
* @returns The CSS alignment string ('left' or 'right').
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* If an unknown value is provided, the function defaults to 'left'.
|
|
10
|
+
*/
|
|
11
|
+
export declare function frozenColumnAlignAsText(frozenColumnAlign: FrozenColumnAlign): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
2
|
+
import { IColumnMetadata } from "../interfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Generates sanitized HTML (`SafeHtml`) with highlighted text based on a global search term.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This utility safely creates HTML content where occurrences of the provided global search text
|
|
8
|
+
* within the cell value are wrapped in a `<span class="highlighted-text">` tag for visual emphasis.
|
|
9
|
+
* If the cell does not match the search text or is of type `Boolean`, the original value is returned as safe HTML.
|
|
10
|
+
*
|
|
11
|
+
* @param {any} cellValue - The cell's value that may contain the text to highlight.
|
|
12
|
+
* @param {IColumnMetadata} colMetadata - Metadata configuration of the column that defines its data type and filtering behavior.
|
|
13
|
+
* @param {string | null} globalSearchText - The search text to highlight if found within the cell's content.
|
|
14
|
+
* @param {DomSanitizer} sanitizer - Angular's sanitizer used to safely produce trusted HTML content.
|
|
15
|
+
* @returns {SafeHtml} A `SafeHtml` instance containing highlighted HTML when a match is found, or the original sanitized text otherwise.
|
|
16
|
+
*/
|
|
17
|
+
export declare function highlightText(cellValue: any, colMetadata: IColumnMetadata, globalSearchText: string | null, sanitizer: DomSanitizer): SafeHtml;
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@competer/primeng-table",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "19.1.8",
|
|
4
|
+
"description": "Community-maintained fork of ECS. Reusable Angular PrimeNG table component with advanced server-side filters. Designed to offload filtering logic to any backend API.",
|
|
5
|
+
"author": "ECS (Eternal CODE Studio); ComPeter",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"angular",
|
|
9
|
+
"primeng",
|
|
10
|
+
"table",
|
|
11
|
+
"ecs",
|
|
12
|
+
"datatable",
|
|
13
|
+
"component",
|
|
14
|
+
"ui"
|
|
15
|
+
],
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@angular/common": ">=19.0.0",
|
|
18
|
+
"@angular/core": ">=19.0.0",
|
|
19
|
+
"@angular/animations": ">=19.0.0",
|
|
20
|
+
"primeng": ">=19.0.0",
|
|
21
|
+
"primeicons": ">=7.0.0",
|
|
22
|
+
"@ngx-translate/core": "^17.0.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"tslib": "^2.3.0"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18.0.0",
|
|
29
|
+
"npm": ">=9.0.0"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/competergiga/ECSPrimengTable.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/competergiga/ECSPrimengTable/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/competergiga/ECSPrimengTable/tree/Angular19-publish",
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"module": "fesm2022/competer-primeng-table.mjs",
|
|
41
|
+
"typings": "index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
"./package.json": {
|
|
44
|
+
"default": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
".": {
|
|
47
|
+
"types": "./index.d.ts",
|
|
48
|
+
"default": "./fesm2022/competer-primeng-table.mjs"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
6
51
|
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './lib/enums';
|
|
2
|
+
export * from './lib/interfaces/columns-metadata.interface';
|
|
3
|
+
export * from './lib/interfaces/predefined-filter.interface';
|
|
4
|
+
export * from './lib/interfaces/table-button.interface';
|
|
5
|
+
export * from './lib/interfaces/table-options.interface';
|
|
6
|
+
export * from "./lib/utils/create-table-options";
|
|
7
|
+
export * from './lib/services';
|
|
8
|
+
export * from './lib/components/ecs-primeng-table/ecs-primeng-table';
|
|
9
|
+
export * from './lib/components/ecs-primeng-table/ecs-primeng-table.service';
|