@servicemind.tis/tis-image-and-file-upload-and-view 1.2.23 → 1.2.25
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/fesm2022/servicemind.tis-tis-image-and-file-upload-and-view.mjs +154 -96
- package/fesm2022/servicemind.tis-tis-image-and-file-upload-and-view.mjs.map +1 -1
- package/lib/interfaces/socket-adapter.interface.d.ts +8 -1
- package/lib/services/tis-remote-upload.service.d.ts +12 -3
- package/lib/tis-image-and-file-upload-and-view.module.d.ts +10 -9
- package/lib/tis-qr-code-dialog/tis-qr-code-dialog.component.d.ts +15 -9
- package/package.json +3 -2
|
@@ -65,12 +65,19 @@ export interface TisSocketAdapter {
|
|
|
65
65
|
getUserId?(): string | Promise<string>;
|
|
66
66
|
/**
|
|
67
67
|
* Send a message directly via socket (for handshake and communication)
|
|
68
|
-
* @param message - The message to send { action: string
|
|
68
|
+
* @param message - The message to send { action: string; data: any }
|
|
69
69
|
*/
|
|
70
70
|
sendViaSocket?(message: {
|
|
71
71
|
action: string;
|
|
72
72
|
data: any;
|
|
73
73
|
}): void;
|
|
74
|
+
/**
|
|
75
|
+
* Call API via socket and get response as Observable
|
|
76
|
+
* @param route - The API route to call
|
|
77
|
+
* @param body - The request body
|
|
78
|
+
* @returns Observable that emits the API response
|
|
79
|
+
*/
|
|
80
|
+
callApiViaSocket?(route: string, body: any): Observable<any>;
|
|
74
81
|
}
|
|
75
82
|
/**
|
|
76
83
|
* Configuration for remote upload feature
|
|
@@ -88,7 +88,7 @@ export declare class TisRemoteUploadService implements OnDestroy {
|
|
|
88
88
|
*/
|
|
89
89
|
private buildQrUrl;
|
|
90
90
|
/**
|
|
91
|
-
* Send message to mobile device
|
|
91
|
+
* Send message to mobile device via channel
|
|
92
92
|
*/
|
|
93
93
|
sendToMobile(type: string, data: any): void;
|
|
94
94
|
/**
|
|
@@ -96,9 +96,13 @@ export declare class TisRemoteUploadService implements OnDestroy {
|
|
|
96
96
|
*/
|
|
97
97
|
private acceptMobileConnection;
|
|
98
98
|
/**
|
|
99
|
-
* Disconnect from mobile device
|
|
99
|
+
* Disconnect from mobile device - call API and clear local state
|
|
100
100
|
*/
|
|
101
|
-
disconnect(): void
|
|
101
|
+
disconnect(): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Handle disconnect initiated from remote (mobile) side
|
|
104
|
+
*/
|
|
105
|
+
private handleRemoteDisconnect;
|
|
102
106
|
/**
|
|
103
107
|
* Subscribe to channel for receiving messages from mobile
|
|
104
108
|
*/
|
|
@@ -107,6 +111,11 @@ export declare class TisRemoteUploadService implements OnDestroy {
|
|
|
107
111
|
* Handle incoming channel messages from mobile
|
|
108
112
|
*/
|
|
109
113
|
private handleChannelMessage;
|
|
114
|
+
/**
|
|
115
|
+
* Handle mobile-link-established message
|
|
116
|
+
* This is sent when mobile successfully connects via the backend
|
|
117
|
+
*/
|
|
118
|
+
private handleMobileLinkEstablished;
|
|
110
119
|
/**
|
|
111
120
|
* Handle connection state messages from mobile
|
|
112
121
|
*/
|
|
@@ -12,16 +12,17 @@ import * as i10 from "@angular/common";
|
|
|
12
12
|
import * as i11 from "@angular/common/http";
|
|
13
13
|
import * as i12 from "ngx-extended-pdf-viewer";
|
|
14
14
|
import * as i13 from "@angular/forms";
|
|
15
|
-
import * as i14 from "
|
|
16
|
-
import * as i15 from "@angular/material/
|
|
17
|
-
import * as i16 from "@angular/material/
|
|
18
|
-
import * as i17 from "@angular/material/
|
|
19
|
-
import * as i18 from "@angular/material/
|
|
20
|
-
import * as i19 from "@angular/material/
|
|
21
|
-
import * as i20 from "@angular/material/
|
|
22
|
-
import * as i21 from "@angular/
|
|
15
|
+
import * as i14 from "angularx-qrcode";
|
|
16
|
+
import * as i15 from "@angular/material/tooltip";
|
|
17
|
+
import * as i16 from "@angular/material/icon";
|
|
18
|
+
import * as i17 from "@angular/material/snack-bar";
|
|
19
|
+
import * as i18 from "@angular/material/progress-spinner";
|
|
20
|
+
import * as i19 from "@angular/material/input";
|
|
21
|
+
import * as i20 from "@angular/material/button";
|
|
22
|
+
import * as i21 from "@angular/material/dialog";
|
|
23
|
+
import * as i22 from "@angular/cdk/drag-drop";
|
|
23
24
|
export declare class TisImageAndFileUploadAndViewModule {
|
|
24
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<TisImageAndFileUploadAndViewModule, never>;
|
|
25
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TisImageAndFileUploadAndViewModule, [typeof i1.TisImageAndFileUploadAndViewComponent, typeof i2.TisPreviewImageComponent, typeof i3.TisFileViewerComponent, typeof i4.TisExcelFileViewerComponent, typeof i5.TisPdfViewerComponent, typeof i6.TisVideoComponent, typeof i7.TisErrorDialogComponent, typeof i8.TisConfirmationDialogComponent, typeof i9.TisQrCodeDialogComponent], [typeof i10.CommonModule, typeof i11.HttpClientModule, typeof i12.NgxExtendedPdfViewerModule, typeof i13.FormsModule, typeof i13.ReactiveFormsModule, typeof i14.
|
|
26
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TisImageAndFileUploadAndViewModule, [typeof i1.TisImageAndFileUploadAndViewComponent, typeof i2.TisPreviewImageComponent, typeof i3.TisFileViewerComponent, typeof i4.TisExcelFileViewerComponent, typeof i5.TisPdfViewerComponent, typeof i6.TisVideoComponent, typeof i7.TisErrorDialogComponent, typeof i8.TisConfirmationDialogComponent, typeof i9.TisQrCodeDialogComponent], [typeof i10.CommonModule, typeof i11.HttpClientModule, typeof i12.NgxExtendedPdfViewerModule, typeof i13.FormsModule, typeof i13.ReactiveFormsModule, typeof i14.QRCodeComponent, typeof i15.MatTooltipModule, typeof i16.MatIconModule, typeof i17.MatSnackBarModule, typeof i18.MatProgressSpinnerModule, typeof i19.MatInputModule, typeof i20.MatButtonModule, typeof i21.MatDialogModule, typeof i22.DragDropModule], [typeof i1.TisImageAndFileUploadAndViewComponent, typeof i9.TisQrCodeDialogComponent]>;
|
|
26
27
|
static ɵinj: i0.ɵɵInjectorDeclaration<TisImageAndFileUploadAndViewModule>;
|
|
27
28
|
}
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
import { OnInit, OnDestroy
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
3
|
import { TisRemoteUploadService } from '../services/tis-remote-upload.service';
|
|
4
4
|
import { TisRemoteUploadEvent } from '../interfaces/socket-adapter.interface';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
export interface FieldInfo {
|
|
7
|
+
label?: string;
|
|
8
|
+
accept?: string;
|
|
9
|
+
type?: 'image' | 'file';
|
|
10
|
+
entityType?: string;
|
|
11
|
+
entityId?: any;
|
|
12
|
+
isMultiple?: boolean;
|
|
13
|
+
limit?: number;
|
|
14
|
+
isCompressed?: boolean;
|
|
15
|
+
}
|
|
6
16
|
export interface TisQrCodeDialogData {
|
|
7
17
|
title?: string;
|
|
8
18
|
subtitle?: string;
|
|
9
19
|
qrSize?: number;
|
|
10
20
|
showCountdown?: boolean;
|
|
11
21
|
autoCloseOnUpload?: boolean;
|
|
22
|
+
fieldInfo?: FieldInfo;
|
|
12
23
|
}
|
|
13
24
|
export declare class TisQrCodeDialogComponent implements OnInit, OnDestroy {
|
|
14
25
|
dialogRef: MatDialogRef<TisQrCodeDialogComponent>;
|
|
15
26
|
data: TisQrCodeDialogData;
|
|
16
27
|
private remoteUploadService;
|
|
17
|
-
qrCanvas: ElementRef<HTMLCanvasElement>;
|
|
18
28
|
qrData: string;
|
|
19
29
|
expiresAt: number;
|
|
20
30
|
remainingTime: string;
|
|
@@ -37,15 +47,11 @@ export declare class TisQrCodeDialogComponent implements OnInit, OnDestroy {
|
|
|
37
47
|
private checkExistingConnection;
|
|
38
48
|
private generateQrCode;
|
|
39
49
|
private subscribeToEvents;
|
|
40
|
-
private startCountdown;
|
|
41
|
-
private renderQrCode;
|
|
42
50
|
/**
|
|
43
|
-
*
|
|
44
|
-
* In production, you'd use a library like qrcode or qrcode-generator
|
|
51
|
+
* Send field configuration to mobile device
|
|
45
52
|
*/
|
|
46
|
-
private
|
|
47
|
-
private
|
|
48
|
-
private drawFinderPattern;
|
|
53
|
+
private sendFieldInfoToMobile;
|
|
54
|
+
private startCountdown;
|
|
49
55
|
/**
|
|
50
56
|
* Format device ID for display
|
|
51
57
|
*/
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicemind.tis/tis-image-and-file-upload-and-view",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.25",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.2.0",
|
|
6
6
|
"@angular/core": "^19.2.0",
|
|
7
7
|
"@angular/material": "^19.2.8",
|
|
8
8
|
"@angular/cdk": "^19.2.8",
|
|
9
|
-
"ngx-extended-pdf-viewer": "^19.2.1"
|
|
9
|
+
"ngx-extended-pdf-viewer": "^19.2.1",
|
|
10
|
+
"angularx-qrcode": "^19.0.0"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"tslib": "^2.3.0"
|