bpm-core 0.0.20 → 0.0.22

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.
Files changed (28) hide show
  1. package/esm2022/lib/app/app.component.mjs +3 -3
  2. package/esm2022/lib/components/app-component-sections/form-section/form-section.component.mjs +66 -116
  3. package/esm2022/lib/components/app-component-sections/service-header/service-header.component.mjs +3 -3
  4. package/esm2022/lib/components/app-component-sections/workflow-section/workflow-section.component.mjs +2 -2
  5. package/esm2022/lib/components/shared-components/action-buttons/action-buttons.component.mjs +54 -0
  6. package/esm2022/lib/components/shared-components/form-field/control-value-accessor.directive.mjs +103 -0
  7. package/esm2022/lib/components/shared-components/form-field/input/input.component.mjs +49 -86
  8. package/esm2022/lib/constants/constants.mjs +4 -1
  9. package/esm2022/lib/i18n/en.mjs +1 -2
  10. package/esm2022/lib/services/action.service.ts.mjs +21 -0
  11. package/esm2022/lib/testComponent/config/segment-dynamic-loader.config.mjs +2 -3
  12. package/esm2022/lib/testComponent/request-details-section/request-details-section.component.mjs +49 -24
  13. package/fesm2022/bpm-core.mjs +328 -232
  14. package/fesm2022/bpm-core.mjs.map +1 -1
  15. package/lib/components/app-component-sections/form-section/form-section.component.d.ts +11 -22
  16. package/lib/components/app-component-sections/service-header/service-header.component.d.ts +1 -1
  17. package/lib/components/shared-components/action-buttons/action-buttons.component.d.ts +20 -0
  18. package/lib/components/shared-components/dialogs/submit-dialog/submit-dialog.component.d.ts +1 -1
  19. package/lib/components/shared-components/form-field/control-value-accessor.directive.d.ts +34 -0
  20. package/lib/components/shared-components/form-field/input/input.component.d.ts +4 -14
  21. package/lib/constants/constants.d.ts +3 -0
  22. package/lib/i18n/en.d.ts +0 -1
  23. package/lib/services/action.service.ts.d.ts +10 -0
  24. package/lib/testComponent/config/segment-dynamic-loader.config.d.ts +1 -2
  25. package/lib/testComponent/request-details-section/request-details-section.component.d.ts +8 -7
  26. package/lib/testComponent/services/segment-dynamic-loader.service.d.ts +1 -2
  27. package/package.json +2 -2
  28. package/src/lib/assets/scss/_general.scss +5 -1
@@ -1,24 +1,19 @@
1
- import { AfterViewChecked, AfterViewInit, OnInit } from '@angular/core';
2
- import { CoreI18nService } from '../../../services';
1
+ import { AfterViewChecked, OnInit } from '@angular/core';
2
+ import { CoreI18nService, CoreService, SidenavService } from '../../../services';
3
3
  import { Form, Section } from '../../../interfaces';
4
4
  import * as i0 from "@angular/core";
5
- export declare class FormSectionComponent implements OnInit, AfterViewChecked, AfterViewInit {
5
+ export declare class FormSectionComponent implements OnInit, AfterViewChecked {
6
6
  i18n: CoreI18nService;
7
+ private readonly coreService;
8
+ private readonly sidenavService;
7
9
  userType: string;
8
- popover?: any;
9
10
  popoverType: string;
10
- popoverPosition: {
11
- top: number;
12
- left: number;
13
- };
14
11
  requestDetails: Section;
15
12
  userPopoverInfo: any;
16
13
  section: Section;
17
14
  form: Form;
18
15
  lov: any;
19
16
  isReadOnly: boolean;
20
- isOpen: boolean;
21
- isFinalApproval: boolean;
22
17
  controllers: any;
23
18
  segmentDynamicLoaderService: any;
24
19
  sectionFormComponent: any;
@@ -26,7 +21,7 @@ export declare class FormSectionComponent implements OnInit, AfterViewChecked, A
26
21
  sectionNumber: number;
27
22
  sectionStatusValue: string;
28
23
  sectionStatusKey: string;
29
- receipient: {
24
+ recipient: {
30
25
  isShowing: boolean;
31
26
  profile: any;
32
27
  };
@@ -35,24 +30,18 @@ export declare class FormSectionComponent implements OnInit, AfterViewChecked, A
35
30
  profile: any;
36
31
  };
37
32
  input: any;
38
- highlightFlag: boolean;
39
33
  processingDate: string;
40
34
  randomID: number;
41
- constructor(i18n: CoreI18nService);
35
+ constructor(i18n: CoreI18nService, coreService: CoreService, sidenavService: SidenavService);
42
36
  ngOnInit(): void;
43
- ngOnChanges(): void;
44
- ngAfterViewInit(): void;
45
37
  get isExpanded(): boolean;
46
- ServicesSubScriptions(): void;
47
38
  ngAfterViewChecked(): void;
48
39
  sectionId(): string;
49
- getSectionName(): string;
50
- getFormStepStatus(key: string): string;
40
+ private createUserProfileFromResponse;
41
+ private openOrCreateUserProfile;
51
42
  toggleSmallProfileInfo(event: any, personType: any): void;
52
- statusIconClass(status: string, type: string): "danger" | "close" | "warning" | "clock" | "success" | "check";
53
- locationHref(hrefLink: any): void;
54
- statusClass(status: string): "danger" | "warning" | "success";
43
+ statusClass(status: string): "success" | "danger" | "warning";
55
44
  statusIcon(status: string): "close" | "clock" | "check";
56
45
  static ɵfac: i0.ɵɵFactoryDeclaration<FormSectionComponent, never>;
57
- static ɵcmp: i0.ɵɵComponentDeclaration<FormSectionComponent, "app-form-section", never, { "requestDetails": { "alias": "requestDetails"; "required": false; }; "section": { "alias": "section"; "required": false; }; "form": { "alias": "form"; "required": false; }; "lov": { "alias": "lov"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "isFinalApproval": { "alias": "isFinalApproval"; "required": false; }; "controllers": { "alias": "controllers"; "required": false; }; "segmentDynamicLoaderService": { "alias": "segmentDynamicLoaderService"; "required": false; }; "sectionFormComponent": { "alias": "sectionFormComponent"; "required": false; }; "sectionName": { "alias": "sectionName"; "required": false; }; }, {}, never, never, true, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormSectionComponent, "app-form-section", never, { "requestDetails": { "alias": "requestDetails"; "required": false; }; "section": { "alias": "section"; "required": false; }; "form": { "alias": "form"; "required": false; }; "lov": { "alias": "lov"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "controllers": { "alias": "controllers"; "required": false; }; "segmentDynamicLoaderService": { "alias": "segmentDynamicLoaderService"; "required": false; }; "sectionFormComponent": { "alias": "sectionFormComponent"; "required": false; }; "sectionName": { "alias": "sectionName"; "required": false; }; }, {}, never, never, true, never>;
58
47
  }
@@ -27,7 +27,7 @@ export declare class ServiceHeaderComponent implements AfterViewInit {
27
27
  feedback(): void;
28
28
  showUserInfo(): void;
29
29
  setFlagPriority(id: string): void;
30
- statusClass(status: string): "danger" | "warning" | "success" | "loading";
30
+ statusClass(status: string): "success" | "loading" | "danger" | "warning";
31
31
  openFaq(): void;
32
32
  getApprovalHistory(): void;
33
33
  static ɵfac: i0.ɵɵFactoryDeclaration<ServiceHeaderComponent, never>;
@@ -0,0 +1,20 @@
1
+ import { CoreI18nService } from "../../../services";
2
+ import { ActionStateService } from "../../../services/action.service.ts";
3
+ import * as i0 from "@angular/core";
4
+ export declare class ActionButtonsComponent {
5
+ i18n: CoreI18nService;
6
+ private actionStateService;
7
+ lovOptions: any[];
8
+ lovType: string;
9
+ actionStates: {
10
+ [action: string]: boolean;
11
+ };
12
+ constructor(i18n: CoreI18nService, actionStateService: ActionStateService);
13
+ resetForm(): void;
14
+ onSubmit(action: string): void;
15
+ validForm(action: string): boolean;
16
+ buttonShape(item: any): "" | "outline";
17
+ buttonColor(item: any): "" | "red";
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<ActionButtonsComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<ActionButtonsComponent, "lib-action-buttons", never, { "lovOptions": { "alias": "lovOptions"; "required": false; }; "lovType": { "alias": "lovType"; "required": false; }; }, {}, never, never, true, never>;
20
+ }
@@ -9,7 +9,7 @@ export declare class SubmitDialogComponent {
9
9
  backHome(): void;
10
10
  getImage(email: string): string;
11
11
  viewForm(formId: string, formName?: string): void;
12
- getStatus(statusKey: string): "" | "danger" | "warning" | "success";
12
+ getStatus(statusKey: string): "success" | "" | "danger" | "warning";
13
13
  static ɵfac: i0.ɵɵFactoryDeclaration<SubmitDialogComponent, never>;
14
14
  static ɵcmp: i0.ɵɵComponentDeclaration<SubmitDialogComponent, "app-submit-dialog", never, {}, {}, never, never, true, never>;
15
15
  }
@@ -0,0 +1,34 @@
1
+ import { Injector, OnInit } from '@angular/core';
2
+ import { ControlValueAccessor, FormControl } from '@angular/forms';
3
+ import { CoreI18nService } from '../../../services';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ControlValueAccessorDirective<Type> implements ControlValueAccessor, OnInit {
6
+ private injector;
7
+ i18n: CoreI18nService;
8
+ hasLabel: boolean;
9
+ isReadOnly: boolean;
10
+ hideOption: boolean;
11
+ labelTextWriteMode: string;
12
+ hint: string;
13
+ loading: boolean;
14
+ placeholder: string;
15
+ type: string;
16
+ value: any;
17
+ showErrorMessage: string;
18
+ showHint: string;
19
+ showIfEmpty: string;
20
+ insideTable: any;
21
+ maxLength: number;
22
+ control: FormControl | undefined;
23
+ required: boolean;
24
+ private _isDisabled;
25
+ constructor(injector: Injector, i18n: CoreI18nService);
26
+ ngOnInit(): void;
27
+ setFormControl(): void;
28
+ writeValue(value: Type): void;
29
+ registerOnChange(fn: (val: Type | null) => Type): void;
30
+ registerOnTouched(fn: () => Type): void;
31
+ setDisabledState?(isDisabled: boolean): void;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<ControlValueAccessorDirective<any>, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ControlValueAccessorDirective<any>, "[appControlValueAccessor]", never, { "hasLabel": { "alias": "hasLabel"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "hideOption": { "alias": "hideOption"; "required": false; }; "labelTextWriteMode": { "alias": "labelTextWriteMode"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showErrorMessage": { "alias": "showErrorMessage"; "required": false; }; "showHint": { "alias": "showHint"; "required": false; }; "showIfEmpty": { "alias": "showIfEmpty"; "required": false; }; "insideTable": { "alias": "insideTable"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; }, {}, never, never, false, never>;
34
+ }
@@ -1,12 +1,9 @@
1
- import { BaseComponent } from '../base-component/base-component.component';
2
1
  import { SimpleChanges, EventEmitter } from '@angular/core';
2
+ import { ControlValueAccessorDirective } from '../control-value-accessor.directive';
3
3
  import * as i0 from "@angular/core";
4
- export declare class InputComponent extends BaseComponent {
4
+ export declare class InputComponent<Type> extends ControlValueAccessorDirective<Type> {
5
5
  label: string;
6
- displayValue: any;
7
- hasError: boolean;
8
6
  hasTooltip: boolean;
9
- error: string;
10
7
  tooltip: string;
11
8
  floatLabel: any;
12
9
  className: string;
@@ -15,18 +12,11 @@ export declare class InputComponent extends BaseComponent {
15
12
  iconPrefixName: string;
16
13
  matSuffix: boolean;
17
14
  iconSuffixName: string;
18
- numberSuffixName: string;
19
- optional: boolean;
20
- showArrows: boolean;
21
- decimals: number;
22
15
  emitedChangedValue1: EventEmitter<any>;
23
- useCurrency: boolean;
24
- useMask: boolean;
25
- ngOnInit(): void;
26
16
  ngAfterViewChecked(): void;
27
17
  ngOnChanges(changes: SimpleChanges): void;
28
18
  onValueChange1(data: any): void;
29
19
  onValueChange(data: any): void;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "app-input", never, { "label": { "alias": "label"; "required": false; }; "displayValue": { "alias": "displayValue"; "required": false; }; "hasError": { "alias": "hasError"; "required": false; }; "hasTooltip": { "alias": "hasTooltip"; "required": false; }; "error": { "alias": "error"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "floatLabel": { "alias": "floatLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "matPrefix": { "alias": "matPrefix"; "required": false; }; "iconPrefixName": { "alias": "iconPrefixName"; "required": false; }; "matSuffix": { "alias": "matSuffix"; "required": false; }; "iconSuffixName": { "alias": "iconSuffixName"; "required": false; }; "numberSuffixName": { "alias": "numberSuffixName"; "required": false; }; "optional": { "alias": "optional"; "required": false; }; "showArrows": { "alias": "showArrows"; "required": false; }; "decimals": { "alias": "decimals"; "required": false; }; "emitedChangedValue1": { "alias": "emitedChangedValue1"; "required": false; }; "useCurrency": { "alias": "useCurrency"; "required": false; }; "useMask": { "alias": "useMask"; "required": false; }; }, {}, never, never, true, never>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent<any>, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent<any>, "app-input", never, { "label": { "alias": "label"; "required": false; }; "hasTooltip": { "alias": "hasTooltip"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "floatLabel": { "alias": "floatLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "matPrefix": { "alias": "matPrefix"; "required": false; }; "iconPrefixName": { "alias": "iconPrefixName"; "required": false; }; "matSuffix": { "alias": "matSuffix"; "required": false; }; "iconSuffixName": { "alias": "iconSuffixName"; "required": false; }; "emitedChangedValue1": { "alias": "emitedChangedValue1"; "required": false; }; }, {}, never, never, true, never>;
32
22
  }
@@ -69,9 +69,12 @@ export declare const WM_ACTION_SUBMIT = "SUBMIT";
69
69
  export declare const FORM_STATUS_NEW = "NEW";
70
70
  export declare const FORM_STATUS_PENDING = "PENDING";
71
71
  export declare const FORM_STATUS_APPROVED = "APPROVED";
72
+ export declare const FORM_STATUS_APPROVE = "APPROVE";
72
73
  export declare const FORM_STATUS_REJECTED = "REJECTED";
74
+ export declare const FORM_STATUS_REJECT = "REJECT";
73
75
  export declare const FORM_STATUS_SEND_BACK = "SENDBACK";
74
76
  export declare const FORM_STATUS_CANCELLED = "CANCELLED";
77
+ export declare const FORM_STATUS_CANCEL = "CANCEL";
75
78
  export declare const FORM_STATUS_COMPLETED = "COMPLETED";
76
79
  export declare const STATE_MACHINE_ACTION_LOAD_HISTORY = "loadHistory";
77
80
  export declare const STATE_MACHINE_ACTION_SUCCESS_HISTORY = "successHistory";
package/lib/i18n/en.d.ts CHANGED
@@ -170,6 +170,5 @@ declare const _default: {
170
170
  NORMAL: string;
171
171
  select: string;
172
172
  addMultiAttachments: string;
173
- vpr_dRole: string;
174
173
  };
175
174
  export default _default;
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ActionStateService {
3
+ private actionStatesSubject;
4
+ actionStates$: import("rxjs").Observable<{
5
+ [action: string]: boolean;
6
+ }>;
7
+ setActionValid(action: string, isValid: boolean): void;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ActionStateService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<ActionStateService>;
10
+ }
@@ -1,8 +1,7 @@
1
1
  import { GeneralApproverSectionComponent } from "../general-approver-section/general-approver-section.component";
2
2
  declare const _default: {
3
3
  roleToApprovalSectionMapping: {
4
- wpo_d: typeof GeneralApproverSectionComponent;
5
- wpo_gm: typeof GeneralApproverSectionComponent;
4
+ vpr_d: typeof GeneralApproverSectionComponent;
6
5
  };
7
6
  };
8
7
  export default _default;
@@ -1,20 +1,21 @@
1
1
  import { Form, Section } from "../../interfaces";
2
2
  import { CoreI18nService } from "../../services";
3
+ import { FormBuilder, FormGroup } from "@angular/forms";
4
+ import { ActionStateService } from "../../services/action.service.ts";
3
5
  import * as i0 from "@angular/core";
4
6
  export declare class RequestDetailsSectionComponent {
5
7
  i18n: CoreI18nService;
8
+ private fb;
9
+ private actionStateService;
6
10
  isReadOnly: boolean;
7
11
  section: Section;
8
12
  lov: any;
9
13
  className: string;
10
- currentSectionId: string;
11
- lastSectionId: string;
12
14
  form: Form;
13
- constructor(i18n: CoreI18nService);
14
- ngAfterViewInit(): void;
15
- ServicesSubScriptions(): void;
16
- handleAttachment(fieldName: string, data: any): void;
17
- handleEmitValue(data: any, fieldName: string): void;
15
+ fieldsForm: FormGroup;
16
+ constructor(i18n: CoreI18nService, fb: FormBuilder, actionStateService: ActionStateService);
17
+ createForm(): void;
18
+ checkValidity(action: string): boolean;
18
19
  static ɵfac: i0.ɵɵFactoryDeclaration<RequestDetailsSectionComponent, never>;
19
20
  static ɵcmp: i0.ɵɵComponentDeclaration<RequestDetailsSectionComponent, "app-request-details-section", never, { "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "section": { "alias": "section"; "required": false; }; "lov": { "alias": "lov"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, never, true, never>;
20
21
  }
@@ -5,8 +5,7 @@ export declare class SegmentDynamicLoaderService {
5
5
  private i18n;
6
6
  requestDetailsSection: typeof RequestDetailsSectionComponent;
7
7
  roleToApprovalSectionMapping: {
8
- wpo_d: typeof import("../general-approver-section/general-approver-section.component").GeneralApproverSectionComponent;
9
- wpo_gm: typeof import("../general-approver-section/general-approver-section.component").GeneralApproverSectionComponent;
8
+ vpr_d: typeof import("../general-approver-section/general-approver-section.component").GeneralApproverSectionComponent;
10
9
  };
11
10
  constructor(i18n: I18nService);
12
11
  getComponent(componentId: string): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpm-core",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.0",
6
6
  "@angular/core": "^18.2.0",
@@ -23,4 +23,4 @@
23
23
  "default": "./fesm2022/bpm-core.mjs"
24
24
  }
25
25
  }
26
- }
26
+ }
@@ -1073,6 +1073,10 @@ mat-form-field.mat-mdc-form-field .mat-mdc-form-field-icon-suffix {
1073
1073
  min-width: fit-content;
1074
1074
  }
1075
1075
 
1076
+ ds-button.disabled::part(base) {
1077
+ opacity: 50%;
1078
+ }
1079
+
1076
1080
  ds-button[disabled] {
1077
1081
  &::part(base) {
1078
1082
  opacity: 1;
@@ -2008,4 +2012,4 @@ ul.ul-custom {
2008
2012
  font-size: 16px;
2009
2013
  }
2010
2014
  }
2011
- }
2015
+ }