@codex-ts/core-lib 1.0.0

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.
Files changed (76) hide show
  1. package/dist/core-lib/fesm2022/core-lib.mjs +2349 -0
  2. package/dist/core-lib/fesm2022/core-lib.mjs.map +1 -0
  3. package/dist/core-lib/index.d.ts +29 -0
  4. package/dist/core-lib/lib/components/base-form.component.d.ts +62 -0
  5. package/dist/core-lib/lib/components/base-list-page.component.d.ts +132 -0
  6. package/dist/core-lib/lib/components/base-page.component.d.ts +25 -0
  7. package/dist/core-lib/lib/components/base-tabbed-form.component.d.ts +54 -0
  8. package/dist/core-lib/lib/components/formly/core-formly.module.d.ts +7 -0
  9. package/dist/core-lib/lib/components/formly/form-field.wrapper.d.ts +21 -0
  10. package/dist/core-lib/lib/components/formly/formly.constants.d.ts +13 -0
  11. package/dist/core-lib/lib/components/formly/types/checkbox.type.d.ts +12 -0
  12. package/dist/core-lib/lib/components/formly/types/date.type.d.ts +20 -0
  13. package/dist/core-lib/lib/components/formly/types/multiselect.type.d.ts +26 -0
  14. package/dist/core-lib/lib/components/formly/types/numeric-input.type.d.ts +17 -0
  15. package/dist/core-lib/lib/components/formly/types/radio.type.d.ts +13 -0
  16. package/dist/core-lib/lib/components/formly/types/select.type.d.ts +25 -0
  17. package/dist/core-lib/lib/components/formly/types/text-input.type.d.ts +12 -0
  18. package/dist/core-lib/lib/components/formly/types/textarea.type.d.ts +14 -0
  19. package/dist/core-lib/lib/constants/app.constants.d.ts +13 -0
  20. package/dist/core-lib/lib/constants/app.messages.d.ts +36 -0
  21. package/dist/core-lib/lib/enums/component-context.enum.d.ts +6 -0
  22. package/dist/core-lib/lib/enums/tabbed-form-type.enum.d.ts +4 -0
  23. package/dist/core-lib/lib/models/pagination/filter-criteria.interface.d.ts +9 -0
  24. package/dist/core-lib/lib/models/pagination/page-request.interface.d.ts +10 -0
  25. package/dist/core-lib/lib/models/pagination/page.interface.d.ts +9 -0
  26. package/dist/core-lib/lib/models/pagination/sort-criteria.interface.d.ts +4 -0
  27. package/dist/core-lib/lib/pipes/indian-date.pipe.d.ts +12 -0
  28. package/dist/core-lib/lib/services/base-crud.service.d.ts +36 -0
  29. package/dist/core-lib/lib/services/entity-registry.service.d.ts +26 -0
  30. package/dist/core-lib/lib/services/entity.service.d.ts +9 -0
  31. package/dist/core-lib/lib/services/enum-registry.service.d.ts +41 -0
  32. package/dist/core-lib/lib/services/formly-config.service.d.ts +11 -0
  33. package/dist/core-lib/lib/services/http-utility.service.d.ts +130 -0
  34. package/dist/core-lib/lib/services/notification.service.d.ts +13 -0
  35. package/dist/core-lib/lib/services/reference-data-provider.service.d.ts +8 -0
  36. package/dist/core-lib/lib/services/utils.service.d.ts +72 -0
  37. package/ng-package.json +7 -0
  38. package/package.json +63 -0
  39. package/src/index.ts +44 -0
  40. package/src/lib/components/base-form.component.ts +328 -0
  41. package/src/lib/components/base-list-page.component.ts +327 -0
  42. package/src/lib/components/base-page.component.ts +33 -0
  43. package/src/lib/components/base-tabbed-form.component.ts +345 -0
  44. package/src/lib/components/formly/core-formly.module.ts +34 -0
  45. package/src/lib/components/formly/field.interface.ts +15 -0
  46. package/src/lib/components/formly/form-field.wrapper.ts +94 -0
  47. package/src/lib/components/formly/formly.constants.ts +14 -0
  48. package/src/lib/components/formly/primeng-formly.module.ts +77 -0
  49. package/src/lib/components/formly/types/checkbox.type.ts +43 -0
  50. package/src/lib/components/formly/types/date.type.ts +88 -0
  51. package/src/lib/components/formly/types/multiselect.type.ts +61 -0
  52. package/src/lib/components/formly/types/numeric-input.type.ts +45 -0
  53. package/src/lib/components/formly/types/radio.type.ts +47 -0
  54. package/src/lib/components/formly/types/select.type.ts +54 -0
  55. package/src/lib/components/formly/types/text-input.type.ts +33 -0
  56. package/src/lib/components/formly/types/textarea.type.ts +37 -0
  57. package/src/lib/constants/app.constants.ts +15 -0
  58. package/src/lib/constants/app.messages.ts +36 -0
  59. package/src/lib/enums/component-context.enum.ts +6 -0
  60. package/src/lib/enums/tabbed-form-type.enum.ts +4 -0
  61. package/src/lib/models/pagination/filter-criteria.interface.ts +19 -0
  62. package/src/lib/models/pagination/page-request.interface.ts +13 -0
  63. package/src/lib/models/pagination/page.interface.ts +9 -0
  64. package/src/lib/models/pagination/sort-criteria.interface.ts +4 -0
  65. package/src/lib/pipes/indian-date.pipe.ts +46 -0
  66. package/src/lib/services/base-crud.service.ts +81 -0
  67. package/src/lib/services/entity-registry.service.ts +51 -0
  68. package/src/lib/services/entity.service.ts +10 -0
  69. package/src/lib/services/enum-registry.service.ts +66 -0
  70. package/src/lib/services/formly-config.service.ts +50 -0
  71. package/src/lib/services/http-utility.service.example.ts +253 -0
  72. package/src/lib/services/http-utility.service.md +175 -0
  73. package/src/lib/services/http-utility.service.ts +389 -0
  74. package/src/lib/services/notification.service.ts +35 -0
  75. package/src/lib/services/reference-data-provider.service.ts +28 -0
  76. package/src/lib/services/utils.service.ts +154 -0
@@ -0,0 +1,132 @@
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+ import { Table, TableLazyLoadEvent } from 'primeng/table';
4
+ import { ConfirmationService } from 'primeng/api';
5
+ import { NotificationService } from '../services/notification.service';
6
+ import { Subscription, Observable } from 'rxjs';
7
+ import { Page } from '../models/pagination/page.interface';
8
+ import { PageRequest } from '../models/pagination/page-request.interface';
9
+ import { FilterCriteria, FilterOperator } from '../models/pagination/filter-criteria.interface';
10
+ import { BasePageComponent } from './base-page.component';
11
+ import { UtilsService } from '../services/utils.service';
12
+ import * as i0 from "@angular/core";
13
+ /**
14
+ * Base component for all list page components in the application.
15
+ * Provides common functionality for list operations like loading data,
16
+ * pagination, sorting, and CRUD operations.
17
+ */
18
+ export declare abstract class BaseListPageComponent<T extends {
19
+ uuid: string;
20
+ }> extends BasePageComponent implements OnInit, OnDestroy {
21
+ protected router: Router;
22
+ protected notificationService: NotificationService;
23
+ protected utilsService: UtilsService;
24
+ protected confirmationService: ConfirmationService;
25
+ table: Table;
26
+ items: T[];
27
+ actionLoading: boolean;
28
+ rows: number;
29
+ totalRecords: number;
30
+ filters: FilterCriteria[];
31
+ protected subscriptions: Subscription[];
32
+ constructor(router: Router, notificationService: NotificationService, utilsService: UtilsService, confirmationService: ConfirmationService);
33
+ /**
34
+ * Initialize the component, subscribe to loading state if available,
35
+ * and load initial data.
36
+ */
37
+ ngOnInit(): void;
38
+ /**
39
+ * Clean up any subscriptions when the component is destroyed
40
+ */
41
+ ngOnDestroy(): void;
42
+ /**
43
+ * Handle search event from the UI
44
+ * @param event The search event
45
+ */
46
+ onSearch(event: Event): void;
47
+ /**
48
+ * Load data with pagination and sorting
49
+ * @param event The lazy load event from PrimeNG table
50
+ */
51
+ /**
52
+ * Convert PrimeNG filter format to backend format
53
+ * @param filters The PrimeNG filters object
54
+ * @returns Converted filters object for backend
55
+ */
56
+ /**
57
+ * Convert PrimeNG filter format to backend format
58
+ * @param filters The PrimeNG filters object
59
+ * @returns Converted filters object for backend
60
+ */
61
+ /**
62
+ * Convert PrimeNG filters to backend format with proper operator mapping
63
+ */
64
+ protected convertFilters(filters: {
65
+ [key: string]: any;
66
+ }): FilterCriteria[];
67
+ /**
68
+ * Transform filter value based on backend requirements - all values must be strings
69
+ */
70
+ protected transformFilterValue(value: any): string;
71
+ /**
72
+ * Map PrimeNG operators to backend operators
73
+ */
74
+ protected transformOperator(operator: string): FilterOperator;
75
+ loadData(event?: TableLazyLoadEvent): void;
76
+ /**
77
+ * Navigate to create a new entity
78
+ */
79
+ onCreate(): void;
80
+ /**
81
+ * Navigate to view an entity
82
+ * @param item The entity to view
83
+ */
84
+ onView(item: T): void;
85
+ /**
86
+ * Navigate to edit an entity
87
+ * @param item The entity to edit
88
+ */
89
+ onEdit(item: T): void;
90
+ /**
91
+ * Navigate to a route with error handling
92
+ * @param path The route path
93
+ * @param matrixParams Optional matrix parameters
94
+ */
95
+ protected navigateTo(path: any[], matrixParams?: {
96
+ [key: string]: any;
97
+ }): void;
98
+ /**
99
+ * Delete an entity with confirmation
100
+ * @param item The entity to delete
101
+ */
102
+ onDelete(item: T): void;
103
+ /**
104
+ * Validate that an entity has a UUID
105
+ * @param item The entity to validate
106
+ * @param action The action being performed
107
+ * @returns true if valid, false otherwise
108
+ */
109
+ protected validateItemUuid(item: T, action: string): boolean;
110
+ /**
111
+ * Get an observable for loading state from the entity service
112
+ * @returns An observable of loading state if available, null otherwise
113
+ */
114
+ protected getLoadingObservable(): Observable<boolean> | null;
115
+ /**
116
+ * Get the entity service for data operations
117
+ */
118
+ protected abstract getEntityService(): {
119
+ getAll: (pageRequest?: PageRequest) => Observable<Page<T>>;
120
+ delete: (uuid: string) => Observable<any>;
121
+ };
122
+ /**
123
+ * Get the entity name for display in messages
124
+ */
125
+ protected abstract getEntityName(): string;
126
+ /**
127
+ * Get the route to the entity form
128
+ */
129
+ protected abstract getFormRoute(): string;
130
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseListPageComponent<any>, never>;
131
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaseListPageComponent<any>, never, never, {}, {}, never, never, true, never>;
132
+ }
@@ -0,0 +1,25 @@
1
+ import { UtilsService } from '../services/utils.service';
2
+ import { NotificationService } from '../services/notification.service';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Base component for all page components in the application.
6
+ * Provides common functionality like loading state and message display.
7
+ */
8
+ export declare abstract class BasePageComponent {
9
+ protected utilsService: UtilsService;
10
+ protected notificationService: NotificationService;
11
+ protected loading: boolean;
12
+ constructor(utilsService: UtilsService, notificationService: NotificationService);
13
+ /**
14
+ * Display an error message to the user
15
+ * @param detail The error message to display
16
+ */
17
+ protected showError(detail: string): void;
18
+ /**
19
+ * Display a success message to the user
20
+ * @param detail The success message to display
21
+ */
22
+ protected showSuccess(detail: string): void;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<BasePageComponent, never>;
24
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BasePageComponent, never, never, {}, {}, never, never, true, never>;
25
+ }
@@ -0,0 +1,54 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
+ import { BasePageComponent } from './base-page.component';
4
+ import { UtilsService } from '../services/utils.service';
5
+ import { NotificationService } from '../services/notification.service';
6
+ import { PageMode } from '../constants/app.constants';
7
+ import { EntityService } from '../services/entity.service';
8
+ import * as i0 from "@angular/core";
9
+ export interface TabConfig {
10
+ value: string;
11
+ title: string;
12
+ isParentModel?: boolean;
13
+ }
14
+ export declare abstract class BaseTabbedFormComponent<T extends {
15
+ uuid: string;
16
+ }> extends BasePageComponent implements OnInit {
17
+ protected route: ActivatedRoute;
18
+ protected router: Router;
19
+ protected notificationService: NotificationService;
20
+ protected utilsService: UtilsService;
21
+ activeTab: string;
22
+ tabs: TabConfig[];
23
+ formType: string;
24
+ isNew: boolean;
25
+ mode: PageMode;
26
+ currentFormData: T;
27
+ protected originalFormData: T | null;
28
+ protected hasChanges: boolean;
29
+ private debug;
30
+ constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService);
31
+ ngOnInit(): void;
32
+ private initializeFormData;
33
+ private loadFromUuid;
34
+ private initializeForm;
35
+ protected patchFormData(data: T | null): void;
36
+ private initializeFormMode;
37
+ private setupFormState;
38
+ protected loadEntity(uuid: string): void;
39
+ protected findTabByValue(value: string): TabConfig | undefined;
40
+ protected loadDefaultTab(): void;
41
+ protected getTabFormData(tabConfig: TabConfig): T | null;
42
+ private initializeListForm;
43
+ protected onTabChange(value: string | number): void;
44
+ protected hasFormChanges(currentData: T): boolean;
45
+ private isEqual;
46
+ private isValidPageMode;
47
+ protected abstract getTabs(): TabConfig[];
48
+ protected abstract getEntityService(): EntityService<T>;
49
+ protected abstract getEntityName(): string;
50
+ protected abstract getTabTitle(data: T): string;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseTabbedFormComponent<any>, never>;
52
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaseTabbedFormComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
53
+ static ɵprov: i0.ɵɵInjectableDeclaration<BaseTabbedFormComponent<any>>;
54
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@ngx-formly/core";
3
+ export declare class CoreFormlyModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<CoreFormlyModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CoreFormlyModule, never, [typeof i1.FormlyModule], [typeof i1.FormlyModule]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<CoreFormlyModule>;
7
+ }
@@ -0,0 +1,21 @@
1
+ import { FieldWrapper, FormlyFieldConfig } from '@ngx-formly/core';
2
+ import * as i0 from "@angular/core";
3
+ interface FormlyValidationMessage {
4
+ [key: string]: string;
5
+ }
6
+ interface FormlyFieldProps {
7
+ label?: string;
8
+ required?: boolean;
9
+ tooltip?: string;
10
+ description?: string;
11
+ validation?: {
12
+ messages?: FormlyValidationMessage;
13
+ };
14
+ }
15
+ export declare class FormFieldWrapper extends FieldWrapper<FormlyFieldConfig<FormlyFieldProps>> {
16
+ get errorMessage(): string;
17
+ get showError(): boolean;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldWrapper, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldWrapper, "formly-wrapper-form-field", never, {}, {}, never, never, true, never>;
20
+ }
21
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare const FORMLY_TYPES: {
2
+ TEXT: string;
3
+ NUMBER: string;
4
+ DATE: string;
5
+ CHECKBOX: string;
6
+ RADIO: string;
7
+ SELECT: string;
8
+ MULTISELECT: string;
9
+ TEXTAREA: string;
10
+ };
11
+ export declare const FORMLY_WRAPPERS: {
12
+ FORM_FIELD: string;
13
+ };
@@ -0,0 +1,12 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CheckboxType extends FieldType {
4
+ defaultOptions: {
5
+ props: {
6
+ trueValue: boolean;
7
+ falseValue: boolean;
8
+ };
9
+ };
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxType, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxType, "formly-field-checkbox", never, {}, {}, never, never, true, never>;
12
+ }
@@ -0,0 +1,20 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DateType extends FieldType {
4
+ defaultOptions: {
5
+ props: {
6
+ dateFormat: string;
7
+ showTime: boolean;
8
+ touchUI: boolean;
9
+ placeholder: string;
10
+ showButtonBar: boolean;
11
+ };
12
+ };
13
+ onDateSelect(event: Date): void;
14
+ onDateInput(event: any): void;
15
+ private formatAndSetDate;
16
+ private parseDate;
17
+ private isValidDateInput;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateType, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateType, "formly-field-date", never, {}, {}, never, never, true, never>;
20
+ }
@@ -0,0 +1,26 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ interface SelectOption {
5
+ value: any;
6
+ label: string;
7
+ [key: string]: any;
8
+ }
9
+ export declare class MultiselectType extends FieldType {
10
+ get options$(): Observable<SelectOption[]>;
11
+ defaultOptions: {
12
+ props: {
13
+ options: SelectOption[];
14
+ optionLabel: string;
15
+ optionValue: string;
16
+ placeholder: string;
17
+ filter: boolean;
18
+ maxSelectedLabels: number;
19
+ showToggleAll: boolean;
20
+ virtualScroll: boolean;
21
+ };
22
+ };
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<MultiselectType, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<MultiselectType, "formly-field-multiselect", never, {}, {}, never, never, true, never>;
25
+ }
26
+ export {};
@@ -0,0 +1,17 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NumericInputType extends FieldType {
4
+ defaultOptions: {
5
+ props: {
6
+ min: any;
7
+ max: any;
8
+ minFractionDigits: number;
9
+ maxFractionDigits: number;
10
+ prefix: string;
11
+ suffix: string;
12
+ useGrouping: boolean;
13
+ };
14
+ };
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<NumericInputType, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<NumericInputType, "formly-field-numeric-input", never, {}, {}, never, never, true, never>;
17
+ }
@@ -0,0 +1,13 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ interface RadioOption {
5
+ value: any;
6
+ label: string;
7
+ }
8
+ export declare class RadioType extends FieldType {
9
+ get options$(): Observable<RadioOption[]>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<RadioType, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<RadioType, "formly-field-radio", never, {}, {}, never, never, true, never>;
12
+ }
13
+ export {};
@@ -0,0 +1,25 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ interface SelectOption {
5
+ value: any;
6
+ label: string;
7
+ [key: string]: any;
8
+ }
9
+ export declare class SelectType extends FieldType {
10
+ get options$(): Observable<SelectOption[]>;
11
+ defaultOptions: {
12
+ props: {
13
+ options: any[];
14
+ optionLabel: string;
15
+ optionValue: string;
16
+ placeholder: string;
17
+ showClear: boolean;
18
+ filter: boolean;
19
+ virtualScroll: boolean;
20
+ };
21
+ };
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectType, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectType, "formly-field-select", never, {}, {}, never, never, true, never>;
24
+ }
25
+ export {};
@@ -0,0 +1,12 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TextInputType extends FieldType {
4
+ defaultOptions: {
5
+ props: {
6
+ type: string;
7
+ placeholder: string;
8
+ };
9
+ };
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextInputType, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextInputType, "formly-field-text-input", never, {}, {}, never, never, true, never>;
12
+ }
@@ -0,0 +1,14 @@
1
+ import { FieldType } from '@ngx-formly/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TextareaType extends FieldType {
4
+ defaultOptions: {
5
+ props: {
6
+ rows: number;
7
+ cols: any;
8
+ autoResize: boolean;
9
+ placeholder: string;
10
+ };
11
+ };
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextareaType, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextareaType, "formly-field-textarea", never, {}, {}, never, never, true, never>;
14
+ }
@@ -0,0 +1,13 @@
1
+ export declare class AppConstants {
2
+ static readonly FORM: {
3
+ readonly MODE: "mode";
4
+ readonly UUID: "uuid";
5
+ readonly NEW: "new";
6
+ };
7
+ static readonly PAGE_MODE: {
8
+ readonly CREATE: "create";
9
+ readonly EDIT: "edit";
10
+ readonly VIEW: "view";
11
+ };
12
+ }
13
+ export type PageMode = typeof AppConstants.PAGE_MODE[keyof typeof AppConstants.PAGE_MODE];
@@ -0,0 +1,36 @@
1
+ export declare const AppMessages: {
2
+ readonly COMMON: {
3
+ readonly ERROR: {
4
+ readonly GENERAL: "An error occurred";
5
+ readonly INVALID_INPUT: "Invalid input provided";
6
+ readonly REQUIRED_FIELD: "This field is required";
7
+ };
8
+ readonly SUCCESS: {
9
+ readonly SAVE: "saved successfully";
10
+ readonly UPDATE: "updated successfully";
11
+ readonly DELETE: "deleted successfully";
12
+ };
13
+ };
14
+ readonly FORM: {
15
+ readonly ERROR: {
16
+ readonly INIT: "Failed to initialize form";
17
+ readonly SAVE: "Failed to save";
18
+ readonly LOAD: "Failed to load";
19
+ readonly VALIDATION: "Please fill in all required fields correctly";
20
+ };
21
+ readonly SUCCESS: {
22
+ readonly SAVE: "saved successfully";
23
+ };
24
+ };
25
+ readonly LIST: {
26
+ readonly ERROR: {
27
+ readonly LOAD: "Failed to load";
28
+ readonly DELETE: "Failed to delete";
29
+ readonly NAVIGATION: "Navigation failed";
30
+ readonly INVALID_ID: "Cannot perform action without ID";
31
+ };
32
+ readonly SUCCESS: {
33
+ readonly DELETE: "deleted successfully";
34
+ };
35
+ };
36
+ };
@@ -0,0 +1,6 @@
1
+ export declare enum ComponentContext {
2
+ STANDALONE = "STANDALONE",
3
+ TABBED = "TABBED",
4
+ MODAL = "MODAL",
5
+ EMBEDDED = "EMBEDDED"
6
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum TabbedFormType {
2
+ STANDARD = "STANDARD",
3
+ LIST = "LIST"
4
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Matches backend FilterCriteria and FilterOperator
3
+ */
4
+ export type FilterOperator = 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'ENDS_WITH' | 'LESS_THAN' | 'LESS_THAN_EQUALS' | 'GREATER_THAN' | 'GREATER_THAN_EQUALS';
5
+ export interface FilterCriteria {
6
+ field: string;
7
+ value: string;
8
+ operator: FilterOperator;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { FilterCriteria } from './filter-criteria.interface';
2
+ import { SortCriteria } from './sort-criteria.interface';
3
+ export interface PageRequest {
4
+ page?: number;
5
+ size?: number;
6
+ sorts?: SortCriteria[];
7
+ filters?: FilterCriteria[];
8
+ }
9
+ export type { FilterCriteria } from './filter-criteria.interface';
10
+ export type { SortCriteria } from './sort-criteria.interface';
@@ -0,0 +1,9 @@
1
+ export interface Page<T> {
2
+ content: T[];
3
+ page: {
4
+ totalElements: number;
5
+ totalPages: number;
6
+ size: number;
7
+ number: number;
8
+ };
9
+ }
@@ -0,0 +1,4 @@
1
+ export interface SortCriteria {
2
+ field: string;
3
+ direction: 'asc' | 'desc';
4
+ }
@@ -0,0 +1,12 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { DatePipe } from '@angular/common';
3
+ import * as i0 from "@angular/core";
4
+ type DateFormat = 'default' | 'short' | 'medium';
5
+ export declare class IndianDatePipe implements PipeTransform {
6
+ private datePipe;
7
+ constructor(datePipe: DatePipe);
8
+ transform(value: string | null, format?: DateFormat): string | null;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<IndianDatePipe, never>;
10
+ static ɵpipe: i0.ɵɵPipeDeclaration<IndianDatePipe, "indianDate", true>;
11
+ }
12
+ export {};
@@ -0,0 +1,36 @@
1
+ import { Observable } from 'rxjs';
2
+ import { HttpUtilityService } from './http-utility.service';
3
+ import { UtilsService } from './utils.service';
4
+ import { MessageService } from 'primeng/api';
5
+ import { Page } from '../models/pagination/page.interface';
6
+ import { PageRequest } from '../models/pagination/page-request.interface';
7
+ import { EntityService } from './entity.service';
8
+ export declare abstract class BaseCrudService<T extends {
9
+ uuid: string;
10
+ }> implements EntityService<T> {
11
+ protected httpUtility: HttpUtilityService;
12
+ protected utilsService: UtilsService;
13
+ protected resourcePath: string;
14
+ protected backendBaseUrl: string;
15
+ protected messageService: MessageService | undefined;
16
+ get loading$(): Observable<boolean>;
17
+ protected apiUrl: string;
18
+ /**
19
+ * Creates an instance of BaseCrudService.
20
+ * @param httpUtility - Service for making HTTP requests
21
+ * @param utilsService - Utility service for common operations
22
+ * @param resourcePath - API resource path (e.g., 'customers', 'products')
23
+ * @param backendBaseUrl - Base URL for the backend API
24
+ * @param messageService - Optional service for showing messages
25
+ */
26
+ protected constructor(httpUtility: HttpUtilityService, utilsService: UtilsService, resourcePath: string, backendBaseUrl: string, messageService: MessageService | undefined);
27
+ /**
28
+ * Joins URL parts ensuring no double slashes
29
+ */
30
+ private joinUrls;
31
+ getAll(pageRequest?: PageRequest): Observable<Page<T>>;
32
+ getById(uuid: string): Observable<T>;
33
+ create(entity: Omit<T, 'uuid'>): Observable<T>;
34
+ update(uuid: string, entity: Omit<T, 'uuid'>): Observable<T>;
35
+ delete(uuid: string): Observable<void>;
36
+ }
@@ -0,0 +1,26 @@
1
+ import { Observable } from 'rxjs';
2
+ import { HttpUtilityService } from './http-utility.service';
3
+ import { ReferenceDataProviderService } from './reference-data-provider.service';
4
+ import * as i0 from "@angular/core";
5
+ export interface ReferenceDto {
6
+ key: string;
7
+ displayLabel: string;
8
+ data?: any;
9
+ }
10
+ export declare class EntityRegistryService {
11
+ private httpUtility;
12
+ private dataProvider;
13
+ constructor(httpUtility: HttpUtilityService, dataProvider: ReferenceDataProviderService);
14
+ /**
15
+ * Gets reference options for an entity, suitable for select/dropdown components
16
+ * @param entityName The name of the entity (e.g., 'customers', 'departments')
17
+ * @returns Observable of options array with label/value pairs
18
+ */
19
+ getEntityOptions(entityName: string): Observable<{
20
+ label: string;
21
+ value: string;
22
+ data?: any;
23
+ }[]>;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityRegistryService, never>;
25
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityRegistryService>;
26
+ }
@@ -0,0 +1,9 @@
1
+ import { Observable } from 'rxjs';
2
+ /**
3
+ * Interface for basic CRUD operations that all entity services must implement
4
+ */
5
+ export interface EntityService<T> {
6
+ create(data: Omit<T, 'uuid'>): Observable<T>;
7
+ update(uuid: string, data: Omit<T, 'uuid'>): Observable<T>;
8
+ getById(uuid: string): Observable<T>;
9
+ }
@@ -0,0 +1,41 @@
1
+ import { UtilsService } from './utils.service';
2
+ import * as i0 from "@angular/core";
3
+ export declare class EnumRegistryService {
4
+ private utilsService;
5
+ private enumMap;
6
+ constructor(utilsService: UtilsService);
7
+ /**
8
+ * Initialize global enums
9
+ */
10
+ static registerGlobalEnums(enums: Record<string, any>): {
11
+ provide: typeof EnumRegistryService;
12
+ useFactory: (utilsService: UtilsService) => EnumRegistryService;
13
+ deps: (typeof UtilsService)[];
14
+ };
15
+ /**
16
+ * Register an enum type with the service
17
+ * @param name Name to register the enum under
18
+ * @param enumType The enum type to register
19
+ */
20
+ register(name: string, enumType: any): void;
21
+ /**
22
+ * Get formly-compatible options array for a registered enum
23
+ * @param name Name of the registered enum
24
+ * @returns Array of {label, value} pairs suitable for formly select fields
25
+ */
26
+ getEnumValues(name: string): {
27
+ label: string;
28
+ value: string;
29
+ }[];
30
+ /**
31
+ * Check if an enum type is registered
32
+ * @param name Name of the enum to check
33
+ */
34
+ hasEnum(name: string): boolean;
35
+ /**
36
+ * Clear all registered enums
37
+ */
38
+ clear(): void;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<EnumRegistryService, never>;
40
+ static ɵprov: i0.ɵɵInjectableDeclaration<EnumRegistryService>;
41
+ }
@@ -0,0 +1,11 @@
1
+ import { FormlyFieldConfig } from '@ngx-formly/core';
2
+ import { PageMode } from '../constants/app.constants';
3
+ import { EnumRegistryService } from './enum-registry.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class FormlyConfigService {
6
+ private enumRegistry;
7
+ constructor(enumRegistry: EnumRegistryService);
8
+ getFormConfig(fields: FormlyFieldConfig[], mode: PageMode, dynamicOptions?: Record<string, any>): FormlyFieldConfig[];
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormlyConfigService, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormlyConfigService>;
11
+ }