@datarailsshared/datarailsshared 1.5.576 → 1.6.21

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.
@@ -8,15 +8,17 @@ import * as i6 from "./dr-chat-message/dr-chat-message-file/chat-message-file.co
8
8
  import * as i7 from "./dr-chat-suggestions/chat-suggestions.component";
9
9
  import * as i8 from "./dr-dot-flashing/dr-dot-flashing.component";
10
10
  import * as i9 from "./dr-chat-alert/dr-chat-alert.component";
11
- import * as i10 from "./dr-chat-message/dr-chat-message-custom/chat-custom-message.directive";
12
- import * as i11 from "@angular/forms";
13
- import * as i12 from "@angular/common";
14
- import * as i13 from "../dr-avatar/dr-avatar.module";
15
- import * as i14 from "../dr-inputs/dr-inputs.module";
16
- import * as i15 from "../dr-tooltip/dr-tooltip.module";
17
- import * as i16 from "../directives/click-outside/click-outside.module";
11
+ import * as i10 from "./dr-chat-dropped-files/dr-chat-dropped-files.component";
12
+ import * as i11 from "./dr-chat-message/dr-chat-message-custom/chat-custom-message.directive";
13
+ import * as i12 from "./dr-chat-dropped-files/pipes/shorter-naming.pipe";
14
+ import * as i13 from "@angular/forms";
15
+ import * as i14 from "@angular/common";
16
+ import * as i15 from "../dr-avatar/dr-avatar.module";
17
+ import * as i16 from "../dr-inputs/dr-inputs.module";
18
+ import * as i17 from "../dr-tooltip/dr-tooltip.module";
19
+ import * as i18 from "../directives/click-outside/click-outside.module";
18
20
  export declare class DrChatModule {
19
21
  static ɵfac: i0.ɵɵFactoryDeclaration<DrChatModule, never>;
20
- static ɵmod: i0.ɵɵNgModuleDeclaration<DrChatModule, [typeof i1.DrChatComponent, typeof i2.DrChatMessageComponent, typeof i3.DrChatFormComponent, typeof i4.DrChatFormWithHistoryComponent, typeof i5.DrChatMessageTextComponent, typeof i6.DrChatMessageFileComponent, typeof i7.DrChatSuggestionsComponent, typeof i8.DrDotFlashingComponent, typeof i9.DrChatAlertComponent, typeof i10.DrChatCustomMessageDirective], [typeof i11.FormsModule, typeof i11.ReactiveFormsModule, typeof i12.CommonModule, typeof i13.DrAvatarModule, typeof i14.DrInputsModule, typeof i15.DrTooltipModule, typeof i16.ClickOutsideModule], [typeof i1.DrChatComponent, typeof i2.DrChatMessageComponent, typeof i3.DrChatFormComponent, typeof i4.DrChatFormWithHistoryComponent, typeof i5.DrChatMessageTextComponent, typeof i6.DrChatMessageFileComponent, typeof i7.DrChatSuggestionsComponent, typeof i8.DrDotFlashingComponent, typeof i9.DrChatAlertComponent, typeof i10.DrChatCustomMessageDirective]>;
22
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DrChatModule, [typeof i1.DrChatComponent, typeof i2.DrChatMessageComponent, typeof i3.DrChatFormComponent, typeof i4.DrChatFormWithHistoryComponent, typeof i5.DrChatMessageTextComponent, typeof i6.DrChatMessageFileComponent, typeof i7.DrChatSuggestionsComponent, typeof i8.DrDotFlashingComponent, typeof i9.DrChatAlertComponent, typeof i10.DrChatDroppedFilesComponent, typeof i11.DrChatCustomMessageDirective, typeof i12.ShorterNamingPipe], [typeof i13.FormsModule, typeof i13.ReactiveFormsModule, typeof i14.CommonModule, typeof i15.DrAvatarModule, typeof i16.DrInputsModule, typeof i17.DrTooltipModule, typeof i18.ClickOutsideModule], [typeof i1.DrChatComponent, typeof i2.DrChatMessageComponent, typeof i3.DrChatFormComponent, typeof i4.DrChatFormWithHistoryComponent, typeof i5.DrChatMessageTextComponent, typeof i6.DrChatMessageFileComponent, typeof i7.DrChatSuggestionsComponent, typeof i8.DrDotFlashingComponent, typeof i9.DrChatAlertComponent, typeof i10.DrChatDroppedFilesComponent, typeof i11.DrChatCustomMessageDirective]>;
21
23
  static ɵinj: i0.ɵɵInjectorDeclaration<DrChatModule>;
22
24
  }
@@ -0,0 +1,12 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { IFIle } from '../../models/chat';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DrChatDroppedFilesComponent {
5
+ files: Array<IFIle>;
6
+ isRemovable: boolean;
7
+ maxLengthText: number;
8
+ removeFileEvent: EventEmitter<IFIle>;
9
+ removeFile(file: IFIle, event: Event): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<DrChatDroppedFilesComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<DrChatDroppedFilesComponent, "dr-chat-dropped-files", never, { "files": { "alias": "files"; "required": false; }; "isRemovable": { "alias": "isRemovable"; "required": false; }; "maxLengthText": { "alias": "maxLengthText"; "required": false; }; }, { "removeFileEvent": "removeFileEvent"; }, never, never, false, never>;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ShorterNamingPipe implements PipeTransform {
4
+ transform(fileName: string, maxLength?: number): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<ShorterNamingPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<ShorterNamingPipe, "shorterNaming", false>;
7
+ }
@@ -1,16 +1,20 @@
1
1
  import { ChangeDetectorRef, ElementRef, EventEmitter } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
+ import { IFIle } from '../../models/chat';
4
+ import { BehaviorSubject } from 'rxjs';
3
5
  import * as i0 from "@angular/core";
4
6
  export declare class DrChatFormWithHistoryComponent {
5
7
  protected cdr: ChangeDetectorRef;
6
8
  protected domSanitizer: DomSanitizer;
7
9
  textAreaElementRef: ElementRef;
10
+ fileInput: ElementRef;
8
11
  _textareaInitialHeight: boolean;
9
12
  inputFocus: boolean;
10
13
  inputHover: boolean;
11
- droppedFiles: any[];
14
+ droppedFiles$: BehaviorSubject<IFIle[]>;
12
15
  isShowedHistory: boolean;
13
16
  isChatMode: boolean;
17
+ isLoading: boolean;
14
18
  /**
15
19
  * Predefined message text
16
20
  *
@@ -46,15 +50,16 @@ export declare class DrChatFormWithHistoryComponent {
46
50
  *
47
51
  * @type {boolean}
48
52
  */
49
- showDisabledButtonInsteadOfDotFlashing: boolean;
53
+ showDotFlashing: boolean;
50
54
  /**
51
55
  *
52
- * @type {EventEmitter<{ message: string, files: File[] }>}
56
+ * @type {EventEmitter<{ message: string, files: IFile[] }>}
53
57
  */
54
58
  send: EventEmitter<{
55
59
  message: string;
56
- files: File[];
60
+ files: IFIle[];
57
61
  }>;
62
+ uploadFiles: EventEmitter<IFIle[]>;
58
63
  abort: EventEmitter<any>;
59
64
  /**
60
65
  * Emits when message input value has been changed
@@ -76,6 +81,8 @@ export declare class DrChatFormWithHistoryComponent {
76
81
  showHistory(): void;
77
82
  closeHistory(): void;
78
83
  onFileSelected(event: Event): void;
84
+ private saveFiles;
85
+ private base64Convert;
79
86
  static ɵfac: i0.ɵɵFactoryDeclaration<DrChatFormWithHistoryComponent, never>;
80
- static ɵcmp: i0.ɵɵComponentDeclaration<DrChatFormWithHistoryComponent, "dr-chat-form-with-history", never, { "isChatMode": { "alias": "isChatMode"; "required": false; }; "message": { "alias": "message"; "required": false; }; "messagePlaceholder": { "alias": "messagePlaceholder"; "required": false; }; "dropFiles": { "alias": "dropFiles"; "required": false; }; "dropFilePlaceholder": { "alias": "dropFilePlaceholder"; "required": false; }; "waitForReply": { "alias": "waitForReply"; "required": false; }; "showDisabledButtonInsteadOfDotFlashing": { "alias": "showDisabledButtonInsteadOfDotFlashing"; "required": false; }; }, { "send": "send"; "abort": "abort"; "inputChange": "inputChange"; }, never, ["*"], false, never>;
87
+ static ɵcmp: i0.ɵɵComponentDeclaration<DrChatFormWithHistoryComponent, "dr-chat-form-with-history", never, { "isChatMode": { "alias": "isChatMode"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "message": { "alias": "message"; "required": false; }; "messagePlaceholder": { "alias": "messagePlaceholder"; "required": false; }; "dropFiles": { "alias": "dropFiles"; "required": false; }; "dropFilePlaceholder": { "alias": "dropFilePlaceholder"; "required": false; }; "waitForReply": { "alias": "waitForReply"; "required": false; }; "showDotFlashing": { "alias": "showDotFlashing"; "required": false; }; }, { "send": "send"; "uploadFiles": "uploadFiles"; "abort": "abort"; "inputChange": "inputChange"; }, never, ["*"], false, never>;
81
88
  }
@@ -1,6 +1,6 @@
1
1
  import { ChangeDetectorRef } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
- import { IChatDownloadFileMessage, IChatImageMessage, IChatMessageFile } from '../../../models/chat';
3
+ import { IFIle } from '../../../models/chat';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * Chat message component.
@@ -8,21 +8,8 @@ import * as i0 from "@angular/core";
8
8
  export declare class DrChatMessageFileComponent {
9
9
  protected cd: ChangeDetectorRef;
10
10
  protected domSanitizer: DomSanitizer;
11
- readyFiles: any[];
12
- /**
13
- * Message with file
14
- *
15
- * @type {IChatDownloadFileMessage | IChatImageMessage}
16
- */
17
- message: IChatDownloadFileMessage | IChatImageMessage;
18
- /**
19
- * Message file path
20
- *
21
- * @type {Date}
22
- */
23
- set files(files: IChatMessageFile[]);
11
+ files: Array<IFIle>;
24
12
  constructor(cd: ChangeDetectorRef, domSanitizer: DomSanitizer);
25
- isImage(file: IChatMessageFile): boolean;
26
13
  static ɵfac: i0.ɵɵFactoryDeclaration<DrChatMessageFileComponent, never>;
27
- static ɵcmp: i0.ɵɵComponentDeclaration<DrChatMessageFileComponent, "dr-chat-message-file", never, { "message": { "alias": "message"; "required": false; }; "files": { "alias": "files"; "required": false; }; }, {}, never, never, false, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<DrChatMessageFileComponent, "dr-chat-message-file", never, { "files": { "alias": "files"; "required": false; }; }, {}, never, never, false, never>;
28
15
  }
@@ -1,5 +1,9 @@
1
1
  import { IFeedback } from './feedback';
2
2
  export declare const IMAGE_TYPES: string[];
3
+ export interface IFIle extends Partial<File> {
4
+ id?: string;
5
+ data: string;
6
+ }
3
7
  export declare enum CHAT_MESSAGE_TYPE {
4
8
  TEXT = "text",
5
9
  RICH_TEXT = "rich-text",
@@ -8,7 +12,8 @@ export declare enum CHAT_MESSAGE_TYPE {
8
12
  MAILTO = "mailto",
9
13
  EMBED = "embed",
10
14
  INPUT = "input",
11
- CODE = "code"
15
+ CODE = "code",
16
+ ERROR = "error"
12
17
  }
13
18
  export declare enum ChatRole {
14
19
  USER = "user",
@@ -25,6 +30,7 @@ export interface IChatMessageBase extends IChatMessageRef {
25
30
  avatarUrl?: string;
26
31
  user?: any;
27
32
  subjectId?: string;
33
+ files?: Array<IFIle>;
28
34
  }
29
35
  export interface IChatTextMessage extends IChatMessageBase {
30
36
  kind: string | CHAT_MESSAGE_TYPE.TEXT;
@@ -66,5 +72,7 @@ export declare class ChatMessage implements IChatMessageBase, IChatTextMessage,
66
72
  user?: any;
67
73
  feedback?: IFeedback;
68
74
  subjectId?: string;
75
+ files?: Array<any>;
76
+ suggestions?: Array<string>;
69
77
  constructor(obj: any);
70
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/datarailsshared",
3
- "version": "1.5.576",
3
+ "version": "1.6.21",
4
4
  "description": "DataRails shared components",
5
5
  "keywords": [
6
6
  "angular",
package/public-api.d.ts CHANGED
@@ -95,6 +95,7 @@ export { TooltipInfoContext, TooltipInfoWidth, TooltipInfoIconTheme, } from './l
95
95
  export { Step } from './lib/stepper/interfaces/stepper';
96
96
  export * from './lib/dr-dialog/interfaces/dialog-data';
97
97
  export * from './lib/dr-avatar/types';
98
+ export { IFIle } from './lib/models/chat';
98
99
  export * from './lib/dr-inputs/dr-model-debounce-change.directive';
99
100
  export * from './lib/directives/click-outside/click-outside.directive';
100
101
  export * from './lib/directives/dr-shine-animation/dr-shine-animation.directive';