ngx-techlify-core 18.71.0 → 18.72.1
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/access-control-config/access-control-config.component.mjs +1 -3
- package/esm2022/lib/app-admin/admin-role/admin-role-list/admin-role-list.component.mjs +2 -3
- package/esm2022/lib/app-admin/tenant/tenant-list-widget/tenant-list-widget.component.mjs +1 -3
- package/esm2022/lib/audit-log/audit-log-list/audit-log-list.component.mjs +2 -3
- package/esm2022/lib/base-model/index.mjs +3 -3
- package/esm2022/lib/base-model/techlify-form.component.mjs +132 -0
- package/esm2022/lib/base-model/{techlify-list-component.mjs → techlify-list.component.mjs} +2 -2
- package/esm2022/lib/data-table/data-table.component.mjs +4 -4
- package/esm2022/lib/email-subscription/email-subscription-for-user/email-subscription-for-user.component.mjs +6 -9
- package/esm2022/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.component.mjs +3 -3
- package/esm2022/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list.component.mjs +3 -3
- package/esm2022/lib/entity-files/entity-files-view-all.component.mjs +1 -2
- package/esm2022/lib/export-excel/export-excel-button/export-excel-button.component.mjs +36 -3
- package/esm2022/lib/import-csv/import-history-list/import-history-list.component.mjs +3 -3
- package/esm2022/lib/locked-date/locked-dates-list/locked-date-list.component.mjs +1 -2
- package/esm2022/lib/login-history-for-user/login-history-for-user.component.mjs +3 -3
- package/esm2022/lib/restrictors/restrictors-list-page/restrictors-list-page.component.mjs +1 -2
- package/esm2022/lib/searchable-selector/searchable-selector.component.mjs +2 -2
- package/esm2022/lib/subscription/subscription-form/subscription-form.component.mjs +2 -2
- package/esm2022/lib/subscription/subscription-listing/subscription-listing.component.mjs +2 -3
- package/esm2022/lib/subscription/subscription-package-listing/subscription-package-listing.component.mjs +2 -3
- package/esm2022/lib/tag/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.component.mjs +3 -3
- package/esm2022/lib/techlify-auto-complete-select/techlify-auto-complete-select.component.mjs +2 -7
- package/esm2022/lib/techlify-currency-pipe/techlify-currency-pipe.directive.mjs +27 -0
- package/esm2022/lib/techlify-feature/techlify-feature-listing.component.mjs +1 -3
- package/esm2022/lib/techlify-feature/techlify-feature.service.mjs +2 -2
- package/esm2022/lib/techlify-notifications/techlify-notification-for-user/techlify-notification-for-user.component.mjs +1 -2
- package/esm2022/lib/techlify-update/techlify-update-history/techlify-update-history.component.mjs +2 -3
- package/esm2022/lib/techlify-update/techlify-updates-list/techlify-updates-list.component.mjs +1 -3
- package/esm2022/lib/techlify-update/techlify-updates-teaser/techlify-updates-teaser.component.mjs +2 -3
- package/esm2022/lib/techlify-view/my-techlify-view-listing/my-techlify-view-listing.component.mjs +2 -2
- package/esm2022/lib/techlify-view/techlify-view-form/techlify-view-form.component.mjs +2 -2
- package/esm2022/lib/timeline-activity/timeline-activity-list/timeline-activity-list.component.mjs +1 -2
- package/esm2022/lib/user/users-view-all.component.mjs +2 -3
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/ngx-techlify-core.mjs +136 -100
- package/fesm2022/ngx-techlify-core.mjs.map +1 -1
- package/lib/access-control-config/access-control-config.component.d.ts +0 -1
- package/lib/app-admin/admin-role/admin-role-list/admin-role-list.component.d.ts +1 -1
- package/lib/base-model/index.d.ts +2 -2
- package/lib/base-model/{techlify-form-component.d.ts → techlify-form.component.d.ts} +1 -0
- package/lib/email-subscription/email-subscription-for-user/email-subscription-for-user.component.d.ts +1 -2
- package/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.component.d.ts +1 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list.component.d.ts +1 -2
- package/lib/export-excel/export-excel-button/export-excel-button.component.d.ts +4 -1
- package/lib/import-csv/import-history-list/import-history-list.component.d.ts +1 -2
- package/lib/login-history-for-user/login-history-for-user.component.d.ts +1 -2
- package/lib/subscription/subscription-form/subscription-form.component.d.ts +1 -1
- package/lib/subscription/subscription-listing/subscription-listing.component.d.ts +1 -1
- package/lib/subscription/subscription-package-listing/subscription-package-listing.component.d.ts +1 -1
- package/lib/techlify-auto-complete-select/techlify-auto-complete-select.component.d.ts +1 -2
- package/lib/techlify-currency-pipe/techlify-currency-pipe.directive.d.ts +8 -0
- package/lib/techlify-feature/techlify-feature-listing.component.d.ts +0 -1
- package/lib/techlify-update/techlify-update-history/techlify-update-history.component.d.ts +1 -1
- package/lib/techlify-update/techlify-updates-list/techlify-updates-list.component.d.ts +0 -1
- package/lib/techlify-view/my-techlify-view-listing/my-techlify-view-listing.component.d.ts +1 -1
- package/lib/techlify-view/techlify-view-form/techlify-view-form.component.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/esm2022/lib/base-model/techlify-form-component.mjs +0 -128
- /package/lib/base-model/{techlify-list-component.d.ts → techlify-list.component.d.ts} +0 -0
|
@@ -14,7 +14,6 @@ export declare class AccessControlConfigComponent implements OnInit {
|
|
|
14
14
|
displayedColumns: string[];
|
|
15
15
|
page: number;
|
|
16
16
|
lastPage: number;
|
|
17
|
-
perPage: number;
|
|
18
17
|
isWorking: boolean;
|
|
19
18
|
filterFormGroup: UntypedFormGroup;
|
|
20
19
|
constructor(dialog: MatDialog, alertService: AlertService, fb: UntypedFormBuilder, configService: AccessControlConfigService);
|
|
@@ -4,7 +4,7 @@ import { ActivatedRoute } from '@angular/router';
|
|
|
4
4
|
import { MatDialog } from '@angular/material/dialog';
|
|
5
5
|
import { NgxSpinnerService } from 'ngx-spinner';
|
|
6
6
|
import { AdminRoleService } from '../admin-role.service';
|
|
7
|
-
import { TechlifyListComponent } from '../../../base-model/techlify-list
|
|
7
|
+
import { TechlifyListComponent } from '../../../base-model/techlify-list.component';
|
|
8
8
|
import { FilterService } from '../../../core/filter.service';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
export declare class AdminRoleListComponent extends TechlifyListComponent implements OnInit {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './techlify-form
|
|
2
|
-
export * from './techlify-list
|
|
1
|
+
export * from './techlify-form.component';
|
|
2
|
+
export * from './techlify-list.component';
|
|
3
3
|
export * from './techlify-service';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { HttpService } from '../../core/http.service';
|
|
3
|
-
import { PageEvent } from '../../data-table/data-table.model';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class EmailSubscriptionForUserComponent implements OnInit {
|
|
6
5
|
private http;
|
|
7
6
|
subscriptions: any[];
|
|
8
|
-
pageEvent:
|
|
7
|
+
pageEvent: any;
|
|
9
8
|
filters: any;
|
|
10
9
|
constructor(http: HttpService);
|
|
11
10
|
ngOnInit(): void;
|
|
@@ -2,14 +2,13 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { MatDialog } from '@angular/material/dialog';
|
|
3
3
|
import { UntypedFormControl } from '@angular/forms';
|
|
4
4
|
import { MatSort } from '@angular/material/sort';
|
|
5
|
-
import { PageEvent } from '../../../data-table/data-table.model';
|
|
6
5
|
import { HttpService } from '../../../core/http.service';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
export declare class EmailSubscriptionTypeListComponent implements OnInit {
|
|
9
8
|
private dialog;
|
|
10
9
|
private http;
|
|
11
10
|
emailSubscriptionTypeList: any[];
|
|
12
|
-
pageEvent:
|
|
11
|
+
pageEvent: any;
|
|
13
12
|
filters: any;
|
|
14
13
|
search: UntypedFormControl;
|
|
15
14
|
sort: MatSort;
|
|
@@ -3,7 +3,6 @@ import { MatDialog } from '@angular/material/dialog';
|
|
|
3
3
|
import { UntypedFormControl } from '@angular/forms';
|
|
4
4
|
import { MatSort } from '@angular/material/sort';
|
|
5
5
|
import { Router } from '@angular/router';
|
|
6
|
-
import { PageEvent } from '../../../data-table/data-table.model';
|
|
7
6
|
import { HttpService } from '../../../core/http.service';
|
|
8
7
|
import * as i0 from "@angular/core";
|
|
9
8
|
export declare class EmailSubscriptionUserListComponent implements OnInit {
|
|
@@ -11,7 +10,7 @@ export declare class EmailSubscriptionUserListComponent implements OnInit {
|
|
|
11
10
|
private http;
|
|
12
11
|
private router;
|
|
13
12
|
esUserList: any[];
|
|
14
|
-
pageEvent:
|
|
13
|
+
pageEvent: any;
|
|
15
14
|
filters: any;
|
|
16
15
|
sort: MatSort;
|
|
17
16
|
displayColumns: UntypedFormControl;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OnInit, EventEmitter } from '@angular/core';
|
|
2
|
+
import * as XLSX from 'xlsx';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class ExportExcelButtonComponent implements OnInit {
|
|
4
5
|
isCSV: boolean;
|
|
@@ -6,6 +7,7 @@ export declare class ExportExcelButtonComponent implements OnInit {
|
|
|
6
7
|
fileName: string;
|
|
7
8
|
data: any[];
|
|
8
9
|
tableId: string;
|
|
10
|
+
isParseNumeric: boolean;
|
|
9
11
|
isExportingToExcel: EventEmitter<boolean>;
|
|
10
12
|
isWorking: boolean;
|
|
11
13
|
constructor();
|
|
@@ -13,6 +15,7 @@ export declare class ExportExcelButtonComponent implements OnInit {
|
|
|
13
15
|
exportToExcel(): void;
|
|
14
16
|
convertJSONToExcel(): void;
|
|
15
17
|
convertTableToExcel(): void;
|
|
18
|
+
parseNumeric(ws: XLSX.WorkSheet): void;
|
|
16
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExportExcelButtonComponent, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ExportExcelButtonComponent, "app-export-excel-button", never, { "isCSV": { "alias": "isCSV"; "required": false; }; "iconName": { "alias": "iconName"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; "data": { "alias": "data"; "required": false; }; "tableId": { "alias": "tableId"; "required": false; }; }, { "isExportingToExcel": "isExportingToExcel"; }, never, never, false, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ExportExcelButtonComponent, "app-export-excel-button", never, { "isCSV": { "alias": "isCSV"; "required": false; }; "iconName": { "alias": "iconName"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; "data": { "alias": "data"; "required": false; }; "tableId": { "alias": "tableId"; "required": false; }; "isParseNumeric": { "alias": "isParseNumeric"; "required": false; }; }, { "isExportingToExcel": "isExportingToExcel"; }, never, never, false, never>;
|
|
18
21
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ErrorHandlerService } from './../../core/error-handler.service';
|
|
2
|
-
import { PageEvent } from './../../data-table/data-table.model';
|
|
3
2
|
import { OnInit } from '@angular/core';
|
|
4
3
|
import { ImportCsvConfig } from '../import-csv-config';
|
|
5
4
|
import { HttpService } from '../../core/http.service';
|
|
@@ -12,7 +11,7 @@ export declare class ImportHistoryListComponent implements OnInit {
|
|
|
12
11
|
displayedColumns: string[];
|
|
13
12
|
isWorking: boolean;
|
|
14
13
|
filter: any;
|
|
15
|
-
pageEvent:
|
|
14
|
+
pageEvent: any;
|
|
16
15
|
constructor(errorHandler: ErrorHandlerService, http: HttpService);
|
|
17
16
|
ngOnInit(): void;
|
|
18
17
|
loadData(): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
3
|
-
import { PageEvent } from '../data-table/data-table.model';
|
|
4
3
|
import { HttpService } from '../core/http.service';
|
|
5
4
|
import { TimelineValue } from '../timeline-filter';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
@@ -8,7 +7,7 @@ export declare class LoginHistoryForUserComponent implements OnInit {
|
|
|
8
7
|
private http;
|
|
9
8
|
private fb;
|
|
10
9
|
loginHistoryList: any[];
|
|
11
|
-
pageEvent:
|
|
10
|
+
pageEvent: any;
|
|
12
11
|
filters: any;
|
|
13
12
|
historyFilterForm: UntypedFormGroup;
|
|
14
13
|
displayedColumns: any[];
|
|
@@ -2,7 +2,7 @@ import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
|
2
2
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
3
|
import { UntypedFormBuilder } from '@angular/forms';
|
|
4
4
|
import { SubscriptionService } from '../subscription.service';
|
|
5
|
-
import { TechlifyFormComponent } from '../../base-model/techlify-form
|
|
5
|
+
import { TechlifyFormComponent } from '../../base-model/techlify-form.component';
|
|
6
6
|
import { FormValidatorService } from '../../core/form-validator.service';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class SubscriptionFormComponent extends TechlifyFormComponent implements OnInit {
|
|
@@ -3,7 +3,7 @@ import { UntypedFormBuilder } from '@angular/forms';
|
|
|
3
3
|
import { MatDialog } from '@angular/material/dialog';
|
|
4
4
|
import { SubscriptionService } from '../subscription.service';
|
|
5
5
|
import { SubscriptionStatus } from '../subscription-status.enum';
|
|
6
|
-
import { TechlifyListComponent } from '../../base-model/techlify-list
|
|
6
|
+
import { TechlifyListComponent } from '../../base-model/techlify-list.component';
|
|
7
7
|
import { DatePipe } from '@angular/common';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export declare class SubscriptionListingComponent extends TechlifyListComponent implements OnInit {
|
package/lib/subscription/subscription-package-listing/subscription-package-listing.component.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { SubscriptionPackageService } from '../subscription-package.service';
|
|
3
3
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
4
|
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
5
|
-
import { TechlifyListComponent } from '../../base-model/techlify-list
|
|
5
|
+
import { TechlifyListComponent } from '../../base-model/techlify-list.component';
|
|
6
6
|
import { FilterService } from '../../core/filter.service';
|
|
7
7
|
import { MatDialog } from '@angular/material/dialog';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
@@ -12,7 +12,6 @@ export declare class TechlifyAutoCompleteSelectComponent implements OnInit, OnDe
|
|
|
12
12
|
titleField: string;
|
|
13
13
|
valueField: string;
|
|
14
14
|
placeholder: string;
|
|
15
|
-
perPage: number;
|
|
16
15
|
sortBy: string;
|
|
17
16
|
displaySelectedDir: 'column' | 'row';
|
|
18
17
|
options: any[];
|
|
@@ -46,6 +45,6 @@ export declare class TechlifyAutoCompleteSelectComponent implements OnInit, OnDe
|
|
|
46
45
|
registerOnChange(fn: any): void;
|
|
47
46
|
registerOnTouched(fn: any): void;
|
|
48
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyAutoCompleteSelectComponent, never>;
|
|
49
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TechlifyAutoCompleteSelectComponent, "app-techlify-auto-complete-select", never, { "service": { "alias": "service"; "required": false; }; "titleField": { "alias": "titleField"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TechlifyAutoCompleteSelectComponent, "app-techlify-auto-complete-select", never, { "service": { "alias": "service"; "required": false; }; "titleField": { "alias": "titleField"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "sortBy": { "alias": "sortBy"; "required": false; }; "displaySelectedDir": { "alias": "displaySelectedDir"; "required": false; }; "options": { "alias": "options"; "required": false; }; "selectedItems": { "alias": "selectedItems"; "required": false; }; "isAllowDynamicOptionsAdd": { "alias": "isAllowDynamicOptionsAdd"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, { "selectedItemsChange": "selectedItemsChange"; }, ["itemTemplate", "selectedTemplate"], never, true, never>;
|
|
50
49
|
}
|
|
51
50
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TechlifyCurrencyPipe implements PipeTransform {
|
|
4
|
+
private readonly currencyPipe;
|
|
5
|
+
transform(value: number | null | undefined, isExporting?: boolean, currencyCode?: string, display?: 'symbol' | 'code' | 'symbol-narrow', digitsInfo?: string, locale?: string): string | number;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyCurrencyPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TechlifyCurrencyPipe, "techlifyCurrency", true>;
|
|
8
|
+
}
|
|
@@ -15,7 +15,6 @@ export declare class TechlifyFeatureListingComponent implements OnInit {
|
|
|
15
15
|
displayedColumns: string[];
|
|
16
16
|
page: number;
|
|
17
17
|
lastPage: number;
|
|
18
|
-
perPage: number;
|
|
19
18
|
isWorking: boolean;
|
|
20
19
|
filterFormGroup: UntypedFormGroup;
|
|
21
20
|
featureToggleForm: UntypedFormGroup;
|
|
@@ -14,7 +14,7 @@ export declare class TechlifyUpdateHistoryComponent implements OnInit {
|
|
|
14
14
|
displayedColumns: string[];
|
|
15
15
|
page: number;
|
|
16
16
|
lastPage: number;
|
|
17
|
-
|
|
17
|
+
per_page: number;
|
|
18
18
|
isWorking: boolean;
|
|
19
19
|
filterFormGroup: UntypedFormGroup;
|
|
20
20
|
constructor(dialog: MatDialog, techlifyUpdateService: TechlifyUpdateService, fb: UntypedFormBuilder, alertService: AlertService);
|
|
@@ -14,7 +14,6 @@ export declare class TechlifyUpdatesListComponent implements OnInit {
|
|
|
14
14
|
displayedColumns: string[];
|
|
15
15
|
page: number;
|
|
16
16
|
lastPage: number;
|
|
17
|
-
perPage: number;
|
|
18
17
|
isWorking: boolean;
|
|
19
18
|
filterFormGroup: UntypedFormGroup;
|
|
20
19
|
constructor(dialog: MatDialog, alertService: AlertService, techlifyUpdateService: TechlifyUpdateService, fb: UntypedFormBuilder);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OnInit, EventEmitter } from '@angular/core';
|
|
2
2
|
import { MyTechlifyViewService } from './my-techlify-view.service';
|
|
3
3
|
import { MatDialog } from '@angular/material/dialog';
|
|
4
|
-
import { TechlifyListComponent } from '../../base-model/techlify-list
|
|
4
|
+
import { TechlifyListComponent } from '../../base-model/techlify-list.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class MyTechlifyViewListingComponent extends TechlifyListComponent implements OnInit {
|
|
7
7
|
private myTechlifyViewService;
|
|
@@ -2,7 +2,7 @@ import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
|
2
2
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
3
|
import { UntypedFormBuilder } from '@angular/forms';
|
|
4
4
|
import { TechlifyViewService } from '../techlify-view.service';
|
|
5
|
-
import { TechlifyFormComponent } from '../../base-model/techlify-form
|
|
5
|
+
import { TechlifyFormComponent } from '../../base-model/techlify-form.component';
|
|
6
6
|
import { FormValidatorService } from '../../core/form-validator.service';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class TechlifyViewFormComponent extends TechlifyFormComponent implements OnInit {
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -201,3 +201,4 @@ export * from './lib/tag/techlify-tagger-tag-list/techlify-tagger-tag-list.compo
|
|
|
201
201
|
export * from './lib/tag/techlify-tagger-tag-form/techlify-tagger-tag-form.component';
|
|
202
202
|
export * from './lib/tag/tag.service';
|
|
203
203
|
export * from './lib/techlify-auto-complete-select/techlify-auto-complete-select.component';
|
|
204
|
+
export * from './lib/techlify-currency-pipe/techlify-currency-pipe.directive';
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { Directive, EventEmitter, inject, Input, Optional, Output } from '@angular/core';
|
|
2
|
-
import { finalize } from 'rxjs';
|
|
3
|
-
import { AlertService } from '../core/alert.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "../core/form-validator.service";
|
|
6
|
-
import * as i2 from "./techlify-service";
|
|
7
|
-
/**
|
|
8
|
-
* Interface used to ensure we have a consistent structure across our form components
|
|
9
|
-
*
|
|
10
|
-
* It also provides some abstraction of repeated code to reduce our codebase size
|
|
11
|
-
*
|
|
12
|
-
* @todo This should be moved to ngx-techlify-core
|
|
13
|
-
*
|
|
14
|
-
* Advantages of this abstract class
|
|
15
|
-
* - Less code, less maintenance, less bugs
|
|
16
|
-
* - more consistent code
|
|
17
|
-
* - comments on more code
|
|
18
|
-
* - save time, save energy
|
|
19
|
-
*/
|
|
20
|
-
export class TechlifyFormComponent {
|
|
21
|
-
constructor(formValidatorService, service) {
|
|
22
|
-
this.formValidatorService = formValidatorService;
|
|
23
|
-
this.service = service;
|
|
24
|
-
//Boolean to denote the form is in API progress
|
|
25
|
-
this.isWorking = false;
|
|
26
|
-
//Array of created multiple entries
|
|
27
|
-
this.createdEntries = [];
|
|
28
|
-
//Boolean to denote if form is in update mode
|
|
29
|
-
this.isUpdate = false;
|
|
30
|
-
//Boolean to denote if form has ability to create multiple entries
|
|
31
|
-
this.isAllowCreateAnother = true;
|
|
32
|
-
//Emits an event once form submit is success
|
|
33
|
-
this.success = new EventEmitter();
|
|
34
|
-
//Injected alert service
|
|
35
|
-
this.alertService = inject(AlertService, { optional: true });
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Submits the form
|
|
39
|
-
* @param model form model optional, if needed to be overriden
|
|
40
|
-
* @returns
|
|
41
|
-
*/
|
|
42
|
-
submit(model) {
|
|
43
|
-
this.form.markAllAsTouched();
|
|
44
|
-
if (!this.service) {
|
|
45
|
-
throw new Error(`${this.constructor.name}: Service is required to submit the form`);
|
|
46
|
-
}
|
|
47
|
-
if (!this.form.valid) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (!model) {
|
|
51
|
-
model = this.form.value;
|
|
52
|
-
}
|
|
53
|
-
this.isWorking = true;
|
|
54
|
-
(this.isUpdate ?
|
|
55
|
-
this.service.update(model) :
|
|
56
|
-
this.service.store(model))
|
|
57
|
-
.pipe(finalize(() => this.isWorking = false))
|
|
58
|
-
.subscribe((res) => {
|
|
59
|
-
this.createdEntries.unshift(res?.item);
|
|
60
|
-
if (model?.is_create_another) {
|
|
61
|
-
this.alertService.addAlert('Successfully Created', 'success');
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (this.isUpdate) {
|
|
65
|
-
this.success.emit(res?.item);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
this.success.emit((this.createdEntries.length == 1) ? this.createdEntries[0] : this.createdEntries);
|
|
69
|
-
}
|
|
70
|
-
if (this.dialogRef) {
|
|
71
|
-
this.dialogRef.close(res.item);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Close the active dialog
|
|
77
|
-
*/
|
|
78
|
-
closeDialog() {
|
|
79
|
-
if (this.createdEntries?.length > 0) {
|
|
80
|
-
this.success.emit(this.createdEntries);
|
|
81
|
-
}
|
|
82
|
-
this.dialogRef.close();
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Resets the value of a field in the HTML form
|
|
86
|
-
*
|
|
87
|
-
* @param event
|
|
88
|
-
* @param field
|
|
89
|
-
*/
|
|
90
|
-
resetFieldValue(event, field) {
|
|
91
|
-
this.form?.get(field)?.setValue('');
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Retrieves the value of a field from the HTML form
|
|
95
|
-
*
|
|
96
|
-
* @param field
|
|
97
|
-
* @returns
|
|
98
|
-
*/
|
|
99
|
-
getFieldValue(field) {
|
|
100
|
-
return this.form?.get(field)?.value;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Method to evaluate form fields
|
|
104
|
-
* */
|
|
105
|
-
isFieldValid(field) {
|
|
106
|
-
return this.formValidatorService.isFieldValid(field, this.form);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Method to find error in form fields
|
|
110
|
-
* */
|
|
111
|
-
getErrorMessage(field) {
|
|
112
|
-
return this.formValidatorService.getErrorMessage(field, this.form, this.errorMessages);
|
|
113
|
-
}
|
|
114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TechlifyFormComponent, deps: [{ token: i1.FormValidatorService }, { token: i2.TechlifyService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
115
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TechlifyFormComponent, inputs: { isUpdate: "isUpdate", isAllowCreateAnother: "isAllowCreateAnother" }, outputs: { success: "success" }, ngImport: i0 }); }
|
|
116
|
-
}
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TechlifyFormComponent, decorators: [{
|
|
118
|
-
type: Directive
|
|
119
|
-
}], ctorParameters: () => [{ type: i1.FormValidatorService }, { type: i2.TechlifyService, decorators: [{
|
|
120
|
-
type: Optional
|
|
121
|
-
}] }], propDecorators: { isUpdate: [{
|
|
122
|
-
type: Input
|
|
123
|
-
}], isAllowCreateAnother: [{
|
|
124
|
-
type: Input
|
|
125
|
-
}], success: [{
|
|
126
|
-
type: Output
|
|
127
|
-
}] } });
|
|
128
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVjaGxpZnktZm9ybS1jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdGVjaGxpZnktY29yZS9zcmMvbGliL2Jhc2UtbW9kZWwvdGVjaGxpZnktZm9ybS1jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRXpGLE9BQU8sRUFBRSxRQUFRLEVBQU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