@unifylib/ui-lib 1.0.3 → 1.1.3
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/ng-package.json +7 -7
- package/package.json +14 -12
- package/src/lib/base-model/SearchStrConfig.ts +12 -12
- package/src/lib/base-model/api-response.ts +23 -23
- package/src/lib/base-model/audit-log-entry.ts +7 -7
- package/src/lib/base-model/button-action-settings.ts +29 -25
- package/src/lib/base-model/column-def.model.ts +34 -34
- package/src/lib/base-model/do-action-request.ts +11 -11
- package/src/lib/base-model/feature-item.ts +9 -0
- package/src/lib/base-model/field-action.ts +7 -7
- package/src/lib/base-model/field-filter.model.ts +7 -14
- package/src/lib/base-model/field-info.ts +102 -98
- package/src/lib/base-model/field-predicate.model.ts +7 -7
- package/src/lib/base-model/filter-request.ts +27 -27
- package/src/lib/base-model/filter.model.ts +49 -49
- package/src/lib/base-model/get-items-list.ts +24 -24
- package/src/lib/base-model/index.ts +11 -11
- package/src/lib/base-model/items-total.model.ts +12 -0
- package/src/lib/base-model/line-item.model.ts +18 -0
- package/src/lib/base-model/lookupItem.ts +21 -21
- package/src/lib/base-model/null-snackmessage.ts +9 -9
- package/src/lib/base-model/page-info.ts +54 -51
- package/src/lib/base-model/report-request.model.ts +33 -33
- package/src/lib/base-model/response-envelop.model.ts +15 -15
- package/src/lib/base-model/snack-message.model.ts +14 -14
- package/src/lib/base-model/snackmessage-interface.ts +7 -7
- package/src/lib/base-model/table-column.interface.ts +29 -29
- package/src/lib/base-model/table-page-user-action.interface.ts +33 -33
- package/src/lib/base-model/workflow/workflow-steps.model.ts +9 -9
- package/src/lib/base-model/workflow/workflow.model.ts +52 -52
- package/src/lib/components/action-comment/action-comment.component.css +52 -0
- package/src/lib/components/action-comment/action-comment.component.html +47 -0
- package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.spec.ts +23 -23
- package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.ts +102 -86
- package/src/lib/components/action-confirmation/action-confirmation.component.css +46 -34
- package/src/lib/components/action-confirmation/action-confirmation.component.html +32 -18
- package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +23 -23
- package/src/lib/components/action-confirmation/action-confirmation.component.ts +58 -58
- package/src/lib/components/activity-report-form/activity-report-form.component.html +110 -109
- package/src/lib/components/activity-report-form/activity-report-form.component.scss +69 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +25 -25
- package/src/lib/components/activity-report-form/activity-report-form.component.ts +616 -605
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.html +8 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.scss +0 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.spec.ts +25 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.ts +55 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.html +36 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.scss +130 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.spec.ts +25 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.ts +186 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +51 -51
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +23 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +23 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +69 -69
- package/src/lib/components/audit-log-list/audit-log.component.html +26 -23
- package/src/lib/components/audit-log-list/audit-log.component.scss +50 -0
- package/src/lib/components/audit-log-list/audit-log.component.spec.ts +25 -25
- package/src/lib/components/audit-log-list/audit-log.component.ts +114 -116
- package/src/lib/components/auto-complete/auto-complete.component.css +55 -14
- package/src/lib/components/auto-complete/auto-complete.component.html +45 -29
- package/src/lib/components/auto-complete/auto-complete.component.spec.ts +23 -23
- package/src/lib/components/auto-complete/auto-complete.component.ts +331 -330
- package/src/lib/components/base-form/base-form.component.html +59 -58
- package/src/lib/components/base-form/base-form.component.scss +68 -0
- package/src/lib/components/base-form/base-form.component.spec.ts +25 -25
- package/src/lib/components/base-form/base-form.component.ts +323 -305
- package/src/lib/components/base-form-canvas/base-form-canvas.component.css +196 -22
- package/src/lib/components/base-form-canvas/base-form-canvas.component.html +1095 -1006
- package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +23 -23
- package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +680 -573
- package/src/lib/components/base-input-dialog/base-input-dialog.component.css +67 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.html +47 -42
- package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +23 -23
- package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +77 -78
- package/src/lib/components/base-table/base-table.component.html +268 -242
- package/src/lib/components/base-table/base-table.component.scss +140 -31
- package/src/lib/components/base-table/base-table.component.spec.ts +25 -25
- package/src/lib/components/base-table/base-table.component.ts +621 -568
- package/src/lib/components/button-actions/button-actions.component.html +27 -28
- package/src/lib/components/button-actions/button-actions.component.scss +101 -6
- package/src/lib/components/button-actions/button-actions.component.spec.ts +23 -23
- package/src/lib/components/button-actions/button-actions.component.ts +70 -72
- package/src/lib/components/editable-base-table/editable-base-table.component.html +337 -372
- package/src/lib/components/editable-base-table/editable-base-table.component.scss +126 -44
- package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +25 -25
- package/src/lib/components/editable-base-table/editable-base-table.component.ts +579 -570
- package/src/lib/components/equation-builder/equation-builder.component.css +39 -0
- package/src/lib/components/equation-builder/equation-builder.component.html +31 -31
- package/src/lib/components/equation-builder/equation-builder.component.spec.ts +23 -23
- package/src/lib/components/equation-builder/equation-builder.component.ts +119 -121
- package/src/lib/components/item-line-editor/item-line-editor.component.html +102 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.scss +152 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.spec.ts +23 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.ts +306 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +19 -11
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +38 -38
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +23 -23
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +315 -317
- package/src/lib/components/paginator/paginator.component.css +65 -25
- package/src/lib/components/paginator/paginator.component.html +30 -34
- package/src/lib/components/paginator/paginator.component.ts +87 -94
- package/src/lib/components/report-details-dialog/report-details-dialog.component.css +17 -17
- package/src/lib/components/report-details-dialog/report-details-dialog.component.html +16 -16
- package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +23 -23
- package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +111 -113
- package/src/lib/components/report-form/report-form.component.html +92 -94
- package/src/lib/components/report-form/report-form.component.scss +51 -0
- package/src/lib/components/report-form/report-form.component.spec.ts +25 -25
- package/src/lib/components/report-form/report-form.component.ts +599 -588
- package/src/lib/components/search-bar/search-bar.component.html +51 -62
- package/src/lib/components/search-bar/search-bar.component.scss +63 -8
- package/src/lib/components/search-bar/search-bar.component.spec.ts +25 -25
- package/src/lib/components/search-bar/search-bar.component.ts +68 -70
- package/src/lib/components/section-form-canvas/section-form-canvas.component.html +43 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.scss +81 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.spec.ts +23 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.ts +67 -0
- package/src/lib/components/shared/action-button/action-button.component.html +12 -0
- package/src/lib/components/shared/action-button/action-button.component.scss +45 -0
- package/src/lib/components/shared/action-button/action-button.component.ts +51 -0
- package/src/lib/components/shared/action-card/action-card.component.html +78 -0
- package/src/lib/components/shared/action-card/action-card.component.scss +238 -0
- package/src/lib/components/shared/action-card/action-card.component.ts +56 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +135 -54
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +36 -22
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +23 -23
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +71 -45
- package/src/lib/components/shared-list/shared-list.component.html +17 -17
- package/src/lib/components/shared-list/shared-list.component.spec.ts +23 -23
- package/src/lib/components/shared-list/shared-list.component.ts +53 -53
- package/src/lib/components/snackbar-static/snackbar-static.component.html +20 -0
- package/src/lib/components/snackbar-static/snackbar-static.component.scss +135 -0
- package/src/lib/components/snackbar-static/snackbar-static.component.ts +26 -0
- package/src/lib/components/title-bar/title-bar.component.html +35 -31
- package/src/lib/components/title-bar/title-bar.component.scss +126 -23
- package/src/lib/components/title-bar/title-bar.component.spec.ts +23 -23
- package/src/lib/components/title-bar/title-bar.component.ts +126 -119
- package/src/lib/services/backend-service.ts +287 -286
- package/src/lib/services/index.ts +3 -3
- package/src/lib/services/top-panel.ts +17 -17
- package/src/lib/services/trigger-form.service.ts +11 -11
- package/src/lib/share-module/shared-module.ts +10 -10
- package/src/lib/utils/base-utils.ts +102 -102
- package/src/lib/validators/date-range-validator.ts +31 -31
- package/src/lib/validators/index.ts +3 -3
- package/src/lib/validators/match-list.validator.ts +10 -10
- package/src/lib/validators/multi-email-validator.ts +15 -15
- package/src/public-api.ts +29 -21
- package/tsconfig.lib.json +15 -15
- package/tsconfig.lib.prod.json +11 -11
- package/tsconfig.spec.json +15 -15
- package/src/lib/components/rejection-comment/action-comment.component.css +0 -33
- package/src/lib/components/rejection-comment/action-comment.component.html +0 -46
- package/src/lib/styles/invoiceq-theme.scss +0 -252
- package/src/lib/styles/styles.scss +0 -1723
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {Injectable, signal} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Injectable({
|
|
4
|
-
providedIn: 'root'
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export class ShareDataService {
|
|
9
|
-
trigger = signal<boolean>(true);
|
|
10
|
-
enableTrigger = (() => (() => this.trigger.update((val) => val = !val)))
|
|
11
|
-
}
|
|
1
|
+
import {Injectable, signal} from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Injectable({
|
|
4
|
+
providedIn: 'root'
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export class ShareDataService {
|
|
9
|
+
trigger = signal<boolean>(true);
|
|
10
|
+
enableTrigger = (() => (() => this.trigger.update((val) => val = !val)))
|
|
11
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// projects/your-lib/src/lib/shared/shared.module.ts
|
|
2
|
-
import { NgModule } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
// Import other shared modules (e.g., Angular Material modules)
|
|
5
|
-
|
|
6
|
-
@NgModule({
|
|
7
|
-
imports: [CommonModule],
|
|
8
|
-
exports: [CommonModule]
|
|
9
|
-
})
|
|
10
|
-
export class SharedModule { }
|
|
1
|
+
// projects/your-lib/src/lib/shared/shared.module.ts
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
// Import other shared modules (e.g., Angular Material modules)
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [CommonModule]
|
|
9
|
+
})
|
|
10
|
+
export class SharedModule { }
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import {FieldInfo, EMPTY_PAGE_INFO, PageInfo, FilterRequest, SAVE_AND_COMPLETE} from "../base-model";
|
|
2
|
-
import {APPROVE, NEW, SAVE} from "../base-model/do-action-request";
|
|
3
|
-
import {Validators} from "@angular/forms";
|
|
4
|
-
|
|
5
|
-
export class BaseUtils {
|
|
6
|
-
|
|
7
|
-
pageInfo: PageInfo = EMPTY_PAGE_INFO;
|
|
8
|
-
|
|
9
|
-
labelKey(column: any) {
|
|
10
|
-
if (column.type === 'workflowStatus') {
|
|
11
|
-
return 'INVENTORY.workflowStatus'
|
|
12
|
-
}
|
|
13
|
-
if (!column.property.length) {
|
|
14
|
-
return "";
|
|
15
|
-
}
|
|
16
|
-
const configuredKey = column.label ? column.label : column.property
|
|
17
|
-
return configuredKey.startsWith(this.pageInfo.labelsSection) ? `${configuredKey}` : `${this.pageInfo.labelsSection}.${configuredKey}`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
labelKeyByValue(column: any, element) {
|
|
21
|
-
if (!column.property.length) {
|
|
22
|
-
return "";
|
|
23
|
-
}
|
|
24
|
-
return `${this.pageInfo.labelsSection}.${element[column.property]}`
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
formatTimeToDate(v: any){
|
|
28
|
-
const fromTime: Date = new Date();
|
|
29
|
-
if (v) {
|
|
30
|
-
let split = v.split(":");
|
|
31
|
-
fromTime.setHours(split[0], split[1]);
|
|
32
|
-
}
|
|
33
|
-
return new Date(fromTime.getTime());
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function buildFormFields(fields: FieldInfo[], item:any){
|
|
38
|
-
let fieldsControls: string[] = [];
|
|
39
|
-
for (let field of fields) {
|
|
40
|
-
if (field.type !== 'spacer') {
|
|
41
|
-
const emptyValue = field.type === 'lookup' || field.type === 'multi-select' ? null : '';
|
|
42
|
-
const extractedValue = item ? extractFieldName(item, field.property) : undefined;
|
|
43
|
-
const validators = field.required
|
|
44
|
-
? [...(field.validators || []), Validators.required]
|
|
45
|
-
: field.validators || [];
|
|
46
|
-
|
|
47
|
-
fieldsControls[field.property] = extractedValue !== undefined && extractedValue !== null
|
|
48
|
-
? [extractedValue, validators]
|
|
49
|
-
: [
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return fieldsControls;
|
|
53
|
-
}
|
|
54
|
-
export function buildItemsList(searchStr: string, apiPath?: string, cascadedByProperty?:string){
|
|
55
|
-
const filterRequest : FilterRequest = new FilterRequest();
|
|
56
|
-
// return {
|
|
57
|
-
filterRequest.apiUri = cascadedByProperty ? `${apiPath}/${cascadedByProperty}` :apiPath;
|
|
58
|
-
filterRequest.searchStr= searchStr
|
|
59
|
-
filterRequest.pageIndex = 0;
|
|
60
|
-
filterRequest.pageSize= 10;
|
|
61
|
-
filterRequest.sortKey= 'id';
|
|
62
|
-
filterRequest.sortDirection = "DESC" as const;
|
|
63
|
-
// }
|
|
64
|
-
return filterRequest;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function extractFieldName(element: any, property: string) {
|
|
68
|
-
if (property.includes('.')) {
|
|
69
|
-
return property.split('.').reduce((acc, part) => acc && acc[part], element);
|
|
70
|
-
} else {
|
|
71
|
-
return element[property];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function getPositiveWfActionKey(stateType: any) {
|
|
76
|
-
if (stateType === "COMPLETED") {
|
|
77
|
-
return "save";
|
|
78
|
-
} else if (stateType === "PENDING" || stateType === "NEW") {
|
|
79
|
-
return "approve";
|
|
80
|
-
}
|
|
81
|
-
return "save";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function getNegativeWfActionKey(stateType: any) {
|
|
85
|
-
if (stateType === "COMPLETED" ) {
|
|
86
|
-
return "cancel";
|
|
87
|
-
} else if (stateType === "PENDING"|| stateType === "NEW") {
|
|
88
|
-
return "reject";
|
|
89
|
-
}
|
|
90
|
-
return "cancel";
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function getWfActionId(stateType) {
|
|
94
|
-
let actionId = NEW;
|
|
95
|
-
if (stateType === "COMPLETED") {
|
|
96
|
-
actionId = SAVE;
|
|
97
|
-
} else if (stateType === "PENDING" || stateType === "NEW") {
|
|
98
|
-
actionId = APPROVE;
|
|
99
|
-
}
|
|
100
|
-
return actionId;
|
|
101
|
-
}
|
|
102
|
-
|
|
1
|
+
import {FieldInfo, EMPTY_PAGE_INFO, PageInfo, FilterRequest, SAVE_AND_COMPLETE} from "../base-model";
|
|
2
|
+
import {APPROVE, NEW, SAVE} from "../base-model/do-action-request";
|
|
3
|
+
import {Validators} from "@angular/forms";
|
|
4
|
+
|
|
5
|
+
export class BaseUtils {
|
|
6
|
+
|
|
7
|
+
pageInfo: PageInfo = EMPTY_PAGE_INFO;
|
|
8
|
+
|
|
9
|
+
labelKey(column: any) {
|
|
10
|
+
if (column.type === 'workflowStatus') {
|
|
11
|
+
return 'INVENTORY.workflowStatus'
|
|
12
|
+
}
|
|
13
|
+
if (!column.property.length) {
|
|
14
|
+
return "";
|
|
15
|
+
}
|
|
16
|
+
const configuredKey = column.label ? column.label : column.property
|
|
17
|
+
return configuredKey.startsWith(this.pageInfo.labelsSection) ? `${configuredKey}` : `${this.pageInfo.labelsSection}.${configuredKey}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
labelKeyByValue(column: any, element) {
|
|
21
|
+
if (!column.property.length) {
|
|
22
|
+
return "";
|
|
23
|
+
}
|
|
24
|
+
return `${this.pageInfo.labelsSection}.${element[column.property]}`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
formatTimeToDate(v: any){
|
|
28
|
+
const fromTime: Date = new Date();
|
|
29
|
+
if (v) {
|
|
30
|
+
let split = v.split(":");
|
|
31
|
+
fromTime.setHours(split[0], split[1]);
|
|
32
|
+
}
|
|
33
|
+
return new Date(fromTime.getTime());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function buildFormFields(fields: FieldInfo[], item:any){
|
|
38
|
+
let fieldsControls: string[] = [];
|
|
39
|
+
for (let field of fields) {
|
|
40
|
+
if (field.type !== 'spacer') {
|
|
41
|
+
const emptyValue = field.type === 'lookup' || field.type === 'multi-select' ? null : '';
|
|
42
|
+
const extractedValue = item ? extractFieldName(item, field.property) : undefined;
|
|
43
|
+
const validators = field.required
|
|
44
|
+
? [...(field.validators || []), Validators.required]
|
|
45
|
+
: field.validators || [];
|
|
46
|
+
|
|
47
|
+
fieldsControls[field.property] = extractedValue !== undefined && extractedValue !== null
|
|
48
|
+
? [extractedValue, validators]
|
|
49
|
+
: [emptyValue, validators];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return fieldsControls;
|
|
53
|
+
}
|
|
54
|
+
export function buildItemsList(searchStr: string, apiPath?: string, cascadedByProperty?:string){
|
|
55
|
+
const filterRequest : FilterRequest = new FilterRequest();
|
|
56
|
+
// return {
|
|
57
|
+
filterRequest.apiUri = cascadedByProperty ? `${apiPath}/${cascadedByProperty}` :apiPath;
|
|
58
|
+
filterRequest.searchStr= searchStr
|
|
59
|
+
filterRequest.pageIndex = 0;
|
|
60
|
+
filterRequest.pageSize= 10;
|
|
61
|
+
filterRequest.sortKey= 'id';
|
|
62
|
+
filterRequest.sortDirection = "DESC" as const;
|
|
63
|
+
// }
|
|
64
|
+
return filterRequest;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function extractFieldName(element: any, property: string) {
|
|
68
|
+
if (property.includes('.')) {
|
|
69
|
+
return property.split('.').reduce((acc, part) => acc && acc[part], element);
|
|
70
|
+
} else {
|
|
71
|
+
return element[property];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function getPositiveWfActionKey(stateType: any) {
|
|
76
|
+
if (stateType === "COMPLETED") {
|
|
77
|
+
return "save";
|
|
78
|
+
} else if (stateType === "PENDING" || stateType === "NEW") {
|
|
79
|
+
return "approve";
|
|
80
|
+
}
|
|
81
|
+
return "save";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function getNegativeWfActionKey(stateType: any) {
|
|
85
|
+
if (stateType === "COMPLETED" ) {
|
|
86
|
+
return "cancel";
|
|
87
|
+
} else if (stateType === "PENDING"|| stateType === "NEW") {
|
|
88
|
+
return "reject";
|
|
89
|
+
}
|
|
90
|
+
return "cancel";
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function getWfActionId(stateType) {
|
|
94
|
+
let actionId = NEW;
|
|
95
|
+
if (stateType === "COMPLETED") {
|
|
96
|
+
actionId = SAVE;
|
|
97
|
+
} else if (stateType === "PENDING" || stateType === "NEW") {
|
|
98
|
+
actionId = APPROVE;
|
|
99
|
+
}
|
|
100
|
+
return actionId;
|
|
101
|
+
}
|
|
102
|
+
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AbstractControl, ValidationErrors, FormArray, FormGroup } from '@angular/forms';
|
|
2
|
-
|
|
3
|
-
export function DateRangeValidator(group: AbstractControl): ValidationErrors | null {
|
|
4
|
-
let fromDateControl: AbstractControl | null = null;
|
|
5
|
-
let toDateControl: AbstractControl | null = null;
|
|
6
|
-
|
|
7
|
-
if (group.parent instanceof FormGroup && group.parent.parent instanceof FormArray) {
|
|
8
|
-
const formGroup = group.parent;
|
|
9
|
-
fromDateControl = formGroup.get('fromDate');
|
|
10
|
-
toDateControl = formGroup.get('toDate');
|
|
11
|
-
} else {
|
|
12
|
-
fromDateControl = group.root.get('fromDate');
|
|
13
|
-
toDateControl = group.root.get('toDate');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (fromDateControl && toDateControl) {
|
|
17
|
-
const fromDateValue = fromDateControl.value;
|
|
18
|
-
const toDateValue = toDateControl.value;
|
|
19
|
-
|
|
20
|
-
if (fromDateValue && toDateValue) {
|
|
21
|
-
const fromDate = new Date(fromDateValue);
|
|
22
|
-
const toDate = new Date(toDateValue);
|
|
23
|
-
|
|
24
|
-
if (fromDate > toDate) {
|
|
25
|
-
return { dateRangeInvalid: 'Invalid Date Range: To date must be after from date' };
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
1
|
+
import { AbstractControl, ValidationErrors, FormArray, FormGroup } from '@angular/forms';
|
|
2
|
+
|
|
3
|
+
export function DateRangeValidator(group: AbstractControl): ValidationErrors | null {
|
|
4
|
+
let fromDateControl: AbstractControl | null = null;
|
|
5
|
+
let toDateControl: AbstractControl | null = null;
|
|
6
|
+
|
|
7
|
+
if (group.parent instanceof FormGroup && group.parent.parent instanceof FormArray) {
|
|
8
|
+
const formGroup = group.parent;
|
|
9
|
+
fromDateControl = formGroup.get('fromDate');
|
|
10
|
+
toDateControl = formGroup.get('toDate');
|
|
11
|
+
} else {
|
|
12
|
+
fromDateControl = group.root.get('fromDate');
|
|
13
|
+
toDateControl = group.root.get('toDate');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (fromDateControl && toDateControl) {
|
|
17
|
+
const fromDateValue = fromDateControl.value;
|
|
18
|
+
const toDateValue = toDateControl.value;
|
|
19
|
+
|
|
20
|
+
if (fromDateValue && toDateValue) {
|
|
21
|
+
const fromDate = new Date(fromDateValue);
|
|
22
|
+
const toDate = new Date(toDateValue);
|
|
23
|
+
|
|
24
|
+
if (fromDate > toDate) {
|
|
25
|
+
return { dateRangeInvalid: 'Invalid Date Range: To date must be after from date' };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './match-list.validator';
|
|
2
|
-
export * from './multi-email-validator';
|
|
3
|
-
export * from './date-range-validator';
|
|
1
|
+
export * from './match-list.validator';
|
|
2
|
+
export * from './multi-email-validator';
|
|
3
|
+
export * from './date-range-validator';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {FormGroup} from "@angular/forms";
|
|
2
|
-
import {LookupItem} from "../base-model";
|
|
3
|
-
|
|
4
|
-
export function RequireMatch(control: FormGroup) {
|
|
5
|
-
const selection: any = control.value;
|
|
6
|
-
if (typeof selection === 'string' || (selection instanceof LookupItem && selection.id === -1)) {
|
|
7
|
-
return { incorrect: true };
|
|
8
|
-
}
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
1
|
+
import {FormGroup} from "@angular/forms";
|
|
2
|
+
import {LookupItem} from "../base-model";
|
|
3
|
+
|
|
4
|
+
export function RequireMatch(control: FormGroup) {
|
|
5
|
+
const selection: any = control.value;
|
|
6
|
+
if (typeof selection === 'string' || (selection instanceof LookupItem && selection.id === -1)) {
|
|
7
|
+
return { incorrect: true };
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { FormGroup } from '@angular/forms';
|
|
2
|
-
|
|
3
|
-
export function MultiEmailValidator(control: FormGroup) {
|
|
4
|
-
if (!control.value) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
const emails = control.value.split(';').map(email => email.trim());
|
|
8
|
-
|
|
9
|
-
for (let email of emails) {
|
|
10
|
-
if (!email.match(/^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,7};?)*$/)) {
|
|
11
|
-
return { 'invalidEmail': { value: control.value } };
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
1
|
+
import { FormGroup } from '@angular/forms';
|
|
2
|
+
|
|
3
|
+
export function MultiEmailValidator(control: FormGroup) {
|
|
4
|
+
if (!control.value) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
const emails = control.value.split(';').map(email => email.trim());
|
|
8
|
+
|
|
9
|
+
for (let email of emails) {
|
|
10
|
+
if (!email.match(/^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,7};?)*$/)) {
|
|
11
|
+
return { 'invalidEmail': { value: control.value } };
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
package/src/public-api.ts
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of invoiceq-lib
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export * from './lib/components/action-confirmation/action-confirmation.component'
|
|
6
|
-
export * from './lib/components/base-table/base-table.component'
|
|
7
|
-
export * from './lib/components/audit-log-list/audit-log.component'
|
|
8
|
-
export * from './lib/components/editable-base-table/editable-base-table.component'
|
|
9
|
-
export * from './lib/components/title-bar/title-bar.component'
|
|
10
|
-
export * from './lib/components/shared-list/shared-list.component'
|
|
11
|
-
export * from './lib/components/base-form-canvas/base-form-canvas.component'
|
|
12
|
-
export * from './lib/components/
|
|
13
|
-
export * from './lib/components/
|
|
14
|
-
export * from './lib/components/
|
|
15
|
-
export * from './lib/components/
|
|
16
|
-
export * from './lib/components/report-
|
|
17
|
-
export * from './lib/
|
|
18
|
-
export * from './lib/
|
|
19
|
-
export * from './lib/
|
|
20
|
-
export * from './lib/
|
|
21
|
-
export * from './lib/
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of invoiceq-lib
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './lib/components/action-confirmation/action-confirmation.component'
|
|
6
|
+
export * from './lib/components/base-table/base-table.component'
|
|
7
|
+
export * from './lib/components/audit-log-list/audit-log.component'
|
|
8
|
+
export * from './lib/components/editable-base-table/editable-base-table.component'
|
|
9
|
+
export * from './lib/components/title-bar/title-bar.component'
|
|
10
|
+
export * from './lib/components/shared-list/shared-list.component'
|
|
11
|
+
export * from './lib/components/base-form-canvas/base-form-canvas.component'
|
|
12
|
+
export * from './lib/components/section-form-canvas/section-form-canvas.component'
|
|
13
|
+
export * from './lib/components/base-form/base-form.component'
|
|
14
|
+
export * from './lib/components/audit-log-details-dialog/audit-log-details-dialog.component'
|
|
15
|
+
export * from './lib/components/report-form/report-form.component'
|
|
16
|
+
export * from './lib/components/activity-report-form/activity-report-form.component'
|
|
17
|
+
export * from './lib/components/report-details-dialog/report-details-dialog.component'
|
|
18
|
+
export * from './lib/base-model';
|
|
19
|
+
export * from './lib/base-model/line-item.model';
|
|
20
|
+
export * from './lib/base-model/items-total.model';
|
|
21
|
+
export * from './lib/services';
|
|
22
|
+
export * from './lib/validators';
|
|
23
|
+
export * from './lib/components/base-input-dialog/base-input-dialog.component'
|
|
24
|
+
export * from './lib/components/search-bar/search-bar.component'
|
|
25
|
+
export * from './lib/components/snackbar-static/snackbar-static.component'
|
|
26
|
+
export * from './lib/components/shared/action-card/action-card.component'
|
|
27
|
+
export * from './lib/components/shared/action-button/action-button.component'
|
|
28
|
+
export * from './lib/components/action-comment/action-comment.component'
|
|
29
|
+
export * from './lib/components/item-line-editor/item-line-editor.component'
|
package/tsconfig.lib.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "../../../tsconfig.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"outDir": "../../../out-tsc/lib",
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"declarationMap": true,
|
|
9
|
-
"inlineSources": true,
|
|
10
|
-
"types": []
|
|
11
|
-
},
|
|
12
|
-
"exclude": [
|
|
13
|
-
"**/*.spec.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../../out-tsc/lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"types": []
|
|
11
|
+
},
|
|
12
|
+
"exclude": [
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
package/tsconfig.lib.prod.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "./tsconfig.lib.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"declarationMap": false
|
|
7
|
-
},
|
|
8
|
-
"angularCompilerOptions": {
|
|
9
|
-
"compilationMode": "partial"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.lib.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"declarationMap": false
|
|
7
|
+
},
|
|
8
|
+
"angularCompilerOptions": {
|
|
9
|
+
"compilationMode": "partial"
|
|
10
|
+
}
|
|
11
|
+
}
|
package/tsconfig.spec.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "../../../tsconfig.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"outDir": "../../../out-tsc/spec",
|
|
7
|
-
"types": [
|
|
8
|
-
"jasmine"
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"include": [
|
|
12
|
-
"**/*.spec.ts",
|
|
13
|
-
"**/*.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../../out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"**/*.spec.ts",
|
|
13
|
+
"**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
.m-0{
|
|
2
|
-
margin: 0 !important;
|
|
3
|
-
}
|
|
4
|
-
.w-100{
|
|
5
|
-
width: 100%;
|
|
6
|
-
}
|
|
7
|
-
.form-style{
|
|
8
|
-
min-height: 12vh !important;
|
|
9
|
-
height: auto !important;
|
|
10
|
-
}
|
|
11
|
-
.text-red{
|
|
12
|
-
color: red !important;
|
|
13
|
-
}
|
|
14
|
-
.modal-footer{
|
|
15
|
-
margin-top: 5vh;
|
|
16
|
-
}
|
|
17
|
-
.overflow-hidden{
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
}
|
|
20
|
-
.pad-top{
|
|
21
|
-
margin-top: -7px;
|
|
22
|
-
display: block;
|
|
23
|
-
}
|
|
24
|
-
.action-comment {
|
|
25
|
-
display: flex;
|
|
26
|
-
justify-content: space-between;
|
|
27
|
-
}
|
|
28
|
-
.material-icons {
|
|
29
|
-
color: #E22222;padding: 10px;cursor: pointer;
|
|
30
|
-
}
|
|
31
|
-
textarea#warn::placeholder {
|
|
32
|
-
color: red;
|
|
33
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<div *ngIf="signingRequired">
|
|
2
|
-
<p mat-dialog-title align="start" class="invoice-note-text invoice-section m-0">
|
|
3
|
-
{{ 'comment.OTP' | translate }}
|
|
4
|
-
<span *ngIf="isTermination" class="text-red">*</span>
|
|
5
|
-
</p>
|
|
6
|
-
<mat-dialog-content class="mat-typography">
|
|
7
|
-
<mat-form-field appearance="outline" class="w-100" [class.error-input]="isSubmitted && !otp">
|
|
8
|
-
<input cdkFocusInitial agAcceptOnlyNumeric [(ngModel)]="otp" matInput type="text" class="pad-top"/>
|
|
9
|
-
</mat-form-field>
|
|
10
|
-
</mat-dialog-content>
|
|
11
|
-
</div>
|
|
12
|
-
<div>
|
|
13
|
-
<div class="action-comment">
|
|
14
|
-
<p class="invoice-note-text invoice-section">
|
|
15
|
-
<span style="padding: 10px 15px">{{ actionLabel | translate }}</span>
|
|
16
|
-
<span *ngIf="isTermination" class="text-red">*</span>
|
|
17
|
-
</p>
|
|
18
|
-
<mat-icon (click)="cancel()">close</mat-icon>
|
|
19
|
-
<!-- <span class="material-icons" (click)="cancel()">close</span>-->
|
|
20
|
-
</div>
|
|
21
|
-
<mat-dialog-content class="mat-typography overflow-hidden">
|
|
22
|
-
<mat-form-field appearance="outline" class="w-100">
|
|
23
|
-
<textarea cdkFocusInitial [(ngModel)]="comment" matInput class="form-style"
|
|
24
|
-
[id]="isTermination ? 'warn' : 'primary'"
|
|
25
|
-
cdkTextareaAutosize
|
|
26
|
-
cdkAutosizeMinRows="4"
|
|
27
|
-
cdkAutosizeMaxRows="5"
|
|
28
|
-
placeholder="{{'PAYER.placeHolder' | translate}}">
|
|
29
|
-
</textarea>
|
|
30
|
-
</mat-form-field>
|
|
31
|
-
</mat-dialog-content>
|
|
32
|
-
|
|
33
|
-
<div style="margin-top: 10px">
|
|
34
|
-
<p *ngIf="warningMsg" mat-dialog-title align="start" class="invoice-section m-0 text-red">
|
|
35
|
-
{{ 'vendorWarning' | translate }}
|
|
36
|
-
</p>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<mat-dialog-actions align="end" class="modal-footer">
|
|
40
|
-
|
|
41
|
-
<button mat-stroked-button [color]="isTermination ? 'warn': 'primary'" [disabled]="isTermination && !comment"
|
|
42
|
-
(click)="commentAndClose()" id="actionLabel">
|
|
43
|
-
{{ 'Proceed' | translate }}
|
|
44
|
-
</button>
|
|
45
|
-
</mat-dialog-actions>
|
|
46
|
-
</div>
|