@mintplayer/ng-bootstrap 13.3.10 → 13.3.11

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 { Component, ContentChildren, forwardRef, NgModule, Input, Injectable, Pipe, EventEmitter, Output, Directive, HostBinding, InjectionToken, Inject, HostListener, Injector, ViewChild, Host, SkipSelf, PLATFORM_ID, ContentChild, ViewChildren, Optional, TemplateRef } from '@angular/core';
2
+ import { Component, ContentChildren, forwardRef, EventEmitter, Output, Input, NgModule, Injectable, Pipe, Directive, HostBinding, InjectionToken, Inject, HostListener, Injector, ViewChild, ElementRef, Host, SkipSelf, PLATFORM_ID, ContentChild, ViewChildren, Optional, TemplateRef } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT, isPlatformServer } from '@angular/common';
5
5
  import { SlideUpDownAnimation, FadeInOutAnimation, CarouselSlideAnimation, ColorTransitionAnimation } from '@mintplayer/ng-animations';
@@ -37,6 +37,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
37
37
  class BsAccordionComponent {
38
38
  constructor() {
39
39
  //#region ActiveTab
40
+ this.activeTabChange = new EventEmitter();
40
41
  this._activeTab = null;
41
42
  }
42
43
  get activeTab() {
@@ -50,16 +51,21 @@ class BsAccordionComponent {
50
51
  acc.activeTab = null;
51
52
  });
52
53
  });
54
+ this.activeTabChange.emit(value);
53
55
  }
54
56
  }
55
57
  BsAccordionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
56
- BsAccordionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BsAccordionComponent, selector: "bs-accordion", queries: [{ propertyName: "tabPages", predicate: BsAccordionTabComponent }], ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
58
+ BsAccordionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BsAccordionComponent, selector: "bs-accordion", inputs: { activeTab: "activeTab" }, outputs: { activeTabChange: "activeTabChange" }, queries: [{ propertyName: "tabPages", predicate: BsAccordionTabComponent }], ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
57
59
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionComponent, decorators: [{
58
60
  type: Component,
59
61
  args: [{ selector: 'bs-accordion', template: "<ng-content></ng-content>", styles: [""] }]
60
62
  }], propDecorators: { tabPages: [{
61
63
  type: ContentChildren,
62
64
  args: [BsAccordionTabComponent]
65
+ }], activeTabChange: [{
66
+ type: Output
67
+ }], activeTab: [{
68
+ type: Input
63
69
  }] } });
64
70
 
65
71
  class BsAccordionTabHeaderComponent {
@@ -207,12 +213,10 @@ class BsCalendarMonthService {
207
213
  };
208
214
  });
209
215
  const weeks = this.chunk(allDays, 7);
210
- const weeksMapped = weeks.map((w, i) => {
211
- return {
212
- number: this.weekOfYear(new Date(month.getFullYear(), month.getMonth(), w.find(d => d.isInMonth)?.dayOfMonth)),
213
- days: w
214
- };
215
- });
216
+ const weeksMapped = weeks.map((w, i) => ({
217
+ number: this.weekOfYear(new Date(month.getFullYear(), month.getMonth(), w.find(d => d.isInMonth)?.dayOfMonth)),
218
+ days: w
219
+ }));
216
220
  return weeksMapped;
217
221
  }
218
222
  generateList(count) {
@@ -933,21 +937,34 @@ class BsContextMenuDirective {
933
937
  this.element.nativeElement.oncontextmenu = (ev) => {
934
938
  ev.preventDefault();
935
939
  this.checkAndCloseExisting(ev);
940
+ const target = {
941
+ getBoundingClientRect: () => {
942
+ console.log('getBoundingClientRect', {
943
+ clientX: ev.clientX,
944
+ clientY: ev.clientY,
945
+ scrollY: window.scrollY,
946
+ });
947
+ return ({
948
+ width: 0,
949
+ height: 0,
950
+ top: ev.clientY + window.scrollY,
951
+ left: ev.clientX,
952
+ bottom: ev.clientY + window.scrollY,
953
+ right: ev.clientX,
954
+ });
955
+ },
956
+ };
957
+ const element = new ElementRef(target);
936
958
  this.overlayRef = this.overlay.create({
937
959
  hasBackdrop: false,
938
960
  scrollStrategy: this.overlay.scrollStrategies.reposition(),
939
961
  positionStrategy: this.overlay.position()
940
- // .flexibleConnectedTo({ x: ev.x, y: ev.y })
941
- .flexibleConnectedTo(this.element)
962
+ .flexibleConnectedTo(element)
942
963
  .withPositions([
943
- // element: TopLeft - dropdown: TopLeft
944
- { originX: "start", originY: "top", overlayX: "start", overlayY: "top", offsetX: ev.offsetX, offsetY: ev.offsetY },
945
- // // element: TopLeft - dropdown: BottomLeft
946
- // { originX: "start", originY: "top", overlayX: "start", overlayY: "bottom", offsetX: ev.offsetX, offsetY: ev.offsetY },
947
- // // element: TopLeft - dropdown: TopRight
948
- // { originX: "start", originY: "top", overlayX: "end", overlayY: "top", offsetX: ev.offsetX, offsetY: ev.offsetY },
949
- // // element: TopLeft - dropdown: BottomRight
950
- // { originX: "start", originY: "top", overlayX: "end", overlayY: "bottom", offsetX: ev.offsetX, offsetY: ev.offsetY },
964
+ { originX: "end", originY: "top", overlayX: "start", overlayY: "top" },
965
+ { originX: "end", originY: "bottom", overlayX: "start", overlayY: "bottom" },
966
+ { originX: "start", originY: "top", overlayX: "end", overlayY: "top" },
967
+ { originX: "start", originY: "bottom", overlayX: "end", overlayY: "bottom" },
951
968
  ])
952
969
  });
953
970
  this.templatePortal = new TemplatePortal(this.templateRef, this.viewContainerRef);
@@ -2272,9 +2289,7 @@ class BsSchedulerComponent {
2272
2289
  }
2273
2290
  }));
2274
2291
  this.daysOfWeekWithTimestamps$ = this.shownDays$
2275
- .pipe(map((shownDays) => {
2276
- return { start: shownDays[0].getTime(), end: shownDays[shownDays.length - 1].getTime() + 24 * 60 * 60 * 1000 };
2277
- }));
2292
+ .pipe(map((shownDays) => ({ start: shownDays[0].getTime(), end: shownDays[shownDays.length - 1].getTime() + 24 * 60 * 60 * 1000 })));
2278
2293
  this.events$ = this.resources$
2279
2294
  .pipe(map((resourcesOrGroups) => resourcesOrGroups.map(resOrGroup => this.getResourcesForGroup(resOrGroup))))
2280
2295
  .pipe(map(jaggedResources => jaggedResources.reduce((flat, toFlatten) => flat.concat(toFlatten), [])))
@@ -2320,15 +2335,9 @@ class BsSchedulerComponent {
2320
2335
  .filter((e) => !!e)
2321
2336
  .map((e) => e);
2322
2337
  const timeline = this.timelineService.getTimeline(events);
2323
- const result = timeline.map(track => {
2324
- return track.events.map(ev => {
2325
- return { event: ev, index: track.index };
2326
- });
2327
- })
2338
+ const result = timeline.map(track => track.events.map(ev => ({ event: ev, index: track.index })))
2328
2339
  .reduce((flat, toFlatten) => flat.concat(toFlatten), [])
2329
- .map((evi) => eventParts.filter(p => p.event === evi.event).map(p => {
2330
- return { part: p, index: evi.index };
2331
- }))
2340
+ .map((evi) => eventParts.filter(p => p.event === evi.event).map(p => ({ part: p, index: evi.index })))
2332
2341
  .reduce((flat, toFlatten) => flat.concat(toFlatten), []);
2333
2342
  return {
2334
2343
  total: timeline.length,