ets-fe-ng-sdk 17.0.309 → 17.0.310

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.
@@ -3,10 +3,10 @@ import { FormControl, Validators, FormArray, FormGroup, FormBuilder, NG_VALUE_AC
3
3
  import 'zone.js/plugins/zone-error';
4
4
  import { cloneDeep, clone, isEqual, isEmpty, uniqBy } from 'lodash-es';
5
5
  import * as i0 from '@angular/core';
6
- import { Injectable, Pipe, NgModule, signal, inject, Directive, Input, booleanAttribute, input, computed, EventEmitter, DestroyRef, effect, Component, Output, ViewChild, forwardRef, HostListener, viewChild, Inject, HostBinding, ContentChild, InjectionToken, ErrorHandler } from '@angular/core';
6
+ import { Injectable, Pipe, NgModule, signal, inject, Directive, Input, booleanAttribute, input, computed, EventEmitter, DestroyRef, effect, Component, Output, ViewChild, forwardRef, HostListener, viewChild, Inject, HostBinding, ContentChild, model, InjectionToken, ErrorHandler } from '@angular/core';
7
7
  import * as i1$1 from '@angular/common';
8
8
  import { CommonModule, Location, CurrencyPipe, TitleCasePipe, DatePipe, DecimalPipe, NgClass, AsyncPipe, NgIf, NgFor, UpperCasePipe, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NgStyle, JsonPipe } from '@angular/common';
9
- import { faPlus, faSlidersH, faMoneyCheck, faCancel, faCheck, faListAlt, faClone, faCogs, faTrash, faDownload, faEdit, faFileExport, faFile, faFilter, faPenFancy, faUserShield, faHistory, faHome, faFileImport, faInfoCircle, faLock, faArrowRight, faPen, faArrowLeft, faRecycle, faSave, faSearch, faEye, faBellSlash, faUpload, faUnlock, faUsers, faTruck, faTag, faReceipt, faBank, faArrowsH, faPlay, faPercent, faHandshake, faCircleExclamation, faTable, faSpoon } from '@fortawesome/free-solid-svg-icons';
9
+ import { faPlus, faSlidersH, faMoneyCheck, faCancel, faCheck, faListAlt, faClone, faCogs, faTrash, faDownload, faEdit, faFileExport, faFile, faFilter, faPenFancy, faUserShield, faHistory, faHome, faFileImport, faInfoCircle, faLock, faArrowRight, faPause, faPen, faArrowLeft, faRecycle, faSave, faSearch, faEye, faBellSlash, faUpload, faUnlock, faUsers, faStop, faTruck, faTag, faReceipt, faBank, faArrowsH, faPlay, faPercent, faHandshake, faCircleExclamation, faTable, faSpoon } from '@fortawesome/free-solid-svg-icons';
10
10
  import { faPaperPlane } from '@fortawesome/free-regular-svg-icons';
11
11
  import { timer, take, tap, merge, Observable, BehaviorSubject, debounceTime, filter, ReplaySubject, lastValueFrom, isObservable, of, firstValueFrom, throwError, fromEvent, map as map$1, distinct, interval, concat, Subject, debounce } from 'rxjs';
12
12
  import { catchError, tap as tap$1, map, retry, debounceTime as debounceTime$1, filter as filter$1, startWith, switchMap, first, timeout } from 'rxjs/operators';
@@ -52,14 +52,14 @@ import * as i6$1 from '@angular/material/button-toggle';
52
52
  import { MatButtonToggleModule } from '@angular/material/button-toggle';
53
53
  import { toSignal } from '@angular/core/rxjs-interop';
54
54
  import PerfectScrollbar from 'perfect-scrollbar';
55
- import { moveItemInArray, transferArrayItem, CdkDropList, CdkDrag, CdkDragPlaceholder, CdkDragHandle } from '@angular/cdk/drag-drop';
56
- import * as i1$4 from '@angular/material/slide-toggle';
57
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
58
55
  import { NGTelInputDirective } from '@serene-dev/ng-tel-input';
59
56
  import * as i2$2 from 'ngx-quill';
60
57
  import { QuillEditorComponent, QuillModule } from 'ngx-quill';
61
58
  import 'quill-emoji/dist/quill-emoji.js';
62
59
  import 'quill-mention';
60
+ import { moveItemInArray, transferArrayItem, CdkDropList, CdkDrag, CdkDragPlaceholder, CdkDragHandle } from '@angular/cdk/drag-drop';
61
+ import * as i1$4 from '@angular/material/slide-toggle';
62
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
63
63
  import * as i1$5 from '@angular/material/progress-spinner';
64
64
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
65
65
  import * as i1$6 from '@angular/material/paginator';
@@ -1302,169 +1302,173 @@ class BtnService {
1302
1302
  _mclass: 'btn btn-lg btn-success w-100',
1303
1303
  },
1304
1304
  };
1305
- this.getIcon = (iconType) => {
1306
- const index = {
1307
- add: {
1308
- icon: faPlus,
1309
- },
1310
- adjust: {
1311
- icon: faSlidersH,
1312
- },
1313
- calendar: {
1314
- iconString: 'fas fa-calendar-alt',
1315
- },
1316
- cash: {
1317
- icon: faMoneyCheck,
1318
- },
1319
- cancel: {
1320
- icon: faCancel,
1321
- },
1322
- checked: {
1323
- icon: faCheck,
1324
- },
1325
- checklist: {
1326
- icon: faListAlt,
1327
- },
1328
- clone: {
1329
- icon: faClone,
1330
- },
1331
- close: {
1332
- iconString: 'fa fa-close',
1333
- },
1334
- cogs: {
1335
- icon: faCogs,
1336
- },
1337
- delete: {
1338
- icon: faTrash,
1339
- },
1340
- download: {
1341
- icon: faDownload,
1342
- },
1343
- dropdown: {
1344
- iconPosition: 'right',
1345
- iconString: 'fa fa-chevron-down',
1346
- },
1347
- edit: {
1348
- icon: faEdit,
1349
- },
1350
- export: {
1351
- icon: faFileExport,
1352
- },
1353
- file: {
1354
- icon: faFile,
1355
- },
1356
- filter: {
1357
- icon: faFilter,
1358
- },
1359
- generate: {
1360
- icon: faPenFancy,
1361
- },
1362
- guard: {
1363
- icon: faUserShield,
1364
- },
1365
- access: {
1366
- icon: faUserShield,
1367
- },
1368
- history: {
1369
- icon: faHistory,
1370
- },
1371
- home: {
1372
- icon: faHome,
1373
- },
1374
- import: {
1375
- icon: faFileImport,
1376
- },
1377
- info: {
1378
- icon: faInfoCircle,
1379
- },
1380
- link: {
1381
- iconString: 'fas fa-chain',
1382
- },
1383
- lock: {
1384
- icon: faLock,
1385
- },
1386
- next: {
1387
- icon: faArrowRight,
1388
- iconPosition: 'right',
1389
- },
1390
- pen: {
1391
- icon: faPen,
1392
- },
1393
- post: {
1394
- icon: faPaperPlane,
1395
- },
1396
- previous: {
1397
- icon: faArrowLeft,
1398
- },
1399
- renew: {
1400
- icon: faRecycle,
1401
- },
1402
- save: {
1403
- icon: faSave,
1404
- },
1405
- search: {
1406
- icon: faSearch,
1407
- },
1408
- show: {
1409
- icon: faEye,
1410
- },
1411
- view: {
1412
- icon: faEye,
1413
- },
1414
- snooze: {
1415
- icon: faBellSlash,
1416
- },
1417
- upload: {
1418
- icon: faUpload,
1419
- },
1420
- unlock: {
1421
- icon: faUnlock,
1422
- },
1423
- users: {
1424
- icon: faUsers,
1425
- },
1426
- recycle: {
1427
- icon: faRecycle,
1428
- },
1429
- refresh: {
1430
- iconString: 'fa fa-refresh',
1431
- },
1432
- truck: {
1433
- icon: faTruck,
1434
- },
1435
- tag: {
1436
- icon: faTag,
1437
- },
1438
- receipt: {
1439
- icon: faReceipt,
1440
- },
1441
- bank: {
1442
- icon: faBank,
1443
- },
1444
- arrowh: {
1445
- icon: faArrowsH,
1446
- },
1447
- play: {
1448
- icon: faPlay,
1449
- },
1450
- percent: {
1451
- icon: faPercent,
1452
- },
1453
- shake: {
1454
- icon: faHandshake,
1455
- },
1456
- error: {
1457
- icon: faCircleExclamation,
1458
- },
1459
- table: {
1460
- icon: faTable,
1461
- },
1462
- spoon: {
1463
- icon: faSpoon,
1464
- },
1465
- };
1466
- return index[iconType];
1305
+ this.buttonIconIndex = {
1306
+ add: {
1307
+ icon: faPlus,
1308
+ },
1309
+ adjust: {
1310
+ icon: faSlidersH,
1311
+ },
1312
+ calendar: {
1313
+ iconString: 'fas fa-calendar-alt',
1314
+ },
1315
+ cash: {
1316
+ icon: faMoneyCheck,
1317
+ },
1318
+ cancel: {
1319
+ icon: faCancel,
1320
+ },
1321
+ checked: {
1322
+ icon: faCheck,
1323
+ },
1324
+ checklist: {
1325
+ icon: faListAlt,
1326
+ },
1327
+ clone: {
1328
+ icon: faClone,
1329
+ },
1330
+ close: {
1331
+ iconString: 'fa fa-close',
1332
+ },
1333
+ cogs: {
1334
+ icon: faCogs,
1335
+ },
1336
+ delete: {
1337
+ icon: faTrash,
1338
+ },
1339
+ download: {
1340
+ icon: faDownload,
1341
+ },
1342
+ dropdown: {
1343
+ iconPosition: 'right',
1344
+ iconString: 'fa fa-chevron-down',
1345
+ },
1346
+ edit: {
1347
+ icon: faEdit,
1348
+ },
1349
+ export: {
1350
+ icon: faFileExport,
1351
+ },
1352
+ file: {
1353
+ icon: faFile,
1354
+ },
1355
+ filter: {
1356
+ icon: faFilter,
1357
+ },
1358
+ generate: {
1359
+ icon: faPenFancy,
1360
+ },
1361
+ guard: {
1362
+ icon: faUserShield,
1363
+ },
1364
+ access: {
1365
+ icon: faUserShield,
1366
+ },
1367
+ history: {
1368
+ icon: faHistory,
1369
+ },
1370
+ home: {
1371
+ icon: faHome,
1372
+ },
1373
+ import: {
1374
+ icon: faFileImport,
1375
+ },
1376
+ info: {
1377
+ icon: faInfoCircle,
1378
+ },
1379
+ link: {
1380
+ iconString: 'fas fa-chain',
1381
+ },
1382
+ lock: {
1383
+ icon: faLock,
1384
+ },
1385
+ next: {
1386
+ icon: faArrowRight,
1387
+ iconPosition: 'right',
1388
+ },
1389
+ pause: {
1390
+ icon: faPause,
1391
+ },
1392
+ pen: {
1393
+ icon: faPen,
1394
+ },
1395
+ post: {
1396
+ icon: faPaperPlane,
1397
+ },
1398
+ previous: {
1399
+ icon: faArrowLeft,
1400
+ },
1401
+ renew: {
1402
+ icon: faRecycle,
1403
+ },
1404
+ save: {
1405
+ icon: faSave,
1406
+ },
1407
+ search: {
1408
+ icon: faSearch,
1409
+ },
1410
+ show: {
1411
+ icon: faEye,
1412
+ },
1413
+ view: {
1414
+ icon: faEye,
1415
+ },
1416
+ snooze: {
1417
+ icon: faBellSlash,
1418
+ },
1419
+ upload: {
1420
+ icon: faUpload,
1421
+ },
1422
+ unlock: {
1423
+ icon: faUnlock,
1424
+ },
1425
+ users: {
1426
+ icon: faUsers,
1427
+ },
1428
+ recycle: {
1429
+ icon: faRecycle,
1430
+ },
1431
+ refresh: {
1432
+ iconString: 'fa fa-refresh',
1433
+ },
1434
+ stop: {
1435
+ icon: faStop,
1436
+ },
1437
+ truck: {
1438
+ icon: faTruck,
1439
+ },
1440
+ tag: {
1441
+ icon: faTag,
1442
+ },
1443
+ receipt: {
1444
+ icon: faReceipt,
1445
+ },
1446
+ bank: {
1447
+ icon: faBank,
1448
+ },
1449
+ arrowh: {
1450
+ icon: faArrowsH,
1451
+ },
1452
+ play: {
1453
+ icon: faPlay,
1454
+ },
1455
+ percent: {
1456
+ icon: faPercent,
1457
+ },
1458
+ shake: {
1459
+ icon: faHandshake,
1460
+ },
1461
+ error: {
1462
+ icon: faCircleExclamation,
1463
+ },
1464
+ table: {
1465
+ icon: faTable,
1466
+ },
1467
+ spoon: {
1468
+ icon: faSpoon,
1469
+ },
1467
1470
  };
1471
+ this.getIcon = (iconType) => this.buttonIconIndex[iconType];
1468
1472
  this.defaultType = 'secondary';
1469
1473
  this.setFormState = (btn) => {
1470
1474
  btn.checkFormStateSub?.unsubscribe();
@@ -7997,91 +8001,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
7997
8001
  args: ['searchQuery']
7998
8002
  }] } });
7999
8003
 
8000
- class FileUploadComponent {
8001
- set _accept(v) {
8002
- switch (v) {
8003
- case 'image':
8004
- this.accept = '.png,.jpg,.docx,.pdf';
8005
- break;
8006
- default:
8007
- this.accept = v;
8008
- break;
8009
- }
8010
- }
8011
- constructor() {
8012
- this.class = input();
8013
- this.mini = input(true);
8014
- this.listFiles = input(true);
8015
- this.fileChange = new EventEmitter();
8016
- this.filesChange = new EventEmitter();
8017
- this.uS = inject(UtilityService);
8018
- }
8019
- ngOnInit() { }
8020
- get isSingle() {
8021
- return !this.multiple;
8022
- }
8023
- acceptFiles(...files) {
8024
- this.files = files;
8025
- this.file = files ? files[0] : null;
8026
- }
8027
- emitFiles() {
8028
- if (this.multiple)
8029
- this.filesChange.emit(this.files);
8030
- else
8031
- this.fileChange.emit(this.file);
8032
- }
8033
- onUpload(event) {
8034
- const files = Array.from(event.target.files);
8035
- this.acceptFiles(...files);
8036
- this.emitFiles();
8037
- }
8038
- removeFile(index) {
8039
- this.files.splice(index, 1);
8040
- this.file = this.files ? this.files[0] : null;
8041
- this.fileChange.emit(this.file);
8042
- this.filesChange.emit(this.files);
8043
- }
8044
- openDialog() {
8045
- const inp = document.createElement('input');
8046
- inp.type = 'file';
8047
- inp.accept = this.accept;
8048
- inp.multiple = this.multiple;
8049
- inp.onchange = (e) => {
8050
- this.onUpload(e);
8051
- inp.remove();
8052
- };
8053
- // document.body.appendChild(inp);
8054
- inp.click();
8055
- }
8056
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8057
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: FileUploadComponent, isStandalone: true, selector: "app-file-upload", inputs: { help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, mini: { classPropertyName: "mini", publicName: "mini", isSignal: true, isRequired: false, transformFunction: null }, useDocumentModal: { classPropertyName: "useDocumentModal", publicName: "useDocumentModal", isSignal: false, isRequired: false, transformFunction: null }, listFiles: { classPropertyName: "listFiles", publicName: "listFiles", isSignal: true, isRequired: false, transformFunction: null }, _accept: { classPropertyName: "_accept", publicName: "accept", isSignal: false, isRequired: false, transformFunction: null }, file: { classPropertyName: "file", publicName: "file", isSignal: false, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { fileChange: "fileChange", filesChange: "filesChange" }, ngImport: i0, template: "\n@if (listFiles()) {\n<div [ngClass]=\"{meta:mini()}\" class=\"{{class()}} form-label mb-2 hide-scroll\">\n @for (item of files; track item;) {\n <div class=\"row align-items-start mb-1\">\n <div class=\"col\">\n <div class=\"hide-scroll file-name\">\n {{item?.name}}\n </div>\n </div>\n <div class=\"col-auto text-end\">\n <span class=\"text-danger pointer p-1 fa fa-close\" (click)=\"removeFile($index);\"></span>\n </div>\n </div>\n}\n</div>\n}\n<!-- <input type=\"file\" style=\"display: none;\" accept=\"{{accept}}\" (change)=\"onUpload($event)\" #uploadInput [multiple]=\"multiple\"> -->\n<app-btn icon=\"upload\" (mclick)=\"openDialog()\" [type]=\"file?'primary':'secondary'\"\n [disabled]=\"disabled\" [help]=\"help\" [text]=\"label\">\n\n</app-btn>", styles: [".meta,.file-name{height:23px}.meta{overflow-y:auto}.file-name{overflow:auto}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: BtnComponent, selector: "app-btn", inputs: ["formSchema", "debug", "centerBtn", "danger", "warning", "icon", "rightIcon", "leftIcon", "type", "group", "actionType", "animate", "excludeLogging", "loggingValue", "badge", "class", "customIcon", "disabled", "form", "forms", "help", "iconBtn", "loading", "mclass", "showHelpIcon", "rightCustomIcon", "leftCustomIcon", "text", "valid", "mini", "onFormInvalid"], outputs: ["mclick"] }] }); }
8058
- }
8059
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FileUploadComponent, decorators: [{
8060
- type: Component,
8061
- args: [{ selector: 'app-file-upload', standalone: true, imports: [NgIf, NgClass, NgFor, BtnComponent], template: "\n@if (listFiles()) {\n<div [ngClass]=\"{meta:mini()}\" class=\"{{class()}} form-label mb-2 hide-scroll\">\n @for (item of files; track item;) {\n <div class=\"row align-items-start mb-1\">\n <div class=\"col\">\n <div class=\"hide-scroll file-name\">\n {{item?.name}}\n </div>\n </div>\n <div class=\"col-auto text-end\">\n <span class=\"text-danger pointer p-1 fa fa-close\" (click)=\"removeFile($index);\"></span>\n </div>\n </div>\n}\n</div>\n}\n<!-- <input type=\"file\" style=\"display: none;\" accept=\"{{accept}}\" (change)=\"onUpload($event)\" #uploadInput [multiple]=\"multiple\"> -->\n<app-btn icon=\"upload\" (mclick)=\"openDialog()\" [type]=\"file?'primary':'secondary'\"\n [disabled]=\"disabled\" [help]=\"help\" [text]=\"label\">\n\n</app-btn>", styles: [".meta,.file-name{height:23px}.meta{overflow-y:auto}.file-name{overflow:auto}\n"] }]
8062
- }], ctorParameters: () => [], propDecorators: { help: [{
8063
- type: Input
8064
- }], label: [{
8065
- type: Input
8066
- }], disabled: [{
8067
- type: Input
8068
- }], multiple: [{
8069
- type: Input
8070
- }], useDocumentModal: [{
8071
- type: Input
8072
- }], _accept: [{
8073
- type: Input,
8074
- args: ['accept']
8075
- }], file: [{
8076
- type: Input
8077
- }], fileChange: [{
8078
- type: Output
8079
- }], files: [{
8080
- type: Input
8081
- }], filesChange: [{
8082
- type: Output
8083
- }] } });
8084
-
8085
8004
  class FadingCirclesComponent {
8086
8005
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FadingCirclesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8087
8006
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.1", type: FadingCirclesComponent, isStandalone: true, selector: "fading-circles", ngImport: i0, template: "<div class=\"lds-ellipsis\">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [".lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:var(--primary);animation-timing-function:cubic-bezier(0,1,1,0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 .6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 .6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 .6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 .6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0)}to{transform:translate(24px)}}\n"] }); }
@@ -12155,6 +12074,356 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
12155
12074
 
12156
12075
  const ModalComponents = [ModalComponent, ModalFormComponent, ModalHeaderComponent, ModalBodyDirective, ModalFooterDirective];
12157
12076
 
12077
+ class WebcamMediaComponent {
12078
+ constructor() {
12079
+ this.closed = new EventEmitter();
12080
+ this.recorderStopped = new EventEmitter();
12081
+ this.recorderErrored = new EventEmitter();
12082
+ this.recorderStarted = new EventEmitter();
12083
+ this.recordingState = new EventEmitter();
12084
+ this.recordingChanged = new EventEmitter();
12085
+ this.isVideo = input();
12086
+ this.useAudio = input();
12087
+ this.fileName = input();
12088
+ this.fileNameFactory = input();
12089
+ this.fileType = input();
12090
+ this.extraClass = input();
12091
+ /**
12092
+ * Seconds
12093
+ */
12094
+ this.recordingNotificationInterval = input(5);
12095
+ this.isBackground = input(false);
12096
+ this.computedRecordingNotificationInterval = computed(() => (this.recordingNotificationInterval() || 5) * 1000);
12097
+ this.isPicture = computed(() => !this.isVideo());
12098
+ this.subject = computed(() => (this.isPicture() ? 'Image' : 'Video'));
12099
+ this.isPaused = toSignal(this.recordingState.pipe(map$1((r) => r == 'paused')));
12100
+ this.computedFileType = computed(() => {
12101
+ const ft = this.fileType(), isp = this.isPicture();
12102
+ return ft || (isp ? 'image/jpeg' : 'video/mp4');
12103
+ });
12104
+ this.computedFileExtension = computed(() => this.computedFileType()?.split('/')[1]);
12105
+ this.computedFileName = computed(() => {
12106
+ const ff = this.fileNameFactory(), fn = this.fileName() || ff?.(this), fx = this.computedFileExtension(), subject = this.subject();
12107
+ return fn?.includes('.' + fx) ? fn : `${fn || subject}.${fx}`;
12108
+ });
12109
+ this.streamingVideoTemplate = viewChild('streamVideoTemp');
12110
+ this.recordingVideoRef = viewChild('recordingVideoTag');
12111
+ this.recordingVideoRefEl = computed(() => this.recordingVideoRef()?.nativeElement);
12112
+ this.streaming = signal(undefined);
12113
+ this.preview = signal(false);
12114
+ this.computedPreview = computed(() => !this.isBackground() && this.preview());
12115
+ // The width and height of the captured photo. We will set the
12116
+ // width to the value defined here, but the height will be
12117
+ // calculated based on the aspect ratio of the input stream.
12118
+ this.width = model(1080); // We will scale the photo width to this
12119
+ this.height = computed(() => {
12120
+ const width = this.width();
12121
+ return width / (4 / 3);
12122
+ }); // This will be computed based on the input stream
12123
+ // The various HTML elements we need to configure or control. These
12124
+ // will be set by the startup() function.
12125
+ this.canvas = signal(undefined);
12126
+ this.mediaFile = signal(undefined);
12127
+ this.photoSrc = signal(undefined);
12128
+ this.videoSrc = signal(undefined);
12129
+ this.stream = signal(undefined);
12130
+ this.isRecording = toSignal(this.recordingState.pipe(map$1((r) => r == 'recording' || r == 'paused')));
12131
+ this.recordedBlobs = [];
12132
+ this.recordedTime = signal(0);
12133
+ this.startRecording = (stream = this.stream()) => {
12134
+ if (!this.isVideo())
12135
+ return;
12136
+ this.recorder = new MediaRecorder(stream);
12137
+ this.recordedBlobs = [];
12138
+ this.recordedTime.set(0);
12139
+ const lengths = [];
12140
+ this.recorder.ondataavailable = (event) => {
12141
+ this.recordedBlobs.push(event.data);
12142
+ this.mediaFile.set(new File(this.recordedBlobs, this.computedFileName(), { type: this.computedFileType() }));
12143
+ lengths.push([this.mediaFile().size, event.data.size]);
12144
+ };
12145
+ // this.recorder.ondataavailable = (event) => {
12146
+ // this.recordedBlobs = [event.data];
12147
+ // lengths.push(event.data.size);
12148
+ // };
12149
+ // this.recorder.ondataavailable = (event) => this.recordedBlobs.push(event.data);
12150
+ this.recorder.start();
12151
+ let notifSub;
12152
+ const startTimer = () => {
12153
+ let lastDateTime = Date.now();
12154
+ notifSub = timer(1000, 1000)
12155
+ .pipe(tap(() => this.recordedTime.update((t) => (t += 1))), tap(() => console.log(Date.now(), this.computedRecordingNotificationInterval(), this.recordingNotificationInterval())), filter(() => Date.now() - lastDateTime > this.computedRecordingNotificationInterval()), tap(() => this.recorder.requestData()))
12156
+ .subscribe((r) => {
12157
+ lastDateTime = Date.now();
12158
+ this.recordingChanged.emit(this.mediaFile());
12159
+ });
12160
+ };
12161
+ this.recorder.onstart = (e) => {
12162
+ this.recordingState.emit(this.recorder.state);
12163
+ this.recorderStarted.emit(e);
12164
+ startTimer();
12165
+ };
12166
+ this.recorder.onstop = (e) => {
12167
+ this.recordingState.emit(this.recorder.state);
12168
+ this.recorderStopped.emit(e);
12169
+ console.log('new length', lengths);
12170
+ notifSub?.unsubscribe();
12171
+ };
12172
+ this.recorder.onpause = (e) => {
12173
+ this.recordingState.emit(this.recorder.state);
12174
+ notifSub?.unsubscribe();
12175
+ };
12176
+ this.recorder.onresume = (e) => {
12177
+ this.recordingState.emit(this.recorder.state);
12178
+ startTimer();
12179
+ };
12180
+ this.recorder.onerror = (e) => {
12181
+ this.recordingState.emit(this.recorder.state);
12182
+ this.recorderErrored.emit(e);
12183
+ notifSub?.unsubscribe();
12184
+ };
12185
+ };
12186
+ }
12187
+ ngAfterViewInit() {
12188
+ this.startUpWebcam();
12189
+ }
12190
+ ngOnDestroy() {
12191
+ this.sub?.unsubscribe();
12192
+ }
12193
+ /**
12194
+ * Start the webcam stream
12195
+ */
12196
+ startUpWebcam() {
12197
+ this.clear();
12198
+ navigator.mediaDevices
12199
+ .getUserMedia({ video: true, audio: this.useAudio() })
12200
+ .then((stream) => {
12201
+ this.streaming.set(true);
12202
+ this.canvas.set(document.createElement('canvas'));
12203
+ this.canvas()?.setAttribute('width', this.width() + 'px');
12204
+ this.canvas()?.setAttribute('height', this.height() + 'px');
12205
+ this.stream.set(stream);
12206
+ // debugger;
12207
+ })
12208
+ .catch((err) => {
12209
+ console.error(`An error occurred:`, err);
12210
+ });
12211
+ }
12212
+ /**
12213
+ * Indicate that the user is done with the webcam component.
12214
+ *
12215
+ * Any media obtained will be emitted
12216
+ */
12217
+ save() {
12218
+ if (this.isPicture())
12219
+ new Observable((sub) => this.canvas().toBlob((blob) => {
12220
+ if (blob) {
12221
+ this.mediaFile.set(new File([blob], this.computedFileName()));
12222
+ sub.next(this.mediaFile());
12223
+ sub.complete();
12224
+ }
12225
+ else
12226
+ sub.error(`No ${this.subject()} file generated`);
12227
+ }, this.computedFileType(), 1)).subscribe(() => {
12228
+ this.closed.emit(this.mediaFile());
12229
+ this.closeWebcam();
12230
+ });
12231
+ else {
12232
+ this.closed.emit(this.mediaFile());
12233
+ this.closeWebcam();
12234
+ }
12235
+ }
12236
+ /**
12237
+ * Indicate that the user is done with the webcam component.
12238
+ *
12239
+ * Any media obtained will be deleted
12240
+ */
12241
+ cancel() {
12242
+ this.closed.emit(null);
12243
+ this.closeWebcam();
12244
+ }
12245
+ /**
12246
+ * Clear the media taken and close preview
12247
+ */
12248
+ clear() {
12249
+ if (this.canvas()) {
12250
+ const context = this.canvas()?.getContext('2d');
12251
+ context.fillStyle = '#AAA';
12252
+ context.fillRect(0, 0, this.canvas().width, this.canvas().height);
12253
+ const data = this.canvas().toDataURL(this.computedFileType());
12254
+ this.photoSrc.set(data);
12255
+ this.streaming.set(true);
12256
+ this.preview.set(false);
12257
+ }
12258
+ }
12259
+ /**
12260
+ * Shutdown the webcam stream
12261
+ */
12262
+ closeWebcam() {
12263
+ this.stream()
12264
+ ?.getTracks()
12265
+ .forEach((x) => x.stop());
12266
+ this.stream.set(undefined);
12267
+ this.streaming.set(undefined);
12268
+ // this.stream.set(this.stream()?.getTracks[0].stop());
12269
+ }
12270
+ /**
12271
+ * Capture a photo by fetching the current contents of the video
12272
+ * and drawing it into a canvas, then converting that to a PNG
12273
+ * format data URL.
12274
+ *
12275
+ * By drawing it on an offscreen canvas and then
12276
+ * drawing that to the screen, we can change its size and/or apply
12277
+ * other changes before drawing it.
12278
+ */
12279
+ takePicture() {
12280
+ if (!this.isPicture())
12281
+ return;
12282
+ const context = this.canvas().getContext('2d'), width = this.width(), height = this.height();
12283
+ if (width && height && context) {
12284
+ this.canvas.update((canvas) => {
12285
+ if (canvas)
12286
+ canvas.width = width;
12287
+ return canvas;
12288
+ });
12289
+ this.canvas.update((canvas) => {
12290
+ if (canvas)
12291
+ canvas.height = height;
12292
+ return canvas;
12293
+ });
12294
+ context.drawImage(this.recordingVideoRefEl(), 0, 0, width, height);
12295
+ const data = this.canvas().toDataURL('image/png');
12296
+ this.photoSrc.set(data);
12297
+ }
12298
+ else
12299
+ this.clear();
12300
+ this.streaming.set(false);
12301
+ this.preview.set(true);
12302
+ }
12303
+ stopRecording() {
12304
+ if (this.recorder.state === 'recording')
12305
+ this.recorder.stop();
12306
+ this.preview.set(true);
12307
+ this.streaming.set(false);
12308
+ }
12309
+ pauseRecording() {
12310
+ // debugger;
12311
+ if (this.recorder.state === 'paused')
12312
+ this.recorder.resume();
12313
+ else
12314
+ this.recorder.pause();
12315
+ }
12316
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: WebcamMediaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12317
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: WebcamMediaComponent, isStandalone: true, selector: "lib-webcam-media", inputs: { isVideo: { classPropertyName: "isVideo", publicName: "isVideo", isSignal: true, isRequired: false, transformFunction: null }, useAudio: { classPropertyName: "useAudio", publicName: "useAudio", isSignal: true, isRequired: false, transformFunction: null }, fileName: { classPropertyName: "fileName", publicName: "fileName", isSignal: true, isRequired: false, transformFunction: null }, fileNameFactory: { classPropertyName: "fileNameFactory", publicName: "fileNameFactory", isSignal: true, isRequired: false, transformFunction: null }, fileType: { classPropertyName: "fileType", publicName: "fileType", isSignal: true, isRequired: false, transformFunction: null }, extraClass: { classPropertyName: "extraClass", publicName: "extraClass", isSignal: true, isRequired: false, transformFunction: null }, recordingNotificationInterval: { classPropertyName: "recordingNotificationInterval", publicName: "recordingNotificationInterval", isSignal: true, isRequired: false, transformFunction: null }, isBackground: { classPropertyName: "isBackground", publicName: "isBackground", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed", recorderStopped: "recorderStopped", recorderErrored: "recorderErrored", recorderStarted: "recorderStarted", recordingState: "recordingState", recordingChanged: "recordingChanged", width: "widthChange" }, viewQueries: [{ propertyName: "streamingVideoTemplate", first: true, predicate: ["streamVideoTemp"], descendants: true, isSignal: true }, { propertyName: "recordingVideoRef", first: true, predicate: ["recordingVideoTag"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"\" [hidden]=\"streaming() != true || isBackground()\">\n <ng-container *ngTemplateOutlet=\"streamVideoTemp\" />\n\n @if (!isBackground()) {\n <div class=\"wm-buttons\">\n <div class=\" row row-cols-lg-auto g-3 justify-content-start\">\n @if (!isRecording()) {\n <div>\n <app-btn [text]=\"isPicture() ? 'Take Picture' : 'Record Video'\" (mclick)=\"isPicture() ? takePicture() : startRecording()\" />\n </div>\n } @else {\n <div>\n <app-btn text=\"{{isPaused()?'Play': 'Pause'}} Recording\" (mclick)=\"pauseRecording()\" type=\"outline\" [icon]=\"isPaused()?'play':'pause'\" />\n </div>\n <div>\n <app-btn [text]=\"'Stop Recording'\" (mclick)=\"stopRecording()\" type=\"danger\" icon=\"stop\" />\n </div>\n }\n </div>\n </div>\n }\n</div>\n\n<ng-template #streamVideoTemp>\n <div class=\"wm-recording-video-cont\">\n <video #recordingVideoTag [srcObject]=\"stream()\" autoplay class=\"wm-recording-video {{ extraClass() }}\"></video>\n @if (isRecording()) {\n <div class=\"wm-recordingDot\"></div>\n }\n </div>\n</ng-template>\n\n@if (computedPreview()) {\n <div class=\"wm-preview\">\n <div>\n @if (isPicture()) {\n <img class=\"w-100\" [style.width.px]=\"width()\" [style.height.px]=\"height()\" [src]=\"photoSrc()\" />\n } @else {\n <video class=\"w-100\" [style.width.px]=\"width()\" [style.height.px]=\"height()\" [src]=\"mediaFile()\"></video>\n }\n </div>\n <div class=\"mt-3 row row-cols-lg-auto g-3\">\n <div>\n <app-btn text=\"Retake {{ subject() }}\" type=\"outline\" (mclick)=\"clear()\" />\n </div>\n <div>\n <app-btn (mclick)=\"save()\" text=\"Done\" type=\"primary\" icon=\"save\" />\n </div>\n <div>\n <app-btn (mclick)=\"cancel()\" text=\"Cancel\" type=\"danger\" icon=\"cancel\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{display:block}:host .wm-recording-video{width:100%}:host .wm-preview image,:host .wm-preview video{object-fit:contain}:host .wm-recording-video-cont{position:relative}@keyframes wmAnimateDot{0%{background-color:transparent}50%{background-color:#ff000086}}:host .wm-recordingDot{animation-name:wmAnimateDot;animation-duration:1s;animation-iteration-count:infinite;border-radius:5px;--dimen: 20px;width:var(--dimen);height:var(--dimen);position:absolute;top:10px;right:10px}:host .wm-buttons{margin-top:var(--space-16)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: BtnComponent, selector: "app-btn", inputs: ["formSchema", "debug", "centerBtn", "danger", "warning", "icon", "rightIcon", "leftIcon", "type", "group", "actionType", "animate", "excludeLogging", "loggingValue", "badge", "class", "customIcon", "disabled", "form", "forms", "help", "iconBtn", "loading", "mclass", "showHelpIcon", "rightCustomIcon", "leftCustomIcon", "text", "valid", "mini", "onFormInvalid"], outputs: ["mclick"] }] }); }
12318
+ }
12319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: WebcamMediaComponent, decorators: [{
12320
+ type: Component,
12321
+ args: [{ selector: 'lib-webcam-media', standalone: true, imports: [CommonModule, BtnComponent], template: "<div class=\"\" [hidden]=\"streaming() != true || isBackground()\">\n <ng-container *ngTemplateOutlet=\"streamVideoTemp\" />\n\n @if (!isBackground()) {\n <div class=\"wm-buttons\">\n <div class=\" row row-cols-lg-auto g-3 justify-content-start\">\n @if (!isRecording()) {\n <div>\n <app-btn [text]=\"isPicture() ? 'Take Picture' : 'Record Video'\" (mclick)=\"isPicture() ? takePicture() : startRecording()\" />\n </div>\n } @else {\n <div>\n <app-btn text=\"{{isPaused()?'Play': 'Pause'}} Recording\" (mclick)=\"pauseRecording()\" type=\"outline\" [icon]=\"isPaused()?'play':'pause'\" />\n </div>\n <div>\n <app-btn [text]=\"'Stop Recording'\" (mclick)=\"stopRecording()\" type=\"danger\" icon=\"stop\" />\n </div>\n }\n </div>\n </div>\n }\n</div>\n\n<ng-template #streamVideoTemp>\n <div class=\"wm-recording-video-cont\">\n <video #recordingVideoTag [srcObject]=\"stream()\" autoplay class=\"wm-recording-video {{ extraClass() }}\"></video>\n @if (isRecording()) {\n <div class=\"wm-recordingDot\"></div>\n }\n </div>\n</ng-template>\n\n@if (computedPreview()) {\n <div class=\"wm-preview\">\n <div>\n @if (isPicture()) {\n <img class=\"w-100\" [style.width.px]=\"width()\" [style.height.px]=\"height()\" [src]=\"photoSrc()\" />\n } @else {\n <video class=\"w-100\" [style.width.px]=\"width()\" [style.height.px]=\"height()\" [src]=\"mediaFile()\"></video>\n }\n </div>\n <div class=\"mt-3 row row-cols-lg-auto g-3\">\n <div>\n <app-btn text=\"Retake {{ subject() }}\" type=\"outline\" (mclick)=\"clear()\" />\n </div>\n <div>\n <app-btn (mclick)=\"save()\" text=\"Done\" type=\"primary\" icon=\"save\" />\n </div>\n <div>\n <app-btn (mclick)=\"cancel()\" text=\"Cancel\" type=\"danger\" icon=\"cancel\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{display:block}:host .wm-recording-video{width:100%}:host .wm-preview image,:host .wm-preview video{object-fit:contain}:host .wm-recording-video-cont{position:relative}@keyframes wmAnimateDot{0%{background-color:transparent}50%{background-color:#ff000086}}:host .wm-recordingDot{animation-name:wmAnimateDot;animation-duration:1s;animation-iteration-count:infinite;border-radius:5px;--dimen: 20px;width:var(--dimen);height:var(--dimen);position:absolute;top:10px;right:10px}:host .wm-buttons{margin-top:var(--space-16)}\n"] }]
12322
+ }], propDecorators: { closed: [{
12323
+ type: Output
12324
+ }], recorderStopped: [{
12325
+ type: Output
12326
+ }], recorderErrored: [{
12327
+ type: Output
12328
+ }], recorderStarted: [{
12329
+ type: Output
12330
+ }], recordingState: [{
12331
+ type: Output
12332
+ }], recordingChanged: [{
12333
+ type: Output
12334
+ }] } });
12335
+
12336
+ class FileUploadComponent {
12337
+ set _accept(v) {
12338
+ switch (v) {
12339
+ case 'image':
12340
+ this.accept = '.png,.jpg,.docx,.pdf';
12341
+ break;
12342
+ default:
12343
+ this.accept = v;
12344
+ break;
12345
+ }
12346
+ }
12347
+ constructor() {
12348
+ this.mediaWidth = model(1080);
12349
+ this.class = input();
12350
+ this.useWebcam = input(false);
12351
+ /**
12352
+ * Only useful if using the webcam option
12353
+ */
12354
+ this.fileName = input();
12355
+ this.mini = input(true);
12356
+ this.listFiles = input(true);
12357
+ this.fileChange = new EventEmitter();
12358
+ this.filesChange = new EventEmitter();
12359
+ this.uS = inject(UtilityService);
12360
+ }
12361
+ ngOnInit() { }
12362
+ get isSingle() {
12363
+ return !this.multiple;
12364
+ }
12365
+ acceptFiles(...files) {
12366
+ this.files = files;
12367
+ this.file = files ? files[0] : null;
12368
+ this.emitFiles();
12369
+ }
12370
+ emitFiles() {
12371
+ if (this.multiple)
12372
+ this.filesChange.emit(this.files);
12373
+ else
12374
+ this.fileChange.emit(this.file);
12375
+ }
12376
+ onUpload(event) {
12377
+ const files = Array.from(event.target.files);
12378
+ this.acceptFiles(...files);
12379
+ }
12380
+ removeFile(index) {
12381
+ this.files.splice(index, 1);
12382
+ this.file = this.files ? this.files[0] : null;
12383
+ this.fileChange.emit(this.file);
12384
+ this.filesChange.emit(this.files);
12385
+ }
12386
+ openDialog() {
12387
+ const inp = document.createElement('input');
12388
+ inp.type = 'file';
12389
+ inp.accept = this.accept;
12390
+ inp.multiple = this.multiple;
12391
+ inp.onchange = (e) => {
12392
+ this.onUpload(e);
12393
+ inp.remove();
12394
+ };
12395
+ // document.body.appendChild(inp);
12396
+ inp.click();
12397
+ }
12398
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12399
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.1", type: FileUploadComponent, isStandalone: true, selector: "app-file-upload", inputs: { help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, mediaWidth: { classPropertyName: "mediaWidth", publicName: "mediaWidth", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, useWebcam: { classPropertyName: "useWebcam", publicName: "useWebcam", isSignal: true, isRequired: false, transformFunction: null }, fileName: { classPropertyName: "fileName", publicName: "fileName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, mini: { classPropertyName: "mini", publicName: "mini", isSignal: true, isRequired: false, transformFunction: null }, useDocumentModal: { classPropertyName: "useDocumentModal", publicName: "useDocumentModal", isSignal: false, isRequired: false, transformFunction: null }, listFiles: { classPropertyName: "listFiles", publicName: "listFiles", isSignal: true, isRequired: false, transformFunction: null }, _accept: { classPropertyName: "_accept", publicName: "accept", isSignal: false, isRequired: false, transformFunction: null }, file: { classPropertyName: "file", publicName: "file", isSignal: false, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { mediaWidth: "mediaWidthChange", fileChange: "fileChange", filesChange: "filesChange" }, ngImport: i0, template: "@if (listFiles()) {\n <div [ngClass]=\"{ meta: mini() }\" class=\"{{ class() }} form-label mb-2 hide-scroll\">\n @for (item of files; track item) {\n <div class=\"row align-items-start mb-1\">\n <div class=\"col\">\n <div class=\"hide-scroll file-name\">\n {{ item?.name }}\n </div>\n </div>\n <div class=\"col-auto text-end\">\n <span class=\"text-danger pointer p-1 fa fa-close\" (click)=\"removeFile($index)\"></span>\n </div>\n </div>\n }\n </div>\n}\n<!-- <input type=\"file\" style=\"display: none;\" accept=\"{{accept}}\" (change)=\"onUpload($event)\" #uploadInput [multiple]=\"multiple\"> -->\n<app-btn\n icon=\"upload\"\n (mclick)=\"useWebcam() ? null : openDialog()\"\n [type]=\"file ? 'primary' : 'secondary'\"\n [disabled]=\"disabled\"\n [help]=\"help\"\n [text]=\"label\"\n [matMenuTriggerFor]=\"useWebcam() ? menu : null\" />\n\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"openDialog()\">Upload</button>\n <button mat-menu-item (click)=\"webcamModal.open()\">Use Camera</button>\n</mat-menu>\n\n<modal-comp #webcamModal width=\"1080px\" header=\"Webcam\">\n <ng-template modalBody>\n <lib-webcam-media [fileName]=\"fileName()\" [width]=\"mediaWidth()\" (closed)=\"webcamModal.close(); acceptFiles($event)\" />\n </ng-template>\n</modal-comp>\n", styles: [".meta,.file-name{height:23px}.meta{overflow-y:auto}.file-name{overflow:auto}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: BtnComponent, selector: "app-btn", inputs: ["formSchema", "debug", "centerBtn", "danger", "warning", "icon", "rightIcon", "leftIcon", "type", "group", "actionType", "animate", "excludeLogging", "loggingValue", "badge", "class", "customIcon", "disabled", "form", "forms", "help", "iconBtn", "loading", "mclass", "showHelpIcon", "rightCustomIcon", "leftCustomIcon", "text", "valid", "mini", "onFormInvalid"], outputs: ["mclick"] }, { kind: "component", type: ModalComponent, selector: "modal-comp", inputs: ["header", "bodyTemplateRef", "footerTemplateRef", "showHeader", "loading", "isFullscreen", "showFooter", "width", "minWidth", "height", "maxHeight", "icon", "data", "disableClose", "hasBackdrop"], outputs: ["modalOpen", "modalClose"] }, { kind: "directive", type: ModalBodyDirective, selector: "[modalBody]" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i3$2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i3$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: WebcamMediaComponent, selector: "lib-webcam-media", inputs: ["isVideo", "useAudio", "fileName", "fileNameFactory", "fileType", "extraClass", "recordingNotificationInterval", "isBackground", "width"], outputs: ["closed", "recorderStopped", "recorderErrored", "recorderStarted", "recordingState", "recordingChanged", "widthChange"] }] }); }
12400
+ }
12401
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FileUploadComponent, decorators: [{
12402
+ type: Component,
12403
+ args: [{ selector: 'app-file-upload', standalone: true, imports: [NgIf, NgClass, NgFor, BtnComponent, ModalComponents, MatMenuModule, WebcamMediaComponent], template: "@if (listFiles()) {\n <div [ngClass]=\"{ meta: mini() }\" class=\"{{ class() }} form-label mb-2 hide-scroll\">\n @for (item of files; track item) {\n <div class=\"row align-items-start mb-1\">\n <div class=\"col\">\n <div class=\"hide-scroll file-name\">\n {{ item?.name }}\n </div>\n </div>\n <div class=\"col-auto text-end\">\n <span class=\"text-danger pointer p-1 fa fa-close\" (click)=\"removeFile($index)\"></span>\n </div>\n </div>\n }\n </div>\n}\n<!-- <input type=\"file\" style=\"display: none;\" accept=\"{{accept}}\" (change)=\"onUpload($event)\" #uploadInput [multiple]=\"multiple\"> -->\n<app-btn\n icon=\"upload\"\n (mclick)=\"useWebcam() ? null : openDialog()\"\n [type]=\"file ? 'primary' : 'secondary'\"\n [disabled]=\"disabled\"\n [help]=\"help\"\n [text]=\"label\"\n [matMenuTriggerFor]=\"useWebcam() ? menu : null\" />\n\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"openDialog()\">Upload</button>\n <button mat-menu-item (click)=\"webcamModal.open()\">Use Camera</button>\n</mat-menu>\n\n<modal-comp #webcamModal width=\"1080px\" header=\"Webcam\">\n <ng-template modalBody>\n <lib-webcam-media [fileName]=\"fileName()\" [width]=\"mediaWidth()\" (closed)=\"webcamModal.close(); acceptFiles($event)\" />\n </ng-template>\n</modal-comp>\n", styles: [".meta,.file-name{height:23px}.meta{overflow-y:auto}.file-name{overflow:auto}\n"] }]
12404
+ }], ctorParameters: () => [], propDecorators: { help: [{
12405
+ type: Input
12406
+ }], label: [{
12407
+ type: Input
12408
+ }], disabled: [{
12409
+ type: Input
12410
+ }], multiple: [{
12411
+ type: Input
12412
+ }], useDocumentModal: [{
12413
+ type: Input
12414
+ }], _accept: [{
12415
+ type: Input,
12416
+ args: ['accept']
12417
+ }], file: [{
12418
+ type: Input
12419
+ }], fileChange: [{
12420
+ type: Output
12421
+ }], files: [{
12422
+ type: Input
12423
+ }], filesChange: [{
12424
+ type: Output
12425
+ }] } });
12426
+
12158
12427
  class FieldsToDisplayComponent {
12159
12428
  set _fields(v) {
12160
12429
  this.allFields.set(cloneDeep(v).map((x) => {
@@ -17916,5 +18185,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
17916
18185
  * Generated bundle index. Do not edit.
17917
18186
  */
17918
18187
 
17919
- export { AddItemComponent, ApiService, AppRouteBase, AppRouteService, AppRouteState, AppService, ArraySplitter, AuthenticationInterceptorService, AutocompleteComponent, AutocompleteModule, AutocompleteService, AutocompleteTdRfComponent, BlinkingBlocksComponent, BouncingBallComponent, Btn, BtnComponent, BtnLg, BtnLgComponent, BtnLinkComponent, BtnModule, BtnService, ButtonComponent, CETSInput, CacheService, CacheUpdaterService, CardComponent, CardComponent as CardModule, CodeTitleDescPipe, CommafyNumberDirective, ButtonComponent as ComponentsModule, Config, ConfirmDialogComponent, ConfirmDialogComponent as ConfirmDialogModule, Constant, CustomDatePipe, DEFAULT_TIMEOUT, DateInputComponent, Day, DayHourMinInputComponent, DebouncerService, DesktopClassDirective, DetailsBtnComponent, DetailsBtnComponent as DetailsBtnModule, DirectivesModule, DocumentsNameDisplayComponent, DocumentsNameDisplayComponent as DocumentsNameDisplayModule, DragDropFileUploadDirective, EETSPageBtnID, ELanguage, EMenuLocation, EMenuType, EPageType, ESubSystem, ESystem, ESystemBusLine, ETSCheckForUpdateService, ETSConfirmDialogService, ETSExtraPagesModule, ETSFKVP, ETSForms, ETSHandleUnrecoverableStateService, ETSKVP, ETSLogUpdateService, ETSLoggerModule, ETSMenuItem, ETSMenuItemDivider, ETSPageNotFoundModule, ETSPromptUpdateService, ETSReactiveFormInputService, ETSResetModule, ETSResponsivenessDirectiveModule, ETSRobotModule, ETSServiceWorkerService, ETSStorageService, ETSThemeService, ETSTimeoutTesterModule, ETSVersionModule, ETSWindowSecurityService, EUA, EVFunctions, EValidationType, EditableTextCaseComponent, EditableTextCaseComponent as EditableTextCaseModule, SDKEnvironment as Environment, EqualChildrenDirective, ErrorMessagePipe, ExportTableComponent, ExportTableComponent as ExportTableModule, FCInput, FadingBarsComponent, FadingCirclesComponent, FieldToLabelPipe, FieldsToDisplayComponent, FileUploadComponent, FilterArrayByStringPipe, FilterArrayPipe, FilterFormArrayControlPipe, FilterFormArrayGroupPipe, FilterOptions, FindItemComponent, FindItemModule, FormErrorComponent, FormGeneratedValueComponent, FormGeneratorComponent, FormGeneratorComponent as FormGeneratorModule, FormGeneratorService, FormInvalidClassDirective, FormInvalidClassPipe, FormLinkComponent, FormLinkComponent as FormLinkModule, FormSchemaToTableColumnsPipe, FormTabHeadersComponent, FormTabHeadersComponent as FormTabHeadersModule, FormValuePipe, FunctionCaller, FunctionCaller1, FunctionCaller2, FunctionCaller3, GenderPipe, GetColFormattedPipe, GetHeadersPipe, GetRawFieldsPipe, GetValueLabel, GlobalErrorHandlerService, HasFormValuePipe, HasValuePipe, HideDesktopDirective, HideMobileDirective, HtmlerService, HttpListCaller, HttpListCaller1, HttpListCaller2, ImageLoaderDirective, ImageUpload, InfoDialogComponent, InfoDialogModule, InfoDialogService, InfoIconComponent, InfoIconComponent as InfoIconModule, InputBasicComponent, InputClassPipe, InputComponent, inputs_component as InputComponents, InputControlComponent, InputFormatDirective, InputFormatDirectivesModule, InputFormatService, InputFormattersPipe, InputLabelComponent, InputModule, InputNGModelComponent, InputNGModelComponent as InputNGModelModule, InputPipesModule, InputService, InputTD_RFComponent, InputTableComponent, InputTableService, IntegerOnlyDirective, IsClonePage, IsShowPage, LabelComponent, LabelComponent as LabelModule, Lbl, ListOptionFinderPipe, LoaderComponent, LoaderComponent as LoaderModule, LocalCacheService, Log, LoggerComponent, LoggerInterceptorService, LoggerRoutingModule, LoggerService, MHrefDirective, MobileClassDirective, ModalBodyDirective, ModalComponent, ModalComponents, ModalFooterDirective, ModalFormComponent, ModalFormComponent as ModalFormModule, ModalHeaderComponent, ModalHeaderComponent as ModalHeaderModule, ModalComponent as ModalModule, MrouterLinkirective, NarrationHistoryCompComponent, NegativeNumberOnlyDirective, NotificationsComponent, NotificationsService, ObjectToArrayPipe, ObjectToLabelsPipe, OnClickDirective, OptionLabeller, OptionerPipe, OptionsFormatter, PSDirective, PageCenterBodyComponent, PageLoader, PageLoaderService, PageModal, PageService, PageTemplateComponent, PageTemplateComponent as PageTemplateModule, PageToComponentComponent, PageToComponentDirective, PageToComponentComponent as PageToComponentModule, PageToComponentService, PaginatorComponent, PaginatorPipe, PhoneNumberComponent, PhoneNumberComponent as PhoneNumberModule, PhoneNumberService, prototypes as Prototypes, RefresherPipe, RemoveUsedOptionsPipe, RemoveUsedOptionsReactivePipe, ReplaceAllPipe, RequestLoggerInterceptorService, RequestTimeoutInterceptorService, ResponsiveValPipe, ResponsivenessDirective, RichTextEditorComponent, RichTextEditorRFComponent, RingRipplesComponent, RoundPipe, RouteItem, RowActionsComponent, RowActionsComponent as RowActionsModule, BaseEffect as SDKBaseEffect, BaseFacadeService as SDKBaseFacadeService, BaseService as SDKBaseService, SaverClass, SaverService, SecondsToTimePipe, SharedModule, SortPipe, SpinnerComponent, StorageClass, StrConcatenatorPipe, SvgIconComponent, SvgIconService, TableCol, TableHttpsComponent, TableHttpsComponent as TableHttpsModule, TableInputComponent, TableInputRowComponent, TablePipesModule, TablePlainComponent, TablePlainComponent as TablePlainModule, TableService, TableToStringPipe, TextAreaModalComponent, TextAreaModalService, TextCase1Component, TextCase2Component, TextCase2ForObject, TextCaseInputComponent, TextCaseService, TextComponent, ToAnyArrayPipe, ToAnyPipe, ToggleInputFormComponent, TranslatePipe, TranslatePipeModule, TranslationService, TranslatorCaseComponent, TranslatorDirective, TrimPipe, TrimTextPipe, TyperPipe, UserActivity, UserActivityService, UtilityPipesModule, UtilityService, ValidationMessageComponent, ValidationMessageNgmodelComponent, ValidationMsg, Validator, ValueFormatterPipe, ValueOrXPipe, ViewFormButtonsComponent, ViewFormButtonsComponent as ViewFormButtonsModule, WatermarkComponent, WebUserAuthenticationService, WebUserForgotPasswordComponent, WebUserLoginComponent, WebUserResetPasswordComponent, XOrYPipe, YearMonthTdRfComponent, _SharedModule, configForms, configPatterns, configValidationMessages, environment, webUserAuthenticationGuard, webUserAuthenticationInterceptor };
18188
+ export { AddItemComponent, ApiService, AppRouteBase, AppRouteService, AppRouteState, AppService, ArraySplitter, AuthenticationInterceptorService, AutocompleteComponent, AutocompleteModule, AutocompleteService, AutocompleteTdRfComponent, BlinkingBlocksComponent, BouncingBallComponent, Btn, BtnComponent, BtnLg, BtnLgComponent, BtnLinkComponent, BtnModule, BtnService, ButtonComponent, CETSInput, CacheService, CacheUpdaterService, CardComponent, CardComponent as CardModule, CodeTitleDescPipe, CommafyNumberDirective, ButtonComponent as ComponentsModule, Config, ConfirmDialogComponent, ConfirmDialogComponent as ConfirmDialogModule, Constant, CustomDatePipe, DEFAULT_TIMEOUT, DateInputComponent, Day, DayHourMinInputComponent, DebouncerService, DesktopClassDirective, DetailsBtnComponent, DetailsBtnComponent as DetailsBtnModule, DirectivesModule, DocumentsNameDisplayComponent, DocumentsNameDisplayComponent as DocumentsNameDisplayModule, DragDropFileUploadDirective, EETSPageBtnID, ELanguage, EMenuLocation, EMenuType, EPageType, ESubSystem, ESystem, ESystemBusLine, ETSCheckForUpdateService, ETSConfirmDialogService, ETSExtraPagesModule, ETSFKVP, ETSForms, ETSHandleUnrecoverableStateService, ETSKVP, ETSLogUpdateService, ETSLoggerModule, ETSMenuItem, ETSMenuItemDivider, ETSPageNotFoundModule, ETSPromptUpdateService, ETSReactiveFormInputService, ETSResetModule, ETSResponsivenessDirectiveModule, ETSRobotModule, ETSServiceWorkerService, ETSStorageService, ETSThemeService, ETSTimeoutTesterModule, ETSVersionModule, ETSWindowSecurityService, EUA, EVFunctions, EValidationType, EditableTextCaseComponent, EditableTextCaseComponent as EditableTextCaseModule, SDKEnvironment as Environment, EqualChildrenDirective, ErrorMessagePipe, ExportTableComponent, ExportTableComponent as ExportTableModule, FCInput, FadingBarsComponent, FadingCirclesComponent, FieldToLabelPipe, FieldsToDisplayComponent, FileUploadComponent, FilterArrayByStringPipe, FilterArrayPipe, FilterFormArrayControlPipe, FilterFormArrayGroupPipe, FilterOptions, FindItemComponent, FindItemModule, FormErrorComponent, FormGeneratedValueComponent, FormGeneratorComponent, FormGeneratorComponent as FormGeneratorModule, FormGeneratorService, FormInvalidClassDirective, FormInvalidClassPipe, FormLinkComponent, FormLinkComponent as FormLinkModule, FormSchemaToTableColumnsPipe, FormTabHeadersComponent, FormTabHeadersComponent as FormTabHeadersModule, FormValuePipe, FunctionCaller, FunctionCaller1, FunctionCaller2, FunctionCaller3, GenderPipe, GetColFormattedPipe, GetHeadersPipe, GetRawFieldsPipe, GetValueLabel, GlobalErrorHandlerService, HasFormValuePipe, HasValuePipe, HideDesktopDirective, HideMobileDirective, HtmlerService, HttpListCaller, HttpListCaller1, HttpListCaller2, ImageLoaderDirective, ImageUpload, InfoDialogComponent, InfoDialogModule, InfoDialogService, InfoIconComponent, InfoIconComponent as InfoIconModule, InputBasicComponent, InputClassPipe, InputComponent, inputs_component as InputComponents, InputControlComponent, InputFormatDirective, InputFormatDirectivesModule, InputFormatService, InputFormattersPipe, InputLabelComponent, InputModule, InputNGModelComponent, InputNGModelComponent as InputNGModelModule, InputPipesModule, InputService, InputTD_RFComponent, InputTableComponent, InputTableService, IntegerOnlyDirective, IsClonePage, IsShowPage, LabelComponent, LabelComponent as LabelModule, Lbl, ListOptionFinderPipe, LoaderComponent, LoaderComponent as LoaderModule, LocalCacheService, Log, LoggerComponent, LoggerInterceptorService, LoggerRoutingModule, LoggerService, MHrefDirective, MobileClassDirective, ModalBodyDirective, ModalComponent, ModalComponents, ModalFooterDirective, ModalFormComponent, ModalFormComponent as ModalFormModule, ModalHeaderComponent, ModalHeaderComponent as ModalHeaderModule, ModalComponent as ModalModule, MrouterLinkirective, NarrationHistoryCompComponent, NegativeNumberOnlyDirective, NotificationsComponent, NotificationsService, ObjectToArrayPipe, ObjectToLabelsPipe, OnClickDirective, OptionLabeller, OptionerPipe, OptionsFormatter, PSDirective, PageCenterBodyComponent, PageLoader, PageLoaderService, PageModal, PageService, PageTemplateComponent, PageTemplateComponent as PageTemplateModule, PageToComponentComponent, PageToComponentDirective, PageToComponentComponent as PageToComponentModule, PageToComponentService, PaginatorComponent, PaginatorPipe, PhoneNumberComponent, PhoneNumberComponent as PhoneNumberModule, PhoneNumberService, prototypes as Prototypes, RefresherPipe, RemoveUsedOptionsPipe, RemoveUsedOptionsReactivePipe, ReplaceAllPipe, RequestLoggerInterceptorService, RequestTimeoutInterceptorService, ResponsiveValPipe, ResponsivenessDirective, RichTextEditorComponent, RichTextEditorRFComponent, RingRipplesComponent, RoundPipe, RouteItem, RowActionsComponent, RowActionsComponent as RowActionsModule, BaseEffect as SDKBaseEffect, BaseFacadeService as SDKBaseFacadeService, BaseService as SDKBaseService, SaverClass, SaverService, SecondsToTimePipe, SharedModule, SortPipe, SpinnerComponent, StorageClass, StrConcatenatorPipe, SvgIconComponent, SvgIconService, TableCol, TableHttpsComponent, TableHttpsComponent as TableHttpsModule, TableInputComponent, TableInputRowComponent, TablePipesModule, TablePlainComponent, TablePlainComponent as TablePlainModule, TableService, TableToStringPipe, TextAreaModalComponent, TextAreaModalService, TextCase1Component, TextCase2Component, TextCase2ForObject, TextCaseInputComponent, TextCaseService, TextComponent, ToAnyArrayPipe, ToAnyPipe, ToggleInputFormComponent, TranslatePipe, TranslatePipeModule, TranslationService, TranslatorCaseComponent, TranslatorDirective, TrimPipe, TrimTextPipe, TyperPipe, UserActivity, UserActivityService, UtilityPipesModule, UtilityService, ValidationMessageComponent, ValidationMessageNgmodelComponent, ValidationMsg, Validator, ValueFormatterPipe, ValueOrXPipe, ViewFormButtonsComponent, ViewFormButtonsComponent as ViewFormButtonsModule, WatermarkComponent, WebUserAuthenticationService, WebUserForgotPasswordComponent, WebUserLoginComponent, WebUserResetPasswordComponent, WebcamMediaComponent, XOrYPipe, YearMonthTdRfComponent, _SharedModule, configForms, configPatterns, configValidationMessages, environment, webUserAuthenticationGuard, webUserAuthenticationInterceptor };
17920
18189
  //# sourceMappingURL=ets-fe-ng-sdk.mjs.map