@mintplayer/ng-bootstrap 13.1.21 → 13.1.26

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 (52) hide show
  1. package/_bootstrap.scss +0 -1
  2. package/esm2020/lib/components/context-menu/context-menu.directive.mjs +1 -2
  3. package/esm2020/lib/components/file-upload/component/file-upload.component.mjs +1 -2
  4. package/esm2020/lib/components/index.mjs +2 -1
  5. package/esm2020/lib/components/modal/service/modal.service.mjs +1 -2
  6. package/esm2020/lib/components/navbar/navbar/navbar.component.mjs +7 -4
  7. package/esm2020/lib/components/navbar/navbar-item/navbar-item.component.mjs +12 -6
  8. package/esm2020/lib/components/navbar/navbar-toggler/navbar-toggler.component.mjs +8 -5
  9. package/esm2020/lib/components/scheduler/components/index.mjs +2 -0
  10. package/esm2020/lib/components/scheduler/components/scheduler/scheduler.component.mjs +346 -0
  11. package/esm2020/lib/components/scheduler/enums/drag-operation.mjs +8 -0
  12. package/esm2020/lib/components/scheduler/index.mjs +3 -0
  13. package/esm2020/lib/components/scheduler/interfaces/drag-operation.mjs +2 -0
  14. package/esm2020/lib/components/scheduler/interfaces/preview-event.mjs +2 -0
  15. package/esm2020/lib/components/scheduler/interfaces/scheduler-event-part.mjs +2 -0
  16. package/esm2020/lib/components/scheduler/interfaces/scheduler-event-with-parts.mjs +2 -0
  17. package/esm2020/lib/components/scheduler/interfaces/scheduler-event.mjs +2 -0
  18. package/esm2020/lib/components/scheduler/interfaces/time-slot.mjs +2 -0
  19. package/esm2020/lib/components/scheduler/interfaces/timeline-track.mjs +2 -0
  20. package/esm2020/lib/components/scheduler/pipes/bs-seconds-timespan.pipe/bs-seconds-timespan.pipe.mjs +16 -0
  21. package/esm2020/lib/components/scheduler/pipes/bs-seconds-today-offset/bs-seconds-today-offset.pipe.mjs +20 -0
  22. package/esm2020/lib/components/scheduler/pipes/date-offset/date-offset.pipe.mjs +20 -0
  23. package/esm2020/lib/components/scheduler/pipes/day-of-week/day-of-week.pipe.mjs +22 -0
  24. package/esm2020/lib/components/scheduler/scheduler.module.mjs +38 -0
  25. package/esm2020/lib/components/scheduler/services/timeline/timeline.service.mjs +65 -0
  26. package/esm2020/lib/services/calendar-month/calendar-month.service.mjs +1 -1
  27. package/fesm2015/mintplayer-ng-bootstrap.mjs +526 -14
  28. package/fesm2015/mintplayer-ng-bootstrap.mjs.map +1 -1
  29. package/fesm2020/mintplayer-ng-bootstrap.mjs +526 -14
  30. package/fesm2020/mintplayer-ng-bootstrap.mjs.map +1 -1
  31. package/lib/components/index.d.ts +1 -0
  32. package/lib/components/navbar/navbar/navbar.component.d.ts +2 -1
  33. package/lib/components/navbar/navbar-item/navbar-item.component.d.ts +4 -2
  34. package/lib/components/navbar/navbar-toggler/navbar-toggler.component.d.ts +1 -1
  35. package/lib/components/scheduler/components/index.d.ts +1 -0
  36. package/lib/components/scheduler/components/scheduler/scheduler.component.d.ts +58 -0
  37. package/lib/components/scheduler/enums/drag-operation.d.ts +6 -0
  38. package/lib/components/scheduler/index.d.ts +2 -0
  39. package/lib/components/scheduler/interfaces/drag-operation.d.ts +6 -0
  40. package/lib/components/scheduler/interfaces/preview-event.d.ts +4 -0
  41. package/lib/components/scheduler/interfaces/scheduler-event-part.d.ts +6 -0
  42. package/lib/components/scheduler/interfaces/scheduler-event-with-parts.d.ts +6 -0
  43. package/lib/components/scheduler/interfaces/scheduler-event.d.ts +6 -0
  44. package/lib/components/scheduler/interfaces/time-slot.d.ts +4 -0
  45. package/lib/components/scheduler/interfaces/timeline-track.d.ts +5 -0
  46. package/lib/components/scheduler/pipes/bs-seconds-timespan.pipe/bs-seconds-timespan.pipe.d.ts +9 -0
  47. package/lib/components/scheduler/pipes/bs-seconds-today-offset/bs-seconds-today-offset.pipe.d.ts +9 -0
  48. package/lib/components/scheduler/pipes/date-offset/date-offset.pipe.d.ts +8 -0
  49. package/lib/components/scheduler/pipes/day-of-week/day-of-week.pipe.d.ts +9 -0
  50. package/lib/components/scheduler/scheduler.module.d.ts +12 -0
  51. package/lib/components/scheduler/services/timeline/timeline.service.d.ts +14 -0
  52. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ContentChildren, NgModule, Input, Injectable, Pipe, EventEmitter, Output, Directive, HostBinding, InjectionToken, Inject, HostListener, Injector, ViewChild, Host, SkipSelf, forwardRef, PLATFORM_ID, ContentChild, Optional, ViewChildren, TemplateRef } from '@angular/core';
2
+ import { Component, ContentChildren, NgModule, Input, Injectable, Pipe, EventEmitter, Output, Directive, HostBinding, InjectionToken, Inject, HostListener, Injector, ViewChild, Host, SkipSelf, forwardRef, PLATFORM_ID, ContentChild, ViewChildren, Optional, TemplateRef } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT } from '@angular/common';
5
5
  import { SlideUpDownAnimation, FadeInOutAnimation, CarouselSlideAnimation, ColorTransitionAnimation } from '@mintplayer/ng-animations';
@@ -925,7 +925,6 @@ class BsContextMenuDirective {
925
925
  this.element.nativeElement.oncontextmenu = (ev) => {
926
926
  ev.preventDefault();
927
927
  this.checkAndCloseExisting(ev);
928
- console.log('d', element.nativeElement);
929
928
  this.overlayRef = this.overlay.create({
930
929
  hasBackdrop: false,
931
930
  scrollStrategy: this.overlay.scrollStrategies.reposition(),
@@ -1804,7 +1803,6 @@ class BsFileUploadComponent {
1804
1803
  this.filesDropped = new EventEmitter();
1805
1804
  }
1806
1805
  onChange(event) {
1807
- console.log('event', event);
1808
1806
  if (!event.target)
1809
1807
  return;
1810
1808
  if (!('files' in event.target))
@@ -1991,6 +1989,511 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
1991
1989
  }]
1992
1990
  }] });
1993
1991
 
1992
+ var EDragOperation;
1993
+ (function (EDragOperation) {
1994
+ EDragOperation[EDragOperation["none"] = 0] = "none";
1995
+ EDragOperation[EDragOperation["createEvent"] = 1] = "createEvent";
1996
+ EDragOperation[EDragOperation["resizeEvent"] = 2] = "resizeEvent";
1997
+ EDragOperation[EDragOperation["moveEvent"] = 3] = "moveEvent";
1998
+ })(EDragOperation || (EDragOperation = {}));
1999
+
2000
+ class BsTimelineService {
2001
+ splitInParts(event) {
2002
+ let startTime = event.start;
2003
+ const result = [];
2004
+ const eventOrNull = 'color' in event ? event : null;
2005
+ while (!this.dateEquals(startTime, event.end)) {
2006
+ const end = new Date(startTime.getFullYear(), startTime.getMonth(), startTime.getDate() + 1, 0, 0, 0);
2007
+ result.push({ start: startTime, end: end, event: eventOrNull });
2008
+ startTime = end;
2009
+ }
2010
+ if (startTime != event.end) {
2011
+ result.push({ start: startTime, end: event.end, event: eventOrNull });
2012
+ }
2013
+ return { event: event, parts: result };
2014
+ }
2015
+ dateEquals(date1, date2) {
2016
+ return (date1.getFullYear() === date2.getFullYear() &&
2017
+ date1.getMonth() === date2.getMonth() &&
2018
+ date1.getDate() === date2.getDate());
2019
+ }
2020
+ getTimeline(events) {
2021
+ const timestamps = this.getTimestamps(events);
2022
+ const tracks = [];
2023
+ timestamps.forEach((timestamp, tIndex) => {
2024
+ const starting = events.filter((e) => e.start === timestamp);
2025
+ // const ending = events.filter((e) => e.end === timestamp);
2026
+ starting.forEach((startedEvent, eIndex) => {
2027
+ const freeTracks = tracks.filter(t => this.trackIsFreeAt(t, startedEvent));
2028
+ if (freeTracks.length === 0) {
2029
+ tracks.push({ index: tracks.length, events: [startedEvent] });
2030
+ }
2031
+ else {
2032
+ freeTracks[0].events.push(startedEvent);
2033
+ }
2034
+ });
2035
+ });
2036
+ return tracks;
2037
+ }
2038
+ getTimestamps(events) {
2039
+ const allTimestamps = events.map(e => [e.start, e.end])
2040
+ .reduce((flat, toFlatten) => flat.concat(toFlatten), []);
2041
+ return allTimestamps
2042
+ .filter((t, i) => allTimestamps.indexOf(t) === i)
2043
+ .sort((t1, t2) => t1 - t2);
2044
+ }
2045
+ trackIsFreeAt(track, event) {
2046
+ if (track.events.every((ev) => (ev.end <= event.start) || (event.end <= ev.start))) {
2047
+ return true;
2048
+ }
2049
+ else {
2050
+ return false;
2051
+ }
2052
+ }
2053
+ }
2054
+ BsTimelineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsTimelineService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2055
+ BsTimelineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsTimelineService, providedIn: 'root' });
2056
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsTimelineService, decorators: [{
2057
+ type: Injectable,
2058
+ args: [{
2059
+ providedIn: 'root'
2060
+ }]
2061
+ }] });
2062
+
2063
+ class BsSecondsTodayOffsetPipe {
2064
+ transform(value) {
2065
+ const today = new Date(value.start);
2066
+ today.setHours(0);
2067
+ today.setMinutes(0);
2068
+ today.setSeconds(0);
2069
+ return (value.start.getTime() - today.getTime()) / 1000;
2070
+ }
2071
+ }
2072
+ BsSecondsTodayOffsetPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTodayOffsetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2073
+ BsSecondsTodayOffsetPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTodayOffsetPipe, name: "bsSecondsTodayOffset" });
2074
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTodayOffsetPipe, decorators: [{
2075
+ type: Pipe,
2076
+ args: [{
2077
+ name: 'bsSecondsTodayOffset'
2078
+ }]
2079
+ }] });
2080
+
2081
+ class BsSecondsTimespanPipe {
2082
+ transform(value) {
2083
+ return (value.end.getTime() - value.start.getTime()) / 1000;
2084
+ }
2085
+ }
2086
+ BsSecondsTimespanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTimespanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2087
+ BsSecondsTimespanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTimespanPipe, name: "bsSecondsTimespan" });
2088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTimespanPipe, decorators: [{
2089
+ type: Pipe,
2090
+ args: [{
2091
+ name: 'bsSecondsTimespan'
2092
+ }]
2093
+ }] });
2094
+
2095
+ class DayOfWeekPipe {
2096
+ transform(value) {
2097
+ const dayOfWeek = value.start.getDay();
2098
+ if (dayOfWeek === 0) {
2099
+ return 7;
2100
+ }
2101
+ else {
2102
+ return dayOfWeek;
2103
+ }
2104
+ }
2105
+ }
2106
+ DayOfWeekPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DayOfWeekPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2107
+ DayOfWeekPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DayOfWeekPipe, name: "dayOfWeek" });
2108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DayOfWeekPipe, decorators: [{
2109
+ type: Pipe,
2110
+ args: [{
2111
+ name: 'dayOfWeek'
2112
+ }]
2113
+ }] });
2114
+
2115
+ class BsSchedulerComponent {
2116
+ constructor(calendarMonthService, timelineService) {
2117
+ this.calendarMonthService = calendarMonthService;
2118
+ this.timelineService = timelineService;
2119
+ this.events$ = new BehaviorSubject([]);
2120
+ this.previewEvent$ = new BehaviorSubject(null);
2121
+ this.timeSlotDuration$ = new BehaviorSubject(1800);
2122
+ this.mouseState$ = new BehaviorSubject(false);
2123
+ this.hoveredTimeSlot$ = new BehaviorSubject(null);
2124
+ this.destroyed$ = new Subject();
2125
+ //#region UnitHeight
2126
+ this.unitHeight$ = new BehaviorSubject(40);
2127
+ this.unitHeightChange = new EventEmitter();
2128
+ this.operation = null;
2129
+ this.dragStartTimeslot = null;
2130
+ const monday = this.calendarMonthService.getMondayBefore(new Date());
2131
+ this.currentWeek$ = new BehaviorSubject(monday);
2132
+ this.daysOfWeek$ = this.currentWeek$.pipe(map((weekMonday) => {
2133
+ weekMonday.setHours(0);
2134
+ weekMonday.setMinutes(0);
2135
+ weekMonday.setSeconds(0);
2136
+ weekMonday.setMilliseconds(0);
2137
+ return Array.from(Array(7).keys()).map((x) => this.addDays(weekMonday, x));
2138
+ }));
2139
+ this.daysOfWeekWithTimestamps$ = this.daysOfWeek$
2140
+ .pipe(map((daysOfWeek) => {
2141
+ return { start: daysOfWeek[0].getTime(), end: daysOfWeek[daysOfWeek.length - 1].getTime() + 24 * 60 * 60 * 1000 };
2142
+ }));
2143
+ this.eventParts$ = this.events$.pipe(map((events) => events.map((ev) => this.timelineService.splitInParts(ev))));
2144
+ this.eventPartsForThisWeek$ = combineLatest([
2145
+ this.daysOfWeekWithTimestamps$,
2146
+ this.eventParts$
2147
+ .pipe(map(eventParts => eventParts.map(evp => evp.parts)))
2148
+ .pipe(map(jaggedParts => {
2149
+ return jaggedParts.reduce((flat, toFlatten) => flat.concat(toFlatten), []);
2150
+ }))
2151
+ ])
2152
+ .pipe(map(([startAndEnd, eventParts]) => {
2153
+ return eventParts.filter(eventPart => {
2154
+ return !((eventPart.end.getTime() <= startAndEnd.start) || (eventPart.start.getTime() >= startAndEnd.end));
2155
+ });
2156
+ }));
2157
+ this.previewEventParts$ = this.previewEvent$.pipe(map((event) => {
2158
+ if (event) {
2159
+ return this.timelineService.splitInParts(event);
2160
+ }
2161
+ else {
2162
+ return null;
2163
+ }
2164
+ }));
2165
+ this.previewEventPartsForThisWeek$ = combineLatest([this.daysOfWeekWithTimestamps$, this.previewEventParts$])
2166
+ .pipe(map(([startAndEnd, previewEventParts]) => {
2167
+ if (previewEventParts) {
2168
+ return previewEventParts.parts.filter(eventPart => {
2169
+ return !((eventPart.end.getTime() <= startAndEnd.start) || (eventPart.start.getTime() >= startAndEnd.end));
2170
+ });
2171
+ }
2172
+ else {
2173
+ return [];
2174
+ }
2175
+ }));
2176
+ this.timelinedEventPartsForThisWeek$ = this.eventPartsForThisWeek$
2177
+ .pipe(map(eventParts => {
2178
+ // We'll only use the events for this week
2179
+ const events = eventParts.map(ep => ep.event)
2180
+ .filter((e, i, list) => list.indexOf(e) === i)
2181
+ .filter((e) => !!e)
2182
+ .map((e) => e);
2183
+ const timeline = this.timelineService.getTimeline(events);
2184
+ const result = timeline.map(track => {
2185
+ return track.events.map(ev => {
2186
+ return { event: ev, index: track.index };
2187
+ });
2188
+ })
2189
+ .reduce((flat, toFlatten) => flat.concat(toFlatten), [])
2190
+ .map((evi) => eventParts.filter(p => p.event === evi.event).map(p => {
2191
+ return { part: p, index: evi.index };
2192
+ }))
2193
+ .reduce((flat, toFlatten) => flat.concat(toFlatten), []);
2194
+ return {
2195
+ total: timeline.length,
2196
+ parts: result
2197
+ };
2198
+ }));
2199
+ this.timeSlots$ = combineLatest([this.daysOfWeek$, this.timeSlotDuration$])
2200
+ .pipe(map(([daysOfWeek, duration]) => {
2201
+ const timeSlotsPerDay = Math.floor((60 * 60 * 24) / duration);
2202
+ return Array.from(Array(timeSlotsPerDay).keys()).map((index) => {
2203
+ const timeSlotStart = new Date(daysOfWeek[0]);
2204
+ timeSlotStart.setSeconds(timeSlotStart.getSeconds() + index * duration);
2205
+ const timeSlotEnd = new Date(timeSlotStart);
2206
+ timeSlotEnd.setSeconds(timeSlotEnd.getSeconds() + duration);
2207
+ return daysOfWeek.map((day) => {
2208
+ const start = new Date(day);
2209
+ start.setHours(timeSlotStart.getHours());
2210
+ start.setMinutes(timeSlotStart.getMinutes());
2211
+ start.setSeconds(timeSlotStart.getSeconds());
2212
+ start.setMilliseconds(timeSlotStart.getMilliseconds());
2213
+ const end = new Date(day);
2214
+ end.setHours(timeSlotEnd.getHours());
2215
+ end.setMinutes(timeSlotEnd.getMinutes());
2216
+ end.setSeconds(timeSlotEnd.getSeconds());
2217
+ end.setMilliseconds(timeSlotEnd.getMilliseconds());
2218
+ return { start, end };
2219
+ });
2220
+ });
2221
+ }));
2222
+ this.unitHeight$
2223
+ .pipe(takeUntil(this.destroyed$))
2224
+ .subscribe((unitHeight) => {
2225
+ this.unitHeightChange.emit(unitHeight);
2226
+ });
2227
+ }
2228
+ get unitHeight() {
2229
+ return this.unitHeight$.value;
2230
+ }
2231
+ set unitHeight(value) {
2232
+ this.unitHeight$.next(value);
2233
+ }
2234
+ //#endregion
2235
+ addDays(date, days) {
2236
+ const result = new Date(date);
2237
+ result.setDate(result.getDate() + days);
2238
+ return result;
2239
+ }
2240
+ onPreviousWeek() {
2241
+ this.currentWeek$
2242
+ .pipe(map((w) => this.addDays(w, -7)), take(1))
2243
+ .subscribe((w) => this.currentWeek$.next(w));
2244
+ }
2245
+ onNextWeek() {
2246
+ this.currentWeek$
2247
+ .pipe(map((w) => this.addDays(w, 7)), take(1))
2248
+ .subscribe((w) => this.currentWeek$.next(w));
2249
+ }
2250
+ onCreateEvent(ev, slot) {
2251
+ ev.preventDefault();
2252
+ this.mouseState$.next(true);
2253
+ this.dragStartTimeslot = slot;
2254
+ this.operation = {
2255
+ operation: EDragOperation.createEvent,
2256
+ event: {
2257
+ start: slot.start,
2258
+ end: slot.end,
2259
+ color: '#5AC8FA',
2260
+ description: 'Test event',
2261
+ }
2262
+ };
2263
+ this.previewEvent$.next({ start: slot.start, end: slot.end });
2264
+ // this.events$.next([...this.events$.value, this.operation.event]);
2265
+ }
2266
+ onStartDragEvent(eventPart, ev) {
2267
+ ev.preventDefault();
2268
+ this.hoveredTimeSlot$.pipe(take(1)).subscribe((hoveredTimeSlot) => {
2269
+ if (eventPart.event) {
2270
+ this.dragStartTimeslot = hoveredTimeSlot;
2271
+ this.operation = {
2272
+ operation: EDragOperation.moveEvent,
2273
+ event: eventPart.event,
2274
+ };
2275
+ this.previewEvent$.next({ start: eventPart.event.start, end: eventPart.event.end });
2276
+ }
2277
+ });
2278
+ }
2279
+ //#region hoveredTimeslot$
2280
+ getHoveredTimeslot(ev, timeSlots) {
2281
+ const hoveredSlots = this.timeSlotElements.filter((el) => {
2282
+ const rct = el.nativeElement.getBoundingClientRect();
2283
+ if (rct.left <= ev.x && ev.x <= rct.right && rct.top <= ev.y && ev.y <= rct.bottom) {
2284
+ return true;
2285
+ }
2286
+ else {
2287
+ return false;
2288
+ }
2289
+ });
2290
+ if (!hoveredSlots || hoveredSlots.length === 0) {
2291
+ return null;
2292
+ }
2293
+ const slotElement = hoveredSlots[0].nativeElement;
2294
+ const strRow = slotElement.getAttribute('data-row');
2295
+ if (!strRow) {
2296
+ return null;
2297
+ }
2298
+ const row = parseInt(strRow);
2299
+ const strColumn = slotElement.getAttribute('data-column');
2300
+ if (!strColumn) {
2301
+ return null;
2302
+ }
2303
+ const column = parseInt(strColumn);
2304
+ const slot = timeSlots[row][column];
2305
+ return slot;
2306
+ }
2307
+ onMousemove(ev) {
2308
+ this.timeSlots$.pipe(take(1)).subscribe((timeSlots) => {
2309
+ const hovered = this.getHoveredTimeslot(ev, timeSlots);
2310
+ this.hoveredTimeSlot$.next(hovered);
2311
+ if (this.operation) {
2312
+ switch (this.operation.operation) {
2313
+ case EDragOperation.createEvent:
2314
+ {
2315
+ if (this.operation.event && this.dragStartTimeslot && hovered && (this.operation.event.end.getTime() != hovered.end.getTime())) {
2316
+ if (this.dragStartTimeslot.start.getTime() === hovered.start.getTime()) {
2317
+ // 1 slot
2318
+ }
2319
+ else if (this.dragStartTimeslot.start.getTime() < hovered.start.getTime()) {
2320
+ // Drag down
2321
+ // this.operation.event.start = this.dragStartTimeslot.start;
2322
+ // this.operation.event.end = hovered.end;
2323
+ // this.events$.next(this.events$.value);
2324
+ this.previewEvent$
2325
+ .pipe(filter((ev) => !!ev && !!this.dragStartTimeslot))
2326
+ .pipe(map((ev) => {
2327
+ if (ev && this.dragStartTimeslot) {
2328
+ ev.start = this.dragStartTimeslot.start;
2329
+ ev.end = hovered.end;
2330
+ }
2331
+ return ev;
2332
+ }))
2333
+ .pipe(take(1))
2334
+ .subscribe((ev) => this.previewEvent$.next(ev));
2335
+ }
2336
+ else if (this.dragStartTimeslot.start.getTime() > hovered.start.getTime()) {
2337
+ // Drag up
2338
+ // this.operation.event.start = hovered.start;
2339
+ // this.operation.event.end = this.dragStartTimeslot.end;
2340
+ // this.events$.next(this.events$.value);
2341
+ this.previewEvent$
2342
+ .pipe(filter((ev) => !!ev && !!this.dragStartTimeslot))
2343
+ .pipe(map((ev) => {
2344
+ if (ev && this.dragStartTimeslot) {
2345
+ ev.start = hovered.start;
2346
+ ev.end = this.dragStartTimeslot.end;
2347
+ }
2348
+ return ev;
2349
+ }))
2350
+ .pipe(take(1))
2351
+ .subscribe((ev) => this.previewEvent$.next(ev));
2352
+ }
2353
+ }
2354
+ }
2355
+ break;
2356
+ case EDragOperation.moveEvent:
2357
+ {
2358
+ if (hovered && this.dragStartTimeslot) {
2359
+ // this.operation.event.start.setTime(this.operation.event.start.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
2360
+ // this.operation.event.end.setTime(this.operation.event.end.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
2361
+ // this.dragStartTimeslot = hovered;
2362
+ // // this.events$.next(this.events$.value);
2363
+ this.previewEvent$
2364
+ .pipe(filter((ev) => !!ev && !!this.dragStartTimeslot))
2365
+ .pipe(map((ev) => {
2366
+ if (ev && this.dragStartTimeslot) {
2367
+ ev.start.setTime(ev.start.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
2368
+ ev.end.setTime(ev.end.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
2369
+ this.dragStartTimeslot = hovered;
2370
+ }
2371
+ return ev;
2372
+ }))
2373
+ .pipe(take(1))
2374
+ .subscribe((ev) => this.previewEvent$.next(ev));
2375
+ }
2376
+ }
2377
+ break;
2378
+ }
2379
+ }
2380
+ });
2381
+ }
2382
+ //#endregion
2383
+ onMouseUp(ev) {
2384
+ if (this.operation) {
2385
+ switch (this.operation.operation) {
2386
+ case EDragOperation.createEvent:
2387
+ {
2388
+ combineLatest([this.previewEvent$])
2389
+ .pipe(take(1))
2390
+ .subscribe(([previewEvent]) => {
2391
+ if (previewEvent) {
2392
+ this.operation = null;
2393
+ this.dragStartTimeslot = null;
2394
+ this.events$.next([...this.events$.value, {
2395
+ start: previewEvent.start,
2396
+ end: previewEvent.end,
2397
+ color: '#F00',
2398
+ description: 'New event'
2399
+ }]);
2400
+ this.previewEvent$.next(null);
2401
+ }
2402
+ });
2403
+ }
2404
+ break;
2405
+ case EDragOperation.moveEvent:
2406
+ {
2407
+ this.previewEvent$
2408
+ .pipe(filter((ev) => !!ev))
2409
+ .pipe(take(1))
2410
+ .subscribe((previewEvent) => {
2411
+ if (this.operation && this.operation.event && previewEvent) {
2412
+ this.operation.event.start = previewEvent.start;
2413
+ this.operation.event.end = previewEvent.end;
2414
+ this.operation = null;
2415
+ this.dragStartTimeslot = null;
2416
+ this.events$.next(this.events$.value);
2417
+ this.previewEvent$.next(null);
2418
+ }
2419
+ });
2420
+ }
2421
+ break;
2422
+ }
2423
+ }
2424
+ }
2425
+ ngOnDestroy() {
2426
+ this.destroyed$.next(true);
2427
+ }
2428
+ }
2429
+ BsSchedulerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerComponent, deps: [{ token: BsCalendarMonthService }, { token: BsTimelineService }], target: i0.ɵɵFactoryTarget.Component });
2430
+ BsSchedulerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsSchedulerComponent, selector: "bs-scheduler", inputs: { unitHeight: "unitHeight" }, outputs: { unitHeightChange: "unitHeightChange" }, host: { listeners: { "document:mousemove": "onMousemove($event)", "document:mouseup": "onMouseUp($event)" } }, viewQueries: [{ propertyName: "timeSlotElements", predicate: ["slot"], descendants: true }], ngImport: i0, template: "<div class=\"table d-flex w-100 overflow-y-auto\" [style.max-height.px]=\"null\">\n <div class=\"calendar-head\">\n <div class=\"w-100 d-flex flex-row\">\n <div class=\"d-flex calendar-left justify-content-between\">\n <button class=\"btn btn-default flex-start\" (click)=\"onPreviousWeek()\">&lt;</button>\n <button class=\"btn btn-default flex-end\" (click)=\"onNextWeek()\">&gt;</button>\n </div>\n <div class=\"flex-grow-1\" *ngFor=\"let day of (daysOfWeek$ | async)\">\n <span class=\"d-block col-form-label text-center\">\n {{ day | date: 'dd-MM-yyyy' }}\n </span>\n </div>\n </div>\n </div>\n <div class=\"calendar-body\">\n <div class=\"position-relative\">\n <!-- Timeslots -->\n <div *ngFor=\"let timeslots of (timeSlots$ | async); let i = index\" class=\"d-flex flex-row p-0 timeslot\" [style.height.px]=\"unitHeight$ | async\">\n <div class=\"calendar-cell calendar-left align-top py-0\">{{ timeslots[0].start | date: 'HH:mm:ss' }}</div>\n <div class=\"calendar-cell flex-grow-1\" *ngFor=\"let slot of timeslots; let j = index\" #slot (mousedown)=\"onCreateEvent($event, slot)\" [attr.data-row]=\"i\" [attr.data-column]=\"j\"></div>\n </div>\n \n <!-- Events -->\n <ng-container *ngIf=\"(timeSlotDuration$ | async) as timeSlotDuration\">\n <ng-container *ngIf=\"(timelinedEventPartsForThisWeek$ | async) as partData\">\n <div *ngFor=\"let eventPart of partData.parts\" class=\"event p-0\"\n [style.top.px]=\"(eventPart.part | bsSecondsTodayOffset) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.height.px]=\"(eventPart.part | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.left]=\"'calc(90px + ((100% - 90px) / 7 * ' + ((eventPart.part | dayOfWeek) - 1) + '))'\">\n <div class=\"event-inner\"\n [style.width]=\"'calc(100% / ' + partData.total + ')'\"\n [style.height.px]=\"(eventPart.part | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.margin-left]=\"'calc(100% / ' + partData.total + ' * ' + eventPart.index + ')'\"\n (mousedown)=\"onStartDragEvent(eventPart.part, $event)\">\n <div class=\"event-border\"></div>\n <ng-container *ngIf=\"eventPart.part.event\">\n <div class=\"event-bg\" [style.background-color]=\"eventPart.part.event.color\"></div>\n <div class=\"event-label\">{{ eventPart.part.event.description }}</div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"(previewEventPartsForThisWeek$ | async) as previewPartData\">\n <div *ngFor=\"let eventPart of previewPartData\" class=\"event preview p-0\"\n [style.top.px]=\"(eventPart | bsSecondsTodayOffset) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.height.px]=\"(eventPart | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.left]=\"'calc(90px + ((100% - 90px) / 7 * ' + ((eventPart | dayOfWeek) - 1) + '))'\">\n <div class=\"event-inner w-100\" [style.height.px]=\"(eventPart | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"></div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n </div>\n</div>", styles: [":host{display:block}.table{flex-flow:column}.table .calendar-head{flex:0 0 auto}.table .calendar-head>div{padding-right:18px}.table .calendar-body{flex:1 1 auto;display:block;overflow-y:visible;overflow-x:hidden}.table .calendar-body .calendar-cell{border-right:1px solid #DEE2E6;border-bottom:1px solid #DEE2E6;cursor:default}.table .calendar-body .calendar-cell.hover{border-top-width:3px}.table .calendar-left{width:90px}.event{z-index:5;width:calc((100% - 90px) / 7);height:100px;overflow:hidden;position:absolute;-webkit-user-select:none;user-select:none;pointer-events:none}.event.preview{background:#666;opacity:.6}.event .event-border{background:black;top:0;left:0;bottom:3px;width:3px;position:absolute;z-index:10;opacity:.3}.event .event-inner{position:relative;left:0px;right:5px;top:0px;bottom:5px;cursor:move;pointer-events:all}.event .event-inner .event-bg{opacity:.5;width:calc(100% - 2px);margin:1px auto 1px 0;height:calc(100% - 3px);transition:opacity .15s ease-in-out}.event .event-inner .event-label{position:absolute;top:0;font-size:12px;font-weight:600;padding:4px}.event .event-inner:hover .event-bg{opacity:.7}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i1.AsyncPipe, "date": i1.DatePipe, "bsSecondsTodayOffset": BsSecondsTodayOffsetPipe, "bsSecondsTimespan": BsSecondsTimespanPipe, "dayOfWeek": DayOfWeekPipe } });
2431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerComponent, decorators: [{
2432
+ type: Component,
2433
+ args: [{ selector: 'bs-scheduler', template: "<div class=\"table d-flex w-100 overflow-y-auto\" [style.max-height.px]=\"null\">\n <div class=\"calendar-head\">\n <div class=\"w-100 d-flex flex-row\">\n <div class=\"d-flex calendar-left justify-content-between\">\n <button class=\"btn btn-default flex-start\" (click)=\"onPreviousWeek()\">&lt;</button>\n <button class=\"btn btn-default flex-end\" (click)=\"onNextWeek()\">&gt;</button>\n </div>\n <div class=\"flex-grow-1\" *ngFor=\"let day of (daysOfWeek$ | async)\">\n <span class=\"d-block col-form-label text-center\">\n {{ day | date: 'dd-MM-yyyy' }}\n </span>\n </div>\n </div>\n </div>\n <div class=\"calendar-body\">\n <div class=\"position-relative\">\n <!-- Timeslots -->\n <div *ngFor=\"let timeslots of (timeSlots$ | async); let i = index\" class=\"d-flex flex-row p-0 timeslot\" [style.height.px]=\"unitHeight$ | async\">\n <div class=\"calendar-cell calendar-left align-top py-0\">{{ timeslots[0].start | date: 'HH:mm:ss' }}</div>\n <div class=\"calendar-cell flex-grow-1\" *ngFor=\"let slot of timeslots; let j = index\" #slot (mousedown)=\"onCreateEvent($event, slot)\" [attr.data-row]=\"i\" [attr.data-column]=\"j\"></div>\n </div>\n \n <!-- Events -->\n <ng-container *ngIf=\"(timeSlotDuration$ | async) as timeSlotDuration\">\n <ng-container *ngIf=\"(timelinedEventPartsForThisWeek$ | async) as partData\">\n <div *ngFor=\"let eventPart of partData.parts\" class=\"event p-0\"\n [style.top.px]=\"(eventPart.part | bsSecondsTodayOffset) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.height.px]=\"(eventPart.part | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.left]=\"'calc(90px + ((100% - 90px) / 7 * ' + ((eventPart.part | dayOfWeek) - 1) + '))'\">\n <div class=\"event-inner\"\n [style.width]=\"'calc(100% / ' + partData.total + ')'\"\n [style.height.px]=\"(eventPart.part | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.margin-left]=\"'calc(100% / ' + partData.total + ' * ' + eventPart.index + ')'\"\n (mousedown)=\"onStartDragEvent(eventPart.part, $event)\">\n <div class=\"event-border\"></div>\n <ng-container *ngIf=\"eventPart.part.event\">\n <div class=\"event-bg\" [style.background-color]=\"eventPart.part.event.color\"></div>\n <div class=\"event-label\">{{ eventPart.part.event.description }}</div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"(previewEventPartsForThisWeek$ | async) as previewPartData\">\n <div *ngFor=\"let eventPart of previewPartData\" class=\"event preview p-0\"\n [style.top.px]=\"(eventPart | bsSecondsTodayOffset) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.height.px]=\"(eventPart | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"\n [style.left]=\"'calc(90px + ((100% - 90px) / 7 * ' + ((eventPart | dayOfWeek) - 1) + '))'\">\n <div class=\"event-inner w-100\" [style.height.px]=\"(eventPart | bsSecondsTimespan) / timeSlotDuration * (unitHeight$ | async)!\"></div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n </div>\n</div>", styles: [":host{display:block}.table{flex-flow:column}.table .calendar-head{flex:0 0 auto}.table .calendar-head>div{padding-right:18px}.table .calendar-body{flex:1 1 auto;display:block;overflow-y:visible;overflow-x:hidden}.table .calendar-body .calendar-cell{border-right:1px solid #DEE2E6;border-bottom:1px solid #DEE2E6;cursor:default}.table .calendar-body .calendar-cell.hover{border-top-width:3px}.table .calendar-left{width:90px}.event{z-index:5;width:calc((100% - 90px) / 7);height:100px;overflow:hidden;position:absolute;-webkit-user-select:none;user-select:none;pointer-events:none}.event.preview{background:#666;opacity:.6}.event .event-border{background:black;top:0;left:0;bottom:3px;width:3px;position:absolute;z-index:10;opacity:.3}.event .event-inner{position:relative;left:0px;right:5px;top:0px;bottom:5px;cursor:move;pointer-events:all}.event .event-inner .event-bg{opacity:.5;width:calc(100% - 2px);margin:1px auto 1px 0;height:calc(100% - 3px);transition:opacity .15s ease-in-out}.event .event-inner .event-label{position:absolute;top:0;font-size:12px;font-weight:600;padding:4px}.event .event-inner:hover .event-bg{opacity:.7}\n"] }]
2434
+ }], ctorParameters: function () { return [{ type: BsCalendarMonthService }, { type: BsTimelineService }]; }, propDecorators: { timeSlotElements: [{
2435
+ type: ViewChildren,
2436
+ args: ['slot']
2437
+ }], unitHeightChange: [{
2438
+ type: Output
2439
+ }], unitHeight: [{
2440
+ type: Input
2441
+ }], onMousemove: [{
2442
+ type: HostListener,
2443
+ args: ['document:mousemove', ['$event']]
2444
+ }], onMouseUp: [{
2445
+ type: HostListener,
2446
+ args: ['document:mouseup', ['$event']]
2447
+ }] } });
2448
+
2449
+ class DateOffsetPipe {
2450
+ transform(value) {
2451
+ const today = new Date(value.start);
2452
+ today.setHours(0);
2453
+ today.setMinutes(0);
2454
+ today.setSeconds(0);
2455
+ return (value.start.getTime() - today.getTime()) / 1000;
2456
+ }
2457
+ }
2458
+ DateOffsetPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateOffsetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2459
+ DateOffsetPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateOffsetPipe, name: "dateOffset" });
2460
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateOffsetPipe, decorators: [{
2461
+ type: Pipe,
2462
+ args: [{
2463
+ name: 'dateOffset'
2464
+ }]
2465
+ }] });
2466
+
2467
+ class BsSchedulerModule {
2468
+ }
2469
+ BsSchedulerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2470
+ BsSchedulerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, declarations: [BsSchedulerComponent,
2471
+ BsSecondsTimespanPipe,
2472
+ BsSecondsTodayOffsetPipe,
2473
+ DateOffsetPipe,
2474
+ DayOfWeekPipe], imports: [CommonModule], exports: [BsSchedulerComponent] });
2475
+ BsSchedulerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, imports: [[
2476
+ CommonModule
2477
+ ]] });
2478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, decorators: [{
2479
+ type: NgModule,
2480
+ args: [{
2481
+ declarations: [
2482
+ BsSchedulerComponent,
2483
+ BsSecondsTimespanPipe,
2484
+ BsSecondsTodayOffsetPipe,
2485
+ DateOffsetPipe,
2486
+ DayOfWeekPipe
2487
+ ],
2488
+ imports: [
2489
+ CommonModule
2490
+ ],
2491
+ exports: [
2492
+ BsSchedulerComponent
2493
+ ]
2494
+ }]
2495
+ }] });
2496
+
1994
2497
  class BsListGroupItemComponent {
1995
2498
  constructor() {
1996
2499
  }
@@ -2177,7 +2680,6 @@ class BsModalService {
2177
2680
  hasBackdrop: true
2178
2681
  });
2179
2682
  const componentInstance = overlayRef.attach(portal);
2180
- console.log('instance', componentInstance);
2181
2683
  componentInstance.instance['instance'] = {
2182
2684
  component: componentInstance,
2183
2685
  overlay: overlayRef
@@ -2312,6 +2814,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
2312
2814
 
2313
2815
  class BsNavbarComponent {
2314
2816
  constructor() {
2817
+ this.autoclose = true;
2315
2818
  this.expandButtonTemplate = null;
2316
2819
  this.isExpanded$ = new BehaviorSubject(false);
2317
2820
  }
@@ -2322,13 +2825,15 @@ class BsNavbarComponent {
2322
2825
  }
2323
2826
  }
2324
2827
  BsNavbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2325
- BsNavbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarComponent, selector: "bs-navbar", viewQueries: [{ propertyName: "nav", first: true, predicate: ["nav"], descendants: true }], ngImport: i0, template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-end\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}\n"], directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1.AsyncPipe } });
2828
+ BsNavbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarComponent, selector: "bs-navbar", inputs: { autoclose: "autoclose" }, viewQueries: [{ propertyName: "nav", first: true, predicate: ["nav"], descendants: true }], ngImport: i0, template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <div class=\"flex-end d-md-none d-flex tw\">\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-center\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}.tw{margin:-.5rem -.6666666667rem}\n"], directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1.AsyncPipe } });
2326
2829
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarComponent, decorators: [{
2327
2830
  type: Component,
2328
- args: [{ selector: 'bs-navbar', template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-end\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}\n"] }]
2831
+ args: [{ selector: 'bs-navbar', template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <div class=\"flex-end d-md-none d-flex tw\">\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-center\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}.tw{margin:-.5rem -.6666666667rem}\n"] }]
2329
2832
  }], propDecorators: { nav: [{
2330
2833
  type: ViewChild,
2331
2834
  args: ['nav']
2835
+ }], autoclose: [{
2836
+ type: Input
2332
2837
  }] } });
2333
2838
 
2334
2839
  class BsNavbarNavComponent {
@@ -2394,7 +2899,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
2394
2899
  }] } });
2395
2900
 
2396
2901
  class BsNavbarItemComponent {
2397
- constructor(parentDropdown, element) {
2902
+ constructor(navbar, parentDropdown, element) {
2903
+ this.navbar = navbar;
2398
2904
  this.element = element;
2399
2905
  this.hasDropdown = false;
2400
2906
  this.anchorTag = null;
@@ -2421,7 +2927,7 @@ class BsNavbarItemComponent {
2421
2927
  }
2422
2928
  else {
2423
2929
  // Close if this is a link
2424
- if (this.parentDropdown && this.dropdowns.length === 0) {
2930
+ if (this.dropdowns.length === 0) {
2425
2931
  if (this.anchorTag && !this.anchorTag.onclick) {
2426
2932
  this.anchorTag.onclick = (ev) => {
2427
2933
  let d = this.parentDropdown;
@@ -2429,18 +2935,21 @@ class BsNavbarItemComponent {
2429
2935
  d.isVisible = false;
2430
2936
  d = d.parentDropdown;
2431
2937
  }
2938
+ if (this.navbar.autoclose) {
2939
+ this.navbar.isExpanded$.next(false);
2940
+ }
2432
2941
  };
2433
2942
  }
2434
2943
  }
2435
2944
  }
2436
2945
  }
2437
2946
  }
2438
- BsNavbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarItemComponent, deps: [{ token: BsNavbarDropdownComponent, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2947
+ BsNavbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarItemComponent, deps: [{ token: BsNavbarComponent }, { token: BsNavbarDropdownComponent, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2439
2948
  BsNavbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarItemComponent, selector: "bs-navbar-item", queries: [{ propertyName: "dropdowns", predicate: i0.forwardRef(function () { return BsNavbarDropdownComponent; }) }], ngImport: i0, template: "<li [class.nav-item]=\"parentDropdown === null\" [class.dropdown]=\"(dropdowns.length > 0) && (parentDropdown === null)\" [class.dropend]=\"(dropdowns.length > 0) && (parentDropdown !== null)\">\n <ng-content></ng-content>\n</li>", styles: ["li.dropend ::ng-deep a.dropdown-toggle{padding-right:1.5rem}li.dropend ::ng-deep a.dropdown-toggle:after{position:absolute;right:.5rem;top:.75rem}\n"] });
2440
2949
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarItemComponent, decorators: [{
2441
2950
  type: Component,
2442
2951
  args: [{ selector: 'bs-navbar-item', template: "<li [class.nav-item]=\"parentDropdown === null\" [class.dropdown]=\"(dropdowns.length > 0) && (parentDropdown === null)\" [class.dropend]=\"(dropdowns.length > 0) && (parentDropdown !== null)\">\n <ng-content></ng-content>\n</li>", styles: ["li.dropend ::ng-deep a.dropdown-toggle{padding-right:1.5rem}li.dropend ::ng-deep a.dropdown-toggle:after{position:absolute;right:.5rem;top:.75rem}\n"] }]
2443
- }], ctorParameters: function () { return [{ type: BsNavbarDropdownComponent, decorators: [{
2952
+ }], ctorParameters: function () { return [{ type: BsNavbarComponent }, { type: BsNavbarDropdownComponent, decorators: [{
2444
2953
  type: Optional
2445
2954
  }] }, { type: i0.ElementRef }]; }, propDecorators: { dropdowns: [{
2446
2955
  type: ContentChildren,
@@ -2614,7 +3123,7 @@ class BsNavbarTogglerComponent {
2614
3123
  this.stateChange.emit(this._state);
2615
3124
  }
2616
3125
  //#endregion
2617
- toggleState() {
3126
+ toggleState(ev) {
2618
3127
  switch (this._state) {
2619
3128
  case 'open':
2620
3129
  this.state = 'closed';
@@ -2626,14 +3135,17 @@ class BsNavbarTogglerComponent {
2626
3135
  }
2627
3136
  }
2628
3137
  BsNavbarTogglerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarTogglerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2629
- BsNavbarTogglerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarTogglerComponent, selector: "bs-navbar-toggler", inputs: { state: "state" }, outputs: { stateChange: "stateChange" }, ngImport: i0, template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\" id=\"navbar-toggler\" (click)=\"toggleState()\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;position:absolute;top:0;right:0;padding:.5rem .75rem}.navbar-toggler{padding:.25rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
3138
+ BsNavbarTogglerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarTogglerComponent, selector: "bs-navbar-toggler", inputs: { state: "state" }, outputs: { stateChange: "stateChange" }, host: { listeners: { "click": "toggleState($event)" } }, ngImport: i0, template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;top:0;right:0}.navbar-toggler{padding:.75rem 1rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2630
3139
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarTogglerComponent, decorators: [{
2631
3140
  type: Component,
2632
- args: [{ selector: 'bs-navbar-toggler', template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\" id=\"navbar-toggler\" (click)=\"toggleState()\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;position:absolute;top:0;right:0;padding:.5rem .75rem}.navbar-toggler{padding:.25rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"] }]
3141
+ args: [{ selector: 'bs-navbar-toggler', template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;top:0;right:0}.navbar-toggler{padding:.75rem 1rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"] }]
2633
3142
  }], propDecorators: { stateChange: [{
2634
3143
  type: Output
2635
3144
  }], state: [{
2636
3145
  type: Input
3146
+ }], toggleState: [{
3147
+ type: HostListener,
3148
+ args: ['click', ['$event']]
2637
3149
  }] } });
2638
3150
 
2639
3151
  class BsNavbarModule {
@@ -3562,5 +4074,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3562
4074
  * Generated bundle index. Do not edit.
3563
4075
  */
3564
4076
 
3565
- 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, BsPaginationComponent, BsPaginationModule, BsProgressBarComponent, BsProgressBarModule, BsProgressComponent, BsRatingComponent, BsRatingModule, BsRowTemplateDirective, BsScrollspyComponent, BsScrollspyDirective, BsScrollspyModule, BsSelect2Component, BsSelect2Module, BsSnackbarCloseDirective, BsSnackbarComponent, BsSnackbarModule, BsSnackbarService, BsTabControlComponent, BsTabControlModule, BsTabPageComponent, BsToggleButtonComponent, BsToggleButtonModule, BsTooltipDirective, BsTooltipModule, BsTypeaheadComponent, BsTypeaheadModule, Color, DatatableSettings, DropdownToggleDirective, NavLinkDirective, NavbarContentDirective, Position };
4077
+ 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, BsPaginationComponent, BsPaginationModule, BsProgressBarComponent, BsProgressBarModule, BsProgressComponent, BsRatingComponent, BsRatingModule, BsRowTemplateDirective, BsSchedulerComponent, BsSchedulerModule, BsScrollspyComponent, BsScrollspyDirective, BsScrollspyModule, BsSelect2Component, BsSelect2Module, BsSnackbarCloseDirective, BsSnackbarComponent, BsSnackbarModule, BsSnackbarService, BsTabControlComponent, BsTabControlModule, BsTabPageComponent, BsToggleButtonComponent, BsToggleButtonModule, BsTooltipDirective, BsTooltipModule, BsTypeaheadComponent, BsTypeaheadModule, Color, DatatableSettings, DropdownToggleDirective, NavLinkDirective, NavbarContentDirective, Position };
3566
4078
  //# sourceMappingURL=mintplayer-ng-bootstrap.mjs.map