@unifylib/ui-lib 1.0.3 → 1.1.4
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/iq-ui-lib.mjs +5 -0
- package/esm2022/lib/base-model/SearchStrConfig.mjs +11 -0
- package/esm2022/lib/base-model/api-response.mjs +2 -0
- package/esm2022/lib/base-model/audit-log-entry.mjs +3 -0
- package/esm2022/lib/base-model/button-action-settings.mjs +16 -0
- package/esm2022/lib/base-model/column-def.model.mjs +28 -0
- package/esm2022/lib/base-model/do-action-request.mjs +8 -0
- package/esm2022/lib/base-model/field-action.mjs +6 -0
- package/esm2022/lib/base-model/field-filter.model.mjs +3 -0
- package/esm2022/lib/base-model/field-info.mjs +57 -0
- package/esm2022/lib/base-model/field-predicate.model.mjs +10 -0
- package/esm2022/lib/base-model/filter-request.mjs +13 -0
- package/esm2022/lib/base-model/filter.model.mjs +25 -0
- package/esm2022/lib/base-model/get-items-list.mjs +10 -0
- package/esm2022/lib/base-model/index.mjs +12 -0
- package/esm2022/lib/base-model/items-total.model.mjs +8 -0
- package/esm2022/lib/base-model/line-item.model.mjs +11 -0
- package/esm2022/lib/base-model/lookupItem.mjs +16 -0
- package/esm2022/lib/base-model/page-info.mjs +17 -0
- package/esm2022/lib/base-model/report-request.model.mjs +17 -0
- package/esm2022/lib/base-model/response-envelop.model.mjs +10 -0
- package/esm2022/lib/base-model/snack-message.model.mjs +11 -0
- package/esm2022/lib/base-model/table-column.interface.mjs +2 -0
- package/esm2022/lib/base-model/table-page-user-action.interface.mjs +21 -0
- package/esm2022/lib/base-model/workflow/workflow-steps.model.mjs +9 -0
- package/esm2022/lib/base-model/workflow/workflow.model.mjs +42 -0
- package/esm2022/lib/components/action-comment/action-comment.component.mjs +101 -0
- package/esm2022/lib/components/action-confirmation/action-confirmation.component.mjs +55 -0
- package/esm2022/lib/components/activity-report-form/activity-report-form.component.mjs +499 -0
- package/esm2022/lib/components/advanced-filter/field-filter/field-filter.component.mjs +41 -0
- package/esm2022/lib/components/advanced-filter/filter-builder/filter-builder.component.mjs +162 -0
- package/esm2022/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.mjs +70 -0
- package/esm2022/lib/components/audit-log-list/audit-log.component.mjs +99 -0
- package/esm2022/lib/components/auto-complete/auto-complete.component.mjs +292 -0
- package/esm2022/lib/components/base-form/base-form.component.mjs +297 -0
- package/esm2022/lib/components/base-form-canvas/base-form-canvas.component.mjs +591 -0
- package/esm2022/lib/components/base-input-dialog/base-input-dialog.component.mjs +72 -0
- package/esm2022/lib/components/base-table/base-table.component.mjs +514 -0
- package/esm2022/lib/components/button-actions/button-actions.component.mjs +70 -0
- package/esm2022/lib/components/editable-base-table/editable-base-table.component.mjs +496 -0
- package/esm2022/lib/components/equation-builder/equation-builder.component.mjs +112 -0
- package/esm2022/lib/components/item-line-editor/item-line-editor.component.mjs +299 -0
- package/esm2022/lib/components/multi-auto-complete/multi-auto-complete.component.mjs +278 -0
- package/esm2022/lib/components/paginator/paginator.component.mjs +91 -0
- package/esm2022/lib/components/report-details-dialog/report-details-dialog.component.mjs +102 -0
- package/esm2022/lib/components/report-form/report-form.component.mjs +498 -0
- package/esm2022/lib/components/search-bar/search-bar.component.mjs +62 -0
- package/esm2022/lib/components/section-form-canvas/section-form-canvas.component.mjs +81 -0
- package/esm2022/lib/components/shared/action-button/action-button.component.mjs +59 -0
- package/esm2022/lib/components/shared/action-card/action-card.component.mjs +93 -0
- package/esm2022/lib/components/shared/attachment-uploader/attachment-uploader.component.mjs +70 -0
- package/esm2022/lib/components/shared-list/shared-list.component.mjs +47 -0
- package/esm2022/lib/components/snackbar-static/snackbar-static.component.mjs +43 -0
- package/esm2022/lib/components/title-bar/title-bar.component.mjs +119 -0
- package/esm2022/lib/services/backend-service.mjs +240 -0
- package/esm2022/lib/services/index.mjs +4 -0
- package/esm2022/lib/services/top-panel.mjs +22 -0
- package/esm2022/lib/services/trigger-form.service.mjs +17 -0
- package/esm2022/lib/utils/base-utils.mjs +97 -0
- package/esm2022/lib/validators/date-range-validator.mjs +27 -0
- package/esm2022/lib/validators/index.mjs +4 -0
- package/esm2022/lib/validators/match-list.validator.mjs +9 -0
- package/esm2022/lib/validators/multi-email-validator.mjs +13 -0
- package/esm2022/public-api.mjs +29 -0
- package/esm2022/q-btech-ui-lib.mjs +5 -0
- package/esm2022/unifylib-ui-lib.mjs +5 -0
- package/fesm2022/iq-ui-lib.mjs +5625 -0
- package/fesm2022/iq-ui-lib.mjs.map +1 -0
- package/fesm2022/q-btech-ui-lib.mjs +5619 -0
- package/fesm2022/q-btech-ui-lib.mjs.map +1 -0
- package/fesm2022/unifylib-ui-lib.mjs +5625 -0
- package/fesm2022/unifylib-ui-lib.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/base-model/SearchStrConfig.d.ts +8 -0
- package/{src/lib/base-model/api-response.ts → lib/base-model/api-response.d.ts} +5 -7
- package/lib/base-model/audit-log-entry.d.ts +7 -0
- package/lib/base-model/button-action-settings.d.ts +15 -0
- package/lib/base-model/column-def.model.d.ts +11 -0
- package/lib/base-model/do-action-request.d.ts +10 -0
- package/lib/base-model/field-action.d.ts +6 -0
- package/lib/base-model/field-filter.model.d.ts +7 -0
- package/lib/base-model/field-info.d.ts +53 -0
- package/lib/base-model/field-predicate.model.d.ts +7 -0
- package/lib/base-model/filter-request.d.ts +15 -0
- package/lib/base-model/filter.model.d.ts +22 -0
- package/lib/base-model/get-items-list.d.ts +21 -0
- package/lib/base-model/index.d.ts +11 -0
- package/lib/base-model/items-total.model.d.ts +6 -0
- package/lib/base-model/line-item.model.d.ts +9 -0
- package/lib/base-model/lookupItem.d.ts +13 -0
- package/{src/lib/base-model/page-info.ts → lib/base-model/page-info.d.ts} +25 -24
- package/lib/base-model/report-request.model.d.ts +18 -0
- package/lib/base-model/response-envelop.model.d.ts +8 -0
- package/lib/base-model/snack-message.model.d.ts +7 -0
- package/lib/base-model/table-column.interface.d.ts +28 -0
- package/lib/base-model/table-page-user-action.interface.d.ts +14 -0
- package/lib/base-model/workflow/workflow-steps.model.d.ts +7 -0
- package/lib/base-model/workflow/workflow.model.d.ts +13 -0
- package/lib/components/action-comment/action-comment.component.d.ts +32 -0
- package/lib/components/action-confirmation/action-confirmation.component.d.ts +19 -0
- package/lib/components/activity-report-form/activity-report-form.component.d.ts +93 -0
- package/lib/components/advanced-filter/field-filter/field-filter.component.d.ts +20 -0
- package/lib/components/advanced-filter/filter-builder/filter-builder.component.d.ts +28 -0
- package/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.d.ts +25 -0
- package/lib/components/audit-log-list/audit-log.component.d.ts +36 -0
- package/lib/components/auto-complete/auto-complete.component.d.ts +51 -0
- package/lib/components/base-form/base-form.component.d.ts +59 -0
- package/lib/components/base-form-canvas/base-form-canvas.component.d.ts +124 -0
- package/lib/components/base-input-dialog/base-input-dialog.component.d.ts +23 -0
- package/lib/components/base-table/base-table.component.d.ts +128 -0
- package/lib/components/button-actions/button-actions.component.d.ts +17 -0
- package/lib/components/editable-base-table/editable-base-table.component.d.ts +106 -0
- package/lib/components/equation-builder/equation-builder.component.d.ts +23 -0
- package/lib/components/item-line-editor/item-line-editor.component.d.ts +64 -0
- package/lib/components/multi-auto-complete/multi-auto-complete.component.d.ts +51 -0
- package/lib/components/paginator/paginator.component.d.ts +26 -0
- package/lib/components/report-details-dialog/report-details-dialog.component.d.ts +34 -0
- package/lib/components/report-form/report-form.component.d.ts +92 -0
- package/lib/components/search-bar/search-bar.component.d.ts +29 -0
- package/lib/components/section-form-canvas/section-form-canvas.component.d.ts +27 -0
- package/lib/components/shared/action-button/action-button.component.d.ts +17 -0
- package/lib/components/shared/action-card/action-card.component.d.ts +37 -0
- package/lib/components/shared/attachment-uploader/attachment-uploader.component.d.ts +16 -0
- package/lib/components/shared-list/shared-list.component.d.ts +21 -0
- package/lib/components/snackbar-static/snackbar-static.component.d.ts +15 -0
- package/lib/components/title-bar/title-bar.component.d.ts +42 -0
- package/lib/services/backend-service.d.ts +59 -0
- package/{src/lib/services/index.ts → lib/services/index.d.ts} +1 -1
- package/lib/services/top-panel.d.ts +8 -0
- package/lib/services/trigger-form.service.d.ts +7 -0
- package/lib/utils/base-utils.d.ts +13 -0
- package/lib/validators/date-range-validator.d.ts +2 -0
- package/lib/validators/match-list.validator.d.ts +4 -0
- package/lib/validators/multi-email-validator.d.ts +6 -0
- package/package.json +19 -4
- package/{src/public-api.ts → public-api.d.ts} +22 -18
- package/ng-package.json +0 -7
- package/src/lib/base-model/SearchStrConfig.ts +0 -12
- package/src/lib/base-model/audit-log-entry.ts +0 -7
- package/src/lib/base-model/button-action-settings.ts +0 -25
- package/src/lib/base-model/column-def.model.ts +0 -34
- package/src/lib/base-model/do-action-request.ts +0 -11
- package/src/lib/base-model/field-action.ts +0 -7
- package/src/lib/base-model/field-filter.model.ts +0 -14
- package/src/lib/base-model/field-info.ts +0 -98
- package/src/lib/base-model/field-predicate.model.ts +0 -7
- package/src/lib/base-model/filter-request.ts +0 -27
- package/src/lib/base-model/filter.model.ts +0 -49
- package/src/lib/base-model/get-items-list.ts +0 -24
- package/src/lib/base-model/index.ts +0 -11
- package/src/lib/base-model/lookupItem.ts +0 -21
- package/src/lib/base-model/null-snackmessage.ts +0 -9
- package/src/lib/base-model/report-request.model.ts +0 -33
- package/src/lib/base-model/response-envelop.model.ts +0 -15
- package/src/lib/base-model/snack-message.model.ts +0 -14
- package/src/lib/base-model/snackmessage-interface.ts +0 -7
- package/src/lib/base-model/table-column.interface.ts +0 -29
- package/src/lib/base-model/table-page-user-action.interface.ts +0 -33
- package/src/lib/base-model/workflow/workflow-steps.model.ts +0 -9
- package/src/lib/base-model/workflow/workflow.model.ts +0 -52
- package/src/lib/components/action-confirmation/action-confirmation.component.css +0 -34
- package/src/lib/components/action-confirmation/action-confirmation.component.html +0 -18
- package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +0 -23
- package/src/lib/components/action-confirmation/action-confirmation.component.ts +0 -58
- package/src/lib/components/activity-report-form/activity-report-form.component.html +0 -109
- package/src/lib/components/activity-report-form/activity-report-form.component.scss +0 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +0 -25
- package/src/lib/components/activity-report-form/activity-report-form.component.ts +0 -605
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +0 -51
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +0 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +0 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +0 -69
- package/src/lib/components/audit-log-list/audit-log.component.html +0 -23
- package/src/lib/components/audit-log-list/audit-log.component.scss +0 -0
- package/src/lib/components/audit-log-list/audit-log.component.spec.ts +0 -25
- package/src/lib/components/audit-log-list/audit-log.component.ts +0 -116
- package/src/lib/components/auto-complete/auto-complete.component.css +0 -14
- package/src/lib/components/auto-complete/auto-complete.component.html +0 -29
- package/src/lib/components/auto-complete/auto-complete.component.spec.ts +0 -23
- package/src/lib/components/auto-complete/auto-complete.component.ts +0 -330
- package/src/lib/components/base-form/base-form.component.html +0 -58
- package/src/lib/components/base-form/base-form.component.scss +0 -0
- package/src/lib/components/base-form/base-form.component.spec.ts +0 -25
- package/src/lib/components/base-form/base-form.component.ts +0 -305
- package/src/lib/components/base-form-canvas/base-form-canvas.component.css +0 -22
- package/src/lib/components/base-form-canvas/base-form-canvas.component.html +0 -1006
- package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +0 -23
- package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +0 -573
- package/src/lib/components/base-input-dialog/base-input-dialog.component.css +0 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.html +0 -42
- package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +0 -23
- package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +0 -78
- package/src/lib/components/base-table/base-table.component.html +0 -242
- package/src/lib/components/base-table/base-table.component.scss +0 -31
- package/src/lib/components/base-table/base-table.component.spec.ts +0 -25
- package/src/lib/components/base-table/base-table.component.ts +0 -568
- package/src/lib/components/button-actions/button-actions.component.html +0 -28
- package/src/lib/components/button-actions/button-actions.component.scss +0 -6
- package/src/lib/components/button-actions/button-actions.component.spec.ts +0 -23
- package/src/lib/components/button-actions/button-actions.component.ts +0 -72
- package/src/lib/components/editable-base-table/editable-base-table.component.html +0 -372
- package/src/lib/components/editable-base-table/editable-base-table.component.scss +0 -44
- package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +0 -25
- package/src/lib/components/editable-base-table/editable-base-table.component.ts +0 -570
- package/src/lib/components/equation-builder/equation-builder.component.css +0 -0
- package/src/lib/components/equation-builder/equation-builder.component.html +0 -31
- package/src/lib/components/equation-builder/equation-builder.component.spec.ts +0 -23
- package/src/lib/components/equation-builder/equation-builder.component.ts +0 -121
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +0 -11
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +0 -38
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +0 -23
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +0 -317
- package/src/lib/components/paginator/paginator.component.css +0 -25
- package/src/lib/components/paginator/paginator.component.html +0 -34
- package/src/lib/components/paginator/paginator.component.ts +0 -94
- 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/components/rejection-comment/action-comment.component.spec.ts +0 -23
- package/src/lib/components/rejection-comment/action-comment.component.ts +0 -86
- package/src/lib/components/report-details-dialog/report-details-dialog.component.css +0 -17
- package/src/lib/components/report-details-dialog/report-details-dialog.component.html +0 -16
- package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +0 -23
- package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +0 -113
- package/src/lib/components/report-form/report-form.component.html +0 -94
- package/src/lib/components/report-form/report-form.component.scss +0 -0
- package/src/lib/components/report-form/report-form.component.spec.ts +0 -25
- package/src/lib/components/report-form/report-form.component.ts +0 -588
- package/src/lib/components/search-bar/search-bar.component.html +0 -62
- package/src/lib/components/search-bar/search-bar.component.scss +0 -8
- package/src/lib/components/search-bar/search-bar.component.spec.ts +0 -25
- package/src/lib/components/search-bar/search-bar.component.ts +0 -70
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +0 -54
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +0 -22
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +0 -23
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +0 -45
- package/src/lib/components/shared-list/shared-list.component.css +0 -0
- package/src/lib/components/shared-list/shared-list.component.html +0 -17
- package/src/lib/components/shared-list/shared-list.component.spec.ts +0 -23
- package/src/lib/components/shared-list/shared-list.component.ts +0 -53
- package/src/lib/components/title-bar/title-bar.component.css +0 -0
- package/src/lib/components/title-bar/title-bar.component.css.map +0 -1
- package/src/lib/components/title-bar/title-bar.component.html +0 -31
- package/src/lib/components/title-bar/title-bar.component.scss +0 -23
- package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -23
- package/src/lib/components/title-bar/title-bar.component.ts +0 -119
- package/src/lib/services/backend-service.ts +0 -286
- package/src/lib/services/top-panel.ts +0 -17
- package/src/lib/services/trigger-form.service.ts +0 -11
- package/src/lib/share-module/shared-module.ts +0 -10
- package/src/lib/styles/invoiceq-theme.scss +0 -252
- package/src/lib/styles/styles.scss +0 -1723
- package/src/lib/utils/base-utils.ts +0 -102
- package/src/lib/validators/date-range-validator.ts +0 -31
- package/src/lib/validators/match-list.validator.ts +0 -10
- package/src/lib/validators/multi-email-validator.ts +0 -15
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
- /package/{src/lib/validators/index.ts → lib/validators/index.d.ts} +0 -0
|
@@ -1,102 +0,0 @@
|
|
|
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
|
-
: [field.placeholder || 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 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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/tsconfig.lib.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
File without changes
|