@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.
- package/_bootstrap.scss +0 -1
- package/esm2020/lib/components/context-menu/context-menu.directive.mjs +1 -2
- package/esm2020/lib/components/file-upload/component/file-upload.component.mjs +1 -2
- package/esm2020/lib/components/index.mjs +2 -1
- package/esm2020/lib/components/modal/service/modal.service.mjs +1 -2
- package/esm2020/lib/components/navbar/navbar/navbar.component.mjs +7 -4
- package/esm2020/lib/components/navbar/navbar-item/navbar-item.component.mjs +12 -6
- package/esm2020/lib/components/navbar/navbar-toggler/navbar-toggler.component.mjs +8 -5
- package/esm2020/lib/components/scheduler/components/index.mjs +2 -0
- package/esm2020/lib/components/scheduler/components/scheduler/scheduler.component.mjs +346 -0
- package/esm2020/lib/components/scheduler/enums/drag-operation.mjs +8 -0
- package/esm2020/lib/components/scheduler/index.mjs +3 -0
- package/esm2020/lib/components/scheduler/interfaces/drag-operation.mjs +2 -0
- package/esm2020/lib/components/scheduler/interfaces/preview-event.mjs +2 -0
- package/esm2020/lib/components/scheduler/interfaces/scheduler-event-part.mjs +2 -0
- package/esm2020/lib/components/scheduler/interfaces/scheduler-event-with-parts.mjs +2 -0
- package/esm2020/lib/components/scheduler/interfaces/scheduler-event.mjs +2 -0
- package/esm2020/lib/components/scheduler/interfaces/time-slot.mjs +2 -0
- package/esm2020/lib/components/scheduler/interfaces/timeline-track.mjs +2 -0
- package/esm2020/lib/components/scheduler/pipes/bs-seconds-timespan.pipe/bs-seconds-timespan.pipe.mjs +16 -0
- package/esm2020/lib/components/scheduler/pipes/bs-seconds-today-offset/bs-seconds-today-offset.pipe.mjs +20 -0
- package/esm2020/lib/components/scheduler/pipes/date-offset/date-offset.pipe.mjs +20 -0
- package/esm2020/lib/components/scheduler/pipes/day-of-week/day-of-week.pipe.mjs +22 -0
- package/esm2020/lib/components/scheduler/scheduler.module.mjs +38 -0
- package/esm2020/lib/components/scheduler/services/timeline/timeline.service.mjs +65 -0
- package/esm2020/lib/services/calendar-month/calendar-month.service.mjs +1 -1
- package/fesm2015/mintplayer-ng-bootstrap.mjs +526 -14
- package/fesm2015/mintplayer-ng-bootstrap.mjs.map +1 -1
- package/fesm2020/mintplayer-ng-bootstrap.mjs +526 -14
- package/fesm2020/mintplayer-ng-bootstrap.mjs.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/navbar/navbar/navbar.component.d.ts +2 -1
- package/lib/components/navbar/navbar-item/navbar-item.component.d.ts +4 -2
- package/lib/components/navbar/navbar-toggler/navbar-toggler.component.d.ts +1 -1
- package/lib/components/scheduler/components/index.d.ts +1 -0
- package/lib/components/scheduler/components/scheduler/scheduler.component.d.ts +58 -0
- package/lib/components/scheduler/enums/drag-operation.d.ts +6 -0
- package/lib/components/scheduler/index.d.ts +2 -0
- package/lib/components/scheduler/interfaces/drag-operation.d.ts +6 -0
- package/lib/components/scheduler/interfaces/preview-event.d.ts +4 -0
- package/lib/components/scheduler/interfaces/scheduler-event-part.d.ts +6 -0
- package/lib/components/scheduler/interfaces/scheduler-event-with-parts.d.ts +6 -0
- package/lib/components/scheduler/interfaces/scheduler-event.d.ts +6 -0
- package/lib/components/scheduler/interfaces/time-slot.d.ts +4 -0
- package/lib/components/scheduler/interfaces/timeline-track.d.ts +5 -0
- package/lib/components/scheduler/pipes/bs-seconds-timespan.pipe/bs-seconds-timespan.pipe.d.ts +9 -0
- package/lib/components/scheduler/pipes/bs-seconds-today-offset/bs-seconds-today-offset.pipe.d.ts +9 -0
- package/lib/components/scheduler/pipes/date-offset/date-offset.pipe.d.ts +8 -0
- package/lib/components/scheduler/pipes/day-of-week/day-of-week.pipe.d.ts +9 -0
- package/lib/components/scheduler/scheduler.module.d.ts +12 -0
- package/lib/components/scheduler/services/timeline/timeline.service.d.ts +14 -0
- 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,
|
|
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';
|
|
@@ -931,7 +931,6 @@ class BsContextMenuDirective {
|
|
|
931
931
|
this.element.nativeElement.oncontextmenu = (ev) => {
|
|
932
932
|
ev.preventDefault();
|
|
933
933
|
this.checkAndCloseExisting(ev);
|
|
934
|
-
console.log('d', element.nativeElement);
|
|
935
934
|
this.overlayRef = this.overlay.create({
|
|
936
935
|
hasBackdrop: false,
|
|
937
936
|
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
@@ -1815,7 +1814,6 @@ class BsFileUploadComponent {
|
|
|
1815
1814
|
this.filesDropped = new EventEmitter();
|
|
1816
1815
|
}
|
|
1817
1816
|
onChange(event) {
|
|
1818
|
-
console.log('event', event);
|
|
1819
1817
|
if (!event.target)
|
|
1820
1818
|
return;
|
|
1821
1819
|
if (!('files' in event.target))
|
|
@@ -2002,6 +2000,511 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
2002
2000
|
}]
|
|
2003
2001
|
}] });
|
|
2004
2002
|
|
|
2003
|
+
var EDragOperation;
|
|
2004
|
+
(function (EDragOperation) {
|
|
2005
|
+
EDragOperation[EDragOperation["none"] = 0] = "none";
|
|
2006
|
+
EDragOperation[EDragOperation["createEvent"] = 1] = "createEvent";
|
|
2007
|
+
EDragOperation[EDragOperation["resizeEvent"] = 2] = "resizeEvent";
|
|
2008
|
+
EDragOperation[EDragOperation["moveEvent"] = 3] = "moveEvent";
|
|
2009
|
+
})(EDragOperation || (EDragOperation = {}));
|
|
2010
|
+
|
|
2011
|
+
class BsTimelineService {
|
|
2012
|
+
splitInParts(event) {
|
|
2013
|
+
let startTime = event.start;
|
|
2014
|
+
const result = [];
|
|
2015
|
+
const eventOrNull = 'color' in event ? event : null;
|
|
2016
|
+
while (!this.dateEquals(startTime, event.end)) {
|
|
2017
|
+
const end = new Date(startTime.getFullYear(), startTime.getMonth(), startTime.getDate() + 1, 0, 0, 0);
|
|
2018
|
+
result.push({ start: startTime, end: end, event: eventOrNull });
|
|
2019
|
+
startTime = end;
|
|
2020
|
+
}
|
|
2021
|
+
if (startTime != event.end) {
|
|
2022
|
+
result.push({ start: startTime, end: event.end, event: eventOrNull });
|
|
2023
|
+
}
|
|
2024
|
+
return { event: event, parts: result };
|
|
2025
|
+
}
|
|
2026
|
+
dateEquals(date1, date2) {
|
|
2027
|
+
return (date1.getFullYear() === date2.getFullYear() &&
|
|
2028
|
+
date1.getMonth() === date2.getMonth() &&
|
|
2029
|
+
date1.getDate() === date2.getDate());
|
|
2030
|
+
}
|
|
2031
|
+
getTimeline(events) {
|
|
2032
|
+
const timestamps = this.getTimestamps(events);
|
|
2033
|
+
const tracks = [];
|
|
2034
|
+
timestamps.forEach((timestamp, tIndex) => {
|
|
2035
|
+
const starting = events.filter((e) => e.start === timestamp);
|
|
2036
|
+
// const ending = events.filter((e) => e.end === timestamp);
|
|
2037
|
+
starting.forEach((startedEvent, eIndex) => {
|
|
2038
|
+
const freeTracks = tracks.filter(t => this.trackIsFreeAt(t, startedEvent));
|
|
2039
|
+
if (freeTracks.length === 0) {
|
|
2040
|
+
tracks.push({ index: tracks.length, events: [startedEvent] });
|
|
2041
|
+
}
|
|
2042
|
+
else {
|
|
2043
|
+
freeTracks[0].events.push(startedEvent);
|
|
2044
|
+
}
|
|
2045
|
+
});
|
|
2046
|
+
});
|
|
2047
|
+
return tracks;
|
|
2048
|
+
}
|
|
2049
|
+
getTimestamps(events) {
|
|
2050
|
+
const allTimestamps = events.map(e => [e.start, e.end])
|
|
2051
|
+
.reduce((flat, toFlatten) => flat.concat(toFlatten), []);
|
|
2052
|
+
return allTimestamps
|
|
2053
|
+
.filter((t, i) => allTimestamps.indexOf(t) === i)
|
|
2054
|
+
.sort((t1, t2) => t1 - t2);
|
|
2055
|
+
}
|
|
2056
|
+
trackIsFreeAt(track, event) {
|
|
2057
|
+
if (track.events.every((ev) => (ev.end <= event.start) || (event.end <= ev.start))) {
|
|
2058
|
+
return true;
|
|
2059
|
+
}
|
|
2060
|
+
else {
|
|
2061
|
+
return false;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
BsTimelineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsTimelineService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2066
|
+
BsTimelineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsTimelineService, providedIn: 'root' });
|
|
2067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsTimelineService, decorators: [{
|
|
2068
|
+
type: Injectable,
|
|
2069
|
+
args: [{
|
|
2070
|
+
providedIn: 'root'
|
|
2071
|
+
}]
|
|
2072
|
+
}] });
|
|
2073
|
+
|
|
2074
|
+
class BsSecondsTodayOffsetPipe {
|
|
2075
|
+
transform(value) {
|
|
2076
|
+
const today = new Date(value.start);
|
|
2077
|
+
today.setHours(0);
|
|
2078
|
+
today.setMinutes(0);
|
|
2079
|
+
today.setSeconds(0);
|
|
2080
|
+
return (value.start.getTime() - today.getTime()) / 1000;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
BsSecondsTodayOffsetPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTodayOffsetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2084
|
+
BsSecondsTodayOffsetPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTodayOffsetPipe, name: "bsSecondsTodayOffset" });
|
|
2085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTodayOffsetPipe, decorators: [{
|
|
2086
|
+
type: Pipe,
|
|
2087
|
+
args: [{
|
|
2088
|
+
name: 'bsSecondsTodayOffset'
|
|
2089
|
+
}]
|
|
2090
|
+
}] });
|
|
2091
|
+
|
|
2092
|
+
class BsSecondsTimespanPipe {
|
|
2093
|
+
transform(value) {
|
|
2094
|
+
return (value.end.getTime() - value.start.getTime()) / 1000;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
BsSecondsTimespanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTimespanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2098
|
+
BsSecondsTimespanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTimespanPipe, name: "bsSecondsTimespan" });
|
|
2099
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSecondsTimespanPipe, decorators: [{
|
|
2100
|
+
type: Pipe,
|
|
2101
|
+
args: [{
|
|
2102
|
+
name: 'bsSecondsTimespan'
|
|
2103
|
+
}]
|
|
2104
|
+
}] });
|
|
2105
|
+
|
|
2106
|
+
class DayOfWeekPipe {
|
|
2107
|
+
transform(value) {
|
|
2108
|
+
const dayOfWeek = value.start.getDay();
|
|
2109
|
+
if (dayOfWeek === 0) {
|
|
2110
|
+
return 7;
|
|
2111
|
+
}
|
|
2112
|
+
else {
|
|
2113
|
+
return dayOfWeek;
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
DayOfWeekPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DayOfWeekPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2118
|
+
DayOfWeekPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DayOfWeekPipe, name: "dayOfWeek" });
|
|
2119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DayOfWeekPipe, decorators: [{
|
|
2120
|
+
type: Pipe,
|
|
2121
|
+
args: [{
|
|
2122
|
+
name: 'dayOfWeek'
|
|
2123
|
+
}]
|
|
2124
|
+
}] });
|
|
2125
|
+
|
|
2126
|
+
class BsSchedulerComponent {
|
|
2127
|
+
constructor(calendarMonthService, timelineService) {
|
|
2128
|
+
this.calendarMonthService = calendarMonthService;
|
|
2129
|
+
this.timelineService = timelineService;
|
|
2130
|
+
this.events$ = new BehaviorSubject([]);
|
|
2131
|
+
this.previewEvent$ = new BehaviorSubject(null);
|
|
2132
|
+
this.timeSlotDuration$ = new BehaviorSubject(1800);
|
|
2133
|
+
this.mouseState$ = new BehaviorSubject(false);
|
|
2134
|
+
this.hoveredTimeSlot$ = new BehaviorSubject(null);
|
|
2135
|
+
this.destroyed$ = new Subject();
|
|
2136
|
+
//#region UnitHeight
|
|
2137
|
+
this.unitHeight$ = new BehaviorSubject(40);
|
|
2138
|
+
this.unitHeightChange = new EventEmitter();
|
|
2139
|
+
this.operation = null;
|
|
2140
|
+
this.dragStartTimeslot = null;
|
|
2141
|
+
const monday = this.calendarMonthService.getMondayBefore(new Date());
|
|
2142
|
+
this.currentWeek$ = new BehaviorSubject(monday);
|
|
2143
|
+
this.daysOfWeek$ = this.currentWeek$.pipe(map((weekMonday) => {
|
|
2144
|
+
weekMonday.setHours(0);
|
|
2145
|
+
weekMonday.setMinutes(0);
|
|
2146
|
+
weekMonday.setSeconds(0);
|
|
2147
|
+
weekMonday.setMilliseconds(0);
|
|
2148
|
+
return Array.from(Array(7).keys()).map((x) => this.addDays(weekMonday, x));
|
|
2149
|
+
}));
|
|
2150
|
+
this.daysOfWeekWithTimestamps$ = this.daysOfWeek$
|
|
2151
|
+
.pipe(map((daysOfWeek) => {
|
|
2152
|
+
return { start: daysOfWeek[0].getTime(), end: daysOfWeek[daysOfWeek.length - 1].getTime() + 24 * 60 * 60 * 1000 };
|
|
2153
|
+
}));
|
|
2154
|
+
this.eventParts$ = this.events$.pipe(map((events) => events.map((ev) => this.timelineService.splitInParts(ev))));
|
|
2155
|
+
this.eventPartsForThisWeek$ = combineLatest([
|
|
2156
|
+
this.daysOfWeekWithTimestamps$,
|
|
2157
|
+
this.eventParts$
|
|
2158
|
+
.pipe(map(eventParts => eventParts.map(evp => evp.parts)))
|
|
2159
|
+
.pipe(map(jaggedParts => {
|
|
2160
|
+
return jaggedParts.reduce((flat, toFlatten) => flat.concat(toFlatten), []);
|
|
2161
|
+
}))
|
|
2162
|
+
])
|
|
2163
|
+
.pipe(map(([startAndEnd, eventParts]) => {
|
|
2164
|
+
return eventParts.filter(eventPart => {
|
|
2165
|
+
return !((eventPart.end.getTime() <= startAndEnd.start) || (eventPart.start.getTime() >= startAndEnd.end));
|
|
2166
|
+
});
|
|
2167
|
+
}));
|
|
2168
|
+
this.previewEventParts$ = this.previewEvent$.pipe(map((event) => {
|
|
2169
|
+
if (event) {
|
|
2170
|
+
return this.timelineService.splitInParts(event);
|
|
2171
|
+
}
|
|
2172
|
+
else {
|
|
2173
|
+
return null;
|
|
2174
|
+
}
|
|
2175
|
+
}));
|
|
2176
|
+
this.previewEventPartsForThisWeek$ = combineLatest([this.daysOfWeekWithTimestamps$, this.previewEventParts$])
|
|
2177
|
+
.pipe(map(([startAndEnd, previewEventParts]) => {
|
|
2178
|
+
if (previewEventParts) {
|
|
2179
|
+
return previewEventParts.parts.filter(eventPart => {
|
|
2180
|
+
return !((eventPart.end.getTime() <= startAndEnd.start) || (eventPart.start.getTime() >= startAndEnd.end));
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
else {
|
|
2184
|
+
return [];
|
|
2185
|
+
}
|
|
2186
|
+
}));
|
|
2187
|
+
this.timelinedEventPartsForThisWeek$ = this.eventPartsForThisWeek$
|
|
2188
|
+
.pipe(map(eventParts => {
|
|
2189
|
+
// We'll only use the events for this week
|
|
2190
|
+
const events = eventParts.map(ep => ep.event)
|
|
2191
|
+
.filter((e, i, list) => list.indexOf(e) === i)
|
|
2192
|
+
.filter((e) => !!e)
|
|
2193
|
+
.map((e) => e);
|
|
2194
|
+
const timeline = this.timelineService.getTimeline(events);
|
|
2195
|
+
const result = timeline.map(track => {
|
|
2196
|
+
return track.events.map(ev => {
|
|
2197
|
+
return { event: ev, index: track.index };
|
|
2198
|
+
});
|
|
2199
|
+
})
|
|
2200
|
+
.reduce((flat, toFlatten) => flat.concat(toFlatten), [])
|
|
2201
|
+
.map((evi) => eventParts.filter(p => p.event === evi.event).map(p => {
|
|
2202
|
+
return { part: p, index: evi.index };
|
|
2203
|
+
}))
|
|
2204
|
+
.reduce((flat, toFlatten) => flat.concat(toFlatten), []);
|
|
2205
|
+
return {
|
|
2206
|
+
total: timeline.length,
|
|
2207
|
+
parts: result
|
|
2208
|
+
};
|
|
2209
|
+
}));
|
|
2210
|
+
this.timeSlots$ = combineLatest([this.daysOfWeek$, this.timeSlotDuration$])
|
|
2211
|
+
.pipe(map(([daysOfWeek, duration]) => {
|
|
2212
|
+
const timeSlotsPerDay = Math.floor((60 * 60 * 24) / duration);
|
|
2213
|
+
return Array.from(Array(timeSlotsPerDay).keys()).map((index) => {
|
|
2214
|
+
const timeSlotStart = new Date(daysOfWeek[0]);
|
|
2215
|
+
timeSlotStart.setSeconds(timeSlotStart.getSeconds() + index * duration);
|
|
2216
|
+
const timeSlotEnd = new Date(timeSlotStart);
|
|
2217
|
+
timeSlotEnd.setSeconds(timeSlotEnd.getSeconds() + duration);
|
|
2218
|
+
return daysOfWeek.map((day) => {
|
|
2219
|
+
const start = new Date(day);
|
|
2220
|
+
start.setHours(timeSlotStart.getHours());
|
|
2221
|
+
start.setMinutes(timeSlotStart.getMinutes());
|
|
2222
|
+
start.setSeconds(timeSlotStart.getSeconds());
|
|
2223
|
+
start.setMilliseconds(timeSlotStart.getMilliseconds());
|
|
2224
|
+
const end = new Date(day);
|
|
2225
|
+
end.setHours(timeSlotEnd.getHours());
|
|
2226
|
+
end.setMinutes(timeSlotEnd.getMinutes());
|
|
2227
|
+
end.setSeconds(timeSlotEnd.getSeconds());
|
|
2228
|
+
end.setMilliseconds(timeSlotEnd.getMilliseconds());
|
|
2229
|
+
return { start, end };
|
|
2230
|
+
});
|
|
2231
|
+
});
|
|
2232
|
+
}));
|
|
2233
|
+
this.unitHeight$
|
|
2234
|
+
.pipe(takeUntil(this.destroyed$))
|
|
2235
|
+
.subscribe((unitHeight) => {
|
|
2236
|
+
this.unitHeightChange.emit(unitHeight);
|
|
2237
|
+
});
|
|
2238
|
+
}
|
|
2239
|
+
get unitHeight() {
|
|
2240
|
+
return this.unitHeight$.value;
|
|
2241
|
+
}
|
|
2242
|
+
set unitHeight(value) {
|
|
2243
|
+
this.unitHeight$.next(value);
|
|
2244
|
+
}
|
|
2245
|
+
//#endregion
|
|
2246
|
+
addDays(date, days) {
|
|
2247
|
+
const result = new Date(date);
|
|
2248
|
+
result.setDate(result.getDate() + days);
|
|
2249
|
+
return result;
|
|
2250
|
+
}
|
|
2251
|
+
onPreviousWeek() {
|
|
2252
|
+
this.currentWeek$
|
|
2253
|
+
.pipe(map((w) => this.addDays(w, -7)), take(1))
|
|
2254
|
+
.subscribe((w) => this.currentWeek$.next(w));
|
|
2255
|
+
}
|
|
2256
|
+
onNextWeek() {
|
|
2257
|
+
this.currentWeek$
|
|
2258
|
+
.pipe(map((w) => this.addDays(w, 7)), take(1))
|
|
2259
|
+
.subscribe((w) => this.currentWeek$.next(w));
|
|
2260
|
+
}
|
|
2261
|
+
onCreateEvent(ev, slot) {
|
|
2262
|
+
ev.preventDefault();
|
|
2263
|
+
this.mouseState$.next(true);
|
|
2264
|
+
this.dragStartTimeslot = slot;
|
|
2265
|
+
this.operation = {
|
|
2266
|
+
operation: EDragOperation.createEvent,
|
|
2267
|
+
event: {
|
|
2268
|
+
start: slot.start,
|
|
2269
|
+
end: slot.end,
|
|
2270
|
+
color: '#5AC8FA',
|
|
2271
|
+
description: 'Test event',
|
|
2272
|
+
}
|
|
2273
|
+
};
|
|
2274
|
+
this.previewEvent$.next({ start: slot.start, end: slot.end });
|
|
2275
|
+
// this.events$.next([...this.events$.value, this.operation.event]);
|
|
2276
|
+
}
|
|
2277
|
+
onStartDragEvent(eventPart, ev) {
|
|
2278
|
+
ev.preventDefault();
|
|
2279
|
+
this.hoveredTimeSlot$.pipe(take(1)).subscribe((hoveredTimeSlot) => {
|
|
2280
|
+
if (eventPart.event) {
|
|
2281
|
+
this.dragStartTimeslot = hoveredTimeSlot;
|
|
2282
|
+
this.operation = {
|
|
2283
|
+
operation: EDragOperation.moveEvent,
|
|
2284
|
+
event: eventPart.event,
|
|
2285
|
+
};
|
|
2286
|
+
this.previewEvent$.next({ start: eventPart.event.start, end: eventPart.event.end });
|
|
2287
|
+
}
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
//#region hoveredTimeslot$
|
|
2291
|
+
getHoveredTimeslot(ev, timeSlots) {
|
|
2292
|
+
const hoveredSlots = this.timeSlotElements.filter((el) => {
|
|
2293
|
+
const rct = el.nativeElement.getBoundingClientRect();
|
|
2294
|
+
if (rct.left <= ev.x && ev.x <= rct.right && rct.top <= ev.y && ev.y <= rct.bottom) {
|
|
2295
|
+
return true;
|
|
2296
|
+
}
|
|
2297
|
+
else {
|
|
2298
|
+
return false;
|
|
2299
|
+
}
|
|
2300
|
+
});
|
|
2301
|
+
if (!hoveredSlots || hoveredSlots.length === 0) {
|
|
2302
|
+
return null;
|
|
2303
|
+
}
|
|
2304
|
+
const slotElement = hoveredSlots[0].nativeElement;
|
|
2305
|
+
const strRow = slotElement.getAttribute('data-row');
|
|
2306
|
+
if (!strRow) {
|
|
2307
|
+
return null;
|
|
2308
|
+
}
|
|
2309
|
+
const row = parseInt(strRow);
|
|
2310
|
+
const strColumn = slotElement.getAttribute('data-column');
|
|
2311
|
+
if (!strColumn) {
|
|
2312
|
+
return null;
|
|
2313
|
+
}
|
|
2314
|
+
const column = parseInt(strColumn);
|
|
2315
|
+
const slot = timeSlots[row][column];
|
|
2316
|
+
return slot;
|
|
2317
|
+
}
|
|
2318
|
+
onMousemove(ev) {
|
|
2319
|
+
this.timeSlots$.pipe(take(1)).subscribe((timeSlots) => {
|
|
2320
|
+
const hovered = this.getHoveredTimeslot(ev, timeSlots);
|
|
2321
|
+
this.hoveredTimeSlot$.next(hovered);
|
|
2322
|
+
if (this.operation) {
|
|
2323
|
+
switch (this.operation.operation) {
|
|
2324
|
+
case EDragOperation.createEvent:
|
|
2325
|
+
{
|
|
2326
|
+
if (this.operation.event && this.dragStartTimeslot && hovered && (this.operation.event.end.getTime() != hovered.end.getTime())) {
|
|
2327
|
+
if (this.dragStartTimeslot.start.getTime() === hovered.start.getTime()) {
|
|
2328
|
+
// 1 slot
|
|
2329
|
+
}
|
|
2330
|
+
else if (this.dragStartTimeslot.start.getTime() < hovered.start.getTime()) {
|
|
2331
|
+
// Drag down
|
|
2332
|
+
// this.operation.event.start = this.dragStartTimeslot.start;
|
|
2333
|
+
// this.operation.event.end = hovered.end;
|
|
2334
|
+
// this.events$.next(this.events$.value);
|
|
2335
|
+
this.previewEvent$
|
|
2336
|
+
.pipe(filter((ev) => !!ev && !!this.dragStartTimeslot))
|
|
2337
|
+
.pipe(map((ev) => {
|
|
2338
|
+
if (ev && this.dragStartTimeslot) {
|
|
2339
|
+
ev.start = this.dragStartTimeslot.start;
|
|
2340
|
+
ev.end = hovered.end;
|
|
2341
|
+
}
|
|
2342
|
+
return ev;
|
|
2343
|
+
}))
|
|
2344
|
+
.pipe(take(1))
|
|
2345
|
+
.subscribe((ev) => this.previewEvent$.next(ev));
|
|
2346
|
+
}
|
|
2347
|
+
else if (this.dragStartTimeslot.start.getTime() > hovered.start.getTime()) {
|
|
2348
|
+
// Drag up
|
|
2349
|
+
// this.operation.event.start = hovered.start;
|
|
2350
|
+
// this.operation.event.end = this.dragStartTimeslot.end;
|
|
2351
|
+
// this.events$.next(this.events$.value);
|
|
2352
|
+
this.previewEvent$
|
|
2353
|
+
.pipe(filter((ev) => !!ev && !!this.dragStartTimeslot))
|
|
2354
|
+
.pipe(map((ev) => {
|
|
2355
|
+
if (ev && this.dragStartTimeslot) {
|
|
2356
|
+
ev.start = hovered.start;
|
|
2357
|
+
ev.end = this.dragStartTimeslot.end;
|
|
2358
|
+
}
|
|
2359
|
+
return ev;
|
|
2360
|
+
}))
|
|
2361
|
+
.pipe(take(1))
|
|
2362
|
+
.subscribe((ev) => this.previewEvent$.next(ev));
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
break;
|
|
2367
|
+
case EDragOperation.moveEvent:
|
|
2368
|
+
{
|
|
2369
|
+
if (hovered && this.dragStartTimeslot) {
|
|
2370
|
+
// this.operation.event.start.setTime(this.operation.event.start.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
|
|
2371
|
+
// this.operation.event.end.setTime(this.operation.event.end.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
|
|
2372
|
+
// this.dragStartTimeslot = hovered;
|
|
2373
|
+
// // this.events$.next(this.events$.value);
|
|
2374
|
+
this.previewEvent$
|
|
2375
|
+
.pipe(filter((ev) => !!ev && !!this.dragStartTimeslot))
|
|
2376
|
+
.pipe(map((ev) => {
|
|
2377
|
+
if (ev && this.dragStartTimeslot) {
|
|
2378
|
+
ev.start.setTime(ev.start.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
|
|
2379
|
+
ev.end.setTime(ev.end.getTime() + hovered.start.getTime() - this.dragStartTimeslot.start.getTime());
|
|
2380
|
+
this.dragStartTimeslot = hovered;
|
|
2381
|
+
}
|
|
2382
|
+
return ev;
|
|
2383
|
+
}))
|
|
2384
|
+
.pipe(take(1))
|
|
2385
|
+
.subscribe((ev) => this.previewEvent$.next(ev));
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
break;
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
});
|
|
2392
|
+
}
|
|
2393
|
+
//#endregion
|
|
2394
|
+
onMouseUp(ev) {
|
|
2395
|
+
if (this.operation) {
|
|
2396
|
+
switch (this.operation.operation) {
|
|
2397
|
+
case EDragOperation.createEvent:
|
|
2398
|
+
{
|
|
2399
|
+
combineLatest([this.previewEvent$])
|
|
2400
|
+
.pipe(take(1))
|
|
2401
|
+
.subscribe(([previewEvent]) => {
|
|
2402
|
+
if (previewEvent) {
|
|
2403
|
+
this.operation = null;
|
|
2404
|
+
this.dragStartTimeslot = null;
|
|
2405
|
+
this.events$.next([...this.events$.value, {
|
|
2406
|
+
start: previewEvent.start,
|
|
2407
|
+
end: previewEvent.end,
|
|
2408
|
+
color: '#F00',
|
|
2409
|
+
description: 'New event'
|
|
2410
|
+
}]);
|
|
2411
|
+
this.previewEvent$.next(null);
|
|
2412
|
+
}
|
|
2413
|
+
});
|
|
2414
|
+
}
|
|
2415
|
+
break;
|
|
2416
|
+
case EDragOperation.moveEvent:
|
|
2417
|
+
{
|
|
2418
|
+
this.previewEvent$
|
|
2419
|
+
.pipe(filter((ev) => !!ev))
|
|
2420
|
+
.pipe(take(1))
|
|
2421
|
+
.subscribe((previewEvent) => {
|
|
2422
|
+
if (this.operation && this.operation.event && previewEvent) {
|
|
2423
|
+
this.operation.event.start = previewEvent.start;
|
|
2424
|
+
this.operation.event.end = previewEvent.end;
|
|
2425
|
+
this.operation = null;
|
|
2426
|
+
this.dragStartTimeslot = null;
|
|
2427
|
+
this.events$.next(this.events$.value);
|
|
2428
|
+
this.previewEvent$.next(null);
|
|
2429
|
+
}
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2432
|
+
break;
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
ngOnDestroy() {
|
|
2437
|
+
this.destroyed$.next(true);
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
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 });
|
|
2441
|
+
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()\"><</button>\n <button class=\"btn btn-default flex-end\" (click)=\"onNextWeek()\">></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 } });
|
|
2442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerComponent, decorators: [{
|
|
2443
|
+
type: Component,
|
|
2444
|
+
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()\"><</button>\n <button class=\"btn btn-default flex-end\" (click)=\"onNextWeek()\">></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"] }]
|
|
2445
|
+
}], ctorParameters: function () { return [{ type: BsCalendarMonthService }, { type: BsTimelineService }]; }, propDecorators: { timeSlotElements: [{
|
|
2446
|
+
type: ViewChildren,
|
|
2447
|
+
args: ['slot']
|
|
2448
|
+
}], unitHeightChange: [{
|
|
2449
|
+
type: Output
|
|
2450
|
+
}], unitHeight: [{
|
|
2451
|
+
type: Input
|
|
2452
|
+
}], onMousemove: [{
|
|
2453
|
+
type: HostListener,
|
|
2454
|
+
args: ['document:mousemove', ['$event']]
|
|
2455
|
+
}], onMouseUp: [{
|
|
2456
|
+
type: HostListener,
|
|
2457
|
+
args: ['document:mouseup', ['$event']]
|
|
2458
|
+
}] } });
|
|
2459
|
+
|
|
2460
|
+
class DateOffsetPipe {
|
|
2461
|
+
transform(value) {
|
|
2462
|
+
const today = new Date(value.start);
|
|
2463
|
+
today.setHours(0);
|
|
2464
|
+
today.setMinutes(0);
|
|
2465
|
+
today.setSeconds(0);
|
|
2466
|
+
return (value.start.getTime() - today.getTime()) / 1000;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
DateOffsetPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateOffsetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2470
|
+
DateOffsetPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateOffsetPipe, name: "dateOffset" });
|
|
2471
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateOffsetPipe, decorators: [{
|
|
2472
|
+
type: Pipe,
|
|
2473
|
+
args: [{
|
|
2474
|
+
name: 'dateOffset'
|
|
2475
|
+
}]
|
|
2476
|
+
}] });
|
|
2477
|
+
|
|
2478
|
+
class BsSchedulerModule {
|
|
2479
|
+
}
|
|
2480
|
+
BsSchedulerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2481
|
+
BsSchedulerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, declarations: [BsSchedulerComponent,
|
|
2482
|
+
BsSecondsTimespanPipe,
|
|
2483
|
+
BsSecondsTodayOffsetPipe,
|
|
2484
|
+
DateOffsetPipe,
|
|
2485
|
+
DayOfWeekPipe], imports: [CommonModule], exports: [BsSchedulerComponent] });
|
|
2486
|
+
BsSchedulerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, imports: [[
|
|
2487
|
+
CommonModule
|
|
2488
|
+
]] });
|
|
2489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsSchedulerModule, decorators: [{
|
|
2490
|
+
type: NgModule,
|
|
2491
|
+
args: [{
|
|
2492
|
+
declarations: [
|
|
2493
|
+
BsSchedulerComponent,
|
|
2494
|
+
BsSecondsTimespanPipe,
|
|
2495
|
+
BsSecondsTodayOffsetPipe,
|
|
2496
|
+
DateOffsetPipe,
|
|
2497
|
+
DayOfWeekPipe
|
|
2498
|
+
],
|
|
2499
|
+
imports: [
|
|
2500
|
+
CommonModule
|
|
2501
|
+
],
|
|
2502
|
+
exports: [
|
|
2503
|
+
BsSchedulerComponent
|
|
2504
|
+
]
|
|
2505
|
+
}]
|
|
2506
|
+
}] });
|
|
2507
|
+
|
|
2005
2508
|
class BsListGroupItemComponent {
|
|
2006
2509
|
constructor() {
|
|
2007
2510
|
}
|
|
@@ -2190,7 +2693,6 @@ class BsModalService {
|
|
|
2190
2693
|
hasBackdrop: true
|
|
2191
2694
|
});
|
|
2192
2695
|
const componentInstance = overlayRef.attach(portal);
|
|
2193
|
-
console.log('instance', componentInstance);
|
|
2194
2696
|
componentInstance.instance['instance'] = {
|
|
2195
2697
|
component: componentInstance,
|
|
2196
2698
|
overlay: overlayRef
|
|
@@ -2326,6 +2828,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
2326
2828
|
|
|
2327
2829
|
class BsNavbarComponent {
|
|
2328
2830
|
constructor() {
|
|
2831
|
+
this.autoclose = true;
|
|
2329
2832
|
this.expandButtonTemplate = null;
|
|
2330
2833
|
this.isExpanded$ = new BehaviorSubject(false);
|
|
2331
2834
|
}
|
|
@@ -2336,13 +2839,15 @@ class BsNavbarComponent {
|
|
|
2336
2839
|
}
|
|
2337
2840
|
}
|
|
2338
2841
|
BsNavbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2339
|
-
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-
|
|
2842
|
+
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 } });
|
|
2340
2843
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarComponent, decorators: [{
|
|
2341
2844
|
type: Component,
|
|
2342
|
-
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-
|
|
2845
|
+
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"] }]
|
|
2343
2846
|
}], propDecorators: { nav: [{
|
|
2344
2847
|
type: ViewChild,
|
|
2345
2848
|
args: ['nav']
|
|
2849
|
+
}], autoclose: [{
|
|
2850
|
+
type: Input
|
|
2346
2851
|
}] } });
|
|
2347
2852
|
|
|
2348
2853
|
class BsNavbarNavComponent {
|
|
@@ -2408,7 +2913,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
2408
2913
|
}] } });
|
|
2409
2914
|
|
|
2410
2915
|
class BsNavbarItemComponent {
|
|
2411
|
-
constructor(parentDropdown, element) {
|
|
2916
|
+
constructor(navbar, parentDropdown, element) {
|
|
2917
|
+
this.navbar = navbar;
|
|
2412
2918
|
this.element = element;
|
|
2413
2919
|
this.hasDropdown = false;
|
|
2414
2920
|
this.anchorTag = null;
|
|
@@ -2435,7 +2941,7 @@ class BsNavbarItemComponent {
|
|
|
2435
2941
|
}
|
|
2436
2942
|
else {
|
|
2437
2943
|
// Close if this is a link
|
|
2438
|
-
if (this.
|
|
2944
|
+
if (this.dropdowns.length === 0) {
|
|
2439
2945
|
if (this.anchorTag && !this.anchorTag.onclick) {
|
|
2440
2946
|
this.anchorTag.onclick = (ev) => {
|
|
2441
2947
|
let d = this.parentDropdown;
|
|
@@ -2443,19 +2949,22 @@ class BsNavbarItemComponent {
|
|
|
2443
2949
|
d.isVisible = false;
|
|
2444
2950
|
d = d.parentDropdown;
|
|
2445
2951
|
}
|
|
2952
|
+
if (this.navbar.autoclose) {
|
|
2953
|
+
this.navbar.isExpanded$.next(false);
|
|
2954
|
+
}
|
|
2446
2955
|
};
|
|
2447
2956
|
}
|
|
2448
2957
|
}
|
|
2449
2958
|
}
|
|
2450
2959
|
}
|
|
2451
2960
|
}
|
|
2452
|
-
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 });
|
|
2961
|
+
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 });
|
|
2453
2962
|
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"] });
|
|
2454
2963
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarItemComponent, decorators: [{
|
|
2455
2964
|
type: Component,
|
|
2456
2965
|
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"] }]
|
|
2457
2966
|
}], ctorParameters: function () {
|
|
2458
|
-
return [{ type: BsNavbarDropdownComponent, decorators: [{
|
|
2967
|
+
return [{ type: BsNavbarComponent }, { type: BsNavbarDropdownComponent, decorators: [{
|
|
2459
2968
|
type: Optional
|
|
2460
2969
|
}] }, { type: i0.ElementRef }];
|
|
2461
2970
|
}, propDecorators: { dropdowns: [{
|
|
@@ -2636,7 +3145,7 @@ class BsNavbarTogglerComponent {
|
|
|
2636
3145
|
this.stateChange.emit(this._state);
|
|
2637
3146
|
}
|
|
2638
3147
|
//#endregion
|
|
2639
|
-
toggleState() {
|
|
3148
|
+
toggleState(ev) {
|
|
2640
3149
|
switch (this._state) {
|
|
2641
3150
|
case 'open':
|
|
2642
3151
|
this.state = 'closed';
|
|
@@ -2648,14 +3157,17 @@ class BsNavbarTogglerComponent {
|
|
|
2648
3157
|
}
|
|
2649
3158
|
}
|
|
2650
3159
|
BsNavbarTogglerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarTogglerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2651
|
-
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\"
|
|
3160
|
+
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"] }] });
|
|
2652
3161
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarTogglerComponent, decorators: [{
|
|
2653
3162
|
type: Component,
|
|
2654
|
-
args: [{ selector: 'bs-navbar-toggler', template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\"
|
|
3163
|
+
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"] }]
|
|
2655
3164
|
}], propDecorators: { stateChange: [{
|
|
2656
3165
|
type: Output
|
|
2657
3166
|
}], state: [{
|
|
2658
3167
|
type: Input
|
|
3168
|
+
}], toggleState: [{
|
|
3169
|
+
type: HostListener,
|
|
3170
|
+
args: ['click', ['$event']]
|
|
2659
3171
|
}] } });
|
|
2660
3172
|
|
|
2661
3173
|
class BsNavbarModule {
|
|
@@ -3593,5 +4105,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
3593
4105
|
* Generated bundle index. Do not edit.
|
|
3594
4106
|
*/
|
|
3595
4107
|
|
|
3596
|
-
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 };
|
|
4108
|
+
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 };
|
|
3597
4109
|
//# sourceMappingURL=mintplayer-ng-bootstrap.mjs.map
|