@propmix/profet-common-header 3.0.15-utility-unstable.4 → 3.0.15-utility-unstable.6

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 (31) hide show
  1. package/esm2020/lib/api-endpoints.def.mjs +3 -2
  2. package/esm2020/lib/api-gateway.service.mjs +5 -13
  3. package/esm2020/lib/appraisal-assistant/appraisal-assistant-chat-widget.component.mjs +179 -0
  4. package/esm2020/lib/appraisal-assistant/appraisal-assistant.interface.mjs +2 -0
  5. package/esm2020/lib/closable.mixin.mjs +14 -0
  6. package/esm2020/lib/common-header.interface.mjs +1 -1
  7. package/esm2020/lib/common-header.service.mjs +28 -1
  8. package/esm2020/lib/header/header.component.mjs +44 -11
  9. package/esm2020/lib/utility-widget-config.token.mjs +3 -0
  10. package/esm2020/lib/utils/chat-time.pipe.mjs +35 -0
  11. package/esm2020/lib/utils/text-to-html.pipe.mjs +42 -0
  12. package/fesm2015/propmix-profet-common-header-appraisal-assistant-chat-widget.component-56a1672f.mjs +281 -0
  13. package/fesm2015/propmix-profet-common-header-appraisal-assistant-chat-widget.component-56a1672f.mjs.map +1 -0
  14. package/fesm2015/propmix-profet-common-header.mjs +83 -24
  15. package/fesm2015/propmix-profet-common-header.mjs.map +1 -1
  16. package/fesm2020/propmix-profet-common-header-appraisal-assistant-chat-widget.component-8816b836.mjs +276 -0
  17. package/fesm2020/propmix-profet-common-header-appraisal-assistant-chat-widget.component-8816b836.mjs.map +1 -0
  18. package/fesm2020/propmix-profet-common-header.mjs +77 -24
  19. package/fesm2020/propmix-profet-common-header.mjs.map +1 -1
  20. package/lib/api-endpoints.def.d.ts +1 -0
  21. package/lib/api-gateway.service.d.ts +2 -1
  22. package/lib/appraisal-assistant/appraisal-assistant-chat-widget.component.d.ts +37 -0
  23. package/lib/appraisal-assistant/appraisal-assistant.interface.d.ts +4 -0
  24. package/lib/closable.mixin.d.ts +7 -0
  25. package/lib/common-header.interface.d.ts +12 -2
  26. package/lib/common-header.service.d.ts +4 -0
  27. package/lib/header/header.component.d.ts +10 -4
  28. package/lib/utility-widget-config.token.d.ts +2 -0
  29. package/lib/utils/chat-time.pipe.d.ts +7 -0
  30. package/lib/utils/text-to-html.pipe.d.ts +21 -0
  31. package/package.json +1 -1
@@ -9,5 +9,6 @@ export declare class EndPoints {
9
9
  getCompanyList: string;
10
10
  getAppMenu: string;
11
11
  updateLastAccessedApplication: string;
12
+ appraisalChat: string;
12
13
  };
13
14
  }
@@ -1,8 +1,9 @@
1
1
  import { Observable } from 'rxjs';
2
+ import { ApiConfig } from './common-header.interface';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class ApiGatewayService {
4
5
  private _http;
5
- doGet(url: string, config?: any): Observable<any>;
6
+ doGet(url: string, config?: ApiConfig): Observable<any>;
6
7
  doPost(url: string, req_body?: any): Observable<any>;
7
8
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiGatewayService, never>;
8
9
  static ɵprov: i0.ɵɵInjectableDeclaration<ApiGatewayService>;
@@ -0,0 +1,37 @@
1
+ import { AfterViewChecked, ElementRef, OnInit, QueryList } from '@angular/core';
2
+ import { FormControl } from '@angular/forms';
3
+ import { CommonHeaderService } from '../common-header.service';
4
+ import * as i0 from "@angular/core";
5
+ declare const AppraisalAssistantChatWidgetComponent_base: {
6
+ new (...args: any[]): {
7
+ _ser: CommonHeaderService;
8
+ close(): void;
9
+ };
10
+ } & {
11
+ new (): {};
12
+ };
13
+ export declare class AppraisalAssistantChatWidgetComponent extends AppraisalAssistantChatWidgetComponent_base implements OnInit, AfterViewChecked {
14
+ isOpen: boolean;
15
+ message: string;
16
+ messages: any[];
17
+ isLoading: boolean;
18
+ conversationId: string;
19
+ msgControl: FormControl;
20
+ _chatSer: CommonHeaderService;
21
+ private chatContainer;
22
+ lastMessageRefs: QueryList<ElementRef>;
23
+ msgInputRef: ElementRef<HTMLTextAreaElement>;
24
+ private shouldScroll;
25
+ welcomeMessage: string;
26
+ ngOnInit(): void;
27
+ ngAfterViewChecked(): void;
28
+ toggleChat(): void;
29
+ sendMessage(): void;
30
+ scrollToLastMessage(): void;
31
+ handleKeyDown(event: KeyboardEvent): void;
32
+ focusInput(): void;
33
+ resetChat(): void;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppraisalAssistantChatWidgetComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<AppraisalAssistantChatWidgetComponent, "appraisal-assistant-agent", never, {}, {}, never, never, true, never>;
36
+ }
37
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface AppraisalChatRequest {
2
+ query: string;
3
+ conversationId?: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ import { CommonHeaderService } from "./common-header.service";
2
+ export declare function WithClosable<T extends new (...args: any[]) => {}>(Base: T): {
3
+ new (...args: any[]): {
4
+ _ser: CommonHeaderService;
5
+ close(): void;
6
+ };
7
+ } & T;
@@ -1,3 +1,4 @@
1
+ import { HttpHeaders } from "@angular/common/http";
1
2
  import { EventEmitter, Type } from "@angular/core";
2
3
  import { PROFET_APPS } from "./utils/apps.enum";
3
4
  export interface AppMenu {
@@ -19,6 +20,7 @@ export interface HeaderConfig {
19
20
  signOutUrl: string;
20
21
  appType: PROFET_APPS;
21
22
  disableUtilityDrawer?: boolean;
23
+ disableAppraisalAssistantApp?: boolean;
22
24
  }
23
25
  export interface Company {
24
26
  id: number;
@@ -39,10 +41,18 @@ export interface SessionOutInfo {
39
41
  export interface UtilityConfig {
40
42
  id: string;
41
43
  label: string;
42
- component: Type<any>;
43
- layout: 'push' | 'side' | 'over';
44
+ loadComponent?: () => Promise<Type<any>>;
45
+ layout?: 'push' | 'side' | 'over';
44
46
  icon: string;
47
+ config?: any;
45
48
  }
46
49
  export interface UtilityComp {
47
50
  outEvent: EventEmitter<boolean>;
48
51
  }
52
+ export interface ApiConfig {
53
+ httpHeader?: HttpHeaders;
54
+ isUnauthorized?: boolean;
55
+ additionalParams?: {
56
+ [key: string]: any;
57
+ };
58
+ }
@@ -1,4 +1,5 @@
1
1
  import { MatDialog } from '@angular/material/dialog';
2
+ import { AppraisalChatRequest } from './appraisal-assistant/appraisal-assistant.interface';
2
3
  import { AppMenu, Company, HeaderConfig, SessionOutInfo } from './common-header.interface';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class CommonHeaderService {
@@ -33,6 +34,9 @@ export declare class CommonHeaderService {
33
34
  getCompanyList(): import("rxjs").Observable<{}>;
34
35
  getMenuList(): import("rxjs").Observable<{}>;
35
36
  updateLastAccessedApplication(reqBody: any): import("rxjs").Observable<any>;
37
+ objectToQueryParams(obj: Record<string, any>): string;
38
+ getCookie(name: string): string | null;
39
+ getQueryResponse(request?: AppraisalChatRequest): import("rxjs").Observable<any>;
36
40
  static ɵfac: i0.ɵɵFactoryDeclaration<CommonHeaderService, never>;
37
41
  static ɵprov: i0.ɵɵInjectableDeclaration<CommonHeaderService>;
38
42
  }
@@ -1,4 +1,4 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
1
+ import { EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges, Type } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
3
  import { MatDrawer, MatSidenav } from '@angular/material/sidenav';
4
4
  import { DomSanitizer } from '@angular/platform-browser';
@@ -6,7 +6,7 @@ import { Router } from '@angular/router';
6
6
  import { AppMenu, Company, UtilityConfig } from '../common-header.interface';
7
7
  import { CommonHeaderService } from '../common-header.service';
8
8
  import * as i0 from "@angular/core";
9
- export declare class HeaderComponent implements OnInit, OnDestroy {
9
+ export declare class HeaderComponent implements OnInit, OnChanges, OnDestroy {
10
10
  companyProfile: any;
11
11
  portalUrl: string;
12
12
  userAuthData: any;
@@ -34,6 +34,7 @@ export declare class HeaderComponent implements OnInit, OnDestroy {
34
34
  _domSanitizer: DomSanitizer;
35
35
  private inactivityTimeout;
36
36
  INACTIVITY_LIMIT: number;
37
+ logoutEvent: EventEmitter<void>;
37
38
  companyControl: FormControl<any>;
38
39
  appConfig: any;
39
40
  companyList: Company[];
@@ -45,9 +46,14 @@ export declare class HeaderComponent implements OnInit, OnDestroy {
45
46
  activeCompany: Company | undefined;
46
47
  utilitySpace: MatDrawer;
47
48
  config: UtilityConfig[];
49
+ defaultApps: UtilityConfig[];
48
50
  selected?: UtilityConfig;
49
- openItem(item: UtilityConfig): void;
51
+ componentToLoad: Type<any> | null;
52
+ dynamicInjector: Injector;
53
+ private injector;
54
+ openItem(item: UtilityConfig): Promise<void>;
50
55
  constructor();
56
+ ngOnChanges(changes: SimpleChanges): Promise<void>;
51
57
  ngOnInit(): Promise<void>;
52
58
  resetTimer(): void;
53
59
  selectCurrentCompany(): void;
@@ -64,5 +70,5 @@ export declare class HeaderComponent implements OnInit, OnDestroy {
64
70
  switchCompany(info: any): void;
65
71
  ngOnDestroy(): void;
66
72
  static ɵfac: i0.ɵɵFactoryDeclaration<HeaderComponent, never>;
67
- static ɵcmp: i0.ɵɵComponentDeclaration<HeaderComponent, "lib-header", never, { "INACTIVITY_LIMIT": "INACTIVITY_LIMIT"; "config": "config"; }, {}, never, ["[headerInfo]", "[bodyContentInfo]"], false, never>;
73
+ static ɵcmp: i0.ɵɵComponentDeclaration<HeaderComponent, "lib-header", never, { "INACTIVITY_LIMIT": "INACTIVITY_LIMIT"; "config": "config"; }, { "logoutEvent": "logoutEvent"; }, never, ["[headerInfo]", "[bodyContentInfo]"], false, never>;
68
74
  }
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ export declare const UTILITY_WIDGET_CONFIG: InjectionToken<any>;
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ChatTimePipe implements PipeTransform {
4
+ transform(value: string | number | Date): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatTimePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<ChatTimePipe, "chatTime", true>;
7
+ }
@@ -0,0 +1,21 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Pipe to convert text with special characters to HTML.
6
+ * It replaces:
7
+ * - \n with <br>
8
+ * - \t with &emsp;
9
+ * - \' with '
10
+ * - \" with "
11
+ * - \\ with \
12
+ * - **text** with <strong>text</strong>
13
+ * - _text_ with <em>text</em>
14
+ */
15
+ export declare class TextToHtmlPipe implements PipeTransform {
16
+ private sanitizer;
17
+ constructor(sanitizer: DomSanitizer);
18
+ transform(value: string): SafeHtml;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextToHtmlPipe, never>;
20
+ static ɵpipe: i0.ɵɵPipeDeclaration<TextToHtmlPipe, "textToHtml", true>;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propmix/profet-common-header",
3
- "version": "3.0.15-utility-unstable.4",
3
+ "version": "3.0.15-utility-unstable.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=15.2.0",
6
6
  "@angular/core": ">=15.2.0",