@pongrass/utils 0.0.1-v20 → 0.0.3-v20
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 +7 -7
- package/fesm2022/pongrass-utils.mjs +756 -13
- package/fesm2022/pongrass-utils.mjs.map +1 -1
- package/index.d.ts +275 -3
- package/package.json +10 -4
package/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { WritableSignal, ElementRef, OnInit, OnDestroy, EventEmitter, OnChanges, SimpleChanges, AfterViewInit } from '@angular/core';
|
|
3
|
+
import * as i3$1 from '@ag-grid-community/angular';
|
|
3
4
|
import { ICellRendererAngularComp, IFilterAngularComp } from '@ag-grid-community/angular';
|
|
4
|
-
import { ICellRendererParams, IFilterParams, IDoesFilterPassParams } from '@ag-grid-community/core';
|
|
5
|
+
import { ICellRendererParams, IFilterParams, IDoesFilterPassParams, ColDef, SelectionColumnDef, GridOptions, GridReadyEvent, GridApi, CellValueChangedEvent, PaginationChangedEvent, AgPublicEventType, ColumnResizedEvent, ColumnMovedEvent, SortChangedEvent, FirstDataRenderedEvent } from '@ag-grid-community/core';
|
|
5
6
|
import * as i4 from '@angular/forms';
|
|
6
7
|
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
8
|
+
import { Observable, Subject } from 'rxjs';
|
|
7
9
|
import * as i3 from '@angular/common';
|
|
8
10
|
import * as i5 from '@coreui/angular-pro';
|
|
9
11
|
import * as i6 from '@coreui/icons-angular';
|
|
@@ -55,6 +57,7 @@ interface IProject {
|
|
|
55
57
|
declare class ConfigurationServiceLib {
|
|
56
58
|
currentTablePreference: WritableSignal<any>;
|
|
57
59
|
allConfigValues: WritableSignal<IConfig | null>;
|
|
60
|
+
openFilterModal: WritableSignal<boolean>;
|
|
58
61
|
constructor();
|
|
59
62
|
generateUniqueId(): string;
|
|
60
63
|
setTablePreference(tableName: string, preference: any): void;
|
|
@@ -62,6 +65,17 @@ declare class ConfigurationServiceLib {
|
|
|
62
65
|
static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurationServiceLib>;
|
|
63
66
|
}
|
|
64
67
|
|
|
68
|
+
interface IAvailableForms {
|
|
69
|
+
table_name: string;
|
|
70
|
+
form_name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
unique_key: string;
|
|
73
|
+
fields_to_display: {
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}[];
|
|
76
|
+
checkbox_fields: string[];
|
|
77
|
+
modal_filter: boolean;
|
|
78
|
+
}
|
|
65
79
|
interface IColorOption {
|
|
66
80
|
color_name: string;
|
|
67
81
|
color_code: string;
|
|
@@ -106,6 +120,17 @@ interface IPageStatusList {
|
|
|
106
120
|
ps_waiting_checkpoint: string;
|
|
107
121
|
ps_complete_checkpoint: string;
|
|
108
122
|
}
|
|
123
|
+
interface IProdStatus {
|
|
124
|
+
rop_component_type: string;
|
|
125
|
+
html_color: string;
|
|
126
|
+
statusid: string;
|
|
127
|
+
needsaqueue: string;
|
|
128
|
+
statusname: string;
|
|
129
|
+
statusdesc: string;
|
|
130
|
+
productiononly: string;
|
|
131
|
+
class_component_type: string;
|
|
132
|
+
status_colour: string;
|
|
133
|
+
}
|
|
109
134
|
|
|
110
135
|
declare class ColorCellRendererComponent implements ICellRendererAngularComp {
|
|
111
136
|
params: ICellRendererParams;
|
|
@@ -214,6 +239,23 @@ declare class PageStatusCellRendererComponent {
|
|
|
214
239
|
static ɵcmp: i0.ɵɵComponentDeclaration<PageStatusCellRendererComponent, "app-page-status-cell-renderer", never, {}, {}, never, never, true, never>;
|
|
215
240
|
}
|
|
216
241
|
|
|
242
|
+
declare class StatusSelectCellRendererComponent implements ICellRendererAngularComp {
|
|
243
|
+
prodStatusList: IProdStatus[];
|
|
244
|
+
private params;
|
|
245
|
+
fileStatus: any | undefined;
|
|
246
|
+
agInit(params: ICellRendererParams): void;
|
|
247
|
+
refresh(params: ICellRendererParams): boolean;
|
|
248
|
+
updatePageStatus(value: string): void;
|
|
249
|
+
getStatusColor(): string;
|
|
250
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StatusSelectCellRendererComponent, never>;
|
|
251
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StatusSelectCellRendererComponent, "app-status-select-cell-renderer", never, {}, {}, never, never, true, never>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
interface IEmmitedResponse {
|
|
255
|
+
isReset: boolean;
|
|
256
|
+
returnedData: any[];
|
|
257
|
+
}
|
|
258
|
+
|
|
217
259
|
declare enum FormFieldType {
|
|
218
260
|
Text = "text",
|
|
219
261
|
Email = "email",
|
|
@@ -366,6 +408,65 @@ declare class MultiFormComponent implements OnInit, OnChanges {
|
|
|
366
408
|
static ɵcmp: i0.ɵɵComponentDeclaration<MultiFormComponent, "app-multi-form", never, { "config": { "alias": "config"; "required": false; }; "showUnsavedFlags": { "alias": "showUnsavedFlags"; "required": false; }; "currentTableGridsSelectedIndex": { "alias": "currentTableGridsSelectedIndex"; "required": false; }; "formId": { "alias": "formId"; "required": false; }; }, { "fieldAction": "fieldAction"; "formSavedUnsavedListen": "formSavedUnsavedListen"; "selectionChangeEvent": "selectionChangeEvent"; }, never, never, false, never>;
|
|
367
409
|
}
|
|
368
410
|
|
|
411
|
+
declare class JsonrpcService {
|
|
412
|
+
private readonly httpService;
|
|
413
|
+
private readonly configService;
|
|
414
|
+
postJsonRpcRequest(method: string, params: any): Observable<any>;
|
|
415
|
+
postJsonRpcRequestPromise(method: string, params: any): Promise<any>;
|
|
416
|
+
/**
|
|
417
|
+
*
|
|
418
|
+
* @param formName Form config name
|
|
419
|
+
* @param tableName Table Name
|
|
420
|
+
*/
|
|
421
|
+
getFormConfig(formName: string, tableName: string): Promise<IFormConfig | null>;
|
|
422
|
+
/**
|
|
423
|
+
*
|
|
424
|
+
* @param formName Report config name
|
|
425
|
+
* @param reportName Table Name
|
|
426
|
+
*/
|
|
427
|
+
getFormConfigReports(formName: string, reportName: string): Promise<IFormConfig | null>;
|
|
428
|
+
/** Get available forms */
|
|
429
|
+
getTableConfig(tableName: string): Promise<IAvailableForms[]>;
|
|
430
|
+
/** Get single row data by their params */
|
|
431
|
+
getTableRow(tableName: string, param: any): Promise<any>;
|
|
432
|
+
/**
|
|
433
|
+
*
|
|
434
|
+
* @param tableName Table Name
|
|
435
|
+
* @param param Form values and params needed fo the call
|
|
436
|
+
* @param action 'U' for update and 'N' for create and 'D' for delete
|
|
437
|
+
* @returns Promise<any>
|
|
438
|
+
*/
|
|
439
|
+
createUpdateDeleteTableRow(tableName: string, requests: any, action?: MaintAction): Promise<any>;
|
|
440
|
+
/**
|
|
441
|
+
*
|
|
442
|
+
* @param tableName Table Name
|
|
443
|
+
* @param param Params to get the list of data
|
|
444
|
+
* @returns Array of data
|
|
445
|
+
*/
|
|
446
|
+
getTableList(tableName: string, param: any): Promise<any>;
|
|
447
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<JsonrpcService, never>;
|
|
448
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<JsonrpcService>;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
declare class GenericFilterModelComponent implements OnInit {
|
|
452
|
+
readonly configurationService: ConfigurationServiceLib;
|
|
453
|
+
readonly jsonrpcService: JsonrpcService;
|
|
454
|
+
filterFormConfiguration: IFormConfig | any;
|
|
455
|
+
tableName: string;
|
|
456
|
+
sendFilteredData: EventEmitter<IEmmitedResponse>;
|
|
457
|
+
filterFormComponent: MultiFormComponent;
|
|
458
|
+
isFilterModalActive: boolean;
|
|
459
|
+
constructor();
|
|
460
|
+
ngOnInit(): void;
|
|
461
|
+
handleFilterModal(event: boolean): void;
|
|
462
|
+
resetFilter(): void;
|
|
463
|
+
onFilter(): Promise<void>;
|
|
464
|
+
private filterAttributesWithValues;
|
|
465
|
+
close(): void;
|
|
466
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GenericFilterModelComponent, never>;
|
|
467
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GenericFilterModelComponent, "app-generic-filter-model", never, { "filterFormConfiguration": { "alias": "filterFormConfiguration"; "required": false; }; "tableName": { "alias": "tableName"; "required": false; }; }, { "sendFilteredData": "sendFilteredData"; }, never, never, true, never>;
|
|
468
|
+
}
|
|
469
|
+
|
|
369
470
|
declare class CircularFocusDirective implements AfterViewInit, OnDestroy {
|
|
370
471
|
private el;
|
|
371
472
|
formId: string;
|
|
@@ -432,5 +533,176 @@ declare class MultiFormModule {
|
|
|
432
533
|
static ɵinj: i0.ɵɵInjectorDeclaration<MultiFormModule>;
|
|
433
534
|
}
|
|
434
535
|
|
|
435
|
-
|
|
436
|
-
|
|
536
|
+
declare class ITableGridConfiguration {
|
|
537
|
+
initialState: ITableGridState[];
|
|
538
|
+
columnDefs: ColDef[];
|
|
539
|
+
rows: any;
|
|
540
|
+
defaultColDef: ColDef;
|
|
541
|
+
rowSelectionOption: IRowSelectionOptions;
|
|
542
|
+
pagination: ITableGridPagination;
|
|
543
|
+
themeClass: string;
|
|
544
|
+
tableTheme: string;
|
|
545
|
+
tablename: string;
|
|
546
|
+
selectionColumnDef?: SelectionColumnDef;
|
|
547
|
+
tablePreference: {
|
|
548
|
+
disableRemovecolumn?: boolean;
|
|
549
|
+
disableResetPreference?: boolean;
|
|
550
|
+
disableUpdatePreference?: boolean;
|
|
551
|
+
};
|
|
552
|
+
detailCellRendererParams?: any;
|
|
553
|
+
detailCellRenderer?: any;
|
|
554
|
+
frameworkComponents?: {
|
|
555
|
+
[key: string]: any;
|
|
556
|
+
};
|
|
557
|
+
tooltipShowDelay: number;
|
|
558
|
+
masterDetail: boolean;
|
|
559
|
+
tableClasses: string[];
|
|
560
|
+
defaultGridOptions?: GridOptions;
|
|
561
|
+
constructor();
|
|
562
|
+
}
|
|
563
|
+
declare class ITableGridPagination {
|
|
564
|
+
private configurationService;
|
|
565
|
+
enabled: boolean;
|
|
566
|
+
paginationPageSize: number;
|
|
567
|
+
paginationPageSizeSelector: boolean | number[];
|
|
568
|
+
}
|
|
569
|
+
interface IRowSelectionOptions {
|
|
570
|
+
enableClickSelection?: boolean | 'enableDeselection' | 'enableSelection';
|
|
571
|
+
mode: string;
|
|
572
|
+
checkboxes: boolean;
|
|
573
|
+
headerCheckbox?: boolean;
|
|
574
|
+
}
|
|
575
|
+
interface IColumnStateEvent {
|
|
576
|
+
currentEvent: ITableGridState;
|
|
577
|
+
currentTableState: ITableGridState[];
|
|
578
|
+
}
|
|
579
|
+
interface ITableGridState {
|
|
580
|
+
key?: string;
|
|
581
|
+
width?: number;
|
|
582
|
+
visible?: boolean;
|
|
583
|
+
sort?: 'asc' | 'desc' | null;
|
|
584
|
+
label?: string;
|
|
585
|
+
}
|
|
586
|
+
interface IFilterChangeEvent {
|
|
587
|
+
rows: any[];
|
|
588
|
+
column: any[];
|
|
589
|
+
filters: any;
|
|
590
|
+
}
|
|
591
|
+
interface IGridReadyEvent extends GridReadyEvent {
|
|
592
|
+
api: IGridApi;
|
|
593
|
+
}
|
|
594
|
+
interface ICellValueChangedEvent extends CellValueChangedEvent {
|
|
595
|
+
data: CellValueChangedEvent['data'];
|
|
596
|
+
colDef: CellValueChangedEvent['colDef'];
|
|
597
|
+
}
|
|
598
|
+
interface IColDef extends ColDef {
|
|
599
|
+
}
|
|
600
|
+
interface IPaginationChangedEvent extends PaginationChangedEvent {
|
|
601
|
+
newPage: PaginationChangedEvent['newPage'];
|
|
602
|
+
animate?: PaginationChangedEvent['animate'];
|
|
603
|
+
keepRenderedRows?: PaginationChangedEvent['keepRenderedRows'];
|
|
604
|
+
newData?: PaginationChangedEvent['newData'];
|
|
605
|
+
newPageSize?: PaginationChangedEvent['newPageSize'];
|
|
606
|
+
api: PaginationChangedEvent['api'];
|
|
607
|
+
}
|
|
608
|
+
interface PongrassICellRendererAngularComp extends ICellRendererAngularComp {
|
|
609
|
+
}
|
|
610
|
+
interface PongrassICellRendererParams extends ICellRendererParams {
|
|
611
|
+
data: ICellRendererParams['data'];
|
|
612
|
+
colDef: ICellRendererParams['colDef'];
|
|
613
|
+
}
|
|
614
|
+
interface IGridApi extends GridApi<any> {
|
|
615
|
+
}
|
|
616
|
+
type IAgPublicEventType = AgPublicEventType;
|
|
617
|
+
type MaintAction = 'N' | 'D' | 'U';
|
|
618
|
+
|
|
619
|
+
declare class TableGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
620
|
+
private readonly formBuilder;
|
|
621
|
+
private readonly utilsService;
|
|
622
|
+
private readonly toastrService;
|
|
623
|
+
private readonly configurationService;
|
|
624
|
+
tableConfiguration: ITableGridConfiguration;
|
|
625
|
+
columnToolVisible: boolean;
|
|
626
|
+
initialPageNumber: number;
|
|
627
|
+
tableGridReady: EventEmitter<GridReadyEvent>;
|
|
628
|
+
tableRowSelection: EventEmitter<any>;
|
|
629
|
+
tableRowClicked: EventEmitter<{
|
|
630
|
+
event: any;
|
|
631
|
+
row: any;
|
|
632
|
+
}>;
|
|
633
|
+
columnStateEvent: EventEmitter<IColumnStateEvent>;
|
|
634
|
+
pageChange: EventEmitter<PaginationChangedEvent>;
|
|
635
|
+
filterChanged: EventEmitter<IFilterChangeEvent>;
|
|
636
|
+
cellValueChanged: EventEmitter<CellValueChangedEvent>;
|
|
637
|
+
private gridAPI;
|
|
638
|
+
columnsListselectionForm: FormGroup;
|
|
639
|
+
tableGridState: ITableGridState[];
|
|
640
|
+
autoSizeTrigger$: Subject<void>;
|
|
641
|
+
subscribeUntil$: Subject<void>;
|
|
642
|
+
autoSizeStrategy: {
|
|
643
|
+
type: string;
|
|
644
|
+
defaultMinWidth: number;
|
|
645
|
+
};
|
|
646
|
+
/**
|
|
647
|
+
* Resize all columns to fit the grid width while maintaining their minimum widths.
|
|
648
|
+
* This method collects the current widths of all columns and applies them as limits
|
|
649
|
+
*/
|
|
650
|
+
sizeToFit(): void;
|
|
651
|
+
/**
|
|
652
|
+
* Automatically resize all columns to fit their content.
|
|
653
|
+
* This method collects the current widths of all columns and applies them as limits
|
|
654
|
+
* to ensure that the columns are resized based on their content.
|
|
655
|
+
*/
|
|
656
|
+
autoSizeAll(skipHeader?: boolean): void;
|
|
657
|
+
gridOptions: GridOptions;
|
|
658
|
+
constructor();
|
|
659
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
660
|
+
ngOnInit(): void;
|
|
661
|
+
/** Send event to parent component when Ag Grid is stabilized*/
|
|
662
|
+
onGridReady(event: GridReadyEvent): void;
|
|
663
|
+
/** Send event to parent component when a row is selected */
|
|
664
|
+
onRowSelected(event: any): void;
|
|
665
|
+
/** Send event to parent component when a row is clicked */
|
|
666
|
+
onRowClicked(event: any): void;
|
|
667
|
+
/** Create column state on initialization of table grid */
|
|
668
|
+
private createColumnState;
|
|
669
|
+
/** Set visibility of columns and send the event and column form to parent component along with last checkbox event data */
|
|
670
|
+
getCheckboxStatus(event: Event, field: string): void;
|
|
671
|
+
/** Create form group for column tools menu */
|
|
672
|
+
private createColumnsListForm;
|
|
673
|
+
private getAppliedFilter;
|
|
674
|
+
/** On resizing columns, update the tableGridState */
|
|
675
|
+
onColumnResized(event: ColumnResizedEvent | any): void;
|
|
676
|
+
/** On moving columns, update the tableGridState */
|
|
677
|
+
onColumnMoved(event: ColumnMovedEvent): void;
|
|
678
|
+
onSortChanged(event: SortChangedEvent): void;
|
|
679
|
+
/** Emit event when pagination is changed */
|
|
680
|
+
onPaginationChanged(event: PaginationChangedEvent): void;
|
|
681
|
+
/** Emit event when first data is rendered */
|
|
682
|
+
onFirstDataRendered(event: FirstDataRenderedEvent): void;
|
|
683
|
+
/** Emit event to update table preference */
|
|
684
|
+
updatetablePreference(): void;
|
|
685
|
+
/** Reset table preference to default state */
|
|
686
|
+
resetTablePreference(): void;
|
|
687
|
+
/** Reset table preference to default state */
|
|
688
|
+
resetTablePreferenceV2(): void;
|
|
689
|
+
/** Handle successful reset of table preference */
|
|
690
|
+
private handleSuccessfulReset;
|
|
691
|
+
/** Update grid state based on the current tableGridState */
|
|
692
|
+
private updateGridState;
|
|
693
|
+
onFilterChanged(params: any): void;
|
|
694
|
+
/** Emit event when a cell value is changed */
|
|
695
|
+
onCellValueChanged(event: CellValueChangedEvent): void;
|
|
696
|
+
ngOnDestroy(): void;
|
|
697
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableGridComponent, never>;
|
|
698
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableGridComponent, "app-table-grid", never, { "tableConfiguration": { "alias": "tableConfiguration"; "required": false; }; "columnToolVisible": { "alias": "columnToolVisible"; "required": false; }; "initialPageNumber": { "alias": "initialPageNumber"; "required": false; }; }, { "tableGridReady": "tableGridReady"; "tableRowSelection": "tableRowSelection"; "tableRowClicked": "tableRowClicked"; "columnStateEvent": "columnStateEvent"; "pageChange": "pageChange"; "filterChanged": "filterChanged"; "cellValueChanged": "cellValueChanged"; }, never, never, false, never>;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
declare class TableGridModule {
|
|
702
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableGridModule, never>;
|
|
703
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableGridModule, [typeof TableGridComponent], [typeof i3.CommonModule, typeof i3$1.AgGridModule, typeof i5.FormModule, typeof i4.ReactiveFormsModule, typeof i5.ButtonModule, typeof i5.OffcanvasModule, typeof i5.TooltipModule, typeof i6.IconModule], [typeof TableGridComponent]>;
|
|
704
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<TableGridModule>;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export { CheckboxCellRendererComponent, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, EditionListGroupedComponent, FormFieldType, GenericFilterModelComponent, ITableGridConfiguration, ITableGridPagination, IndustryUpdateListboxCellRendererComponent, MultiFormComponent, MultiFormModule, PageStatusCellRendererComponent, StatusSelectCellRendererComponent, TableGridComponent, TableGridModule };
|
|
708
|
+
export type { IAgPublicEventType, ICellValueChangedEvent, IColDef, IColumnStateEvent, IEmmitedResponse, IFieldConfig, IFilterChangeEvent, IFormConfig, IFormStyles, IFormSubmissionEmit, IFormValidations, IGridApi, IGridReadyEvent, IPaginationChangedEvent, IRowSelectionOptions, ITableGridState, MaintAction, PongrassICellRendererAngularComp, PongrassICellRendererParams };
|
package/package.json
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pongrass/utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-v20",
|
|
4
4
|
"description": "A collection of utility components and services for Angular applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
7
7
|
"utils",
|
|
8
8
|
"components",
|
|
9
9
|
"ag-grid",
|
|
10
|
-
"ui"
|
|
10
|
+
"ui",
|
|
11
|
+
"pongrass",
|
|
12
|
+
"pongrass utils"
|
|
11
13
|
],
|
|
12
14
|
"author": "Pongrass Publishing Systems",
|
|
13
15
|
"license": "MIT",
|
|
14
16
|
"peerDependencies": {
|
|
15
|
-
"@angular/common": "^20.3.
|
|
16
|
-
"@angular/core": "^20.3.
|
|
17
|
+
"@angular/common": "^20.3.1",
|
|
18
|
+
"@angular/core": "^20.3.1",
|
|
19
|
+
"@angular/forms": "^20.3.1",
|
|
20
|
+
"@angular/platform-browser": "^20.3.1",
|
|
21
|
+
"@angular/platform-browser-dynamic": "^20.3.1",
|
|
22
|
+
"@angular/router": "^20.3.1",
|
|
17
23
|
"@ag-grid-community/angular": "^32.3.9",
|
|
18
24
|
"@ag-grid-community/client-side-row-model": "^32.3.9",
|
|
19
25
|
"@ag-grid-community/core": "^32.3.9",
|