ngx-techlify-core 18.89.0 → 18.91.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.
@@ -3,3 +3,5 @@ export * from './techlify-form/contract/techlify-form.contract';
3
3
  export * from './techlify-list/techlify-list.component';
4
4
  export * from './techlify-list/contract/techlify-list.contract';
5
5
  export * from './techlify-service';
6
+ export * from './techlify-show/techlify-show.component';
7
+ export * from './techlify-show/contract/techlify-show.contract';
@@ -0,0 +1,17 @@
1
+ import { TechlifyShowComponent } from '../techlify-show.component';
2
+ export interface TechlifyShowContractOptions {
3
+ getComponent: () => TechlifyShowComponent;
4
+ getService: () => any;
5
+ routeParamName?: string;
6
+ }
7
+ /**
8
+ * Reusable test contract for components extending TechlifyShowComponent.
9
+ *
10
+ * Ensures all view components follow the same base behaviour:
11
+ * - Service injection
12
+ * - Default state initialization
13
+ * - Reading the id from the route
14
+ * - Loading the model through service.show()
15
+ * - Model update handling
16
+ */
17
+ export declare function techlifyShowContract(options: TechlifyShowContractOptions): void;
@@ -0,0 +1,71 @@
1
+ import { ActivatedRoute, ParamMap } from '@angular/router';
2
+ import { TechlifyService } from '../techlify-service';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Interface used to ensure we have a consistent structure across our view (show) pages
6
+ *
7
+ * Every view page follows the same workflow:
8
+ * route param -> id -> service.show(id) -> model
9
+ */
10
+ export declare abstract class TechlifyShowComponent {
11
+ protected service?: TechlifyService;
12
+ model: any;
13
+ id: any;
14
+ isWorking: boolean;
15
+ /**
16
+ * Name of the route param holding the model id.
17
+ * Override in child class if the route uses a different name, eg: 'memoId'
18
+ */
19
+ protected routeParamName: string;
20
+ /**
21
+ * Child classes can override this.
22
+ * If left undefined/empty, falls back to environment.appTitle
23
+ */
24
+ protected get pageTitle(): string | undefined;
25
+ private loadSubscription?;
26
+ private titleService;
27
+ private environmentService;
28
+ protected route: ActivatedRoute;
29
+ constructor(service?: TechlifyService);
30
+ /**
31
+ * Function that listens for route param changes
32
+ * Sets the id and reloads the model whenever it changes,
33
+ * so navigating between two records on the same page works
34
+ */
35
+ listenRouteChanges(): void;
36
+ /**
37
+ * Reads the model id from the route params
38
+ * Uses the current route snapshot when params are not given
39
+ *
40
+ * @param params optional route params
41
+ */
42
+ getIdFromRoute(params?: ParamMap): any;
43
+ /**
44
+ * Query params passed to the show request, eg: relations to load
45
+ * Override in child class if needed
46
+ */
47
+ protected getShowParams(): any;
48
+ /**
49
+ * Function that loads the main model of the page
50
+ */
51
+ loadData(): void;
52
+ /**
53
+ * Reload the model of the page
54
+ */
55
+ reload(): void;
56
+ /**
57
+ * Hook called once the model is loaded
58
+ * Override in child class to compute derived data from the model
59
+ *
60
+ * @param model The loaded model
61
+ */
62
+ protected modelLoaded(model: any): void;
63
+ /**
64
+ * Replaces the model of the page, eg: after an update form or status change
65
+ *
66
+ * @param model The updated model
67
+ */
68
+ modelUpdated(model: any): void;
69
+ static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyShowComponent, [{ optional: true; }]>;
70
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TechlifyShowComponent, never, never, {}, {}, never, never, false, never>;
71
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class TechlifyDetailLayoutComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyDetailLayoutComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<TechlifyDetailLayoutComponent, "app-techlify-detail-layout", never, {}, {}, never, ["*"], true, never>;
5
+ }
@@ -2,18 +2,18 @@ import { OnInit } from '@angular/core';
2
2
  import { TechlifyListComponent } from '../../base-model';
3
3
  import { LockedDateService } from '../locked-date.service';
4
4
  import { FormBuilder } from '@angular/forms';
5
- import { DatePipe } from '@angular/common';
6
5
  import { LockedDateFormComponent } from '../locked-date-form/locked-date-form.component';
6
+ import { UserConfigService } from '../../user-config/user-config.service';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class LockedDateListComponent extends TechlifyListComponent implements OnInit {
9
9
  protected service: LockedDateService;
10
10
  private fb;
11
- private datePipe;
11
+ private userConfigService;
12
12
  formComponent: import("@angular/core").WritableSignal<typeof LockedDateFormComponent>;
13
+ scrollContainer: string;
13
14
  displayedColumns: string[];
14
- constructor(service: LockedDateService, fb: FormBuilder, datePipe: DatePipe);
15
+ constructor(service: LockedDateService, fb: FormBuilder, userConfigService: UserConfigService);
15
16
  ngOnInit(): void;
16
- loadData(): void;
17
17
  static ɵfac: i0.ɵɵFactoryDeclaration<LockedDateListComponent, never>;
18
18
  static ɵcmp: i0.ɵɵComponentDeclaration<LockedDateListComponent, "app-locked-date-list", never, {}, {}, never, never, false, never>;
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-techlify-core",
3
- "version": "18.89.0",
3
+ "version": "18.91.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18",
6
6
  "@angular/core": ">=18",
package/public-api.d.ts CHANGED
@@ -186,6 +186,7 @@ export * from './lib/timeline-activity/timeline-activity-list/timeline-activity-
186
186
  export * from './lib/local-date-parser';
187
187
  export * from './lib/delete-button/techlify-delete-button.component';
188
188
  export * from './lib/form-button/techlify-form-button.component';
189
+ export * from './lib/detail-layout/techlify-detail-layout.component';
189
190
  export * from './lib/form-configuration/form-configuration-form.service';
190
191
  export * from './lib/form-configuration/form-configuration-form-field.service';
191
192
  export * from './lib/form-configuration/form-configuration-utility.service';