@nettyapps/ntybase 0.0.2 → 0.0.4

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 _angular_core from '@angular/core';
2
- import { OnDestroy, OnInit, ElementRef } from '@angular/core';
2
+ import { OnInit, OnChanges, SimpleChanges, DoCheck, OnDestroy, ElementRef } from '@angular/core';
3
3
  import { TranslateService } from '@ngx-translate/core';
4
4
  import { Observable, Subject } from 'rxjs';
5
5
  import { Theme as Theme$1, GridApi, GridOptions, StatusPanelDef, GridReadyEvent } from 'ag-grid-community';
@@ -124,11 +124,21 @@ declare class CommonService {
124
124
  protected dialog: MatDialog;
125
125
  rightSidenavOpen: _angular_core.WritableSignal<boolean>;
126
126
  toggleRightSidenav(open: boolean): void;
127
+ /**
128
+ * Normalizes Turkish text for search and comparison operations by converting
129
+ * Turkish special characters to their English equivalents and lowercasing.
130
+ *
131
+ */
127
132
  normalizeTurkish(text: string): string;
128
133
  /**
129
134
  * Gets the clean URL path without fragments or query params
130
135
  */
131
136
  getCleanUrlPath(): string;
137
+ /**
138
+ * Clears the right sidenav outlet and resets the UI state.
139
+ * Removes the right sidenav route while keeping the main content and query parameters.
140
+ * Also collapses the sidenav and closes any open dialogs.
141
+ */
132
142
  clearOutlet(): void;
133
143
  ngOnDestroy(): void;
134
144
  /** Merge columns with the given seperator
@@ -178,11 +188,11 @@ declare class CommonService {
178
188
  /** Read-only Signal for external components to observe updates */
179
189
  updates: _angular_core.Signal<{
180
190
  type: string;
181
- action: "add" | "update" | "delete";
191
+ action: "add" | "update";
182
192
  data: any;
183
193
  } | null>;
184
194
  /** Broadcasts grid data changes to subscribers */
185
- notifyUpdate(type: string, action: 'add' | 'update' | 'delete', data: any): void;
195
+ notifyUpdate(type: string, action: 'add' | 'update', data: any): void;
186
196
  /** User is not allowed to access the page
187
197
  *
188
198
  */
@@ -200,7 +210,7 @@ declare class AlertService {
200
210
  showAlert(message: string, action?: string, duration?: number): void;
201
211
  showConfirm(message: string): Promise<boolean>;
202
212
  showSuccess(message: string, duration?: number): void;
203
- showError(message: string, duration?: number): void;
213
+ showError(error: any, duration?: number): void;
204
214
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AlertService, never>;
205
215
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AlertService>;
206
216
  }
@@ -230,12 +240,13 @@ declare class SysfunctionProxy {
230
240
 
231
241
  declare abstract class AgGridBase<T extends {
232
242
  [key: string]: any;
233
- }> {
243
+ }> implements OnInit, OnChanges {
234
244
  readOnly: _angular_core.InputSignal<boolean>;
235
245
  popupFilterValid: _angular_core.InputSignal<boolean>;
236
246
  popupValid: _angular_core.InputSignal<boolean>;
237
247
  params: _angular_core.InputSignal<any>;
238
248
  parameters: _angular_core.InputSignal<string>;
249
+ isEmbedded: _angular_core.WritableSignal<boolean>;
239
250
  protected authenticationList: Array<NettySecurity>;
240
251
  protected accessRightsProcessed: _angular_core.WritableSignal<boolean>;
241
252
  allowAdd: _angular_core.WritableSignal<boolean>;
@@ -248,10 +259,6 @@ declare abstract class AgGridBase<T extends {
248
259
  selectionValid: _angular_core.WritableSignal<boolean>;
249
260
  refreshButtonValid: _angular_core.WritableSignal<boolean>;
250
261
  selectedElement: _angular_core.OutputEmitterRef<any>;
251
- filterField: _angular_core.InputSignal<string | null>;
252
- filterFieldValue: _angular_core.InputSignal<any>;
253
- filterFieldNumeric: _angular_core.InputSignal<boolean>;
254
- filterFieldEquality: _angular_core.InputSignal<string>;
255
262
  theme: Theme$1;
256
263
  protected gridApi: GridApi;
257
264
  protected userGridApi: GridApi;
@@ -281,6 +288,14 @@ declare abstract class AgGridBase<T extends {
281
288
  statusBar: {
282
289
  statusPanels: StatusPanelDef[];
283
290
  };
291
+ /**
292
+ * Component initialization lifecycle hook
293
+ */
294
+ ngOnInit(): Promise<void>;
295
+ /**
296
+ * Handle input changes for route parameters
297
+ */
298
+ ngOnChanges(changes: SimpleChanges): void;
284
299
  protected onGridReady(params: GridReadyEvent): void;
285
300
  onFirstDataRendered(params: any): void;
286
301
  saveGrid(params: any): void;
@@ -290,7 +305,7 @@ declare abstract class AgGridBase<T extends {
290
305
  * Handle back button click
291
306
  */
292
307
  backClicked(): void;
293
- gotoURL(routePrefix: string[], rightSidenav: string[] | undefined, parameters: string, type?: string, isNewTab?: boolean, embedded?: boolean, dialogComponent?: any): void;
308
+ gotoURL(routePrefix: string[], rightSidenav: string[] | undefined, parameters: string, type?: string, dialogComponent?: any, isNewTab?: boolean, isPopup?: boolean): void;
294
309
  popupGotoURL(urlSegments: string[]): void;
295
310
  /**
296
311
  * Listens for update events from CommonService and refreshes the grid accordingly.
@@ -308,37 +323,33 @@ declare abstract class AgGridBase<T extends {
308
323
  */
309
324
  protected updateRowInGrid(rowData: T, idField?: string): void;
310
325
  deleteSelected(): Promise<void>;
311
- /**
312
- * Delete a row from the grid
313
- * @param rowData The row to delete
314
- */
315
- protected deleteRowFromGrid(rowData: T): void;
316
326
  refreshData(): Promise<void>;
317
327
  setAccessRights(): Promise<boolean>;
318
- protected abstract loadData(): void;
328
+ protected abstract loadData(filter?: string): void;
329
+ protected abstract initAgGrid(): void;
319
330
  protected onBtnClick?(e: T): void;
320
- protected loadFreshData?(): Promise<T[]>;
321
331
  protected deleteRows?(rows: T[]): void;
322
332
  protected getEntityType?(): string;
333
+ protected selectedData?(): void;
323
334
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgGridBase<any>, never>;
324
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgGridBase<any>, "ntybase-ag-grid-base", never, { "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "popupFilterValid": { "alias": "popupFilterValid"; "required": false; "isSignal": true; }; "popupValid": { "alias": "popupValid"; "required": false; "isSignal": true; }; "params": { "alias": "params"; "required": false; "isSignal": true; }; "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; "filterField": { "alias": "filterField"; "required": false; "isSignal": true; }; "filterFieldValue": { "alias": "filterFieldValue"; "required": false; "isSignal": true; }; "filterFieldNumeric": { "alias": "filterFieldNumeric"; "required": false; "isSignal": true; }; "filterFieldEquality": { "alias": "filterFieldEquality"; "required": false; "isSignal": true; }; }, { "selectedElement": "selectedElement"; }, never, never, true, never>;
335
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgGridBase<any>, "ntybase-ag-grid-base", never, { "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "popupFilterValid": { "alias": "popupFilterValid"; "required": false; "isSignal": true; }; "popupValid": { "alias": "popupValid"; "required": false; "isSignal": true; }; "params": { "alias": "params"; "required": false; "isSignal": true; }; "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; }, { "selectedElement": "selectedElement"; }, never, never, true, never>;
325
336
  }
326
337
 
327
338
  type UserViewMode = 'fullscreen' | 'sidenav' | 'dialog';
328
- declare abstract class AgGridSaveBase<T> {
339
+ declare abstract class AgGridSaveBase<T> implements DoCheck {
329
340
  protected router: Router;
330
341
  protected route: ActivatedRoute;
331
342
  protected commonService: CommonService;
332
343
  protected alertService: AlertService;
333
- parameters: string;
344
+ viewMode: _angular_core.WritableSignal<UserViewMode>;
345
+ parameters: _angular_core.InputSignal<string>;
346
+ embedded: _angular_core.InputSignal<boolean>;
334
347
  currentItem: _angular_core.WritableSignal<T>;
335
348
  initialItem: T;
336
349
  formChanged: boolean;
337
350
  saveForm: NgForm;
338
- viewMode: _angular_core.WritableSignal<UserViewMode>;
339
351
  protected dialogRef: MatDialogRef<any, any> | null;
340
352
  protected dialogData: any;
341
- embedded: _angular_core.InputSignal<boolean>;
342
353
  closeAfterSave: _angular_core.ModelSignal<boolean>;
343
354
  setCloseAfterSave(value: boolean): void;
344
355
  updateValid: _angular_core.WritableSignal<boolean>;
@@ -347,6 +358,15 @@ declare abstract class AgGridSaveBase<T> {
347
358
  * Determine view mode based on current route
348
359
  */
349
360
  protected determineViewMode(): void;
361
+ /**
362
+ * Set data to the form while preserving any unsaved changes
363
+ * @param item - Data object of type T to populate the form
364
+ */
365
+ protected initializeFormData(item: T): void;
366
+ /**
367
+ * @param data - Data to populate the new instance
368
+ */
369
+ protected createItemInstance(data: Partial<T>): T;
350
370
  /**
351
371
  * Check for form changes
352
372
  */
@@ -356,13 +376,16 @@ declare abstract class AgGridSaveBase<T> {
356
376
  * Check if can deactivate component
357
377
  */
358
378
  canDeactivate(): Promise<boolean>;
379
+ protected getGuidFromParameters(): string;
380
+ ngOnChanges(changes: SimpleChanges): void;
359
381
  /**
360
382
  * Close sidenav or navigate back
361
383
  */
362
384
  closeSidenav(): void;
363
385
  backClicked(): void;
386
+ protected abstract loadDetailData(): void;
364
387
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgGridSaveBase<any>, never>;
365
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgGridSaveBase<any>, "ntybase-ag-grid-save-base", never, { "parameters": { "alias": "parameters"; "required": false; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; "closeAfterSave": { "alias": "closeAfterSave"; "required": false; "isSignal": true; }; }, { "closeAfterSave": "closeAfterSaveChange"; }, never, never, true, never>;
388
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgGridSaveBase<any>, "ntybase-ag-grid-save-base", never, { "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; "closeAfterSave": { "alias": "closeAfterSave"; "required": false; "isSignal": true; }; }, { "closeAfterSave": "closeAfterSaveChange"; }, never, never, true, never>;
366
389
  }
367
390
 
368
391
  type AOA = string[][];
@@ -757,7 +780,7 @@ declare class LeftSidenav implements OnInit {
757
780
  }
758
781
 
759
782
  interface AppTheme {
760
- name: 'light' | 'dark' | 'system';
783
+ name: 'light' | 'dark';
761
784
  icon: string;
762
785
  }
763
786
  declare class Theme {
@@ -765,7 +788,7 @@ declare class Theme {
765
788
  private themes;
766
789
  selectedTheme: _angular_core.Signal<AppTheme | undefined>;
767
790
  getThemes(): AppTheme[];
768
- setTheme(theme: 'light' | 'dark' | 'system'): void;
791
+ setTheme(theme: 'light' | 'dark'): void;
769
792
  constructor();
770
793
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Theme, never>;
771
794
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<Theme>;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@nettyapps/ntybase",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "peerDependencies": {
5
- "@angular/common": "^20.0.0",
6
- "@angular/core": "^20.0.0"
5
+ "@angular/common": "^20.1.7",
6
+ "@angular/core": "^20.1.7"
7
7
  },
8
8
  "dependencies": {
9
9
  "tslib": "^2.3.0"