@pongrass/utils 1.1.5-v20 → 1.1.7-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
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { WritableSignal, ElementRef, OnInit, OnDestroy, EventEmitter, OnChanges, SimpleChanges, AfterViewInit } from '@angular/core';
2
+ import { WritableSignal, ElementRef, AfterViewInit, ChangeDetectorRef, OnInit, OnDestroy, EventEmitter, OnChanges, SimpleChanges, Type, ViewContainerRef, Injector, ComponentRef } from '@angular/core';
3
3
  import * as i3 from '@ag-grid-community/angular';
4
4
  import { ICellRendererAngularComp, IFilterAngularComp } from '@ag-grid-community/angular';
5
5
  import { ICellRendererParams, IFilterParams, IDoesFilterPassParams, ColDef, SelectionColumnDef, GridOptions, GridReadyEvent, GridApi, CellValueChangedEvent, PaginationChangedEvent, AgPublicEventType, ColumnResizedEvent, ColumnMovedEvent, SortChangedEvent, FirstDataRenderedEvent } from '@ag-grid-community/core';
@@ -157,6 +157,7 @@ declare class CustomSelectFilterComponent implements IFilterAngularComp {
157
157
  searchInputRef: ElementRef<HTMLInputElement>;
158
158
  afterGuiAttached(): void;
159
159
  getUniqueValues(): string[];
160
+ getFormattedValue(node: any, value: any): string;
160
161
  isValueSelected(value: string): boolean;
161
162
  isAllSelected(): boolean;
162
163
  onSelectAllChanged(event: Event): void;
@@ -171,10 +172,50 @@ declare class CustomSelectFilterComponent implements IFilterAngularComp {
171
172
  setModel(model: {
172
173
  values?: string[];
173
174
  }): void;
175
+ onReset(): void;
174
176
  static ɵfac: i0.ɵɵFactoryDeclaration<CustomSelectFilterComponent, never>;
175
177
  static ɵcmp: i0.ɵɵComponentDeclaration<CustomSelectFilterComponent, "prg-ws-custom-set-filter", never, {}, {}, never, never, true, never>;
176
178
  }
177
179
 
180
+ declare class AgDateRangeFilterComponent implements IFilterAngularComp, AfterViewInit {
181
+ private cdr;
182
+ params: IFilterParams;
183
+ startDate: Date | null;
184
+ endDate: Date | null;
185
+ viewDate: Date;
186
+ private selectedPresetLabel;
187
+ presets: {
188
+ label: string;
189
+ isSelected: boolean;
190
+ calculate: () => {
191
+ start: Date;
192
+ end: Date;
193
+ };
194
+ }[];
195
+ constructor(cdr: ChangeDetectorRef);
196
+ agInit(params: IFilterParams): void;
197
+ ngAfterViewInit(): void;
198
+ onStartDateChange(date: Date | null): void;
199
+ onEndDateChange(date: Date | null): void;
200
+ private clearPresetSelection;
201
+ private calculatePastDays;
202
+ private normalizeDate;
203
+ private areDatesEqual;
204
+ private matchAndSelectPreset;
205
+ onPresetClick(preset: any): void;
206
+ isFilterActive(): boolean;
207
+ doesFilterPass(params: IDoesFilterPassParams): boolean;
208
+ getModel(): {
209
+ startDate: Date | null;
210
+ endDate: Date | null;
211
+ selectedPreset: string | null;
212
+ };
213
+ setModel(model: any): void;
214
+ onReset(): void;
215
+ static ɵfac: i0.ɵɵFactoryDeclaration<AgDateRangeFilterComponent, never>;
216
+ static ɵcmp: i0.ɵɵComponentDeclaration<AgDateRangeFilterComponent, "prg-ws-ag-date-range-filter", never, {}, {}, never, never, true, never>;
217
+ }
218
+
178
219
  declare class CheckboxCellRendererComponent implements ICellRendererAngularComp {
179
220
  value: boolean;
180
221
  private params;
@@ -254,6 +295,47 @@ declare class StatusSelectCellRendererComponent implements ICellRendererAngularC
254
295
  static ɵcmp: i0.ɵɵComponentDeclaration<StatusSelectCellRendererComponent, "prg-ws-status-select-cell-renderer", never, {}, {}, never, never, true, never>;
255
296
  }
256
297
 
298
+ declare class BadgeCellRendererComponent implements ICellRendererAngularComp {
299
+ displayValue: string;
300
+ badgeColor: string;
301
+ textColor: string;
302
+ customStyles: {
303
+ [key: string]: string;
304
+ };
305
+ agInit(params: ICellRendererParams): void;
306
+ refresh(params: ICellRendererParams): boolean;
307
+ private updateValue;
308
+ private applyColor;
309
+ static ɵfac: i0.ɵɵFactoryDeclaration<BadgeCellRendererComponent, never>;
310
+ static ɵcmp: i0.ɵɵComponentDeclaration<BadgeCellRendererComponent, "prg-ws-badge-cell-renderer", never, {}, {}, never, never, true, never>;
311
+ }
312
+
313
+ declare class IconTextCellRendererComponent implements ICellRendererAngularComp {
314
+ displayValue: string;
315
+ iconName: string;
316
+ iconPosition: 'start' | 'end';
317
+ isRed: boolean;
318
+ agInit(params: ICellRendererParams): void;
319
+ refresh(params: ICellRendererParams): boolean;
320
+ private updateValue;
321
+ static ɵfac: i0.ɵɵFactoryDeclaration<IconTextCellRendererComponent, never>;
322
+ static ɵcmp: i0.ɵɵComponentDeclaration<IconTextCellRendererComponent, "prg-ws-icon-text-cell-renderer", never, {}, {}, never, never, true, never>;
323
+ }
324
+
325
+ declare class HyperlinkCellRendererComponent implements ICellRendererAngularComp {
326
+ displayValue: string;
327
+ href: string;
328
+ target: string;
329
+ isLink: boolean;
330
+ agInit(params: ICellRendererParams): void;
331
+ refresh(params: ICellRendererParams): boolean;
332
+ private updateValue;
333
+ private setAsEmail;
334
+ private setAsLink;
335
+ static ɵfac: i0.ɵɵFactoryDeclaration<HyperlinkCellRendererComponent, never>;
336
+ static ɵcmp: i0.ɵɵComponentDeclaration<HyperlinkCellRendererComponent, "prg-ws-hyperlink-cell-renderer", never, {}, {}, never, never, true, never>;
337
+ }
338
+
257
339
  interface IEmmitedResponse {
258
340
  isReset: boolean;
259
341
  returnedData: any[];
@@ -264,9 +346,9 @@ declare enum FormFieldType {
264
346
  Email = "email",
265
347
  Number = "number",
266
348
  Select = "select",
267
- Autosuggest = "autosuggest",
268
349
  Textarea = "textarea",
269
350
  Date = "date",
351
+ NewDate = "new-date",
270
352
  Datetime = "datetime",
271
353
  Switch = "switch",
272
354
  Checkbox = "checkbox",
@@ -276,7 +358,8 @@ declare enum FormFieldType {
276
358
  FormHeader = "form-header",
277
359
  Password = "password",
278
360
  Url = "url",
279
- Tel = "tel"
361
+ Tel = "tel",
362
+ Timepicker = "time"
280
363
  }
281
364
  interface IFieldConfig {
282
365
  /** Form label */
@@ -297,6 +380,8 @@ interface IFieldConfig {
297
380
  allowSearch?: boolean;
298
381
  /** for selects or multi-selects allows clear option */
299
382
  allowCleaner?: boolean;
383
+ /** for selects or multi-selects search option */
384
+ search?: string;
300
385
  /** grid column span */
301
386
  colspan?: number;
302
387
  /** Placeholder */
@@ -386,6 +471,7 @@ declare class MultiFormComponent implements OnInit, OnChanges {
386
471
  color_code: string;
387
472
  }[];
388
473
  FormFieldType: typeof FormFieldType;
474
+ today: Date;
389
475
  constructor();
390
476
  ngOnInit(): void;
391
477
  ngOnChanges(changes: SimpleChanges): void;
@@ -647,7 +733,7 @@ declare class MultiSelectStylerDirective implements OnInit, OnDestroy {
647
733
 
648
734
  declare class MultiFormModule {
649
735
  static ɵfac: i0.ɵɵFactoryDeclaration<MultiFormModule, never>;
650
- static ɵmod: i0.ɵɵNgModuleDeclaration<MultiFormModule, [typeof MultiFormComponent, typeof DateTimePickerComponent], [typeof CircularFocusDirective, typeof i2.CommonModule, typeof i5.ReactiveFormsModule, typeof i6.MultiSelectModule, typeof i6.FormModule, typeof i6$1.IconModule, typeof i6.InputGroupComponent, typeof i6.DatePickerModule, typeof DecimalInputDirective, typeof ShowTooltipIfTruncatedDirective, typeof i6.ModalModule, typeof i6.TooltipModule, typeof i6.ButtonModule, typeof i10.BsDatepickerModule, typeof i6.AutocompleteModule, typeof i6.FormCheckInputDirective, typeof EditionListGroupedComponent, typeof MultiSelectStylerDirective], [typeof MultiFormComponent, typeof DateTimePickerComponent]>;
736
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MultiFormModule, [typeof MultiFormComponent, typeof DateTimePickerComponent], [typeof CircularFocusDirective, typeof i2.CommonModule, typeof i5.ReactiveFormsModule, typeof i6.MultiSelectModule, typeof i6.FormModule, typeof i6$1.IconModule, typeof i6.InputGroupComponent, typeof i6.DatePickerModule, typeof DecimalInputDirective, typeof ShowTooltipIfTruncatedDirective, typeof i6.ModalModule, typeof i6.TooltipModule, typeof i6.ButtonModule, typeof i10.BsDatepickerModule, typeof i6.AutocompleteModule, typeof i6.FormCheckInputDirective, typeof EditionListGroupedComponent, typeof MultiSelectStylerDirective, typeof i6.TimePickerModule], [typeof MultiFormComponent, typeof DateTimePickerComponent]>;
651
737
  static ɵinj: i0.ɵɵInjectorDeclaration<MultiFormModule>;
652
738
  }
653
739
 
@@ -827,6 +913,7 @@ type TimeOption = {
827
913
  label: string;
828
914
  };
829
915
  declare function generateTimeOptions(): TimeOption[];
916
+ declare function getTimeValueFromDateTime(isoString: string): string;
830
917
 
831
918
  interface ILoginConfig {
832
919
  /** Heading of Application (e.g., Maintainance Portal) */
@@ -886,5 +973,93 @@ declare class LoginModule {
886
973
  static ɵinj: i0.ɵɵInjectorDeclaration<LoginModule>;
887
974
  }
888
975
 
889
- export { BackgroundImageDirective, CheckboxCellRendererComponent, CircularFocusDirective, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, DateTimePickerComponent, DecimalInputDirective, EditionListGroupedComponent, ExcelType, ExportToExcelNames, FormFieldType, GenericFilterModelComponent, ILOGIN_ACTION, ITableGridConfiguration, ITableGridPagination, IndustryUpdateListboxCellRendererComponent, JsonrpcServiceLib, LoginComponent, LoginModule, MultiFormComponent, MultiFormModule, MultiSelectStylerDirective, PageStatusCellRendererComponent, ShowTooltipIfTruncatedDirective, StatusSelectCellRendererComponent, TableGridComponent, TableGridModule, UtilsService, convertDateShort, convertIsoToFormat, convertToISOnString, generateTimeOptions, regionalDateFormat };
890
- export type { IAgPublicEventType, ICellValueChangedEvent, IColDef, IColumnStateEvent, IEmmitedResponse, IExcelHeaders, IExportCellConfig, IFieldConfig, IFilterChangeEvent, IFormConfig, IFormStyles, IFormSubmissionEmit, IFormValidations, IGridApi, IGridReadyEvent, ILoginConfig, IPaginationChangedEvent, IPrintHeaders, IRowSelectionOptions, ITableGridState, MaintAction, PongrassICellRendererAngularComp, PongrassICellRendererParams, TimeOption };
976
+ interface IDialogButton {
977
+ label: string;
978
+ type?: 'submit' | 'close' | 'custom';
979
+ color?: string;
980
+ variant?: string;
981
+ class?: string;
982
+ onClick?: (context?: any) => void;
983
+ }
984
+ interface IDialogConfig {
985
+ title?: string;
986
+ message?: string;
987
+ size?: 'sm' | 'md' | 'lg' | 'xl';
988
+ data?: any;
989
+ buttons?: IDialogButton[];
990
+ scrollable?: boolean;
991
+ customClose?: boolean;
992
+ alignment?: 'center' | 'top';
993
+ component?: Type<any>;
994
+ }
995
+ declare class DialogRef<T = any> {
996
+ closeFn?: ((result?: T) => void) | undefined;
997
+ private _result;
998
+ /** Observable that emits when any button is clicked in the wrapper */
999
+ buttonClick$: Subject<IDialogButton>;
1000
+ /** Observable that emits when the dialog is closed */
1001
+ afterClosed(): Observable<T>;
1002
+ constructor(closeFn?: ((result?: T) => void) | undefined);
1003
+ setCloseFn(fn: (result?: T) => void): void;
1004
+ close(result?: T): void;
1005
+ }
1006
+
1007
+ declare class PgDialogService {
1008
+ private appRef;
1009
+ private injector;
1010
+ private viewContainerRef;
1011
+ private openDialogs;
1012
+ registerViewContainerRef(vcr: ViewContainerRef): void;
1013
+ add<T>(config: IDialogConfig): Observable<any>;
1014
+ alert(message: string, title?: string): Observable<void>;
1015
+ confirm(message: string, title?: string): Observable<boolean>;
1016
+ open<T>(component: Type<T>, config?: IDialogConfig): DialogRef<any>;
1017
+ private openManual;
1018
+ private configureWrapper;
1019
+ private removeDialog;
1020
+ closeAll(): void;
1021
+ static ɵfac: i0.ɵɵFactoryDeclaration<PgDialogService, never>;
1022
+ static ɵprov: i0.ɵɵInjectableDeclaration<PgDialogService>;
1023
+ }
1024
+
1025
+ declare class DynamicModalWrapperComponent implements AfterViewInit, OnDestroy {
1026
+ title: string;
1027
+ message: string;
1028
+ size: 'sm' | 'md' | 'lg' | 'xl' | undefined;
1029
+ buttons: IDialogButton[];
1030
+ scrollable: boolean;
1031
+ alignment: 'center' | 'top';
1032
+ childInjector?: Injector;
1033
+ backdropIndex: number;
1034
+ customClose: boolean;
1035
+ private _result;
1036
+ private _childComponentType;
1037
+ set childComponentType(value: Type<any>);
1038
+ private _childComponentData;
1039
+ set childComponentData(value: any);
1040
+ contentHost: ViewContainerRef;
1041
+ modalElement: ElementRef;
1042
+ visibleSignal: i0.WritableSignal<boolean>;
1043
+ componentRef: ComponentRef<any>;
1044
+ closeCallback: (result?: any) => void;
1045
+ private readonly cdr;
1046
+ private readonly zone;
1047
+ private readonly dialogRef;
1048
+ private isDestroyed;
1049
+ private isViewInit;
1050
+ constructor();
1051
+ ngAfterViewInit(): void;
1052
+ ngOnDestroy(): void;
1053
+ loadComponent(): void;
1054
+ private applyData;
1055
+ onButtonClick(btn: IDialogButton): void;
1056
+ topClose(): void;
1057
+ close(result?: any): void;
1058
+ onVisibleChange(event: boolean): void;
1059
+ private addBackdropClass;
1060
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicModalWrapperComponent, never>;
1061
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicModalWrapperComponent, "prg-ws-dynamic-modal-wrapper", never, { "title": { "alias": "title"; "required": false; }; "message": { "alias": "message"; "required": false; }; "size": { "alias": "size"; "required": false; }; "buttons": { "alias": "buttons"; "required": false; }; "scrollable": { "alias": "scrollable"; "required": false; }; "alignment": { "alias": "alignment"; "required": false; }; "childInjector": { "alias": "childInjector"; "required": false; }; "backdropIndex": { "alias": "backdropIndex"; "required": false; }; "customClose": { "alias": "customClose"; "required": false; }; "childComponentType": { "alias": "childComponentType"; "required": false; }; "childComponentData": { "alias": "childComponentData"; "required": false; }; }, {}, never, never, true, never>;
1062
+ }
1063
+
1064
+ export { AgDateRangeFilterComponent, BackgroundImageDirective, BadgeCellRendererComponent, CheckboxCellRendererComponent, CircularFocusDirective, ColorCellRendererComponent, CommentsButtonCellRendererComponent, ConfigurationServiceLib, CustomSelectFilterComponent, DateTimePickerComponent, DecimalInputDirective, DialogRef, DynamicModalWrapperComponent, EditionListGroupedComponent, ExcelType, ExportToExcelNames, FormFieldType, GenericFilterModelComponent, HyperlinkCellRendererComponent, ILOGIN_ACTION, ITableGridConfiguration, ITableGridPagination, IconTextCellRendererComponent, IndustryUpdateListboxCellRendererComponent, JsonrpcServiceLib, LoginComponent, LoginModule, MultiFormComponent, MultiFormModule, MultiSelectStylerDirective, PageStatusCellRendererComponent, PgDialogService, ShowTooltipIfTruncatedDirective, StatusSelectCellRendererComponent, TableGridComponent, TableGridModule, UtilsService, convertDateShort, convertIsoToFormat, convertToISOnString, generateTimeOptions, getTimeValueFromDateTime, regionalDateFormat };
1065
+ export type { IAgPublicEventType, ICellValueChangedEvent, IColDef, IColumnStateEvent, IDialogButton, IDialogConfig, IEmmitedResponse, IExcelHeaders, IExportCellConfig, IFieldConfig, IFilterChangeEvent, IFormConfig, IFormStyles, IFormSubmissionEmit, IFormValidations, IGridApi, IGridReadyEvent, ILoginConfig, IPaginationChangedEvent, IPrintHeaders, IRowSelectionOptions, ITableGridState, MaintAction, PongrassICellRendererAngularComp, PongrassICellRendererParams, TimeOption };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pongrass/utils",
3
- "version": "1.1.5-v20",
3
+ "version": "1.1.7-v20",
4
4
  "description": "A collection of utility components and services for Angular applications",
5
5
  "keywords": [
6
6
  "angular",