@bizy/core 19.0.19 → 19.0.21

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.
@@ -584,6 +584,7 @@ registerLocaleData(localeEs);
584
584
  class BizyCalendarComponent {
585
585
  id = `bizy-calendar-${Math.random()}`;
586
586
  hideHeaderDate = false;
587
+ preventExpand = false;
587
588
  dayStartHour = 0;
588
589
  dayEndHour = 24;
589
590
  hourMinutesDuration = 60;
@@ -639,8 +640,12 @@ class BizyCalendarComponent {
639
640
  });
640
641
  this._refresh.next();
641
642
  }
642
- dayClicked({ date, events }) {
643
- if (isSameMonth(date, this._viewDate)) {
643
+ dayClicked({ date, events, isOpen }) {
644
+ if (this.preventExpand) {
645
+ isOpen = false;
646
+ this._activeDayIsOpen = false;
647
+ }
648
+ else if (isSameMonth(date, this._viewDate)) {
644
649
  if ((isSameDay(this._viewDate, date) && this._activeDayIsOpen === true) || events.length === 0) {
645
650
  this._activeDayIsOpen = false;
646
651
  }
@@ -725,7 +730,7 @@ class BizyCalendarComponent {
725
730
  return actions;
726
731
  }
727
732
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
728
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyCalendarComponent, isStandalone: true, selector: "bizy-calendar", inputs: { id: "id", hideHeaderDate: "hideHeaderDate", dayStartHour: "dayStartHour", dayEndHour: "dayEndHour", hourMinutesDuration: "hourMinutesDuration", hourSegments: "hourSegments", language: "language", excludeDays: "excludeDays", weekendDays: "weekendDays", weekStartsOn: "weekStartsOn", mode: "mode", customCalendarWeekEventTemplate: "customCalendarWeekEventTemplate", viewDate: "viewDate", events: "events" }, outputs: { onEventSelect: "onEventSelect", onDateSelect: "onDateSelect", onEventDelete: "onEventDelete" }, providers: [
733
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyCalendarComponent, isStandalone: true, selector: "bizy-calendar", inputs: { id: "id", hideHeaderDate: "hideHeaderDate", preventExpand: "preventExpand", dayStartHour: "dayStartHour", dayEndHour: "dayEndHour", hourMinutesDuration: "hourMinutesDuration", hourSegments: "hourSegments", language: "language", excludeDays: "excludeDays", weekendDays: "weekendDays", weekStartsOn: "weekStartsOn", mode: "mode", customCalendarWeekEventTemplate: "customCalendarWeekEventTemplate", viewDate: "viewDate", events: "events" }, outputs: { onEventSelect: "onEventSelect", onDateSelect: "onDateSelect", onEventDelete: "onEventDelete" }, providers: [
729
734
  CalendarUtils,
730
735
  CalendarA11y,
731
736
  CalendarEventTitleFormatter,
@@ -758,6 +763,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
758
763
  type: Input
759
764
  }], hideHeaderDate: [{
760
765
  type: Input
766
+ }], preventExpand: [{
767
+ type: Input
761
768
  }], dayStartHour: [{
762
769
  type: Input
763
770
  }], dayEndHour: [{
@@ -2615,32 +2622,40 @@ class BizyGridComponent {
2615
2622
  this.elementRef = elementRef;
2616
2623
  }
2617
2624
  ngAfterContentInit() {
2618
- this.#rowScrollingMutationObserver = new MutationObserver(() => {
2619
- if (!this.gridDirective) {
2620
- return;
2621
- }
2622
- this.#subscription.add(this.gridDirective.items$.subscribe(items => {
2623
- if (this.items.length === 0 && items.length === 0) {
2625
+ if (this.gridDirective) {
2626
+ this.#initView();
2627
+ }
2628
+ else {
2629
+ this.#rowScrollingMutationObserver = new MutationObserver(() => {
2630
+ if (!this.gridDirective) {
2624
2631
  return;
2625
2632
  }
2626
- this.items = items;
2627
- this.#updateView();
2628
- if (!this.#view) {
2629
- this.#view = this.gridDirective.viewContainerRef;
2630
- this.#view.createEmbeddedView(this.content);
2631
- }
2632
- }));
2633
- this.#rowScrollingMutationObserver.disconnect();
2634
- this.ref.detectChanges();
2635
- });
2636
- this.#rowScrollingMutationObserver.observe(this.document.body, { childList: true, subtree: true });
2633
+ this.#initView();
2634
+ this.#rowScrollingMutationObserver.disconnect();
2635
+ this.ref.detectChanges();
2636
+ });
2637
+ this.#rowScrollingMutationObserver.observe(this.document.body, { childList: true, subtree: true });
2638
+ }
2639
+ }
2640
+ #initView = () => {
2641
+ this.#subscription.add(this.gridDirective.items$.subscribe(items => {
2642
+ if (this.items.length === 0 && items.length === 0) {
2643
+ return;
2644
+ }
2645
+ this.items = items;
2646
+ this.#updateView();
2647
+ }));
2648
+ if (!this.#view) {
2649
+ this.#view = this.gridDirective.viewContainerRef;
2650
+ this.#view.createEmbeddedView(this.content);
2651
+ }
2637
2652
  this.#resizeObserver = new ResizeObserver(() => this.notifier$.next());
2638
2653
  const resizeRef = this.resizeRef ? this.resizeRef : this.renderer.parentNode(this.elementRef.nativeElement) ? this.renderer.parentNode(this.elementRef.nativeElement) : this.elementRef.nativeElement;
2639
2654
  this.#resizeObserver.observe(resizeRef);
2640
2655
  this.#subscription.add(this.notifier$.pipe(debounceTime(50)).subscribe(() => {
2641
2656
  this.#updateView();
2642
2657
  }));
2643
- }
2658
+ };
2644
2659
  #updateView = () => {
2645
2660
  this.itemTemplate = this.gridDirective.templateRef;
2646
2661
  const rowWidth = this.elementRef.nativeElement.offsetWidth || this.elementRef.nativeElement.firstChild.offsetWidth;