@nettyapps/ntybase 0.0.2 → 0.0.3

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,7 +240,7 @@ 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>;
@@ -281,6 +291,14 @@ declare abstract class AgGridBase<T extends {
281
291
  statusBar: {
282
292
  statusPanels: StatusPanelDef[];
283
293
  };
294
+ /**
295
+ * Component initialization lifecycle hook
296
+ */
297
+ ngOnInit(): Promise<void>;
298
+ /**
299
+ * Handle input changes for route parameters
300
+ */
301
+ ngOnChanges(changes: SimpleChanges): void;
284
302
  protected onGridReady(params: GridReadyEvent): void;
285
303
  onFirstDataRendered(params: any): void;
286
304
  saveGrid(params: any): void;
@@ -308,37 +326,33 @@ declare abstract class AgGridBase<T extends {
308
326
  */
309
327
  protected updateRowInGrid(rowData: T, idField?: string): void;
310
328
  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
329
  refreshData(): Promise<void>;
317
330
  setAccessRights(): Promise<boolean>;
318
- protected abstract loadData(): void;
331
+ protected abstract loadData(filter?: string): void;
332
+ protected abstract initAgGrid(): void;
319
333
  protected onBtnClick?(e: T): void;
320
- protected loadFreshData?(): Promise<T[]>;
321
334
  protected deleteRows?(rows: T[]): void;
322
335
  protected getEntityType?(): string;
336
+ protected selectedData?(): void;
323
337
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgGridBase<any>, never>;
324
338
  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>;
325
339
  }
326
340
 
327
341
  type UserViewMode = 'fullscreen' | 'sidenav' | 'dialog';
328
- declare abstract class AgGridSaveBase<T> {
342
+ declare abstract class AgGridSaveBase<T> implements DoCheck {
329
343
  protected router: Router;
330
344
  protected route: ActivatedRoute;
331
345
  protected commonService: CommonService;
332
346
  protected alertService: AlertService;
333
- parameters: string;
347
+ viewMode: _angular_core.WritableSignal<UserViewMode>;
348
+ parameters: _angular_core.InputSignal<string>;
349
+ embedded: _angular_core.InputSignal<boolean>;
334
350
  currentItem: _angular_core.WritableSignal<T>;
335
351
  initialItem: T;
336
352
  formChanged: boolean;
337
353
  saveForm: NgForm;
338
- viewMode: _angular_core.WritableSignal<UserViewMode>;
339
354
  protected dialogRef: MatDialogRef<any, any> | null;
340
355
  protected dialogData: any;
341
- embedded: _angular_core.InputSignal<boolean>;
342
356
  closeAfterSave: _angular_core.ModelSignal<boolean>;
343
357
  setCloseAfterSave(value: boolean): void;
344
358
  updateValid: _angular_core.WritableSignal<boolean>;
@@ -347,6 +361,15 @@ declare abstract class AgGridSaveBase<T> {
347
361
  * Determine view mode based on current route
348
362
  */
349
363
  protected determineViewMode(): void;
364
+ /**
365
+ * Set data to the form while preserving any unsaved changes
366
+ * @param item - Data object of type T to populate the form
367
+ */
368
+ protected initializeFormData(item: T): void;
369
+ /**
370
+ * @param data - Data to populate the new instance
371
+ */
372
+ protected createItemInstance(data: Partial<T>): T;
350
373
  /**
351
374
  * Check for form changes
352
375
  */
@@ -356,13 +379,16 @@ declare abstract class AgGridSaveBase<T> {
356
379
  * Check if can deactivate component
357
380
  */
358
381
  canDeactivate(): Promise<boolean>;
382
+ protected getGuidFromParameters(): string;
383
+ ngOnChanges(changes: SimpleChanges): void;
359
384
  /**
360
385
  * Close sidenav or navigate back
361
386
  */
362
387
  closeSidenav(): void;
363
388
  backClicked(): void;
389
+ protected abstract loadDetailData(): void;
364
390
  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>;
391
+ 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
392
  }
367
393
 
368
394
  type AOA = string[][];
@@ -757,7 +783,7 @@ declare class LeftSidenav implements OnInit {
757
783
  }
758
784
 
759
785
  interface AppTheme {
760
- name: 'light' | 'dark' | 'system';
786
+ name: 'light' | 'dark';
761
787
  icon: string;
762
788
  }
763
789
  declare class Theme {
@@ -765,7 +791,7 @@ declare class Theme {
765
791
  private themes;
766
792
  selectedTheme: _angular_core.Signal<AppTheme | undefined>;
767
793
  getThemes(): AppTheme[];
768
- setTheme(theme: 'light' | 'dark' | 'system'): void;
794
+ setTheme(theme: 'light' | 'dark'): void;
769
795
  constructor();
770
796
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Theme, never>;
771
797
  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.3",
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"