ngx-techlify-core 18.89.0 → 18.90.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.
- package/esm2022/lib/base-model/index.mjs +3 -1
- package/esm2022/lib/base-model/techlify-show/contract/techlify-show.contract.mjs +84 -0
- package/esm2022/lib/base-model/techlify-show/techlify-show.component.mjs +120 -0
- package/esm2022/lib/detail-layout/techlify-detail-layout.component.mjs +11 -0
- package/esm2022/lib/searchable-selector/searchable-selector.component.mjs +2 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/ngx-techlify-core.mjs +207 -3
- package/fesm2022/ngx-techlify-core.mjs.map +1 -1
- package/lib/base-model/index.d.ts +2 -0
- package/lib/base-model/techlify-show/contract/techlify-show.contract.d.ts +17 -0
- package/lib/base-model/techlify-show/techlify-show.component.d.ts +71 -0
- package/lib/detail-layout/techlify-detail-layout.component.d.ts +5 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -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
|
+
}
|
package/package.json
CHANGED
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';
|