@mintplayer/ng-bootstrap 13.3.9 → 13.3.12

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.
Files changed (26) hide show
  1. package/esm2020/lib/components/accordion/accordion/accordion.component.mjs +3 -15
  2. package/esm2020/lib/components/accordion/accordion-tab/accordion-tab.component.mjs +36 -5
  3. package/esm2020/lib/components/accordion/accordion-tab-header/accordion-tab-header.component.mjs +2 -7
  4. package/esm2020/lib/components/accordion/accordion.module.mjs +15 -5
  5. package/esm2020/lib/components/accordion/from-overlay/from-overlay.directive.mjs +61 -0
  6. package/esm2020/lib/components/accordion/from-overlay-id/from-overlay-id.directive.mjs +45 -0
  7. package/esm2020/lib/components/accordion/index.mjs +3 -1
  8. package/esm2020/lib/components/context-menu/context-menu.directive.mjs +24 -11
  9. package/esm2020/lib/components/modal/component/modal/modal.component.mjs +1 -1
  10. package/esm2020/lib/components/modal/component/modal-content/modal-content.component.mjs +17 -5
  11. package/esm2020/lib/components/modal/service/modal.service.mjs +3 -2
  12. package/esm2020/lib/components/scheduler/components/scheduler/scheduler.component.mjs +4 -12
  13. package/esm2020/lib/services/calendar-month/calendar-month.service.mjs +5 -7
  14. package/fesm2015/mintplayer-ng-bootstrap.mjs +188 -56
  15. package/fesm2015/mintplayer-ng-bootstrap.mjs.map +1 -1
  16. package/fesm2020/mintplayer-ng-bootstrap.mjs +190 -60
  17. package/fesm2020/mintplayer-ng-bootstrap.mjs.map +1 -1
  18. package/lib/components/accordion/accordion/accordion.component.d.ts +3 -4
  19. package/lib/components/accordion/accordion-tab/accordion-tab.component.d.ts +7 -2
  20. package/lib/components/accordion/accordion.module.d.ts +4 -2
  21. package/lib/components/accordion/from-overlay/from-overlay.directive.d.ts +20 -0
  22. package/lib/components/accordion/from-overlay-id/from-overlay-id.directive.d.ts +16 -0
  23. package/lib/components/accordion/index.d.ts +2 -0
  24. package/lib/components/modal/component/modal-content/modal-content.component.d.ts +2 -0
  25. package/lib/components/modal/service/modal.service.d.ts +1 -1
  26. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { forwardRef, Component, ContentChildren, 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 { EventEmitter, Component, ContentChildren, forwardRef, Output, Input, Directive, ElementRef, NgModule, Injectable, Pipe, HostBinding, InjectionToken, Inject, HostListener, Injector, ViewChild, 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';
6
- import { Subject, BehaviorSubject, map, takeUntil, filter, take, Observable, combineLatest, debounceTime } from 'rxjs';
6
+ import { Subject, takeUntil, BehaviorSubject, combineLatest, filter, map, take, Observable, debounceTime } from 'rxjs';
7
7
  import { map as map$1, takeUntil as takeUntil$1, take as take$1 } from 'rxjs/operators';
8
8
  import * as i1$1 from '@angular/cdk/overlay';
9
9
  import { OverlayModule } from '@angular/cdk/overlay';
@@ -21,34 +21,53 @@ import { FormsModule } from '@angular/forms';
21
21
 
22
22
  class BsAccordionTabComponent {
23
23
  constructor(accordion) {
24
+ this.tabOverlayIdentifier = null;
25
+ //#region IsActive
26
+ this.isActiveChange = new EventEmitter();
27
+ this._isActive = false;
24
28
  this.accordion = accordion;
25
29
  }
30
+ get isActive() {
31
+ return this._isActive;
32
+ }
33
+ set isActive(value) {
34
+ if (this._isActive !== value) {
35
+ this._isActive = value;
36
+ if (this._isActive) {
37
+ this.accordion.tabPages.filter((tab) => {
38
+ return tab !== this;
39
+ }).forEach((tab) => {
40
+ tab.isActive = false;
41
+ });
42
+ }
43
+ else {
44
+ this.childAccordions.forEach((accordion) => {
45
+ accordion.tabPages.forEach((tab) => {
46
+ tab.isActive = false;
47
+ });
48
+ });
49
+ }
50
+ this.isActiveChange.emit(value);
51
+ }
52
+ }
26
53
  }
27
54
  BsAccordionTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionTabComponent, deps: [{ token: BsAccordionComponent }], target: i0.ɵɵFactoryTarget.Component });
28
- BsAccordionTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BsAccordionTabComponent, selector: "bs-accordion-tab", queries: [{ propertyName: "childAccordions", predicate: () => forwardRef(() => BsAccordionComponent) }], ngImport: i0, template: "<div class=\"card\">\n <ng-content select=\"bs-accordion-tab-header\"></ng-content>\n <div class=\"card-block overflow-hidden\" [@slideUpDown] *ngIf=\"accordion.activeTab === this\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".card,.card-header,.card-block{border-radius:0}.card{margin-bottom:-1px}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [SlideUpDownAnimation] });
55
+ BsAccordionTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BsAccordionTabComponent, selector: "bs-accordion-tab", inputs: { isActive: "isActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "childAccordions", predicate: i0.forwardRef(function () { return BsAccordionComponent; }) }], ngImport: i0, template: "<div class=\"card\" [@.disabled]=\"accordion.disableAnimations\">\n <ng-content select=\"bs-accordion-tab-header\"></ng-content>\n <div class=\"card-block overflow-hidden\" [@slideUpDown] *ngIf=\"isActive\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".card,.card-header,.card-block{border-radius:0}.card{margin-bottom:-1px}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [SlideUpDownAnimation] });
29
56
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionTabComponent, decorators: [{
30
57
  type: Component,
31
- args: [{ selector: 'bs-accordion-tab', animations: [SlideUpDownAnimation], template: "<div class=\"card\">\n <ng-content select=\"bs-accordion-tab-header\"></ng-content>\n <div class=\"card-block overflow-hidden\" [@slideUpDown] *ngIf=\"accordion.activeTab === this\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".card,.card-header,.card-block{border-radius:0}.card{margin-bottom:-1px}\n"] }]
58
+ args: [{ selector: 'bs-accordion-tab', animations: [SlideUpDownAnimation], template: "<div class=\"card\" [@.disabled]=\"accordion.disableAnimations\">\n <ng-content select=\"bs-accordion-tab-header\"></ng-content>\n <div class=\"card-block overflow-hidden\" [@slideUpDown] *ngIf=\"isActive\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".card,.card-header,.card-block{border-radius:0}.card{margin-bottom:-1px}\n"] }]
32
59
  }], ctorParameters: function () { return [{ type: BsAccordionComponent }]; }, propDecorators: { childAccordions: [{
33
60
  type: ContentChildren,
34
- args: [() => forwardRef(() => BsAccordionComponent)]
61
+ args: [forwardRef(() => BsAccordionComponent)]
62
+ }], isActiveChange: [{
63
+ type: Output
64
+ }], isActive: [{
65
+ type: Input
35
66
  }] } });
36
67
 
37
68
  class BsAccordionComponent {
38
69
  constructor() {
39
- //#region ActiveTab
40
- this._activeTab = null;
41
- }
42
- get activeTab() {
43
- return this._activeTab;
44
- }
45
- set activeTab(value) {
46
- this._activeTab = value;
47
- // this.tabPages.filter((tab) => tab !== value).forEach((tab) => {
48
- // tab.childAccordions.forEach((acc) => {
49
- // acc.activeTab = null;
50
- // });
51
- // });
70
+ this.disableAnimations = false;
52
71
  }
53
72
  }
54
73
  BsAccordionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -68,12 +87,7 @@ class BsAccordionTabHeaderComponent {
68
87
  }
69
88
  headerClicked(event) {
70
89
  event.preventDefault();
71
- if (this.accordion.activeTab === this.accordionTab) {
72
- this.accordion.activeTab = null;
73
- }
74
- else {
75
- this.accordion.activeTab = this.accordionTab;
76
- }
90
+ this.accordionTab.isActive = !this.accordionTab.isActive;
77
91
  }
78
92
  }
79
93
  BsAccordionTabHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionTabHeaderComponent, deps: [{ token: BsAccordionTabComponent }, { token: BsAccordionComponent }], target: i0.ɵɵFactoryTarget.Component });
@@ -83,14 +97,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
83
97
  args: [{ selector: 'bs-accordion-tab-header', template: "<div class=\"card-header cursor-pointer\" (click)=\"headerClicked($event)\">\n <ng-content></ng-content>\n</div>", styles: [""] }]
84
98
  }], ctorParameters: function () { return [{ type: BsAccordionTabComponent }, { type: BsAccordionComponent }]; } });
85
99
 
100
+ class BsFromOverlayIdDirective {
101
+ constructor(accordionTab, bsFromOverlay) {
102
+ this.accordionTab = accordionTab;
103
+ this.bsFromOverlay = bsFromOverlay;
104
+ this.destroyed$ = new Subject();
105
+ this.accordionTab.isActiveChange
106
+ .pipe(takeUntil(this.destroyed$))
107
+ .subscribe((isActive) => {
108
+ if (isActive) {
109
+ bsFromOverlay.bsFromOverlay = this.bsFromOverlayId;
110
+ }
111
+ else {
112
+ bsFromOverlay.bsFromOverlay = null;
113
+ }
114
+ });
115
+ }
116
+ ngOnDestroy() {
117
+ this.destroyed$.next(true);
118
+ }
119
+ get bsFromOverlayId() {
120
+ return this._bsFromOverlayId;
121
+ }
122
+ set bsFromOverlayId(value) {
123
+ this._bsFromOverlayId = value;
124
+ this.accordionTab['tabOverlayIdentifier'] = value;
125
+ }
126
+ }
127
+ BsFromOverlayIdDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsFromOverlayIdDirective, deps: [{ token: BsAccordionTabComponent }, { token: BsFromOverlayDirective }], target: i0.ɵɵFactoryTarget.Directive });
128
+ BsFromOverlayIdDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: BsFromOverlayIdDirective, selector: "bs-accordion-tab[bsFromOverlayId]", inputs: { bsFromOverlayId: "bsFromOverlayId" }, ngImport: i0 });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsFromOverlayIdDirective, decorators: [{
130
+ type: Directive,
131
+ args: [{
132
+ selector: 'bs-accordion-tab[bsFromOverlayId]'
133
+ }]
134
+ }], ctorParameters: function () { return [{ type: BsAccordionTabComponent }, { type: BsFromOverlayDirective }]; }, propDecorators: { bsFromOverlayId: [{
135
+ type: Input
136
+ }] } });
137
+
138
+ class BsFromOverlayDirective {
139
+ constructor(accordion) {
140
+ this.accordion = accordion;
141
+ this.inited$ = new BehaviorSubject(false);
142
+ this.destroyed$ = new Subject();
143
+ this.activeOverlayIdentifier$ = new BehaviorSubject(null);
144
+ this.bsFromOverlayChange = new EventEmitter();
145
+ this._bsFromOverlay = null;
146
+ this.accordion.disableAnimations = true;
147
+ combineLatest([this.inited$, this.activeOverlayIdentifier$])
148
+ .pipe(filter(([inited, activeOverlayIdentifier]) => {
149
+ return inited;
150
+ }))
151
+ // .pipe(debounceTime(5))
152
+ .pipe(takeUntil(this.destroyed$))
153
+ .subscribe(([inited, activeOverlayIdentifier]) => {
154
+ this.bsFromOverlayChange.emit(activeOverlayIdentifier);
155
+ this.accordion.tabPages.forEach((tab) => {
156
+ tab.isActive = (tab["tabOverlayIdentifier"] == activeOverlayIdentifier);
157
+ });
158
+ setTimeout(() => this.accordion.disableAnimations = false, 30);
159
+ });
160
+ }
161
+ get bsFromOverlay() {
162
+ return this._bsFromOverlay;
163
+ }
164
+ set bsFromOverlay(value) {
165
+ if (this._bsFromOverlay != value) {
166
+ this._bsFromOverlay = value;
167
+ this.activeOverlayIdentifier$.next(value);
168
+ }
169
+ }
170
+ ngAfterContentInit() {
171
+ this.inited$.next(true);
172
+ }
173
+ ngOnDestroy() {
174
+ this.destroyed$.next(true);
175
+ }
176
+ }
177
+ BsFromOverlayDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsFromOverlayDirective, deps: [{ token: BsAccordionComponent }], target: i0.ɵɵFactoryTarget.Directive });
178
+ BsFromOverlayDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: BsFromOverlayDirective, selector: "bs-accordion[bsFromOverlay]", inputs: { bsFromOverlay: "bsFromOverlay" }, outputs: { bsFromOverlayChange: "bsFromOverlayChange" }, queries: [{ propertyName: "tabPages", predicate: BsFromOverlayIdDirective, read: ElementRef }], ngImport: i0 });
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsFromOverlayDirective, decorators: [{
180
+ type: Directive,
181
+ args: [{
182
+ selector: 'bs-accordion[bsFromOverlay]'
183
+ }]
184
+ }], ctorParameters: function () { return [{ type: BsAccordionComponent }]; }, propDecorators: { bsFromOverlayChange: [{
185
+ type: Output
186
+ }], bsFromOverlay: [{
187
+ type: Input
188
+ }], tabPages: [{
189
+ type: ContentChildren,
190
+ args: [BsFromOverlayIdDirective, { read: ElementRef }]
191
+ }] } });
192
+
86
193
  class BsAccordionModule {
87
194
  }
88
195
  BsAccordionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
89
196
  BsAccordionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionModule, declarations: [BsAccordionComponent,
90
197
  BsAccordionTabComponent,
91
- BsAccordionTabHeaderComponent], imports: [CommonModule], exports: [BsAccordionComponent,
198
+ BsAccordionTabHeaderComponent,
199
+ BsFromOverlayDirective,
200
+ BsFromOverlayIdDirective], imports: [CommonModule], exports: [BsAccordionComponent,
92
201
  BsAccordionTabComponent,
93
- BsAccordionTabHeaderComponent] });
202
+ BsAccordionTabHeaderComponent,
203
+ BsFromOverlayDirective,
204
+ BsFromOverlayIdDirective] });
94
205
  BsAccordionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsAccordionModule, imports: [[
95
206
  CommonModule
96
207
  ]] });
@@ -100,7 +211,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
100
211
  declarations: [
101
212
  BsAccordionComponent,
102
213
  BsAccordionTabComponent,
103
- BsAccordionTabHeaderComponent
214
+ BsAccordionTabHeaderComponent,
215
+ BsFromOverlayDirective,
216
+ BsFromOverlayIdDirective
104
217
  ],
105
218
  imports: [
106
219
  CommonModule
@@ -108,7 +221,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
108
221
  exports: [
109
222
  BsAccordionComponent,
110
223
  BsAccordionTabComponent,
111
- BsAccordionTabHeaderComponent
224
+ BsAccordionTabHeaderComponent,
225
+ BsFromOverlayDirective,
226
+ BsFromOverlayIdDirective
112
227
  ]
113
228
  }]
114
229
  }] });
@@ -206,12 +321,10 @@ class BsCalendarMonthService {
206
321
  };
207
322
  });
208
323
  const weeks = this.chunk(allDays, 7);
209
- const weeksMapped = weeks.map((w, i) => {
210
- return {
211
- number: this.weekOfYear(new Date(month.getFullYear(), month.getMonth(), w.find(d => d.isInMonth)?.dayOfMonth)),
212
- days: w
213
- };
214
- });
324
+ const weeksMapped = weeks.map((w, i) => ({
325
+ number: this.weekOfYear(new Date(month.getFullYear(), month.getMonth(), w.find(d => d.isInMonth)?.dayOfMonth)),
326
+ days: w
327
+ }));
215
328
  return weeksMapped;
216
329
  }
217
330
  generateList(count) {
@@ -932,21 +1045,34 @@ class BsContextMenuDirective {
932
1045
  this.element.nativeElement.oncontextmenu = (ev) => {
933
1046
  ev.preventDefault();
934
1047
  this.checkAndCloseExisting(ev);
1048
+ const target = {
1049
+ getBoundingClientRect: () => {
1050
+ console.log('getBoundingClientRect', {
1051
+ clientX: ev.clientX,
1052
+ clientY: ev.clientY,
1053
+ scrollY: window.scrollY,
1054
+ });
1055
+ return ({
1056
+ width: 0,
1057
+ height: 0,
1058
+ top: ev.clientY + window.scrollY,
1059
+ left: ev.clientX,
1060
+ bottom: ev.clientY + window.scrollY,
1061
+ right: ev.clientX,
1062
+ });
1063
+ },
1064
+ };
1065
+ const element = new ElementRef(target);
935
1066
  this.overlayRef = this.overlay.create({
936
1067
  hasBackdrop: false,
937
1068
  scrollStrategy: this.overlay.scrollStrategies.reposition(),
938
1069
  positionStrategy: this.overlay.position()
939
- // .flexibleConnectedTo({ x: ev.x, y: ev.y })
940
- .flexibleConnectedTo(this.element)
1070
+ .flexibleConnectedTo(element)
941
1071
  .withPositions([
942
- // element: TopLeft - dropdown: TopLeft
943
- { originX: "start", originY: "top", overlayX: "start", overlayY: "top", offsetX: ev.offsetX, offsetY: ev.offsetY },
944
- // // element: TopLeft - dropdown: BottomLeft
945
- // { originX: "start", originY: "top", overlayX: "start", overlayY: "bottom", offsetX: ev.offsetX, offsetY: ev.offsetY },
946
- // // element: TopLeft - dropdown: TopRight
947
- // { originX: "start", originY: "top", overlayX: "end", overlayY: "top", offsetX: ev.offsetX, offsetY: ev.offsetY },
948
- // // element: TopLeft - dropdown: BottomRight
949
- // { originX: "start", originY: "top", overlayX: "end", overlayY: "bottom", offsetX: ev.offsetX, offsetY: ev.offsetY },
1072
+ { originX: "end", originY: "top", overlayX: "start", overlayY: "top" },
1073
+ { originX: "end", originY: "bottom", overlayX: "start", overlayY: "bottom" },
1074
+ { originX: "start", originY: "top", overlayX: "end", overlayY: "top" },
1075
+ { originX: "start", originY: "bottom", overlayX: "end", overlayY: "bottom" },
950
1076
  ])
951
1077
  });
952
1078
  this.templatePortal = new TemplatePortal(this.templateRef, this.viewContainerRef);
@@ -2271,9 +2397,7 @@ class BsSchedulerComponent {
2271
2397
  }
2272
2398
  }));
2273
2399
  this.daysOfWeekWithTimestamps$ = this.shownDays$
2274
- .pipe(map((shownDays) => {
2275
- return { start: shownDays[0].getTime(), end: shownDays[shownDays.length - 1].getTime() + 24 * 60 * 60 * 1000 };
2276
- }));
2400
+ .pipe(map((shownDays) => ({ start: shownDays[0].getTime(), end: shownDays[shownDays.length - 1].getTime() + 24 * 60 * 60 * 1000 })));
2277
2401
  this.events$ = this.resources$
2278
2402
  .pipe(map((resourcesOrGroups) => resourcesOrGroups.map(resOrGroup => this.getResourcesForGroup(resOrGroup))))
2279
2403
  .pipe(map(jaggedResources => jaggedResources.reduce((flat, toFlatten) => flat.concat(toFlatten), [])))
@@ -2319,15 +2443,9 @@ class BsSchedulerComponent {
2319
2443
  .filter((e) => !!e)
2320
2444
  .map((e) => e);
2321
2445
  const timeline = this.timelineService.getTimeline(events);
2322
- const result = timeline.map(track => {
2323
- return track.events.map(ev => {
2324
- return { event: ev, index: track.index };
2325
- });
2326
- })
2446
+ const result = timeline.map(track => track.events.map(ev => ({ event: ev, index: track.index })))
2327
2447
  .reduce((flat, toFlatten) => flat.concat(toFlatten), [])
2328
- .map((evi) => eventParts.filter(p => p.event === evi.event).map(p => {
2329
- return { part: p, index: evi.index };
2330
- }))
2448
+ .map((evi) => eventParts.filter(p => p.event === evi.event).map(p => ({ part: p, index: evi.index })))
2331
2449
  .reduce((flat, toFlatten) => flat.concat(toFlatten), []);
2332
2450
  return {
2333
2451
  total: timeline.length,
@@ -2874,7 +2992,8 @@ const MODAL_CONTENT = new InjectionToken('ModalContent');
2874
2992
  class BsModalContentComponent {
2875
2993
  constructor(content) {
2876
2994
  this.instance = null;
2877
- //#region Monitor @slideUpDown hooks
2995
+ this.closeOnEscape = false;
2996
+ //#region Monitor @fadeInOut hooks
2878
2997
  this.animationState = '';
2879
2998
  this.animationStateChanged = new EventEmitter();
2880
2999
  this.content = content;
@@ -2882,16 +3001,26 @@ class BsModalContentComponent {
2882
3001
  onAnimationChanged(event) {
2883
3002
  this.animationStateChanged.emit(event);
2884
3003
  }
3004
+ //#endregion
3005
+ onKeyDown(ev) {
3006
+ if (this.closeOnEscape && ev.code === 'Escape') {
3007
+ this.animationStateChanged.pipe(filter(ev => ev.phaseName === 'done' && ev.toState === 'void'), take(1)).subscribe(() => this.instance?.overlay.dispose());
3008
+ this.animationState = 'void';
3009
+ }
3010
+ }
2885
3011
  }
2886
3012
  BsModalContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsModalContentComponent, deps: [{ token: MODAL_CONTENT }], target: i0.ɵɵFactoryTarget.Component });
2887
- BsModalContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BsModalContentComponent, selector: "bs-modal-content", ngImport: i0, template: "<div class=\"modal d-block\" tabindex=\"-1\"\n [@fadeInOut]=\"animationState\"\n (@fadeInOut.start)=\"onAnimationChanged($event)\"\n (@fadeInOut.done)=\"onAnimationChanged($event)\">\n\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: this }\" ></ng-container>\n\n</div>", styles: [""], directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [FadeInOutAnimation] });
3013
+ BsModalContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BsModalContentComponent, selector: "bs-modal-content", host: { listeners: { "keydown": "onKeyDown($event)" } }, ngImport: i0, template: "<div class=\"modal d-block\" tabindex=\"-1\"\n [@fadeInOut]=\"animationState\"\n (@fadeInOut.start)=\"onAnimationChanged($event)\"\n (@fadeInOut.done)=\"onAnimationChanged($event)\">\n\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: this }\" ></ng-container>\n\n</div>", styles: [""], directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [FadeInOutAnimation] });
2888
3014
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BsModalContentComponent, decorators: [{
2889
3015
  type: Component,
2890
3016
  args: [{ selector: 'bs-modal-content', animations: [FadeInOutAnimation], template: "<div class=\"modal d-block\" tabindex=\"-1\"\n [@fadeInOut]=\"animationState\"\n (@fadeInOut.start)=\"onAnimationChanged($event)\"\n (@fadeInOut.done)=\"onAnimationChanged($event)\">\n\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: this }\" ></ng-container>\n\n</div>", styles: [""] }]
2891
3017
  }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
2892
3018
  type: Inject,
2893
3019
  args: [MODAL_CONTENT]
2894
- }] }]; } });
3020
+ }] }]; }, propDecorators: { onKeyDown: [{
3021
+ type: HostListener,
3022
+ args: ['keydown', ['$event']]
3023
+ }] } });
2895
3024
 
2896
3025
  class BsModalHeaderDirective {
2897
3026
  constructor(modal, template) {
@@ -2980,7 +3109,7 @@ class BsModalService {
2980
3109
  this.parentInjector = parentInjector;
2981
3110
  this.componentFactoryResolver = componentFactoryResolver;
2982
3111
  }
2983
- show(template) {
3112
+ show(template, closeOnEscape = false) {
2984
3113
  const injector = Injector.create({
2985
3114
  providers: [{ provide: MODAL_CONTENT, useValue: template }],
2986
3115
  parent: this.parentInjector
@@ -2998,6 +3127,7 @@ class BsModalService {
2998
3127
  component: componentInstance,
2999
3128
  overlay: overlayRef
3000
3129
  };
3130
+ componentInstance.instance.closeOnEscape = closeOnEscape;
3001
3131
  return componentInstance.instance;
3002
3132
  }
3003
3133
  hide(modal) {
@@ -4838,5 +4968,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
4838
4968
  * Generated bundle index. Do not edit.
4839
4969
  */
4840
4970
 
4841
- export { BsAccordionComponent, BsAccordionModule, BsAccordionTabComponent, BsAccordionTabHeaderComponent, BsAlertCloseComponent, BsAlertComponent, BsAlertModule, BsButtonTemplateDirective, BsCalendarComponent, BsCalendarModule, BsCardComponent, BsCardHeaderComponent, BsCardModule, BsCarouselComponent, BsCarouselImageDirective, BsCarouselModule, BsCodeSnippetComponent, BsCodeSnippetModule, BsContextMenuDirective, BsContextMenuModule, BsCopyDirective, BsCopyModule, BsDatatableColumnDirective, BsDatatableComponent, BsDatatableModule, BsDatepickerComponent, BsDatepickerModule, BsDropdownDirective, BsDropdownMenuDirective, BsDropdownModule, BsDropdownToggleDirective, BsExpandButtonDirective, BsFileUploadComponent, BsFileUploadModule, BsFileUploadTemplateDirective, BsFontColorPipe, BsFontColorPipeModule, BsFooterTemplateDirective, BsForDirective, BsForModule, BsFormatBytesModule, BsFormatBytesPipe, BsHeaderTemplateDirective, BsItemTemplateDirective, BsListGroupComponent, BsListGroupItemComponent, BsListGroupModule, BsModalBodyDirective, BsModalComponent, BsModalContentComponent, BsModalFooterDirective, BsModalHeaderDirective, BsModalModule, BsModalService, BsMultiselectComponent, BsMultiselectModule, BsNavbarBrandComponent, BsNavbarComponent, BsNavbarDropdownComponent, BsNavbarItemComponent, BsNavbarModule, BsNavbarNavComponent, BsNavbarTogglerComponent, BsOffcanvasBodyComponent, BsOffcanvasCloseDirective, BsOffcanvasComponent, BsOffcanvasHeaderComponent, BsOffcanvasModule, BsOffcanvasService, BsPaginationComponent, BsPaginationModule, BsProgressBarComponent, BsProgressBarModule, BsProgressComponent, BsRatingComponent, BsRatingModule, BsRowTemplateDirective, BsSchedulerComponent, BsSchedulerModule, BsScrollspyComponent, BsScrollspyDirective, BsScrollspyModule, BsSelect2Component, BsSelect2Module, BsSnackbarCloseDirective, BsSnackbarComponent, BsSnackbarModule, BsSnackbarService, BsTabControlComponent, BsTabControlModule, BsTabPageComponent, BsTimepickerComponent, BsTimepickerModule, BsToggleButtonComponent, BsToggleButtonModule, BsTooltipDirective, BsTooltipModule, BsTypeaheadComponent, BsTypeaheadModule, Color, DatatableSettings, DropdownToggleDirective, ESchedulerMode, NavLinkDirective, NavbarContentDirective, Position, ResourceGroupPresenterComponent, availableScales };
4971
+ export { BsAccordionComponent, BsAccordionModule, BsAccordionTabComponent, BsAccordionTabHeaderComponent, BsAlertCloseComponent, BsAlertComponent, BsAlertModule, BsButtonTemplateDirective, BsCalendarComponent, BsCalendarModule, BsCardComponent, BsCardHeaderComponent, BsCardModule, BsCarouselComponent, BsCarouselImageDirective, BsCarouselModule, BsCodeSnippetComponent, BsCodeSnippetModule, BsContextMenuDirective, BsContextMenuModule, BsCopyDirective, BsCopyModule, BsDatatableColumnDirective, BsDatatableComponent, BsDatatableModule, BsDatepickerComponent, BsDatepickerModule, BsDropdownDirective, BsDropdownMenuDirective, BsDropdownModule, BsDropdownToggleDirective, BsExpandButtonDirective, BsFileUploadComponent, BsFileUploadModule, BsFileUploadTemplateDirective, BsFontColorPipe, BsFontColorPipeModule, BsFooterTemplateDirective, BsForDirective, BsForModule, BsFormatBytesModule, BsFormatBytesPipe, BsFromOverlayDirective, BsFromOverlayIdDirective, BsHeaderTemplateDirective, BsItemTemplateDirective, BsListGroupComponent, BsListGroupItemComponent, BsListGroupModule, BsModalBodyDirective, BsModalComponent, BsModalContentComponent, BsModalFooterDirective, BsModalHeaderDirective, BsModalModule, BsModalService, BsMultiselectComponent, BsMultiselectModule, BsNavbarBrandComponent, BsNavbarComponent, BsNavbarDropdownComponent, BsNavbarItemComponent, BsNavbarModule, BsNavbarNavComponent, BsNavbarTogglerComponent, BsOffcanvasBodyComponent, BsOffcanvasCloseDirective, BsOffcanvasComponent, BsOffcanvasHeaderComponent, BsOffcanvasModule, BsOffcanvasService, BsPaginationComponent, BsPaginationModule, BsProgressBarComponent, BsProgressBarModule, BsProgressComponent, BsRatingComponent, BsRatingModule, BsRowTemplateDirective, BsSchedulerComponent, BsSchedulerModule, BsScrollspyComponent, BsScrollspyDirective, BsScrollspyModule, BsSelect2Component, BsSelect2Module, BsSnackbarCloseDirective, BsSnackbarComponent, BsSnackbarModule, BsSnackbarService, BsTabControlComponent, BsTabControlModule, BsTabPageComponent, BsTimepickerComponent, BsTimepickerModule, BsToggleButtonComponent, BsToggleButtonModule, BsTooltipDirective, BsTooltipModule, BsTypeaheadComponent, BsTypeaheadModule, Color, DatatableSettings, DropdownToggleDirective, ESchedulerMode, NavLinkDirective, NavbarContentDirective, Position, ResourceGroupPresenterComponent, availableScales };
4842
4972
  //# sourceMappingURL=mintplayer-ng-bootstrap.mjs.map