@pongrass/utils 0.0.3-v20 → 1.0.2-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 +230 -122
- package/fesm2022/pongrass-utils.mjs +447 -164
- package/fesm2022/pongrass-utils.mjs.map +1 -1
- package/index.d.ts +156 -91
- package/package.json +2 -1
package/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ declare class ConfigurationServiceLib {
|
|
|
58
58
|
currentTablePreference: WritableSignal<any>;
|
|
59
59
|
allConfigValues: WritableSignal<IConfig | null>;
|
|
60
60
|
openFilterModal: WritableSignal<boolean>;
|
|
61
|
+
utilsAppliedTheme: WritableSignal<string>;
|
|
61
62
|
constructor();
|
|
62
63
|
generateUniqueId(): string;
|
|
63
64
|
setTablePreference(tableName: string, preference: any): void;
|
|
@@ -193,7 +194,7 @@ declare class CommentsButtonCellRendererComponent implements ICellRendererAngula
|
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
declare class EditionListGroupedComponent implements OnInit, OnDestroy {
|
|
196
|
-
private readonly
|
|
197
|
+
private readonly jsonrpcService;
|
|
197
198
|
private isActive;
|
|
198
199
|
editionPublicationList: {
|
|
199
200
|
region: string;
|
|
@@ -408,7 +409,90 @@ declare class MultiFormComponent implements OnInit, OnChanges {
|
|
|
408
409
|
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>;
|
|
409
410
|
}
|
|
410
411
|
|
|
411
|
-
declare class
|
|
412
|
+
declare class ITableGridConfiguration {
|
|
413
|
+
initialState: ITableGridState[];
|
|
414
|
+
columnDefs: ColDef[];
|
|
415
|
+
rows: any;
|
|
416
|
+
defaultColDef: ColDef;
|
|
417
|
+
rowSelectionOption: IRowSelectionOptions;
|
|
418
|
+
pagination: ITableGridPagination;
|
|
419
|
+
themeClass: string;
|
|
420
|
+
tableTheme: string;
|
|
421
|
+
tablename: string;
|
|
422
|
+
selectionColumnDef?: SelectionColumnDef;
|
|
423
|
+
tablePreference: {
|
|
424
|
+
disableRemovecolumn?: boolean;
|
|
425
|
+
disableResetPreference?: boolean;
|
|
426
|
+
disableUpdatePreference?: boolean;
|
|
427
|
+
};
|
|
428
|
+
detailCellRendererParams?: any;
|
|
429
|
+
detailCellRenderer?: any;
|
|
430
|
+
frameworkComponents?: {
|
|
431
|
+
[key: string]: any;
|
|
432
|
+
};
|
|
433
|
+
tooltipShowDelay: number;
|
|
434
|
+
masterDetail: boolean;
|
|
435
|
+
tableClasses: string[];
|
|
436
|
+
defaultGridOptions?: GridOptions;
|
|
437
|
+
constructor();
|
|
438
|
+
}
|
|
439
|
+
declare class ITableGridPagination {
|
|
440
|
+
private configurationService;
|
|
441
|
+
enabled: boolean;
|
|
442
|
+
paginationPageSize: number;
|
|
443
|
+
paginationPageSizeSelector: boolean | number[];
|
|
444
|
+
}
|
|
445
|
+
interface IRowSelectionOptions {
|
|
446
|
+
enableClickSelection?: boolean | 'enableDeselection' | 'enableSelection';
|
|
447
|
+
mode: string;
|
|
448
|
+
checkboxes: boolean;
|
|
449
|
+
headerCheckbox?: boolean;
|
|
450
|
+
}
|
|
451
|
+
interface IColumnStateEvent {
|
|
452
|
+
currentEvent: ITableGridState;
|
|
453
|
+
currentTableState: ITableGridState[];
|
|
454
|
+
}
|
|
455
|
+
interface ITableGridState {
|
|
456
|
+
key?: string;
|
|
457
|
+
width?: number;
|
|
458
|
+
visible?: boolean;
|
|
459
|
+
sort?: 'asc' | 'desc' | null;
|
|
460
|
+
label?: string;
|
|
461
|
+
}
|
|
462
|
+
interface IFilterChangeEvent {
|
|
463
|
+
rows: any[];
|
|
464
|
+
column: any[];
|
|
465
|
+
filters: any;
|
|
466
|
+
}
|
|
467
|
+
interface IGridReadyEvent extends GridReadyEvent {
|
|
468
|
+
api: IGridApi;
|
|
469
|
+
}
|
|
470
|
+
interface ICellValueChangedEvent extends CellValueChangedEvent {
|
|
471
|
+
data: CellValueChangedEvent['data'];
|
|
472
|
+
colDef: CellValueChangedEvent['colDef'];
|
|
473
|
+
}
|
|
474
|
+
interface IColDef extends ColDef {
|
|
475
|
+
}
|
|
476
|
+
interface IPaginationChangedEvent extends PaginationChangedEvent {
|
|
477
|
+
newPage: PaginationChangedEvent['newPage'];
|
|
478
|
+
animate?: PaginationChangedEvent['animate'];
|
|
479
|
+
keepRenderedRows?: PaginationChangedEvent['keepRenderedRows'];
|
|
480
|
+
newData?: PaginationChangedEvent['newData'];
|
|
481
|
+
newPageSize?: PaginationChangedEvent['newPageSize'];
|
|
482
|
+
api: PaginationChangedEvent['api'];
|
|
483
|
+
}
|
|
484
|
+
interface PongrassICellRendererAngularComp extends ICellRendererAngularComp {
|
|
485
|
+
}
|
|
486
|
+
interface PongrassICellRendererParams extends ICellRendererParams {
|
|
487
|
+
data: ICellRendererParams['data'];
|
|
488
|
+
colDef: ICellRendererParams['colDef'];
|
|
489
|
+
}
|
|
490
|
+
interface IGridApi extends GridApi<any> {
|
|
491
|
+
}
|
|
492
|
+
type IAgPublicEventType = AgPublicEventType;
|
|
493
|
+
type MaintAction = 'N' | 'D' | 'U';
|
|
494
|
+
|
|
495
|
+
declare class JsonrpcServiceLib {
|
|
412
496
|
private readonly httpService;
|
|
413
497
|
private readonly configService;
|
|
414
498
|
postJsonRpcRequest(method: string, params: any): Observable<any>;
|
|
@@ -444,13 +528,13 @@ declare class JsonrpcService {
|
|
|
444
528
|
* @returns Array of data
|
|
445
529
|
*/
|
|
446
530
|
getTableList(tableName: string, param: any): Promise<any>;
|
|
447
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
448
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
531
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<JsonrpcServiceLib, never>;
|
|
532
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<JsonrpcServiceLib>;
|
|
449
533
|
}
|
|
450
534
|
|
|
451
535
|
declare class GenericFilterModelComponent implements OnInit {
|
|
452
536
|
readonly configurationService: ConfigurationServiceLib;
|
|
453
|
-
readonly jsonrpcService:
|
|
537
|
+
readonly jsonrpcService: JsonrpcServiceLib;
|
|
454
538
|
filterFormConfiguration: IFormConfig | any;
|
|
455
539
|
tableName: string;
|
|
456
540
|
sendFilteredData: EventEmitter<IEmmitedResponse>;
|
|
@@ -533,92 +617,9 @@ declare class MultiFormModule {
|
|
|
533
617
|
static ɵinj: i0.ɵɵInjectorDeclaration<MultiFormModule>;
|
|
534
618
|
}
|
|
535
619
|
|
|
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
620
|
declare class TableGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
620
621
|
private readonly formBuilder;
|
|
621
|
-
private readonly
|
|
622
|
+
private readonly jsonrpcService;
|
|
622
623
|
private readonly toastrService;
|
|
623
624
|
private readonly configurationService;
|
|
624
625
|
tableConfiguration: ITableGridConfiguration;
|
|
@@ -704,5 +705,69 @@ declare class TableGridModule {
|
|
|
704
705
|
static ɵinj: i0.ɵɵInjectorDeclaration<TableGridModule>;
|
|
705
706
|
}
|
|
706
707
|
|
|
707
|
-
|
|
708
|
-
|
|
708
|
+
interface IExcelHeaders {
|
|
709
|
+
heading: string;
|
|
710
|
+
alignment?: 'center' | 'left' | 'right';
|
|
711
|
+
bold?: boolean;
|
|
712
|
+
fontSize?: number;
|
|
713
|
+
}
|
|
714
|
+
interface IPrintHeaders {
|
|
715
|
+
heading: string;
|
|
716
|
+
alignment?: 'center' | 'left' | 'right';
|
|
717
|
+
bold?: boolean;
|
|
718
|
+
fontSize?: number;
|
|
719
|
+
marginBottom?: number;
|
|
720
|
+
marginTop?: number;
|
|
721
|
+
}
|
|
722
|
+
interface IExportCellConfig {
|
|
723
|
+
align: string;
|
|
724
|
+
headers: string[];
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
declare class UtilsService {
|
|
728
|
+
private readonly configurationServiceLib;
|
|
729
|
+
private readonly toastrService;
|
|
730
|
+
readonly allConfigValues: IConfig;
|
|
731
|
+
constructor();
|
|
732
|
+
formatToTwoDecimalPlaces(value: any, decimalPlaces?: number): string;
|
|
733
|
+
truncateFloat(value: number | string, precision: number): string;
|
|
734
|
+
/**
|
|
735
|
+
*
|
|
736
|
+
* @param excelData Table data to export
|
|
737
|
+
* @param columns Array of Column keys and label '{ keys: '_key', label: '_label' }'
|
|
738
|
+
* @param excelFileName Name of the excel file 'Example FileName_export_1740978888354'
|
|
739
|
+
* @param headers (Optional) Adds Extra headings on top of the columns
|
|
740
|
+
* @param showTotalValueCols (Optional) Calculates and shows the total of all the values of that column
|
|
741
|
+
* @param columnAlignment (Optional) Aligns the cell value (currently only to right side)
|
|
742
|
+
*/
|
|
743
|
+
exportAsExcelFile(excelData: any[], columns: any[], excelFileName: string, headers?: IExcelHeaders[], showTotalValueCols?: string[], columnAlignment?: IExportCellConfig): Promise<void>;
|
|
744
|
+
/** Prepare Data for Excel Export*/
|
|
745
|
+
private prepareWorksheetData;
|
|
746
|
+
/** Save Buffer File */
|
|
747
|
+
private saveAsExcelFile;
|
|
748
|
+
/** Print Page Status Report */
|
|
749
|
+
printHTMLTable(columns: any[], data: any[], headers?: IExcelHeaders[], showTotalValueCols?: string[]): void;
|
|
750
|
+
private generateHeaderHTML;
|
|
751
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UtilsService, never>;
|
|
752
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UtilsService>;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
declare enum ExportToExcelNames {
|
|
756
|
+
ProdStatusReport = "Prod_Status_Report",
|
|
757
|
+
NationalROPReport = "National ROP Report",
|
|
758
|
+
NationalInserts = "National Inserts",
|
|
759
|
+
ApprovedAdList = "Approved Ad List",
|
|
760
|
+
PageStatusReport = "Page Status Report"
|
|
761
|
+
}
|
|
762
|
+
declare enum ExcelType {
|
|
763
|
+
excelBlobType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
764
|
+
xlsxBookType = "xlsx"
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
declare function convertToISOnString(date: Date): string;
|
|
768
|
+
declare function regionalDateFormat(date: Date): string;
|
|
769
|
+
declare function convertIsoToFormat(date: string | Date, dateFormat?: string): string;
|
|
770
|
+
declare function convertDateShort(dateString: string): string;
|
|
771
|
+
|
|
772
|
+
export { CheckboxCellRendererComponent, CircularFocusDirective, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, DecimalInputDirective, EditionListGroupedComponent, ExcelType, ExportToExcelNames, FormFieldType, GenericFilterModelComponent, ITableGridConfiguration, ITableGridPagination, IndustryUpdateListboxCellRendererComponent, MultiFormComponent, MultiFormModule, MultiSelectStylerDirective, PageStatusCellRendererComponent, ShowTooltipIfTruncatedDirective, StatusSelectCellRendererComponent, TableGridComponent, TableGridModule, UtilsService, convertDateShort, convertIsoToFormat, convertToISOnString, regionalDateFormat };
|
|
773
|
+
export type { IAgPublicEventType, ICellValueChangedEvent, IColDef, IColumnStateEvent, IEmmitedResponse, IExcelHeaders, IExportCellConfig, IFieldConfig, IFilterChangeEvent, IFormConfig, IFormStyles, IFormSubmissionEmit, IFormValidations, IGridApi, IGridReadyEvent, IPaginationChangedEvent, IPrintHeaders, IRowSelectionOptions, ITableGridState, MaintAction, PongrassICellRendererAngularComp, PongrassICellRendererParams };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pongrass/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.2-v20",
|
|
4
4
|
"description": "A collection of utility components and services for Angular applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@ag-grid-community/csv-export": "^32.3.9",
|
|
27
27
|
"@ag-grid-community/infinite-row-model": "^32.3.9",
|
|
28
28
|
"@ag-grid-community/styles": "^32.3.9",
|
|
29
|
+
"exceljs": "^4.4.0",
|
|
29
30
|
"ngx-bootstrap": "^20.0.2"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|