ngx-techlify-core 11.4.7 → 11.4.8

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.
@@ -0,0 +1,3 @@
1
+ export * from './techlify-form-component.class';
2
+ export * from './techlify-listing-component.class';
3
+ export * from './techlify-service.class';
@@ -0,0 +1,43 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { FormValidatorService } from '../core/form-validator.service';
3
+ /**
4
+ * Interface used to ensure we have a consistent structure across our form components
5
+ *
6
+ * It also provides some abstraction of repeated code to reduce our codebase size
7
+ *
8
+ * @todo This should be moved to ngx-techlify-core
9
+ *
10
+ * Advantages of this abstract class
11
+ * - Less code, less maintenance, less bugs
12
+ * - more consistent code
13
+ * - comments on more code
14
+ * - save time, save energy
15
+ */
16
+ export declare abstract class TechlifyFormComponentInterface {
17
+ protected formValidatorService: FormValidatorService;
18
+ form: FormGroup;
19
+ errorMessages: any;
20
+ constructor(formValidatorService: FormValidatorService);
21
+ /**
22
+ * Resets the value of a field in the HTML form
23
+ *
24
+ * @param event
25
+ * @param field
26
+ */
27
+ resetFieldValue(event: any, field: string): void;
28
+ /**
29
+ * Retrieves the value of a field from the HTML form
30
+ *
31
+ * @param field
32
+ * @returns
33
+ */
34
+ getFieldValue(field: string): any;
35
+ /**
36
+ * Method to evaluate form fields
37
+ * */
38
+ isFieldValid(field: string): any;
39
+ /**
40
+ * Method to find error in form fields
41
+ * */
42
+ getErrorMessage(field: string): any;
43
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Interface used to ensure we have a consistent structure across our listing pages
3
+ *
4
+ * @todo This should be moved to ngx-techlify-core
5
+ *
6
+ * Advantages of this abstract class
7
+ * - Less code, less maintenance, less bugs
8
+ * - more consistent code
9
+ * - comments on more code
10
+ * - save time, save energy
11
+ */
12
+ export declare abstract class TechlifyListingControllerInterface {
13
+ models: any[];
14
+ page: number;
15
+ perPage: number;
16
+ lastPage: number;
17
+ isWorking: boolean;
18
+ /**
19
+ * Function that listens for any changes in the form group to apply the filters
20
+ */
21
+ abstract listenForChanges(): void;
22
+ /**
23
+ * Function that loads the main models of the application
24
+ */
25
+ abstract loadData(): void;
26
+ /**
27
+ * Reload all data from page 1
28
+ */
29
+ reload(): void;
30
+ /**
31
+ * Can be called when the user is scrolling,
32
+ * to trigger loading a new page of data
33
+ */
34
+ onScroll(): void;
35
+ /**
36
+ * Function used to pop up the edit form for the model
37
+ *
38
+ * @param model
39
+ */
40
+ abstract editForm(model: any): void;
41
+ /**
42
+ * Function used to pop up the delete form for the model
43
+ *
44
+ * @param model
45
+ */
46
+ abstract deleteForm(model: any): void;
47
+ }
@@ -0,0 +1,52 @@
1
+ import { HttpService } from '../core/http.service';
2
+ /**
3
+ * Interface used to ensure we have a consistent structure across our listing pages
4
+ *
5
+ * @todo This should be moved to ngx-techlify-core
6
+ *
7
+ * Advantages of this abstract class
8
+ * - Less code, less maintenance, less bugs
9
+ * - more consistent code
10
+ * - comments on more code
11
+ * - save time, save energy
12
+ */
13
+ export declare class TechlifyServiceBaseClass {
14
+ protected http: HttpService;
15
+ protected baseUrl: string;
16
+ constructor(http: HttpService, baseUrl: string);
17
+ /**
18
+ * Loads a set of the model this service is for
19
+ *
20
+ * @param filters Restrictors to filter the set of models
21
+ * @returns
22
+ */
23
+ index(filters: any): Promise<Object>;
24
+ /**
25
+ * Add a new record to the database
26
+ *
27
+ * @param model The data of the model to add
28
+ * @returns
29
+ */
30
+ store(model: any): Promise<Object>;
31
+ /**
32
+ * Load a single model record, often with all relations and related data
33
+ *
34
+ * @param modelId ID of the model to load
35
+ * @returns
36
+ */
37
+ show(modelId: any): Promise<Object>;
38
+ /**
39
+ * Update fields of a single existing model
40
+ *
41
+ * @param model Model to update
42
+ * @returns
43
+ */
44
+ update(model: any): Promise<Object>;
45
+ /**
46
+ * Delete a single model
47
+ *
48
+ * @param model Model to delete
49
+ * @returns
50
+ */
51
+ delete(model: any): Promise<Object>;
52
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-techlify-core",
3
- "version": "11.4.7",
3
+ "version": "11.4.8",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=11",
6
6
  "@angular/core": ">=11",
package/public-api.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './lib/action-popup';
2
+ export * from './lib/base-model';
2
3
  export * from './lib/data-table';
3
4
  export * from './lib/document-viewer';
4
5
  export * from './lib/entity-files';