@pongrass/utils 1.0.1-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/index.d.ts CHANGED
@@ -705,5 +705,69 @@ declare class TableGridModule {
705
705
  static ɵinj: i0.ɵɵInjectorDeclaration<TableGridModule>;
706
706
  }
707
707
 
708
- export { CheckboxCellRendererComponent, CircularFocusDirective, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, DecimalInputDirective, EditionListGroupedComponent, FormFieldType, GenericFilterModelComponent, ITableGridConfiguration, ITableGridPagination, IndustryUpdateListboxCellRendererComponent, MultiFormComponent, MultiFormModule, MultiSelectStylerDirective, PageStatusCellRendererComponent, ShowTooltipIfTruncatedDirective, StatusSelectCellRendererComponent, TableGridComponent, TableGridModule };
709
- export type { IAgPublicEventType, ICellValueChangedEvent, IColDef, IColumnStateEvent, IEmmitedResponse, IFieldConfig, IFilterChangeEvent, IFormConfig, IFormStyles, IFormSubmissionEmit, IFormValidations, IGridApi, IGridReadyEvent, IPaginationChangedEvent, IRowSelectionOptions, ITableGridState, MaintAction, PongrassICellRendererAngularComp, PongrassICellRendererParams };
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": "1.0.1-v20",
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": {