ngx-techlify-core 11.4.6 → 11.4.8-beta.2
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/bundles/ngx-techlify-core.umd.js +3096 -2889
- package/bundles/ngx-techlify-core.umd.js.map +1 -1
- package/bundles/ngx-techlify-core.umd.min.js +1 -16
- package/bundles/ngx-techlify-core.umd.min.js.map +1 -1
- package/esm2015/lib/base-model/index.js +4 -0
- package/esm2015/lib/base-model/techlify-form-component.class.js +51 -0
- package/esm2015/lib/base-model/techlify-listing-component.class.js +41 -0
- package/esm2015/lib/base-model/techlify-service.class.js +64 -0
- package/esm2015/lib/entity-files/entity-file-form/entity-file-form.component.js +12 -3
- package/esm2015/lib/entity-files/entity-files-view-all.component.js +47 -21
- package/esm2015/lib/entity-files/entity-files-view-all.module.js +6 -2
- package/esm2015/ngx-techlify-core.js +10 -10
- package/esm2015/public-api.js +2 -1
- package/fesm2015/ngx-techlify-core.js +614 -421
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/base-model/index.d.ts +3 -0
- package/lib/base-model/techlify-form-component.class.d.ts +43 -0
- package/lib/base-model/techlify-listing-component.class.d.ts +47 -0
- package/lib/base-model/techlify-service.class.d.ts +52 -0
- package/lib/entity-files/entity-file-form/entity-file-form.component.d.ts +4 -0
- package/lib/entity-files/entity-files-view-all.component.d.ts +11 -4
- package/ngx-techlify-core.d.ts +9 -9
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
|
@@ -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
|
+
}
|
|
@@ -20,6 +20,10 @@ export declare class EntityFileFormComponent implements OnInit {
|
|
|
20
20
|
fileList: any[];
|
|
21
21
|
viewerConfig: ViewerConfig;
|
|
22
22
|
hideTitleAndDetails: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Should we allow tagging entity-files?
|
|
25
|
+
*/
|
|
26
|
+
useTechlifyTags: boolean;
|
|
23
27
|
constructor(dialogRef: MatDialogRef<EntityFileFormComponent>, data: any, formValidatorService: FormValidatorService, fb: FormBuilder, entityFileService: EntityFileService, alertService: AlertService);
|
|
24
28
|
/** Method to create a form **/
|
|
25
29
|
private createForm;
|
|
@@ -2,7 +2,7 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { Location } from '@angular/common';
|
|
3
3
|
import { MatDialog } from '@angular/material/dialog';
|
|
4
4
|
import { EntityFileService } from './entity-file.service';
|
|
5
|
-
import {
|
|
5
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
6
6
|
import { AlertService } from '../core/alert.service';
|
|
7
7
|
import { ViewerConfig } from '../document-viewer/viewer-config.model';
|
|
8
8
|
import { FileDropperConfig } from '../file-dropper';
|
|
@@ -11,26 +11,33 @@ export declare class EntityFilesViewAllComponent implements OnInit {
|
|
|
11
11
|
location: Location;
|
|
12
12
|
private alertService;
|
|
13
13
|
private dialog;
|
|
14
|
+
private fb;
|
|
14
15
|
entityId: number;
|
|
15
16
|
entityType: string;
|
|
16
17
|
viewOnly: boolean;
|
|
17
18
|
removeSearch: boolean;
|
|
18
19
|
hideTitleAndDetails: boolean;
|
|
19
20
|
displayMode: boolean;
|
|
21
|
+
allowMultipleFiles: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Should we allow tagging entity-files?
|
|
24
|
+
*/
|
|
25
|
+
useTechlifyTags: boolean;
|
|
20
26
|
viewerConfig: ViewerConfig;
|
|
21
27
|
title: string;
|
|
22
28
|
filters: any;
|
|
23
29
|
entityFiles: any[];
|
|
24
30
|
displayedColumns: string[];
|
|
25
31
|
isWorking: boolean;
|
|
26
|
-
search: FormControl;
|
|
27
32
|
page: number;
|
|
28
33
|
perPage: number;
|
|
29
34
|
lastPage: number;
|
|
30
35
|
fileConfig: FileDropperConfig;
|
|
31
36
|
fileList: any[];
|
|
32
|
-
|
|
37
|
+
filterFormGroup: FormGroup;
|
|
38
|
+
constructor(entityFileService: EntityFileService, location: Location, alertService: AlertService, dialog: MatDialog, fb: FormBuilder);
|
|
33
39
|
ngOnInit(): void;
|
|
40
|
+
listenRoutes(): void;
|
|
34
41
|
fetchEntityFilesDetails(): Promise<void>;
|
|
35
42
|
addEntityFile(): void;
|
|
36
43
|
editEntityFile(file: any): void;
|
|
@@ -38,7 +45,7 @@ export declare class EntityFilesViewAllComponent implements OnInit {
|
|
|
38
45
|
onScroll(): void;
|
|
39
46
|
reload(): void;
|
|
40
47
|
ngOnDestroy(): void;
|
|
41
|
-
resetFieldValue(): void;
|
|
48
|
+
resetFieldValue(event: any, field: any): void;
|
|
42
49
|
sizeOf(bytes: any): string;
|
|
43
50
|
fileChanged(event: any): Promise<void>;
|
|
44
51
|
}
|
package/ngx-techlify-core.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export { ActionPopupComponent as ɵg } from './lib/action-popup/action-popup.com
|
|
|
6
6
|
export { ActionPopup as ɵh } from './lib/action-popup/action-popup.model';
|
|
7
7
|
export { AlertService as ɵn } from './lib/core/alert.service';
|
|
8
8
|
export { AuthenticationGuard as ɵbg } from './lib/core/authentication.guard';
|
|
9
|
-
export { ConfigService as
|
|
10
|
-
export { CredentialsService as
|
|
9
|
+
export { ConfigService as ɵx } from './lib/core/config.service';
|
|
10
|
+
export { CredentialsService as ɵw } from './lib/core/credentials.service';
|
|
11
11
|
export { DataManager as ɵbv } from './lib/core/dataManager.service';
|
|
12
12
|
export { ErrorHandlerService as ɵbw } from './lib/core/error-handler.service';
|
|
13
13
|
export { FormValidatorService as ɵl } from './lib/core/form-validator.service';
|
|
@@ -16,7 +16,7 @@ export { RouteReusableStrategy as ɵf } from './lib/core/route-reusable-strategy
|
|
|
16
16
|
export { ErrorSnackComponent as ɵc, SuccessSnackComponent as ɵb } from './lib/core/snack/snack.component';
|
|
17
17
|
export { SnackModule as ɵa } from './lib/core/snack/snack.module';
|
|
18
18
|
export { StorageService as ɵcc } from './lib/core/storage.service';
|
|
19
|
-
export { TechlifyConfig as
|
|
19
|
+
export { TechlifyConfig as ɵy } from './lib/core/techlify-config.model';
|
|
20
20
|
export { DataTableComponent as ɵi } from './lib/data-table/data-table.component';
|
|
21
21
|
export { DocumentViewerComponent as ɵj } from './lib/document-viewer/document-viewer.component';
|
|
22
22
|
export { EmailSubscriptionForUserComponent as ɵbk } from './lib/email-subscription/email-subscription-for-user/email-subscription-for-user.component';
|
|
@@ -35,12 +35,12 @@ export { FieldMappingComponent as ɵbx } from './lib/import-csv/field-mapping/fi
|
|
|
35
35
|
export { ImportHistoryListComponent as ɵbz } from './lib/import-csv/import-history-list/import-history-list.component';
|
|
36
36
|
export { ImportSuccessComponent as ɵca } from './lib/import-csv/import-success/import-success.component';
|
|
37
37
|
export { LoaderComponent as ɵbd } from './lib/loader/loader.component';
|
|
38
|
-
export { CommentFormComponent as
|
|
39
|
-
export { NoteFormComponent as
|
|
40
|
-
export { NoteListComponent as
|
|
41
|
-
export { NoteService as
|
|
42
|
-
export { MatSelectInfiniteScrollDirective as
|
|
43
|
-
export { SearchableSelectorComponent as
|
|
38
|
+
export { CommentFormComponent as ɵv } from './lib/note/comment-form/comment-form.component';
|
|
39
|
+
export { NoteFormComponent as ɵu } from './lib/note/note-form/note-form.component';
|
|
40
|
+
export { NoteListComponent as ɵs } from './lib/note/note-list/note-list.component';
|
|
41
|
+
export { NoteService as ɵt } from './lib/note/note.service';
|
|
42
|
+
export { MatSelectInfiniteScrollDirective as ɵr } from './lib/searchable-selector/mat-select-infinite-scroll.directive';
|
|
43
|
+
export { SearchableSelectorComponent as ɵq } from './lib/searchable-selector/searchable-selector.component';
|
|
44
44
|
export { OnOffSwitchComponent as ɵce } from './lib/techlify-feature/on-off-switch/on-off-switch.component';
|
|
45
45
|
export { TechlifyFeatureService as ɵcd } from './lib/techlify-feature/techlify-feature.service';
|
|
46
46
|
export { TechlifyUpdateFormComponent as ɵbp } from './lib/techlify-update/techlify-update-form/techlify-update-form.component';
|