@rangertechnologies/ngnxt 2.1.63 → 2.1.65

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.
@@ -4359,11 +4359,11 @@ class CustomCalendarComponent {
4359
4359
  // this.dateSelected.emit(this.calendar);
4360
4360
  //this.eventSelected.emit(this.allEvents);
4361
4361
  }
4362
- ngOnChanges(simplechanges) {
4363
- if (simplechanges['question']) {
4364
- this.allEvents = this.question.input;
4365
- }
4366
- }
4362
+ // ngOnChanges(simplechanges:SimpleChanges) {
4363
+ // if(simplechanges['question']){
4364
+ // this.allEvents = this.question.input;
4365
+ // }
4366
+ // }
4367
4367
  processQuestion() {
4368
4368
  this.entries = JSON.parse(this.question['Fields_Meta__c']);
4369
4369
  this.qbRefrenceBook = JSON.parse(this.question['QB_Reference_Questions__c']);
@@ -4561,7 +4561,7 @@ class CustomCalendarComponent {
4561
4561
  return acc;
4562
4562
  }, {});
4563
4563
  // Find an existing event for the given date
4564
- const existingEvent = day.events.find(event => event.date === day.date);
4564
+ const existingEvent = day.events?.find(event => event.date === day.date);
4565
4565
  if (existingEvent) {
4566
4566
  // Merge new entries into the existing event's entries array
4567
4567
  // Check if the entries array already contains an object with the same ID
@@ -4577,6 +4577,7 @@ class CustomCalendarComponent {
4577
4577
  date: day.date,
4578
4578
  entries: [newEntries] // Wrap the new entries in an array
4579
4579
  };
4580
+ day.events = day?.events || [];
4580
4581
  day.events.push(newEvent);
4581
4582
  this.allEvents?.push(newEvent);
4582
4583
  //this.eventSelected.emit(this.allEvents);
@@ -4645,7 +4646,7 @@ class CustomCalendarComponent {
4645
4646
  return updatedText;
4646
4647
  }
4647
4648
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomCalendarComponent, deps: [{ token: ChangeService }], target: i0.ɵɵFactoryTarget.Component });
4648
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomCalendarComponent, selector: "app-custom-calendar", inputs: { allEvents: "allEvents", question: "question", nxtId: "nxtId" }, outputs: { eventSelected: "eventSelected", dateSelected: "dateSelected", openModal: "openModal", closeModal: "closeModal" }, usesOnChanges: 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 <!-- VD 09Sep24- date type and link type updates -->\n <span *ngIf=\"entryGroup[key].Type__c != 'Time' && entryGroup[key].Type__c != 'Link'&& entryGroup[key].Type__c != 'Date'\">{{ 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 == 'Date'\">{{ entryGroup[key].input | date: 'mediumDate' }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Link'\">\n <a [href]=\"'//'+ entryGroup[key].input\" target=\"_blank\">{{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<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: "pipe", type: i2.DatePipe, name: "date" }] });
4649
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CustomCalendarComponent, selector: "app-custom-calendar", inputs: { allEvents: "allEvents", question: "question", nxtId: "nxtId" }, outputs: { eventSelected: "eventSelected", dateSelected: "dateSelected", openModal: "openModal", closeModal: "closeModal" }, 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 <!-- VD 09Sep24- date type and link type updates -->\n <span *ngIf=\"entryGroup[key].Type__c != 'Time' && entryGroup[key].Type__c != 'Link'&& entryGroup[key].Type__c != 'Date'\">{{ 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 == 'Date'\">{{ entryGroup[key].input | date: 'mediumDate' }}</span>\n <span *ngIf=\"entryGroup[key].Type__c == 'Link'\">\n <a [href]=\"'//'+ entryGroup[key].input\" target=\"_blank\">{{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<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: "pipe", type: i2.DatePipe, name: "date" }] });
4649
4650
  }
4650
4651
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomCalendarComponent, decorators: [{
4651
4652
  type: Component,
@@ -5947,6 +5948,7 @@ class BookletComponent {
5947
5948
  ngOnChanges(simplechanges) {
5948
5949
  // HA 23JAN24 To avoid undefined error
5949
5950
  if (simplechanges['bookletId'] || (simplechanges['bookletJSON'] && (simplechanges['bookletJSON'].currentValue != null || simplechanges['bookletJSON'].currentValue != undefined)) || (simplechanges['dataBind'] && (simplechanges['dataBind'].currentValue != null || simplechanges['dataBind'].currentValue != undefined))) {
5951
+ this.allEvents = [];
5950
5952
  this.processBooklet();
5951
5953
  }
5952
5954
  // console.log('inside Questionnaire ngOnChanges');
@@ -6215,8 +6217,9 @@ class BookletComponent {
6215
6217
  }
6216
6218
  });
6217
6219
  }
6220
+ this.addEvent(date, referenceQuestions); //SKS 27SEP24 each event added to allEvents array
6218
6221
  });
6219
- this.addEvent(date, referenceQuestions);
6222
+ // this.addEvent(date,referenceQuestions); //this is only last event added to allEvents array
6220
6223
  });
6221
6224
  }
6222
6225
  }
@@ -6262,7 +6265,7 @@ class BookletComponent {
6262
6265
  else {
6263
6266
  // Create a new event if it doesn't exist for the given date
6264
6267
  const newEvent = {
6265
- id: '',
6268
+ id: '_' + Math.random().toString(36).substr(2, 9),
6266
6269
  date: day,
6267
6270
  entries: [newEntries] // Wrap the new entries in an array
6268
6271
  };