@rangertechnologies/ngnxt 2.1.49 → 2.1.50

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, Optional, InjectionToken, EventEmitter, Inject, Output, Pipe, ViewChild, Input, ViewEncapsulation, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { Injectable, Component, Optional, InjectionToken, EventEmitter, Inject, Output, Pipe, ViewChild, Input, ViewEncapsulation, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
3
  import * as moment from 'moment';
4
4
  import { Subject, BehaviorSubject } from 'rxjs';
5
5
  import * as i1 from '@angular/router';
@@ -23,9 +23,9 @@ import * as i4$1 from 'ng-pick-datetime';
23
23
  import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';
24
24
  import * as i6 from '@ng-select/ng-select';
25
25
  import { NgSelectModule } from '@ng-select/ng-select';
26
- import * as i8 from '@angular/material/tooltip';
26
+ import * as i9$1 from '@angular/material/tooltip';
27
27
  import { MatTooltipModule } from '@angular/material/tooltip';
28
- import * as i9$1 from '@angular/cdk/bidi';
28
+ import * as i10 from '@angular/cdk/bidi';
29
29
 
30
30
  class NxtAppService {
31
31
  constructor() { }
@@ -4254,555 +4254,892 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
4254
4254
  }]
4255
4255
  }], ctorParameters: function () { return []; } });
4256
4256
 
4257
- class SearchBoxComponent {
4258
- sfService;
4259
- dataService;
4260
- route;
4261
- i18nService;
4262
- placeHolderText;
4263
- auto;
4264
- question;
4265
- apiMeta;
4266
- id;
4267
- readOnly = false; // VD 12Jun24 - readonly change
4268
- searchValueChange = new EventEmitter();
4269
- apiObj;
4270
- SearchItem;
4271
- filterName; // VD 20Aug default filter value as input
4272
- finalResults = [];
4273
- searchKeyWord = '';
4274
- newResult;
4275
- showResult = false;
4276
- noResult = false;
4277
- showSuggestion = true;
4278
- el;
4279
- serv = 'api';
4280
- tkn = '';
4281
- constructor(sfService, dataService, route, el, i18nService) {
4282
- this.sfService = sfService;
4283
- this.dataService = dataService;
4284
- this.route = route;
4285
- this.i18nService = i18nService;
4257
+ // VD 06-09-24 directive file to call component dynamically
4258
+ class ComponenthostDirective {
4259
+ viewContainerRef;
4260
+ constructor(viewContainerRef) {
4261
+ this.viewContainerRef = viewContainerRef;
4262
+ }
4263
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ComponenthostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
4264
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: ComponenthostDirective, isStandalone: true, selector: "[dynamicComponentHost]", ngImport: i0 });
4265
+ }
4266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ComponenthostDirective, decorators: [{
4267
+ type: Directive,
4268
+ args: [{
4269
+ selector: '[dynamicComponentHost]',
4270
+ standalone: true
4271
+ }]
4272
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
4273
+
4274
+ class CustomModelComponent {
4275
+ constructor() { }
4276
+ modalTitle;
4277
+ isModalOpen = false;
4278
+ modalSize = '';
4279
+ saveButtonValue = 'Save';
4280
+ modalFooter = true;
4281
+ saveButtonEmit = new EventEmitter();
4282
+ cancelButtonEmit = new EventEmitter();
4283
+ onSave() {
4284
+ this.saveButtonEmit.emit();
4286
4285
  }
4287
- ngOnInit() {
4288
- // VD 03May- search changes
4289
- if (this.apiMeta) {
4290
- let apiObj = JSON.parse(this.apiMeta);
4291
- this.SearchItem = apiObj.field;
4292
- }
4286
+ onCancel() {
4287
+ this.cancelButtonEmit.emit();
4293
4288
  }
4294
- clearList() {
4295
- setTimeout(() => {
4296
- this.finalResults = [];
4297
- }, 1000);
4289
+ ngOnInit() {
4298
4290
  }
4299
- getSourceDataLocal(event) {
4300
- if (event.target.value.length > 2) {
4301
- this.showSuggestion = true;
4302
- this.finalResults = [];
4303
- this.searchKeyWord = event.target.value;
4304
- this.showResult = false;
4305
- this.getSourceData(event.target.value);
4306
- }
4307
- else {
4308
- this.showSuggestion = false;
4309
- this.finalResults = [];
4310
- this.noResult = false;
4311
- }
4291
+ closeModal() {
4292
+ this.cancelButtonEmit.emit(false);
4312
4293
  }
4313
- // VD 03May- search changes
4314
- getSourceData = (keyword) => {
4315
- if (this.apiMeta !== undefined) {
4316
- let apiObj = JSON.parse(this.apiMeta);
4317
- this.dataService.apiResponse(apiObj.endpoint).subscribe((apiResponse) => {
4318
- let response;
4319
- if (apiObj.variable) {
4320
- // VD 22May24 - handling multiple child objects
4321
- response = this.dataService.getValue(apiResponse, apiObj.variable);
4322
- }
4323
- else {
4324
- response = apiResponse;
4325
- }
4326
- let field = apiObj.field;
4327
- let results = [];
4328
- for (let i = 0; i < response.length; i++) { // VD NOV23 - updated the search keys
4329
- // VD 26JUN24 - handling multiple objects
4330
- const objValue = this.dataService.getValue(response[i], field);
4331
- if (objValue?.toLowerCase().includes(keyword?.toLowerCase())) {
4332
- console.log('pushing ' + objValue);
4333
- results.push(response[i]);
4334
- }
4335
- }
4336
- this.noResult = !(results.length > 1);
4337
- this.finalResults = results;
4338
- });
4339
- }
4340
- };
4341
- clickItem(event) {
4342
- // console.log('inside clickItem of ' + event.target.value);
4343
- let apiObj = JSON.parse(this.apiMeta);
4344
- this.filterName = event[apiObj.field];
4345
- let change = new ChangeWrapper(); // ChangeWrapper = JSON.parse('{}');
4346
- change.fromQuestionId = this.id;
4347
- change.valueObj = event;
4348
- change.field = apiObj.field;
4349
- this.searchValueChange.emit(change);
4294
+ saveModal() {
4295
+ this.saveButtonEmit.emit();
4350
4296
  }
4351
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SearchBoxComponent, deps: [{ token: SalesforceService }, { token: DataService }, { token: i1.ActivatedRoute }, { token: i0.ElementRef }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
4352
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: SearchBoxComponent, selector: "lib-search-box", inputs: { placeHolderText: "placeHolderText", question: "question", apiMeta: "apiMeta", id: "id", readOnly: "readOnly", filterName: "filterName" }, outputs: { searchValueChange: "searchValueChange" }, viewQueries: [{ propertyName: "auto", first: true, predicate: ["auto"], descendants: true }], ngImport: i0, template: "<!-- // VD 12Jun24 - readonly change-->\n<div id=\"autocomplete-input\">\n <input #auto id=\"searchbox-style\"\n (blur)=\"clearList()\" \n [(ngModel)]=\"filterName\" \n type=\"text\" \n name=\"name\" \n [readOnly]=\"readOnly\"\n [placeholder]=\"placeHolderText\" \n style=\"margin: 0 !important;\" \n class=\"searchInput she-line-input form-control\" \n (focusin)=\"getSourceDataLocal($event)\" \n (input)=\"getSourceDataLocal($event)\">\n <div id=\"selectList\" style=\"position: absolute;position: absolute;background: white;z-index: 2;\">\n <div *ngIf=\"finalResults.length > 0 && showSuggestion\" \n style=\"max-height: 100vh;border: 1px solid #d2d4d6;overflow: scroll;\" \n class=\"suggestions-container\">\n <!-- HA 20DEC23 Uncommented the logic -->\n <!-- VD 03May- search changes -->\n <div *ngFor=\"let item of finalResults\" (click)='clickItem(item)' class=\"hoover\">\n <!-- VD 26Jun24 - id condition removed -->\n <div class=\"grid-x align-middle\" style=\"padding: 1rem\">\n <div *ngIf=\"item.thumbnail\" class=\"cell shrink\" style=\"width: 60px; margin-right: 1.6rem;\">\n <img [src]=\"item.thumbnail\" style=\"width: 60px;\" alt=\"\">\n </div>\n <div class=\"cell auto\" style=\"text-align: left; padding-left: 20px;\">\n <!--// VD 26JUN24 - pipe changes -->\n <h4 >{{ '' | getValue: item : SearchItem }}</h4>\n </div>\n </div>\n </div>\n <!-- HA 20DEC23 For Commented this for future purpose -->\n <!-- <table class=\"table table-striped table-bordered\">\n <thead>\n <tr>\n <th>{{ 'firstName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'lastName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'division' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'numberPlate' | i18n:i18nService.currentLanguage }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of finalResults\" (click)='clickItem(item)'>\n <td>{{ item.firstName }}</td>\n <td>{{ item.lastName }}</td>\n <td>{{ item.division }}</td>\n <td>{{ item.numberPlate }}</td>\n </tr>\n </tbody>\n </table> -->\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: GetValuePipe, name: "getValue" }] });
4297
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomModelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4298
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomModelComponent, selector: "app-custom-model", inputs: { modalTitle: "modalTitle", isModalOpen: "isModalOpen", modalSize: "modalSize", saveButtonValue: "saveButtonValue", modalFooter: "modalFooter" }, outputs: { saveButtonEmit: "saveButtonEmit", cancelButtonEmit: "cancelButtonEmit" }, ngImport: i0, template: "<div *ngIf=\"isModalOpen\" class=\"modal\" [ngClass]=\"modalSize\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <span class=\"close\" (click)=\"onCancel()\">&times;</span>\n <h2>{{ modalTitle }}</h2>\n </div>\n <div class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <!-- /* VD 06Sep24 styling changes */-->\n <div class=\"modal-footer\" *ngIf=\"modalFooter\">\n <button (click)=\"onCancel()\">Cancel</button>\n <button (click)=\"onSave()\">{{ saveButtonValue }}</button>\n </div>\n </div>\n</div>\n ", styles: [".modal{display:block;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:5% auto;padding:20px;border:1px solid #888;width:70%;max-width:90%;max-height:80vh;overflow-y:auto}.modal-header,.modal-footer{padding:10px;text-align:center;display:block}.modal-body{max-height:60vh;overflow-y:auto}.close{color:#aaa;float:right;font-size:28px;font-weight:700}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}.modal-footer button{padding:10px 20px;margin:5px;font-size:16px;border:1px solid #ccc;border-radius:4px;cursor:pointer;background-color:#f5f5f5;color:#333}.modal-footer button:hover{background-color:#e0e0e0;border-color:#bbb}@media (max-width: 768px){.modal-content{width:90%;margin:10% auto}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
4353
4299
  }
4354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SearchBoxComponent, decorators: [{
4300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomModelComponent, decorators: [{
4355
4301
  type: Component,
4356
- args: [{ selector: 'lib-search-box', template: "<!-- // VD 12Jun24 - readonly change-->\n<div id=\"autocomplete-input\">\n <input #auto id=\"searchbox-style\"\n (blur)=\"clearList()\" \n [(ngModel)]=\"filterName\" \n type=\"text\" \n name=\"name\" \n [readOnly]=\"readOnly\"\n [placeholder]=\"placeHolderText\" \n style=\"margin: 0 !important;\" \n class=\"searchInput she-line-input form-control\" \n (focusin)=\"getSourceDataLocal($event)\" \n (input)=\"getSourceDataLocal($event)\">\n <div id=\"selectList\" style=\"position: absolute;position: absolute;background: white;z-index: 2;\">\n <div *ngIf=\"finalResults.length > 0 && showSuggestion\" \n style=\"max-height: 100vh;border: 1px solid #d2d4d6;overflow: scroll;\" \n class=\"suggestions-container\">\n <!-- HA 20DEC23 Uncommented the logic -->\n <!-- VD 03May- search changes -->\n <div *ngFor=\"let item of finalResults\" (click)='clickItem(item)' class=\"hoover\">\n <!-- VD 26Jun24 - id condition removed -->\n <div class=\"grid-x align-middle\" style=\"padding: 1rem\">\n <div *ngIf=\"item.thumbnail\" class=\"cell shrink\" style=\"width: 60px; margin-right: 1.6rem;\">\n <img [src]=\"item.thumbnail\" style=\"width: 60px;\" alt=\"\">\n </div>\n <div class=\"cell auto\" style=\"text-align: left; padding-left: 20px;\">\n <!--// VD 26JUN24 - pipe changes -->\n <h4 >{{ '' | getValue: item : SearchItem }}</h4>\n </div>\n </div>\n </div>\n <!-- HA 20DEC23 For Commented this for future purpose -->\n <!-- <table class=\"table table-striped table-bordered\">\n <thead>\n <tr>\n <th>{{ 'firstName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'lastName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'division' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'numberPlate' | i18n:i18nService.currentLanguage }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of finalResults\" (click)='clickItem(item)'>\n <td>{{ item.firstName }}</td>\n <td>{{ item.lastName }}</td>\n <td>{{ item.division }}</td>\n <td>{{ item.numberPlate }}</td>\n </tr>\n </tbody>\n </table> -->\n </div>\n</div>\n" }]
4357
- }], ctorParameters: function () { return [{ type: SalesforceService }, { type: DataService }, { type: i1.ActivatedRoute }, { type: i0.ElementRef }, { type: I18nService }]; }, propDecorators: { placeHolderText: [{
4302
+ args: [{ selector: 'app-custom-model', template: "<div *ngIf=\"isModalOpen\" class=\"modal\" [ngClass]=\"modalSize\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <span class=\"close\" (click)=\"onCancel()\">&times;</span>\n <h2>{{ modalTitle }}</h2>\n </div>\n <div class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <!-- /* VD 06Sep24 styling changes */-->\n <div class=\"modal-footer\" *ngIf=\"modalFooter\">\n <button (click)=\"onCancel()\">Cancel</button>\n <button (click)=\"onSave()\">{{ saveButtonValue }}</button>\n </div>\n </div>\n</div>\n ", styles: [".modal{display:block;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:5% auto;padding:20px;border:1px solid #888;width:70%;max-width:90%;max-height:80vh;overflow-y:auto}.modal-header,.modal-footer{padding:10px;text-align:center;display:block}.modal-body{max-height:60vh;overflow-y:auto}.close{color:#aaa;float:right;font-size:28px;font-weight:700}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}.modal-footer button{padding:10px 20px;margin:5px;font-size:16px;border:1px solid #ccc;border-radius:4px;cursor:pointer;background-color:#f5f5f5;color:#333}.modal-footer button:hover{background-color:#e0e0e0;border-color:#bbb}@media (max-width: 768px){.modal-content{width:90%;margin:10% auto}}\n"] }]
4303
+ }], ctorParameters: function () { return []; }, propDecorators: { modalTitle: [{
4358
4304
  type: Input
4359
- }], auto: [{
4360
- type: ViewChild,
4361
- args: ['auto']
4362
- }], question: [{
4305
+ }], isModalOpen: [{
4363
4306
  type: Input
4364
- }], apiMeta: [{
4307
+ }], modalSize: [{
4365
4308
  type: Input
4366
- }], id: [{
4309
+ }], saveButtonValue: [{
4367
4310
  type: Input
4368
- }], readOnly: [{
4311
+ }], modalFooter: [{
4369
4312
  type: Input
4370
- }], searchValueChange: [{
4313
+ }], saveButtonEmit: [{
4314
+ type: Output
4315
+ }], cancelButtonEmit: [{
4371
4316
  type: Output
4372
- }], filterName: [{
4373
- type: Input
4374
4317
  }] } });
4375
4318
 
4376
- class FileUploadComponent {
4377
- SharedService;
4378
- dataService;
4379
- sanitizer;
4380
- i18nService;
4381
- selectedFileData = new EventEmitter();
4382
- deletedFileData = new EventEmitter();
4383
- allFiles;
4384
- limitFileUploading;
4385
- isDeleteFileButtonVisible;
4386
- isShowNoFileIcon;
4387
- tableFile; // file Upload from table
4319
+ class CustomCalendarComponent {
4320
+ eventSelected = new EventEmitter();
4321
+ // VD 06Sep24 calendar changes
4322
+ dateSelected = new EventEmitter();
4323
+ allEvents = [];
4388
4324
  question;
4389
- error;
4390
- selectedFileNameArray = [];
4391
- copyOfInputAllFiles;
4392
- copyOfFileUploadingLimit;
4393
- fileUrl;
4394
- showFile = false;
4395
- isImage = false;
4396
- fileName = '';
4397
- currentFile;
4398
- constructor(SharedService, dataService, sanitizer, i18nService) {
4399
- this.SharedService = SharedService;
4400
- this.dataService = dataService;
4401
- this.sanitizer = sanitizer;
4402
- this.i18nService = i18nService;
4325
+ dynamicHost;
4326
+ entries = [];
4327
+ referenceQuestions = [];
4328
+ qbRefrenceBook;
4329
+ calendarQuestion = [];
4330
+ currentDate = new Date();
4331
+ calendarDays = [];
4332
+ daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
4333
+ newEventTitle = '';
4334
+ newEventTime = '';
4335
+ newDescription = '';
4336
+ newLink = '';
4337
+ selectedDay = null;
4338
+ isModalOpen = false;
4339
+ modalTitle = 'Custom Modal';
4340
+ modalSize = 'large';
4341
+ saveButtonValue = 'Save';
4342
+ modalFooter = true;
4343
+ editingEventId;
4344
+ editingEntryGroup;
4345
+ showAppoinmentSection = true;
4346
+ ngOnInit() {
4347
+ if (this.question?.input) {
4348
+ this.allEvents = this.question.input;
4349
+ }
4350
+ this.processQuestion();
4351
+ this.generateCalendar();
4403
4352
  }
4404
- ngOnInit() { }
4405
- // VD 03May24 file upload fix
4406
- // onFileUpload(event: any) {
4407
- // const fileUploaderElement: HTMLElement = document.getElementById(
4408
- // 'fileUpload'
4409
- // ) as HTMLElement;
4410
- // fileUploaderElement.click();
4411
- // }
4412
- ngOnChanges(simpleChanges) {
4413
- console.log('simple changes', simpleChanges);
4414
- this.copyOfInputAllFiles = simpleChanges.allFiles?.currentValue;
4415
- if (simpleChanges.limitFileUploading) {
4416
- this.copyOfFileUploadingLimit = simpleChanges.limitFileUploading?.currentValue;
4353
+ processQuestion() {
4354
+ this.entries = JSON.parse(this.question['Fields_Meta__c']);
4355
+ this.qbRefrenceBook = JSON.parse(this.question['QB_Reference_Questions__c']);
4356
+ let title = this.qbRefrenceBook?.questionbook?.Title__c;
4357
+ this.modalTitle = title;
4358
+ this.referenceQuestions = [];
4359
+ if (this.entries.length > 0) {
4360
+ this.entries.forEach(element => {
4361
+ if (element.questionReference) {
4362
+ let qReference = JSON.parse(element.questionReference);
4363
+ this.referenceQuestions.push(qReference?.question);
4364
+ }
4365
+ });
4417
4366
  }
4367
+ console.log('entries-->');
4368
+ console.log('question-->');
4369
+ console.log(this.entries);
4370
+ console.log(this.referenceQuestions);
4418
4371
  }
4419
- uploadMultipleFiles(event) {
4420
- console.log('File uploader initiated');
4421
- let inputFiles = this.copyOfInputAllFiles ? this.copyOfInputAllFiles : [];
4422
- const selectedFileData = [];
4423
- const uploadedFiles = event.target.files;
4424
- if (uploadedFiles.length + inputFiles.length <= this.copyOfFileUploadingLimit) {
4425
- const readFilesPromises = [];
4426
- for (const eachUploadedFile of uploadedFiles) {
4427
- const file = eachUploadedFile;
4428
- const format = file.name.split('.')[1];
4429
- // Create a promise for each file read
4430
- const fileReadPromise = new Promise((resolve, reject) => {
4431
- const reader = new FileReader();
4432
- reader.readAsDataURL(file);
4433
- reader.onload = () => {
4434
- const fileData = {
4435
- doc: reader.result,
4436
- name: file.name,
4437
- type: file.type,
4438
- format,
4439
- id: null,
4440
- };
4441
- selectedFileData.push(fileData);
4442
- inputFiles.push(fileData);
4443
- resolve();
4444
- };
4445
- reader.onerror = () => {
4446
- reject();
4447
- };
4448
- });
4449
- readFilesPromises.push(fileReadPromise);
4450
- }
4451
- // Wait for all promises to resolve
4452
- Promise.all(readFilesPromises).then(() => {
4453
- this.copyOfInputAllFiles = inputFiles;
4454
- console.log('uploadedFiles', inputFiles);
4455
- this.selectedFileData.emit(inputFiles);
4456
- }).catch(() => {
4457
- console.error('Error reading files');
4372
+ // VD 06-09-24 to call the quetionbook component
4373
+ openQuestionBookModal() {
4374
+ const viewContainerRef = this.dynamicHost.viewContainerRef;
4375
+ viewContainerRef.clear();
4376
+ const componentRef = viewContainerRef.createComponent(QuestionbookComponent);
4377
+ componentRef.instance.qbItem = this.qbRefrenceBook;
4378
+ componentRef.instance.questions = this.referenceQuestions;
4379
+ componentRef.instance.handleQuestion.subscribe((event) => this.handleQuestionEvent(event));
4380
+ }
4381
+ generateCalendar() {
4382
+ const year = this.currentDate.getFullYear();
4383
+ const month = this.currentDate.getMonth();
4384
+ const startOfMonth = new Date(year, month, 1);
4385
+ const endOfMonth = new Date(year, month + 1, 0);
4386
+ const startDayOfWeek = startOfMonth.getDay();
4387
+ const endDayOfWeek = endOfMonth.getDay();
4388
+ const startDate = new Date(startOfMonth);
4389
+ startDate.setDate(startDate.getDate() - startDayOfWeek);
4390
+ const endDate = new Date(endOfMonth);
4391
+ endDate.setDate(endDate.getDate() + (6 - endDayOfWeek));
4392
+ const today = new Date(new Date().setHours(0, 0, 0, 0));
4393
+ this.calendarDays = [];
4394
+ for (let d = new Date(startDate); d <= endDate; d.setDate(d.getDate() + 1)) {
4395
+ const date = new Date(d);
4396
+ this.calendarDays.push({
4397
+ date: date,
4398
+ events: [],
4399
+ isCurrentMonth: d.getMonth() === month,
4400
+ isPast: date < today,
4401
+ isToday: date.getTime() === today.getTime(),
4402
+ isFuture: date > today,
4458
4403
  });
4459
4404
  }
4460
- else {
4461
- console.warn('You can upload max 5 files');
4462
- // this.toastr.warning(TOASTER_MESSAGES.MAX_FIVE_FILES, TOASTER_MESSAGES.WARNING_TITLE);
4405
+ // Populate calendar with events from allEvents array
4406
+ this.calendarDays.forEach(day => {
4407
+ day.events = this.allEvents.filter(event => event.date.toDateString() === day.date.toDateString());
4408
+ });
4409
+ this.eventSelected.emit(this.allEvents);
4410
+ // VD 06Sep24 calendar changes
4411
+ let calendar = {};
4412
+ calendar['year'] = year;
4413
+ calendar['month'] = month + 1;
4414
+ console.log(calendar);
4415
+ this.dateSelected.emit(calendar);
4416
+ }
4417
+ selectDay(day) {
4418
+ console.log(day);
4419
+ // VD 06Sep24 calendar changes
4420
+ this.showAppoinmentSection = true;
4421
+ this.selectedDay = day;
4422
+ // this.eventSelected.emit(day?.events);
4423
+ const previouslySelectedDay = this.calendarDays.find(d => d.isSelected);
4424
+ if (previouslySelectedDay) {
4425
+ previouslySelectedDay.isSelected = false;
4463
4426
  }
4464
- event.target.value = '';
4427
+ // Select the clicked day
4428
+ day.isSelected = true;
4465
4429
  }
4466
- // uploadMultipleFiles(event: any) {
4467
- // console.log('File uploader initiated');
4468
- // let inputFiles: any[] = this.copyOfInputAllFiles ? this.copyOfInputAllFiles : [];
4469
- // const selectedFileData = [];
4470
- // const uploadedFiles = event.target.files;
4471
- // if (uploadedFiles.length + inputFiles.length <= this.copyOfFileUploadingLimit) {
4472
- // for (const eachUploadedFile of uploadedFiles) {
4473
- // const reader = new FileReader();
4474
- // const file: File = eachUploadedFile;
4475
- // const format = file.name.split('.')[1];
4476
- // reader.readAsDataURL(file);
4477
- // reader.onload = () => {
4478
- // selectedFileData.push({
4479
- // doc: reader.result,
4480
- // name: file.name,
4481
- // type: file.type,
4482
- // format,
4483
- // id: null,
4484
- // });
4485
- // inputFiles.push({
4486
- // doc: reader.result,
4487
- // name: file.name,
4488
- // type: file.type,
4489
- // format,
4490
- // id: null,
4491
- // });
4492
- // };
4493
- // }
4494
- // } else {
4495
- // console.warn('You can upload max 5 files');
4496
- // //this.toastr.warning(TOASTER_MESSAGES.MAX_FIVE_FILES, TOASTER_MESSAGES.WARNING_TITLE);
4497
- // }
4498
- // event.target.value = '';
4499
- // this.copyOfInputAllFiles = inputFiles;
4500
- // console.log('uploadedFiles',inputFiles);
4501
- // this.selectedFileData.emit(inputFiles);
4502
- // }
4503
- deleteFile(currentFileIndex) {
4504
- const deletedFileName = this.selectedFileNameArray.splice(currentFileIndex, 1);
4505
- const deletedFile = this.copyOfInputAllFiles.splice(currentFileIndex, 1);
4506
- console.log('emit', deletedFile[0]);
4507
- this.deletedFileData.emit(deletedFile[0]);
4508
- this.selectedFileData.emit(this.copyOfInputAllFiles);
4430
+ previousMonth() {
4431
+ this.showAppoinmentSection = false;
4432
+ this.currentDate.setMonth(this.currentDate.getMonth() - 1);
4433
+ this.currentDate = new Date(this.currentDate); // Ensure the date object is updated
4434
+ this.generateCalendar();
4509
4435
  }
4510
- // VD 20May24 - preview changes
4511
- viewFile(currentFile) {
4512
- this.currentFile = currentFile;
4513
- this.showFile = true;
4514
- console.log(currentFile);
4515
- if (this.question.Sub_Text__c != undefined) {
4516
- let fileMeta = JSON.parse(this.question.Sub_Text__c);
4517
- let endpoint = fileMeta.endpoint;
4518
- let queryParameter = fileMeta.queryParameter;
4519
- let file = currentFile;
4520
- if (endpoint) {
4521
- const fullEndPoint = endpoint + '?' + queryParameter + '=' + file[queryParameter];
4522
- if (fullEndPoint) {
4523
- this.dataService.apiResponse(fullEndPoint).subscribe((apiResponse) => {
4524
- if (apiResponse) {
4525
- this.handleFileContent(apiResponse);
4526
- }
4527
- });
4436
+ nextMonth() {
4437
+ // VD 06Sep24 calendar changes
4438
+ this.showAppoinmentSection = false;
4439
+ this.currentDate.setMonth(this.currentDate.getMonth() + 1);
4440
+ this.currentDate = new Date(this.currentDate); // Ensure the date object is updated
4441
+ this.generateCalendar();
4442
+ }
4443
+ addAppointment() {
4444
+ this.isModalOpen = true;
4445
+ this.calendarQuestion = this.referenceQuestions.map(q => ({ ...q, input: '' }));
4446
+ this.referenceQuestions.forEach(ques => {
4447
+ // clear the input
4448
+ if (ques.Type__c == 'Dropdown') {
4449
+ delete ques.input;
4450
+ delete ques.selectedValue;
4451
+ // VD 06Sep24 calendar changes
4452
+ }
4453
+ else {
4454
+ delete ques.input;
4455
+ }
4456
+ });
4457
+ console.log(' console.log(this.referenceQuestions);');
4458
+ console.log(this.referenceQuestions);
4459
+ this.editingEventId = null;
4460
+ // Dynamically load the QuestionBookComponent
4461
+ this.openQuestionBookModal();
4462
+ }
4463
+ // VD 06Sep24 calendar changes
4464
+ editEvent(event, entryGroup) {
4465
+ this.isModalOpen = true;
4466
+ this.referenceQuestions = Object.values(entryGroup);
4467
+ this.calendarQuestion = [...this.referenceQuestions]; // Make a copy of the current entries to edit
4468
+ this.editingEventId = event.id;
4469
+ this.editingEntryGroup = entryGroup; // Store the entry group being edited
4470
+ this.generateCalendar(); // Regenerate the calendar to reflect changes
4471
+ }
4472
+ deleteEvent(eventId, entryGroup) {
4473
+ const event = this.allEvents.find(e => e.id === eventId);
4474
+ if (event) {
4475
+ // Find the index of the entryGroup to delete
4476
+ const entryIndex = event.entries.indexOf(entryGroup);
4477
+ if (entryIndex > -1) {
4478
+ event.entries.splice(entryIndex, 1); // Remove the specific entry
4479
+ }
4480
+ // If the event has no more entries, remove the event entirely
4481
+ if (event.entries.length === 0) {
4482
+ const eventIndex = this.allEvents.indexOf(event);
4483
+ if (eventIndex > -1) {
4484
+ this.allEvents.splice(eventIndex, 1); // Remove the entire event
4528
4485
  }
4529
4486
  }
4530
4487
  }
4488
+ this.generateCalendar(); // Regenerate the calendar to reflect the changes
4489
+ }
4490
+ closeModal() {
4491
+ this.isModalOpen = false;
4492
+ }
4493
+ // VD 06Sep24 calendar changes
4494
+ addEvent(day, entryQues) {
4495
+ // Transform new entries into the desired format
4496
+ const newEntries = entryQues.reduce((acc, q) => {
4497
+ acc[q.Id] = { ...q };
4498
+ return acc;
4499
+ }, {});
4500
+ // Find an existing event for the given date
4501
+ const existingEvent = day.events.find(event => event.date === day.date);
4502
+ if (existingEvent) {
4503
+ // Merge new entries into the existing event's entries array
4504
+ // Check if the entries array already contains an object with the same ID
4505
+ const existingEntries = existingEvent.entries.map(entry => ({ ...entry }));
4506
+ // Append new entries to the existing entries
4507
+ existingEntries.push(newEntries);
4508
+ existingEvent.entries = existingEntries;
4509
+ }
4531
4510
  else {
4532
- this.viewLocalFile();
4511
+ // Create a new event if it doesn't exist for the given date
4512
+ const newEvent = {
4513
+ id: this.generateId(),
4514
+ date: day.date,
4515
+ entries: [newEntries] // Wrap the new entries in an array
4516
+ };
4517
+ day.events.push(newEvent);
4518
+ this.allEvents.push(newEvent);
4533
4519
  }
4520
+ this.generateCalendar();
4521
+ console.log('allEvents', this.allEvents);
4534
4522
  }
4535
- // // VD 03Aug24 process local preview
4536
- viewLocalFile() {
4537
- if (this.currentFile) {
4538
- this.setFileUrl(this.currentFile?.doc);
4539
- this.fileName = this.currentFile.name;
4540
- this.isImage = this.currentFile.type.startsWith('image/');
4523
+ // VD 06Sep24 calendar changes
4524
+ onSave() {
4525
+ if (this.editingEventId !== null) {
4526
+ const event = this.allEvents.find(e => e.id === this.editingEventId);
4527
+ if (event && this.editingEntryGroup) {
4528
+ // Update the specific entry group within the event
4529
+ const entryIndex = event.entries.findIndex(entryGroup => entryGroup === this.editingEntryGroup);
4530
+ if (entryIndex > -1) {
4531
+ event.entries[entryIndex] = this.calendarQuestion.reduce((acc, q) => {
4532
+ acc[q.Id] = { ...q };
4533
+ return acc;
4534
+ }, {});
4535
+ }
4536
+ }
4541
4537
  }
4542
- }
4543
- handleFileContent(fileResponse) {
4544
- const byteArray = new Uint8Array(fileResponse.content.data);
4545
- const blob = new Blob([byteArray], { type: fileResponse.type });
4546
- const url = window.URL.createObjectURL(blob);
4547
- this.setFileUrl(url);
4548
- this.isImage = false;
4549
- if (fileResponse.name) {
4550
- this.fileName = fileResponse.name;
4551
- const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
4552
- const fileExtension = fileResponse.name.split('.').pop()?.toLowerCase();
4553
- this.isImage = imageExtensions.includes(fileExtension || '');
4538
+ else {
4539
+ if (this.selectedDay) {
4540
+ this.addEvent(this.selectedDay, this.calendarQuestion);
4541
+ }
4554
4542
  }
4543
+ this.closeModal();
4544
+ this.generateCalendar();
4555
4545
  }
4556
- setFileUrl(url) {
4557
- this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
4558
- }
4559
- getDocIcon(docName) {
4560
- const ext = docName.split('.').pop(-1);
4561
- return this.SharedService.docIcon(ext);
4546
+ onCancel() {
4547
+ console.log('Cancel button clicked');
4548
+ this.closeModal();
4562
4549
  }
4563
- close() {
4564
- this.showFile = false;
4565
- this.fileName = '';
4566
- this.fileUrl = '';
4567
- this.isImage = false;
4568
- if (this.fileUrl) {
4569
- URL.revokeObjectURL(this.fileUrl);
4550
+ handleQuestionEvent(ques) {
4551
+ // Update the questions array with the new question
4552
+ const index = this.calendarQuestion.findIndex(q => q.Id === ques.Id);
4553
+ if (index > -1) {
4554
+ // If question already exists, update it
4555
+ this.calendarQuestion[index] = ques;
4556
+ }
4557
+ else {
4558
+ // If question doesn't exist, add it to the array
4559
+ this.calendarQuestion.push(ques);
4570
4560
  }
4561
+ console.log('calender question');
4562
+ console.log(this.calendarQuestion);
4571
4563
  }
4572
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileUploadComponent, deps: [{ token: SharedService }, { token: DataService }, { token: i6$1.DomSanitizer }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
4573
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FileUploadComponent, selector: "app-file-upload", inputs: { allFiles: "allFiles", limitFileUploading: "limitFileUploading", isDeleteFileButtonVisible: "isDeleteFileButtonVisible", isShowNoFileIcon: "isShowNoFileIcon", tableFile: "tableFile", question: "question", error: "error" }, outputs: { selectedFileData: "selectedFileData", deletedFileData: "deletedFileData" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-md-12\" *ngIf=\"!isDeleteFileButtonVisible\" style=\"text-align: left;\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n <div class=\"col-lg-5 document-cnt m-t-10 m-b-10\"\n *ngFor=\"let eachFile of copyOfInputAllFiles; let currentFileIndex = index\">\n <div *ngIf=\"!tableFile\"> <!-- (click)=\"viewFile(eachFile)\" -->\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.name)\">\n </div>\n <div class=\"col-lg-9 document_name\">\n {{eachFile?.name}}\n </div>\n <div class=\"document_delete\" (click)=\"deleteFile(currentFileIndex);$event.stopPropagation()\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/bin.svg\">\n </div>\n <!-- VD 20May24 - preview changes-->\n <div class=\"preview-icon\" (click)=\"viewFile(eachFile)\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/icons8-eye-24.png\">\n </div>\n </div>\n <div *ngIf=\"tableFile\" class=\"row\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{eachFile?.name}}\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"copyOfInputAllFiles?.length === 0 && isShowNoFileIcon\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n</div>\n\n<div class=\"col-lg-6\" style=\"padding:0;margin-top: 10px;\">\n <label class=\"custom-file\" *ngIf=\"isDeleteFileButtonVisible && !tableFile\">\n <!-- HA 19DEC23 For translation -->\n <!-- VD 03May24 file upload fix-->\n <button [class]=\"error ? 'she-btn-primary-bordered Invalid' : 'she-btn-primary-bordered'\" style=\"width:275px;\" (click)=\"fileInput.click()\"\n [ngClass]=\"{ 'btn-disabled': copyOfInputAllFiles?.length >= copyOfFileUploadingLimit }\" [disabled]=\"copyOfInputAllFiles?.length >= copyOfFileUploadingLimit\"\n >Choose Files</button>\n\n <input #fileInput type=\"file\" name=\"fileUpload\" multiple=\"multiple\" accept=\"*\" style=\"display:none;\"\n (change) = uploadMultipleFiles($event)\n />\n </label>\n<!-- HA 19DEC23 For translation -->\n <label *ngIf=\"tableFile\" class=\"btn btn-primary\">\n {{ 'uploadFile' | i18n:i18nService.currentLanguage }}\n <input id=\"file\" style=\"display: none;\" type=\"file\" class=\"form-control\" (change)= uploadMultipleFiles($event) />\n </label>\n <!-- <span class=\"error-msg\" *ngIf=\"(formControl?.documents?.touched || formControl?.documents?.dirty) &&\n formControl?.documents?.errors?.required\">\n {{LM_POLICY_VALIDATION_MESSAGE.REQUIRED}}\n </span> -->\n</div>\n<div *ngIf=\"error\" class=\"error-msg\" style=\"margin-top: 10px;\">{{question?.Error_Message__c}}</div>\n<div class=\"nxt-file-overlay\" *ngIf=\"showFile\">\n <div class=\"nxt-file-map-modal\">\n <div class=\"nxt-file-model-content\">\n <div class=\"nxt-file-model-header\">\n <h4>{{fileName}}</h4>\n <button class=\"close-button\" (click)=\"close()\">X</button>\n </div>\n <ng-container *ngIf=\"isImage; else otherFile\">\n <img [src]=\"fileUrl\" class=\"img-fluid\" alt=\"File Preview\" />\n </ng-container>\n <ng-template #otherFile>\n <iframe [src]=\"fileUrl\" width=\"100%\" height=\"500px\"></iframe>\n </ng-template>\n </div>\n </div>\n</div>\n\n\n", styles: [".document-cnt{padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f9f9f9;margin-bottom:10px;cursor:pointer;transition:background-color .3s ease;position:relative}.document-cnt:hover{background-color:#e9ecef}.document_image img{width:30px;height:30px}.document_name{font-size:14px;font-weight:700;color:#333;line-height:30px}.label{margin-bottom:0}.document_delete img,.preview-icon img{width:20px;height:20px;cursor:pointer;transition:transform .3s ease}.document_delete img{filter:brightness(0) saturate(100%) invert(20%) sepia(97%) saturate(7481%) hue-rotate(357deg) brightness(98%) contrast(119%)}.document_delete img:hover,.preview-icon img:hover{transform:scale(1.1)}.document_delete,.preview-icon{position:absolute;top:50%;transform:translateY(-50%)}.document_delete{right:10px}.preview-icon{right:40px}@media (min-width: 992px){.document-cnt{margin-left:10px}}.btn-disabled{background:#e1e1e1;color:#fff;border:none;border-radius:5px;height:50px}.form-control[disabled]{border-radius:5px}.custom-file{color:#9a9a9a;font-size:14px;font-weight:400;display:inline-block;width:auto;margin-bottom:5px}.she-btn-primary-bordered{background:#ffffff;color:#48b7ff;border:1px solid #48B7FF;border-radius:5px;height:50px;outline:none!important}.btn-primary{background-color:#03a9f4!important;border:1px solid #03a9f4!important;color:#fff!important}.btn.btn-primary{border-radius:2px;padding:6px 14px;font-size:14px}.nxt-file-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.nxt-file-map-modal{background-color:#fff;border-radius:8px;overflow:hidden;width:80%;max-width:800px;max-height:90%;display:flex;flex-direction:column}.nxt-file-model-content{display:flex;flex-direction:column;height:100%}.nxt-file-model-header{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background-color:#f5f5f5;border-bottom:1px solid #ddd}.nxt-file-model-header h4{margin:0;font-size:1.25em}.close-button{background:none;border:none;font-size:1.5em;cursor:pointer}.img-fluid{max-width:100%;height:auto;flex:1}iframe{border:none}.Invalid{border:1px solid red!important}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
4564
+ // VD 06Sep24 calendar changes
4565
+ generateId() {
4566
+ return '_' + Math.random().toString(36).substr(2, 9);
4567
+ }
4568
+ getEntryKeys(entryGroup) {
4569
+ return Object.keys(entryGroup);
4570
+ }
4571
+ removeCharacters(questionText) {
4572
+ let updatedText = questionText?.replace(/<[^>]*>/g, '');
4573
+ return updatedText;
4574
+ }
4575
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4576
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomCalendarComponent, selector: "app-custom-calendar", inputs: { allEvents: "allEvents", question: "question" }, outputs: { eventSelected: "eventSelected", dateSelected: "dateSelected" }, viewQueries: [{ propertyName: "dynamicHost", first: true, predicate: ComponenthostDirective, descendants: true, static: true }], ngImport: i0, template: "<div class=\"align-calendar\">\n <div class=\"calendar-container\">\n <div class=\"calendar-header\">\n <button (click)=\"previousMonth()\"><< Previous >></button>\n <h3>{{ currentDate | date: 'MMMM yyyy' }}</h3>\n <button (click)=\"nextMonth()\"><< Next >></button>\n </div>\n <div class=\"calendar-grid\">\n <div class=\"day-of-week\" *ngFor=\"let day of daysOfWeek\">{{ day }}</div>\n\n <div\n class=\"calendar-day\"\n *ngFor=\"let day of calendarDays\"\n [class.not-current-month]=\"!day.isCurrentMonth\"\n [class.past]=\"day.isPast\"\n [class.today]=\"day.isToday\"\n [class.future]=\"day.isFuture\"\n [class.selected]=\"day.isSelected\"\n (click)=\"selectDay(day)\"\n >\n <div class=\"day-number\">{{ day.date.getDate() }}\n <span *ngIf=\"day.events.length > 0\" class=\"entry-indicator\" [class.select]=\"day.isSelected\"></span>\n </div>\n <!-- <div *ngFor=\"let event of day.events\" >\n <div *ngFor=\"let entryGroup of event.entries\" class=\"event\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\">\n <div *ngIf=\"entryGroup[key].Type__c == 'Time'\">\n {{ entryGroup[key].input?.value | date: 'shortTime' }}\n </div>\n <div *ngIf=\"entryGroup[key].Type__c != 'Time'\">\n {{ entryGroup[key].input }}\n </div>\n </div>\n </div>\n </div> -->\n </div>\n </div>\n </div>\n <div class=\"appoinappointment\">\n <div class=\"appointments-container\">\n <h4>Add Appointment</h4>\n <button *ngIf=\"selectedDay\" (click)=\"addAppointment()\">Add</button>\n </div>\n <!--VD 06Sep24 calendar updates--> \n <div *ngIf=\"showAppoinmentSection && selectedDay?.events.length > 0\" class=\"appointments-container\">\n <h4>Appointments</h4>\n <div *ngFor=\"let event of selectedDay?.events\">\n <div class=\"event\" *ngFor=\"let entryGroup of event.entries\">\n <div class=\"event-info\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\" class=\"entry-row\">\n <div *ngIf=\"entryGroup[key].Question_Text__c\" class=\"entry-text\">\n {{removeCharacters(entryGroup[key].Question_Text__c)}}:\n </div>\n <div class=\"entry-value\">\n <span *ngIf=\"entryGroup[key].Type__c != 'Time' && entryGroup[key].Type__c != 'Link'\">{{ entryGroup[key].input }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Time'\">{{ entryGroup[key].input | date: 'shortTime' }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Link'\">\n <a href=\"{{entryGroup[key].input}}\">{{removeCharacters(entryGroup[key].Question_Text__c)}}</a>\n </span>\n </div>\n </div>\n <div class=\"event-actions\">\n <button (click)=\"editEvent(event,entryGroup)\">Edit</button>\n <button (click)=\"deleteEvent(event.id,entryGroup)\">Delete</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<app-custom-model\n [modalTitle]=\"modalTitle\"\n [isModalOpen]=\"isModalOpen\"\n [modalSize]=\"modalSize\"\n [saveButtonValue]=\"saveButtonValue\"\n [modalFooter]=\"modalFooter\"\n (saveButtonEmit)=\"onSave()\"\n (cancelButtonEmit)=\"onCancel()\"\n>\n<!-- VD 06-09-24 used directive file to call the questionbook beacasue to avoid cirecular issue-->\n<!-- <lib-questionbook [qbItem]=\"qbRefrenceBook\" [questions]=\"referenceQuestions\" (handleQuestion)=\"handleQuestionEvent($event)\"></lib-questionbook> -->\n<ng-template dynamicComponentHost ></ng-template>\n</app-custom-model>\n\n\n \n \n ", styles: [".calendar-container{flex:1}.appoinappointment{flex:1;margin-left:10px}.calendar-header{display:flex;justify-content:space-between;align-items:center}.selected{box-shadow:0 0 5px #00000080;background-color:green!important;color:#fff!important}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.day-of-week{text-align:center;font-weight:700;padding:5px;background-color:#f0f0f0;border:1px solid #ccc}.calendar-day{border:1px solid #ccc;padding:5px;display:flex;flex-direction:column;align-items:flex-start;background-color:#fff;position:relative;cursor:pointer}.calendar-day.not-current-month{background-color:#f0f0f0}.calendar-day.past{color:#aaa}.calendar-day.today{background-color:#e6ffe6;font-weight:700}.calendar-day.future{color:#000}.day-number{font-size:1.2em;margin-bottom:5px}.event{background-color:#d1e7dd;border-left:4px solid #0f5132;margin:5px 0;padding:2px 5px;border-radius:3px}.event-title{font-weight:700}.event-time{font-size:.8em}input[type=text],input[type=time]{width:100%;margin-top:5px;box-sizing:border-box}button{margin-top:5px;align-self:stretch;margin-left:0!important}.calendar-header button{margin-top:5px;align-self:stretch;margin-left:0!important;border:none;background:none}.align-calendar{display:flex;width:100%}.form-group.content-box{padding-bottom:0!important}.entry-indicator{position:absolute;top:5px;right:5px;width:10px;height:10px;background-color:#0f5132;border-radius:50%}.select{background-color:#fff}.entry-row{display:flex;align-items:center;margin-bottom:5px}.entry-text{font-weight:700;margin-right:10px;white-space:nowrap}.entry-value{flex:1;word-break:break-word}.entry-value a{color:#4caf50}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: ComponenthostDirective, selector: "[dynamicComponentHost]" }, { kind: "component", type: CustomModelComponent, selector: "app-custom-model", inputs: ["modalTitle", "isModalOpen", "modalSize", "saveButtonValue", "modalFooter"], outputs: ["saveButtonEmit", "cancelButtonEmit"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }] });
4574
4577
  }
4575
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileUploadComponent, decorators: [{
4578
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomCalendarComponent, decorators: [{
4576
4579
  type: Component,
4577
- args: [{ selector: 'app-file-upload', template: "<div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-md-12\" *ngIf=\"!isDeleteFileButtonVisible\" style=\"text-align: left;\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n <div class=\"col-lg-5 document-cnt m-t-10 m-b-10\"\n *ngFor=\"let eachFile of copyOfInputAllFiles; let currentFileIndex = index\">\n <div *ngIf=\"!tableFile\"> <!-- (click)=\"viewFile(eachFile)\" -->\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.name)\">\n </div>\n <div class=\"col-lg-9 document_name\">\n {{eachFile?.name}}\n </div>\n <div class=\"document_delete\" (click)=\"deleteFile(currentFileIndex);$event.stopPropagation()\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/bin.svg\">\n </div>\n <!-- VD 20May24 - preview changes-->\n <div class=\"preview-icon\" (click)=\"viewFile(eachFile)\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/icons8-eye-24.png\">\n </div>\n </div>\n <div *ngIf=\"tableFile\" class=\"row\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{eachFile?.name}}\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"copyOfInputAllFiles?.length === 0 && isShowNoFileIcon\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n</div>\n\n<div class=\"col-lg-6\" style=\"padding:0;margin-top: 10px;\">\n <label class=\"custom-file\" *ngIf=\"isDeleteFileButtonVisible && !tableFile\">\n <!-- HA 19DEC23 For translation -->\n <!-- VD 03May24 file upload fix-->\n <button [class]=\"error ? 'she-btn-primary-bordered Invalid' : 'she-btn-primary-bordered'\" style=\"width:275px;\" (click)=\"fileInput.click()\"\n [ngClass]=\"{ 'btn-disabled': copyOfInputAllFiles?.length >= copyOfFileUploadingLimit }\" [disabled]=\"copyOfInputAllFiles?.length >= copyOfFileUploadingLimit\"\n >Choose Files</button>\n\n <input #fileInput type=\"file\" name=\"fileUpload\" multiple=\"multiple\" accept=\"*\" style=\"display:none;\"\n (change) = uploadMultipleFiles($event)\n />\n </label>\n<!-- HA 19DEC23 For translation -->\n <label *ngIf=\"tableFile\" class=\"btn btn-primary\">\n {{ 'uploadFile' | i18n:i18nService.currentLanguage }}\n <input id=\"file\" style=\"display: none;\" type=\"file\" class=\"form-control\" (change)= uploadMultipleFiles($event) />\n </label>\n <!-- <span class=\"error-msg\" *ngIf=\"(formControl?.documents?.touched || formControl?.documents?.dirty) &&\n formControl?.documents?.errors?.required\">\n {{LM_POLICY_VALIDATION_MESSAGE.REQUIRED}}\n </span> -->\n</div>\n<div *ngIf=\"error\" class=\"error-msg\" style=\"margin-top: 10px;\">{{question?.Error_Message__c}}</div>\n<div class=\"nxt-file-overlay\" *ngIf=\"showFile\">\n <div class=\"nxt-file-map-modal\">\n <div class=\"nxt-file-model-content\">\n <div class=\"nxt-file-model-header\">\n <h4>{{fileName}}</h4>\n <button class=\"close-button\" (click)=\"close()\">X</button>\n </div>\n <ng-container *ngIf=\"isImage; else otherFile\">\n <img [src]=\"fileUrl\" class=\"img-fluid\" alt=\"File Preview\" />\n </ng-container>\n <ng-template #otherFile>\n <iframe [src]=\"fileUrl\" width=\"100%\" height=\"500px\"></iframe>\n </ng-template>\n </div>\n </div>\n</div>\n\n\n", styles: [".document-cnt{padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f9f9f9;margin-bottom:10px;cursor:pointer;transition:background-color .3s ease;position:relative}.document-cnt:hover{background-color:#e9ecef}.document_image img{width:30px;height:30px}.document_name{font-size:14px;font-weight:700;color:#333;line-height:30px}.label{margin-bottom:0}.document_delete img,.preview-icon img{width:20px;height:20px;cursor:pointer;transition:transform .3s ease}.document_delete img{filter:brightness(0) saturate(100%) invert(20%) sepia(97%) saturate(7481%) hue-rotate(357deg) brightness(98%) contrast(119%)}.document_delete img:hover,.preview-icon img:hover{transform:scale(1.1)}.document_delete,.preview-icon{position:absolute;top:50%;transform:translateY(-50%)}.document_delete{right:10px}.preview-icon{right:40px}@media (min-width: 992px){.document-cnt{margin-left:10px}}.btn-disabled{background:#e1e1e1;color:#fff;border:none;border-radius:5px;height:50px}.form-control[disabled]{border-radius:5px}.custom-file{color:#9a9a9a;font-size:14px;font-weight:400;display:inline-block;width:auto;margin-bottom:5px}.she-btn-primary-bordered{background:#ffffff;color:#48b7ff;border:1px solid #48B7FF;border-radius:5px;height:50px;outline:none!important}.btn-primary{background-color:#03a9f4!important;border:1px solid #03a9f4!important;color:#fff!important}.btn.btn-primary{border-radius:2px;padding:6px 14px;font-size:14px}.nxt-file-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.nxt-file-map-modal{background-color:#fff;border-radius:8px;overflow:hidden;width:80%;max-width:800px;max-height:90%;display:flex;flex-direction:column}.nxt-file-model-content{display:flex;flex-direction:column;height:100%}.nxt-file-model-header{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background-color:#f5f5f5;border-bottom:1px solid #ddd}.nxt-file-model-header h4{margin:0;font-size:1.25em}.close-button{background:none;border:none;font-size:1.5em;cursor:pointer}.img-fluid{max-width:100%;height:auto;flex:1}iframe{border:none}.Invalid{border:1px solid red!important}\n"] }]
4578
- }], ctorParameters: function () { return [{ type: SharedService }, { type: DataService }, { type: i6$1.DomSanitizer }, { type: I18nService }]; }, propDecorators: { selectedFileData: [{
4580
+ args: [{ selector: 'app-custom-calendar', template: "<div class=\"align-calendar\">\n <div class=\"calendar-container\">\n <div class=\"calendar-header\">\n <button (click)=\"previousMonth()\"><< Previous >></button>\n <h3>{{ currentDate | date: 'MMMM yyyy' }}</h3>\n <button (click)=\"nextMonth()\"><< Next >></button>\n </div>\n <div class=\"calendar-grid\">\n <div class=\"day-of-week\" *ngFor=\"let day of daysOfWeek\">{{ day }}</div>\n\n <div\n class=\"calendar-day\"\n *ngFor=\"let day of calendarDays\"\n [class.not-current-month]=\"!day.isCurrentMonth\"\n [class.past]=\"day.isPast\"\n [class.today]=\"day.isToday\"\n [class.future]=\"day.isFuture\"\n [class.selected]=\"day.isSelected\"\n (click)=\"selectDay(day)\"\n >\n <div class=\"day-number\">{{ day.date.getDate() }}\n <span *ngIf=\"day.events.length > 0\" class=\"entry-indicator\" [class.select]=\"day.isSelected\"></span>\n </div>\n <!-- <div *ngFor=\"let event of day.events\" >\n <div *ngFor=\"let entryGroup of event.entries\" class=\"event\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\">\n <div *ngIf=\"entryGroup[key].Type__c == 'Time'\">\n {{ entryGroup[key].input?.value | date: 'shortTime' }}\n </div>\n <div *ngIf=\"entryGroup[key].Type__c != 'Time'\">\n {{ entryGroup[key].input }}\n </div>\n </div>\n </div>\n </div> -->\n </div>\n </div>\n </div>\n <div class=\"appoinappointment\">\n <div class=\"appointments-container\">\n <h4>Add Appointment</h4>\n <button *ngIf=\"selectedDay\" (click)=\"addAppointment()\">Add</button>\n </div>\n <!--VD 06Sep24 calendar updates--> \n <div *ngIf=\"showAppoinmentSection && selectedDay?.events.length > 0\" class=\"appointments-container\">\n <h4>Appointments</h4>\n <div *ngFor=\"let event of selectedDay?.events\">\n <div class=\"event\" *ngFor=\"let entryGroup of event.entries\">\n <div class=\"event-info\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\" class=\"entry-row\">\n <div *ngIf=\"entryGroup[key].Question_Text__c\" class=\"entry-text\">\n {{removeCharacters(entryGroup[key].Question_Text__c)}}:\n </div>\n <div class=\"entry-value\">\n <span *ngIf=\"entryGroup[key].Type__c != 'Time' && entryGroup[key].Type__c != 'Link'\">{{ entryGroup[key].input }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Time'\">{{ entryGroup[key].input | date: 'shortTime' }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Link'\">\n <a href=\"{{entryGroup[key].input}}\">{{removeCharacters(entryGroup[key].Question_Text__c)}}</a>\n </span>\n </div>\n </div>\n <div class=\"event-actions\">\n <button (click)=\"editEvent(event,entryGroup)\">Edit</button>\n <button (click)=\"deleteEvent(event.id,entryGroup)\">Delete</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<app-custom-model\n [modalTitle]=\"modalTitle\"\n [isModalOpen]=\"isModalOpen\"\n [modalSize]=\"modalSize\"\n [saveButtonValue]=\"saveButtonValue\"\n [modalFooter]=\"modalFooter\"\n (saveButtonEmit)=\"onSave()\"\n (cancelButtonEmit)=\"onCancel()\"\n>\n<!-- VD 06-09-24 used directive file to call the questionbook beacasue to avoid cirecular issue-->\n<!-- <lib-questionbook [qbItem]=\"qbRefrenceBook\" [questions]=\"referenceQuestions\" (handleQuestion)=\"handleQuestionEvent($event)\"></lib-questionbook> -->\n<ng-template dynamicComponentHost ></ng-template>\n</app-custom-model>\n\n\n \n \n ", styles: [".calendar-container{flex:1}.appoinappointment{flex:1;margin-left:10px}.calendar-header{display:flex;justify-content:space-between;align-items:center}.selected{box-shadow:0 0 5px #00000080;background-color:green!important;color:#fff!important}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.day-of-week{text-align:center;font-weight:700;padding:5px;background-color:#f0f0f0;border:1px solid #ccc}.calendar-day{border:1px solid #ccc;padding:5px;display:flex;flex-direction:column;align-items:flex-start;background-color:#fff;position:relative;cursor:pointer}.calendar-day.not-current-month{background-color:#f0f0f0}.calendar-day.past{color:#aaa}.calendar-day.today{background-color:#e6ffe6;font-weight:700}.calendar-day.future{color:#000}.day-number{font-size:1.2em;margin-bottom:5px}.event{background-color:#d1e7dd;border-left:4px solid #0f5132;margin:5px 0;padding:2px 5px;border-radius:3px}.event-title{font-weight:700}.event-time{font-size:.8em}input[type=text],input[type=time]{width:100%;margin-top:5px;box-sizing:border-box}button{margin-top:5px;align-self:stretch;margin-left:0!important}.calendar-header button{margin-top:5px;align-self:stretch;margin-left:0!important;border:none;background:none}.align-calendar{display:flex;width:100%}.form-group.content-box{padding-bottom:0!important}.entry-indicator{position:absolute;top:5px;right:5px;width:10px;height:10px;background-color:#0f5132;border-radius:50%}.select{background-color:#fff}.entry-row{display:flex;align-items:center;margin-bottom:5px}.entry-text{font-weight:700;margin-right:10px;white-space:nowrap}.entry-value{flex:1;word-break:break-word}.entry-value a{color:#4caf50}\n"] }]
4581
+ }], propDecorators: { eventSelected: [{
4579
4582
  type: Output
4580
- }], deletedFileData: [{
4583
+ }], dateSelected: [{
4581
4584
  type: Output
4582
- }], allFiles: [{
4583
- type: Input
4584
- }], limitFileUploading: [{
4585
- type: Input
4586
- }], isDeleteFileButtonVisible: [{
4587
- type: Input
4588
- }], isShowNoFileIcon: [{
4589
- type: Input
4590
- }], tableFile: [{
4585
+ }], allEvents: [{
4591
4586
  type: Input
4592
4587
  }], question: [{
4593
4588
  type: Input
4594
- }], error: [{
4595
- type: Input
4589
+ }], dynamicHost: [{
4590
+ type: ViewChild,
4591
+ args: [ComponenthostDirective, { static: true }]
4596
4592
  }] } });
4597
4593
 
4598
- class DependentTableComponent {
4599
- changeService;
4600
- alertMessage;
4601
- ValueLength;
4602
- Value;
4603
- errorObj;
4604
- constructor(changeService) {
4605
- this.changeService = changeService;
4606
- this.changeService.changeField$.subscribe((data) => {
4607
- this.dependentData(data);
4608
- });
4594
+ class SearchBoxComponent {
4595
+ sfService;
4596
+ dataService;
4597
+ route;
4598
+ i18nService;
4599
+ placeHolderText;
4600
+ auto;
4601
+ question;
4602
+ apiMeta;
4603
+ id;
4604
+ readOnly = false; // VD 12Jun24 - readonly change
4605
+ searchValueChange = new EventEmitter();
4606
+ apiObj;
4607
+ SearchItem;
4608
+ filterName; // VD 20Aug default filter value as input
4609
+ finalResults = [];
4610
+ searchKeyWord = '';
4611
+ newResult;
4612
+ showResult = false;
4613
+ noResult = false;
4614
+ showSuggestion = true;
4615
+ el;
4616
+ serv = 'api';
4617
+ tkn = '';
4618
+ constructor(sfService, dataService, route, el, i18nService) {
4619
+ this.sfService = sfService;
4620
+ this.dataService = dataService;
4621
+ this.route = route;
4622
+ this.i18nService = i18nService;
4609
4623
  }
4610
4624
  ngOnInit() {
4611
- this.errorObj = JSON.parse(this.alertMessage);
4625
+ // VD 03May- search changes
4626
+ if (this.apiMeta) {
4627
+ let apiObj = JSON.parse(this.apiMeta);
4628
+ this.SearchItem = apiObj.field;
4629
+ }
4612
4630
  }
4613
- dependentData(data) {
4614
- let existingData = data.Permits;
4615
- if (existingData.length !== 0) {
4616
- this.ValueLength = true;
4617
- this.Value = existingData;
4618
- $("#zoneIcon").css("border", "3px solid rgb(252, 35, 27)");
4631
+ clearList() {
4632
+ setTimeout(() => {
4633
+ this.finalResults = [];
4634
+ }, 1000);
4635
+ }
4636
+ getSourceDataLocal(event) {
4637
+ if (event.target.value.length > 2) {
4638
+ this.showSuggestion = true;
4639
+ this.finalResults = [];
4640
+ this.searchKeyWord = event.target.value;
4641
+ this.showResult = false;
4642
+ this.getSourceData(event.target.value);
4619
4643
  }
4620
4644
  else {
4621
- this.ValueLength = false;
4622
- this.Value = [];
4623
- $("#zoneIcon").css("border", "3px solid rgb(12, 190, 12)");
4645
+ this.showSuggestion = false;
4646
+ this.finalResults = [];
4647
+ this.noResult = false;
4624
4648
  }
4625
4649
  }
4626
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DependentTableComponent, deps: [{ token: ChangeService }], target: i0.ɵɵFactoryTarget.Component });
4627
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DependentTableComponent, selector: "app-dependent-table", inputs: { alertMessage: "alertMessage" }, ngImport: i0, template: "<div class=\"dropdown\" style=\"cursor: pointer;\">\n <span id=\"zoneIcon\"> \n <img src=\"./../../../../../assets/images/permit_icons/zone.png\" style=\"height: 35px; margin-left: 0px;\" alt=\"adv-search\">\n </span>\n <div class=\"dropdown-content\" style=\"margin-left: -300px; min-width: 415px;\">\n <div class=\"col-lg-12\">\n <table class=\"table table-striped table-bordered\">\n <tbody *ngIf=\"!ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(12, 190, 12); text-align: center\">\n <span><b>{{ errorObj.noPermits }}</b></span>\n <span>{{ errorObj.noActive }}</span>\n </td>\n </tr>\n </tbody>\n <tbody id=\"zoneDetails\" *ngIf=\"ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(252, 35, 27); text-align: center\">\n <span><b>{{ errorObj.permits }} ({{Value.length}})</b></span>\n <span>{{ errorObj.active }}</span>\n </td>\n </tr>\n <tr *ngFor=\"let item of Value\" >\n <td>\n <span>{{item?.permit_type}}-{{item?.ref_no}} - {{item?.status}} - {{item?.end_date}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>", styles: [".dropdown{margin-top:25px;margin-left:25px}.dropdown-content{display:none;position:absolute;background-color:#f9f9f9;min-width:160px;box-shadow:0 8px 16px #0003;padding:12px 16px;z-index:1}.dropdown:hover .dropdown-content{display:block}#zoneIcon{border:3px solid #a59d9d;padding:10px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}@media (max-width: 992px){.dropdown{margin-top:15px;margin-left:0;margin-bottom:15px}}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
4650
+ // VD 03May- search changes
4651
+ getSourceData = (keyword) => {
4652
+ if (this.apiMeta !== undefined) {
4653
+ let apiObj = JSON.parse(this.apiMeta);
4654
+ this.dataService.apiResponse(apiObj.endpoint).subscribe((apiResponse) => {
4655
+ let response;
4656
+ if (apiObj.variable) {
4657
+ // VD 22May24 - handling multiple child objects
4658
+ response = this.dataService.getValue(apiResponse, apiObj.variable);
4659
+ }
4660
+ else {
4661
+ response = apiResponse;
4662
+ }
4663
+ let field = apiObj.field;
4664
+ let results = [];
4665
+ for (let i = 0; i < response.length; i++) { // VD NOV23 - updated the search keys
4666
+ // VD 26JUN24 - handling multiple objects
4667
+ const objValue = this.dataService.getValue(response[i], field);
4668
+ if (objValue?.toLowerCase().includes(keyword?.toLowerCase())) {
4669
+ console.log('pushing ' + objValue);
4670
+ results.push(response[i]);
4671
+ }
4672
+ }
4673
+ this.noResult = !(results.length > 1);
4674
+ this.finalResults = results;
4675
+ });
4676
+ }
4677
+ };
4678
+ clickItem(event) {
4679
+ // console.log('inside clickItem of ' + event.target.value);
4680
+ let apiObj = JSON.parse(this.apiMeta);
4681
+ this.filterName = event[apiObj.field];
4682
+ let change = new ChangeWrapper(); // ChangeWrapper = JSON.parse('{}');
4683
+ change.fromQuestionId = this.id;
4684
+ change.valueObj = event;
4685
+ change.field = apiObj.field;
4686
+ this.searchValueChange.emit(change);
4687
+ }
4688
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SearchBoxComponent, deps: [{ token: SalesforceService }, { token: DataService }, { token: i1.ActivatedRoute }, { token: i0.ElementRef }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
4689
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: SearchBoxComponent, selector: "lib-search-box", inputs: { placeHolderText: "placeHolderText", question: "question", apiMeta: "apiMeta", id: "id", readOnly: "readOnly", filterName: "filterName" }, outputs: { searchValueChange: "searchValueChange" }, viewQueries: [{ propertyName: "auto", first: true, predicate: ["auto"], descendants: true }], ngImport: i0, template: "<!-- // VD 12Jun24 - readonly change-->\n<div id=\"autocomplete-input\">\n <input #auto id=\"searchbox-style\"\n (blur)=\"clearList()\" \n [(ngModel)]=\"filterName\" \n type=\"text\" \n name=\"name\" \n [readOnly]=\"readOnly\"\n [placeholder]=\"placeHolderText\" \n style=\"margin: 0 !important;\" \n class=\"searchInput she-line-input form-control\" \n (focusin)=\"getSourceDataLocal($event)\" \n (input)=\"getSourceDataLocal($event)\">\n <div id=\"selectList\" style=\"position: absolute;position: absolute;background: white;z-index: 2;\">\n <div *ngIf=\"finalResults.length > 0 && showSuggestion\" \n style=\"max-height: 100vh;border: 1px solid #d2d4d6;overflow: scroll;\" \n class=\"suggestions-container\">\n <!-- HA 20DEC23 Uncommented the logic -->\n <!-- VD 03May- search changes -->\n <div *ngFor=\"let item of finalResults\" (click)='clickItem(item)' class=\"hoover\">\n <!-- VD 26Jun24 - id condition removed -->\n <div class=\"grid-x align-middle\" style=\"padding: 1rem\">\n <div *ngIf=\"item.thumbnail\" class=\"cell shrink\" style=\"width: 60px; margin-right: 1.6rem;\">\n <img [src]=\"item.thumbnail\" style=\"width: 60px;\" alt=\"\">\n </div>\n <div class=\"cell auto\" style=\"text-align: left; padding-left: 20px;\">\n <!--// VD 26JUN24 - pipe changes -->\n <h4 >{{ '' | getValue: item : SearchItem }}</h4>\n </div>\n </div>\n </div>\n <!-- HA 20DEC23 For Commented this for future purpose -->\n <!-- <table class=\"table table-striped table-bordered\">\n <thead>\n <tr>\n <th>{{ 'firstName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'lastName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'division' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'numberPlate' | i18n:i18nService.currentLanguage }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of finalResults\" (click)='clickItem(item)'>\n <td>{{ item.firstName }}</td>\n <td>{{ item.lastName }}</td>\n <td>{{ item.division }}</td>\n <td>{{ item.numberPlate }}</td>\n </tr>\n </tbody>\n </table> -->\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: GetValuePipe, name: "getValue" }] });
4628
4690
  }
4629
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DependentTableComponent, decorators: [{
4691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SearchBoxComponent, decorators: [{
4630
4692
  type: Component,
4631
- args: [{ selector: 'app-dependent-table', template: "<div class=\"dropdown\" style=\"cursor: pointer;\">\n <span id=\"zoneIcon\"> \n <img src=\"./../../../../../assets/images/permit_icons/zone.png\" style=\"height: 35px; margin-left: 0px;\" alt=\"adv-search\">\n </span>\n <div class=\"dropdown-content\" style=\"margin-left: -300px; min-width: 415px;\">\n <div class=\"col-lg-12\">\n <table class=\"table table-striped table-bordered\">\n <tbody *ngIf=\"!ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(12, 190, 12); text-align: center\">\n <span><b>{{ errorObj.noPermits }}</b></span>\n <span>{{ errorObj.noActive }}</span>\n </td>\n </tr>\n </tbody>\n <tbody id=\"zoneDetails\" *ngIf=\"ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(252, 35, 27); text-align: center\">\n <span><b>{{ errorObj.permits }} ({{Value.length}})</b></span>\n <span>{{ errorObj.active }}</span>\n </td>\n </tr>\n <tr *ngFor=\"let item of Value\" >\n <td>\n <span>{{item?.permit_type}}-{{item?.ref_no}} - {{item?.status}} - {{item?.end_date}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>", styles: [".dropdown{margin-top:25px;margin-left:25px}.dropdown-content{display:none;position:absolute;background-color:#f9f9f9;min-width:160px;box-shadow:0 8px 16px #0003;padding:12px 16px;z-index:1}.dropdown:hover .dropdown-content{display:block}#zoneIcon{border:3px solid #a59d9d;padding:10px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}@media (max-width: 992px){.dropdown{margin-top:15px;margin-left:0;margin-bottom:15px}}\n"] }]
4632
- }], ctorParameters: function () { return [{ type: ChangeService }]; }, propDecorators: { alertMessage: [{
4693
+ args: [{ selector: 'lib-search-box', template: "<!-- // VD 12Jun24 - readonly change-->\n<div id=\"autocomplete-input\">\n <input #auto id=\"searchbox-style\"\n (blur)=\"clearList()\" \n [(ngModel)]=\"filterName\" \n type=\"text\" \n name=\"name\" \n [readOnly]=\"readOnly\"\n [placeholder]=\"placeHolderText\" \n style=\"margin: 0 !important;\" \n class=\"searchInput she-line-input form-control\" \n (focusin)=\"getSourceDataLocal($event)\" \n (input)=\"getSourceDataLocal($event)\">\n <div id=\"selectList\" style=\"position: absolute;position: absolute;background: white;z-index: 2;\">\n <div *ngIf=\"finalResults.length > 0 && showSuggestion\" \n style=\"max-height: 100vh;border: 1px solid #d2d4d6;overflow: scroll;\" \n class=\"suggestions-container\">\n <!-- HA 20DEC23 Uncommented the logic -->\n <!-- VD 03May- search changes -->\n <div *ngFor=\"let item of finalResults\" (click)='clickItem(item)' class=\"hoover\">\n <!-- VD 26Jun24 - id condition removed -->\n <div class=\"grid-x align-middle\" style=\"padding: 1rem\">\n <div *ngIf=\"item.thumbnail\" class=\"cell shrink\" style=\"width: 60px; margin-right: 1.6rem;\">\n <img [src]=\"item.thumbnail\" style=\"width: 60px;\" alt=\"\">\n </div>\n <div class=\"cell auto\" style=\"text-align: left; padding-left: 20px;\">\n <!--// VD 26JUN24 - pipe changes -->\n <h4 >{{ '' | getValue: item : SearchItem }}</h4>\n </div>\n </div>\n </div>\n <!-- HA 20DEC23 For Commented this for future purpose -->\n <!-- <table class=\"table table-striped table-bordered\">\n <thead>\n <tr>\n <th>{{ 'firstName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'lastName' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'division' | i18n:i18nService.currentLanguage }}</th>\n <th>{{ 'numberPlate' | i18n:i18nService.currentLanguage }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of finalResults\" (click)='clickItem(item)'>\n <td>{{ item.firstName }}</td>\n <td>{{ item.lastName }}</td>\n <td>{{ item.division }}</td>\n <td>{{ item.numberPlate }}</td>\n </tr>\n </tbody>\n </table> -->\n </div>\n</div>\n" }]
4694
+ }], ctorParameters: function () { return [{ type: SalesforceService }, { type: DataService }, { type: i1.ActivatedRoute }, { type: i0.ElementRef }, { type: I18nService }]; }, propDecorators: { placeHolderText: [{
4695
+ type: Input
4696
+ }], auto: [{
4697
+ type: ViewChild,
4698
+ args: ['auto']
4699
+ }], question: [{
4700
+ type: Input
4701
+ }], apiMeta: [{
4702
+ type: Input
4703
+ }], id: [{
4704
+ type: Input
4705
+ }], readOnly: [{
4706
+ type: Input
4707
+ }], searchValueChange: [{
4708
+ type: Output
4709
+ }], filterName: [{
4633
4710
  type: Input
4634
4711
  }] } });
4635
4712
 
4636
- class TableAppendixComponent {
4713
+ class FileUploadComponent {
4714
+ SharedService;
4715
+ dataService;
4716
+ sanitizer;
4637
4717
  i18nService;
4718
+ selectedFileData = new EventEmitter();
4719
+ deletedFileData = new EventEmitter();
4720
+ allFiles;
4721
+ limitFileUploading;
4722
+ isDeleteFileButtonVisible;
4723
+ isShowNoFileIcon;
4724
+ tableFile; // file Upload from table
4638
4725
  question;
4639
- valueChange = new EventEmitter();
4640
- tableInfo;
4641
- tableHeader;
4642
- tableData;
4643
- addRowColSpan;
4644
- tableAppendix;
4645
- dropDownApi;
4646
- dropDownData;
4647
- constructor(i18nService) {
4726
+ error;
4727
+ selectedFileNameArray = [];
4728
+ copyOfInputAllFiles;
4729
+ copyOfFileUploadingLimit;
4730
+ fileUrl;
4731
+ showFile = false;
4732
+ isImage = false;
4733
+ fileName = '';
4734
+ currentFile;
4735
+ constructor(SharedService, dataService, sanitizer, i18nService) {
4736
+ this.SharedService = SharedService;
4737
+ this.dataService = dataService;
4738
+ this.sanitizer = sanitizer;
4648
4739
  this.i18nService = i18nService;
4649
4740
  }
4650
- ngOnInit() {
4651
- if (this.question.Sub_Text__c != undefined) {
4652
- this.tableInfo = JSON.parse(this.question.Sub_Text__c);
4653
- this.tableHeader = this.tableInfo.header;
4654
- this.tableData = this.tableInfo.data;
4655
- this.tableAppendix = this.tableInfo.tableAppendix;
4656
- this.dropDownApi = JSON.stringify(this.tableInfo['dropdownApi']);
4657
- this.dropDownData = this.tableInfo['dropdownData'];
4658
- const combinedData = {
4659
- tableData: this.tableData,
4660
- tableAppendix: null
4661
- };
4662
- if (this.tableAppendix) {
4663
- combinedData.tableAppendix = this.tableAppendix;
4664
- }
4665
- this.valueChange.emit(combinedData);
4666
- if (this.tableData?.addRow) {
4667
- this.addRowColSpan = this.tableHeader.length - 2;
4668
- }
4741
+ ngOnInit() { }
4742
+ // VD 03May24 file upload fix
4743
+ // onFileUpload(event: any) {
4744
+ // const fileUploaderElement: HTMLElement = document.getElementById(
4745
+ // 'fileUpload'
4746
+ // ) as HTMLElement;
4747
+ // fileUploaderElement.click();
4748
+ // }
4749
+ ngOnChanges(simpleChanges) {
4750
+ console.log('simple changes', simpleChanges);
4751
+ this.copyOfInputAllFiles = simpleChanges.allFiles?.currentValue;
4752
+ if (simpleChanges.limitFileUploading) {
4753
+ this.copyOfFileUploadingLimit = simpleChanges.limitFileUploading?.currentValue;
4669
4754
  }
4670
4755
  }
4671
- addRow() {
4672
- let newItem = JSON.parse(JSON.stringify(this.tableInfo.newRowDefault));
4673
- const updatedTableData = [...this.tableData, newItem];
4674
- this.tableData = updatedTableData;
4675
- this.emitTableDataValue(updatedTableData, this.tableAppendix);
4676
- }
4677
- updateLabel(rowIndex, label, value) {
4678
- this.tableData[rowIndex][label] = value;
4679
- this.tableData[rowIndex].name = value.replace(/\s+/g, '').toLowerCase();
4680
- this.emitTableDataValue(this.tableData, this.tableAppendix);
4681
- }
4682
- updateNumber(item, label, value) {
4683
- item.value[label] = value;
4684
- this.emitTableDataValue(this.tableData, this.tableAppendix);
4685
- }
4686
- updateToggle(item, header, value) {
4687
- let label = header['fieldName'];
4688
- let toggleValue = header['toggleValue'];
4689
- if (label == 'test1') {
4690
- item.value[label][1] = value ? toggleValue[0] : toggleValue[1];
4756
+ uploadMultipleFiles(event) {
4757
+ console.log('File uploader initiated');
4758
+ let inputFiles = this.copyOfInputAllFiles ? this.copyOfInputAllFiles : [];
4759
+ const selectedFileData = [];
4760
+ const uploadedFiles = event.target.files;
4761
+ if (uploadedFiles.length + inputFiles.length <= this.copyOfFileUploadingLimit) {
4762
+ const readFilesPromises = [];
4763
+ for (const eachUploadedFile of uploadedFiles) {
4764
+ const file = eachUploadedFile;
4765
+ const format = file.name.split('.')[1];
4766
+ // Create a promise for each file read
4767
+ const fileReadPromise = new Promise((resolve, reject) => {
4768
+ const reader = new FileReader();
4769
+ reader.readAsDataURL(file);
4770
+ reader.onload = () => {
4771
+ const fileData = {
4772
+ doc: reader.result,
4773
+ name: file.name,
4774
+ type: file.type,
4775
+ format,
4776
+ id: null,
4777
+ };
4778
+ selectedFileData.push(fileData);
4779
+ inputFiles.push(fileData);
4780
+ resolve();
4781
+ };
4782
+ reader.onerror = () => {
4783
+ reject();
4784
+ };
4785
+ });
4786
+ readFilesPromises.push(fileReadPromise);
4787
+ }
4788
+ // Wait for all promises to resolve
4789
+ Promise.all(readFilesPromises).then(() => {
4790
+ this.copyOfInputAllFiles = inputFiles;
4791
+ console.log('uploadedFiles', inputFiles);
4792
+ this.selectedFileData.emit(inputFiles);
4793
+ }).catch(() => {
4794
+ console.error('Error reading files');
4795
+ });
4691
4796
  }
4692
4797
  else {
4693
- item.value[label] = value ? toggleValue[0] : toggleValue[1];
4798
+ console.warn('You can upload max 5 files');
4799
+ // this.toastr.warning(TOASTER_MESSAGES.MAX_FIVE_FILES, TOASTER_MESSAGES.WARNING_TITLE);
4694
4800
  }
4695
- this.emitTableDataValue(this.tableData, this.tableAppendix);
4696
- }
4697
- updateDropDown(item, label, value) {
4698
- item.value[label] = value.valueObj['Value__c'];
4699
- this.emitTableDataValue(this.tableData, this.tableAppendix);
4801
+ event.target.value = '';
4700
4802
  }
4701
- updateCheckText(item, label, value) {
4702
- item.value[label][0] = value;
4703
- this.emitTableDataValue(this.tableData, this.tableAppendix);
4803
+ // uploadMultipleFiles(event: any) {
4804
+ // console.log('File uploader initiated');
4805
+ // let inputFiles: any[] = this.copyOfInputAllFiles ? this.copyOfInputAllFiles : [];
4806
+ // const selectedFileData = [];
4807
+ // const uploadedFiles = event.target.files;
4808
+ // if (uploadedFiles.length + inputFiles.length <= this.copyOfFileUploadingLimit) {
4809
+ // for (const eachUploadedFile of uploadedFiles) {
4810
+ // const reader = new FileReader();
4811
+ // const file: File = eachUploadedFile;
4812
+ // const format = file.name.split('.')[1];
4813
+ // reader.readAsDataURL(file);
4814
+ // reader.onload = () => {
4815
+ // selectedFileData.push({
4816
+ // doc: reader.result,
4817
+ // name: file.name,
4818
+ // type: file.type,
4819
+ // format,
4820
+ // id: null,
4821
+ // });
4822
+ // inputFiles.push({
4823
+ // doc: reader.result,
4824
+ // name: file.name,
4825
+ // type: file.type,
4826
+ // format,
4827
+ // id: null,
4828
+ // });
4829
+ // };
4830
+ // }
4831
+ // } else {
4832
+ // console.warn('You can upload max 5 files');
4833
+ // //this.toastr.warning(TOASTER_MESSAGES.MAX_FIVE_FILES, TOASTER_MESSAGES.WARNING_TITLE);
4834
+ // }
4835
+ // event.target.value = '';
4836
+ // this.copyOfInputAllFiles = inputFiles;
4837
+ // console.log('uploadedFiles',inputFiles);
4838
+ // this.selectedFileData.emit(inputFiles);
4839
+ // }
4840
+ deleteFile(currentFileIndex) {
4841
+ const deletedFileName = this.selectedFileNameArray.splice(currentFileIndex, 1);
4842
+ const deletedFile = this.copyOfInputAllFiles.splice(currentFileIndex, 1);
4843
+ console.log('emit', deletedFile[0]);
4844
+ this.deletedFileData.emit(deletedFile[0]);
4845
+ this.selectedFileData.emit(this.copyOfInputAllFiles);
4704
4846
  }
4705
- updateTableAppendix(item, label, value) {
4706
- let toggleValue = item.value[0].toggleValue;
4707
- if (item.key == 'dropDownData') {
4708
- item.value[0].value[label] = value.valueObj['empIdName'];
4709
- }
4710
- else if (item.key == 'toggleData') {
4711
- item.value[0].value[label] = value ? toggleValue[0] : toggleValue[1];
4847
+ // VD 20May24 - preview changes
4848
+ viewFile(currentFile) {
4849
+ this.currentFile = currentFile;
4850
+ this.showFile = true;
4851
+ console.log(currentFile);
4852
+ if (this.question.Sub_Text__c != undefined) {
4853
+ let fileMeta = JSON.parse(this.question.Sub_Text__c);
4854
+ let endpoint = fileMeta.endpoint;
4855
+ let queryParameter = fileMeta.queryParameter;
4856
+ let file = currentFile;
4857
+ if (endpoint) {
4858
+ const fullEndPoint = endpoint + '?' + queryParameter + '=' + file[queryParameter];
4859
+ if (fullEndPoint) {
4860
+ this.dataService.apiResponse(fullEndPoint).subscribe((apiResponse) => {
4861
+ if (apiResponse) {
4862
+ this.handleFileContent(apiResponse);
4863
+ }
4864
+ });
4865
+ }
4866
+ }
4712
4867
  }
4713
4868
  else {
4714
- item.value[0].value[label] = value;
4869
+ this.viewLocalFile();
4715
4870
  }
4716
- this.emitTableDataValue(this.tableData, this.tableAppendix);
4717
4871
  }
4718
- emitTableDataValue(updatedTableData, tableAppendix) {
4719
- const combinedData = {
4720
- tableData: updatedTableData,
4721
- tableAppendix: null
4722
- };
4723
- if (tableAppendix) {
4724
- combinedData.tableAppendix = this.tableAppendix;
4872
+ // // VD 03Aug24 process local preview
4873
+ viewLocalFile() {
4874
+ if (this.currentFile) {
4875
+ this.setFileUrl(this.currentFile?.doc);
4876
+ this.fileName = this.currentFile.name;
4877
+ this.isImage = this.currentFile.type.startsWith('image/');
4725
4878
  }
4726
- this.valueChange.emit(combinedData);
4727
4879
  }
4728
- //This function finds the index of the current test in the list of test keys and returns the key of the previous test.
4729
- // If the current test is the first one, it returns null, as there is no previous test
4730
- getPreviousTestKey(item, currentTest) {
4731
- const testKeys = Object.keys(item.value);
4732
- const currentIndex = testKeys.indexOf(currentTest);
4733
- if (currentIndex > 0) {
4734
- return testKeys[currentIndex - 1];
4880
+ handleFileContent(fileResponse) {
4881
+ const byteArray = new Uint8Array(fileResponse.content.data);
4882
+ const blob = new Blob([byteArray], { type: fileResponse.type });
4883
+ const url = window.URL.createObjectURL(blob);
4884
+ this.setFileUrl(url);
4885
+ this.isImage = false;
4886
+ if (fileResponse.name) {
4887
+ this.fileName = fileResponse.name;
4888
+ const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
4889
+ const fileExtension = fileResponse.name.split('.').pop()?.toLowerCase();
4890
+ this.isImage = imageExtensions.includes(fileExtension || '');
4735
4891
  }
4736
- return null;
4737
4892
  }
4738
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableAppendixComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
4739
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TableAppendixComponent, selector: "app-table-appendix", inputs: { question: "question" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<table class=\"table table-striped table-bordered\">\n <thead class=\"none-border\" *ngIf=\"tableInfo.tableType === 'lockout' && tableInfo.tableHeader\">\n <th></th>\n <th>{{ tableInfo.tableHeader }}</th>\n <th></th>\n </thead>\n <thead>\n <th *ngFor=\"let header of tableHeader; let hi = index\" [class]=\"'col-md-' + header.size\">\n {{ header.label }}\n </th>\n </thead>\n <tbody id=\"safetyMeasuresTableBody\">\n <tr *ngFor=\"let item of tableData; let i = index\">\n <td *ngFor=\"let header of tableHeader; let j = index\">\n <div *ngIf=\"header.type === 'text'\">\n <input type=\"text\" [(ngModel)]=\"item[header.fieldName]\" [placeholder]=\"header.placeholder\" (ngModelChange)=\"tableInfo.tableType != 'lockout' ? updateLabel(i, header.fieldName, item[header.fieldName]) : updateNumber(item, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('number')\">\n <!-- HA 19DEC23 For translation -->\n <input type=\"number\" [(ngModel)]=\"item.value[header.fieldName]\" [disabled]=\"item.value[getPreviousTestKey(item, header.fieldName)] === null && tableInfo.tableType != 'lockout'\" (ngModelChange)=\"updateNumber(item, header.fieldName, item.value[header.fieldName])\" placeholder=\"{{ 'enterValue' | i18n:i18nService.currentLanguage }}\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type === 'dropdown'\">\n <app-custom-dropdown [fromShengel]=\"true\" [options]=\"dropDownData\" \n [selectedValue]=\"item.value[header.fieldName]\" [placeholder]=\"header.placeholder\"\n (valueChange)=\"updateDropDown(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type === 'textcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <input type=\"text\" [(ngModel)]=\"item.value[header.fieldName][0]\" (ngModelChange)=\"updateCheckText(item, header.fieldName, item.value[header.fieldName][0])\" style=\"width: 85px; height: 27px; text-align: center; padding: 5px; border-bottom: none; border-top: 1px solid transparent; border-right: 1px solid transparent; border-left: 1px solid transparent; background: transparent;outline: none;\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName][1] == header.toggleValue[0]\"/>\n <span class=\"switch-label2\" data-on=\"Psi\" data-off=\"Bar\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n <div *ngIf=\"header.type === 'labelcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <!-- HA 19DEC23 For translation -->\n <span style=\"text-align:left;\">{{ 'calibrated' | i18n:i18nService.currentLanguage }}</span>\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName] == header.toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Yes\" data-off=\"No\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType === 'lockout'\">\n <td colspan=\"1\">\n <!-- HA 19DEC23 For translation -->\n <b style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">{{ 'addMore' | i18n:i18nService.currentLanguage }} +</b>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType != 'lockout'\">\n <td colspan=\"3\">\n <!-- HA 19DEC23 For translation -->\n <b>{{ 'addMore' | i18n:i18nService.currentLanguage }}</b>\n </td>\n <td colspan=\"2\" style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">\n +\n </td>\n </tr>\n <tr *ngFor=\"let item of tableAppendix | keyvalue; let k = index\">\n <td *ngFor=\"let header of tableHeader; let l = index\">\n <div *ngIf=\"header.type === 'text'\" >\n <input type=\"text\" [(ngModel)]=\"item.value[0][header.fieldName]\" (ngModelChange)=\"updateLabel(k, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('dropdown') && item.key == 'dropDownData'\" >\n <!-- HA 19DEC23 For translation -->\n <app-custom-dropdown [fromShengel]=\"true\" [apiMeta]=\"dropDownApi\" \n [selectedValue]=\"item.value[0].value[header.fieldName]\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n (valueChange)=\"updateTableAppendix(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type.includes('datetime') && item.key == 'dateData'\">\n <input [(ngModel)]=\"item.value[0].value[header.fieldName]\" type=\"datetime-local\"\n (ngModelChange)=\"updateTableAppendix(item,header.fieldName,$event)\"\n placeholder=\"DD/MM/YYYY HH:MM\">\n </div>\n <div *ngIf=\"header.type.includes('checkbox') && item.key == 'toggleData'\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateTableAppendix(item,header.fieldName,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[0].value[header.fieldName] == item.value[0].toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Safe\" data-off=\"Unsafe\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n <div *ngIf=\"header.type.includes('file') && item.key == 'fileData'\">\n <app-file-upload [limitFileUploading]=\"2\" [allFiles]=\"item.value[0].value[header.fieldName]\" [tableFile]=\"true\"\n (selectedFileData)=\"updateTableAppendix(item ,header.fieldName, $event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n </td>\n </tr>\n </tbody>\n </table>", styles: [".table{width:100%;max-width:100%;margin-bottom:20px;border-collapse:collapse;border-spacing:0}.table-bordered{border:1px solid #ddd}thead{background-color:#03a9f4}thead th{color:#fff;font-size:14px}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}th{text-align:left}thead .permission{text-align:center}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}tbody{color:#797979}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}.permission_yes,.permission_no,.permission_na{text-align:center}.none-border th{border:none}.switch2{position:relative;width:73px;height:23.5px;margin-left:5px;margin-top:3px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF 25px);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF 25px);border-radius:5px;box-shadow:inset 0 -1px #fff,inset 0 1px 1px #0000000d;cursor:pointer}.switch-input2{position:absolute;top:0;left:0;opacity:0}.switch-label2{position:relative;display:block;height:inherit;font-size:12px;background:rgba(175,172,172,.5);color:#000;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label3{position:relative;display:block;height:inherit;font-size:12px;background:red;color:#fff;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label2:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label3:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label2:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label3:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label2:after{content:attr(data-on);left:11px;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-label3:after{content:attr(data-on);left:11px;margin-left:10px;vertical-align:sub;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-input2:checked~.switch-label2{background:#03a9f4;border-color:#03a9f4;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label3{background:rgb(2,173,2);border-color:#02ad02;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label2:before{opacity:0}.switch-input2:checked~.switch-label3:before{opacity:0}.switch-input2:checked~.switch-label2:after{opacity:1;margin-right:15px}.switch-input2:checked~.switch-label3:after{opacity:1;margin-right:15px}.switch-handle2{position:absolute;top:2px;left:2px;width:18px;height:18px;background:linear-gradient(to bottom,#FFFFFF 40%,#f0f0f0);background-image:-webkit-linear-gradient(top,#FFFFFF 40%,#f0f0f0);border-radius:20%;box-shadow:1px 1px 5px #0003}.switch-handle2:before{content:\"\";position:absolute;top:50%;left:50%;margin:-6px 0 0 -6px;width:12px;height:12px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF);border-radius:6px;box-shadow:inset 0 1px #00000005}.switch-input2:checked~.switch-handle2{left:51px;box-shadow:-1px 1px 5px #0003}.switch-label2,.switch-handle2,.switch-label3{transition:All .3s ease;-webkit-transition:All .3s ease;-moz-transition:All .3s ease;-o-transition:All .3s ease}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CustomDropdownComponent, selector: "app-custom-dropdown", inputs: ["options", "placeholder", "apiMeta", "selectedValue", "progressBar", "id", "readOnly", "errorMessage", "error", "fromShengel", "referenceField", "token"], outputs: ["valueChange"] }, { kind: "component", type: FileUploadComponent, selector: "app-file-upload", inputs: ["allFiles", "limitFileUploading", "isDeleteFileButtonVisible", "isShowNoFileIcon", "tableFile", "question", "error"], outputs: ["selectedFileData", "deletedFileData"] }, { kind: "pipe", type: i2.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
4740
- }
4741
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableAppendixComponent, decorators: [{
4742
- type: Component,
4743
- args: [{ selector: 'app-table-appendix', template: "<table class=\"table table-striped table-bordered\">\n <thead class=\"none-border\" *ngIf=\"tableInfo.tableType === 'lockout' && tableInfo.tableHeader\">\n <th></th>\n <th>{{ tableInfo.tableHeader }}</th>\n <th></th>\n </thead>\n <thead>\n <th *ngFor=\"let header of tableHeader; let hi = index\" [class]=\"'col-md-' + header.size\">\n {{ header.label }}\n </th>\n </thead>\n <tbody id=\"safetyMeasuresTableBody\">\n <tr *ngFor=\"let item of tableData; let i = index\">\n <td *ngFor=\"let header of tableHeader; let j = index\">\n <div *ngIf=\"header.type === 'text'\">\n <input type=\"text\" [(ngModel)]=\"item[header.fieldName]\" [placeholder]=\"header.placeholder\" (ngModelChange)=\"tableInfo.tableType != 'lockout' ? updateLabel(i, header.fieldName, item[header.fieldName]) : updateNumber(item, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('number')\">\n <!-- HA 19DEC23 For translation -->\n <input type=\"number\" [(ngModel)]=\"item.value[header.fieldName]\" [disabled]=\"item.value[getPreviousTestKey(item, header.fieldName)] === null && tableInfo.tableType != 'lockout'\" (ngModelChange)=\"updateNumber(item, header.fieldName, item.value[header.fieldName])\" placeholder=\"{{ 'enterValue' | i18n:i18nService.currentLanguage }}\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type === 'dropdown'\">\n <app-custom-dropdown [fromShengel]=\"true\" [options]=\"dropDownData\" \n [selectedValue]=\"item.value[header.fieldName]\" [placeholder]=\"header.placeholder\"\n (valueChange)=\"updateDropDown(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type === 'textcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <input type=\"text\" [(ngModel)]=\"item.value[header.fieldName][0]\" (ngModelChange)=\"updateCheckText(item, header.fieldName, item.value[header.fieldName][0])\" style=\"width: 85px; height: 27px; text-align: center; padding: 5px; border-bottom: none; border-top: 1px solid transparent; border-right: 1px solid transparent; border-left: 1px solid transparent; background: transparent;outline: none;\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName][1] == header.toggleValue[0]\"/>\n <span class=\"switch-label2\" data-on=\"Psi\" data-off=\"Bar\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n <div *ngIf=\"header.type === 'labelcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <!-- HA 19DEC23 For translation -->\n <span style=\"text-align:left;\">{{ 'calibrated' | i18n:i18nService.currentLanguage }}</span>\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName] == header.toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Yes\" data-off=\"No\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType === 'lockout'\">\n <td colspan=\"1\">\n <!-- HA 19DEC23 For translation -->\n <b style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">{{ 'addMore' | i18n:i18nService.currentLanguage }} +</b>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType != 'lockout'\">\n <td colspan=\"3\">\n <!-- HA 19DEC23 For translation -->\n <b>{{ 'addMore' | i18n:i18nService.currentLanguage }}</b>\n </td>\n <td colspan=\"2\" style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">\n +\n </td>\n </tr>\n <tr *ngFor=\"let item of tableAppendix | keyvalue; let k = index\">\n <td *ngFor=\"let header of tableHeader; let l = index\">\n <div *ngIf=\"header.type === 'text'\" >\n <input type=\"text\" [(ngModel)]=\"item.value[0][header.fieldName]\" (ngModelChange)=\"updateLabel(k, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('dropdown') && item.key == 'dropDownData'\" >\n <!-- HA 19DEC23 For translation -->\n <app-custom-dropdown [fromShengel]=\"true\" [apiMeta]=\"dropDownApi\" \n [selectedValue]=\"item.value[0].value[header.fieldName]\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n (valueChange)=\"updateTableAppendix(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type.includes('datetime') && item.key == 'dateData'\">\n <input [(ngModel)]=\"item.value[0].value[header.fieldName]\" type=\"datetime-local\"\n (ngModelChange)=\"updateTableAppendix(item,header.fieldName,$event)\"\n placeholder=\"DD/MM/YYYY HH:MM\">\n </div>\n <div *ngIf=\"header.type.includes('checkbox') && item.key == 'toggleData'\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateTableAppendix(item,header.fieldName,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[0].value[header.fieldName] == item.value[0].toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Safe\" data-off=\"Unsafe\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n <div *ngIf=\"header.type.includes('file') && item.key == 'fileData'\">\n <app-file-upload [limitFileUploading]=\"2\" [allFiles]=\"item.value[0].value[header.fieldName]\" [tableFile]=\"true\"\n (selectedFileData)=\"updateTableAppendix(item ,header.fieldName, $event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n </td>\n </tr>\n </tbody>\n </table>", styles: [".table{width:100%;max-width:100%;margin-bottom:20px;border-collapse:collapse;border-spacing:0}.table-bordered{border:1px solid #ddd}thead{background-color:#03a9f4}thead th{color:#fff;font-size:14px}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}th{text-align:left}thead .permission{text-align:center}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}tbody{color:#797979}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}.permission_yes,.permission_no,.permission_na{text-align:center}.none-border th{border:none}.switch2{position:relative;width:73px;height:23.5px;margin-left:5px;margin-top:3px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF 25px);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF 25px);border-radius:5px;box-shadow:inset 0 -1px #fff,inset 0 1px 1px #0000000d;cursor:pointer}.switch-input2{position:absolute;top:0;left:0;opacity:0}.switch-label2{position:relative;display:block;height:inherit;font-size:12px;background:rgba(175,172,172,.5);color:#000;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label3{position:relative;display:block;height:inherit;font-size:12px;background:red;color:#fff;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label2:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label3:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label2:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label3:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label2:after{content:attr(data-on);left:11px;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-label3:after{content:attr(data-on);left:11px;margin-left:10px;vertical-align:sub;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-input2:checked~.switch-label2{background:#03a9f4;border-color:#03a9f4;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label3{background:rgb(2,173,2);border-color:#02ad02;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label2:before{opacity:0}.switch-input2:checked~.switch-label3:before{opacity:0}.switch-input2:checked~.switch-label2:after{opacity:1;margin-right:15px}.switch-input2:checked~.switch-label3:after{opacity:1;margin-right:15px}.switch-handle2{position:absolute;top:2px;left:2px;width:18px;height:18px;background:linear-gradient(to bottom,#FFFFFF 40%,#f0f0f0);background-image:-webkit-linear-gradient(top,#FFFFFF 40%,#f0f0f0);border-radius:20%;box-shadow:1px 1px 5px #0003}.switch-handle2:before{content:\"\";position:absolute;top:50%;left:50%;margin:-6px 0 0 -6px;width:12px;height:12px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF);border-radius:6px;box-shadow:inset 0 1px #00000005}.switch-input2:checked~.switch-handle2{left:51px;box-shadow:-1px 1px 5px #0003}.switch-label2,.switch-handle2,.switch-label3{transition:All .3s ease;-webkit-transition:All .3s ease;-moz-transition:All .3s ease;-o-transition:All .3s ease}\n"] }]
4744
- }], ctorParameters: function () { return [{ type: I18nService }]; }, propDecorators: { question: [{
4745
- type: Input
4746
- }], valueChange: [{
4747
- type: Output
4748
- }] } });
4749
-
4750
- class CustomDateComponent {
4751
- i18nService;
4752
- date;
4753
- readOnly = false; // VD 12Jun24 - readonly change
4754
- error;
4755
- errorMessage;
4756
- dateChange = new EventEmitter();
4757
- dateSelected;
4758
- constructor(i18nService) {
4759
- this.i18nService = i18nService;
4893
+ setFileUrl(url) {
4894
+ this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
4760
4895
  }
4761
- ngOnInit() {
4762
- this.dateSelected = new Date(this.date);
4896
+ getDocIcon(docName) {
4897
+ const ext = docName.split('.').pop(-1);
4898
+ return this.SharedService.docIcon(ext);
4763
4899
  }
4764
- // VD 02Aug24 - clear input changes
4765
- ngOnChanges(simplechanges) {
4766
- if (simplechanges['date']) {
4767
- this.dateSelected = new Date(this.date);
4900
+ close() {
4901
+ this.showFile = false;
4902
+ this.fileName = '';
4903
+ this.fileUrl = '';
4904
+ this.isImage = false;
4905
+ if (this.fileUrl) {
4906
+ URL.revokeObjectURL(this.fileUrl);
4768
4907
  }
4769
4908
  }
4770
- onDateChange(event) {
4771
- this.dateChange.emit(event);
4772
- }
4773
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomDateComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
4774
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomDateComponent, selector: "app-custom-date", inputs: { date: "date", readOnly: "readOnly", error: "error", errorMessage: "errorMessage" }, outputs: { dateChange: "dateChange" }, usesOnChanges: true, ngImport: i0, template: "<!-- date component -->\n<!-- VD 12Jun24 - readonly change-->\n<!-- VD 01Aug24 - validation change-->\n<p>\n <input\n [class]=\"error ? 'invalid' : ''\"\n [(ngModel)]=\"dateSelected\"\n [owlDateTimeTrigger]=\"dt1\"\n [owlDateTime]=\"dt1\"\n [disabled]=\"readOnly\"\n placeholder=\"DD/MM/YYYY\"\n (input)=\"onDateChange($event)\"\n style=\"width: 100%; height: 35px; border: none; box-shadow: none; border-bottom: 1px solid #ccc;\"\n (dateTimeChange)=\"onDateChange($event)\"\n >\n <owl-date-time [pickerType]=\"'calendar'\" #dt1></owl-date-time>\n </p>\n <span *ngIf=\"error\" class=\"error-msg\">{{errorMessage}}</span>", styles: [".invalid{border-color:red!important}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.OwlDateTimeTriggerDirective, selector: "[owlDateTimeTrigger]", inputs: ["disabled", "owlDateTimeTrigger"] }, { kind: "directive", type: i4$1.OwlDateTimeInputDirective, selector: "input[owlDateTime]", inputs: ["rangeSeparator", "owlDateTime", "owlDateTimeFilter", "min", "max", "selectMode", "value", "values", "_disabled"], outputs: ["dateTimeChange", "dateTimeInput"], exportAs: ["owlDateTimeInput"] }, { kind: "component", type: i4$1.OwlDateTimeComponent, selector: "owl-date-time", inputs: ["startAt", "pickerType", "pickerMode", "disabled", "opened", "backdropClass", "panelClass", "scrollStrategy"], outputs: ["afterPickerClosed", "afterPickerOpen", "yearSelected", "monthSelected"], exportAs: ["owlDateTime"] }] });
4909
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileUploadComponent, deps: [{ token: SharedService }, { token: DataService }, { token: i6$1.DomSanitizer }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
4910
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FileUploadComponent, selector: "app-file-upload", inputs: { allFiles: "allFiles", limitFileUploading: "limitFileUploading", isDeleteFileButtonVisible: "isDeleteFileButtonVisible", isShowNoFileIcon: "isShowNoFileIcon", tableFile: "tableFile", question: "question", error: "error" }, outputs: { selectedFileData: "selectedFileData", deletedFileData: "deletedFileData" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-md-12\" *ngIf=\"!isDeleteFileButtonVisible\" style=\"text-align: left;\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n <div class=\"col-lg-5 document-cnt m-t-10 m-b-10\"\n *ngFor=\"let eachFile of copyOfInputAllFiles; let currentFileIndex = index\">\n <div *ngIf=\"!tableFile\"> <!-- (click)=\"viewFile(eachFile)\" -->\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.name)\">\n </div>\n <div class=\"col-lg-9 document_name\">\n {{eachFile?.name}}\n </div>\n <div class=\"document_delete\" (click)=\"deleteFile(currentFileIndex);$event.stopPropagation()\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/bin.svg\">\n </div>\n <!-- VD 20May24 - preview changes-->\n <div class=\"preview-icon\" (click)=\"viewFile(eachFile)\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/icons8-eye-24.png\">\n </div>\n </div>\n <div *ngIf=\"tableFile\" class=\"row\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{eachFile?.name}}\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"copyOfInputAllFiles?.length === 0 && isShowNoFileIcon\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n</div>\n\n<div class=\"col-lg-6\" style=\"padding:0;margin-top: 10px;\">\n <label class=\"custom-file\" *ngIf=\"isDeleteFileButtonVisible && !tableFile\">\n <!-- HA 19DEC23 For translation -->\n <!-- VD 03May24 file upload fix-->\n <button [class]=\"error ? 'she-btn-primary-bordered Invalid' : 'she-btn-primary-bordered'\" style=\"width:275px;\" (click)=\"fileInput.click()\"\n [ngClass]=\"{ 'btn-disabled': copyOfInputAllFiles?.length >= copyOfFileUploadingLimit }\" [disabled]=\"copyOfInputAllFiles?.length >= copyOfFileUploadingLimit\"\n >Choose Files</button>\n\n <input #fileInput type=\"file\" name=\"fileUpload\" multiple=\"multiple\" accept=\"*\" style=\"display:none;\"\n (change) = uploadMultipleFiles($event)\n />\n </label>\n<!-- HA 19DEC23 For translation -->\n <label *ngIf=\"tableFile\" class=\"btn btn-primary\">\n {{ 'uploadFile' | i18n:i18nService.currentLanguage }}\n <input id=\"file\" style=\"display: none;\" type=\"file\" class=\"form-control\" (change)= uploadMultipleFiles($event) />\n </label>\n <!-- <span class=\"error-msg\" *ngIf=\"(formControl?.documents?.touched || formControl?.documents?.dirty) &&\n formControl?.documents?.errors?.required\">\n {{LM_POLICY_VALIDATION_MESSAGE.REQUIRED}}\n </span> -->\n</div>\n<div *ngIf=\"error\" class=\"error-msg\" style=\"margin-top: 10px;\">{{question?.Error_Message__c}}</div>\n<div class=\"nxt-file-overlay\" *ngIf=\"showFile\">\n <div class=\"nxt-file-map-modal\">\n <div class=\"nxt-file-model-content\">\n <div class=\"nxt-file-model-header\">\n <h4>{{fileName}}</h4>\n <button class=\"close-button\" (click)=\"close()\">X</button>\n </div>\n <ng-container *ngIf=\"isImage; else otherFile\">\n <img [src]=\"fileUrl\" class=\"img-fluid\" alt=\"File Preview\" />\n </ng-container>\n <ng-template #otherFile>\n <iframe [src]=\"fileUrl\" width=\"100%\" height=\"500px\"></iframe>\n </ng-template>\n </div>\n </div>\n</div>\n\n\n", styles: [".document-cnt{padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f9f9f9;margin-bottom:10px;cursor:pointer;transition:background-color .3s ease;position:relative}.document-cnt:hover{background-color:#e9ecef}.document_image img{width:30px;height:30px}.document_name{font-size:14px;font-weight:700;color:#333;line-height:30px}.label{margin-bottom:0}.document_delete img,.preview-icon img{width:20px;height:20px;cursor:pointer;transition:transform .3s ease}.document_delete img{filter:brightness(0) saturate(100%) invert(20%) sepia(97%) saturate(7481%) hue-rotate(357deg) brightness(98%) contrast(119%)}.document_delete img:hover,.preview-icon img:hover{transform:scale(1.1)}.document_delete,.preview-icon{position:absolute;top:50%;transform:translateY(-50%)}.document_delete{right:10px}.preview-icon{right:40px}@media (min-width: 992px){.document-cnt{margin-left:10px}}.btn-disabled{background:#e1e1e1;color:#fff;border:none;border-radius:5px;height:50px}.form-control[disabled]{border-radius:5px}.custom-file{color:#9a9a9a;font-size:14px;font-weight:400;display:inline-block;width:auto;margin-bottom:5px}.she-btn-primary-bordered{background:#ffffff;color:#48b7ff;border:1px solid #48B7FF;border-radius:5px;height:50px;outline:none!important}.btn-primary{background-color:#03a9f4!important;border:1px solid #03a9f4!important;color:#fff!important}.btn.btn-primary{border-radius:2px;padding:6px 14px;font-size:14px}.nxt-file-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.nxt-file-map-modal{background-color:#fff;border-radius:8px;overflow:hidden;width:80%;max-width:800px;max-height:90%;display:flex;flex-direction:column}.nxt-file-model-content{display:flex;flex-direction:column;height:100%}.nxt-file-model-header{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background-color:#f5f5f5;border-bottom:1px solid #ddd}.nxt-file-model-header h4{margin:0;font-size:1.25em}.close-button{background:none;border:none;font-size:1.5em;cursor:pointer}.img-fluid{max-width:100%;height:auto;flex:1}iframe{border:none}.Invalid{border:1px solid red!important}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
4775
4911
  }
4776
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomDateComponent, decorators: [{
4912
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileUploadComponent, decorators: [{
4777
4913
  type: Component,
4778
- args: [{ selector: 'app-custom-date', template: "<!-- date component -->\n<!-- VD 12Jun24 - readonly change-->\n<!-- VD 01Aug24 - validation change-->\n<p>\n <input\n [class]=\"error ? 'invalid' : ''\"\n [(ngModel)]=\"dateSelected\"\n [owlDateTimeTrigger]=\"dt1\"\n [owlDateTime]=\"dt1\"\n [disabled]=\"readOnly\"\n placeholder=\"DD/MM/YYYY\"\n (input)=\"onDateChange($event)\"\n style=\"width: 100%; height: 35px; border: none; box-shadow: none; border-bottom: 1px solid #ccc;\"\n (dateTimeChange)=\"onDateChange($event)\"\n >\n <owl-date-time [pickerType]=\"'calendar'\" #dt1></owl-date-time>\n </p>\n <span *ngIf=\"error\" class=\"error-msg\">{{errorMessage}}</span>", styles: [".invalid{border-color:red!important}\n"] }]
4779
- }], ctorParameters: function () { return [{ type: I18nService }]; }, propDecorators: { date: [{
4914
+ args: [{ selector: 'app-file-upload', template: "<div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-md-12\" *ngIf=\"!isDeleteFileButtonVisible\" style=\"text-align: left;\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n <div class=\"col-lg-5 document-cnt m-t-10 m-b-10\"\n *ngFor=\"let eachFile of copyOfInputAllFiles; let currentFileIndex = index\">\n <div *ngIf=\"!tableFile\"> <!-- (click)=\"viewFile(eachFile)\" -->\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.name)\">\n </div>\n <div class=\"col-lg-9 document_name\">\n {{eachFile?.name}}\n </div>\n <div class=\"document_delete\" (click)=\"deleteFile(currentFileIndex);$event.stopPropagation()\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/bin.svg\">\n </div>\n <!-- VD 20May24 - preview changes-->\n <div class=\"preview-icon\" (click)=\"viewFile(eachFile)\" *ngIf=\"isDeleteFileButtonVisible\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/icons8-eye-24.png\">\n </div>\n </div>\n <div *ngIf=\"tableFile\" class=\"row\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(eachFile?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{eachFile?.name}}\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"copyOfInputAllFiles?.length === 0 && isShowNoFileIcon\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n</div>\n\n<div class=\"col-lg-6\" style=\"padding:0;margin-top: 10px;\">\n <label class=\"custom-file\" *ngIf=\"isDeleteFileButtonVisible && !tableFile\">\n <!-- HA 19DEC23 For translation -->\n <!-- VD 03May24 file upload fix-->\n <button [class]=\"error ? 'she-btn-primary-bordered Invalid' : 'she-btn-primary-bordered'\" style=\"width:275px;\" (click)=\"fileInput.click()\"\n [ngClass]=\"{ 'btn-disabled': copyOfInputAllFiles?.length >= copyOfFileUploadingLimit }\" [disabled]=\"copyOfInputAllFiles?.length >= copyOfFileUploadingLimit\"\n >Choose Files</button>\n\n <input #fileInput type=\"file\" name=\"fileUpload\" multiple=\"multiple\" accept=\"*\" style=\"display:none;\"\n (change) = uploadMultipleFiles($event)\n />\n </label>\n<!-- HA 19DEC23 For translation -->\n <label *ngIf=\"tableFile\" class=\"btn btn-primary\">\n {{ 'uploadFile' | i18n:i18nService.currentLanguage }}\n <input id=\"file\" style=\"display: none;\" type=\"file\" class=\"form-control\" (change)= uploadMultipleFiles($event) />\n </label>\n <!-- <span class=\"error-msg\" *ngIf=\"(formControl?.documents?.touched || formControl?.documents?.dirty) &&\n formControl?.documents?.errors?.required\">\n {{LM_POLICY_VALIDATION_MESSAGE.REQUIRED}}\n </span> -->\n</div>\n<div *ngIf=\"error\" class=\"error-msg\" style=\"margin-top: 10px;\">{{question?.Error_Message__c}}</div>\n<div class=\"nxt-file-overlay\" *ngIf=\"showFile\">\n <div class=\"nxt-file-map-modal\">\n <div class=\"nxt-file-model-content\">\n <div class=\"nxt-file-model-header\">\n <h4>{{fileName}}</h4>\n <button class=\"close-button\" (click)=\"close()\">X</button>\n </div>\n <ng-container *ngIf=\"isImage; else otherFile\">\n <img [src]=\"fileUrl\" class=\"img-fluid\" alt=\"File Preview\" />\n </ng-container>\n <ng-template #otherFile>\n <iframe [src]=\"fileUrl\" width=\"100%\" height=\"500px\"></iframe>\n </ng-template>\n </div>\n </div>\n</div>\n\n\n", styles: [".document-cnt{padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f9f9f9;margin-bottom:10px;cursor:pointer;transition:background-color .3s ease;position:relative}.document-cnt:hover{background-color:#e9ecef}.document_image img{width:30px;height:30px}.document_name{font-size:14px;font-weight:700;color:#333;line-height:30px}.label{margin-bottom:0}.document_delete img,.preview-icon img{width:20px;height:20px;cursor:pointer;transition:transform .3s ease}.document_delete img{filter:brightness(0) saturate(100%) invert(20%) sepia(97%) saturate(7481%) hue-rotate(357deg) brightness(98%) contrast(119%)}.document_delete img:hover,.preview-icon img:hover{transform:scale(1.1)}.document_delete,.preview-icon{position:absolute;top:50%;transform:translateY(-50%)}.document_delete{right:10px}.preview-icon{right:40px}@media (min-width: 992px){.document-cnt{margin-left:10px}}.btn-disabled{background:#e1e1e1;color:#fff;border:none;border-radius:5px;height:50px}.form-control[disabled]{border-radius:5px}.custom-file{color:#9a9a9a;font-size:14px;font-weight:400;display:inline-block;width:auto;margin-bottom:5px}.she-btn-primary-bordered{background:#ffffff;color:#48b7ff;border:1px solid #48B7FF;border-radius:5px;height:50px;outline:none!important}.btn-primary{background-color:#03a9f4!important;border:1px solid #03a9f4!important;color:#fff!important}.btn.btn-primary{border-radius:2px;padding:6px 14px;font-size:14px}.nxt-file-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.nxt-file-map-modal{background-color:#fff;border-radius:8px;overflow:hidden;width:80%;max-width:800px;max-height:90%;display:flex;flex-direction:column}.nxt-file-model-content{display:flex;flex-direction:column;height:100%}.nxt-file-model-header{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background-color:#f5f5f5;border-bottom:1px solid #ddd}.nxt-file-model-header h4{margin:0;font-size:1.25em}.close-button{background:none;border:none;font-size:1.5em;cursor:pointer}.img-fluid{max-width:100%;height:auto;flex:1}iframe{border:none}.Invalid{border:1px solid red!important}\n"] }]
4915
+ }], ctorParameters: function () { return [{ type: SharedService }, { type: DataService }, { type: i6$1.DomSanitizer }, { type: I18nService }]; }, propDecorators: { selectedFileData: [{
4916
+ type: Output
4917
+ }], deletedFileData: [{
4918
+ type: Output
4919
+ }], allFiles: [{
4780
4920
  type: Input
4781
- }], readOnly: [{
4921
+ }], limitFileUploading: [{
4782
4922
  type: Input
4783
- }], error: [{
4923
+ }], isDeleteFileButtonVisible: [{
4784
4924
  type: Input
4785
- }], errorMessage: [{
4925
+ }], isShowNoFileIcon: [{
4926
+ type: Input
4927
+ }], tableFile: [{
4928
+ type: Input
4929
+ }], question: [{
4930
+ type: Input
4931
+ }], error: [{
4786
4932
  type: Input
4787
- }], dateChange: [{
4788
- type: Output
4789
4933
  }] } });
4790
4934
 
4791
- class CustomTimeComponent {
4792
- i18nService;
4793
- time;
4794
- readOnly = false; // VD 12Jun24 - readonly change
4795
- error;
4796
- errorMessage;
4797
- timeChange = new EventEmitter();
4798
- timeSelected;
4799
- constructor(i18nService) {
4800
- this.i18nService = i18nService;
4801
- }
4802
- ngOnInit() {
4803
- if (this.time) {
4804
- this.time = this.time['value'] ? this.time['value'] : this.time;
4805
- this.timeSelected = new Date(this.time);
4935
+ class DependentTableComponent {
4936
+ changeService;
4937
+ alertMessage;
4938
+ ValueLength;
4939
+ Value;
4940
+ errorObj;
4941
+ constructor(changeService) {
4942
+ this.changeService = changeService;
4943
+ this.changeService.changeField$.subscribe((data) => {
4944
+ this.dependentData(data);
4945
+ });
4946
+ }
4947
+ ngOnInit() {
4948
+ this.errorObj = JSON.parse(this.alertMessage);
4949
+ }
4950
+ dependentData(data) {
4951
+ let existingData = data.Permits;
4952
+ if (existingData.length !== 0) {
4953
+ this.ValueLength = true;
4954
+ this.Value = existingData;
4955
+ $("#zoneIcon").css("border", "3px solid rgb(252, 35, 27)");
4956
+ }
4957
+ else {
4958
+ this.ValueLength = false;
4959
+ this.Value = [];
4960
+ $("#zoneIcon").css("border", "3px solid rgb(12, 190, 12)");
4961
+ }
4962
+ }
4963
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DependentTableComponent, deps: [{ token: ChangeService }], target: i0.ɵɵFactoryTarget.Component });
4964
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DependentTableComponent, selector: "app-dependent-table", inputs: { alertMessage: "alertMessage" }, ngImport: i0, template: "<div class=\"dropdown\" style=\"cursor: pointer;\">\n <span id=\"zoneIcon\"> \n <img src=\"./../../../../../assets/images/permit_icons/zone.png\" style=\"height: 35px; margin-left: 0px;\" alt=\"adv-search\">\n </span>\n <div class=\"dropdown-content\" style=\"margin-left: -300px; min-width: 415px;\">\n <div class=\"col-lg-12\">\n <table class=\"table table-striped table-bordered\">\n <tbody *ngIf=\"!ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(12, 190, 12); text-align: center\">\n <span><b>{{ errorObj.noPermits }}</b></span>\n <span>{{ errorObj.noActive }}</span>\n </td>\n </tr>\n </tbody>\n <tbody id=\"zoneDetails\" *ngIf=\"ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(252, 35, 27); text-align: center\">\n <span><b>{{ errorObj.permits }} ({{Value.length}})</b></span>\n <span>{{ errorObj.active }}</span>\n </td>\n </tr>\n <tr *ngFor=\"let item of Value\" >\n <td>\n <span>{{item?.permit_type}}-{{item?.ref_no}} - {{item?.status}} - {{item?.end_date}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>", styles: [".dropdown{margin-top:25px;margin-left:25px}.dropdown-content{display:none;position:absolute;background-color:#f9f9f9;min-width:160px;box-shadow:0 8px 16px #0003;padding:12px 16px;z-index:1}.dropdown:hover .dropdown-content{display:block}#zoneIcon{border:3px solid #a59d9d;padding:10px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}@media (max-width: 992px){.dropdown{margin-top:15px;margin-left:0;margin-bottom:15px}}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
4965
+ }
4966
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DependentTableComponent, decorators: [{
4967
+ type: Component,
4968
+ args: [{ selector: 'app-dependent-table', template: "<div class=\"dropdown\" style=\"cursor: pointer;\">\n <span id=\"zoneIcon\"> \n <img src=\"./../../../../../assets/images/permit_icons/zone.png\" style=\"height: 35px; margin-left: 0px;\" alt=\"adv-search\">\n </span>\n <div class=\"dropdown-content\" style=\"margin-left: -300px; min-width: 415px;\">\n <div class=\"col-lg-12\">\n <table class=\"table table-striped table-bordered\">\n <tbody *ngIf=\"!ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(12, 190, 12); text-align: center\">\n <span><b>{{ errorObj.noPermits }}</b></span>\n <span>{{ errorObj.noActive }}</span>\n </td>\n </tr>\n </tbody>\n <tbody id=\"zoneDetails\" *ngIf=\"ValueLength\">\n <tr>\n <td colspan=\"3\" class=\"permission_yes\" style=\"color: rgb(252, 35, 27); text-align: center\">\n <span><b>{{ errorObj.permits }} ({{Value.length}})</b></span>\n <span>{{ errorObj.active }}</span>\n </td>\n </tr>\n <tr *ngFor=\"let item of Value\" >\n <td>\n <span>{{item?.permit_type}}-{{item?.ref_no}} - {{item?.status}} - {{item?.end_date}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>", styles: [".dropdown{margin-top:25px;margin-left:25px}.dropdown-content{display:none;position:absolute;background-color:#f9f9f9;min-width:160px;box-shadow:0 8px 16px #0003;padding:12px 16px;z-index:1}.dropdown:hover .dropdown-content{display:block}#zoneIcon{border:3px solid #a59d9d;padding:10px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}@media (max-width: 992px){.dropdown{margin-top:15px;margin-left:0;margin-bottom:15px}}\n"] }]
4969
+ }], ctorParameters: function () { return [{ type: ChangeService }]; }, propDecorators: { alertMessage: [{
4970
+ type: Input
4971
+ }] } });
4972
+
4973
+ class TableAppendixComponent {
4974
+ i18nService;
4975
+ question;
4976
+ valueChange = new EventEmitter();
4977
+ tableInfo;
4978
+ tableHeader;
4979
+ tableData;
4980
+ addRowColSpan;
4981
+ tableAppendix;
4982
+ dropDownApi;
4983
+ dropDownData;
4984
+ constructor(i18nService) {
4985
+ this.i18nService = i18nService;
4986
+ }
4987
+ ngOnInit() {
4988
+ if (this.question.Sub_Text__c != undefined) {
4989
+ this.tableInfo = JSON.parse(this.question.Sub_Text__c);
4990
+ this.tableHeader = this.tableInfo.header;
4991
+ this.tableData = this.tableInfo.data;
4992
+ this.tableAppendix = this.tableInfo.tableAppendix;
4993
+ this.dropDownApi = JSON.stringify(this.tableInfo['dropdownApi']);
4994
+ this.dropDownData = this.tableInfo['dropdownData'];
4995
+ const combinedData = {
4996
+ tableData: this.tableData,
4997
+ tableAppendix: null
4998
+ };
4999
+ if (this.tableAppendix) {
5000
+ combinedData.tableAppendix = this.tableAppendix;
5001
+ }
5002
+ this.valueChange.emit(combinedData);
5003
+ if (this.tableData?.addRow) {
5004
+ this.addRowColSpan = this.tableHeader.length - 2;
5005
+ }
5006
+ }
5007
+ }
5008
+ addRow() {
5009
+ let newItem = JSON.parse(JSON.stringify(this.tableInfo.newRowDefault));
5010
+ const updatedTableData = [...this.tableData, newItem];
5011
+ this.tableData = updatedTableData;
5012
+ this.emitTableDataValue(updatedTableData, this.tableAppendix);
5013
+ }
5014
+ updateLabel(rowIndex, label, value) {
5015
+ this.tableData[rowIndex][label] = value;
5016
+ this.tableData[rowIndex].name = value.replace(/\s+/g, '').toLowerCase();
5017
+ this.emitTableDataValue(this.tableData, this.tableAppendix);
5018
+ }
5019
+ updateNumber(item, label, value) {
5020
+ item.value[label] = value;
5021
+ this.emitTableDataValue(this.tableData, this.tableAppendix);
5022
+ }
5023
+ updateToggle(item, header, value) {
5024
+ let label = header['fieldName'];
5025
+ let toggleValue = header['toggleValue'];
5026
+ if (label == 'test1') {
5027
+ item.value[label][1] = value ? toggleValue[0] : toggleValue[1];
5028
+ }
5029
+ else {
5030
+ item.value[label] = value ? toggleValue[0] : toggleValue[1];
5031
+ }
5032
+ this.emitTableDataValue(this.tableData, this.tableAppendix);
5033
+ }
5034
+ updateDropDown(item, label, value) {
5035
+ item.value[label] = value.valueObj['Value__c'];
5036
+ this.emitTableDataValue(this.tableData, this.tableAppendix);
5037
+ }
5038
+ updateCheckText(item, label, value) {
5039
+ item.value[label][0] = value;
5040
+ this.emitTableDataValue(this.tableData, this.tableAppendix);
5041
+ }
5042
+ updateTableAppendix(item, label, value) {
5043
+ let toggleValue = item.value[0].toggleValue;
5044
+ if (item.key == 'dropDownData') {
5045
+ item.value[0].value[label] = value.valueObj['empIdName'];
5046
+ }
5047
+ else if (item.key == 'toggleData') {
5048
+ item.value[0].value[label] = value ? toggleValue[0] : toggleValue[1];
5049
+ }
5050
+ else {
5051
+ item.value[0].value[label] = value;
5052
+ }
5053
+ this.emitTableDataValue(this.tableData, this.tableAppendix);
5054
+ }
5055
+ emitTableDataValue(updatedTableData, tableAppendix) {
5056
+ const combinedData = {
5057
+ tableData: updatedTableData,
5058
+ tableAppendix: null
5059
+ };
5060
+ if (tableAppendix) {
5061
+ combinedData.tableAppendix = this.tableAppendix;
5062
+ }
5063
+ this.valueChange.emit(combinedData);
5064
+ }
5065
+ //This function finds the index of the current test in the list of test keys and returns the key of the previous test.
5066
+ // If the current test is the first one, it returns null, as there is no previous test
5067
+ getPreviousTestKey(item, currentTest) {
5068
+ const testKeys = Object.keys(item.value);
5069
+ const currentIndex = testKeys.indexOf(currentTest);
5070
+ if (currentIndex > 0) {
5071
+ return testKeys[currentIndex - 1];
5072
+ }
5073
+ return null;
5074
+ }
5075
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableAppendixComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
5076
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TableAppendixComponent, selector: "app-table-appendix", inputs: { question: "question" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<table class=\"table table-striped table-bordered\">\n <thead class=\"none-border\" *ngIf=\"tableInfo.tableType === 'lockout' && tableInfo.tableHeader\">\n <th></th>\n <th>{{ tableInfo.tableHeader }}</th>\n <th></th>\n </thead>\n <thead>\n <th *ngFor=\"let header of tableHeader; let hi = index\" [class]=\"'col-md-' + header.size\">\n {{ header.label }}\n </th>\n </thead>\n <tbody id=\"safetyMeasuresTableBody\">\n <tr *ngFor=\"let item of tableData; let i = index\">\n <td *ngFor=\"let header of tableHeader; let j = index\">\n <div *ngIf=\"header.type === 'text'\">\n <input type=\"text\" [(ngModel)]=\"item[header.fieldName]\" [placeholder]=\"header.placeholder\" (ngModelChange)=\"tableInfo.tableType != 'lockout' ? updateLabel(i, header.fieldName, item[header.fieldName]) : updateNumber(item, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('number')\">\n <!-- HA 19DEC23 For translation -->\n <input type=\"number\" [(ngModel)]=\"item.value[header.fieldName]\" [disabled]=\"item.value[getPreviousTestKey(item, header.fieldName)] === null && tableInfo.tableType != 'lockout'\" (ngModelChange)=\"updateNumber(item, header.fieldName, item.value[header.fieldName])\" placeholder=\"{{ 'enterValue' | i18n:i18nService.currentLanguage }}\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type === 'dropdown'\">\n <app-custom-dropdown [fromShengel]=\"true\" [options]=\"dropDownData\" \n [selectedValue]=\"item.value[header.fieldName]\" [placeholder]=\"header.placeholder\"\n (valueChange)=\"updateDropDown(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type === 'textcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <input type=\"text\" [(ngModel)]=\"item.value[header.fieldName][0]\" (ngModelChange)=\"updateCheckText(item, header.fieldName, item.value[header.fieldName][0])\" style=\"width: 85px; height: 27px; text-align: center; padding: 5px; border-bottom: none; border-top: 1px solid transparent; border-right: 1px solid transparent; border-left: 1px solid transparent; background: transparent;outline: none;\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName][1] == header.toggleValue[0]\"/>\n <span class=\"switch-label2\" data-on=\"Psi\" data-off=\"Bar\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n <div *ngIf=\"header.type === 'labelcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <!-- HA 19DEC23 For translation -->\n <span style=\"text-align:left;\">{{ 'calibrated' | i18n:i18nService.currentLanguage }}</span>\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName] == header.toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Yes\" data-off=\"No\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType === 'lockout'\">\n <td colspan=\"1\">\n <!-- HA 19DEC23 For translation -->\n <b style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">{{ 'addMore' | i18n:i18nService.currentLanguage }} +</b>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType != 'lockout'\">\n <td colspan=\"3\">\n <!-- HA 19DEC23 For translation -->\n <b>{{ 'addMore' | i18n:i18nService.currentLanguage }}</b>\n </td>\n <td colspan=\"2\" style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">\n +\n </td>\n </tr>\n <tr *ngFor=\"let item of tableAppendix | keyvalue; let k = index\">\n <td *ngFor=\"let header of tableHeader; let l = index\">\n <div *ngIf=\"header.type === 'text'\" >\n <input type=\"text\" [(ngModel)]=\"item.value[0][header.fieldName]\" (ngModelChange)=\"updateLabel(k, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('dropdown') && item.key == 'dropDownData'\" >\n <!-- HA 19DEC23 For translation -->\n <app-custom-dropdown [fromShengel]=\"true\" [apiMeta]=\"dropDownApi\" \n [selectedValue]=\"item.value[0].value[header.fieldName]\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n (valueChange)=\"updateTableAppendix(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type.includes('datetime') && item.key == 'dateData'\">\n <input [(ngModel)]=\"item.value[0].value[header.fieldName]\" type=\"datetime-local\"\n (ngModelChange)=\"updateTableAppendix(item,header.fieldName,$event)\"\n placeholder=\"DD/MM/YYYY HH:MM\">\n </div>\n <div *ngIf=\"header.type.includes('checkbox') && item.key == 'toggleData'\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateTableAppendix(item,header.fieldName,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[0].value[header.fieldName] == item.value[0].toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Safe\" data-off=\"Unsafe\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n <div *ngIf=\"header.type.includes('file') && item.key == 'fileData'\">\n <app-file-upload [limitFileUploading]=\"2\" [allFiles]=\"item.value[0].value[header.fieldName]\" [tableFile]=\"true\"\n (selectedFileData)=\"updateTableAppendix(item ,header.fieldName, $event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n </td>\n </tr>\n </tbody>\n </table>", styles: [".table{width:100%;max-width:100%;margin-bottom:20px;border-collapse:collapse;border-spacing:0}.table-bordered{border:1px solid #ddd}thead{background-color:#03a9f4}thead th{color:#fff;font-size:14px}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}th{text-align:left}thead .permission{text-align:center}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}tbody{color:#797979}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}.permission_yes,.permission_no,.permission_na{text-align:center}.none-border th{border:none}.switch2{position:relative;width:73px;height:23.5px;margin-left:5px;margin-top:3px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF 25px);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF 25px);border-radius:5px;box-shadow:inset 0 -1px #fff,inset 0 1px 1px #0000000d;cursor:pointer}.switch-input2{position:absolute;top:0;left:0;opacity:0}.switch-label2{position:relative;display:block;height:inherit;font-size:12px;background:rgba(175,172,172,.5);color:#000;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label3{position:relative;display:block;height:inherit;font-size:12px;background:red;color:#fff;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label2:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label3:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label2:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label3:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label2:after{content:attr(data-on);left:11px;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-label3:after{content:attr(data-on);left:11px;margin-left:10px;vertical-align:sub;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-input2:checked~.switch-label2{background:#03a9f4;border-color:#03a9f4;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label3{background:rgb(2,173,2);border-color:#02ad02;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label2:before{opacity:0}.switch-input2:checked~.switch-label3:before{opacity:0}.switch-input2:checked~.switch-label2:after{opacity:1;margin-right:15px}.switch-input2:checked~.switch-label3:after{opacity:1;margin-right:15px}.switch-handle2{position:absolute;top:2px;left:2px;width:18px;height:18px;background:linear-gradient(to bottom,#FFFFFF 40%,#f0f0f0);background-image:-webkit-linear-gradient(top,#FFFFFF 40%,#f0f0f0);border-radius:20%;box-shadow:1px 1px 5px #0003}.switch-handle2:before{content:\"\";position:absolute;top:50%;left:50%;margin:-6px 0 0 -6px;width:12px;height:12px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF);border-radius:6px;box-shadow:inset 0 1px #00000005}.switch-input2:checked~.switch-handle2{left:51px;box-shadow:-1px 1px 5px #0003}.switch-label2,.switch-handle2,.switch-label3{transition:All .3s ease;-webkit-transition:All .3s ease;-moz-transition:All .3s ease;-o-transition:All .3s ease}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CustomDropdownComponent, selector: "app-custom-dropdown", inputs: ["options", "placeholder", "apiMeta", "selectedValue", "progressBar", "id", "readOnly", "errorMessage", "error", "fromShengel", "referenceField", "token"], outputs: ["valueChange"] }, { kind: "component", type: FileUploadComponent, selector: "app-file-upload", inputs: ["allFiles", "limitFileUploading", "isDeleteFileButtonVisible", "isShowNoFileIcon", "tableFile", "question", "error"], outputs: ["selectedFileData", "deletedFileData"] }, { kind: "pipe", type: i2.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
5077
+ }
5078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableAppendixComponent, decorators: [{
5079
+ type: Component,
5080
+ args: [{ selector: 'app-table-appendix', template: "<table class=\"table table-striped table-bordered\">\n <thead class=\"none-border\" *ngIf=\"tableInfo.tableType === 'lockout' && tableInfo.tableHeader\">\n <th></th>\n <th>{{ tableInfo.tableHeader }}</th>\n <th></th>\n </thead>\n <thead>\n <th *ngFor=\"let header of tableHeader; let hi = index\" [class]=\"'col-md-' + header.size\">\n {{ header.label }}\n </th>\n </thead>\n <tbody id=\"safetyMeasuresTableBody\">\n <tr *ngFor=\"let item of tableData; let i = index\">\n <td *ngFor=\"let header of tableHeader; let j = index\">\n <div *ngIf=\"header.type === 'text'\">\n <input type=\"text\" [(ngModel)]=\"item[header.fieldName]\" [placeholder]=\"header.placeholder\" (ngModelChange)=\"tableInfo.tableType != 'lockout' ? updateLabel(i, header.fieldName, item[header.fieldName]) : updateNumber(item, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('number')\">\n <!-- HA 19DEC23 For translation -->\n <input type=\"number\" [(ngModel)]=\"item.value[header.fieldName]\" [disabled]=\"item.value[getPreviousTestKey(item, header.fieldName)] === null && tableInfo.tableType != 'lockout'\" (ngModelChange)=\"updateNumber(item, header.fieldName, item.value[header.fieldName])\" placeholder=\"{{ 'enterValue' | i18n:i18nService.currentLanguage }}\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type === 'dropdown'\">\n <app-custom-dropdown [fromShengel]=\"true\" [options]=\"dropDownData\" \n [selectedValue]=\"item.value[header.fieldName]\" [placeholder]=\"header.placeholder\"\n (valueChange)=\"updateDropDown(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type === 'textcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <input type=\"text\" [(ngModel)]=\"item.value[header.fieldName][0]\" (ngModelChange)=\"updateCheckText(item, header.fieldName, item.value[header.fieldName][0])\" style=\"width: 85px; height: 27px; text-align: center; padding: 5px; border-bottom: none; border-top: 1px solid transparent; border-right: 1px solid transparent; border-left: 1px solid transparent; background: transparent;outline: none;\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName][1] == header.toggleValue[0]\"/>\n <span class=\"switch-label2\" data-on=\"Psi\" data-off=\"Bar\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n <div *ngIf=\"header.type === 'labelcheckbox'\">\n <div style=\"display: flex; justify-content: center;align-items: center;\">\n <!-- HA 19DEC23 For translation -->\n <span style=\"text-align:left;\">{{ 'calibrated' | i18n:i18nService.currentLanguage }}</span>\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateToggle(item,header,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[header.fieldName] == header.toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Yes\" data-off=\"No\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n </div>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType === 'lockout'\">\n <td colspan=\"1\">\n <!-- HA 19DEC23 For translation -->\n <b style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">{{ 'addMore' | i18n:i18nService.currentLanguage }} +</b>\n </td>\n </tr>\n <tr *ngIf=\"tableInfo.addRow && tableInfo.tableType != 'lockout'\">\n <td colspan=\"3\">\n <!-- HA 19DEC23 For translation -->\n <b>{{ 'addMore' | i18n:i18nService.currentLanguage }}</b>\n </td>\n <td colspan=\"2\" style=\"text-align: center; cursor: pointer;\" id=\"addSafety\" (click)=\"addRow()\">\n +\n </td>\n </tr>\n <tr *ngFor=\"let item of tableAppendix | keyvalue; let k = index\">\n <td *ngFor=\"let header of tableHeader; let l = index\">\n <div *ngIf=\"header.type === 'text'\" >\n <input type=\"text\" [(ngModel)]=\"item.value[0][header.fieldName]\" (ngModelChange)=\"updateLabel(k, header.fieldName, item[header.fieldName])\" class=\"she-line-input table-input\">\n </div>\n <div *ngIf=\"header.type.includes('dropdown') && item.key == 'dropDownData'\" >\n <!-- HA 19DEC23 For translation -->\n <app-custom-dropdown [fromShengel]=\"true\" [apiMeta]=\"dropDownApi\" \n [selectedValue]=\"item.value[0].value[header.fieldName]\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n (valueChange)=\"updateTableAppendix(item,header.fieldName,$event)\">\n </app-custom-dropdown>\n </div>\n <div *ngIf=\"header.type.includes('datetime') && item.key == 'dateData'\">\n <input [(ngModel)]=\"item.value[0].value[header.fieldName]\" type=\"datetime-local\"\n (ngModelChange)=\"updateTableAppendix(item,header.fieldName,$event)\"\n placeholder=\"DD/MM/YYYY HH:MM\">\n </div>\n <div *ngIf=\"header.type.includes('checkbox') && item.key == 'toggleData'\">\n <label class=\"switch2\">\n <input class=\"switch-input2\" (change)=\"updateTableAppendix(item,header.fieldName,$event.target.checked)\" \n type=\"checkbox\"\n [checked]=\"item.value[0].value[header.fieldName] == item.value[0].toggleValue[0]\"/>\n <span class=\"switch-label3\" data-on=\"Safe\" data-off=\"Unsafe\"></span> \n <span class=\"switch-handle2\"></span> \n </label> \n </div>\n <div *ngIf=\"header.type.includes('file') && item.key == 'fileData'\">\n <app-file-upload [limitFileUploading]=\"2\" [allFiles]=\"item.value[0].value[header.fieldName]\" [tableFile]=\"true\"\n (selectedFileData)=\"updateTableAppendix(item ,header.fieldName, $event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n </td>\n </tr>\n </tbody>\n </table>", styles: [".table{width:100%;max-width:100%;margin-bottom:20px;border-collapse:collapse;border-spacing:0}.table-bordered{border:1px solid #ddd}thead{background-color:#03a9f4}thead th{color:#fff;font-size:14px}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}th{text-align:left}thead .permission{text-align:center}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}tbody{color:#797979}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}tbody td{font-size:13px}.permission_yes,.permission_no,.permission_na{text-align:center}.none-border th{border:none}.switch2{position:relative;width:73px;height:23.5px;margin-left:5px;margin-top:3px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF 25px);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF 25px);border-radius:5px;box-shadow:inset 0 -1px #fff,inset 0 1px 1px #0000000d;cursor:pointer}.switch-input2{position:absolute;top:0;left:0;opacity:0}.switch-label2{position:relative;display:block;height:inherit;font-size:12px;background:rgba(175,172,172,.5);color:#000;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label3{position:relative;display:block;height:inherit;font-size:12px;background:red;color:#fff;border-radius:inherit;box-shadow:inset 0 1px 2px #0000001f,inset 0 0 2px #00000026}.switch-label2:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label3:before,.switch-label2:after{position:absolute;top:50%;margin-top:-.5em;line-height:1;transition:inherit}.switch-label2:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label3:before{content:attr(data-off);right:11px;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label2:after{content:attr(data-on);left:11px;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-label3:after{content:attr(data-on);left:11px;margin-left:10px;vertical-align:sub;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-input2:checked~.switch-label2{background:#03a9f4;border-color:#03a9f4;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label3{background:rgb(2,173,2);border-color:#02ad02;box-shadow:inset 0 1px 2px #00000026,inset 0 0 3px #0003}.switch-input2:checked~.switch-label2:before{opacity:0}.switch-input2:checked~.switch-label3:before{opacity:0}.switch-input2:checked~.switch-label2:after{opacity:1;margin-right:15px}.switch-input2:checked~.switch-label3:after{opacity:1;margin-right:15px}.switch-handle2{position:absolute;top:2px;left:2px;width:18px;height:18px;background:linear-gradient(to bottom,#FFFFFF 40%,#f0f0f0);background-image:-webkit-linear-gradient(top,#FFFFFF 40%,#f0f0f0);border-radius:20%;box-shadow:1px 1px 5px #0003}.switch-handle2:before{content:\"\";position:absolute;top:50%;left:50%;margin:-6px 0 0 -6px;width:12px;height:12px;background:linear-gradient(to bottom,#eeeeee,#FFFFFF);background-image:-webkit-linear-gradient(top,#eeeeee,#FFFFFF);border-radius:6px;box-shadow:inset 0 1px #00000005}.switch-input2:checked~.switch-handle2{left:51px;box-shadow:-1px 1px 5px #0003}.switch-label2,.switch-handle2,.switch-label3{transition:All .3s ease;-webkit-transition:All .3s ease;-moz-transition:All .3s ease;-o-transition:All .3s ease}\n"] }]
5081
+ }], ctorParameters: function () { return [{ type: I18nService }]; }, propDecorators: { question: [{
5082
+ type: Input
5083
+ }], valueChange: [{
5084
+ type: Output
5085
+ }] } });
5086
+
5087
+ class CustomDateComponent {
5088
+ i18nService;
5089
+ date;
5090
+ readOnly = false; // VD 12Jun24 - readonly change
5091
+ error;
5092
+ errorMessage;
5093
+ dateChange = new EventEmitter();
5094
+ dateSelected;
5095
+ constructor(i18nService) {
5096
+ this.i18nService = i18nService;
5097
+ }
5098
+ ngOnInit() {
5099
+ this.dateSelected = new Date(this.date);
5100
+ }
5101
+ // VD 02Aug24 - clear input changes
5102
+ ngOnChanges(simplechanges) {
5103
+ if (simplechanges['date']) {
5104
+ this.dateSelected = new Date(this.date);
5105
+ }
5106
+ }
5107
+ onDateChange(event) {
5108
+ this.dateChange.emit(event);
5109
+ }
5110
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomDateComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
5111
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomDateComponent, selector: "app-custom-date", inputs: { date: "date", readOnly: "readOnly", error: "error", errorMessage: "errorMessage" }, outputs: { dateChange: "dateChange" }, usesOnChanges: true, ngImport: i0, template: "<!-- date component -->\n<!-- VD 12Jun24 - readonly change-->\n<!-- VD 01Aug24 - validation change-->\n<p>\n <input\n [class]=\"error ? 'invalid' : ''\"\n [(ngModel)]=\"dateSelected\"\n [owlDateTimeTrigger]=\"dt1\"\n [owlDateTime]=\"dt1\"\n [disabled]=\"readOnly\"\n placeholder=\"DD/MM/YYYY\"\n (input)=\"onDateChange($event)\"\n style=\"width: 100%; height: 35px; border: none; box-shadow: none; border-bottom: 1px solid #ccc;\"\n (dateTimeChange)=\"onDateChange($event)\"\n >\n <owl-date-time [pickerType]=\"'calendar'\" #dt1></owl-date-time>\n </p>\n <span *ngIf=\"error\" class=\"error-msg\">{{errorMessage}}</span>", styles: [".invalid{border-color:red!important}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.OwlDateTimeTriggerDirective, selector: "[owlDateTimeTrigger]", inputs: ["disabled", "owlDateTimeTrigger"] }, { kind: "directive", type: i4$1.OwlDateTimeInputDirective, selector: "input[owlDateTime]", inputs: ["rangeSeparator", "owlDateTime", "owlDateTimeFilter", "min", "max", "selectMode", "value", "values", "_disabled"], outputs: ["dateTimeChange", "dateTimeInput"], exportAs: ["owlDateTimeInput"] }, { kind: "component", type: i4$1.OwlDateTimeComponent, selector: "owl-date-time", inputs: ["startAt", "pickerType", "pickerMode", "disabled", "opened", "backdropClass", "panelClass", "scrollStrategy"], outputs: ["afterPickerClosed", "afterPickerOpen", "yearSelected", "monthSelected"], exportAs: ["owlDateTime"] }] });
5112
+ }
5113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomDateComponent, decorators: [{
5114
+ type: Component,
5115
+ args: [{ selector: 'app-custom-date', template: "<!-- date component -->\n<!-- VD 12Jun24 - readonly change-->\n<!-- VD 01Aug24 - validation change-->\n<p>\n <input\n [class]=\"error ? 'invalid' : ''\"\n [(ngModel)]=\"dateSelected\"\n [owlDateTimeTrigger]=\"dt1\"\n [owlDateTime]=\"dt1\"\n [disabled]=\"readOnly\"\n placeholder=\"DD/MM/YYYY\"\n (input)=\"onDateChange($event)\"\n style=\"width: 100%; height: 35px; border: none; box-shadow: none; border-bottom: 1px solid #ccc;\"\n (dateTimeChange)=\"onDateChange($event)\"\n >\n <owl-date-time [pickerType]=\"'calendar'\" #dt1></owl-date-time>\n </p>\n <span *ngIf=\"error\" class=\"error-msg\">{{errorMessage}}</span>", styles: [".invalid{border-color:red!important}\n"] }]
5116
+ }], ctorParameters: function () { return [{ type: I18nService }]; }, propDecorators: { date: [{
5117
+ type: Input
5118
+ }], readOnly: [{
5119
+ type: Input
5120
+ }], error: [{
5121
+ type: Input
5122
+ }], errorMessage: [{
5123
+ type: Input
5124
+ }], dateChange: [{
5125
+ type: Output
5126
+ }] } });
5127
+
5128
+ class CustomTimeComponent {
5129
+ i18nService;
5130
+ time;
5131
+ readOnly = false; // VD 12Jun24 - readonly change
5132
+ error;
5133
+ errorMessage;
5134
+ timeChange = new EventEmitter();
5135
+ timeSelected;
5136
+ constructor(i18nService) {
5137
+ this.i18nService = i18nService;
5138
+ }
5139
+ ngOnInit() {
5140
+ if (this.time) {
5141
+ this.time = this.time['value'] ? this.time['value'] : this.time;
5142
+ this.timeSelected = new Date(this.time);
4806
5143
  }
4807
5144
  else {
4808
5145
  // if no time set null value
@@ -5024,6 +5361,7 @@ class QuestionbookComponent {
5024
5361
  changeService;
5025
5362
  storageService;
5026
5363
  i18nService;
5364
+ cdr;
5027
5365
  document;
5028
5366
  qbItem;
5029
5367
  questionItem;
@@ -5035,8 +5373,10 @@ class QuestionbookComponent {
5035
5373
  handleDropDown = new EventEmitter();
5036
5374
  handleQuestion = new EventEmitter(); // VD 19Jul01 - get updated question
5037
5375
  dropDownData;
5376
+ dynamicHost;
5038
5377
  subQuestions;
5039
5378
  selectedFileData = [];
5379
+ loadComponent$ = new BehaviorSubject(false);
5040
5380
  // HA 28DEC23 Added styling and logics to load the book type questions
5041
5381
  qbRef;
5042
5382
  // HA 19DEC23 Declaration for Salesforce Styling
@@ -5048,12 +5388,13 @@ class QuestionbookComponent {
5048
5388
  // VD 06Sep24 calendar changes
5049
5389
  handleCalendarDate = new EventEmitter();
5050
5390
  bookQuestionsMap = new Map();
5051
- constructor(sfService, dataService, changeService, storageService, i18nService, document) {
5391
+ constructor(sfService, dataService, changeService, storageService, i18nService, cdr, document) {
5052
5392
  this.sfService = sfService;
5053
5393
  this.dataService = dataService;
5054
5394
  this.changeService = changeService;
5055
5395
  this.storageService = storageService;
5056
5396
  this.i18nService = i18nService;
5397
+ this.cdr = cdr;
5057
5398
  this.document = document;
5058
5399
  }
5059
5400
  ngOnInit() {
@@ -5182,6 +5523,10 @@ class QuestionbookComponent {
5182
5523
  });
5183
5524
  this.storageService.update(element);
5184
5525
  }
5526
+ // VD 06-09-24 to call the calendar component
5527
+ if (element.Type__c === 'Calendar') {
5528
+ this.openCalendarComponent(element);
5529
+ }
5185
5530
  });
5186
5531
  this.subQuestions = [];
5187
5532
  this.setSubQuestions(this.questions);
@@ -5237,55 +5582,51 @@ class QuestionbookComponent {
5237
5582
  // console.log('inside QuestionbookComponent childEventCapture');
5238
5583
  console.log(event);
5239
5584
  this.changeService.announceChange(event);
5240
- // Process the changes in Table and Dropdown and store right value in ques.input
5241
- if (ques.Type__c == 'Dropdown' || ques.Type__c == 'Radio') {
5242
- // HA 19JAN24 Correction of dropdown values
5243
- ques.selectedObj = event.valueObj ? event.valueObj : null;
5244
- ques.input = event.selectedObj ? event.selectedObj : event.valueObj;
5245
- ques.selectedValue = event.valueObj ? event.valueObj : null;
5246
- // emit the dropdown data to parent
5247
- dropdownData['event'] = event.valueObj;
5248
- dropdownData['ques'] = ques;
5249
- if (dropdownData['event']) {
5250
- this.handleDropDown.emit(dropdownData);
5251
- } // VD 21DEC23 - dependent field change
5252
- }
5253
- else if (ques.Type__c == 'Location') {
5254
- ques.input = event.valueObj;
5255
- ques.selectedValue = event.valueObj.address;
5256
- }
5257
- else if (ques.Type__c == 'File') {
5258
- ques.input = this.selectedFileData = event;
5259
- }
5260
- else if (ques.Type__c == 'Date' || ques.Type__c == 'DateTime') { // HA 24JAN24 Converting Date and DateTime to UTC
5261
- if (event.value) {
5262
- let d = new Date(event.value);
5263
- let utcString = d.toISOString();
5264
- ques.input = utcString;
5585
+ if (ques) {
5586
+ if (ques.Type__c == 'Dropdown' || ques.Type__c == 'Radio') {
5587
+ // HA 19JAN24 Correction of dropdown values
5588
+ ques.selectedObj = event.valueObj ? event.valueObj : null;
5589
+ ques.input = event.selectedObj ? event.selectedObj : event.valueObj;
5590
+ ques.selectedValue = event.valueObj ? event.valueObj : null;
5591
+ // emit the dropdown data to parent
5592
+ dropdownData['event'] = event.valueObj;
5593
+ dropdownData['ques'] = ques;
5594
+ if (dropdownData['event']) {
5595
+ this.handleDropDown.emit(dropdownData);
5596
+ } // VD 21DEC23 - dependent field change
5597
+ }
5598
+ else if (ques.Type__c == 'Location') {
5599
+ ques.input = event.valueObj;
5600
+ ques.selectedValue = event.valueObj.address;
5601
+ }
5602
+ else if (ques.Type__c == 'File') {
5603
+ ques.input = this.selectedFileData = event;
5604
+ }
5605
+ else if (ques.Type__c == 'Date' || ques.Type__c == 'DateTime') { // HA 24JAN24 Converting Date and DateTime to UTC
5606
+ if (event.value) {
5607
+ let d = new Date(event.value);
5608
+ let utcString = d.toISOString();
5609
+ ques.input = utcString;
5610
+ }
5611
+ else {
5612
+ ques.input = '';
5613
+ }
5614
+ }
5615
+ else if (ques.Type__c == 'List') {
5616
+ // VD 20Aug24 handling the list type handle multiple object values
5617
+ ques.input = this.dataService.getValue(event.valueObj, event.field);
5265
5618
  }
5266
5619
  else {
5267
- ques.input = '';
5620
+ ques.input = event;
5268
5621
  }
5622
+ // validating error message
5623
+ const hasError = ques.Error_Message__c && ((ques.Type__c === 'File' && ques.input.length == 0) || (ques.Type__c != 'File' && !ques.input));
5624
+ ques.error = hasError ? new ErrorWrapper() : null;
5625
+ // Once the right value is stored in ques.input store the ques (with input) in storageService
5626
+ this.storageService.update(ques);
5627
+ // VD 19Jul01 - get updated question
5628
+ this.handleQuestion.emit(ques);
5269
5629
  }
5270
- else if (ques.Type__c == 'List') {
5271
- // VD 20Aug24 handling the list type handle multiple object values
5272
- ques.input = this.dataService.getValue(event.valueObj, event.field);
5273
- }
5274
- else {
5275
- ques.input = event;
5276
- }
5277
- // validating error message
5278
- const hasError = ques.Error_Message__c && ((ques.Type__c === 'File' && ques.input.length == 0) || (ques.Type__c != 'File' && !ques.input));
5279
- ques.error = hasError ? new ErrorWrapper() : null;
5280
- // if(ques.Is_Optional__c && !ques.input){
5281
- // ques.error = new ErrorWrapper
5282
- // }else{
5283
- // ques.error = null;
5284
- // }
5285
- // Once the right value is stored in ques.input store the ques (with input) in storageService
5286
- this.storageService.update(ques);
5287
- // VD 19Jul01 - get updated question
5288
- this.handleQuestion.emit(ques);
5289
5630
  }
5290
5631
  deleteFile(fileData) {
5291
5632
  console.log('fileDATA', fileData);
@@ -5303,13 +5644,23 @@ class QuestionbookComponent {
5303
5644
  let updatedText = questionText?.replace(/<[^>]*>/g, '');
5304
5645
  return updatedText;
5305
5646
  }
5306
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: QuestionbookComponent, deps: [{ token: SalesforceService }, { token: DataService }, { token: ChangeService }, { token: StorageService }, { token: I18nService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
5307
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: QuestionbookComponent, selector: "lib-questionbook", inputs: { qbItem: "qbItem", questionItem: "questionItem", translatedQuestions: "translatedQuestions", questions: "questions", errorFieldId: "errorFieldId", labelValue: "labelValue", token: "token", dropDownData: "dropDownData" }, outputs: { handleDropDown: "handleDropDown", handleQuestion: "handleQuestion", hadleDropDownDependent: "hadleDropDownDependent", handleCalendarDate: "handleCalendarDate" }, ngImport: i0, template: "<!-- HA 20DEC23 Book Style from salesforce -->\n<!-- HA 28DEC23 Removed IsShengel(removal of shengel values applies for this reason) and direct styling of books to avoid styling issues-->\n<!-- HA 18JAN24 Added class for styling -->\n<div [style]=\"bookStyle\" class=\"content-box form-group\">\n <div class=\"form-row\">\n <!-- HA 20DEC23 Directive and Question Style from salesforce -->\n <div\n [class]=\"'col-lg-' + ques.Size__c + ' paddingnone'\"\n *ngFor=\"let ques of questions;let i = index\" [id]=\"ques.Id\" [dir]=\"ques.langDirection\" [style]=\"ques?.Style__c?.questionStyle\">\n <!-- Sub Question Label -->\n <!-- HA 20DEC23 Label Style from salesforce -->\n <!-- VD 09May24 is hide field change-->\n <div *ngIf=\"!ques.Is_Hide__c\">\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n\n </div>\n <!-- VD 20JUN24 - help text changes-->\n <!-- VD 01Aug24 - validation change-->\n <!-- // VD 02Aug24 - label value style-->\n <div [ngClass]=\"{ down2: qbItem?.Progress_Bar__c }\" *ngIf=\"ques.Style__c?.showLabel ? ques.Style__c?.showLabel : true\" [style]=\"ques.Style__c?.labelStyle\">\n <span [class]=\"'dis-flex shengel-myt-font3 myt-font7 '\" [style]=\"ques.Style__c?.labelValueStyle\">{{ removeCharacters(ques?.Question_Text__c) }} \n <div *ngIf=\"ques.Is_Optional__c\" style=\"color: red;\">*</div>\n <div *ngIf=\"ques.Question_Text__c && ques?.Help_Text__c\" class=\"icon\" [matTooltip]=\"ques?.Help_Text__c\">i</div></span>\n </div>\n <!-- // VD 12Jun24 - readonly change-->\n <!-- DateTime -->\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n <app-custom-date-picker [minDate]=\"ques.minDate\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" [date]=\"ques.input\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date-picker>\n </div>\n\n <!-- Date-->\n <div *ngIf=\"ques.Type__c === 'Date'\">\n <app-custom-date [date]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date>\n </div>\n\n <!-- Time-->\n <div *ngIf=\"ques.Type__c === 'Time'\">\n <app-custom-time [time]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (timeChange)=\"childEventCapture($event, ques)\">\n </app-custom-time>\n </div>\n <!-- calendar -->\n <div *ngIf=\"ques.Type__c === 'Calendar'\">\n <lib-custom-calendar [question]=\"ques\" (eventSelected)=\"childEventCapture($event, ques)\" (dateSelected)=\"getCurrentCalendar($event)\"></lib-custom-calendar>\n </div>\n\n <!-- Text -->\n <div *ngIf=\"ques.Type__c === 'Text' || ques.Type__c === 'Link'\" >\n <app-custom-input [value]=\"ques.input\" [ngClassValue]=\"{\n 'dis-flex dt-line date-line bookText boxoutline myt-font1': qbItem.Progress_Bar__c,\n textBox: !qbItem.Progress_Bar__c\n }\" [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [idValue]=\"ques.Tracking_ID__c\" [focusEvent]=\"clearSQError(ques.Id)\"\n [error]=\"ques.error\" [placeholder]=\"ques.Question__c\" (inputValue)=\"childEventCapture($event, ques)\">\n </app-custom-input>\n </div>\n \n <!-- for pick location -->\n <!-- VD 21DEC23 - dependent field change -->\n <div *ngIf=\"ques.Type__c === 'Location'\">\n <!-- HA10012024 Added Api key as input -->\n <app-pick-location [apiKey]=\"qbItem['Api_Key__c']\" [address]=\"ques.selectedValue\" [question]=\"ques\" (locationSelected)=\"childEventCapture($event, ques)\">\n </app-pick-location>\n </div>\n\n <!-- for text area -->\n <div *ngIf=\"ques.Type__c === 'TextArea'\">\n <app-custom-text-area [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [value]=\"ques.input\" [rows]=\"3\" [error]=\"ques.error\" [placeholder]=\"ques.Question__c \"\n (textareaValueChange)=\"childEventCapture($event, ques)\"></app-custom-text-area>\n </div>\n\n <!-- Email -->\n <div *ngIf=\"ques.Type__c === 'Email'\">\n <input type=\"email\" readOnly=\"ques.Read_Only__c\" [(ngModel)]=\"ques.input\" [id]=\"ques.Id\" required=\"\" (focus)=\"clearSQError(ques.Id)\"\n style.border-color=\"{{ ques.error ? 'red' : '' }}\" placeholder=\"{{ ques.Question__c }}\" />\n </div>\n\n <!-- Table -->\n <div *ngIf=\"ques.Type__c === 'Table'\" class=\"\">\n <app-custom-table [question]=\"ques\" [apiMeta]=\"ques.Sub_Text__c\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-table>\n </div>\n\n <!-- Table Appendix -->\n <div *ngIf=\"ques.Type__c === 'TableAppendix'\" class=\"\">\n <app-table-appendix [question]=\"ques\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-table-appendix>\n </div>\n <!-- list -->\n <!-- VD 20Aug24 used correct attribute -->\n <div *ngIf=\"ques.Type__c === 'List'\" class=\"\">\n <lib-search-box [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [placeHolderText]=\"ques.Question__c\" [filterName]=\"ques.input\" (searchValueChange)=\"childEventCapture($event, ques)\">\n </lib-search-box>\n </div>\n\n <!-- Dropdown -->\n <!-- HA 09FEB24 Added condition of sqOption to the dropdown -->\n <div *ngIf=\"ques.Type__c === 'Dropdown' && ques?.Question_Options__r?.records\" class=\"\">\n <!-- HA 20DEC23 For Translation --> <!-- VD 19JAN24 - getting token as input -->\n <app-custom-dropdown [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-dropdown>\n <i class=\"fa fa-check \" aria-hidden=\"true\" *ngIf=\"ques?.input?.length > 0\"></i>\n </div>\n <!-- // VD 02Aug24 custom-radio component -->\n <div *ngIf=\"ques.Type__c === 'Radio' && ques?.Question_Options__r?.records\" class=\"\">\n <app-custom-radio [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-radio>\n </div>\n\n <!-- Attachment / Files -->\n <div *ngIf=\"ques.Type__c === 'File'\" class=\"\">\n <app-file-upload [limitFileUploading]=\"5\" [error]=\"ques.error\" [question]=\"ques\" [allFiles]=\"ques.input\" [tableFile]=\"false\"\n (selectedFileData)=\"childEventCapture($event, ques)\" (deletedFileData)=\"deleteFile($event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n <div *ngIf=\"ques.Type__c === 'PopUpMessage'\" class=\"\">\n <app-dependent-table [alertMessage]=\"ques.Error_Message__c\">\n </app-dependent-table>\n </div>\n <div *ngIf=\"ques.Type__c === 'Label'\" class=\"\">\n <app-custom-label [labelStyle]=\"ques.Title__c\" [labelValue]=\"ques.Question__c\">\n </app-custom-label>\n </div>\n <!-- // VD 02Aug24 image component -->\n <div *ngIf=\"ques.Type__c === 'Image'\" class=\"\">\n <app-custom-image [question]=\"ques\">\n </app-custom-image>\n </div>\n <!-- 08NOV23 - button type question added -->\n <!-- Button -->\n <div *ngIf=\"ques.Type__c === 'Button'\" class=\"\">\n <app-custom-button [height]=\"'50px'\" \n [width]=\"'150px'\" \n [buttonText]=\"ques?.Question__c\"\n [value]=\"ques?.Question__c\"\n (buttonValue)=\"childEventCapture($event, ques)\"\n >\n </app-custom-button>\n </div>\n <!-- HA 20DEC23 This is to load book type questions-->\n <div *ngIf=\"ques.Type__c === 'Book'\">\n <!-- HA 09FEB24 Added ternary operator -->\n <lib-questionbook [qbItem]=\"ques.qbItem\" [labelValue]=\"labelValue\" [questions]=\"ques.qbItem?.Questions__r?.records\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </div>\n </div>", styles: [".col-lg-6{width:100%}.myt-font7{display:flex;justify-content:flex-start;align-items:center}.icon{display:inline-block;width:15px;height:15px;border-radius:50%;background-color:#08010177;color:#fff;text-align:center;line-height:16px;font-size:11px;font-family:Arial,sans-serif;font-weight:700;margin-left:5px}@media (min-width: 1200px){.col-lg-6{width:50%!important}.form-row{display:flex;flex-wrap:wrap}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i9$1.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "component", type: PickLocationComponent, selector: "app-pick-location", inputs: ["address", "question", "apiKey"], outputs: ["locationSelected"] }, { kind: "component", type: CustomInputComponent, selector: "app-custom-input", inputs: ["value", "question", "disabled", "placeholder", "error", "fromShengel", "readOnly", "ngClassValue", "idValue", "focusEvent"], outputs: ["inputValue"] }, { kind: "component", type: CustomTextAreaComponent, selector: "app-custom-text-area", inputs: ["value", "placeholder", "rows", "error", "question", "readOnly"], outputs: ["textareaValueChange"] }, { kind: "component", type: CustomTableComponent, selector: "app-custom-table", inputs: ["question", "apiMeta"], outputs: ["valueChange"] }, { kind: "component", type: CustomDatePickerComponent, selector: "app-custom-date-picker", inputs: ["date", "minDate", "maxDate", "error", "errorMessage", "readOnly"], outputs: ["dateChange"] }, { kind: "component", type: CustomDropdownComponent, selector: "app-custom-dropdown", inputs: ["options", "placeholder", "apiMeta", "selectedValue", "progressBar", "id", "readOnly", "errorMessage", "error", "fromShengel", "referenceField", "token"], outputs: ["valueChange"] }, { kind: "component", type: SearchBoxComponent, selector: "lib-search-box", inputs: ["placeHolderText", "question", "apiMeta", "id", "readOnly", "filterName"], outputs: ["searchValueChange"] }, { kind: "component", type: QuestionbookComponent, selector: "lib-questionbook", inputs: ["qbItem", "questionItem", "translatedQuestions", "questions", "errorFieldId", "labelValue", "token", "dropDownData"], outputs: ["handleDropDown", "handleQuestion", "hadleDropDownDependent", "handleCalendarDate"] }, { kind: "component", type: FileUploadComponent, selector: "app-file-upload", inputs: ["allFiles", "limitFileUploading", "isDeleteFileButtonVisible", "isShowNoFileIcon", "tableFile", "question", "error"], outputs: ["selectedFileData", "deletedFileData"] }, { kind: "component", type: DependentTableComponent, selector: "app-dependent-table", inputs: ["alertMessage"] }, { kind: "component", type: CustomLabelComponent, selector: "app-custom-label", inputs: ["labelValue", "labelStyle"] }, { kind: "component", type: TableAppendixComponent, selector: "app-table-appendix", inputs: ["question"], outputs: ["valueChange"] }, { kind: "component", type: CustomDateComponent, selector: "app-custom-date", inputs: ["date", "readOnly", "error", "errorMessage"], outputs: ["dateChange"] }, { kind: "component", type: CustomTimeComponent, selector: "app-custom-time", inputs: ["time", "readOnly", "error", "errorMessage"], outputs: ["timeChange"] }, { kind: "component", type: CustomButtonComponent, selector: "app-custom-button", inputs: ["height", "width", "textColor", "buttonText", "value", "backgroundColor"], outputs: ["buttonValue"] }, { kind: "component", type: CustomImageComponent, selector: "app-custom-image", inputs: ["alt", "src", "imageStyle", "question"] }, { kind: "component", type: CustomRadioComponent, selector: "app-custom-radio", inputs: ["options", "apiMeta", "selectedValue", "progressBar", "id", "readOnly", "errorMessage", "error", "fromShengel", "referenceField", "token"], outputs: ["valueChange"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
5647
+ openCalendarComponent(ques) {
5648
+ const viewContainerRef = this.dynamicHost.viewContainerRef;
5649
+ if (viewContainerRef) {
5650
+ viewContainerRef.clear();
5651
+ const componentRef = viewContainerRef.createComponent(CustomCalendarComponent);
5652
+ componentRef.instance.question = ques;
5653
+ componentRef.instance.eventSelected.subscribe((event) => this.childEventCapture(event));
5654
+ componentRef.instance.dateSelected.subscribe((event) => this.getCurrentCalendar(event));
5655
+ }
5656
+ }
5657
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: QuestionbookComponent, deps: [{ token: SalesforceService }, { token: DataService }, { token: ChangeService }, { token: StorageService }, { token: I18nService }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
5658
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: QuestionbookComponent, selector: "lib-questionbook", inputs: { qbItem: "qbItem", questionItem: "questionItem", translatedQuestions: "translatedQuestions", questions: "questions", errorFieldId: "errorFieldId", labelValue: "labelValue", token: "token", dropDownData: "dropDownData" }, outputs: { handleDropDown: "handleDropDown", handleQuestion: "handleQuestion", hadleDropDownDependent: "hadleDropDownDependent", handleCalendarDate: "handleCalendarDate" }, viewQueries: [{ propertyName: "dynamicHost", first: true, predicate: ComponenthostDirective, descendants: true, static: true }], ngImport: i0, template: "<!-- HA 20DEC23 Book Style from salesforce -->\n<!-- HA 28DEC23 Removed IsShengel(removal of shengel values applies for this reason) and direct styling of books to avoid styling issues-->\n<!-- HA 18JAN24 Added class for styling -->\n<div [style]=\"bookStyle\" class=\"content-box form-group\">\n <div class=\"form-row\">\n <!-- HA 20DEC23 Directive and Question Style from salesforce -->\n <div\n [class]=\"'col-lg-' + ques.Size__c + ' paddingnone'\"\n *ngFor=\"let ques of questions;let i = index\" [id]=\"ques.Id\" [dir]=\"ques.langDirection\" [style]=\"ques?.Style__c?.questionStyle\">\n <!-- Sub Question Label -->\n <!-- HA 20DEC23 Label Style from salesforce -->\n <!-- VD 09May24 is hide field change-->\n <div *ngIf=\"!ques.Is_Hide__c\">\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n\n </div>\n <!-- VD 20JUN24 - help text changes-->\n <!-- VD 01Aug24 - validation change-->\n <!-- // VD 02Aug24 - label value style-->\n <div [ngClass]=\"{ down2: qbItem?.Progress_Bar__c }\" *ngIf=\"ques.Style__c?.showLabel ? ques.Style__c?.showLabel : true\" [style]=\"ques.Style__c?.labelStyle\">\n <span [class]=\"'dis-flex shengel-myt-font3 myt-font7 '\" [style]=\"ques.Style__c?.labelValueStyle\">{{ removeCharacters(ques?.Question_Text__c) }} \n <div *ngIf=\"ques.Is_Optional__c\" style=\"color: red;\">*</div>\n <div *ngIf=\"ques.Question_Text__c && ques?.Help_Text__c\" class=\"icon\" [matTooltip]=\"ques?.Help_Text__c\">i</div></span>\n </div>\n <!-- // VD 12Jun24 - readonly change-->\n <!-- DateTime -->\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n <app-custom-date-picker [minDate]=\"ques.minDate\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" [date]=\"ques.input\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date-picker>\n </div>\n\n <!-- Date-->\n <div *ngIf=\"ques.Type__c === 'Date'\">\n <app-custom-date [date]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date>\n </div>\n\n <!-- Time-->\n <div *ngIf=\"ques.Type__c === 'Time'\">\n <app-custom-time [time]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (timeChange)=\"childEventCapture($event, ques)\">\n </app-custom-time>\n </div>\n <!-- calendar -->\n <div *ngIf=\"ques.Type__c === 'Calendar'\">\n <!-- <app-custom-calendar [question]=\"ques\" (eventSelected)=\"childEventCapture($event, ques)\" (dateSelected)=\"getCurrentCalendar($event)\"></app-custom-calendar> -->\n </div>\n <!-- Text -->\n <div *ngIf=\"ques.Type__c === 'Text' || ques.Type__c === 'Link'\" >\n <app-custom-input [value]=\"ques.input\" [ngClassValue]=\"{\n 'dis-flex dt-line date-line bookText boxoutline myt-font1': qbItem.Progress_Bar__c,\n textBox: !qbItem.Progress_Bar__c\n }\" [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [idValue]=\"ques.Tracking_ID__c\" [focusEvent]=\"clearSQError(ques.Id)\"\n [error]=\"ques.error\" [placeholder]=\"ques.Question__c\" (inputValue)=\"childEventCapture($event, ques)\">\n </app-custom-input>\n </div>\n \n <!-- for pick location -->\n <!-- VD 21DEC23 - dependent field change -->\n <div *ngIf=\"ques.Type__c === 'Location'\">\n <!-- HA10012024 Added Api key as input -->\n <app-pick-location [apiKey]=\"qbItem['Api_Key__c']\" [address]=\"ques.selectedValue\" [question]=\"ques\" (locationSelected)=\"childEventCapture($event, ques)\">\n </app-pick-location>\n </div>\n\n <!-- for text area -->\n <div *ngIf=\"ques.Type__c === 'TextArea'\">\n <app-custom-text-area [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [value]=\"ques.input\" [rows]=\"3\" [error]=\"ques.error\" [placeholder]=\"ques.Question__c \"\n (textareaValueChange)=\"childEventCapture($event, ques)\"></app-custom-text-area>\n </div>\n\n <!-- Email -->\n <div *ngIf=\"ques.Type__c === 'Email'\">\n <input type=\"email\" readOnly=\"ques.Read_Only__c\" [(ngModel)]=\"ques.input\" [id]=\"ques.Id\" required=\"\" (focus)=\"clearSQError(ques.Id)\"\n style.border-color=\"{{ ques.error ? 'red' : '' }}\" placeholder=\"{{ ques.Question__c }}\" />\n </div>\n\n <!-- Table -->\n <div *ngIf=\"ques.Type__c === 'Table'\" class=\"\">\n <app-custom-table [question]=\"ques\" [apiMeta]=\"ques.Sub_Text__c\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-table>\n </div>\n\n <!-- Table Appendix -->\n <div *ngIf=\"ques.Type__c === 'TableAppendix'\" class=\"\">\n <app-table-appendix [question]=\"ques\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-table-appendix>\n </div>\n <!-- list -->\n <!-- VD 20Aug24 used correct attribute -->\n <div *ngIf=\"ques.Type__c === 'List'\" class=\"\">\n <lib-search-box [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [placeHolderText]=\"ques.Question__c\" [filterName]=\"ques.input\" (searchValueChange)=\"childEventCapture($event, ques)\">\n </lib-search-box>\n </div>\n\n <!-- Dropdown -->\n <!-- HA 09FEB24 Added condition of sqOption to the dropdown -->\n <div *ngIf=\"ques.Type__c === 'Dropdown' && ques?.Question_Options__r?.records\" class=\"\">\n <!-- HA 20DEC23 For Translation --> <!-- VD 19JAN24 - getting token as input -->\n <app-custom-dropdown [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-dropdown>\n <i class=\"fa fa-check \" aria-hidden=\"true\" *ngIf=\"ques?.input?.length > 0\"></i>\n </div>\n <!-- // VD 02Aug24 custom-radio component -->\n <div *ngIf=\"ques.Type__c === 'Radio' && ques?.Question_Options__r?.records\" class=\"\">\n <app-custom-radio [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-radio>\n </div>\n\n <!-- Attachment / Files -->\n <div *ngIf=\"ques.Type__c === 'File'\" class=\"\">\n <app-file-upload [limitFileUploading]=\"5\" [error]=\"ques.error\" [question]=\"ques\" [allFiles]=\"ques.input\" [tableFile]=\"false\"\n (selectedFileData)=\"childEventCapture($event, ques)\" (deletedFileData)=\"deleteFile($event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n <div *ngIf=\"ques.Type__c === 'PopUpMessage'\" class=\"\">\n <app-dependent-table [alertMessage]=\"ques.Error_Message__c\">\n </app-dependent-table>\n </div>\n <div *ngIf=\"ques.Type__c === 'Label'\" class=\"\">\n <app-custom-label [labelStyle]=\"ques.Title__c\" [labelValue]=\"ques.Question__c\">\n </app-custom-label>\n </div>\n <!-- // VD 02Aug24 image component -->\n <div *ngIf=\"ques.Type__c === 'Image'\" class=\"\">\n <app-custom-image [question]=\"ques\">\n </app-custom-image>\n </div>\n <!-- 08NOV23 - button type question added -->\n <!-- Button -->\n <div *ngIf=\"ques.Type__c === 'Button'\" class=\"\">\n <app-custom-button [height]=\"'50px'\" \n [width]=\"'150px'\" \n [buttonText]=\"ques?.Question__c\"\n [value]=\"ques?.Question__c\"\n (buttonValue)=\"childEventCapture($event, ques)\"\n >\n </app-custom-button>\n </div>\n <!-- HA 20DEC23 This is to load book type questions-->\n <div *ngIf=\"ques.Type__c === 'Book'\">\n <!-- HA 09FEB24 Added ternary operator -->\n <lib-questionbook [qbItem]=\"ques.qbItem\" [labelValue]=\"labelValue\" [questions]=\"ques.qbItem?.Questions__r?.records\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 06-09-24 for calendar type-->\n<ng-template dynamicComponentHost></ng-template>", styles: [".col-lg-6{width:100%}.myt-font7{display:flex;justify-content:flex-start;align-items:center}.icon{display:inline-block;width:15px;height:15px;border-radius:50%;background-color:#08010177;color:#fff;text-align:center;line-height:16px;font-size:11px;font-family:Arial,sans-serif;font-weight:700;margin-left:5px}@media (min-width: 1200px){.col-lg-6{width:50%!important}.form-row{display:flex;flex-wrap:wrap}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ComponenthostDirective, selector: "[dynamicComponentHost]" }, { kind: "directive", type: i9$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i10.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "component", type: PickLocationComponent, selector: "app-pick-location", inputs: ["address", "question", "apiKey"], outputs: ["locationSelected"] }, { kind: "component", type: CustomInputComponent, selector: "app-custom-input", inputs: ["value", "question", "disabled", "placeholder", "error", "fromShengel", "readOnly", "ngClassValue", "idValue", "focusEvent"], outputs: ["inputValue"] }, { kind: "component", type: CustomTextAreaComponent, selector: "app-custom-text-area", inputs: ["value", "placeholder", "rows", "error", "question", "readOnly"], outputs: ["textareaValueChange"] }, { kind: "component", type: CustomTableComponent, selector: "app-custom-table", inputs: ["question", "apiMeta"], outputs: ["valueChange"] }, { kind: "component", type: CustomDatePickerComponent, selector: "app-custom-date-picker", inputs: ["date", "minDate", "maxDate", "error", "errorMessage", "readOnly"], outputs: ["dateChange"] }, { kind: "component", type: CustomDropdownComponent, selector: "app-custom-dropdown", inputs: ["options", "placeholder", "apiMeta", "selectedValue", "progressBar", "id", "readOnly", "errorMessage", "error", "fromShengel", "referenceField", "token"], outputs: ["valueChange"] }, { kind: "component", type: SearchBoxComponent, selector: "lib-search-box", inputs: ["placeHolderText", "question", "apiMeta", "id", "readOnly", "filterName"], outputs: ["searchValueChange"] }, { kind: "component", type: QuestionbookComponent, selector: "lib-questionbook", inputs: ["qbItem", "questionItem", "translatedQuestions", "questions", "errorFieldId", "labelValue", "token", "dropDownData"], outputs: ["handleDropDown", "handleQuestion", "hadleDropDownDependent", "handleCalendarDate"] }, { kind: "component", type: FileUploadComponent, selector: "app-file-upload", inputs: ["allFiles", "limitFileUploading", "isDeleteFileButtonVisible", "isShowNoFileIcon", "tableFile", "question", "error"], outputs: ["selectedFileData", "deletedFileData"] }, { kind: "component", type: DependentTableComponent, selector: "app-dependent-table", inputs: ["alertMessage"] }, { kind: "component", type: CustomLabelComponent, selector: "app-custom-label", inputs: ["labelValue", "labelStyle"] }, { kind: "component", type: TableAppendixComponent, selector: "app-table-appendix", inputs: ["question"], outputs: ["valueChange"] }, { kind: "component", type: CustomDateComponent, selector: "app-custom-date", inputs: ["date", "readOnly", "error", "errorMessage"], outputs: ["dateChange"] }, { kind: "component", type: CustomTimeComponent, selector: "app-custom-time", inputs: ["time", "readOnly", "error", "errorMessage"], outputs: ["timeChange"] }, { kind: "component", type: CustomButtonComponent, selector: "app-custom-button", inputs: ["height", "width", "textColor", "buttonText", "value", "backgroundColor"], outputs: ["buttonValue"] }, { kind: "component", type: CustomImageComponent, selector: "app-custom-image", inputs: ["alt", "src", "imageStyle", "question"] }, { kind: "component", type: CustomRadioComponent, selector: "app-custom-radio", inputs: ["options", "apiMeta", "selectedValue", "progressBar", "id", "readOnly", "errorMessage", "error", "fromShengel", "referenceField", "token"], outputs: ["valueChange"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
5308
5659
  }
5309
5660
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: QuestionbookComponent, decorators: [{
5310
5661
  type: Component,
5311
- args: [{ selector: 'lib-questionbook', template: "<!-- HA 20DEC23 Book Style from salesforce -->\n<!-- HA 28DEC23 Removed IsShengel(removal of shengel values applies for this reason) and direct styling of books to avoid styling issues-->\n<!-- HA 18JAN24 Added class for styling -->\n<div [style]=\"bookStyle\" class=\"content-box form-group\">\n <div class=\"form-row\">\n <!-- HA 20DEC23 Directive and Question Style from salesforce -->\n <div\n [class]=\"'col-lg-' + ques.Size__c + ' paddingnone'\"\n *ngFor=\"let ques of questions;let i = index\" [id]=\"ques.Id\" [dir]=\"ques.langDirection\" [style]=\"ques?.Style__c?.questionStyle\">\n <!-- Sub Question Label -->\n <!-- HA 20DEC23 Label Style from salesforce -->\n <!-- VD 09May24 is hide field change-->\n <div *ngIf=\"!ques.Is_Hide__c\">\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n\n </div>\n <!-- VD 20JUN24 - help text changes-->\n <!-- VD 01Aug24 - validation change-->\n <!-- // VD 02Aug24 - label value style-->\n <div [ngClass]=\"{ down2: qbItem?.Progress_Bar__c }\" *ngIf=\"ques.Style__c?.showLabel ? ques.Style__c?.showLabel : true\" [style]=\"ques.Style__c?.labelStyle\">\n <span [class]=\"'dis-flex shengel-myt-font3 myt-font7 '\" [style]=\"ques.Style__c?.labelValueStyle\">{{ removeCharacters(ques?.Question_Text__c) }} \n <div *ngIf=\"ques.Is_Optional__c\" style=\"color: red;\">*</div>\n <div *ngIf=\"ques.Question_Text__c && ques?.Help_Text__c\" class=\"icon\" [matTooltip]=\"ques?.Help_Text__c\">i</div></span>\n </div>\n <!-- // VD 12Jun24 - readonly change-->\n <!-- DateTime -->\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n <app-custom-date-picker [minDate]=\"ques.minDate\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" [date]=\"ques.input\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date-picker>\n </div>\n\n <!-- Date-->\n <div *ngIf=\"ques.Type__c === 'Date'\">\n <app-custom-date [date]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date>\n </div>\n\n <!-- Time-->\n <div *ngIf=\"ques.Type__c === 'Time'\">\n <app-custom-time [time]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (timeChange)=\"childEventCapture($event, ques)\">\n </app-custom-time>\n </div>\n <!-- calendar -->\n <div *ngIf=\"ques.Type__c === 'Calendar'\">\n <lib-custom-calendar [question]=\"ques\" (eventSelected)=\"childEventCapture($event, ques)\" (dateSelected)=\"getCurrentCalendar($event)\"></lib-custom-calendar>\n </div>\n\n <!-- Text -->\n <div *ngIf=\"ques.Type__c === 'Text' || ques.Type__c === 'Link'\" >\n <app-custom-input [value]=\"ques.input\" [ngClassValue]=\"{\n 'dis-flex dt-line date-line bookText boxoutline myt-font1': qbItem.Progress_Bar__c,\n textBox: !qbItem.Progress_Bar__c\n }\" [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [idValue]=\"ques.Tracking_ID__c\" [focusEvent]=\"clearSQError(ques.Id)\"\n [error]=\"ques.error\" [placeholder]=\"ques.Question__c\" (inputValue)=\"childEventCapture($event, ques)\">\n </app-custom-input>\n </div>\n \n <!-- for pick location -->\n <!-- VD 21DEC23 - dependent field change -->\n <div *ngIf=\"ques.Type__c === 'Location'\">\n <!-- HA10012024 Added Api key as input -->\n <app-pick-location [apiKey]=\"qbItem['Api_Key__c']\" [address]=\"ques.selectedValue\" [question]=\"ques\" (locationSelected)=\"childEventCapture($event, ques)\">\n </app-pick-location>\n </div>\n\n <!-- for text area -->\n <div *ngIf=\"ques.Type__c === 'TextArea'\">\n <app-custom-text-area [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [value]=\"ques.input\" [rows]=\"3\" [error]=\"ques.error\" [placeholder]=\"ques.Question__c \"\n (textareaValueChange)=\"childEventCapture($event, ques)\"></app-custom-text-area>\n </div>\n\n <!-- Email -->\n <div *ngIf=\"ques.Type__c === 'Email'\">\n <input type=\"email\" readOnly=\"ques.Read_Only__c\" [(ngModel)]=\"ques.input\" [id]=\"ques.Id\" required=\"\" (focus)=\"clearSQError(ques.Id)\"\n style.border-color=\"{{ ques.error ? 'red' : '' }}\" placeholder=\"{{ ques.Question__c }}\" />\n </div>\n\n <!-- Table -->\n <div *ngIf=\"ques.Type__c === 'Table'\" class=\"\">\n <app-custom-table [question]=\"ques\" [apiMeta]=\"ques.Sub_Text__c\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-table>\n </div>\n\n <!-- Table Appendix -->\n <div *ngIf=\"ques.Type__c === 'TableAppendix'\" class=\"\">\n <app-table-appendix [question]=\"ques\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-table-appendix>\n </div>\n <!-- list -->\n <!-- VD 20Aug24 used correct attribute -->\n <div *ngIf=\"ques.Type__c === 'List'\" class=\"\">\n <lib-search-box [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [placeHolderText]=\"ques.Question__c\" [filterName]=\"ques.input\" (searchValueChange)=\"childEventCapture($event, ques)\">\n </lib-search-box>\n </div>\n\n <!-- Dropdown -->\n <!-- HA 09FEB24 Added condition of sqOption to the dropdown -->\n <div *ngIf=\"ques.Type__c === 'Dropdown' && ques?.Question_Options__r?.records\" class=\"\">\n <!-- HA 20DEC23 For Translation --> <!-- VD 19JAN24 - getting token as input -->\n <app-custom-dropdown [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-dropdown>\n <i class=\"fa fa-check \" aria-hidden=\"true\" *ngIf=\"ques?.input?.length > 0\"></i>\n </div>\n <!-- // VD 02Aug24 custom-radio component -->\n <div *ngIf=\"ques.Type__c === 'Radio' && ques?.Question_Options__r?.records\" class=\"\">\n <app-custom-radio [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-radio>\n </div>\n\n <!-- Attachment / Files -->\n <div *ngIf=\"ques.Type__c === 'File'\" class=\"\">\n <app-file-upload [limitFileUploading]=\"5\" [error]=\"ques.error\" [question]=\"ques\" [allFiles]=\"ques.input\" [tableFile]=\"false\"\n (selectedFileData)=\"childEventCapture($event, ques)\" (deletedFileData)=\"deleteFile($event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n <div *ngIf=\"ques.Type__c === 'PopUpMessage'\" class=\"\">\n <app-dependent-table [alertMessage]=\"ques.Error_Message__c\">\n </app-dependent-table>\n </div>\n <div *ngIf=\"ques.Type__c === 'Label'\" class=\"\">\n <app-custom-label [labelStyle]=\"ques.Title__c\" [labelValue]=\"ques.Question__c\">\n </app-custom-label>\n </div>\n <!-- // VD 02Aug24 image component -->\n <div *ngIf=\"ques.Type__c === 'Image'\" class=\"\">\n <app-custom-image [question]=\"ques\">\n </app-custom-image>\n </div>\n <!-- 08NOV23 - button type question added -->\n <!-- Button -->\n <div *ngIf=\"ques.Type__c === 'Button'\" class=\"\">\n <app-custom-button [height]=\"'50px'\" \n [width]=\"'150px'\" \n [buttonText]=\"ques?.Question__c\"\n [value]=\"ques?.Question__c\"\n (buttonValue)=\"childEventCapture($event, ques)\"\n >\n </app-custom-button>\n </div>\n <!-- HA 20DEC23 This is to load book type questions-->\n <div *ngIf=\"ques.Type__c === 'Book'\">\n <!-- HA 09FEB24 Added ternary operator -->\n <lib-questionbook [qbItem]=\"ques.qbItem\" [labelValue]=\"labelValue\" [questions]=\"ques.qbItem?.Questions__r?.records\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </div>\n </div>", styles: [".col-lg-6{width:100%}.myt-font7{display:flex;justify-content:flex-start;align-items:center}.icon{display:inline-block;width:15px;height:15px;border-radius:50%;background-color:#08010177;color:#fff;text-align:center;line-height:16px;font-size:11px;font-family:Arial,sans-serif;font-weight:700;margin-left:5px}@media (min-width: 1200px){.col-lg-6{width:50%!important}.form-row{display:flex;flex-wrap:wrap}}\n"] }]
5312
- }], ctorParameters: function () { return [{ type: SalesforceService }, { type: DataService }, { type: ChangeService }, { type: StorageService }, { type: I18nService }, { type: Document, decorators: [{
5662
+ args: [{ selector: 'lib-questionbook', template: "<!-- HA 20DEC23 Book Style from salesforce -->\n<!-- HA 28DEC23 Removed IsShengel(removal of shengel values applies for this reason) and direct styling of books to avoid styling issues-->\n<!-- HA 18JAN24 Added class for styling -->\n<div [style]=\"bookStyle\" class=\"content-box form-group\">\n <div class=\"form-row\">\n <!-- HA 20DEC23 Directive and Question Style from salesforce -->\n <div\n [class]=\"'col-lg-' + ques.Size__c + ' paddingnone'\"\n *ngFor=\"let ques of questions;let i = index\" [id]=\"ques.Id\" [dir]=\"ques.langDirection\" [style]=\"ques?.Style__c?.questionStyle\">\n <!-- Sub Question Label -->\n <!-- HA 20DEC23 Label Style from salesforce -->\n <!-- VD 09May24 is hide field change-->\n <div *ngIf=\"!ques.Is_Hide__c\">\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n\n </div>\n <!-- VD 20JUN24 - help text changes-->\n <!-- VD 01Aug24 - validation change-->\n <!-- // VD 02Aug24 - label value style-->\n <div [ngClass]=\"{ down2: qbItem?.Progress_Bar__c }\" *ngIf=\"ques.Style__c?.showLabel ? ques.Style__c?.showLabel : true\" [style]=\"ques.Style__c?.labelStyle\">\n <span [class]=\"'dis-flex shengel-myt-font3 myt-font7 '\" [style]=\"ques.Style__c?.labelValueStyle\">{{ removeCharacters(ques?.Question_Text__c) }} \n <div *ngIf=\"ques.Is_Optional__c\" style=\"color: red;\">*</div>\n <div *ngIf=\"ques.Question_Text__c && ques?.Help_Text__c\" class=\"icon\" [matTooltip]=\"ques?.Help_Text__c\">i</div></span>\n </div>\n <!-- // VD 12Jun24 - readonly change-->\n <!-- DateTime -->\n <div *ngIf=\"ques.Type__c === 'DateTime'\">\n <app-custom-date-picker [minDate]=\"ques.minDate\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" [date]=\"ques.input\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date-picker>\n </div>\n\n <!-- Date-->\n <div *ngIf=\"ques.Type__c === 'Date'\">\n <app-custom-date [date]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (dateChange)=\"childEventCapture($event, ques)\">\n </app-custom-date>\n </div>\n\n <!-- Time-->\n <div *ngIf=\"ques.Type__c === 'Time'\">\n <app-custom-time [time]=\"ques.input\" [error]=\"ques.error\" [errorMessage]=\"ques.Error_Message__c\" [readOnly]=\"ques.Read_Only__c\" (timeChange)=\"childEventCapture($event, ques)\">\n </app-custom-time>\n </div>\n <!-- calendar -->\n <div *ngIf=\"ques.Type__c === 'Calendar'\">\n <!-- <app-custom-calendar [question]=\"ques\" (eventSelected)=\"childEventCapture($event, ques)\" (dateSelected)=\"getCurrentCalendar($event)\"></app-custom-calendar> -->\n </div>\n <!-- Text -->\n <div *ngIf=\"ques.Type__c === 'Text' || ques.Type__c === 'Link'\" >\n <app-custom-input [value]=\"ques.input\" [ngClassValue]=\"{\n 'dis-flex dt-line date-line bookText boxoutline myt-font1': qbItem.Progress_Bar__c,\n textBox: !qbItem.Progress_Bar__c\n }\" [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [idValue]=\"ques.Tracking_ID__c\" [focusEvent]=\"clearSQError(ques.Id)\"\n [error]=\"ques.error\" [placeholder]=\"ques.Question__c\" (inputValue)=\"childEventCapture($event, ques)\">\n </app-custom-input>\n </div>\n \n <!-- for pick location -->\n <!-- VD 21DEC23 - dependent field change -->\n <div *ngIf=\"ques.Type__c === 'Location'\">\n <!-- HA10012024 Added Api key as input -->\n <app-pick-location [apiKey]=\"qbItem['Api_Key__c']\" [address]=\"ques.selectedValue\" [question]=\"ques\" (locationSelected)=\"childEventCapture($event, ques)\">\n </app-pick-location>\n </div>\n\n <!-- for text area -->\n <div *ngIf=\"ques.Type__c === 'TextArea'\">\n <app-custom-text-area [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [value]=\"ques.input\" [rows]=\"3\" [error]=\"ques.error\" [placeholder]=\"ques.Question__c \"\n (textareaValueChange)=\"childEventCapture($event, ques)\"></app-custom-text-area>\n </div>\n\n <!-- Email -->\n <div *ngIf=\"ques.Type__c === 'Email'\">\n <input type=\"email\" readOnly=\"ques.Read_Only__c\" [(ngModel)]=\"ques.input\" [id]=\"ques.Id\" required=\"\" (focus)=\"clearSQError(ques.Id)\"\n style.border-color=\"{{ ques.error ? 'red' : '' }}\" placeholder=\"{{ ques.Question__c }}\" />\n </div>\n\n <!-- Table -->\n <div *ngIf=\"ques.Type__c === 'Table'\" class=\"\">\n <app-custom-table [question]=\"ques\" [apiMeta]=\"ques.Sub_Text__c\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-table>\n </div>\n\n <!-- Table Appendix -->\n <div *ngIf=\"ques.Type__c === 'TableAppendix'\" class=\"\">\n <app-table-appendix [question]=\"ques\" (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-table-appendix>\n </div>\n <!-- list -->\n <!-- VD 20Aug24 used correct attribute -->\n <div *ngIf=\"ques.Type__c === 'List'\" class=\"\">\n <lib-search-box [question]=\"ques\" [readOnly]=\"ques.Read_Only__c\" [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [placeHolderText]=\"ques.Question__c\" [filterName]=\"ques.input\" (searchValueChange)=\"childEventCapture($event, ques)\">\n </lib-search-box>\n </div>\n\n <!-- Dropdown -->\n <!-- HA 09FEB24 Added condition of sqOption to the dropdown -->\n <div *ngIf=\"ques.Type__c === 'Dropdown' && ques?.Question_Options__r?.records\" class=\"\">\n <!-- HA 20DEC23 For Translation --> <!-- VD 19JAN24 - getting token as input -->\n <app-custom-dropdown [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\" placeholder=\"---{{'select' | i18n:i18nService.currentLanguage}}---\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-dropdown>\n <i class=\"fa fa-check \" aria-hidden=\"true\" *ngIf=\"ques?.input?.length > 0\"></i>\n </div>\n <!-- // VD 02Aug24 custom-radio component -->\n <div *ngIf=\"ques.Type__c === 'Radio' && ques?.Question_Options__r?.records\" class=\"\">\n <app-custom-radio [options]=\"ques.Question_Options__r.records\" [token]=\"token\"\n [apiMeta]=\"ques.Sub_Text__c\" [id]=\"ques.Id\" [selectedValue]=\"ques.selectedValue\"\n [errorMessage]=\"ques.Error_Message__c\" [error]=\"ques.error\"\n [referenceField]=\"ques.Reference_Field__c\"\n [readOnly]=\"ques.Read_Only__c\"\n (valueChange)=\"childEventCapture($event, ques); clearSQError(ques.Id)\">\n </app-custom-radio>\n </div>\n\n <!-- Attachment / Files -->\n <div *ngIf=\"ques.Type__c === 'File'\" class=\"\">\n <app-file-upload [limitFileUploading]=\"5\" [error]=\"ques.error\" [question]=\"ques\" [allFiles]=\"ques.input\" [tableFile]=\"false\"\n (selectedFileData)=\"childEventCapture($event, ques)\" (deletedFileData)=\"deleteFile($event)\"\n [isDeleteFileButtonVisible]=\"true\"></app-file-upload>\n </div>\n <div *ngIf=\"ques.Type__c === 'PopUpMessage'\" class=\"\">\n <app-dependent-table [alertMessage]=\"ques.Error_Message__c\">\n </app-dependent-table>\n </div>\n <div *ngIf=\"ques.Type__c === 'Label'\" class=\"\">\n <app-custom-label [labelStyle]=\"ques.Title__c\" [labelValue]=\"ques.Question__c\">\n </app-custom-label>\n </div>\n <!-- // VD 02Aug24 image component -->\n <div *ngIf=\"ques.Type__c === 'Image'\" class=\"\">\n <app-custom-image [question]=\"ques\">\n </app-custom-image>\n </div>\n <!-- 08NOV23 - button type question added -->\n <!-- Button -->\n <div *ngIf=\"ques.Type__c === 'Button'\" class=\"\">\n <app-custom-button [height]=\"'50px'\" \n [width]=\"'150px'\" \n [buttonText]=\"ques?.Question__c\"\n [value]=\"ques?.Question__c\"\n (buttonValue)=\"childEventCapture($event, ques)\"\n >\n </app-custom-button>\n </div>\n <!-- HA 20DEC23 This is to load book type questions-->\n <div *ngIf=\"ques.Type__c === 'Book'\">\n <!-- HA 09FEB24 Added ternary operator -->\n <lib-questionbook [qbItem]=\"ques.qbItem\" [labelValue]=\"labelValue\" [questions]=\"ques.qbItem?.Questions__r?.records\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 06-09-24 for calendar type-->\n<ng-template dynamicComponentHost></ng-template>", styles: [".col-lg-6{width:100%}.myt-font7{display:flex;justify-content:flex-start;align-items:center}.icon{display:inline-block;width:15px;height:15px;border-radius:50%;background-color:#08010177;color:#fff;text-align:center;line-height:16px;font-size:11px;font-family:Arial,sans-serif;font-weight:700;margin-left:5px}@media (min-width: 1200px){.col-lg-6{width:50%!important}.form-row{display:flex;flex-wrap:wrap}}\n"] }]
5663
+ }], ctorParameters: function () { return [{ type: SalesforceService }, { type: DataService }, { type: ChangeService }, { type: StorageService }, { type: I18nService }, { type: i0.ChangeDetectorRef }, { type: Document, decorators: [{
5313
5664
  type: Inject,
5314
5665
  args: [DOCUMENT]
5315
5666
  }] }]; }, propDecorators: { qbItem: [{
@@ -5332,6 +5683,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
5332
5683
  type: Output
5333
5684
  }], dropDownData: [{
5334
5685
  type: Input
5686
+ }], dynamicHost: [{
5687
+ type: ViewChild,
5688
+ args: [ComponenthostDirective, { static: true }]
5335
5689
  }], hadleDropDownDependent: [{
5336
5690
  type: Output
5337
5691
  }], handleCalendarDate: [{
@@ -5643,789 +5997,484 @@ class BookletComponent {
5643
5997
  if (ques.Type__c === 'Dropdown' || ques.Type__c === 'Radio') {
5644
5998
  this.sqOptions.forEach(element => {
5645
5999
  if (element['Reference_Field__c'] === key) {
5646
- element['input'] = ques.input = value;
5647
- element['selectedValue'] = ques.selectedValue = value;
5648
- }
5649
- });
5650
- }
5651
- // HA 24JAN24 To bind-in Date and DateTime
5652
- else if (ques.Type__c === 'Date' || ques.Type__c == 'DateTime') {
5653
- ques.input = new Date(value.toString());
5654
- }
5655
- // HA 12FEB24 To bind-in Location Type
5656
- else if (ques.Type__c === 'Location') {
5657
- console.log('value ', value);
5658
- ques.input = value;
5659
- ques.selectedValue = value['address'] ? value['address'] : value;
5660
- }
5661
- // VD 06Sep24 calendar changes for data bindIn
5662
- else if (ques.Type__c === 'Calendar') {
5663
- let entries = JSON.parse(ques['Fields_Meta__c']);
5664
- if (entries) {
5665
- let referenceQuestions = [];
5666
- if (entries.length > 0) {
5667
- entries.forEach(element => {
5668
- if (element.questionReference) {
5669
- let qReference = JSON.parse(element.questionReference);
5670
- referenceQuestions.push(qReference?.question);
5671
- }
5672
- });
5673
- }
5674
- if (referenceQuestions.length > 0) {
5675
- value?.forEach(calendarArray => {
5676
- let date = new Date(calendarArray.date);
5677
- calendarArray.entries.forEach(inputEntry => {
5678
- for (let [k, v] of Object.entries(inputEntry)) {
5679
- referenceQuestions.forEach(field => {
5680
- if (field.Reference_Field__c == k) {
5681
- if (field.Type__c === 'Date' || field.Type__c == 'DateTime' || field.Type__c == 'Time') {
5682
- field.input = new Date(v.toString());
5683
- }
5684
- if (field.Type__c === 'Dropdown' || field.Type__c === 'Radio') {
5685
- field.selectedValue = v;
5686
- field.input = v;
5687
- }
5688
- else {
5689
- field.input = v;
5690
- }
5691
- }
5692
- });
5693
- }
5694
- });
5695
- this.addEvent(date, referenceQuestions);
5696
- });
5697
- }
5698
- }
5699
- ques.input = this.allEvents.length > 0 ? this.allEvents : '';
5700
- }
5701
- else {
5702
- ques.input = value;
5703
- }
5704
- this.answerList.push(ques); // HA 12FEB24 To give the value for data
5705
- }
5706
- }
5707
- }
5708
- else {
5709
- const question = {};
5710
- question['id'] = ques.Id;
5711
- // question['Question__c'] = ques.Question__c;
5712
- question['input'] = ques.input;
5713
- // HA 12FEB24 To bind-out Location Type
5714
- if (ques.Type__c === 'Location') {
5715
- question['input'] = ques.input ? ques.input : ques.selectedValue;
5716
- }
5717
- question['Type__c'] = ques.Type__c;
5718
- question['Question_No__c'] = ques.Question_No__c;
5719
- question['Reference_Field__c'] = ques?.Reference_Field__c;
5720
- this.answerList.push(question);
5721
- }
5722
- }
5723
- // VD 06Sep24 calendar changes for data bindIn
5724
- addEvent(day, entryQues) {
5725
- // Transform new entries into the desired format
5726
- const newEntries = entryQues.reduce((acc, q) => {
5727
- acc[q.Id] = { ...q };
5728
- return acc;
5729
- }, {});
5730
- // Find if an event already exists for the given date
5731
- const existingEvent = this.allEvents.find(event => event.date.toDateString() === day.toDateString());
5732
- if (existingEvent) {
5733
- // If the event exists, push the new entries to the existing entries
5734
- const existingEntries = existingEvent.entries.map(entry => ({ ...entry }));
5735
- existingEntries.push(newEntries);
5736
- existingEvent.entries = existingEntries;
5737
- }
5738
- else {
5739
- // Create a new event if it doesn't exist for the given date
5740
- const newEvent = {
5741
- id: '',
5742
- date: day,
5743
- entries: [newEntries] // Wrap the new entries in an array
5744
- };
5745
- this.allEvents.push(newEvent);
5746
- }
5747
- console.log('all events booklet');
5748
- console.log(this.allEvents);
5749
- }
5750
- readQuestions(qbId) {
5751
- // console.log('inside BookletComponent.readQuestions ' + qbId);
5752
- // console.log(this.bookQuestionsMap.size);
5753
- let questions = [];
5754
- // HA 31-JAN-24 Added ternary to avoid undefined
5755
- for (var sq in this.bookQuestionsMap?.get(qbId)?.Questions__r?.records) {
5756
- let q = this.bookQuestionsMap?.get(qbId).Questions__r.records[sq];
5757
- // HA 09FEB24 if question is there process
5758
- if (q) {
5759
- if ((q.Type__c == 'Dropdown' || q.Type__c == 'Radio') && this.sqOptions.get(q.Id)) {
5760
- questions.push(this.sqOptions.get(q.Id));
5761
- }
5762
- else {
5763
- questions.push(q);
5764
- }
5765
- }
5766
- }
5767
- // VD 12Jun24 field permisision changes
5768
- if (this.fieldRestrictions) {
5769
- const fieldRestrictions = new Map(Object.entries(this.fieldRestrictions.fields));
5770
- questions.forEach(ques => {
5771
- const restriction = fieldRestrictions.get(ques.Unique_Identifier__c);
5772
- if (restriction) {
5773
- ques.Read_Only__c = restriction === 'readOnly';
5774
- ques.Is_Hide__c = restriction === 'hide';
5775
- }
5776
- });
5777
- }
5778
- // console.log(questions);
5779
- return questions;
5780
- }
5781
- // VD 11Jun24 - translation changes
5782
- readTransQuestions(qbId) {
5783
- let record = [];
5784
- let translateRecord = this.translateMap.get(qbId);
5785
- if (translateRecord && translateRecord.length > 0) {
5786
- translateRecord.forEach(lanRec => {
5787
- if (lanRec.languageCode == this.languageCode) {
5788
- record = lanRec.fields;
5789
- }
5790
- });
5791
- }
5792
- return record;
5793
- }
5794
- getText(value) {
5795
- var doc = new DOMParser().parseFromString(value, "text/html");
5796
- //console.log( doc.documentElement.textContent);
5797
- return this.sanitizer.bypassSecurityTrustHtml(doc.documentElement.textContent);
5798
- }
5799
- getDropDown(event) {
5800
- this.hadleDropDownDependent.emit(event);
5801
- }
5802
- // VD 06Sep24 calendar changes
5803
- getCalendarDate(event) {
5804
- this.handleCalendarDate.emit(event);
5805
- }
5806
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: BookletComponent, deps: [{ token: SalesforceService }, { token: DataService }, { token: StorageService }, { token: i1.ActivatedRoute }, { token: i6$1.DomSanitizer }, { token: ChangeService }, { token: i0.ElementRef }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
5807
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: BookletComponent, selector: "lib-booklet", inputs: { bookletId: "bookletId", serv: "serv", tkn: "tkn", bookletJSON: "bookletJSON", dropdownDependentData: "dropdownDependentData", labelValue: "labelValue", token: "token", languageCode: "languageCode", fieldRestrictions: "fieldRestrictions", dataBind: "dataBind" }, outputs: { handleBookletActionEvent: "handleBookletActionEvent", handlePage: "handlePage", hadleDropDownDependent: "hadleDropDownDependent", handleCalendarDate: "handleCalendarDate" }, usesOnChanges: true, ngImport: i0, template: "<ngx-spinner size=\"medium\" [name]=\"spinnerName\" [type]=\"spinnerType\"></ngx-spinner>\n<!-- Booklet Handling-->\n<!-- HA 19DEC23 For Direction -->\n<div *ngFor=\"let qb of booklet\" [ngClass]=\"langDirection\">\n <!-- MR Commented below code to ensure single JSON for UNCONDITIONAL Booklets -->\n <!-- <lib-questionnaire [serv]=\"serv\" [qbId]=\"qb.Id\" [tkn]=\"tkn\"></lib-questionnaire> -->\n <!-- HA 28DEC23 Below If logic is to load from booklet -->\n <div *ngIf=\"qb.Questions__r?.records; else elseBlock\">\n <div *ngFor=\"let ques of qb.Questions__r.records\" class=\"questiondiv1\">\n <div>\n <!-- HA 17JAN24 - Is title is enabled so that based on the boolean div will be visible -->\n <div *ngIf=\"ques.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(ques?.Question_Text__c)\" *ngIf=\"ques?.Question_Text__c\" > \n {{ ques?.Question_Text__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!--VD 11Jun24 - translation changes-->\n <!--VD 06Sep24 calendar changes--> \n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" \n [labelValue]=\"labelValue\" \n [questionItem]=\"ques\" \n [translatedQuestions]=\"readTransQuestions(qb.Id)\" \n [questions]=\"readQuestions(qb.Id)\" \n (handleDropDown)=\"getDropDown($event)\"\n (handleCalendarDate)=\"getCalendarDate($event)\"\n ></lib-questionbook>\n </div>\n </div>\n </div>\n <!-- HA 28DEC23 Below else logic is to load from books or questions -->\n <ng-template #elseBlock>\n <div class=\"questiondiv1\">\n <div>\n <div *ngIf=\"!qb.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(qb?.Question_Text__c)\" *ngIf=\"qb?.Question_Text__c\" > \n {{ qb?.Question_Text__c }}\n {{ qb?.Title__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!-- // VD 11Jun24 - translation changes-->\n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" [labelValue]=\"labelValue\" [questionItem]=\"qb\" [translatedQuestions]=\"readTransQuestions(qb.Id)\" [questions]=\"readQuestions(qb.Id)\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </ng-template>\n</div>\n\n<!-- Group Actions -->\n<!-- HA 19DEC23 For Direction -->\n<div class=\"align-submit-row\" *ngIf=\"abItem?.Status__c != 'Completed'\" [ngClass]=\"langDirection\">\n <div *ngFor=\"let action of actions; let i = index\">\n <!-- // HA 22JAN24 Commonise the button style in fusion -->\n <button (click)=\"handleBookletActionClick(action)\" ngClass=\"btn btn-primary fc-button nxtButton\">\n {{ action.name }}\n </button>\n </div>\n</div>\n", styles: [".align-submit-row{display:flex}.header-style{padding:15px;background:#F8F8F8;color:#898989;border:1px solid #e8e8e8;border-top-left-radius:5px;border-top-right-radius:5px;margin-left:0;justify-content:left;font-size:15px}.rtl{flex-direction:row-reverse}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.NgxSpinnerComponent, selector: "ngx-spinner", inputs: ["disableAnimation", "bdColor", "zIndex", "color", "type", "size", "fullScreen", "name", "template", "showSpinner"] }, { kind: "component", type: QuestionbookComponent, selector: "lib-questionbook", inputs: ["qbItem", "questionItem", "translatedQuestions", "questions", "errorFieldId", "labelValue", "token", "dropDownData"], outputs: ["handleDropDown", "handleQuestion", "hadleDropDownDependent", "handleCalendarDate"] }] });
5808
- }
5809
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: BookletComponent, decorators: [{
5810
- type: Component,
5811
- args: [{ selector: 'lib-booklet', template: "<ngx-spinner size=\"medium\" [name]=\"spinnerName\" [type]=\"spinnerType\"></ngx-spinner>\n<!-- Booklet Handling-->\n<!-- HA 19DEC23 For Direction -->\n<div *ngFor=\"let qb of booklet\" [ngClass]=\"langDirection\">\n <!-- MR Commented below code to ensure single JSON for UNCONDITIONAL Booklets -->\n <!-- <lib-questionnaire [serv]=\"serv\" [qbId]=\"qb.Id\" [tkn]=\"tkn\"></lib-questionnaire> -->\n <!-- HA 28DEC23 Below If logic is to load from booklet -->\n <div *ngIf=\"qb.Questions__r?.records; else elseBlock\">\n <div *ngFor=\"let ques of qb.Questions__r.records\" class=\"questiondiv1\">\n <div>\n <!-- HA 17JAN24 - Is title is enabled so that based on the boolean div will be visible -->\n <div *ngIf=\"ques.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(ques?.Question_Text__c)\" *ngIf=\"ques?.Question_Text__c\" > \n {{ ques?.Question_Text__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!--VD 11Jun24 - translation changes-->\n <!--VD 06Sep24 calendar changes--> \n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" \n [labelValue]=\"labelValue\" \n [questionItem]=\"ques\" \n [translatedQuestions]=\"readTransQuestions(qb.Id)\" \n [questions]=\"readQuestions(qb.Id)\" \n (handleDropDown)=\"getDropDown($event)\"\n (handleCalendarDate)=\"getCalendarDate($event)\"\n ></lib-questionbook>\n </div>\n </div>\n </div>\n <!-- HA 28DEC23 Below else logic is to load from books or questions -->\n <ng-template #elseBlock>\n <div class=\"questiondiv1\">\n <div>\n <div *ngIf=\"!qb.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(qb?.Question_Text__c)\" *ngIf=\"qb?.Question_Text__c\" > \n {{ qb?.Question_Text__c }}\n {{ qb?.Title__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!-- // VD 11Jun24 - translation changes-->\n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" [labelValue]=\"labelValue\" [questionItem]=\"qb\" [translatedQuestions]=\"readTransQuestions(qb.Id)\" [questions]=\"readQuestions(qb.Id)\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </ng-template>\n</div>\n\n<!-- Group Actions -->\n<!-- HA 19DEC23 For Direction -->\n<div class=\"align-submit-row\" *ngIf=\"abItem?.Status__c != 'Completed'\" [ngClass]=\"langDirection\">\n <div *ngFor=\"let action of actions; let i = index\">\n <!-- // HA 22JAN24 Commonise the button style in fusion -->\n <button (click)=\"handleBookletActionClick(action)\" ngClass=\"btn btn-primary fc-button nxtButton\">\n {{ action.name }}\n </button>\n </div>\n</div>\n", styles: [".align-submit-row{display:flex}.header-style{padding:15px;background:#F8F8F8;color:#898989;border:1px solid #e8e8e8;border-top-left-radius:5px;border-top-right-radius:5px;margin-left:0;justify-content:left;font-size:15px}.rtl{flex-direction:row-reverse}\n"] }]
5812
- }], ctorParameters: function () { return [{ type: SalesforceService }, { type: DataService }, { type: StorageService }, { type: i1.ActivatedRoute }, { type: i6$1.DomSanitizer }, { type: ChangeService }, { type: i0.ElementRef }, { type: I18nService }]; }, propDecorators: { bookletId: [{
5813
- type: Input
5814
- }], serv: [{
5815
- type: Input
5816
- }], tkn: [{
5817
- type: Input
5818
- }], bookletJSON: [{
5819
- type: Input
5820
- }], dropdownDependentData: [{
5821
- type: Input
5822
- }], labelValue: [{
5823
- type: Input
5824
- }], token: [{
5825
- type: Input
5826
- }], languageCode: [{
5827
- type: Input
5828
- }], fieldRestrictions: [{
5829
- type: Input
5830
- }], handleBookletActionEvent: [{
5831
- type: Output
5832
- }], handlePage: [{
5833
- type: Output
5834
- }], hadleDropDownDependent: [{
5835
- type: Output
5836
- }], handleCalendarDate: [{
5837
- type: Output
5838
- }], dataBind: [{
5839
- type: Input
5840
- }] } });
5841
-
5842
- class FileViewComponent {
5843
- SharedService;
5844
- i18nService;
5845
- documentData;
5846
- api;
5847
- constructor(SharedService, i18nService) {
5848
- this.SharedService = SharedService;
5849
- this.i18nService = i18nService;
5850
- }
5851
- ngOnInit() {
5852
- }
5853
- viewDoc(link) {
5854
- /*
5855
- Author: Vinay Jadhav
5856
- @description: This function will view the file from azure blob.
5857
- The link passed as a parameter will extract file name and pass it to the service
5858
- @param link: It will accept a doc link
5859
- @return: It will not return anything but it will either show or download the file.
5860
- */
5861
- if (link && link !== null) {
5862
- this.SharedService.processViewFile(link.split('/').pop(), this.api);
5863
- }
5864
- // window.open(environment.api.substring(0, environment.api.length - 1) + link, '_blank');
5865
- }
5866
- getDocIcon(docName) {
5867
- const ext = docName.split('.').pop(-1);
5868
- return this.SharedService.docIcon(ext);
5869
- }
5870
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileViewComponent, deps: [{ token: SharedService }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
5871
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FileViewComponent, selector: "app-file-view", inputs: { documentData: "documentData", api: "api" }, ngImport: i0, template: "<div class=\"col-lg-12\">\n <div class=\"row\" style=\"text-align: left;\">\n <div class=\"col-md-12\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label attachment\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n </div>\n <div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-lg-3 document-cnt\" *ngFor=\"let file of documentData;let i = index;\" style=\"margin-bottom: 10px;\">\n <div class=\"row\" (click)=\"viewDoc(file?.doc)\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(file?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{file?.name}}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"documentData?.length === 0\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n </div>\n ", styles: [".document-cnt{border:1px solid #48B7FF;border-radius:5px;margin-right:30px}.document_image{background:#48B7FF66;padding:10px}.document_name{padding:15px 5px}.document_delete{position:absolute;background:#C20808;display:block;height:30px;width:30px;border-radius:50px;bottom:32px;right:-15px;cursor:pointer}.document_delete img{position:relative;left:8px;top:3px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
5872
- }
5873
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileViewComponent, decorators: [{
5874
- type: Component,
5875
- args: [{ selector: 'app-file-view', template: "<div class=\"col-lg-12\">\n <div class=\"row\" style=\"text-align: left;\">\n <div class=\"col-md-12\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label attachment\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n </div>\n <div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-lg-3 document-cnt\" *ngFor=\"let file of documentData;let i = index;\" style=\"margin-bottom: 10px;\">\n <div class=\"row\" (click)=\"viewDoc(file?.doc)\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(file?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{file?.name}}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"documentData?.length === 0\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n </div>\n ", styles: [".document-cnt{border:1px solid #48B7FF;border-radius:5px;margin-right:30px}.document_image{background:#48B7FF66;padding:10px}.document_name{padding:15px 5px}.document_delete{position:absolute;background:#C20808;display:block;height:30px;width:30px;border-radius:50px;bottom:32px;right:-15px;cursor:pointer}.document_delete img{position:relative;left:8px;top:3px}\n"] }]
5876
- }], ctorParameters: function () { return [{ type: SharedService }, { type: I18nService }]; }, propDecorators: { documentData: [{
5877
- type: Input
5878
- }], api: [{
5879
- type: Input
5880
- }] } });
5881
-
5882
- class SummaryPageComponent {
5883
- i18nService;
5884
- answerJson;
5885
- api;
5886
- booklet = [];
5887
- bookQuestionsMap = new Map();
5888
- actions = [];
5889
- sqOptions = new Map();
5890
- questions = [];
5891
- filteredQuestion;
5892
- constructor(i18nService) {
5893
- this.i18nService = i18nService;
5894
- }
5895
- ngOnInit() {
5896
- if (this.answerJson) {
5897
- console.log('answer json', this.answerJson);
5898
- this.booklet = this.answerJson.records;
5899
- // Process the Sub Question Options - This should be merged with bookQuestionsMap in future
5900
- for (var sq in this.answerJson.sqOptions) {
5901
- this.sqOptions.set(sq, this.answerJson.sqOptions[sq]);
5902
- }
5903
- // Process the Questions
5904
- for (var value in this.answerJson.bookQuestionsMap) {
5905
- this.bookQuestionsMap.set(value, this.answerJson.bookQuestionsMap[value]);
5906
- }
5907
- }
5908
- this.processSummary(this.booklet);
5909
- }
5910
- processSummary(data) {
5911
- let questions = [];
5912
- for (var i = 0; i < data.length; i++) {
5913
- let qbId = data[i].Id;
5914
- for (var sq in this.bookQuestionsMap?.get(qbId).Questions__r.records) {
5915
- let q = this.bookQuestionsMap?.get(qbId).Questions__r.records[sq];
5916
- if (q.Type__c == 'Dropdown') {
5917
- questions.push(this.sqOptions.get(q.Id));
5918
- }
5919
- else {
5920
- if (!q.input?.includes('|')) { // to avoid the unwanted fields for summary page
5921
- questions.push(q);
5922
- }
5923
- }
5924
- }
5925
- }
5926
- this.questions = questions;
5927
- console.log('question', this.questions);
5928
- // map the questions using the the bookId
5929
- var qbIds = new Set(this.questions.map((item) => item.Question_Book__c));
5930
- this.filteredQuestion = [];
5931
- qbIds.forEach((id) => {
5932
- this.filteredQuestion.push({
5933
- Id: id,
5934
- questions: this.questions.filter((i) => i.Question_Book__c === id)
5935
- });
5936
- });
5937
- console.log('filteredQuestion', this.filteredQuestion);
5938
- }
5939
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SummaryPageComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
5940
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: SummaryPageComponent, selector: "lib-summary-page", inputs: { answerJson: "answerJson", api: "api" }, ngImport: i0, template: "<div class=\"col-lg-12\">\n <div class=\"panel-group panel-group-joined\" id=\"details\">\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h4 class=\"panel-title\">\n <!-- HA 19DEC23 For Translation -->\n<!-- HA 20FEB24 PTW Details to Details -->\n <a data-toggle=\"collapse\" data-parent=\"#details\" href=\"#collapse\" class=\"collapsed\">\n {{'details' | i18n:i18nService.currentLanguage}}\n </a>\n </h4>\n </div>\n <div [id]=\"'collapse'\" class=\"collapse\">\n <div class=\"panel-body\">\n <div class=\"row\" *ngFor=\"let item of filteredQuestion;let i = index\">\n <div class=\"col-lg-6\" *ngFor=\"let ques of item.questions\" >\n <label *ngIf=\"ques.Type__c != 'File'\" >{{ques.Question__c}}</label>\n <p *ngIf = \"ques.Type__c != 'Dropdown' && ques.Type__c != 'Table' && ques.Type__c != 'File'\">{{ ques.input }}</p>\n <p *ngIf=\"ques.Type__c == 'Dropdown'\">{{ ques.selectedValue }}</p>\n <p *ngIf=\"!ques.input\">N/A</p>\n <div *ngIf= \"ques.Type__c == 'Table'\">\n <div *ngFor=\"let item of ques.input\" class=\"align-center\">\n <img *ngIf=\"item.value == 'yes' \" [src]=\"item.imageSrc\" [alt]=\"item.altText\">\n <p *ngIf=\"item.value == 'yes' \">{{ item.ppe }}</p>\n </div>\n </div>\n <div *ngIf = \"ques.Type__c == 'File'\">\n <app-file-view [api]=\"api\" [documentData]=\"ques.input\"></app-file-view>\n </div>\n </div>\n <div *ngIf=\"i != filteredQuestion.length -1\" class=\"col-lg-12\">\n <hr>\n </div>\n </div>\n </div>\n </div> \n </div>\n</div>\n\n", styles: [".panel{-moz-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);-webkit-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);border-radius:0;border:none;box-shadow:0 1px 2px #0000001a;margin-bottom:20px}.panel .panel-body{padding:20px}.panel-heading{border-radius:0;border:none!important;padding:10px 20px}.panel-default>.panel-heading{background-color:#fafafa;border-bottom:none;color:#2a323c;border:1px solid #e3e3e3!important}.panel-title{margin-bottom:0;margin-top:0;font-family:Rubik,sans-serif;font-weight:400}.panel-group .panel .panel-heading a[data-toggle=collapse].collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading .accordion-toggle.collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading a[data-toggle=collapse]{display:block}.panel-group .panel .panel-heading a[data-toggle=collapse]:before{content:\"\\f0d8\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading .accordion-toggle{display:block}.panel-group .panel .panel-heading .accordion-toggle:before{content:\"\\f068\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading+.panel-collapse .panel-body{border-top:none!important;border:1px solid #e3e3e3}.panel-group .panel-heading{padding:12px 26px}.panel-group.panel-group-joined .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.panel-group-joined .panel-group .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.align-center{display:flex}.align-center p{margin-left:8px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FileViewComponent, selector: "app-file-view", inputs: ["documentData", "api"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
5941
- }
5942
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SummaryPageComponent, decorators: [{
5943
- type: Component,
5944
- args: [{ selector: 'lib-summary-page', template: "<div class=\"col-lg-12\">\n <div class=\"panel-group panel-group-joined\" id=\"details\">\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h4 class=\"panel-title\">\n <!-- HA 19DEC23 For Translation -->\n<!-- HA 20FEB24 PTW Details to Details -->\n <a data-toggle=\"collapse\" data-parent=\"#details\" href=\"#collapse\" class=\"collapsed\">\n {{'details' | i18n:i18nService.currentLanguage}}\n </a>\n </h4>\n </div>\n <div [id]=\"'collapse'\" class=\"collapse\">\n <div class=\"panel-body\">\n <div class=\"row\" *ngFor=\"let item of filteredQuestion;let i = index\">\n <div class=\"col-lg-6\" *ngFor=\"let ques of item.questions\" >\n <label *ngIf=\"ques.Type__c != 'File'\" >{{ques.Question__c}}</label>\n <p *ngIf = \"ques.Type__c != 'Dropdown' && ques.Type__c != 'Table' && ques.Type__c != 'File'\">{{ ques.input }}</p>\n <p *ngIf=\"ques.Type__c == 'Dropdown'\">{{ ques.selectedValue }}</p>\n <p *ngIf=\"!ques.input\">N/A</p>\n <div *ngIf= \"ques.Type__c == 'Table'\">\n <div *ngFor=\"let item of ques.input\" class=\"align-center\">\n <img *ngIf=\"item.value == 'yes' \" [src]=\"item.imageSrc\" [alt]=\"item.altText\">\n <p *ngIf=\"item.value == 'yes' \">{{ item.ppe }}</p>\n </div>\n </div>\n <div *ngIf = \"ques.Type__c == 'File'\">\n <app-file-view [api]=\"api\" [documentData]=\"ques.input\"></app-file-view>\n </div>\n </div>\n <div *ngIf=\"i != filteredQuestion.length -1\" class=\"col-lg-12\">\n <hr>\n </div>\n </div>\n </div>\n </div> \n </div>\n</div>\n\n", styles: [".panel{-moz-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);-webkit-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);border-radius:0;border:none;box-shadow:0 1px 2px #0000001a;margin-bottom:20px}.panel .panel-body{padding:20px}.panel-heading{border-radius:0;border:none!important;padding:10px 20px}.panel-default>.panel-heading{background-color:#fafafa;border-bottom:none;color:#2a323c;border:1px solid #e3e3e3!important}.panel-title{margin-bottom:0;margin-top:0;font-family:Rubik,sans-serif;font-weight:400}.panel-group .panel .panel-heading a[data-toggle=collapse].collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading .accordion-toggle.collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading a[data-toggle=collapse]{display:block}.panel-group .panel .panel-heading a[data-toggle=collapse]:before{content:\"\\f0d8\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading .accordion-toggle{display:block}.panel-group .panel .panel-heading .accordion-toggle:before{content:\"\\f068\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading+.panel-collapse .panel-body{border-top:none!important;border:1px solid #e3e3e3}.panel-group .panel-heading{padding:12px 26px}.panel-group.panel-group-joined .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.panel-group-joined .panel-group .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.align-center{display:flex}.align-center p{margin-left:8px}\n"] }]
5945
- }], ctorParameters: function () { return [{ type: I18nService }]; }, propDecorators: { answerJson: [{
5946
- type: Input
5947
- }], api: [{
5948
- type: Input
5949
- }] } });
5950
-
5951
- // HA 19DEC23 File created for translation
5952
- class I18nModule {
5953
- static forRoot(config) {
5954
- return {
5955
- ngModule: I18nModule,
5956
- providers: [
5957
- I18nService,
5958
- {
5959
- provide: i18nConfigService,
5960
- useValue: config
5961
- }
5962
- ]
5963
- };
5964
- }
5965
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5966
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, imports: [CommonModule] });
5967
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, imports: [CommonModule] });
5968
- }
5969
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, decorators: [{
5970
- type: NgModule,
5971
- args: [{
5972
- declarations: [
5973
- // I18nPipe,
5974
- // I18nComponent
5975
- ],
5976
- imports: [
5977
- CommonModule
5978
- ]
5979
- }]
5980
- }] });
5981
-
5982
- // HA 19DEC23 File created for translation
5983
- class I18nComponent {
5984
- i18nService;
5985
- // @Output() handleEve:EventEmitter<any> = new EventEmitter();
5986
- constructor(i18nService) {
5987
- this.i18nService = i18nService;
5988
- }
5989
- ngOnInit() {
5990
- console.log('ngOnInit component.ts');
5991
- // this.handleEve.emit();
5992
- }
5993
- firstClick(event) {
5994
- console.log('first ', event);
5995
- this.i18nService.languageChange(event);
5996
- // this.handleEve.emit();
5997
- window.location.reload();
5998
- }
5999
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
6000
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: I18nComponent, selector: "app-i18n", ngImport: i0, template: `
6001
- <a *ngFor="let lang of i18nService.langList" href="javascript:void(0);" class="not-selected-language" [ngClass]="{'selected-language': i18nService.currentLanguage === lang.lang}"
6002
-
6003
- (click)="firstClick(lang.lang)">
6004
- <span class="mr-3">
6005
- {{lang.lang}}
6006
- </span>
6007
- </a>
6008
-
6009
- `, isInline: true, styles: [".selected-language{color:green!important;font-weight:700;font-size:24px!important}\n", ".not-selected-language{color:#555;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
6010
- }
6011
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nComponent, decorators: [{
6012
- type: Component,
6013
- args: [{ selector: 'app-i18n', template: `
6014
- <a *ngFor="let lang of i18nService.langList" href="javascript:void(0);" class="not-selected-language" [ngClass]="{'selected-language': i18nService.currentLanguage === lang.lang}"
6015
-
6016
- (click)="firstClick(lang.lang)">
6017
- <span class="mr-3">
6018
- {{lang.lang}}
6019
- </span>
6020
- </a>
6021
-
6022
- `, styles: [".selected-language{color:green!important;font-weight:700;font-size:24px!important}\n", ".not-selected-language{color:#555;font-weight:700}\n"] }]
6023
- }], ctorParameters: function () { return [{ type: I18nService }]; } });
6024
-
6025
- const enI18n = {
6026
- required: "Required",
6027
- addMore: "Add More",
6028
- select: "Select",
6029
- attachment: "Attachment",
6030
- chooseFiles: "Choose files",
6031
- uploadFile: "Upload File",
6032
- thisFieldIsRequired: "This field is required.",
6033
- pickYourLocation: "Pick Your Location",
6034
- // firstName: "First Name",
6035
- // lastName: "Last Name",
6036
- // division: "Division",
6037
- // numberPlate: "Number Plate",
6038
- calibrated: "Calibrated",
6039
- enterValue: "Enter Value",
6040
- details: "Details",
6041
- pleaseMakeChoice: "Please make a choice",
6042
- attach: "Attach",
6043
- add: "Add",
6044
- zeroOfZero: "0 of 0",
6045
- selectDate: "Select date",
6046
- toBuyTicket: "to buy a ticket",
6047
- pickLocation: "Pick Location",
6048
- enterLocation: "Enter Location",
6049
- searchNearestLocation: "Search Nearest Location",
6050
- currentTheme: "ltr",
6051
- };
6052
-
6053
- var enI18n$1 = /*#__PURE__*/Object.freeze({
6054
- __proto__: null,
6055
- default: enI18n
6056
- });
6057
-
6058
- const arI18n = {
6059
- required: "مطلوب",
6060
- addMore: "أضف المزيد",
6061
- select: "يختار",
6062
- attachment: "مرفق",
6063
- chooseFiles: "اختر الملفات",
6064
- uploadFile: "رفع ملف",
6065
- thisFieldIsRequired: "هذه الخانة مطلوبه.",
6066
- pickYourLocation: "اختر موقعك",
6067
- // firstName: "الاسم الأول",
6068
- // lastName: "اسم العائلة",
6069
- // division: "قسم",
6070
- // numberPlate: "لوحة الأرقام",
6071
- calibrated: "معايرة",
6072
- enterValue: "أدخل القيمة",
6073
- details: "تفاصيل",
6074
- pleaseMakeChoice: "يرجى الاختيار",
6075
- attach: "يربط",
6076
- add: "يضيف",
6077
- zeroOfZero: "0 من 0",
6078
- selectDate: "حدد تاريخ",
6079
- toBuyTicket: "لشراء تذكرة",
6080
- pickLocation: "اختر الموقع",
6081
- enterLocation: "إدخال الدولة",
6082
- searchNearestLocation: "البحث عن أقرب موقع",
6083
- currentTheme: "rtl",
6084
- };
6085
-
6086
- var arI18n$1 = /*#__PURE__*/Object.freeze({
6087
- __proto__: null,
6088
- default: arI18n
6089
- });
6090
-
6091
- const tamI18n = {
6092
- required: "தேவை",
6093
- addMore: "மேலும் சேர்க்கவும்",
6094
- select: "தேர்ந்தெடுக்கவும்",
6095
- attachment: "இணைப்பு",
6096
- chooseFiles: "கோப்புகளைத் தேர்ந்தெடுக்கவும்",
6097
- uploadFile: "கோப்பை பதிவேற்றவும்",
6098
- thisFieldIsRequired: "இந்த புலம் தேவை.",
6099
- pickYourLocation: "உங்கள் இருப்பிடத்தைத் தேர்ந்தெடுக்கவும்",
6100
- // firstName: "முதல் பெயர்",
6101
- // lastName: "கடைசி பெயர்",
6102
- // division: "பிரிவு",
6103
- // numberPlate: "இலக்கத்தகடு",
6104
- calibrated: "அளவீடு செய்யப்பட்டது",
6105
- enterValue: "மதிப்பை உள்ளிடவும்",
6106
- details: "விவரங்கள்",
6107
- pleaseMakeChoice: "தயவுசெய்து தேர்வு செய்யுங்கள்",
6108
- attach: "இணைக்கவும்",
6109
- add: "சேர்",
6110
- zeroOfZero: "0 இல் 0",
6111
- selectDate: "தேதியைத் தேர்ந்தெடுக்கவும்",
6112
- toBuyTicket: "டிக்கெட் வாங்க",
6113
- pickLocation: "இருப்பிடத்தைத் தேர்ந்தெடுக்கவும்",
6114
- enterLocation: "இருப்பிடத்தை உள்ளிடவும்",
6115
- searchNearestLocation: "அருகிலுள்ள இடத்தைத் தேடுங்கள்",
6116
- currentTheme: "ltr",
6117
- };
6118
-
6119
- var tamI18n$1 = /*#__PURE__*/Object.freeze({
6120
- __proto__: null,
6121
- default: tamI18n
6122
- });
6123
-
6124
- class CustomModelComponent {
6125
- constructor() { }
6126
- modalTitle;
6127
- isModalOpen = false;
6128
- modalSize = '';
6129
- saveButtonValue = 'Save';
6130
- modalFooter = true;
6131
- saveButtonEmit = new EventEmitter();
6132
- cancelButtonEmit = new EventEmitter();
6133
- onSave() {
6134
- this.saveButtonEmit.emit();
6135
- }
6136
- onCancel() {
6137
- this.cancelButtonEmit.emit();
6138
- }
6139
- ngOnInit() {
6140
- }
6141
- closeModal() {
6142
- this.cancelButtonEmit.emit(false);
6143
- }
6144
- saveModal() {
6145
- this.saveButtonEmit.emit();
6146
- }
6147
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomModelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6148
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomModelComponent, selector: "app-custom-model", inputs: { modalTitle: "modalTitle", isModalOpen: "isModalOpen", modalSize: "modalSize", saveButtonValue: "saveButtonValue", modalFooter: "modalFooter" }, outputs: { saveButtonEmit: "saveButtonEmit", cancelButtonEmit: "cancelButtonEmit" }, ngImport: i0, template: "<div *ngIf=\"isModalOpen\" class=\"modal\" [ngClass]=\"modalSize\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <span class=\"close\" (click)=\"onCancel()\">&times;</span>\n <h2>{{ modalTitle }}</h2>\n </div>\n <div class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <!-- /* VD 06Sep24 styling changes */-->\n <div class=\"modal-footer\" *ngIf=\"modalFooter\">\n <button (click)=\"onCancel()\">Cancel</button>\n <button (click)=\"onSave()\">{{ saveButtonValue }}</button>\n </div>\n </div>\n</div>\n ", styles: [".modal{display:block;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:5% auto;padding:20px;border:1px solid #888;width:70%;max-width:90%;max-height:80vh;overflow-y:auto}.modal-header,.modal-footer{padding:10px;text-align:center;display:block}.modal-body{max-height:60vh;overflow-y:auto}.close{color:#aaa;float:right;font-size:28px;font-weight:700}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}.modal-footer button{padding:10px 20px;margin:5px;font-size:16px;border:1px solid #ccc;border-radius:4px;cursor:pointer;background-color:#f5f5f5;color:#333}.modal-footer button:hover{background-color:#e0e0e0;border-color:#bbb}@media (max-width: 768px){.modal-content{width:90%;margin:10% auto}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
6149
- }
6150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomModelComponent, decorators: [{
6151
- type: Component,
6152
- args: [{ selector: 'app-custom-model', template: "<div *ngIf=\"isModalOpen\" class=\"modal\" [ngClass]=\"modalSize\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <span class=\"close\" (click)=\"onCancel()\">&times;</span>\n <h2>{{ modalTitle }}</h2>\n </div>\n <div class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <!-- /* VD 06Sep24 styling changes */-->\n <div class=\"modal-footer\" *ngIf=\"modalFooter\">\n <button (click)=\"onCancel()\">Cancel</button>\n <button (click)=\"onSave()\">{{ saveButtonValue }}</button>\n </div>\n </div>\n</div>\n ", styles: [".modal{display:block;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:5% auto;padding:20px;border:1px solid #888;width:70%;max-width:90%;max-height:80vh;overflow-y:auto}.modal-header,.modal-footer{padding:10px;text-align:center;display:block}.modal-body{max-height:60vh;overflow-y:auto}.close{color:#aaa;float:right;font-size:28px;font-weight:700}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}.modal-footer button{padding:10px 20px;margin:5px;font-size:16px;border:1px solid #ccc;border-radius:4px;cursor:pointer;background-color:#f5f5f5;color:#333}.modal-footer button:hover{background-color:#e0e0e0;border-color:#bbb}@media (max-width: 768px){.modal-content{width:90%;margin:10% auto}}\n"] }]
6153
- }], ctorParameters: function () { return []; }, propDecorators: { modalTitle: [{
6154
- type: Input
6155
- }], isModalOpen: [{
6156
- type: Input
6157
- }], modalSize: [{
6158
- type: Input
6159
- }], saveButtonValue: [{
6160
- type: Input
6161
- }], modalFooter: [{
6162
- type: Input
6163
- }], saveButtonEmit: [{
6164
- type: Output
6165
- }], cancelButtonEmit: [{
6166
- type: Output
6167
- }] } });
6168
-
6169
- class CustomCalendarComponent {
6170
- eventSelected = new EventEmitter();
6171
- // VD 06Sep24 calendar changes
6172
- dateSelected = new EventEmitter();
6173
- allEvents = [];
6174
- question;
6175
- entries = [];
6176
- referenceQuestions = [];
6177
- qbRefrenceBook;
6178
- calendarQuestion = [];
6179
- currentDate = new Date();
6180
- calendarDays = [];
6181
- daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
6182
- newEventTitle = '';
6183
- newEventTime = '';
6184
- newDescription = '';
6185
- newLink = '';
6186
- selectedDay = null;
6187
- isModalOpen = false;
6188
- modalTitle = 'Custom Modal';
6189
- modalSize = 'large';
6190
- saveButtonValue = 'Save';
6191
- modalFooter = true;
6192
- editingEventId;
6193
- editingEntryGroup;
6194
- showAppoinmentSection = true;
6195
- ngOnInit() {
6196
- if (this.question?.input) {
6197
- this.allEvents = this.question.input;
6198
- }
6199
- this.processQuestion();
6200
- this.generateCalendar();
6201
- }
6202
- processQuestion() {
6203
- this.entries = JSON.parse(this.question['Fields_Meta__c']);
6204
- this.qbRefrenceBook = JSON.parse(this.question['QB_Reference_Questions__c']);
6205
- let title = this.qbRefrenceBook?.questionbook?.Title__c;
6206
- this.modalTitle = title;
6207
- this.referenceQuestions = [];
6208
- if (this.entries.length > 0) {
6209
- this.entries.forEach(element => {
6210
- if (element.questionReference) {
6211
- let qReference = JSON.parse(element.questionReference);
6212
- this.referenceQuestions.push(qReference?.question);
6213
- }
6214
- });
6215
- }
6216
- console.log('entries-->');
6217
- console.log('question-->');
6218
- console.log(this.entries);
6219
- console.log(this.referenceQuestions);
6220
- }
6221
- generateCalendar() {
6222
- const year = this.currentDate.getFullYear();
6223
- const month = this.currentDate.getMonth();
6224
- const startOfMonth = new Date(year, month, 1);
6225
- const endOfMonth = new Date(year, month + 1, 0);
6226
- const startDayOfWeek = startOfMonth.getDay();
6227
- const endDayOfWeek = endOfMonth.getDay();
6228
- const startDate = new Date(startOfMonth);
6229
- startDate.setDate(startDate.getDate() - startDayOfWeek);
6230
- const endDate = new Date(endOfMonth);
6231
- endDate.setDate(endDate.getDate() + (6 - endDayOfWeek));
6232
- const today = new Date(new Date().setHours(0, 0, 0, 0));
6233
- this.calendarDays = [];
6234
- for (let d = new Date(startDate); d <= endDate; d.setDate(d.getDate() + 1)) {
6235
- const date = new Date(d);
6236
- this.calendarDays.push({
6237
- date: date,
6238
- events: [],
6239
- isCurrentMonth: d.getMonth() === month,
6240
- isPast: date < today,
6241
- isToday: date.getTime() === today.getTime(),
6242
- isFuture: date > today,
6243
- });
6244
- }
6245
- // Populate calendar with events from allEvents array
6246
- this.calendarDays.forEach(day => {
6247
- day.events = this.allEvents.filter(event => event.date.toDateString() === day.date.toDateString());
6248
- });
6249
- this.eventSelected.emit(this.allEvents);
6250
- // VD 06Sep24 calendar changes
6251
- let calendar = {};
6252
- calendar['year'] = year;
6253
- calendar['month'] = month + 1;
6254
- console.log(calendar);
6255
- this.dateSelected.emit(calendar);
6256
- }
6257
- selectDay(day) {
6258
- console.log(day);
6259
- // VD 06Sep24 calendar changes
6260
- this.showAppoinmentSection = true;
6261
- this.selectedDay = day;
6262
- // this.eventSelected.emit(day?.events);
6263
- const previouslySelectedDay = this.calendarDays.find(d => d.isSelected);
6264
- if (previouslySelectedDay) {
6265
- previouslySelectedDay.isSelected = false;
6266
- }
6267
- // Select the clicked day
6268
- day.isSelected = true;
6269
- }
6270
- previousMonth() {
6271
- this.showAppoinmentSection = false;
6272
- this.currentDate.setMonth(this.currentDate.getMonth() - 1);
6273
- this.currentDate = new Date(this.currentDate); // Ensure the date object is updated
6274
- this.generateCalendar();
6275
- }
6276
- nextMonth() {
6277
- // VD 06Sep24 calendar changes
6278
- this.showAppoinmentSection = false;
6279
- this.currentDate.setMonth(this.currentDate.getMonth() + 1);
6280
- this.currentDate = new Date(this.currentDate); // Ensure the date object is updated
6281
- this.generateCalendar();
6282
- }
6283
- addAppointment() {
6284
- this.isModalOpen = true;
6285
- this.calendarQuestion = this.referenceQuestions.map(q => ({ ...q, input: '' }));
6286
- this.referenceQuestions.forEach(ques => {
6287
- // clear the input
6288
- if (ques.Type__c == 'Dropdown') {
6289
- delete ques.input;
6290
- delete ques.selectedValue;
6291
- // VD 06Sep24 calendar changes
6292
- }
6293
- else {
6294
- delete ques.input;
6295
- }
6296
- });
6297
- console.log(' console.log(this.referenceQuestions);');
6298
- console.log(this.referenceQuestions);
6299
- this.editingEventId = null;
6300
- }
6301
- // VD 06Sep24 calendar changes
6302
- editEvent(event, entryGroup) {
6303
- this.isModalOpen = true;
6304
- this.referenceQuestions = Object.values(entryGroup);
6305
- this.calendarQuestion = [...this.referenceQuestions]; // Make a copy of the current entries to edit
6306
- this.editingEventId = event.id;
6307
- this.editingEntryGroup = entryGroup; // Store the entry group being edited
6308
- this.generateCalendar(); // Regenerate the calendar to reflect changes
6309
- }
6310
- deleteEvent(eventId, entryGroup) {
6311
- const event = this.allEvents.find(e => e.id === eventId);
6312
- if (event) {
6313
- // Find the index of the entryGroup to delete
6314
- const entryIndex = event.entries.indexOf(entryGroup);
6315
- if (entryIndex > -1) {
6316
- event.entries.splice(entryIndex, 1); // Remove the specific entry
6317
- }
6318
- // If the event has no more entries, remove the event entirely
6319
- if (event.entries.length === 0) {
6320
- const eventIndex = this.allEvents.indexOf(event);
6321
- if (eventIndex > -1) {
6322
- this.allEvents.splice(eventIndex, 1); // Remove the entire event
6000
+ element['input'] = ques.input = value;
6001
+ element['selectedValue'] = ques.selectedValue = value;
6002
+ }
6003
+ });
6004
+ }
6005
+ // HA 24JAN24 To bind-in Date and DateTime
6006
+ else if (ques.Type__c === 'Date' || ques.Type__c == 'DateTime') {
6007
+ ques.input = new Date(value.toString());
6008
+ }
6009
+ // HA 12FEB24 To bind-in Location Type
6010
+ else if (ques.Type__c === 'Location') {
6011
+ console.log('value ', value);
6012
+ ques.input = value;
6013
+ ques.selectedValue = value['address'] ? value['address'] : value;
6014
+ }
6015
+ // VD 06Sep24 calendar changes for data bindIn
6016
+ else if (ques.Type__c === 'Calendar') {
6017
+ let entries = JSON.parse(ques['Fields_Meta__c']);
6018
+ if (entries) {
6019
+ let referenceQuestions = [];
6020
+ if (entries.length > 0) {
6021
+ entries.forEach(element => {
6022
+ if (element.questionReference) {
6023
+ let qReference = JSON.parse(element.questionReference);
6024
+ referenceQuestions.push(qReference?.question);
6025
+ }
6026
+ });
6027
+ }
6028
+ if (referenceQuestions.length > 0) {
6029
+ value?.forEach(calendarArray => {
6030
+ let date = new Date(calendarArray.date);
6031
+ calendarArray.entries.forEach(inputEntry => {
6032
+ for (let [k, v] of Object.entries(inputEntry)) {
6033
+ referenceQuestions.forEach(field => {
6034
+ if (field.Reference_Field__c == k) {
6035
+ if (field.Type__c === 'Date' || field.Type__c == 'DateTime' || field.Type__c == 'Time') {
6036
+ field.input = new Date(v.toString());
6037
+ }
6038
+ if (field.Type__c === 'Dropdown' || field.Type__c === 'Radio') {
6039
+ field.selectedValue = v;
6040
+ field.input = v;
6041
+ }
6042
+ else {
6043
+ field.input = v;
6044
+ }
6045
+ }
6046
+ });
6047
+ }
6048
+ });
6049
+ this.addEvent(date, referenceQuestions);
6050
+ });
6051
+ }
6052
+ }
6053
+ ques.input = this.allEvents.length > 0 ? this.allEvents : '';
6054
+ }
6055
+ else {
6056
+ ques.input = value;
6057
+ }
6058
+ this.answerList.push(ques); // HA 12FEB24 To give the value for data
6323
6059
  }
6324
6060
  }
6325
6061
  }
6326
- this.generateCalendar(); // Regenerate the calendar to reflect the changes
6327
- }
6328
- closeModal() {
6329
- this.isModalOpen = false;
6062
+ else {
6063
+ const question = {};
6064
+ question['id'] = ques.Id;
6065
+ // question['Question__c'] = ques.Question__c;
6066
+ question['input'] = ques.input;
6067
+ // HA 12FEB24 To bind-out Location Type
6068
+ if (ques.Type__c === 'Location') {
6069
+ question['input'] = ques.input ? ques.input : ques.selectedValue;
6070
+ }
6071
+ question['Type__c'] = ques.Type__c;
6072
+ question['Question_No__c'] = ques.Question_No__c;
6073
+ question['Reference_Field__c'] = ques?.Reference_Field__c;
6074
+ this.answerList.push(question);
6075
+ }
6330
6076
  }
6331
- // VD 06Sep24 calendar changes
6077
+ // VD 06Sep24 calendar changes for data bindIn
6332
6078
  addEvent(day, entryQues) {
6333
6079
  // Transform new entries into the desired format
6334
6080
  const newEntries = entryQues.reduce((acc, q) => {
6335
6081
  acc[q.Id] = { ...q };
6336
6082
  return acc;
6337
6083
  }, {});
6338
- // Find an existing event for the given date
6339
- const existingEvent = day.events.find(event => event.date === day.date);
6084
+ // Find if an event already exists for the given date
6085
+ const existingEvent = this.allEvents.find(event => event.date.toDateString() === day.toDateString());
6340
6086
  if (existingEvent) {
6341
- // Merge new entries into the existing event's entries array
6342
- // Check if the entries array already contains an object with the same ID
6087
+ // If the event exists, push the new entries to the existing entries
6343
6088
  const existingEntries = existingEvent.entries.map(entry => ({ ...entry }));
6344
- // Append new entries to the existing entries
6345
6089
  existingEntries.push(newEntries);
6346
6090
  existingEvent.entries = existingEntries;
6347
6091
  }
6348
6092
  else {
6349
6093
  // Create a new event if it doesn't exist for the given date
6350
6094
  const newEvent = {
6351
- id: this.generateId(),
6352
- date: day.date,
6095
+ id: '',
6096
+ date: day,
6353
6097
  entries: [newEntries] // Wrap the new entries in an array
6354
6098
  };
6355
- day.events.push(newEvent);
6356
6099
  this.allEvents.push(newEvent);
6357
6100
  }
6358
- this.generateCalendar();
6359
- console.log('allEvents', this.allEvents);
6101
+ console.log('all events booklet');
6102
+ console.log(this.allEvents);
6360
6103
  }
6361
- // VD 06Sep24 calendar changes
6362
- onSave() {
6363
- if (this.editingEventId !== null) {
6364
- const event = this.allEvents.find(e => e.id === this.editingEventId);
6365
- if (event && this.editingEntryGroup) {
6366
- // Update the specific entry group within the event
6367
- const entryIndex = event.entries.findIndex(entryGroup => entryGroup === this.editingEntryGroup);
6368
- if (entryIndex > -1) {
6369
- event.entries[entryIndex] = this.calendarQuestion.reduce((acc, q) => {
6370
- acc[q.Id] = { ...q };
6371
- return acc;
6372
- }, {});
6104
+ readQuestions(qbId) {
6105
+ // console.log('inside BookletComponent.readQuestions ' + qbId);
6106
+ // console.log(this.bookQuestionsMap.size);
6107
+ let questions = [];
6108
+ // HA 31-JAN-24 Added ternary to avoid undefined
6109
+ for (var sq in this.bookQuestionsMap?.get(qbId)?.Questions__r?.records) {
6110
+ let q = this.bookQuestionsMap?.get(qbId).Questions__r.records[sq];
6111
+ // HA 09FEB24 if question is there process
6112
+ if (q) {
6113
+ if ((q.Type__c == 'Dropdown' || q.Type__c == 'Radio') && this.sqOptions.get(q.Id)) {
6114
+ questions.push(this.sqOptions.get(q.Id));
6115
+ }
6116
+ else {
6117
+ questions.push(q);
6118
+ }
6119
+ }
6120
+ }
6121
+ // VD 12Jun24 field permisision changes
6122
+ if (this.fieldRestrictions) {
6123
+ const fieldRestrictions = new Map(Object.entries(this.fieldRestrictions.fields));
6124
+ questions.forEach(ques => {
6125
+ const restriction = fieldRestrictions.get(ques.Unique_Identifier__c);
6126
+ if (restriction) {
6127
+ ques.Read_Only__c = restriction === 'readOnly';
6128
+ ques.Is_Hide__c = restriction === 'hide';
6129
+ }
6130
+ });
6131
+ }
6132
+ // console.log(questions);
6133
+ return questions;
6134
+ }
6135
+ // VD 11Jun24 - translation changes
6136
+ readTransQuestions(qbId) {
6137
+ let record = [];
6138
+ let translateRecord = this.translateMap.get(qbId);
6139
+ if (translateRecord && translateRecord.length > 0) {
6140
+ translateRecord.forEach(lanRec => {
6141
+ if (lanRec.languageCode == this.languageCode) {
6142
+ record = lanRec.fields;
6373
6143
  }
6144
+ });
6145
+ }
6146
+ return record;
6147
+ }
6148
+ getText(value) {
6149
+ var doc = new DOMParser().parseFromString(value, "text/html");
6150
+ //console.log( doc.documentElement.textContent);
6151
+ return this.sanitizer.bypassSecurityTrustHtml(doc.documentElement.textContent);
6152
+ }
6153
+ getDropDown(event) {
6154
+ this.hadleDropDownDependent.emit(event);
6155
+ }
6156
+ // VD 06Sep24 calendar changes
6157
+ getCalendarDate(event) {
6158
+ this.handleCalendarDate.emit(event);
6159
+ }
6160
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: BookletComponent, deps: [{ token: SalesforceService }, { token: DataService }, { token: StorageService }, { token: i1.ActivatedRoute }, { token: i6$1.DomSanitizer }, { token: ChangeService }, { token: i0.ElementRef }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
6161
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: BookletComponent, selector: "lib-booklet", inputs: { bookletId: "bookletId", serv: "serv", tkn: "tkn", bookletJSON: "bookletJSON", dropdownDependentData: "dropdownDependentData", labelValue: "labelValue", token: "token", languageCode: "languageCode", fieldRestrictions: "fieldRestrictions", dataBind: "dataBind" }, outputs: { handleBookletActionEvent: "handleBookletActionEvent", handlePage: "handlePage", hadleDropDownDependent: "hadleDropDownDependent", handleCalendarDate: "handleCalendarDate" }, usesOnChanges: true, ngImport: i0, template: "<ngx-spinner size=\"medium\" [name]=\"spinnerName\" [type]=\"spinnerType\"></ngx-spinner>\n<!-- Booklet Handling-->\n<!-- HA 19DEC23 For Direction -->\n<div *ngFor=\"let qb of booklet\" [ngClass]=\"langDirection\">\n <!-- MR Commented below code to ensure single JSON for UNCONDITIONAL Booklets -->\n <!-- <lib-questionnaire [serv]=\"serv\" [qbId]=\"qb.Id\" [tkn]=\"tkn\"></lib-questionnaire> -->\n <!-- HA 28DEC23 Below If logic is to load from booklet -->\n <div *ngIf=\"qb.Questions__r?.records; else elseBlock\">\n <div *ngFor=\"let ques of qb.Questions__r.records\" class=\"questiondiv1\">\n <div>\n <!-- HA 17JAN24 - Is title is enabled so that based on the boolean div will be visible -->\n <div *ngIf=\"ques.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(ques?.Question_Text__c)\" *ngIf=\"ques?.Question_Text__c\" > \n {{ ques?.Question_Text__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!--VD 11Jun24 - translation changes-->\n <!--VD 06Sep24 calendar changes--> \n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" \n [labelValue]=\"labelValue\" \n [questionItem]=\"ques\" \n [translatedQuestions]=\"readTransQuestions(qb.Id)\" \n [questions]=\"readQuestions(qb.Id)\" \n (handleDropDown)=\"getDropDown($event)\"\n (handleCalendarDate)=\"getCalendarDate($event)\"\n ></lib-questionbook>\n </div>\n </div>\n </div>\n <!-- HA 28DEC23 Below else logic is to load from books or questions -->\n <ng-template #elseBlock>\n <div class=\"questiondiv1\">\n <div>\n <div *ngIf=\"!qb.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(qb?.Question_Text__c)\" *ngIf=\"qb?.Question_Text__c\" > \n {{ qb?.Question_Text__c }}\n {{ qb?.Title__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!-- // VD 11Jun24 - translation changes-->\n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" [labelValue]=\"labelValue\" [questionItem]=\"qb\" [translatedQuestions]=\"readTransQuestions(qb.Id)\" [questions]=\"readQuestions(qb.Id)\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </ng-template>\n</div>\n\n<!-- Group Actions -->\n<!-- HA 19DEC23 For Direction -->\n<div class=\"align-submit-row\" *ngIf=\"abItem?.Status__c != 'Completed'\" [ngClass]=\"langDirection\">\n <div *ngFor=\"let action of actions; let i = index\">\n <!-- // HA 22JAN24 Commonise the button style in fusion -->\n <button (click)=\"handleBookletActionClick(action)\" ngClass=\"btn btn-primary fc-button nxtButton\">\n {{ action.name }}\n </button>\n </div>\n</div>\n", styles: [".align-submit-row{display:flex}.header-style{padding:15px;background:#F8F8F8;color:#898989;border:1px solid #e8e8e8;border-top-left-radius:5px;border-top-right-radius:5px;margin-left:0;justify-content:left;font-size:15px}.rtl{flex-direction:row-reverse}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.NgxSpinnerComponent, selector: "ngx-spinner", inputs: ["disableAnimation", "bdColor", "zIndex", "color", "type", "size", "fullScreen", "name", "template", "showSpinner"] }, { kind: "component", type: QuestionbookComponent, selector: "lib-questionbook", inputs: ["qbItem", "questionItem", "translatedQuestions", "questions", "errorFieldId", "labelValue", "token", "dropDownData"], outputs: ["handleDropDown", "handleQuestion", "hadleDropDownDependent", "handleCalendarDate"] }] });
6162
+ }
6163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: BookletComponent, decorators: [{
6164
+ type: Component,
6165
+ args: [{ selector: 'lib-booklet', template: "<ngx-spinner size=\"medium\" [name]=\"spinnerName\" [type]=\"spinnerType\"></ngx-spinner>\n<!-- Booklet Handling-->\n<!-- HA 19DEC23 For Direction -->\n<div *ngFor=\"let qb of booklet\" [ngClass]=\"langDirection\">\n <!-- MR Commented below code to ensure single JSON for UNCONDITIONAL Booklets -->\n <!-- <lib-questionnaire [serv]=\"serv\" [qbId]=\"qb.Id\" [tkn]=\"tkn\"></lib-questionnaire> -->\n <!-- HA 28DEC23 Below If logic is to load from booklet -->\n <div *ngIf=\"qb.Questions__r?.records; else elseBlock\">\n <div *ngFor=\"let ques of qb.Questions__r.records\" class=\"questiondiv1\">\n <div>\n <!-- HA 17JAN24 - Is title is enabled so that based on the boolean div will be visible -->\n <div *ngIf=\"ques.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(ques?.Question_Text__c)\" *ngIf=\"ques?.Question_Text__c\" > \n {{ ques?.Question_Text__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!--VD 11Jun24 - translation changes-->\n <!--VD 06Sep24 calendar changes--> \n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" \n [labelValue]=\"labelValue\" \n [questionItem]=\"ques\" \n [translatedQuestions]=\"readTransQuestions(qb.Id)\" \n [questions]=\"readQuestions(qb.Id)\" \n (handleDropDown)=\"getDropDown($event)\"\n (handleCalendarDate)=\"getCalendarDate($event)\"\n ></lib-questionbook>\n </div>\n </div>\n </div>\n <!-- HA 28DEC23 Below else logic is to load from books or questions -->\n <ng-template #elseBlock>\n <div class=\"questiondiv1\">\n <div>\n <div *ngIf=\"!qb.Is_Title__c\" [class]=\"qb.isShengel__c ? 'header-style' : 'question-f-size additional'\">\n <!-- VD 08NOV23 - showing lable when its available-->\n <div [innerHTML]=\"getText(qb?.Question_Text__c)\" *ngIf=\"qb?.Question_Text__c\" > \n {{ qb?.Question_Text__c }}\n {{ qb?.Title__c }}\n </div>\n </div> <!-- VD 19JAN24 - getting token as input --> <!-- // VD 11Jun24 - translation changes-->\n <lib-questionbook [qbItem]=\"qb\" [token]=\"token\" [labelValue]=\"labelValue\" [questionItem]=\"qb\" [translatedQuestions]=\"readTransQuestions(qb.Id)\" [questions]=\"readQuestions(qb.Id)\" (handleDropDown)=\"getDropDown($event)\"></lib-questionbook>\n </div>\n </div>\n </ng-template>\n</div>\n\n<!-- Group Actions -->\n<!-- HA 19DEC23 For Direction -->\n<div class=\"align-submit-row\" *ngIf=\"abItem?.Status__c != 'Completed'\" [ngClass]=\"langDirection\">\n <div *ngFor=\"let action of actions; let i = index\">\n <!-- // HA 22JAN24 Commonise the button style in fusion -->\n <button (click)=\"handleBookletActionClick(action)\" ngClass=\"btn btn-primary fc-button nxtButton\">\n {{ action.name }}\n </button>\n </div>\n</div>\n", styles: [".align-submit-row{display:flex}.header-style{padding:15px;background:#F8F8F8;color:#898989;border:1px solid #e8e8e8;border-top-left-radius:5px;border-top-right-radius:5px;margin-left:0;justify-content:left;font-size:15px}.rtl{flex-direction:row-reverse}\n"] }]
6166
+ }], ctorParameters: function () { return [{ type: SalesforceService }, { type: DataService }, { type: StorageService }, { type: i1.ActivatedRoute }, { type: i6$1.DomSanitizer }, { type: ChangeService }, { type: i0.ElementRef }, { type: I18nService }]; }, propDecorators: { bookletId: [{
6167
+ type: Input
6168
+ }], serv: [{
6169
+ type: Input
6170
+ }], tkn: [{
6171
+ type: Input
6172
+ }], bookletJSON: [{
6173
+ type: Input
6174
+ }], dropdownDependentData: [{
6175
+ type: Input
6176
+ }], labelValue: [{
6177
+ type: Input
6178
+ }], token: [{
6179
+ type: Input
6180
+ }], languageCode: [{
6181
+ type: Input
6182
+ }], fieldRestrictions: [{
6183
+ type: Input
6184
+ }], handleBookletActionEvent: [{
6185
+ type: Output
6186
+ }], handlePage: [{
6187
+ type: Output
6188
+ }], hadleDropDownDependent: [{
6189
+ type: Output
6190
+ }], handleCalendarDate: [{
6191
+ type: Output
6192
+ }], dataBind: [{
6193
+ type: Input
6194
+ }] } });
6195
+
6196
+ class FileViewComponent {
6197
+ SharedService;
6198
+ i18nService;
6199
+ documentData;
6200
+ api;
6201
+ constructor(SharedService, i18nService) {
6202
+ this.SharedService = SharedService;
6203
+ this.i18nService = i18nService;
6204
+ }
6205
+ ngOnInit() {
6206
+ }
6207
+ viewDoc(link) {
6208
+ /*
6209
+ Author: Vinay Jadhav
6210
+ @description: This function will view the file from azure blob.
6211
+ The link passed as a parameter will extract file name and pass it to the service
6212
+ @param link: It will accept a doc link
6213
+ @return: It will not return anything but it will either show or download the file.
6214
+ */
6215
+ if (link && link !== null) {
6216
+ this.SharedService.processViewFile(link.split('/').pop(), this.api);
6217
+ }
6218
+ // window.open(environment.api.substring(0, environment.api.length - 1) + link, '_blank');
6219
+ }
6220
+ getDocIcon(docName) {
6221
+ const ext = docName.split('.').pop(-1);
6222
+ return this.SharedService.docIcon(ext);
6223
+ }
6224
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileViewComponent, deps: [{ token: SharedService }, { token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
6225
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FileViewComponent, selector: "app-file-view", inputs: { documentData: "documentData", api: "api" }, ngImport: i0, template: "<div class=\"col-lg-12\">\n <div class=\"row\" style=\"text-align: left;\">\n <div class=\"col-md-12\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label attachment\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n </div>\n <div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-lg-3 document-cnt\" *ngFor=\"let file of documentData;let i = index;\" style=\"margin-bottom: 10px;\">\n <div class=\"row\" (click)=\"viewDoc(file?.doc)\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(file?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{file?.name}}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"documentData?.length === 0\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n </div>\n ", styles: [".document-cnt{border:1px solid #48B7FF;border-radius:5px;margin-right:30px}.document_image{background:#48B7FF66;padding:10px}.document_name{padding:15px 5px}.document_delete{position:absolute;background:#C20808;display:block;height:30px;width:30px;border-radius:50px;bottom:32px;right:-15px;cursor:pointer}.document_delete img{position:relative;left:8px;top:3px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
6226
+ }
6227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FileViewComponent, decorators: [{
6228
+ type: Component,
6229
+ args: [{ selector: 'app-file-view', template: "<div class=\"col-lg-12\">\n <div class=\"row\" style=\"text-align: left;\">\n <div class=\"col-md-12\">\n <!-- HA 19DEC23 For translation -->\n <label class=\"she-label attachment\">{{ 'attachment' | i18n:i18nService.currentLanguage }}</label>\n </div>\n </div>\n <div class=\"row\" style=\"margin: 0;\">\n <div class=\"col-lg-3 document-cnt\" *ngFor=\"let file of documentData;let i = index;\" style=\"margin-bottom: 10px;\">\n <div class=\"row\" (click)=\"viewDoc(file?.doc)\" style=\"cursor: pointer;\">\n <div class=\"col-lg-3 document_image\">\n <img [src]=\"getDocIcon(file?.doc)\" style=\"margin-right: 10px;height: 40px;\">\n </div>\n <div class=\"col-lg-9 document_name\" style=\"overflow:hidden;height:35px;\">\n {{file?.name}}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-12 m-b-30 text-center\" *ngIf=\"documentData?.length === 0\">\n <img src=\"https://rnxt.s3.amazonaws.com/Icons/fileTypeIcons/ic_no_attachments.svg\" style=\"height: 140px;\">\n </div>\n </div>\n ", styles: [".document-cnt{border:1px solid #48B7FF;border-radius:5px;margin-right:30px}.document_image{background:#48B7FF66;padding:10px}.document_name{padding:15px 5px}.document_delete{position:absolute;background:#C20808;display:block;height:30px;width:30px;border-radius:50px;bottom:32px;right:-15px;cursor:pointer}.document_delete img{position:relative;left:8px;top:3px}\n"] }]
6230
+ }], ctorParameters: function () { return [{ type: SharedService }, { type: I18nService }]; }, propDecorators: { documentData: [{
6231
+ type: Input
6232
+ }], api: [{
6233
+ type: Input
6234
+ }] } });
6235
+
6236
+ class SummaryPageComponent {
6237
+ i18nService;
6238
+ answerJson;
6239
+ api;
6240
+ booklet = [];
6241
+ bookQuestionsMap = new Map();
6242
+ actions = [];
6243
+ sqOptions = new Map();
6244
+ questions = [];
6245
+ filteredQuestion;
6246
+ constructor(i18nService) {
6247
+ this.i18nService = i18nService;
6248
+ }
6249
+ ngOnInit() {
6250
+ if (this.answerJson) {
6251
+ console.log('answer json', this.answerJson);
6252
+ this.booklet = this.answerJson.records;
6253
+ // Process the Sub Question Options - This should be merged with bookQuestionsMap in future
6254
+ for (var sq in this.answerJson.sqOptions) {
6255
+ this.sqOptions.set(sq, this.answerJson.sqOptions[sq]);
6374
6256
  }
6375
- }
6376
- else {
6377
- if (this.selectedDay) {
6378
- this.addEvent(this.selectedDay, this.calendarQuestion);
6257
+ // Process the Questions
6258
+ for (var value in this.answerJson.bookQuestionsMap) {
6259
+ this.bookQuestionsMap.set(value, this.answerJson.bookQuestionsMap[value]);
6379
6260
  }
6380
6261
  }
6381
- this.closeModal();
6382
- this.generateCalendar();
6383
- }
6384
- onCancel() {
6385
- console.log('Cancel button clicked');
6386
- this.closeModal();
6262
+ this.processSummary(this.booklet);
6387
6263
  }
6388
- handleQuestionEvent(ques) {
6389
- // Update the questions array with the new question
6390
- const index = this.calendarQuestion.findIndex(q => q.Id === ques.Id);
6391
- if (index > -1) {
6392
- // If question already exists, update it
6393
- this.calendarQuestion[index] = ques;
6394
- }
6395
- else {
6396
- // If question doesn't exist, add it to the array
6397
- this.calendarQuestion.push(ques);
6264
+ processSummary(data) {
6265
+ let questions = [];
6266
+ for (var i = 0; i < data.length; i++) {
6267
+ let qbId = data[i].Id;
6268
+ for (var sq in this.bookQuestionsMap?.get(qbId).Questions__r.records) {
6269
+ let q = this.bookQuestionsMap?.get(qbId).Questions__r.records[sq];
6270
+ if (q.Type__c == 'Dropdown') {
6271
+ questions.push(this.sqOptions.get(q.Id));
6272
+ }
6273
+ else {
6274
+ if (!q.input?.includes('|')) { // to avoid the unwanted fields for summary page
6275
+ questions.push(q);
6276
+ }
6277
+ }
6278
+ }
6398
6279
  }
6399
- console.log('calender question');
6400
- console.log(this.calendarQuestion);
6401
- }
6402
- // VD 06Sep24 calendar changes
6403
- generateId() {
6404
- return '_' + Math.random().toString(36).substr(2, 9);
6405
- }
6406
- getEntryKeys(entryGroup) {
6407
- return Object.keys(entryGroup);
6408
- }
6409
- removeCharacters(questionText) {
6410
- let updatedText = questionText?.replace(/<[^>]*>/g, '');
6411
- return updatedText;
6280
+ this.questions = questions;
6281
+ console.log('question', this.questions);
6282
+ // map the questions using the the bookId
6283
+ var qbIds = new Set(this.questions.map((item) => item.Question_Book__c));
6284
+ this.filteredQuestion = [];
6285
+ qbIds.forEach((id) => {
6286
+ this.filteredQuestion.push({
6287
+ Id: id,
6288
+ questions: this.questions.filter((i) => i.Question_Book__c === id)
6289
+ });
6290
+ });
6291
+ console.log('filteredQuestion', this.filteredQuestion);
6412
6292
  }
6413
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6414
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomCalendarComponent, selector: "app-custom-calendar", inputs: { allEvents: "allEvents", question: "question" }, outputs: { eventSelected: "eventSelected", dateSelected: "dateSelected" }, ngImport: i0, template: "<div class=\"align-calendar\">\n <div class=\"calendar-container\">\n <div class=\"calendar-header\">\n <button (click)=\"previousMonth()\"><< Previous >></button>\n <h3>{{ currentDate | date: 'MMMM yyyy' }}</h3>\n <button (click)=\"nextMonth()\"><< Next >></button>\n </div>\n <div class=\"calendar-grid\">\n <div class=\"day-of-week\" *ngFor=\"let day of daysOfWeek\">{{ day }}</div>\n\n <div\n class=\"calendar-day\"\n *ngFor=\"let day of calendarDays\"\n [class.not-current-month]=\"!day.isCurrentMonth\"\n [class.past]=\"day.isPast\"\n [class.today]=\"day.isToday\"\n [class.future]=\"day.isFuture\"\n [class.selected]=\"day.isSelected\"\n (click)=\"selectDay(day)\"\n >\n <div class=\"day-number\">{{ day.date.getDate() }}\n <span *ngIf=\"day.events.length > 0\" class=\"entry-indicator\" [class.select]=\"day.isSelected\"></span>\n </div>\n <!-- <div *ngFor=\"let event of day.events\" >\n <div *ngFor=\"let entryGroup of event.entries\" class=\"event\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\">\n <div *ngIf=\"entryGroup[key].Type__c == 'Time'\">\n {{ entryGroup[key].input?.value | date: 'shortTime' }}\n </div>\n <div *ngIf=\"entryGroup[key].Type__c != 'Time'\">\n {{ entryGroup[key].input }}\n </div>\n </div>\n </div>\n </div> -->\n </div>\n </div>\n </div>\n <div class=\"appoinappointment\">\n <div class=\"appointments-container\">\n <h4>Add Appointment</h4>\n <button *ngIf=\"selectedDay\" (click)=\"addAppointment()\">Add</button>\n </div>\n <!--VD 06Sep24 calendar updates--> \n <div *ngIf=\"showAppoinmentSection && selectedDay?.events.length > 0\" class=\"appointments-container\">\n <h4>Appointments</h4>\n <div *ngFor=\"let event of selectedDay?.events\">\n <div class=\"event\" *ngFor=\"let entryGroup of event.entries\">\n <div class=\"event-info\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\" class=\"entry-row\">\n <div *ngIf=\"entryGroup[key].Question_Text__c\" class=\"entry-text\">\n {{removeCharacters(entryGroup[key].Question_Text__c)}}:\n </div>\n <div class=\"entry-value\">\n <span *ngIf=\"entryGroup[key].Type__c != 'Time' && entryGroup[key].Type__c != 'Link'\">{{ entryGroup[key].input }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Time'\">{{ entryGroup[key].input | date: 'shortTime' }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Link'\">\n <a href=\"{{entryGroup[key].input}}\">{{removeCharacters(entryGroup[key].Question_Text__c)}}</a>\n </span>\n </div>\n </div>\n <div class=\"event-actions\">\n <button (click)=\"editEvent(event,entryGroup)\">Edit</button>\n <button (click)=\"deleteEvent(event.id,entryGroup)\">Delete</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<app-custom-model\n [modalTitle]=\"modalTitle\"\n [isModalOpen]=\"isModalOpen\"\n [modalSize]=\"modalSize\"\n [saveButtonValue]=\"saveButtonValue\"\n [modalFooter]=\"modalFooter\"\n (saveButtonEmit)=\"onSave()\"\n (cancelButtonEmit)=\"onCancel()\"\n>\n<lib-questionbook [qbItem]=\"qbRefrenceBook\" [questions]=\"referenceQuestions\" (handleQuestion)=\"handleQuestionEvent($event)\"></lib-questionbook>\n</app-custom-model>\n\n\n \n \n ", styles: [".calendar-container{flex:1}.appoinappointment{flex:1;margin-left:10px}.calendar-header{display:flex;justify-content:space-between;align-items:center}.selected{box-shadow:0 0 5px #00000080;background-color:green!important;color:#fff!important}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.day-of-week{text-align:center;font-weight:700;padding:5px;background-color:#f0f0f0;border:1px solid #ccc}.calendar-day{border:1px solid #ccc;padding:5px;display:flex;flex-direction:column;align-items:flex-start;background-color:#fff;position:relative;cursor:pointer}.calendar-day.not-current-month{background-color:#f0f0f0}.calendar-day.past{color:#aaa}.calendar-day.today{background-color:#e6ffe6;font-weight:700}.calendar-day.future{color:#000}.day-number{font-size:1.2em;margin-bottom:5px}.event{background-color:#d1e7dd;border-left:4px solid #0f5132;margin:5px 0;padding:2px 5px;border-radius:3px}.event-title{font-weight:700}.event-time{font-size:.8em}input[type=text],input[type=time]{width:100%;margin-top:5px;box-sizing:border-box}button{margin-top:5px;align-self:stretch;margin-left:0!important}.calendar-header button{margin-top:5px;align-self:stretch;margin-left:0!important;border:none;background:none}.align-calendar{display:flex;width:100%}.form-group.content-box{padding-bottom:0!important}.entry-indicator{position:absolute;top:5px;right:5px;width:10px;height:10px;background-color:#0f5132;border-radius:50%}.select{background-color:#fff}.entry-row{display:flex;align-items:center;margin-bottom:5px}.entry-text{font-weight:700;margin-right:10px;white-space:nowrap}.entry-value{flex:1;word-break:break-word}.entry-value a{color:#4caf50}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuestionbookComponent, selector: "lib-questionbook", inputs: ["qbItem", "questionItem", "translatedQuestions", "questions", "errorFieldId", "labelValue", "token", "dropDownData"], outputs: ["handleDropDown", "handleQuestion", "hadleDropDownDependent", "handleCalendarDate"] }, { kind: "component", type: CustomModelComponent, selector: "app-custom-model", inputs: ["modalTitle", "isModalOpen", "modalSize", "saveButtonValue", "modalFooter"], outputs: ["saveButtonEmit", "cancelButtonEmit"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }] });
6293
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SummaryPageComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
6294
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: SummaryPageComponent, selector: "lib-summary-page", inputs: { answerJson: "answerJson", api: "api" }, ngImport: i0, template: "<div class=\"col-lg-12\">\n <div class=\"panel-group panel-group-joined\" id=\"details\">\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h4 class=\"panel-title\">\n <!-- HA 19DEC23 For Translation -->\n<!-- HA 20FEB24 PTW Details to Details -->\n <a data-toggle=\"collapse\" data-parent=\"#details\" href=\"#collapse\" class=\"collapsed\">\n {{'details' | i18n:i18nService.currentLanguage}}\n </a>\n </h4>\n </div>\n <div [id]=\"'collapse'\" class=\"collapse\">\n <div class=\"panel-body\">\n <div class=\"row\" *ngFor=\"let item of filteredQuestion;let i = index\">\n <div class=\"col-lg-6\" *ngFor=\"let ques of item.questions\" >\n <label *ngIf=\"ques.Type__c != 'File'\" >{{ques.Question__c}}</label>\n <p *ngIf = \"ques.Type__c != 'Dropdown' && ques.Type__c != 'Table' && ques.Type__c != 'File'\">{{ ques.input }}</p>\n <p *ngIf=\"ques.Type__c == 'Dropdown'\">{{ ques.selectedValue }}</p>\n <p *ngIf=\"!ques.input\">N/A</p>\n <div *ngIf= \"ques.Type__c == 'Table'\">\n <div *ngFor=\"let item of ques.input\" class=\"align-center\">\n <img *ngIf=\"item.value == 'yes' \" [src]=\"item.imageSrc\" [alt]=\"item.altText\">\n <p *ngIf=\"item.value == 'yes' \">{{ item.ppe }}</p>\n </div>\n </div>\n <div *ngIf = \"ques.Type__c == 'File'\">\n <app-file-view [api]=\"api\" [documentData]=\"ques.input\"></app-file-view>\n </div>\n </div>\n <div *ngIf=\"i != filteredQuestion.length -1\" class=\"col-lg-12\">\n <hr>\n </div>\n </div>\n </div>\n </div> \n </div>\n</div>\n\n", styles: [".panel{-moz-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);-webkit-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);border-radius:0;border:none;box-shadow:0 1px 2px #0000001a;margin-bottom:20px}.panel .panel-body{padding:20px}.panel-heading{border-radius:0;border:none!important;padding:10px 20px}.panel-default>.panel-heading{background-color:#fafafa;border-bottom:none;color:#2a323c;border:1px solid #e3e3e3!important}.panel-title{margin-bottom:0;margin-top:0;font-family:Rubik,sans-serif;font-weight:400}.panel-group .panel .panel-heading a[data-toggle=collapse].collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading .accordion-toggle.collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading a[data-toggle=collapse]{display:block}.panel-group .panel .panel-heading a[data-toggle=collapse]:before{content:\"\\f0d8\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading .accordion-toggle{display:block}.panel-group .panel .panel-heading .accordion-toggle:before{content:\"\\f068\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading+.panel-collapse .panel-body{border-top:none!important;border:1px solid #e3e3e3}.panel-group .panel-heading{padding:12px 26px}.panel-group.panel-group-joined .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.panel-group-joined .panel-group .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.align-center{display:flex}.align-center p{margin-left:8px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FileViewComponent, selector: "app-file-view", inputs: ["documentData", "api"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }] });
6415
6295
  }
6416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomCalendarComponent, decorators: [{
6296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SummaryPageComponent, decorators: [{
6417
6297
  type: Component,
6418
- args: [{ selector: 'app-custom-calendar', template: "<div class=\"align-calendar\">\n <div class=\"calendar-container\">\n <div class=\"calendar-header\">\n <button (click)=\"previousMonth()\"><< Previous >></button>\n <h3>{{ currentDate | date: 'MMMM yyyy' }}</h3>\n <button (click)=\"nextMonth()\"><< Next >></button>\n </div>\n <div class=\"calendar-grid\">\n <div class=\"day-of-week\" *ngFor=\"let day of daysOfWeek\">{{ day }}</div>\n\n <div\n class=\"calendar-day\"\n *ngFor=\"let day of calendarDays\"\n [class.not-current-month]=\"!day.isCurrentMonth\"\n [class.past]=\"day.isPast\"\n [class.today]=\"day.isToday\"\n [class.future]=\"day.isFuture\"\n [class.selected]=\"day.isSelected\"\n (click)=\"selectDay(day)\"\n >\n <div class=\"day-number\">{{ day.date.getDate() }}\n <span *ngIf=\"day.events.length > 0\" class=\"entry-indicator\" [class.select]=\"day.isSelected\"></span>\n </div>\n <!-- <div *ngFor=\"let event of day.events\" >\n <div *ngFor=\"let entryGroup of event.entries\" class=\"event\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\">\n <div *ngIf=\"entryGroup[key].Type__c == 'Time'\">\n {{ entryGroup[key].input?.value | date: 'shortTime' }}\n </div>\n <div *ngIf=\"entryGroup[key].Type__c != 'Time'\">\n {{ entryGroup[key].input }}\n </div>\n </div>\n </div>\n </div> -->\n </div>\n </div>\n </div>\n <div class=\"appoinappointment\">\n <div class=\"appointments-container\">\n <h4>Add Appointment</h4>\n <button *ngIf=\"selectedDay\" (click)=\"addAppointment()\">Add</button>\n </div>\n <!--VD 06Sep24 calendar updates--> \n <div *ngIf=\"showAppoinmentSection && selectedDay?.events.length > 0\" class=\"appointments-container\">\n <h4>Appointments</h4>\n <div *ngFor=\"let event of selectedDay?.events\">\n <div class=\"event\" *ngFor=\"let entryGroup of event.entries\">\n <div class=\"event-info\">\n <div *ngFor=\"let key of getEntryKeys(entryGroup)\" class=\"entry-row\">\n <div *ngIf=\"entryGroup[key].Question_Text__c\" class=\"entry-text\">\n {{removeCharacters(entryGroup[key].Question_Text__c)}}:\n </div>\n <div class=\"entry-value\">\n <span *ngIf=\"entryGroup[key].Type__c != 'Time' && entryGroup[key].Type__c != 'Link'\">{{ entryGroup[key].input }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Time'\">{{ entryGroup[key].input | date: 'shortTime' }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Link'\">\n <a href=\"{{entryGroup[key].input}}\">{{removeCharacters(entryGroup[key].Question_Text__c)}}</a>\n </span>\n </div>\n </div>\n <div class=\"event-actions\">\n <button (click)=\"editEvent(event,entryGroup)\">Edit</button>\n <button (click)=\"deleteEvent(event.id,entryGroup)\">Delete</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<app-custom-model\n [modalTitle]=\"modalTitle\"\n [isModalOpen]=\"isModalOpen\"\n [modalSize]=\"modalSize\"\n [saveButtonValue]=\"saveButtonValue\"\n [modalFooter]=\"modalFooter\"\n (saveButtonEmit)=\"onSave()\"\n (cancelButtonEmit)=\"onCancel()\"\n>\n<lib-questionbook [qbItem]=\"qbRefrenceBook\" [questions]=\"referenceQuestions\" (handleQuestion)=\"handleQuestionEvent($event)\"></lib-questionbook>\n</app-custom-model>\n\n\n \n \n ", styles: [".calendar-container{flex:1}.appoinappointment{flex:1;margin-left:10px}.calendar-header{display:flex;justify-content:space-between;align-items:center}.selected{box-shadow:0 0 5px #00000080;background-color:green!important;color:#fff!important}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.day-of-week{text-align:center;font-weight:700;padding:5px;background-color:#f0f0f0;border:1px solid #ccc}.calendar-day{border:1px solid #ccc;padding:5px;display:flex;flex-direction:column;align-items:flex-start;background-color:#fff;position:relative;cursor:pointer}.calendar-day.not-current-month{background-color:#f0f0f0}.calendar-day.past{color:#aaa}.calendar-day.today{background-color:#e6ffe6;font-weight:700}.calendar-day.future{color:#000}.day-number{font-size:1.2em;margin-bottom:5px}.event{background-color:#d1e7dd;border-left:4px solid #0f5132;margin:5px 0;padding:2px 5px;border-radius:3px}.event-title{font-weight:700}.event-time{font-size:.8em}input[type=text],input[type=time]{width:100%;margin-top:5px;box-sizing:border-box}button{margin-top:5px;align-self:stretch;margin-left:0!important}.calendar-header button{margin-top:5px;align-self:stretch;margin-left:0!important;border:none;background:none}.align-calendar{display:flex;width:100%}.form-group.content-box{padding-bottom:0!important}.entry-indicator{position:absolute;top:5px;right:5px;width:10px;height:10px;background-color:#0f5132;border-radius:50%}.select{background-color:#fff}.entry-row{display:flex;align-items:center;margin-bottom:5px}.entry-text{font-weight:700;margin-right:10px;white-space:nowrap}.entry-value{flex:1;word-break:break-word}.entry-value a{color:#4caf50}\n"] }]
6419
- }], propDecorators: { eventSelected: [{
6420
- type: Output
6421
- }], dateSelected: [{
6422
- type: Output
6423
- }], allEvents: [{
6298
+ args: [{ selector: 'lib-summary-page', template: "<div class=\"col-lg-12\">\n <div class=\"panel-group panel-group-joined\" id=\"details\">\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h4 class=\"panel-title\">\n <!-- HA 19DEC23 For Translation -->\n<!-- HA 20FEB24 PTW Details to Details -->\n <a data-toggle=\"collapse\" data-parent=\"#details\" href=\"#collapse\" class=\"collapsed\">\n {{'details' | i18n:i18nService.currentLanguage}}\n </a>\n </h4>\n </div>\n <div [id]=\"'collapse'\" class=\"collapse\">\n <div class=\"panel-body\">\n <div class=\"row\" *ngFor=\"let item of filteredQuestion;let i = index\">\n <div class=\"col-lg-6\" *ngFor=\"let ques of item.questions\" >\n <label *ngIf=\"ques.Type__c != 'File'\" >{{ques.Question__c}}</label>\n <p *ngIf = \"ques.Type__c != 'Dropdown' && ques.Type__c != 'Table' && ques.Type__c != 'File'\">{{ ques.input }}</p>\n <p *ngIf=\"ques.Type__c == 'Dropdown'\">{{ ques.selectedValue }}</p>\n <p *ngIf=\"!ques.input\">N/A</p>\n <div *ngIf= \"ques.Type__c == 'Table'\">\n <div *ngFor=\"let item of ques.input\" class=\"align-center\">\n <img *ngIf=\"item.value == 'yes' \" [src]=\"item.imageSrc\" [alt]=\"item.altText\">\n <p *ngIf=\"item.value == 'yes' \">{{ item.ppe }}</p>\n </div>\n </div>\n <div *ngIf = \"ques.Type__c == 'File'\">\n <app-file-view [api]=\"api\" [documentData]=\"ques.input\"></app-file-view>\n </div>\n </div>\n <div *ngIf=\"i != filteredQuestion.length -1\" class=\"col-lg-12\">\n <hr>\n </div>\n </div>\n </div>\n </div> \n </div>\n</div>\n\n", styles: [".panel{-moz-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);-webkit-box-shadow:0px 1px 2px 0px rgba(0,0,0,.1);border-radius:0;border:none;box-shadow:0 1px 2px #0000001a;margin-bottom:20px}.panel .panel-body{padding:20px}.panel-heading{border-radius:0;border:none!important;padding:10px 20px}.panel-default>.panel-heading{background-color:#fafafa;border-bottom:none;color:#2a323c;border:1px solid #e3e3e3!important}.panel-title{margin-bottom:0;margin-top:0;font-family:Rubik,sans-serif;font-weight:400}.panel-group .panel .panel-heading a[data-toggle=collapse].collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading .accordion-toggle.collapsed:before{content:\"\\f0d7\"}.panel-group .panel .panel-heading a[data-toggle=collapse]{display:block}.panel-group .panel .panel-heading a[data-toggle=collapse]:before{content:\"\\f0d8\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading .accordion-toggle{display:block}.panel-group .panel .panel-heading .accordion-toggle:before{content:\"\\f068\";display:block;float:right;font-family:FontAwesome;font-size:14px;text-align:right;width:25px}.panel-group .panel .panel-heading+.panel-collapse .panel-body{border-top:none!important;border:1px solid #e3e3e3}.panel-group .panel-heading{padding:12px 26px}.panel-group.panel-group-joined .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.panel-group-joined .panel-group .panel+.panel{border-top:1px solid #eeeeee;margin-top:0}.align-center{display:flex}.align-center p{margin-left:8px}\n"] }]
6299
+ }], ctorParameters: function () { return [{ type: I18nService }]; }, propDecorators: { answerJson: [{
6424
6300
  type: Input
6425
- }], question: [{
6301
+ }], api: [{
6426
6302
  type: Input
6427
6303
  }] } });
6428
6304
 
6305
+ // HA 19DEC23 File created for translation
6306
+ class I18nModule {
6307
+ static forRoot(config) {
6308
+ return {
6309
+ ngModule: I18nModule,
6310
+ providers: [
6311
+ I18nService,
6312
+ {
6313
+ provide: i18nConfigService,
6314
+ useValue: config
6315
+ }
6316
+ ]
6317
+ };
6318
+ }
6319
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6320
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, imports: [CommonModule] });
6321
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, imports: [CommonModule] });
6322
+ }
6323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nModule, decorators: [{
6324
+ type: NgModule,
6325
+ args: [{
6326
+ declarations: [
6327
+ // I18nPipe,
6328
+ // I18nComponent
6329
+ ],
6330
+ imports: [
6331
+ CommonModule
6332
+ ]
6333
+ }]
6334
+ }] });
6335
+
6336
+ // HA 19DEC23 File created for translation
6337
+ class I18nComponent {
6338
+ i18nService;
6339
+ // @Output() handleEve:EventEmitter<any> = new EventEmitter();
6340
+ constructor(i18nService) {
6341
+ this.i18nService = i18nService;
6342
+ }
6343
+ ngOnInit() {
6344
+ console.log('ngOnInit component.ts');
6345
+ // this.handleEve.emit();
6346
+ }
6347
+ firstClick(event) {
6348
+ console.log('first ', event);
6349
+ this.i18nService.languageChange(event);
6350
+ // this.handleEve.emit();
6351
+ window.location.reload();
6352
+ }
6353
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nComponent, deps: [{ token: I18nService }], target: i0.ɵɵFactoryTarget.Component });
6354
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: I18nComponent, selector: "app-i18n", ngImport: i0, template: `
6355
+ <a *ngFor="let lang of i18nService.langList" href="javascript:void(0);" class="not-selected-language" [ngClass]="{'selected-language': i18nService.currentLanguage === lang.lang}"
6356
+
6357
+ (click)="firstClick(lang.lang)">
6358
+ <span class="mr-3">
6359
+ {{lang.lang}}
6360
+ </span>
6361
+ </a>
6362
+
6363
+ `, isInline: true, styles: [".selected-language{color:green!important;font-weight:700;font-size:24px!important}\n", ".not-selected-language{color:#555;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
6364
+ }
6365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: I18nComponent, decorators: [{
6366
+ type: Component,
6367
+ args: [{ selector: 'app-i18n', template: `
6368
+ <a *ngFor="let lang of i18nService.langList" href="javascript:void(0);" class="not-selected-language" [ngClass]="{'selected-language': i18nService.currentLanguage === lang.lang}"
6369
+
6370
+ (click)="firstClick(lang.lang)">
6371
+ <span class="mr-3">
6372
+ {{lang.lang}}
6373
+ </span>
6374
+ </a>
6375
+
6376
+ `, styles: [".selected-language{color:green!important;font-weight:700;font-size:24px!important}\n", ".not-selected-language{color:#555;font-weight:700}\n"] }]
6377
+ }], ctorParameters: function () { return [{ type: I18nService }]; } });
6378
+
6379
+ const enI18n = {
6380
+ required: "Required",
6381
+ addMore: "Add More",
6382
+ select: "Select",
6383
+ attachment: "Attachment",
6384
+ chooseFiles: "Choose files",
6385
+ uploadFile: "Upload File",
6386
+ thisFieldIsRequired: "This field is required.",
6387
+ pickYourLocation: "Pick Your Location",
6388
+ // firstName: "First Name",
6389
+ // lastName: "Last Name",
6390
+ // division: "Division",
6391
+ // numberPlate: "Number Plate",
6392
+ calibrated: "Calibrated",
6393
+ enterValue: "Enter Value",
6394
+ details: "Details",
6395
+ pleaseMakeChoice: "Please make a choice",
6396
+ attach: "Attach",
6397
+ add: "Add",
6398
+ zeroOfZero: "0 of 0",
6399
+ selectDate: "Select date",
6400
+ toBuyTicket: "to buy a ticket",
6401
+ pickLocation: "Pick Location",
6402
+ enterLocation: "Enter Location",
6403
+ searchNearestLocation: "Search Nearest Location",
6404
+ currentTheme: "ltr",
6405
+ };
6406
+
6407
+ var enI18n$1 = /*#__PURE__*/Object.freeze({
6408
+ __proto__: null,
6409
+ default: enI18n
6410
+ });
6411
+
6412
+ const arI18n = {
6413
+ required: "مطلوب",
6414
+ addMore: "أضف المزيد",
6415
+ select: "يختار",
6416
+ attachment: "مرفق",
6417
+ chooseFiles: "اختر الملفات",
6418
+ uploadFile: "رفع ملف",
6419
+ thisFieldIsRequired: "هذه الخانة مطلوبه.",
6420
+ pickYourLocation: "اختر موقعك",
6421
+ // firstName: "الاسم الأول",
6422
+ // lastName: "اسم العائلة",
6423
+ // division: "قسم",
6424
+ // numberPlate: "لوحة الأرقام",
6425
+ calibrated: "معايرة",
6426
+ enterValue: "أدخل القيمة",
6427
+ details: "تفاصيل",
6428
+ pleaseMakeChoice: "يرجى الاختيار",
6429
+ attach: "يربط",
6430
+ add: "يضيف",
6431
+ zeroOfZero: "0 من 0",
6432
+ selectDate: "حدد تاريخ",
6433
+ toBuyTicket: "لشراء تذكرة",
6434
+ pickLocation: "اختر الموقع",
6435
+ enterLocation: "إدخال الدولة",
6436
+ searchNearestLocation: "البحث عن أقرب موقع",
6437
+ currentTheme: "rtl",
6438
+ };
6439
+
6440
+ var arI18n$1 = /*#__PURE__*/Object.freeze({
6441
+ __proto__: null,
6442
+ default: arI18n
6443
+ });
6444
+
6445
+ const tamI18n = {
6446
+ required: "தேவை",
6447
+ addMore: "மேலும் சேர்க்கவும்",
6448
+ select: "தேர்ந்தெடுக்கவும்",
6449
+ attachment: "இணைப்பு",
6450
+ chooseFiles: "கோப்புகளைத் தேர்ந்தெடுக்கவும்",
6451
+ uploadFile: "கோப்பை பதிவேற்றவும்",
6452
+ thisFieldIsRequired: "இந்த புலம் தேவை.",
6453
+ pickYourLocation: "உங்கள் இருப்பிடத்தைத் தேர்ந்தெடுக்கவும்",
6454
+ // firstName: "முதல் பெயர்",
6455
+ // lastName: "கடைசி பெயர்",
6456
+ // division: "பிரிவு",
6457
+ // numberPlate: "இலக்கத்தகடு",
6458
+ calibrated: "அளவீடு செய்யப்பட்டது",
6459
+ enterValue: "மதிப்பை உள்ளிடவும்",
6460
+ details: "விவரங்கள்",
6461
+ pleaseMakeChoice: "தயவுசெய்து தேர்வு செய்யுங்கள்",
6462
+ attach: "இணைக்கவும்",
6463
+ add: "சேர்",
6464
+ zeroOfZero: "0 இல் 0",
6465
+ selectDate: "தேதியைத் தேர்ந்தெடுக்கவும்",
6466
+ toBuyTicket: "டிக்கெட் வாங்க",
6467
+ pickLocation: "இருப்பிடத்தைத் தேர்ந்தெடுக்கவும்",
6468
+ enterLocation: "இருப்பிடத்தை உள்ளிடவும்",
6469
+ searchNearestLocation: "அருகிலுள்ள இடத்தைத் தேடுங்கள்",
6470
+ currentTheme: "ltr",
6471
+ };
6472
+
6473
+ var tamI18n$1 = /*#__PURE__*/Object.freeze({
6474
+ __proto__: null,
6475
+ default: tamI18n
6476
+ });
6477
+
6429
6478
  class LoaderComponent {
6430
6479
  loaderService;
6431
6480
  isLoading = false;
@@ -6489,6 +6538,7 @@ class NxtAppModule {
6489
6538
  MyDatePickerModule,
6490
6539
  OwlDateTimeModule,
6491
6540
  OwlNativeDateTimeModule,
6541
+ ComponenthostDirective,
6492
6542
  GetValuePipe,
6493
6543
  // VD 23JAN24 removed HttpClientModule
6494
6544
  NgSelectModule,
@@ -6501,7 +6551,6 @@ class NxtAppModule {
6501
6551
  ReactiveFormsModule, NgxSpinnerModule, I18nModule, i13.NgCircleProgressModule], exports: [NxtAppComponent,
6502
6552
  QuestionnaireComponent,
6503
6553
  BookletComponent,
6504
- QuestionbookComponent,
6505
6554
  SummaryPageComponent,
6506
6555
  I18nPipe,
6507
6556
  I18nComponent] });
@@ -6637,6 +6686,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
6637
6686
  MyDatePickerModule,
6638
6687
  OwlDateTimeModule,
6639
6688
  OwlNativeDateTimeModule,
6689
+ ComponenthostDirective,
6640
6690
  GetValuePipe,
6641
6691
  // VD 23JAN24 removed HttpClientModule
6642
6692
  NgSelectModule,
@@ -6730,7 +6780,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
6730
6780
  exports: [NxtAppComponent,
6731
6781
  QuestionnaireComponent,
6732
6782
  BookletComponent,
6733
- QuestionbookComponent,
6734
6783
  SummaryPageComponent,
6735
6784
  I18nPipe,
6736
6785
  I18nComponent,