@open-amt-cloud-toolkit/ui-toolkit-angular 9.1.2 → 11.0.1

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 (35) hide show
  1. package/README.md +8 -8
  2. package/fesm2022/{open-amt-cloud-toolkit-ui-toolkit-angular-ider.mjs → device-management-toolkit-ui-toolkit-angular-ider.mjs} +22 -19
  3. package/fesm2022/device-management-toolkit-ui-toolkit-angular-ider.mjs.map +1 -0
  4. package/fesm2022/device-management-toolkit-ui-toolkit-angular-kvm.mjs +346 -0
  5. package/fesm2022/device-management-toolkit-ui-toolkit-angular-kvm.mjs.map +1 -0
  6. package/fesm2022/{open-amt-cloud-toolkit-ui-toolkit-angular-sol.mjs → device-management-toolkit-ui-toolkit-angular-sol.mjs} +28 -33
  7. package/fesm2022/device-management-toolkit-ui-toolkit-angular-sol.mjs.map +1 -0
  8. package/fesm2022/{open-amt-cloud-toolkit-ui-toolkit-angular.mjs → device-management-toolkit-ui-toolkit-angular.mjs} +268 -110
  9. package/fesm2022/device-management-toolkit-ui-toolkit-angular.mjs.map +1 -0
  10. package/package.json +20 -12
  11. package/types/device-management-toolkit-ui-toolkit-angular-ider.d.ts +39 -0
  12. package/types/device-management-toolkit-ui-toolkit-angular-kvm.d.ts +55 -0
  13. package/types/device-management-toolkit-ui-toolkit-angular-sol.d.ts +33 -0
  14. package/types/device-management-toolkit-ui-toolkit-angular.d.ts +117 -0
  15. package/fesm2022/open-amt-cloud-toolkit-ui-toolkit-angular-ider.mjs.map +0 -1
  16. package/fesm2022/open-amt-cloud-toolkit-ui-toolkit-angular-kvm.mjs +0 -186
  17. package/fesm2022/open-amt-cloud-toolkit-ui-toolkit-angular-kvm.mjs.map +0 -1
  18. package/fesm2022/open-amt-cloud-toolkit-ui-toolkit-angular-sol.mjs.map +0 -1
  19. package/fesm2022/open-amt-cloud-toolkit-ui-toolkit-angular.mjs.map +0 -1
  20. package/ider/ider.component.d.ts +0 -34
  21. package/ider/index.d.ts +0 -5
  22. package/ider/public_api.d.ts +0 -1
  23. package/ider/src/ider.component.d.ts +0 -34
  24. package/index.d.ts +0 -5
  25. package/kvm/index.d.ts +0 -5
  26. package/kvm/kvm.component.d.ts +0 -54
  27. package/kvm/public_api.d.ts +0 -5
  28. package/kvm/src/kvm.component.d.ts +0 -54
  29. package/public-api.d.ts +0 -7
  30. package/sol/index.d.ts +0 -5
  31. package/sol/public_api.d.ts +0 -5
  32. package/sol/sol.component.d.ts +0 -35
  33. package/sol/src/sol.component.d.ts +0 -35
  34. package/sol/src/terminal/terminal.component.d.ts +0 -15
  35. package/sol/terminal/terminal.component.d.ts +0 -15
@@ -1,7 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, output, Component, EventEmitter, ViewEncapsulation, inject, Renderer2, viewChild, effect } from '@angular/core';
2
+ import { input, output, Component, inject, DestroyRef, effect, ViewEncapsulation, Renderer2, viewChild, signal } from '@angular/core';
3
3
  import { Terminal } from '@xterm/xterm';
4
- import { AmtTerminal, TerminalDataProcessor, Protocol, AMTRedirector, AMTKvmDataRedirector, AMTDesktop, DataProcessor, MouseHelper, KeyBoardHelper, AMTIDER } from '@open-amt-cloud-toolkit/ui-toolkit/core';
4
+ import { AmtTerminal, TerminalDataProcessor, Protocol, AMTRedirector, AMTKvmDataRedirector, AMTDesktop, DataProcessor, MouseHelper, KeyBoardHelper, AMTIDER } from '@device-management-toolkit/ui-toolkit/core';
5
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
6
  import { fromEvent, timer } from 'rxjs';
6
7
  import { throttleTime } from 'rxjs/operators';
7
8
 
@@ -14,7 +15,7 @@ class TerminalComponent {
14
15
  // TODO: Notes from signal input migration:
15
16
  // Input is initialized to `undefined` but type does not allow this value.
16
17
  // This worked with `@Input` because your project uses `--strictPropertyInitialization=false`.
17
- this.term = input(undefined);
18
+ this.term = input(undefined, ...(ngDevMode ? [{ debugName: "term" }] : []));
18
19
  this.handleKeyPress = output();
19
20
  }
20
21
  ngOnInit() {
@@ -58,13 +59,13 @@ class TerminalComponent {
58
59
  this.handleKeyPress.emit(key);
59
60
  });
60
61
  }
61
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TerminalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
62
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.1", type: TerminalComponent, isStandalone: true, selector: "amt-terminal", inputs: { term: { classPropertyName: "term", publicName: "term", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { handleKeyPress: "handleKeyPress" }, ngImport: i0, template: "<div id=\"terminal\" class=\"xtermDisplay\" style=\"width: fit-content\"></div>\n" }); }
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TerminalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
63
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: TerminalComponent, isStandalone: true, selector: "amt-terminal", inputs: { term: { classPropertyName: "term", publicName: "term", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { handleKeyPress: "handleKeyPress" }, ngImport: i0, template: "<div id=\"terminal\" class=\"xtermDisplay\" style=\"width: fit-content\"></div>\n" }); }
63
64
  }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TerminalComponent, decorators: [{
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TerminalComponent, decorators: [{
65
66
  type: Component,
66
67
  args: [{ selector: 'amt-terminal', template: "<div id=\"terminal\" class=\"xtermDisplay\" style=\"width: fit-content\"></div>\n" }]
67
- }] });
68
+ }], propDecorators: { term: [{ type: i0.Input, args: [{ isSignal: true, alias: "term", required: false }] }], handleKeyPress: [{ type: i0.Output, args: ["handleKeyPress"] }] } });
68
69
 
69
70
  /*********************************************************************
70
71
  * Copyright (c) Intel Corporation 2023
@@ -72,32 +73,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
72
73
  **********************************************************************/
73
74
  class SOLComponent {
74
75
  constructor() {
76
+ this.destroyRef = inject(DestroyRef);
75
77
  this.deviceState = 0;
76
78
  this.deviceStatus = output();
77
- this.deviceConnection = input(new EventEmitter());
78
- this.mpsServer = input('');
79
- this.authToken = input('');
80
- this.deviceId = input('');
81
- }
82
- ngOnInit() {
83
- this.deviceConnection().subscribe((data) => {
84
- if (data) {
85
- this.init();
79
+ this.deviceConnection = input(false, ...(ngDevMode ? [{ debugName: "deviceConnection" }] : []));
80
+ this.mpsServer = input('', ...(ngDevMode ? [{ debugName: "mpsServer" }] : []));
81
+ this.authToken = input('', ...(ngDevMode ? [{ debugName: "authToken" }] : []));
82
+ this.deviceId = input('', ...(ngDevMode ? [{ debugName: "deviceId" }] : []));
83
+ // React to deviceConnection changes
84
+ effect(() => {
85
+ const connected = this.deviceConnection();
86
+ if (connected) {
87
+ if (this.redirector == null) {
88
+ this.instantiate();
89
+ }
90
+ this.startSol();
86
91
  }
87
- else {
92
+ else if (this.redirector != null) {
88
93
  this.stopSol();
89
94
  }
90
95
  });
91
96
  }
92
- ngAfterViewInit() {
93
- this.init();
94
- }
95
- init() {
96
- this.instantiate();
97
- setTimeout(() => {
98
- this.startSol();
99
- }, 4000);
100
- }
101
97
  instantiate() {
102
98
  this.terminal = new AmtTerminal();
103
99
  this.dataProcessor = new TerminalDataProcessor(this.terminal);
@@ -142,12 +138,12 @@ class SOLComponent {
142
138
  this.deviceState = state;
143
139
  }
144
140
  startSol() {
145
- if (this.redirector !== null) {
141
+ if (this.redirector != null) {
146
142
  this.redirector.start(WebSocket);
147
143
  }
148
144
  }
149
145
  stopSol() {
150
- if (this.redirector !== null) {
146
+ if (this.redirector != null) {
151
147
  this.redirector.stop();
152
148
  this.handleClearTerminal();
153
149
  this.term?.dispose();
@@ -164,13 +160,13 @@ class SOLComponent {
164
160
  ngOnDestroy() {
165
161
  this.stopSol();
166
162
  }
167
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: SOLComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
168
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: SOLComponent, isStandalone: true, selector: "amt-sol", inputs: { deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus" }, ngImport: i0, template: "<div class=\"container\">\n @if (deviceState === 3) {\n <amt-terminal [term]=\"term\" (handleKeyPress)=\"handleKeyPress($event)\"></amt-terminal>\n }\n</div>\n", styles: [".container{display:block;text-align:center}.xtermDisplay{display:inline-block}\n"], dependencies: [{ kind: "component", type: TerminalComponent, selector: "amt-terminal", inputs: ["term"], outputs: ["handleKeyPress"] }], encapsulation: i0.ViewEncapsulation.None }); }
163
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SOLComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
164
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: SOLComponent, isStandalone: true, selector: "amt-sol", inputs: { deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus" }, ngImport: i0, template: "<div class=\"container\">\n @if (deviceState === 3) {\n <amt-terminal [term]=\"term\" (handleKeyPress)=\"handleKeyPress($event)\"></amt-terminal>\n }\n</div>\n", styles: [".container{display:block;text-align:center}.xtermDisplay{display:inline-block}\n"], dependencies: [{ kind: "component", type: TerminalComponent, selector: "amt-terminal", inputs: ["term"], outputs: ["handleKeyPress"] }], encapsulation: i0.ViewEncapsulation.None }); }
169
165
  }
170
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: SOLComponent, decorators: [{
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SOLComponent, decorators: [{
171
167
  type: Component,
172
168
  args: [{ selector: 'amt-sol', encapsulation: ViewEncapsulation.None, imports: [TerminalComponent], template: "<div class=\"container\">\n @if (deviceState === 3) {\n <amt-terminal [term]=\"term\" (handleKeyPress)=\"handleKeyPress($event)\"></amt-terminal>\n }\n</div>\n", styles: [".container{display:block;text-align:center}.xtermDisplay{display:inline-block}\n"] }]
173
- }] });
169
+ }], ctorParameters: () => [], propDecorators: { deviceStatus: [{ type: i0.Output, args: ["deviceStatus"] }], deviceConnection: [{ type: i0.Input, args: [{ isSignal: true, alias: "deviceConnection", required: false }] }], mpsServer: [{ type: i0.Input, args: [{ isSignal: true, alias: "mpsServer", required: false }] }], authToken: [{ type: i0.Input, args: [{ isSignal: true, alias: "authToken", required: false }] }], deviceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "deviceId", required: false }] }] } });
174
170
 
175
171
  /*********************************************************************
176
172
  * Copyright (c) Intel Corporation 2023
@@ -179,20 +175,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
179
175
  class KVMComponent {
180
176
  constructor() {
181
177
  this.renderer = inject(Renderer2);
182
- this.canvas = viewChild('canvas');
178
+ this.destroyRef = inject(DestroyRef);
179
+ this.KEY_SEQUENCE_DELAY_MS = 10;
180
+ this.canvas = viewChild('canvas', ...(ngDevMode ? [{ debugName: "canvas" }] : []));
183
181
  this.device = viewChild.required('device');
184
- this.isFullscreen = input(false);
185
- //setting a width and height for the canvas
186
- this.width = 400;
187
- this.height = 400;
188
- this.mpsServer = input('');
189
- this.authToken = input('');
190
- this.deviceId = input('');
182
+ // Canvas properties
183
+ this.context = null;
184
+ this.width = signal(400, ...(ngDevMode ? [{ debugName: "width" }] : []));
185
+ this.height = signal(400, ...(ngDevMode ? [{ debugName: "height" }] : []));
186
+ // Input properties
187
+ this.isFullscreen = input(false, ...(ngDevMode ? [{ debugName: "isFullscreen" }] : []));
188
+ this.mpsServer = input('', ...(ngDevMode ? [{ debugName: "mpsServer" }] : []));
189
+ this.authToken = input('', ...(ngDevMode ? [{ debugName: "authToken" }] : []));
190
+ this.deviceId = input('', ...(ngDevMode ? [{ debugName: "deviceId" }] : []));
191
+ // Input/Output properties
191
192
  this.deviceStatus = output();
192
- this.deviceConnection = input(new EventEmitter());
193
- this.selectedEncoding = input(new EventEmitter());
194
- this.powerState = 0;
195
- this.selected = 1;
193
+ this.deviceConnection = input(false, ...(ngDevMode ? [{ debugName: "deviceConnection" }] : []));
194
+ this.selectedEncoding = input(1, ...(ngDevMode ? [{ debugName: "selectedEncoding" }] : []));
195
+ this.selectedHotkey = input('', ...(ngDevMode ? [{ debugName: "selectedHotkey" }] : []));
196
+ // Component state
197
+ this.module = null;
198
+ this.redirector = null;
199
+ this.dataProcessor = null;
200
+ this.mouseHelper = null;
201
+ this.keyboardHelper = null;
202
+ this.selected = signal(1, ...(ngDevMode ? [{ debugName: "selected" }] : []));
203
+ this.isEncodingChange = false;
196
204
  this.encodings = [
197
205
  { value: 1, viewValue: 'RLE 8' },
198
206
  { value: 2, viewValue: 'RLE 16' }
@@ -200,39 +208,42 @@ class KVMComponent {
200
208
  this.onConnectionStateChange = (redirector, state) => {
201
209
  this.deviceStatus.emit(state);
202
210
  };
203
- this.reset = () => {
204
- this.redirector = null;
205
- this.module = null;
206
- this.dataProcessor = null;
207
- this.height = 400;
208
- this.width = 400;
209
- this.instantiate();
210
- };
211
- this.stopKvm = () => {
212
- this.redirector?.stop();
213
- this.keyboardHelper.UnGrabKeyInput();
214
- this.reset();
215
- };
216
211
  effect(() => {
217
212
  this.toggleFullscreen();
218
213
  });
219
- }
220
- ngOnInit() {
221
- this.deviceConnection().subscribe((data) => {
222
- if (data) {
214
+ // React to deviceConnection changes
215
+ effect(() => {
216
+ const connected = this.deviceConnection();
217
+ if (connected && this.redirector == null && !this.isEncodingChange) {
218
+ console.log('KVMComponent: Device connected, initializing KVM...');
223
219
  this.init();
224
220
  }
225
- else {
221
+ else if (!connected && this.redirector != null) {
222
+ console.log('KVMComponent: Device disconnected, stopping KVM...');
226
223
  this.stopKvm();
227
224
  }
228
225
  });
229
- this.selectedEncoding().subscribe((data) => {
230
- this.selected = data;
231
- this.onEncodingChange();
226
+ // React to selectedEncoding changes
227
+ effect(() => {
228
+ if (this.selectedEncoding() === this.selected() || !this.deviceConnection())
229
+ return;
230
+ console.log('KVMComponent: Encoding changed to', this.selectedEncoding());
231
+ const encoding = this.selectedEncoding();
232
+ this.selected.set(encoding);
233
+ // Set flag to prevent connection effect interference
234
+ if (this.redirector != null) {
235
+ this.isEncodingChange = true;
236
+ this.onEncodingChange();
237
+ }
238
+ });
239
+ // React to selectedHotkey changes
240
+ effect(() => {
241
+ const hotkey = this.selectedHotkey();
242
+ if (hotkey && this.deviceConnection() && this.keyboardHelper) {
243
+ console.log('KVMComponent: Hotkey triggered:', hotkey);
244
+ this.sendHotkey(hotkey);
245
+ }
232
246
  });
233
- }
234
- ngAfterViewInit() {
235
- this.init();
236
247
  }
237
248
  toggleFullscreen() {
238
249
  const canvasElement = this.canvas()?.nativeElement;
@@ -250,13 +261,11 @@ class KVMComponent {
250
261
  }
251
262
  this.renderer.removeClass(canvasElement, 'fullscreen');
252
263
  }
253
- if (this.mouseHelper != null) {
254
- this.mouseHelper.resetOffsets();
255
- }
264
+ this.mouseHelper?.resetOffsets();
256
265
  }
257
266
  instantiate() {
258
267
  const canvas = this.canvas();
259
- this.context = canvas?.nativeElement.getContext('2d');
268
+ this.context = canvas?.nativeElement.getContext('2d') || null;
260
269
  const config = {
261
270
  mode: 'kvm',
262
271
  protocol: Protocol.KVM,
@@ -283,12 +292,11 @@ class KVMComponent {
283
292
  this.redirector.onError = this.onRedirectorError.bind(this);
284
293
  this.module.onSend = this.redirector.send.bind(this.redirector);
285
294
  this.module.onProcessData = this.dataProcessor.processData.bind(this.dataProcessor);
286
- this.module.bpp = this.selected;
287
- this.mouseMove = fromEvent(canvas?.nativeElement, 'mousemove');
288
- this.mouseMove.pipe(throttleTime(200)).subscribe((event) => {
289
- if (this.mouseHelper != null) {
290
- this.mouseHelper.mousemove(event);
291
- }
295
+ this.module.bpp = this.selected();
296
+ this.mouseMove$ = fromEvent(canvas?.nativeElement, 'mousemove')
297
+ .pipe(throttleTime(200), takeUntilDestroyed(this.destroyRef))
298
+ .subscribe((event) => {
299
+ this.mouseHelper?.mousemove(event);
292
300
  });
293
301
  }
294
302
  onRedirectorError() {
@@ -301,62 +309,212 @@ class KVMComponent {
301
309
  }, 4000);
302
310
  }
303
311
  autoConnect() {
304
- if (this.redirector != null) {
312
+ if (this.redirector) {
305
313
  this.redirector.start(WebSocket);
306
- this.keyboardHelper.GrabKeyInput();
314
+ this.keyboardHelper?.GrabKeyInput();
307
315
  }
308
316
  }
309
317
  onEncodingChange() {
310
318
  this.stopKvm();
311
319
  timer(1000).subscribe(() => {
312
- this.autoConnect();
320
+ // Need to reinitialize since stopKvm() reset the redirector to null
321
+ this.init();
322
+ // Note: Parent component handles clearing isEncodingChange flag after full process
313
323
  });
314
324
  }
325
+ reset() {
326
+ this.redirector = null;
327
+ this.module = null;
328
+ this.dataProcessor = null;
329
+ this.height.set(400);
330
+ this.width.set(400);
331
+ }
332
+ stopKvm() {
333
+ this.redirector?.stop();
334
+ this.keyboardHelper?.UnGrabKeyInput();
335
+ this.reset();
336
+ }
315
337
  onMouseup(event) {
316
- if (this.mouseHelper != null) {
317
- this.mouseHelper.mouseup(event);
318
- }
338
+ this.mouseHelper?.mouseup(event);
319
339
  }
320
340
  onMousedown(event) {
321
- if (this.mouseHelper != null) {
322
- this.mouseHelper.mousedown(event);
323
- }
341
+ this.mouseHelper?.mousedown(event);
324
342
  }
325
343
  onMousemove(event) {
326
- if (this.mouseHelper != null) {
327
- this.mouseHelper.mousemove(event);
344
+ this.mouseHelper?.mousemove(event);
345
+ }
346
+ sendHotkey(hotKeyType) {
347
+ if (!this.keyboardHelper) {
348
+ console.warn('KVMComponent: Cannot send hotkey - keyboard helper not available');
349
+ return;
350
+ }
351
+ const keySequence = this.getKeySequence(hotKeyType);
352
+ if (keySequence?.keys) {
353
+ console.log('KVMComponent: Sending hotkey sequence for', hotKeyType);
354
+ // Send each key in the sequence with a small delay
355
+ keySequence.keys.forEach((key, index) => {
356
+ setTimeout(() => {
357
+ // Use the KeyboardHelper's existing handleKeyEvent method
358
+ // 0 = Up, 1 = Down (from the UpDown enum)
359
+ const upDown = key.down ? 1 : 0;
360
+ // Create a mock keyboard event with the key code
361
+ const mockEvent = {
362
+ keyCode: key.code,
363
+ preventDefault: () => { },
364
+ stopPropagation: () => { }
365
+ };
366
+ // Use the existing handleKeyEvent method
367
+ this.keyboardHelper.handleKeyEvent(upDown, mockEvent);
368
+ }, index * this.KEY_SEQUENCE_DELAY_MS); // delay between keys
369
+ });
370
+ }
371
+ }
372
+ getKeySequence(hotKeyType) {
373
+ // Based on the KeyBoardHelper, these are the key codes for various combinations
374
+ switch (hotKeyType) {
375
+ case 'ctrl-alt-del':
376
+ return {
377
+ keys: [
378
+ { code: 17, down: true }, // Ctrl down (JS keyCode)
379
+ { code: 18, down: true }, // Alt down (JS keyCode)
380
+ { code: 46, down: true }, // Delete down (JS keyCode)
381
+ { code: 46, down: false }, // Delete up (JS keyCode)
382
+ { code: 18, down: false }, // Alt up (JS keyCode)
383
+ { code: 17, down: false } // Ctrl up (JS keyCode)
384
+ ]
385
+ };
386
+ case 'alt-tab':
387
+ return {
388
+ keys: [
389
+ { code: 18, down: true }, // Alt down (JS keyCode)
390
+ { code: 9, down: true }, // Tab down (JS keyCode)
391
+ { code: 9, down: false }, // Tab up (JS keyCode)
392
+ { code: 18, down: false } // Alt up (JS keyCode)
393
+ ]
394
+ };
395
+ case 'alt-release':
396
+ return {
397
+ keys: [
398
+ { code: 18, down: false } // Alt up (JS keyCode)
399
+ ]
400
+ };
401
+ case 'windows':
402
+ return {
403
+ keys: [
404
+ { code: 0xffe7, down: true }, // Windows key down
405
+ { code: 0xffe7, down: false } // Windows key up
406
+ ]
407
+ };
408
+ case 'windows-l':
409
+ return {
410
+ keys: [
411
+ { code: 0xffe7, down: true }, // Windows down
412
+ { code: 108, down: true }, // L down
413
+ { code: 108, down: false }, // L up
414
+ { code: 0xffe7, down: false } // Windows up
415
+ ]
416
+ };
417
+ case 'windows-r':
418
+ return {
419
+ keys: [
420
+ { code: 0xffe7, down: true }, // Windows down
421
+ { code: 82, down: true }, // R down
422
+ { code: 82, down: false }, // R up
423
+ { code: 0xffe7, down: false } // Windows up
424
+ ]
425
+ };
426
+ case 'windows-up':
427
+ return {
428
+ keys: [
429
+ { code: 0xffe7, down: true }, // Windows down
430
+ { code: 0xff52, down: true }, // Up arrow down
431
+ { code: 0xff52, down: false }, // Up arrow up
432
+ { code: 0xffe7, down: false } // Windows up
433
+ ]
434
+ };
435
+ case 'windows-down':
436
+ return {
437
+ keys: [
438
+ { code: 0xffe7, down: true }, // Windows down
439
+ { code: 0xff54, down: true }, // Down arrow down
440
+ { code: 0xff54, down: false }, // Down arrow up
441
+ { code: 0xffe7, down: false } // Windows up
442
+ ]
443
+ };
444
+ case 'windows-left':
445
+ return {
446
+ keys: [
447
+ { code: 0xffe7, down: true }, // Windows down
448
+ { code: 0xff51, down: true }, // Left arrow down
449
+ { code: 0xff51, down: false }, // Left arrow up
450
+ { code: 0xffe7, down: false } // Windows up
451
+ ]
452
+ };
453
+ case 'windows-right':
454
+ return {
455
+ keys: [
456
+ { code: 0xffe7, down: true }, // Windows down
457
+ { code: 0xff53, down: true }, // Right arrow down
458
+ { code: 0xff53, down: false }, // Right arrow up
459
+ { code: 0xffe7, down: false } // Windows up
460
+ ]
461
+ };
462
+ case 'alt-f4':
463
+ return {
464
+ keys: [
465
+ { code: 0xffe9, down: true }, // Alt down
466
+ { code: 0xffc1, down: true }, // F4 down (F1 = 0xffbe, so F4 = 0xffc1)
467
+ { code: 0xffc1, down: false }, // F4 up
468
+ { code: 0xffe9, down: false } // Alt up
469
+ ]
470
+ };
471
+ case 'ctrl-w':
472
+ return {
473
+ keys: [
474
+ { code: 0xffe3, down: true }, // Ctrl down
475
+ { code: 87, down: true }, // W down
476
+ { code: 87, down: false }, // W up
477
+ { code: 0xffe3, down: false } // Ctrl up
478
+ ]
479
+ };
480
+ default:
481
+ return null;
328
482
  }
329
483
  }
330
484
  ngOnDestroy() {
485
+ this.mouseMove$?.unsubscribe();
331
486
  this.stopKvm();
332
487
  }
333
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: KVMComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
334
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: KVMComponent, isStandalone: true, selector: "amt-kvm", inputs: { isFullscreen: { classPropertyName: "isFullscreen", publicName: "isFullscreen", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null }, deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, selectedEncoding: { classPropertyName: "selectedEncoding", publicName: "selectedEncoding", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "device", first: true, predicate: ["device"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n", styles: [".canvas{max-height:80%;max-width:100%}canvas.fullscreen{height:100vh!important}\n"] }); }
488
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: KVMComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
489
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: KVMComponent, isStandalone: true, selector: "amt-kvm", inputs: { isFullscreen: { classPropertyName: "isFullscreen", publicName: "isFullscreen", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null }, deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, selectedEncoding: { classPropertyName: "selectedEncoding", publicName: "selectedEncoding", isSignal: true, isRequired: false, transformFunction: null }, selectedHotkey: { classPropertyName: "selectedHotkey", publicName: "selectedHotkey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "device", first: true, predicate: ["device"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n", styles: [".canvas{max-height:80%;max-width:100%}canvas.fullscreen{height:100vh!important}\n"] }); }
335
490
  }
336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: KVMComponent, decorators: [{
491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: KVMComponent, decorators: [{
337
492
  type: Component,
338
493
  args: [{ selector: 'amt-kvm', template: "<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n", styles: [".canvas{max-height:80%;max-width:100%}canvas.fullscreen{height:100vh!important}\n"] }]
339
- }], ctorParameters: () => [] });
494
+ }], ctorParameters: () => [], propDecorators: { canvas: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], device: [{ type: i0.ViewChild, args: ['device', { isSignal: true }] }], isFullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFullscreen", required: false }] }], mpsServer: [{ type: i0.Input, args: [{ isSignal: true, alias: "mpsServer", required: false }] }], authToken: [{ type: i0.Input, args: [{ isSignal: true, alias: "authToken", required: false }] }], deviceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "deviceId", required: false }] }], deviceStatus: [{ type: i0.Output, args: ["deviceStatus"] }], deviceConnection: [{ type: i0.Input, args: [{ isSignal: true, alias: "deviceConnection", required: false }] }], selectedEncoding: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedEncoding", required: false }] }], selectedHotkey: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedHotkey", required: false }] }] } });
340
495
 
341
496
  class IDERComponent {
342
497
  constructor() {
498
+ this.destroyRef = inject(DestroyRef);
343
499
  this.deviceState = 0;
344
500
  this.deviceStatus = output();
345
501
  this.iderData = output();
346
- this.deviceConnection = input(new EventEmitter());
347
- this.cdrom = input(null);
348
- this.floppy = input(null);
349
- this.mpsServer = input('');
350
- this.authToken = input('');
351
- this.deviceId = input('');
502
+ this.deviceConnection = input(false, ...(ngDevMode ? [{ debugName: "deviceConnection" }] : []));
503
+ this.cdrom = input(null, ...(ngDevMode ? [{ debugName: "cdrom" }] : []));
504
+ this.floppy = input(null, ...(ngDevMode ? [{ debugName: "floppy" }] : []));
505
+ this.mpsServer = input('', ...(ngDevMode ? [{ debugName: "mpsServer" }] : []));
506
+ this.authToken = input('', ...(ngDevMode ? [{ debugName: "authToken" }] : []));
507
+ this.deviceId = input('', ...(ngDevMode ? [{ debugName: "deviceId" }] : []));
352
508
  this.onConnectionStateChange = (redirector, state) => {
353
509
  this.deviceStatus.emit(state);
354
510
  };
355
- }
356
- ngOnInit() {
357
- this.deviceConnection().subscribe((data) => {
358
- if (data) {
359
- this.init();
511
+ // React to deviceConnection changes
512
+ effect(() => {
513
+ const connected = this.deviceConnection();
514
+ if (connected) {
515
+ if (this.redirector == null) {
516
+ this.init();
517
+ }
360
518
  }
361
519
  else {
362
520
  this.stopIder();
@@ -427,7 +585,7 @@ class IDERComponent {
427
585
  });
428
586
  }
429
587
  stopIder() {
430
- if (this.redirector !== null) {
588
+ if (this.redirector != null) {
431
589
  this.redirector.stop();
432
590
  this.cleanup();
433
591
  }
@@ -441,13 +599,13 @@ class IDERComponent {
441
599
  this.ider.stop();
442
600
  }
443
601
  }
444
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: IDERComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
445
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.1", type: IDERComponent, isStandalone: true, selector: "amt-ider", inputs: { deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, cdrom: { classPropertyName: "cdrom", publicName: "cdrom", isSignal: true, isRequired: false, transformFunction: null }, floppy: { classPropertyName: "floppy", publicName: "floppy", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus", iderData: "iderData" }, ngImport: i0, template: '', isInline: true }); }
602
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: IDERComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
603
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: IDERComponent, isStandalone: true, selector: "amt-ider", inputs: { deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, cdrom: { classPropertyName: "cdrom", publicName: "cdrom", isSignal: true, isRequired: false, transformFunction: null }, floppy: { classPropertyName: "floppy", publicName: "floppy", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus", iderData: "iderData" }, ngImport: i0, template: '', isInline: true }); }
446
604
  }
447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: IDERComponent, decorators: [{
605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: IDERComponent, decorators: [{
448
606
  type: Component,
449
607
  args: [{ selector: 'amt-ider', template: '' }]
450
- }] });
608
+ }], ctorParameters: () => [], propDecorators: { deviceStatus: [{ type: i0.Output, args: ["deviceStatus"] }], iderData: [{ type: i0.Output, args: ["iderData"] }], deviceConnection: [{ type: i0.Input, args: [{ isSignal: true, alias: "deviceConnection", required: false }] }], cdrom: [{ type: i0.Input, args: [{ isSignal: true, alias: "cdrom", required: false }] }], floppy: [{ type: i0.Input, args: [{ isSignal: true, alias: "floppy", required: false }] }], mpsServer: [{ type: i0.Input, args: [{ isSignal: true, alias: "mpsServer", required: false }] }], authToken: [{ type: i0.Input, args: [{ isSignal: true, alias: "authToken", required: false }] }], deviceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "deviceId", required: false }] }] } });
451
609
 
452
610
  /*********************************************************************
453
611
  * Copyright (c) Intel Corporation 2023
@@ -462,4 +620,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
462
620
  */
463
621
 
464
622
  export { IDERComponent, KVMComponent, SOLComponent };
465
- //# sourceMappingURL=open-amt-cloud-toolkit-ui-toolkit-angular.mjs.map
623
+ //# sourceMappingURL=device-management-toolkit-ui-toolkit-angular.mjs.map