@dereekb/dbx-web 13.4.0 → 13.4.2
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/fesm2022/dereekb-dbx-web-calendar.mjs +51 -17
- package/fesm2022/dereekb-dbx-web-calendar.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web-mapbox.mjs +44 -12
- package/fesm2022/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web-table.mjs +48 -10
- package/fesm2022/dereekb-dbx-web-table.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web.mjs +467 -180
- package/fesm2022/dereekb-dbx-web.mjs.map +1 -1
- package/package.json +6 -6
- package/types/dereekb-dbx-web-calendar.d.ts +40 -2
- package/types/dereekb-dbx-web-mapbox.d.ts +27 -1
- package/types/dereekb-dbx-web-table.d.ts +47 -6
- package/types/dereekb-dbx-web.d.ts +500 -113
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, ChangeDetectionStrategy, Component, output, computed
|
|
2
|
+
import { Injectable, inject, ChangeDetectionStrategy, Component, output, computed } from '@angular/core';
|
|
3
3
|
import { isSameDay, startOfDay, endOfDay, startOfWeek, endOfWeek, startOfMonth, endOfMonth, differenceInDays, isAfter, isBefore, addDays, isSameMonth } from 'date-fns';
|
|
4
|
-
import
|
|
5
|
-
import { CalendarModule, CalendarDayModule, CalendarWeekModule, DateAdapter } from 'angular-calendar';
|
|
4
|
+
import { CalendarDatePipe, CalendarMonthViewComponent, CalendarDayViewComponent, CalendarWeekViewComponent, provideCalendar, DateAdapter } from 'angular-calendar';
|
|
6
5
|
import { dateRangeOverlapsDateRangeFunction, isDateInDateRange, isSameDateRange, isSameDateDay, isFullDateRange, clampDateToDateRange, formatToTimeAndDurationString, sortDateRangeStartAscendingCompareFunction } from '@dereekb/date';
|
|
7
6
|
import { invertDecision, reduceBooleansWithAndFn } from '@dereekb/util';
|
|
8
7
|
import { ComponentStore } from '@ngrx/component-store';
|
|
9
8
|
import { distinctUntilChanged, switchMap, first, tap, map, shareReplay, combineLatest, withLatestFrom } from 'rxjs';
|
|
10
|
-
import * as
|
|
9
|
+
import * as i1$1 from '@angular/material/button-toggle';
|
|
11
10
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
12
11
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
13
12
|
import { FlexLayoutModule } from '@ngbracket/ngx-layout';
|
|
@@ -27,9 +26,23 @@ var CalendarDisplayType;
|
|
|
27
26
|
CalendarDisplayType["WEEK"] = "week";
|
|
28
27
|
CalendarDisplayType["DAY"] = "day";
|
|
29
28
|
})(CalendarDisplayType || (CalendarDisplayType = {}));
|
|
29
|
+
/**
|
|
30
|
+
* Compares two {@link CalendarViewDateRange} values for equality by checking type, start/end dates, distance, and min/max visibility flags.
|
|
31
|
+
*
|
|
32
|
+
* @param a - First calendar view date range to compare.
|
|
33
|
+
* @param b - Second calendar view date range to compare.
|
|
34
|
+
* @returns Whether the two date ranges are considered equal.
|
|
35
|
+
*/
|
|
30
36
|
function isCalendarViewDateRangeEqual(a, b) {
|
|
31
37
|
return a.type === b.type && isSameDay(a.start, b.start) && isSameDay(a.end, b.end) && a.distance === b.distance && a.isMinDateVisible === b.isMinDateVisible && a.isMaxDateVisible === b.isMaxDateVisible;
|
|
32
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Computes the visible date range for the given calendar state based on display type (month, week, or day)
|
|
41
|
+
* and the optional navigation range limit.
|
|
42
|
+
*
|
|
43
|
+
* @param calendarState - The current calendar state containing display type, date, and navigation limits.
|
|
44
|
+
* @returns The computed visible date range including start, end, distance, and min/max visibility flags.
|
|
45
|
+
*/
|
|
33
46
|
function visibleDateRangeForCalendarState(calendarState) {
|
|
34
47
|
const { navigationRangeLimit, type, date } = calendarState;
|
|
35
48
|
let start;
|
|
@@ -56,7 +69,7 @@ function visibleDateRangeForCalendarState(calendarState) {
|
|
|
56
69
|
const isMaxDateVisible = navigationRangeLimit?.end != null ? !isBefore(end, navigationRangeLimit.end) : false;
|
|
57
70
|
// TODO: Consider changing min/max date visible logical utility to be fully within the current month or not,
|
|
58
71
|
// not just visible, since it can change to a locked out calendar and doesn't feel as UI friendly.
|
|
59
|
-
|
|
72
|
+
return {
|
|
60
73
|
type,
|
|
61
74
|
start,
|
|
62
75
|
end,
|
|
@@ -64,9 +77,9 @@ function visibleDateRangeForCalendarState(calendarState) {
|
|
|
64
77
|
isMinDateVisible,
|
|
65
78
|
isMaxDateVisible
|
|
66
79
|
};
|
|
67
|
-
return result;
|
|
68
80
|
}
|
|
69
81
|
const distinctUntilDateOrTypeOrEventsChanged = distinctUntilChanged((a, b) => a?.date === b?.date && a?.type === b?.type && a?.events === b?.events);
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
83
|
class DbxCalendarStore extends ComponentStore {
|
|
71
84
|
constructor() {
|
|
72
85
|
super({
|
|
@@ -166,16 +179,30 @@ class DbxCalendarStore extends ComponentStore {
|
|
|
166
179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxCalendarStore, decorators: [{
|
|
167
180
|
type: Injectable
|
|
168
181
|
}], ctorParameters: () => [] });
|
|
182
|
+
/**
|
|
183
|
+
* Returns an updated calendar state after tapping a date. Only updates if the date differs from the current one
|
|
184
|
+
* and falls within the navigation range limit. Toggles `dateTappedTwice` when the same day is tapped again.
|
|
185
|
+
*
|
|
186
|
+
* @param state - The current calendar state.
|
|
187
|
+
* @param date - The date that was tapped.
|
|
188
|
+
* @returns The updated calendar state reflecting the tapped date.
|
|
189
|
+
*/
|
|
169
190
|
function updateCalendarStateWithTappedDate(state, date) {
|
|
170
191
|
// only update the date if it is different
|
|
171
|
-
if (!isSameDateDay(state.date, date)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
state = { ...state, date, dateTappedTwice: isSameDay(date, state.date) ? !state.dateTappedTwice : false };
|
|
175
|
-
}
|
|
192
|
+
if (!isSameDateDay(state.date, date) && // Only update the date if it is within the date range
|
|
193
|
+
(!state.navigationRangeLimit || isDateInDateRange(date, state.navigationRangeLimit))) {
|
|
194
|
+
state = { ...state, date, dateTappedTwice: isSameDay(date, state.date) ? !state.dateTappedTwice : false };
|
|
176
195
|
}
|
|
177
196
|
return state;
|
|
178
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Returns an updated calendar state with a new navigation range limit. If the current date falls outside
|
|
200
|
+
* the new range, it is clamped to fit within the limit.
|
|
201
|
+
*
|
|
202
|
+
* @param state - The current calendar state.
|
|
203
|
+
* @param navigationRangeLimit - The new navigation date range limit, or undefined/null to remove the limit.
|
|
204
|
+
* @returns The updated calendar state with the applied navigation range limit.
|
|
205
|
+
*/
|
|
179
206
|
function updateCalendarStateWithNavigationRangeLimit(state, navigationRangeLimit) {
|
|
180
207
|
const { date } = state;
|
|
181
208
|
// cap the date if it doesn't fall within the range.
|
|
@@ -198,6 +225,12 @@ function timeSubtitleForEvent(event) {
|
|
|
198
225
|
}
|
|
199
226
|
return subtitle;
|
|
200
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Appends time/duration subtitles to each calendar event's title and sorts the events by start date in ascending order.
|
|
230
|
+
*
|
|
231
|
+
* @param events - The calendar events to prepare and sort.
|
|
232
|
+
* @returns A new array of calendar events with updated titles, sorted by start date.
|
|
233
|
+
*/
|
|
201
234
|
function prepareAndSortCalendarEvents(events) {
|
|
202
235
|
return events
|
|
203
236
|
.map((event) => {
|
|
@@ -261,11 +294,11 @@ class DbxCalendarBaseComponent {
|
|
|
261
294
|
this.calendarStore.setDisplayType(event.value);
|
|
262
295
|
}
|
|
263
296
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxCalendarBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
264
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DbxCalendarBaseComponent, isStandalone: true, selector: "dbx-calendar-base", ngImport: i0, template: "<div class=\"dbx-calendar\">\n <h3 class=\"dbx-calendar-title\">{{ viewDateSignal() | calendarDate: displayTypeSignal() + 'ViewTitle' : 'en' }}</h3>\n <div class=\"dbx-calendar-header\">\n <div class=\"dbx-calendar-controls\" fxLayout=\"row\" fxLayout.xs=\"column\" ngClass.xs=\"dbx-calendar-controls-compact\">\n <span class=\"dbx-calendar-controls-left dbx-flex-bar\" fxFlex=\"nogrow\">\n @if (showTodayButtonSignal()) {\n <button mat-stroked-button [disabled]=\"!canJumpToTodaySignal()\" (click)=\"todayClicked()\">Today</button>\n }\n <dbx-button-spacer></dbx-button-spacer>\n @if (hasMultiplePagesSignal()) {\n <div class=\"d-iblock\">\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" aria-label=\"first page button\" (click)=\"firstPageButtonClicked()\">\n <mat-icon>first_page</mat-icon>\n </button>\n }\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" [attr.aria-label]=\"'Previous ' + displayTypeSignal() + ' button'\" (click)=\"previousButtonClicked()\">\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" [attr.aria-label]=\"'Next ' + displayTypeSignal() + ' button'\" (click)=\"nextButtonClicked()\">\n <mat-icon>navigate_next</mat-icon>\n </button>\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" aria-label=\"last page button\" (click)=\"lastPageButtonClicked()\">\n <mat-icon>last_page</mat-icon>\n </button>\n }\n </div>\n }\n </span>\n <span class=\"spacer\"></span>\n <span class=\"dbx-calendar-controls-right\" fxFlex=\"nogrow\">\n <ng-content select=\"[controls]\"></ng-content>\n </span>\n </div>\n </div>\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type:
|
|
297
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DbxCalendarBaseComponent, isStandalone: true, selector: "dbx-calendar-base", ngImport: i0, template: "<div class=\"dbx-calendar\">\n <h3 class=\"dbx-calendar-title\">{{ viewDateSignal() | calendarDate: displayTypeSignal() + 'ViewTitle' : 'en' }}</h3>\n <div class=\"dbx-calendar-header\">\n <div class=\"dbx-calendar-controls\" fxLayout=\"row\" fxLayout.xs=\"column\" ngClass.xs=\"dbx-calendar-controls-compact\">\n <span class=\"dbx-calendar-controls-left dbx-flex-bar\" fxFlex=\"nogrow\">\n @if (showTodayButtonSignal()) {\n <button mat-stroked-button [disabled]=\"!canJumpToTodaySignal()\" (click)=\"todayClicked()\">Today</button>\n }\n <dbx-button-spacer></dbx-button-spacer>\n @if (hasMultiplePagesSignal()) {\n <div class=\"d-iblock\">\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" aria-label=\"first page button\" (click)=\"firstPageButtonClicked()\">\n <mat-icon>first_page</mat-icon>\n </button>\n }\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" [attr.aria-label]=\"'Previous ' + displayTypeSignal() + ' button'\" (click)=\"previousButtonClicked()\">\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" [attr.aria-label]=\"'Next ' + displayTypeSignal() + ' button'\" (click)=\"nextButtonClicked()\">\n <mat-icon>navigate_next</mat-icon>\n </button>\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" aria-label=\"last page button\" (click)=\"lastPageButtonClicked()\">\n <mat-icon>last_page</mat-icon>\n </button>\n }\n </div>\n }\n </span>\n <span class=\"spacer\"></span>\n <span class=\"dbx-calendar-controls-right\" fxFlex=\"nogrow\">\n <ng-content select=\"[controls]\"></ng-content>\n </span>\n </div>\n </div>\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: CalendarDatePipe, name: "calendarDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
265
298
|
}
|
|
266
299
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxCalendarBaseComponent, decorators: [{
|
|
267
300
|
type: Component,
|
|
268
|
-
args: [{ selector: 'dbx-calendar-base', standalone: true, imports: [MatButtonModule, MatButtonToggleModule, DbxButtonSpacerDirective, MatIconModule,
|
|
301
|
+
args: [{ selector: 'dbx-calendar-base', standalone: true, imports: [MatButtonModule, MatButtonToggleModule, DbxButtonSpacerDirective, MatIconModule, CalendarDatePipe, FlexLayoutModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dbx-calendar\">\n <h3 class=\"dbx-calendar-title\">{{ viewDateSignal() | calendarDate: displayTypeSignal() + 'ViewTitle' : 'en' }}</h3>\n <div class=\"dbx-calendar-header\">\n <div class=\"dbx-calendar-controls\" fxLayout=\"row\" fxLayout.xs=\"column\" ngClass.xs=\"dbx-calendar-controls-compact\">\n <span class=\"dbx-calendar-controls-left dbx-flex-bar\" fxFlex=\"nogrow\">\n @if (showTodayButtonSignal()) {\n <button mat-stroked-button [disabled]=\"!canJumpToTodaySignal()\" (click)=\"todayClicked()\">Today</button>\n }\n <dbx-button-spacer></dbx-button-spacer>\n @if (hasMultiplePagesSignal()) {\n <div class=\"d-iblock\">\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" aria-label=\"first page button\" (click)=\"firstPageButtonClicked()\">\n <mat-icon>first_page</mat-icon>\n </button>\n }\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" [attr.aria-label]=\"'Previous ' + displayTypeSignal() + ' button'\" (click)=\"previousButtonClicked()\">\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" [attr.aria-label]=\"'Next ' + displayTypeSignal() + ' button'\" (click)=\"nextButtonClicked()\">\n <mat-icon>navigate_next</mat-icon>\n </button>\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" aria-label=\"last page button\" (click)=\"lastPageButtonClicked()\">\n <mat-icon>last_page</mat-icon>\n </button>\n }\n </div>\n }\n </span>\n <span class=\"spacer\"></span>\n <span class=\"dbx-calendar-controls-right\" fxFlex=\"nogrow\">\n <ng-content select=\"[controls]\"></ng-content>\n </span>\n </div>\n </div>\n <ng-content></ng-content>\n</div>\n" }]
|
|
269
302
|
}] });
|
|
270
303
|
|
|
271
304
|
class DbxCalendarComponent {
|
|
@@ -304,19 +337,20 @@ class DbxCalendarComponent {
|
|
|
304
337
|
this.calendarStore.setDisplayType(event.value);
|
|
305
338
|
}
|
|
306
339
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
307
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DbxCalendarComponent, isStandalone: true, selector: "dbx-calendar", outputs: { clickEvent: "clickEvent" }, ngImport: i0, template: "<dbx-calendar-base>\n <ng-container controls>\n <mat-button-toggle-group name=\"calendarDisplayStyle\" [value]=\"displayTypeSignal()\" (change)=\"typeToggleChanged($event)\" aria-label=\"Display Style\">\n <mat-button-toggle value=\"month\">Month</mat-button-toggle>\n <mat-button-toggle value=\"week\">Week</mat-button-toggle>\n <mat-button-toggle value=\"day\">Day</mat-button-toggle>\n </mat-button-toggle-group>\n </ng-container>\n <div class=\"dbx-calendar-content\" [ngClass]=\"displayTypeClassSignal()\">\n @switch (displayTypeSignal()) {\n @case ('month') {\n <mwl-calendar-month-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" [activeDayIsOpen]=\"activeDayIsOpenSignal()\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-month-view>\n }\n @case ('week') {\n <mwl-calendar-week-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-week-view>\n }\n @case ('day') {\n <mwl-calendar-day-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-day-view>\n }\n }\n </div>\n</dbx-calendar-base>\n", dependencies: [{ kind: "component", type: DbxCalendarBaseComponent, selector: "dbx-calendar-base" }, { kind: "
|
|
340
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DbxCalendarComponent, isStandalone: true, selector: "dbx-calendar", outputs: { clickEvent: "clickEvent" }, ngImport: i0, template: "<dbx-calendar-base>\n <ng-container controls>\n <mat-button-toggle-group name=\"calendarDisplayStyle\" [value]=\"displayTypeSignal()\" (change)=\"typeToggleChanged($event)\" aria-label=\"Display Style\">\n <mat-button-toggle value=\"month\">Month</mat-button-toggle>\n <mat-button-toggle value=\"week\">Week</mat-button-toggle>\n <mat-button-toggle value=\"day\">Day</mat-button-toggle>\n </mat-button-toggle-group>\n </ng-container>\n <div class=\"dbx-calendar-content\" [ngClass]=\"displayTypeClassSignal()\">\n @switch (displayTypeSignal()) {\n @case ('month') {\n <mwl-calendar-month-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" [activeDayIsOpen]=\"activeDayIsOpenSignal()\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-month-view>\n }\n @case ('week') {\n <mwl-calendar-week-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-week-view>\n }\n @case ('day') {\n <mwl-calendar-day-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-day-view>\n }\n }\n </div>\n</dbx-calendar-base>\n", dependencies: [{ kind: "component", type: DbxCalendarBaseComponent, selector: "dbx-calendar-base" }, { kind: "component", type: CalendarMonthViewComponent, selector: "mwl-calendar-month-view", inputs: ["viewDate", "events", "excludeDays", "activeDayIsOpen", "activeDay", "refresh", "locale", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "weekStartsOn", "headerTemplate", "cellTemplate", "openDayEventsTemplate", "eventTitleTemplate", "eventActionsTemplate", "weekendDays"], outputs: ["beforeViewRender", "dayClicked", "eventClicked", "columnHeaderClicked", "eventTimesChanged"] }, { kind: "component", type: CalendarDayViewComponent, selector: "mwl-calendar-day-view", inputs: ["viewDate", "events", "hourSegments", "hourSegmentHeight", "hourDuration", "minimumEventHeight", "dayStartHour", "dayStartMinute", "dayEndHour", "dayEndMinute", "refresh", "locale", "eventSnapSize", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "hourSegmentTemplate", "eventTemplate", "eventTitleTemplate", "eventActionsTemplate", "snapDraggedEvents", "allDayEventsLabelTemplate", "currentTimeMarkerTemplate", "validateEventTimesChanged", "resizeCursors"], outputs: ["eventClicked", "hourSegmentClicked", "eventTimesChanged", "beforeViewRender"] }, { kind: "component", type: CalendarWeekViewComponent, selector: "mwl-calendar-week-view", inputs: ["viewDate", "events", "excludeDays", "refresh", "locale", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "weekStartsOn", "headerTemplate", "eventTemplate", "eventTitleTemplate", "eventActionsTemplate", "precision", "weekendDays", "snapDraggedEvents", "hourSegments", "hourDuration", "hourSegmentHeight", "minimumEventHeight", "dayStartHour", "dayStartMinute", "dayEndHour", "dayEndMinute", "hourSegmentTemplate", "eventSnapSize", "allDayEventsLabelTemplate", "daysInWeek", "currentTimeMarkerTemplate", "validateEventTimesChanged", "resizeCursors"], outputs: ["dayHeaderClicked", "eventClicked", "eventTimesChanged", "beforeViewRender", "hourSegmentClicked"] }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i1$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1$1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
308
341
|
}
|
|
309
342
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxCalendarComponent, decorators: [{
|
|
310
343
|
type: Component,
|
|
311
|
-
args: [{ selector: 'dbx-calendar', imports: [DbxCalendarBaseComponent,
|
|
344
|
+
args: [{ selector: 'dbx-calendar', imports: [DbxCalendarBaseComponent, CalendarMonthViewComponent, CalendarDayViewComponent, CalendarWeekViewComponent, MatButtonToggleModule, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<dbx-calendar-base>\n <ng-container controls>\n <mat-button-toggle-group name=\"calendarDisplayStyle\" [value]=\"displayTypeSignal()\" (change)=\"typeToggleChanged($event)\" aria-label=\"Display Style\">\n <mat-button-toggle value=\"month\">Month</mat-button-toggle>\n <mat-button-toggle value=\"week\">Week</mat-button-toggle>\n <mat-button-toggle value=\"day\">Day</mat-button-toggle>\n </mat-button-toggle-group>\n </ng-container>\n <div class=\"dbx-calendar-content\" [ngClass]=\"displayTypeClassSignal()\">\n @switch (displayTypeSignal()) {\n @case ('month') {\n <mwl-calendar-month-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" [activeDayIsOpen]=\"activeDayIsOpenSignal()\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-month-view>\n }\n @case ('week') {\n <mwl-calendar-week-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-week-view>\n }\n @case ('day') {\n <mwl-calendar-day-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-day-view>\n }\n }\n </div>\n</dbx-calendar-base>\n" }]
|
|
312
345
|
}], propDecorators: { clickEvent: [{ type: i0.Output, args: ["clickEvent"] }] } });
|
|
313
346
|
|
|
314
347
|
/**
|
|
315
348
|
* Provides default configuration for the DbxCalendarModule
|
|
349
|
+
*
|
|
350
|
+
* @returns Providers that register the calendar with a date-fns date adapter.
|
|
316
351
|
*/
|
|
317
352
|
function provideDbxCalendar() {
|
|
318
|
-
|
|
319
|
-
return providers;
|
|
353
|
+
return provideCalendar({ provide: DateAdapter, useFactory: adapterFactory });
|
|
320
354
|
}
|
|
321
355
|
|
|
322
356
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dereekb-dbx-web-calendar.mjs","sources":["../../../../packages/dbx-web/calendar/src/lib/calendar.store.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.base.component.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.base.component.html","../../../../packages/dbx-web/calendar/src/lib/calendar.component.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.component.html","../../../../packages/dbx-web/calendar/src/lib/calendar.provider.ts","../../../../packages/dbx-web/calendar/src/dereekb-dbx-web-calendar.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { clampDateToDateRange, type DateRange, dateRangeOverlapsDateRangeFunction, isDateInDateRange, isFullDateRange, isSameDateDay, isSameDateRange } from '@dereekb/date';\nimport { invertDecision, type Maybe, reduceBooleansWithAndFn } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type CalendarEvent } from 'angular-calendar';\nimport { differenceInDays, addDays, endOfDay, endOfMonth, endOfWeek, isSameDay, startOfDay, startOfMonth, startOfWeek, isBefore, isAfter } from 'date-fns';\nimport { type Observable, distinctUntilChanged, first, map, shareReplay, switchMap, tap, combineLatest } from 'rxjs';\n\nexport enum CalendarDisplayType {\n MONTH = 'month',\n WEEK = 'week',\n DAY = 'day'\n}\n\nexport interface CalendarViewDateRange {\n readonly type: CalendarDisplayType;\n readonly start: Date;\n readonly end: Date;\n readonly distance: number;\n /**\n * Whether or not the min navigation date is currently visible. This implies that we're at the minimum date.\n */\n readonly isMinDateVisible: boolean;\n /**\n * Whether or not the maximum navigation date is visible. This implies that we're at the maximum date.\n */\n readonly isMaxDateVisible: boolean;\n}\n\nexport function isCalendarViewDateRangeEqual(a: CalendarViewDateRange, b: CalendarViewDateRange): boolean {\n return a.type === b.type && isSameDay(a.start, b.start) && isSameDay(a.end, b.end) && a.distance === b.distance && a.isMinDateVisible === b.isMinDateVisible && a.isMaxDateVisible === b.isMaxDateVisible;\n}\n\nexport interface CalendarState<T = any> {\n /**\n * Calendar display mode\n */\n readonly type: CalendarDisplayType;\n /**\n * Whether or not to show the today button. Defaults to true.\n */\n readonly showTodayButton?: boolean;\n /**\n * Date that is selected.\n */\n readonly date: Date;\n /**\n * Whether or not the day was tapped/set twice.\n */\n readonly dateTappedTwice: boolean;\n /**\n * Set of calendar events.\n */\n readonly events: CalendarEvent<T>[];\n /**\n * Optional navigation range limitation that limits which dates can be navigated to.\n */\n readonly navigationRangeLimit?: Maybe<Partial<DateRange>>;\n /**\n * Whether or not to display the page buttons when applicable. Can only be displayed when a navigationRangeLimit is set.\n */\n readonly showPageButtons?: boolean;\n}\n\nexport function visibleDateRangeForCalendarState(calendarState: CalendarState): CalendarViewDateRange {\n const { navigationRangeLimit, type, date } = calendarState;\n\n let start: Date;\n let end: Date;\n let distance: number;\n\n switch (type) {\n case CalendarDisplayType.MONTH:\n start = startOfDay(startOfWeek(startOfMonth(date), { weekStartsOn: 0 }));\n end = endOfWeek(endOfMonth(date));\n distance = differenceInDays(end, start) + 1;\n break;\n case CalendarDisplayType.WEEK:\n start = startOfWeek(date);\n end = endOfWeek(start);\n distance = 7; // 7 days in a week.\n break;\n case CalendarDisplayType.DAY:\n start = startOfDay(date);\n end = endOfDay(date);\n distance = 1;\n break;\n }\n\n const isMinDateVisible: boolean = navigationRangeLimit?.start != null ? !isAfter(start, navigationRangeLimit.start) : false;\n const isMaxDateVisible: boolean = navigationRangeLimit?.end != null ? !isBefore(end, navigationRangeLimit.end) : false;\n\n // TODO: Consider changing min/max date visible logical utility to be fully within the current month or not,\n // not just visible, since it can change to a locked out calendar and doesn't feel as UI friendly.\n\n const result = {\n type,\n start,\n end,\n distance,\n isMinDateVisible,\n isMaxDateVisible\n };\n\n return result;\n}\n\nconst distinctUntilDateOrTypeOrEventsChanged = distinctUntilChanged<CalendarState>((a, b) => a?.date === b?.date && a?.type === b?.type && a?.events === b?.events);\n\n@Injectable()\nexport class DbxCalendarStore<T = any> extends ComponentStore<CalendarState<T>> {\n constructor() {\n super({\n type: CalendarDisplayType.MONTH,\n showTodayButton: true,\n date: new Date(),\n dateTappedTwice: false,\n events: []\n });\n }\n\n // MARK: Effects\n readonly tapFirstPage = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.minNavigationDate$.pipe(\n first(),\n tap((x) => {\n if (x) {\n this.tapDay(x);\n }\n })\n )\n )\n );\n });\n\n readonly tapNext = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.visibleDateRange$.pipe(\n first(),\n tap(({ end, isMaxDateVisible }) => {\n if (!isMaxDateVisible) {\n this.tapDay(addDays(end, 1));\n }\n })\n )\n )\n );\n });\n\n readonly tapPrevious = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.visibleDateRange$.pipe(\n first(),\n tap(({ start, isMinDateVisible }) => {\n if (!isMinDateVisible) {\n this.tapDay(addDays(start, -1));\n }\n })\n )\n )\n );\n });\n\n readonly tapLastPage = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.maxNavigationDate$.pipe(\n first(),\n tap((x) => {\n if (x) {\n this.tapDay(x);\n }\n })\n )\n )\n );\n });\n\n // MARK: Accessors\n\n readonly showTodayButton$ = this.state$.pipe(\n map((x) => x.showTodayButton),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly date$ = this.state$.pipe(map((x) => x.date));\n readonly dateTappedTwice$ = this.state$.pipe(map((x) => x.dateTappedTwice));\n\n readonly events$ = this.state$.pipe(\n map((x) => x.events),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Returns the events that match the tapped date range state.\n */\n readonly eventsForDateState$ = this.state$.pipe(\n distinctUntilDateOrTypeOrEventsChanged,\n map((state) => ({\n date: state.date,\n events: state.events.filter((x) => isSameDay(x.start, state.date) || (x.end && isBefore(x.start, state.date) && isAfter(x.end, state.date))),\n dateTappedTwice: state.dateTappedTwice\n })),\n shareReplay(1)\n );\n\n readonly eventsForDate$ = this.eventsForDateState$.pipe(map((state) => state.events));\n\n readonly visibleDateRange$: Observable<CalendarViewDateRange> = this.state$.pipe(map(visibleDateRangeForCalendarState), distinctUntilChanged(isCalendarViewDateRangeEqual), shareReplay(1));\n\n readonly visibleEvents$ = combineLatest([this.events$, this.visibleDateRange$]).pipe(\n map(([events, dateRange]) => {\n const isEventInDateRange = dateRangeOverlapsDateRangeFunction(dateRange);\n return events.filter((x) => isEventInDateRange(x));\n }),\n shareReplay(1)\n );\n\n readonly isLookingAtToday$ = this.visibleDateRange$.pipe(\n map((x) => isDateInDateRange(new Date(), x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isLookingAtMinimumDate$ = this.visibleDateRange$.pipe(\n map((x) => x.isMinDateVisible),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isLookingAtMaximumDate$ = this.visibleDateRange$.pipe(\n map((x) => x.isMaxDateVisible),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly hasMultiplePages$ = combineLatest([this.isLookingAtMinimumDate$, this.isLookingAtMaximumDate$]).pipe(map(invertDecision(reduceBooleansWithAndFn(true))), distinctUntilChanged(), shareReplay(1));\n\n readonly displayType$ = this.state$.pipe(\n map((x) => x.type),\n distinctUntilChanged((a, b) => a === b),\n shareReplay(1)\n );\n\n readonly navigationRangeLimit$ = this.state$.pipe(\n map((x) => x.navigationRangeLimit),\n distinctUntilChanged(isSameDateRange),\n shareReplay(1)\n );\n\n readonly minNavigationDate$: Observable<Maybe<Date>> = this.navigationRangeLimit$.pipe(\n map((x) => x?.start),\n distinctUntilChanged(isSameDateDay),\n shareReplay(1)\n );\n\n readonly maxNavigationDate$: Observable<Maybe<Date>> = this.navigationRangeLimit$.pipe(\n map((x) => x?.end),\n distinctUntilChanged(isSameDateDay),\n shareReplay(1)\n );\n\n readonly isTodayInNavigationRangeLimit$ = this.navigationRangeLimit$.pipe(\n map((x) => isDateInDateRange(new Date(), x ?? {})),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly canJumpToToday$ = combineLatest([this.isLookingAtToday$, this.isTodayInNavigationRangeLimit$]).pipe(\n map(([isLookingAtToday, isTodayInNavigationRangeLimit]) => !isLookingAtToday && isTodayInNavigationRangeLimit),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly canShowPageButtons$ = this.state$.pipe(\n map((x) => x.showPageButtons && x.navigationRangeLimit && isFullDateRange(x.navigationRangeLimit)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly showPageButtons$ = combineLatest([this.canShowPageButtons$, this.isLookingAtMinimumDate$, this.isLookingAtMaximumDate$]).pipe(\n map(([canShowPageButtons, isLookingAtMinimumDate, isLookingAtMaximumDate]) => {\n return canShowPageButtons && !(isLookingAtMinimumDate && isLookingAtMaximumDate);\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Tap a day.\n *\n * - If the same day is presented, dateTappedTwice is flipped.\n */\n readonly tapDay = this.updater((state, date: Date) => updateCalendarStateWithTappedDate(state, date));\n\n /**\n * Set all events on the calendar.\n */\n readonly setEvents = this.updater((state, events: CalendarEvent<T>[]) => ({ ...state, events }));\n\n /**\n * Set all events on the calendar.\n */\n readonly setDisplayType = this.updater((state, type: CalendarDisplayType) => ({ ...state, type }));\n\n /**\n * Sets the navigation limit.\n */\n readonly setNavigationRangeLimit = this.updater((state, navigationRangeLimit: Maybe<Partial<DateRange>>) => updateCalendarStateWithNavigationRangeLimit(state, navigationRangeLimit));\n\n readonly setShowTodayButton = this.updater((state, showTodayButton: Maybe<boolean>) => ({ ...state, showTodayButton: showTodayButton != null ? showTodayButton : true }));\n readonly setShowPageButtons = this.updater((state, showPageButtons: Maybe<boolean>) => ({ ...state, showPageButtons: showPageButtons != null ? showPageButtons : false }));\n}\n\nexport function updateCalendarStateWithTappedDate(state: CalendarState, date: Date) {\n // only update the date if it is different\n if (!isSameDateDay(state.date, date)) {\n // Only update the date if it is within the date range\n if (!state.navigationRangeLimit || isDateInDateRange(date, state.navigationRangeLimit)) {\n state = { ...state, date, dateTappedTwice: isSameDay(date, state.date) ? !state.dateTappedTwice : false };\n }\n }\n\n return state;\n}\n\nexport function updateCalendarStateWithNavigationRangeLimit(state: CalendarState, navigationRangeLimit: Maybe<Partial<DateRange>>) {\n const { date } = state;\n\n // cap the date if it doesn't fall within the range.\n if (navigationRangeLimit && !isDateInDateRange(date, navigationRangeLimit)) {\n const clampedDate = clampDateToDateRange(date, navigationRangeLimit);\n return { ...state, date: clampedDate, navigationRangeLimit };\n } else {\n return { ...state, navigationRangeLimit };\n }\n}\n","import { formatToTimeAndDurationString, sortDateRangeStartAscendingCompareFunction } from '@dereekb/date';\nimport { type CalendarEvent } from 'angular-calendar';\n\nexport interface DbxCalendarEvent<T> {\n event: CalendarEvent<T>;\n action?: string;\n}\n\nfunction timeSubtitleForEvent(event: CalendarEvent): string {\n let subtitle;\n\n if (event.allDay) {\n subtitle = `(All Day)`;\n } else {\n subtitle = formatToTimeAndDurationString(event.start, event.end ?? new Date());\n }\n\n return subtitle;\n}\n\nexport function prepareAndSortCalendarEvents(events: CalendarEvent[]): CalendarEvent[] {\n return events\n .map((event: CalendarEvent) => {\n const subtitle = timeSubtitleForEvent(event);\n let title;\n\n if (event.allDay) {\n title = event.title + ' ' + subtitle;\n } else {\n title = `${event.title} - ${subtitle}`;\n }\n\n return {\n ...event,\n title\n };\n })\n .sort(sortDateRangeStartAscendingCompareFunction);\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { DbxCalendarStore } from './calendar.store';\nimport { map, withLatestFrom } from 'rxjs';\nimport { type MatButtonToggleChange, MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { FlexLayoutModule } from '@ngbracket/ngx-layout';\nimport { MatButtonModule } from '@angular/material/button';\nimport { DbxButtonSpacerDirective } from '@dereekb/dbx-web';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CalendarModule } from 'angular-calendar';\n\n@Component({\n selector: 'dbx-calendar-base',\n standalone: true,\n imports: [MatButtonModule, MatButtonToggleModule, DbxButtonSpacerDirective, MatIconModule, CalendarModule, FlexLayoutModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './calendar.base.component.html'\n})\nexport class DbxCalendarBaseComponent<T> {\n readonly calendarStore = inject(DbxCalendarStore<T>);\n\n readonly viewDate$ = this.calendarStore.date$;\n\n readonly showTodayButton$ = this.calendarStore.showTodayButton$;\n readonly canJumpToToday$ = this.calendarStore.canJumpToToday$;\n\n readonly isLookingAtMinimumDate$ = this.calendarStore.isLookingAtMinimumDate$;\n readonly isLookingAtMaximumDate$ = this.calendarStore.isLookingAtMaximumDate$;\n readonly hasMultiplePages$ = this.calendarStore.hasMultiplePages$;\n\n readonly showPageButtons$ = this.calendarStore.showPageButtons$;\n\n readonly activeDayIsOpen$ = this.calendarStore.eventsForDateState$.pipe(\n withLatestFrom(this.calendarStore.date$),\n map(([x, date]) => {\n if (x.events.length && isSameMonth(x.date, date)) {\n return !x.dateTappedTwice;\n }\n\n return false;\n })\n );\n\n readonly displayType$ = this.calendarStore.displayType$;\n\n readonly viewDateSignal = toSignal(this.viewDate$, { initialValue: new Date() });\n readonly showTodayButtonSignal = toSignal(this.showTodayButton$);\n readonly canJumpToTodaySignal = toSignal(this.canJumpToToday$);\n readonly isLookingAtMinimumDateSignal = toSignal(this.isLookingAtMinimumDate$, { initialValue: false });\n readonly isLookingAtMaximumDateSignal = toSignal(this.isLookingAtMaximumDate$, { initialValue: false });\n readonly hasMultiplePagesSignal = toSignal(this.hasMultiplePages$, { initialValue: false });\n readonly showPageButtonsSignal = toSignal(this.showPageButtons$);\n readonly activeDayIsOpenSignal = toSignal(this.activeDayIsOpen$);\n readonly displayTypeSignal = toSignal(this.displayType$);\n\n todayClicked(): void {\n this.calendarStore.tapDay(new Date());\n }\n\n firstPageButtonClicked(): void {\n this.calendarStore.tapFirstPage();\n }\n\n nextButtonClicked(): void {\n this.calendarStore.tapNext();\n }\n\n previousButtonClicked(): void {\n this.calendarStore.tapPrevious();\n }\n\n lastPageButtonClicked(): void {\n this.calendarStore.tapLastPage();\n }\n\n typeToggleChanged(event: MatButtonToggleChange): void {\n this.calendarStore.setDisplayType(event.value);\n }\n}\n","<div class=\"dbx-calendar\">\n <h3 class=\"dbx-calendar-title\">{{ viewDateSignal() | calendarDate: displayTypeSignal() + 'ViewTitle' : 'en' }}</h3>\n <div class=\"dbx-calendar-header\">\n <div class=\"dbx-calendar-controls\" fxLayout=\"row\" fxLayout.xs=\"column\" ngClass.xs=\"dbx-calendar-controls-compact\">\n <span class=\"dbx-calendar-controls-left dbx-flex-bar\" fxFlex=\"nogrow\">\n @if (showTodayButtonSignal()) {\n <button mat-stroked-button [disabled]=\"!canJumpToTodaySignal()\" (click)=\"todayClicked()\">Today</button>\n }\n <dbx-button-spacer></dbx-button-spacer>\n @if (hasMultiplePagesSignal()) {\n <div class=\"d-iblock\">\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" aria-label=\"first page button\" (click)=\"firstPageButtonClicked()\">\n <mat-icon>first_page</mat-icon>\n </button>\n }\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" [attr.aria-label]=\"'Previous ' + displayTypeSignal() + ' button'\" (click)=\"previousButtonClicked()\">\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" [attr.aria-label]=\"'Next ' + displayTypeSignal() + ' button'\" (click)=\"nextButtonClicked()\">\n <mat-icon>navigate_next</mat-icon>\n </button>\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" aria-label=\"last page button\" (click)=\"lastPageButtonClicked()\">\n <mat-icon>last_page</mat-icon>\n </button>\n }\n </div>\n }\n </span>\n <span class=\"spacer\"></span>\n <span class=\"dbx-calendar-controls-right\" fxFlex=\"nogrow\">\n <ng-content select=\"[controls]\"></ng-content>\n </span>\n </div>\n </div>\n <ng-content></ng-content>\n</div>\n","import { Component, inject, output, ChangeDetectionStrategy, computed } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { type CalendarEvent, CalendarModule, CalendarDayModule, CalendarWeekModule } from 'angular-calendar';\nimport { DbxCalendarStore } from './calendar.store';\nimport { distinctUntilChanged, map, shareReplay, withLatestFrom } from 'rxjs';\nimport { type MatButtonToggleChange, MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { type DbxCalendarEvent, prepareAndSortCalendarEvents } from './calendar';\nimport { DbxCalendarBaseComponent } from './calendar.base.component';\nimport { NgClass } from '@angular/common';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\n@Component({\n selector: 'dbx-calendar',\n templateUrl: './calendar.component.html',\n imports: [DbxCalendarBaseComponent, CalendarModule, CalendarDayModule, CalendarWeekModule, MatButtonToggleModule, NgClass],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxCalendarComponent<T> {\n readonly calendarStore = inject(DbxCalendarStore<T>);\n\n readonly clickEvent = output<DbxCalendarEvent<T>>();\n\n readonly viewDate$ = this.calendarStore.date$;\n\n readonly events$ = this.calendarStore.visibleEvents$.pipe(map(prepareAndSortCalendarEvents), shareReplay(1));\n\n readonly activeDayIsOpen$ = this.calendarStore.eventsForDateState$.pipe(\n withLatestFrom(this.calendarStore.date$),\n map(([x, date]) => {\n if (x.events.length && isSameMonth(x.date, date)) {\n return !x.dateTappedTwice;\n }\n\n return false;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly displayType$ = this.calendarStore.displayType$;\n\n readonly viewDateSignal = toSignal(this.viewDate$, { initialValue: new Date() });\n readonly eventsSignal = toSignal(this.events$, { initialValue: [] });\n readonly activeDayIsOpenSignal = toSignal(this.activeDayIsOpen$, { initialValue: true });\n readonly displayTypeSignal = toSignal(this.displayType$);\n readonly displayTypeClassSignal = computed(() => `dbx-calendar-content-${this.displayTypeSignal()}`);\n\n todayClicked(): void {\n this.dayClicked({ date: new Date() });\n }\n\n nextButtonClicked(): void {\n this.calendarStore.tapNext();\n }\n\n previousButtonClicked(): void {\n this.calendarStore.tapPrevious();\n }\n\n dayClicked({ date }: { date: Date }): void {\n this.calendarStore.tapDay(date);\n }\n\n eventClicked(action: string, event: CalendarEvent<T>): void {\n this.clickEvent.emit({ action, event });\n }\n\n typeToggleChanged(event: MatButtonToggleChange): void {\n this.calendarStore.setDisplayType(event.value);\n }\n}\n","<dbx-calendar-base>\n <ng-container controls>\n <mat-button-toggle-group name=\"calendarDisplayStyle\" [value]=\"displayTypeSignal()\" (change)=\"typeToggleChanged($event)\" aria-label=\"Display Style\">\n <mat-button-toggle value=\"month\">Month</mat-button-toggle>\n <mat-button-toggle value=\"week\">Week</mat-button-toggle>\n <mat-button-toggle value=\"day\">Day</mat-button-toggle>\n </mat-button-toggle-group>\n </ng-container>\n <div class=\"dbx-calendar-content\" [ngClass]=\"displayTypeClassSignal()\">\n @switch (displayTypeSignal()) {\n @case ('month') {\n <mwl-calendar-month-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" [activeDayIsOpen]=\"activeDayIsOpenSignal()\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-month-view>\n }\n @case ('week') {\n <mwl-calendar-week-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-week-view>\n }\n @case ('day') {\n <mwl-calendar-day-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-day-view>\n }\n }\n </div>\n</dbx-calendar-base>\n","import { type EnvironmentProviders, importProvidersFrom } from '@angular/core';\nimport { CalendarModule, DateAdapter } from 'angular-calendar';\nimport { adapterFactory as dateAdapterFactory } from 'angular-calendar/date-adapters/date-fns';\n\n/**\n * Provides default configuration for the DbxCalendarModule\n */\nexport function provideDbxCalendar() {\n const providers: EnvironmentProviders = importProvidersFrom(CalendarModule.forRoot({ provide: DateAdapter, useFactory: dateAdapterFactory }));\n\n return providers;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i5","i1","dateAdapterFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;IAQY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,mBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACb,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,GAAA,EAAA,CAAA,CAAA;AAqBzB,SAAU,4BAA4B,CAAC,CAAwB,EAAE,CAAwB,EAAA;IAC7F,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,SA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EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAI9G,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,WAEf,CAAC,wBAAwB,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAA,eAAA,EACzG,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,gzCAAA,EAAA;;;AEZlB;;AAEG;SACa,kBAAkB,GAAA;AAChC,IAAA,MAAM,SAAS,GAAyB,mBAAmB,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAEC,cAAkB,EAAE,CAAC,CAAC;AAE7I,IAAA,OAAO,SAAS;AAClB;;ACXA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"dereekb-dbx-web-calendar.mjs","sources":["../../../../packages/dbx-web/calendar/src/lib/calendar.store.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.base.component.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.base.component.html","../../../../packages/dbx-web/calendar/src/lib/calendar.component.ts","../../../../packages/dbx-web/calendar/src/lib/calendar.component.html","../../../../packages/dbx-web/calendar/src/lib/calendar.provider.ts","../../../../packages/dbx-web/calendar/src/dereekb-dbx-web-calendar.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { clampDateToDateRange, type DateRange, dateRangeOverlapsDateRangeFunction, isDateInDateRange, isFullDateRange, isSameDateDay, isSameDateRange } from '@dereekb/date';\nimport { invertDecision, type Maybe, reduceBooleansWithAndFn } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type CalendarEvent } from 'angular-calendar';\nimport { differenceInDays, addDays, endOfDay, endOfMonth, endOfWeek, isSameDay, startOfDay, startOfMonth, startOfWeek, isBefore, isAfter } from 'date-fns';\nimport { type Observable, distinctUntilChanged, first, map, shareReplay, switchMap, tap, combineLatest } from 'rxjs';\n\nexport enum CalendarDisplayType {\n MONTH = 'month',\n WEEK = 'week',\n DAY = 'day'\n}\n\nexport interface CalendarViewDateRange {\n readonly type: CalendarDisplayType;\n readonly start: Date;\n readonly end: Date;\n readonly distance: number;\n /**\n * Whether or not the min navigation date is currently visible. This implies that we're at the minimum date.\n */\n readonly isMinDateVisible: boolean;\n /**\n * Whether or not the maximum navigation date is visible. This implies that we're at the maximum date.\n */\n readonly isMaxDateVisible: boolean;\n}\n\n/**\n * Compares two {@link CalendarViewDateRange} values for equality by checking type, start/end dates, distance, and min/max visibility flags.\n *\n * @param a - First calendar view date range to compare.\n * @param b - Second calendar view date range to compare.\n * @returns Whether the two date ranges are considered equal.\n */\nexport function isCalendarViewDateRangeEqual(a: CalendarViewDateRange, b: CalendarViewDateRange): boolean {\n return a.type === b.type && isSameDay(a.start, b.start) && isSameDay(a.end, b.end) && a.distance === b.distance && a.isMinDateVisible === b.isMinDateVisible && a.isMaxDateVisible === b.isMaxDateVisible;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface CalendarState<T = any> {\n /**\n * Calendar display mode\n */\n readonly type: CalendarDisplayType;\n /**\n * Whether or not to show the today button. Defaults to true.\n */\n readonly showTodayButton?: boolean;\n /**\n * Date that is selected.\n */\n readonly date: Date;\n /**\n * Whether or not the day was tapped/set twice.\n */\n readonly dateTappedTwice: boolean;\n /**\n * Set of calendar events.\n */\n readonly events: CalendarEvent<T>[];\n /**\n * Optional navigation range limitation that limits which dates can be navigated to.\n */\n readonly navigationRangeLimit?: Maybe<Partial<DateRange>>;\n /**\n * Whether or not to display the page buttons when applicable. Can only be displayed when a navigationRangeLimit is set.\n */\n readonly showPageButtons?: boolean;\n}\n\n/**\n * Computes the visible date range for the given calendar state based on display type (month, week, or day)\n * and the optional navigation range limit.\n *\n * @param calendarState - The current calendar state containing display type, date, and navigation limits.\n * @returns The computed visible date range including start, end, distance, and min/max visibility flags.\n */\nexport function visibleDateRangeForCalendarState(calendarState: CalendarState): CalendarViewDateRange {\n const { navigationRangeLimit, type, date } = calendarState;\n\n let start: Date;\n let end: Date;\n let distance: number;\n\n switch (type) {\n case CalendarDisplayType.MONTH:\n start = startOfDay(startOfWeek(startOfMonth(date), { weekStartsOn: 0 }));\n end = endOfWeek(endOfMonth(date));\n distance = differenceInDays(end, start) + 1;\n break;\n case CalendarDisplayType.WEEK:\n start = startOfWeek(date);\n end = endOfWeek(start);\n distance = 7; // 7 days in a week.\n break;\n case CalendarDisplayType.DAY:\n start = startOfDay(date);\n end = endOfDay(date);\n distance = 1;\n break;\n }\n\n const isMinDateVisible: boolean = navigationRangeLimit?.start != null ? !isAfter(start, navigationRangeLimit.start) : false;\n const isMaxDateVisible: boolean = navigationRangeLimit?.end != null ? !isBefore(end, navigationRangeLimit.end) : false;\n\n // TODO: Consider changing min/max date visible logical utility to be fully within the current month or not,\n // not just visible, since it can change to a locked out calendar and doesn't feel as UI friendly.\n\n return {\n type,\n start,\n end,\n distance,\n isMinDateVisible,\n isMaxDateVisible\n };\n}\n\nconst distinctUntilDateOrTypeOrEventsChanged = distinctUntilChanged<CalendarState>((a, b) => a?.date === b?.date && a?.type === b?.type && a?.events === b?.events);\n\n@Injectable()\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class DbxCalendarStore<T = any> extends ComponentStore<CalendarState<T>> {\n constructor() {\n super({\n type: CalendarDisplayType.MONTH,\n showTodayButton: true,\n date: new Date(),\n dateTappedTwice: false,\n events: []\n });\n }\n\n // MARK: Effects\n readonly tapFirstPage = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.minNavigationDate$.pipe(\n first(),\n tap((x) => {\n if (x) {\n this.tapDay(x);\n }\n })\n )\n )\n );\n });\n\n readonly tapNext = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.visibleDateRange$.pipe(\n first(),\n tap(({ end, isMaxDateVisible }) => {\n if (!isMaxDateVisible) {\n this.tapDay(addDays(end, 1));\n }\n })\n )\n )\n );\n });\n\n readonly tapPrevious = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.visibleDateRange$.pipe(\n first(),\n tap(({ start, isMinDateVisible }) => {\n if (!isMinDateVisible) {\n this.tapDay(addDays(start, -1));\n }\n })\n )\n )\n );\n });\n\n readonly tapLastPage = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.maxNavigationDate$.pipe(\n first(),\n tap((x) => {\n if (x) {\n this.tapDay(x);\n }\n })\n )\n )\n );\n });\n\n // MARK: Accessors\n\n readonly showTodayButton$ = this.state$.pipe(\n map((x) => x.showTodayButton),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly date$ = this.state$.pipe(map((x) => x.date));\n readonly dateTappedTwice$ = this.state$.pipe(map((x) => x.dateTappedTwice));\n\n readonly events$ = this.state$.pipe(\n map((x) => x.events),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Returns the events that match the tapped date range state.\n */\n readonly eventsForDateState$ = this.state$.pipe(\n distinctUntilDateOrTypeOrEventsChanged,\n map((state) => ({\n date: state.date,\n events: state.events.filter((x) => isSameDay(x.start, state.date) || (x.end && isBefore(x.start, state.date) && isAfter(x.end, state.date))),\n dateTappedTwice: state.dateTappedTwice\n })),\n shareReplay(1)\n );\n\n readonly eventsForDate$ = this.eventsForDateState$.pipe(map((state) => state.events));\n\n readonly visibleDateRange$: Observable<CalendarViewDateRange> = this.state$.pipe(map(visibleDateRangeForCalendarState), distinctUntilChanged(isCalendarViewDateRangeEqual), shareReplay(1));\n\n readonly visibleEvents$ = combineLatest([this.events$, this.visibleDateRange$]).pipe(\n map(([events, dateRange]) => {\n const isEventInDateRange = dateRangeOverlapsDateRangeFunction(dateRange);\n return events.filter((x) => isEventInDateRange(x));\n }),\n shareReplay(1)\n );\n\n readonly isLookingAtToday$ = this.visibleDateRange$.pipe(\n map((x) => isDateInDateRange(new Date(), x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isLookingAtMinimumDate$ = this.visibleDateRange$.pipe(\n map((x) => x.isMinDateVisible),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isLookingAtMaximumDate$ = this.visibleDateRange$.pipe(\n map((x) => x.isMaxDateVisible),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly hasMultiplePages$ = combineLatest([this.isLookingAtMinimumDate$, this.isLookingAtMaximumDate$]).pipe(map(invertDecision(reduceBooleansWithAndFn(true))), distinctUntilChanged(), shareReplay(1));\n\n readonly displayType$ = this.state$.pipe(\n map((x) => x.type),\n distinctUntilChanged((a, b) => a === b),\n shareReplay(1)\n );\n\n readonly navigationRangeLimit$ = this.state$.pipe(\n map((x) => x.navigationRangeLimit),\n distinctUntilChanged(isSameDateRange),\n shareReplay(1)\n );\n\n readonly minNavigationDate$: Observable<Maybe<Date>> = this.navigationRangeLimit$.pipe(\n map((x) => x?.start),\n distinctUntilChanged(isSameDateDay),\n shareReplay(1)\n );\n\n readonly maxNavigationDate$: Observable<Maybe<Date>> = this.navigationRangeLimit$.pipe(\n map((x) => x?.end),\n distinctUntilChanged(isSameDateDay),\n shareReplay(1)\n );\n\n readonly isTodayInNavigationRangeLimit$ = this.navigationRangeLimit$.pipe(\n map((x) => isDateInDateRange(new Date(), x ?? {})),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly canJumpToToday$ = combineLatest([this.isLookingAtToday$, this.isTodayInNavigationRangeLimit$]).pipe(\n map(([isLookingAtToday, isTodayInNavigationRangeLimit]) => !isLookingAtToday && isTodayInNavigationRangeLimit),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly canShowPageButtons$ = this.state$.pipe(\n map((x) => x.showPageButtons && x.navigationRangeLimit && isFullDateRange(x.navigationRangeLimit)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly showPageButtons$ = combineLatest([this.canShowPageButtons$, this.isLookingAtMinimumDate$, this.isLookingAtMaximumDate$]).pipe(\n map(([canShowPageButtons, isLookingAtMinimumDate, isLookingAtMaximumDate]) => {\n return canShowPageButtons && !(isLookingAtMinimumDate && isLookingAtMaximumDate);\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Tap a day.\n *\n * - If the same day is presented, dateTappedTwice is flipped.\n */\n readonly tapDay = this.updater((state, date: Date) => updateCalendarStateWithTappedDate(state, date));\n\n /**\n * Set all events on the calendar.\n */\n readonly setEvents = this.updater((state, events: CalendarEvent<T>[]) => ({ ...state, events }));\n\n /**\n * Set all events on the calendar.\n */\n readonly setDisplayType = this.updater((state, type: CalendarDisplayType) => ({ ...state, type }));\n\n /**\n * Sets the navigation limit.\n */\n readonly setNavigationRangeLimit = this.updater((state, navigationRangeLimit: Maybe<Partial<DateRange>>) => updateCalendarStateWithNavigationRangeLimit(state, navigationRangeLimit));\n\n readonly setShowTodayButton = this.updater((state, showTodayButton: Maybe<boolean>) => ({ ...state, showTodayButton: showTodayButton != null ? showTodayButton : true }));\n readonly setShowPageButtons = this.updater((state, showPageButtons: Maybe<boolean>) => ({ ...state, showPageButtons: showPageButtons != null ? showPageButtons : false }));\n}\n\n/**\n * Returns an updated calendar state after tapping a date. Only updates if the date differs from the current one\n * and falls within the navigation range limit. Toggles `dateTappedTwice` when the same day is tapped again.\n *\n * @param state - The current calendar state.\n * @param date - The date that was tapped.\n * @returns The updated calendar state reflecting the tapped date.\n */\nexport function updateCalendarStateWithTappedDate(state: CalendarState, date: Date) {\n // only update the date if it is different\n if (\n !isSameDateDay(state.date, date) && // Only update the date if it is within the date range\n (!state.navigationRangeLimit || isDateInDateRange(date, state.navigationRangeLimit))\n ) {\n state = { ...state, date, dateTappedTwice: isSameDay(date, state.date) ? !state.dateTappedTwice : false };\n }\n\n return state;\n}\n\n/**\n * Returns an updated calendar state with a new navigation range limit. If the current date falls outside\n * the new range, it is clamped to fit within the limit.\n *\n * @param state - The current calendar state.\n * @param navigationRangeLimit - The new navigation date range limit, or undefined/null to remove the limit.\n * @returns The updated calendar state with the applied navigation range limit.\n */\nexport function updateCalendarStateWithNavigationRangeLimit(state: CalendarState, navigationRangeLimit: Maybe<Partial<DateRange>>) {\n const { date } = state;\n\n // cap the date if it doesn't fall within the range.\n if (navigationRangeLimit && !isDateInDateRange(date, navigationRangeLimit)) {\n const clampedDate = clampDateToDateRange(date, navigationRangeLimit);\n return { ...state, date: clampedDate, navigationRangeLimit };\n } else {\n return { ...state, navigationRangeLimit };\n }\n}\n","import { formatToTimeAndDurationString, sortDateRangeStartAscendingCompareFunction } from '@dereekb/date';\nimport { type CalendarEvent } from 'angular-calendar';\n\nexport interface DbxCalendarEvent<T> {\n event: CalendarEvent<T>;\n action?: string;\n}\n\nfunction timeSubtitleForEvent(event: CalendarEvent): string {\n let subtitle;\n\n if (event.allDay) {\n subtitle = `(All Day)`;\n } else {\n subtitle = formatToTimeAndDurationString(event.start, event.end ?? new Date());\n }\n\n return subtitle;\n}\n\n/**\n * Appends time/duration subtitles to each calendar event's title and sorts the events by start date in ascending order.\n *\n * @param events - The calendar events to prepare and sort.\n * @returns A new array of calendar events with updated titles, sorted by start date.\n */\nexport function prepareAndSortCalendarEvents(events: CalendarEvent[]): CalendarEvent[] {\n return events\n .map((event: CalendarEvent) => {\n const subtitle = timeSubtitleForEvent(event);\n let title;\n\n if (event.allDay) {\n title = event.title + ' ' + subtitle;\n } else {\n title = `${event.title} - ${subtitle}`;\n }\n\n return {\n ...event,\n title\n };\n })\n .sort(sortDateRangeStartAscendingCompareFunction);\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { DbxCalendarStore } from './calendar.store';\nimport { map, withLatestFrom } from 'rxjs';\nimport { type MatButtonToggleChange, MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { FlexLayoutModule } from '@ngbracket/ngx-layout';\nimport { MatButtonModule } from '@angular/material/button';\nimport { DbxButtonSpacerDirective } from '@dereekb/dbx-web';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CalendarDatePipe } from 'angular-calendar';\n\n@Component({\n selector: 'dbx-calendar-base',\n standalone: true,\n imports: [MatButtonModule, MatButtonToggleModule, DbxButtonSpacerDirective, MatIconModule, CalendarDatePipe, FlexLayoutModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './calendar.base.component.html'\n})\nexport class DbxCalendarBaseComponent<T> {\n readonly calendarStore = inject(DbxCalendarStore<T>);\n\n readonly viewDate$ = this.calendarStore.date$;\n\n readonly showTodayButton$ = this.calendarStore.showTodayButton$;\n readonly canJumpToToday$ = this.calendarStore.canJumpToToday$;\n\n readonly isLookingAtMinimumDate$ = this.calendarStore.isLookingAtMinimumDate$;\n readonly isLookingAtMaximumDate$ = this.calendarStore.isLookingAtMaximumDate$;\n readonly hasMultiplePages$ = this.calendarStore.hasMultiplePages$;\n\n readonly showPageButtons$ = this.calendarStore.showPageButtons$;\n\n readonly activeDayIsOpen$ = this.calendarStore.eventsForDateState$.pipe(\n withLatestFrom(this.calendarStore.date$),\n map(([x, date]) => {\n if (x.events.length && isSameMonth(x.date, date)) {\n return !x.dateTappedTwice;\n }\n\n return false;\n })\n );\n\n readonly displayType$ = this.calendarStore.displayType$;\n\n readonly viewDateSignal = toSignal(this.viewDate$, { initialValue: new Date() });\n readonly showTodayButtonSignal = toSignal(this.showTodayButton$);\n readonly canJumpToTodaySignal = toSignal(this.canJumpToToday$);\n readonly isLookingAtMinimumDateSignal = toSignal(this.isLookingAtMinimumDate$, { initialValue: false });\n readonly isLookingAtMaximumDateSignal = toSignal(this.isLookingAtMaximumDate$, { initialValue: false });\n readonly hasMultiplePagesSignal = toSignal(this.hasMultiplePages$, { initialValue: false });\n readonly showPageButtonsSignal = toSignal(this.showPageButtons$);\n readonly activeDayIsOpenSignal = toSignal(this.activeDayIsOpen$);\n readonly displayTypeSignal = toSignal(this.displayType$);\n\n todayClicked(): void {\n this.calendarStore.tapDay(new Date());\n }\n\n firstPageButtonClicked(): void {\n this.calendarStore.tapFirstPage();\n }\n\n nextButtonClicked(): void {\n this.calendarStore.tapNext();\n }\n\n previousButtonClicked(): void {\n this.calendarStore.tapPrevious();\n }\n\n lastPageButtonClicked(): void {\n this.calendarStore.tapLastPage();\n }\n\n typeToggleChanged(event: MatButtonToggleChange): void {\n this.calendarStore.setDisplayType(event.value);\n }\n}\n","<div class=\"dbx-calendar\">\n <h3 class=\"dbx-calendar-title\">{{ viewDateSignal() | calendarDate: displayTypeSignal() + 'ViewTitle' : 'en' }}</h3>\n <div class=\"dbx-calendar-header\">\n <div class=\"dbx-calendar-controls\" fxLayout=\"row\" fxLayout.xs=\"column\" ngClass.xs=\"dbx-calendar-controls-compact\">\n <span class=\"dbx-calendar-controls-left dbx-flex-bar\" fxFlex=\"nogrow\">\n @if (showTodayButtonSignal()) {\n <button mat-stroked-button [disabled]=\"!canJumpToTodaySignal()\" (click)=\"todayClicked()\">Today</button>\n }\n <dbx-button-spacer></dbx-button-spacer>\n @if (hasMultiplePagesSignal()) {\n <div class=\"d-iblock\">\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" aria-label=\"first page button\" (click)=\"firstPageButtonClicked()\">\n <mat-icon>first_page</mat-icon>\n </button>\n }\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDateSignal()\" [attr.aria-label]=\"'Previous ' + displayTypeSignal() + ' button'\" (click)=\"previousButtonClicked()\">\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" [attr.aria-label]=\"'Next ' + displayTypeSignal() + ' button'\" (click)=\"nextButtonClicked()\">\n <mat-icon>navigate_next</mat-icon>\n </button>\n @if (showPageButtonsSignal()) {\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDateSignal()\" aria-label=\"last page button\" (click)=\"lastPageButtonClicked()\">\n <mat-icon>last_page</mat-icon>\n </button>\n }\n </div>\n }\n </span>\n <span class=\"spacer\"></span>\n <span class=\"dbx-calendar-controls-right\" fxFlex=\"nogrow\">\n <ng-content select=\"[controls]\"></ng-content>\n </span>\n </div>\n </div>\n <ng-content></ng-content>\n</div>\n","import { Component, inject, output, ChangeDetectionStrategy, computed } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { type CalendarEvent, CalendarMonthViewComponent, CalendarDayViewComponent, CalendarWeekViewComponent } from 'angular-calendar';\nimport { DbxCalendarStore } from './calendar.store';\nimport { distinctUntilChanged, map, shareReplay, withLatestFrom } from 'rxjs';\nimport { type MatButtonToggleChange, MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { type DbxCalendarEvent, prepareAndSortCalendarEvents } from './calendar';\nimport { DbxCalendarBaseComponent } from './calendar.base.component';\nimport { NgClass } from '@angular/common';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\n@Component({\n selector: 'dbx-calendar',\n templateUrl: './calendar.component.html',\n imports: [DbxCalendarBaseComponent, CalendarMonthViewComponent, CalendarDayViewComponent, CalendarWeekViewComponent, MatButtonToggleModule, NgClass],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxCalendarComponent<T> {\n readonly calendarStore = inject(DbxCalendarStore<T>);\n\n readonly clickEvent = output<DbxCalendarEvent<T>>();\n\n readonly viewDate$ = this.calendarStore.date$;\n\n readonly events$ = this.calendarStore.visibleEvents$.pipe(map(prepareAndSortCalendarEvents), shareReplay(1));\n\n readonly activeDayIsOpen$ = this.calendarStore.eventsForDateState$.pipe(\n withLatestFrom(this.calendarStore.date$),\n map(([x, date]) => {\n if (x.events.length && isSameMonth(x.date, date)) {\n return !x.dateTappedTwice;\n }\n\n return false;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly displayType$ = this.calendarStore.displayType$;\n\n readonly viewDateSignal = toSignal(this.viewDate$, { initialValue: new Date() });\n readonly eventsSignal = toSignal(this.events$, { initialValue: [] });\n readonly activeDayIsOpenSignal = toSignal(this.activeDayIsOpen$, { initialValue: true });\n readonly displayTypeSignal = toSignal(this.displayType$);\n readonly displayTypeClassSignal = computed(() => `dbx-calendar-content-${this.displayTypeSignal()}`);\n\n todayClicked(): void {\n this.dayClicked({ date: new Date() });\n }\n\n nextButtonClicked(): void {\n this.calendarStore.tapNext();\n }\n\n previousButtonClicked(): void {\n this.calendarStore.tapPrevious();\n }\n\n dayClicked({ date }: { date: Date }): void {\n this.calendarStore.tapDay(date);\n }\n\n eventClicked(action: string, event: CalendarEvent<T>): void {\n this.clickEvent.emit({ action, event });\n }\n\n typeToggleChanged(event: MatButtonToggleChange): void {\n this.calendarStore.setDisplayType(event.value);\n }\n}\n","<dbx-calendar-base>\n <ng-container controls>\n <mat-button-toggle-group name=\"calendarDisplayStyle\" [value]=\"displayTypeSignal()\" (change)=\"typeToggleChanged($event)\" aria-label=\"Display Style\">\n <mat-button-toggle value=\"month\">Month</mat-button-toggle>\n <mat-button-toggle value=\"week\">Week</mat-button-toggle>\n <mat-button-toggle value=\"day\">Day</mat-button-toggle>\n </mat-button-toggle-group>\n </ng-container>\n <div class=\"dbx-calendar-content\" [ngClass]=\"displayTypeClassSignal()\">\n @switch (displayTypeSignal()) {\n @case ('month') {\n <mwl-calendar-month-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" [activeDayIsOpen]=\"activeDayIsOpenSignal()\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-month-view>\n }\n @case ('week') {\n <mwl-calendar-week-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-week-view>\n }\n @case ('day') {\n <mwl-calendar-day-view [viewDate]=\"viewDateSignal()\" [events]=\"eventsSignal()\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-day-view>\n }\n }\n </div>\n</dbx-calendar-base>\n","import { type Provider } from '@angular/core';\nimport { DateAdapter, provideCalendar } from 'angular-calendar';\nimport { adapterFactory as dateAdapterFactory } from 'angular-calendar/date-adapters/date-fns';\n\n/**\n * Provides default configuration for the DbxCalendarModule\n *\n * @returns Providers that register the calendar with a date-fns date adapter.\n */\nexport function provideDbxCalendar(): Provider[] {\n return provideCalendar({ provide: DateAdapter, useFactory: dateAdapterFactory });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["dateAdapterFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAQY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,mBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACb,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,GAAA,EAAA,CAAA,CAAA;AAqB/B;;;;;;AAMG;AACG,SAAU,4BAA4B,CAAC,CAAwB,EAAE,CAAwB,EAAA;IAC7F,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,gBAAgB,KAAK,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,KAAK,CAAC,CAAC,gBAAgB;AAC3M;AAkCA;;;;;;AAMG;AACG,SAAU,gCAAgC,CAAC,aAA4B,EAAA;IAC3E,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,aAAa;AAE1D,IAAA,IAAI,KAAW;AACf,IAAA,IAAI,G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,GAAA;AAChC,IAAA,OAAO,eAAe,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAEA,cAAkB,EAAE,CAAC;AAClF;;ACXA;;AAEG;;;;"}
|
|
@@ -55,17 +55,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
55
55
|
type: Injectable
|
|
56
56
|
}] });
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Creates a function that calculates the geographic bounds of a Mapbox viewport given a center point and zoom level.
|
|
60
|
+
*
|
|
61
|
+
* @param config - Configuration specifying the map canvas size and optional tile size.
|
|
62
|
+
* @returns A function that accepts a center point and zoom level and returns the corresponding {@link LatLngBound}.
|
|
63
|
+
*/
|
|
58
64
|
function mapboxViewportBoundFunction(config) {
|
|
59
65
|
const { mapCanvasSize, tileSize = 512 } = config;
|
|
60
66
|
const dimensions = [mapCanvasSize.x, mapCanvasSize.y];
|
|
61
67
|
return ({ center, zoom }) => {
|
|
62
68
|
const boundingBox = bounds([center.lng, center.lat], zoom, dimensions, tileSize);
|
|
63
69
|
const [swLng, swLat, neLng, neLat] = boundingBox;
|
|
64
|
-
|
|
70
|
+
return {
|
|
65
71
|
sw: { lat: swLat, lng: swLng },
|
|
66
72
|
ne: { lat: neLat, lng: neLng }
|
|
67
73
|
};
|
|
68
|
-
return result;
|
|
69
74
|
};
|
|
70
75
|
}
|
|
71
76
|
|
|
@@ -407,11 +412,10 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
407
412
|
calculateNextCenterWithOffset(inputOffset) {
|
|
408
413
|
const offset = this.latLngPoint(inputOffset);
|
|
409
414
|
return this.atNextIdle().pipe(switchMap(() => this.center$.pipe(first(), map((center) => {
|
|
410
|
-
|
|
415
|
+
return {
|
|
411
416
|
lat: offset.lat + center.lat,
|
|
412
417
|
lng: offset.lng + center.lng
|
|
413
418
|
};
|
|
414
|
-
return newCenter;
|
|
415
419
|
}))));
|
|
416
420
|
}
|
|
417
421
|
calculateNextCenterOffsetWithScreenMarginChange(sizing) {
|
|
@@ -465,7 +469,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
465
469
|
return combineLatest([this.moveState$.pipe(map((x) => x === 'idle')), this.lifecycleState$.pipe(map((x) => x === 'idle'))]).pipe(filter(([m, l]) => m && l), first(), map(() => true));
|
|
466
470
|
}
|
|
467
471
|
}), shareReplay(1));
|
|
468
|
-
whenInitialized$ = this.isInitialized$.pipe(filter((
|
|
472
|
+
whenInitialized$ = this.isInitialized$.pipe(filter(() => true), shareReplay(1));
|
|
469
473
|
isRendering$ = this.whenInitialized$.pipe(switchMap(() => this.lifecycleState$.pipe(map((x) => x === 'render'), distinctUntilChanged(), shareReplay(1))));
|
|
470
474
|
isMoving$ = this.whenInitialized$.pipe(switchMap(() => this.moveState$.pipe(map((x) => x === 'moving'), distinctUntilChanged(), shareReplay(1))));
|
|
471
475
|
isZooming$ = this.whenInitialized$.pipe(switchMap(() => this.zoomState$.pipe(map((x) => x === 'zooming'), distinctUntilChanged(), shareReplay(1))));
|
|
@@ -535,7 +539,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
535
539
|
})));
|
|
536
540
|
}));
|
|
537
541
|
}), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
|
|
538
|
-
margin$ = this.state$.pipe(map((x) => x.margin), distinctUntilChanged((a, b) => a != null &&
|
|
542
|
+
margin$ = this.state$.pipe(map((x) => x.margin), distinctUntilChanged((a, b) => a != null && a.fullWidth === b?.fullWidth && a.leftMargin === b.leftMargin && a.rightMargin === b.rightMargin), shareReplay(1));
|
|
539
543
|
reverseMargin$ = this.margin$.pipe(map((x) => {
|
|
540
544
|
if (x) {
|
|
541
545
|
return { leftMargin: -x.leftMargin, rightMargin: -x.rightMargin, fullWidth: x.fullWidth };
|
|
@@ -578,7 +582,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
578
582
|
obs = this.isRendering$.pipe(switchMap((x) => (x ? EMPTY : this.rawBoundNow$)));
|
|
579
583
|
break;
|
|
580
584
|
case 'only_after_render_finishes':
|
|
581
|
-
obs = this.isRendering$.pipe(onTrueToFalse(), switchMap((
|
|
585
|
+
obs = this.isRendering$.pipe(onTrueToFalse(), switchMap(() => this.rawBoundNow$.pipe(first())));
|
|
582
586
|
break;
|
|
583
587
|
}
|
|
584
588
|
return obs.pipe(throttleTime(throttleMs, undefined, { leading: true, trailing: true }));
|
|
@@ -686,7 +690,7 @@ class DbxMapboxInjectionStore extends ComponentStore {
|
|
|
686
690
|
});
|
|
687
691
|
}
|
|
688
692
|
map$ = this.state$.pipe(map((x) => x.map), distinctUntilMapHasDifferentKeys(), shareReplay(1));
|
|
689
|
-
allInjectionConfigs$ = this.map$.pipe(map((x) =>
|
|
693
|
+
allInjectionConfigs$ = this.map$.pipe(map((x) => [...x.values()]), shareReplay(1));
|
|
690
694
|
// MARK: State Changes
|
|
691
695
|
addInjectionConfig = this.updater(updateDbxMapboxMapInjectionStoreStateWithInjectionConfig);
|
|
692
696
|
removeInjectionConfigWithKey = this.updater(updateDbxMapboxMapInjectionStoreStateWithRemovedKey);
|
|
@@ -696,10 +700,24 @@ class DbxMapboxInjectionStore extends ComponentStore {
|
|
|
696
700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxMapboxInjectionStore, decorators: [{
|
|
697
701
|
type: Injectable
|
|
698
702
|
}], ctorParameters: () => [] });
|
|
703
|
+
/**
|
|
704
|
+
* Returns an updated store state with the given injection config added or replaced in the map, keyed by its unique key.
|
|
705
|
+
*
|
|
706
|
+
* @param state - The current mapbox injection store state.
|
|
707
|
+
* @param config - The injection configuration to add or update.
|
|
708
|
+
* @returns The updated store state containing the new or replaced config.
|
|
709
|
+
*/
|
|
699
710
|
function updateDbxMapboxMapInjectionStoreStateWithInjectionConfig(state, config) {
|
|
700
711
|
const map = new Map(state.map).set(config.key, config);
|
|
701
712
|
return { ...state, map };
|
|
702
713
|
}
|
|
714
|
+
/**
|
|
715
|
+
* Returns an updated store state with the injection config for the given key removed. If the key does not exist, returns the state unchanged.
|
|
716
|
+
*
|
|
717
|
+
* @param state - The current mapbox injection store state.
|
|
718
|
+
* @param key - The injection key to remove from the map.
|
|
719
|
+
* @returns The updated store state with the key removed, or the original state if the key was not present.
|
|
720
|
+
*/
|
|
703
721
|
function updateDbxMapboxMapInjectionStoreStateWithRemovedKey(state, key) {
|
|
704
722
|
// only create a new state if the key is going to get removed
|
|
705
723
|
if (state.map.has(key)) {
|
|
@@ -768,7 +786,7 @@ function provideMapboxInjectionStoreIfParentIsUnavailable() {
|
|
|
768
786
|
return {
|
|
769
787
|
provide: DbxMapboxInjectionStore,
|
|
770
788
|
useFactory: (parentInjector, dbxMapboxInjectionStoreInjectionBlock, dbxMapboxInjectionStore) => {
|
|
771
|
-
if (!dbxMapboxInjectionStore || (dbxMapboxInjectionStore && dbxMapboxInjectionStoreInjectionBlock
|
|
789
|
+
if (!dbxMapboxInjectionStore || (dbxMapboxInjectionStore && dbxMapboxInjectionStoreInjectionBlock?.dbxMapboxInjectionStore === dbxMapboxInjectionStore)) {
|
|
772
790
|
// create a new dbxMapboxInjectionStore to use
|
|
773
791
|
const injector = Injector.create({ providers: [{ provide: DbxMapboxInjectionStore }], parent: parentInjector });
|
|
774
792
|
dbxMapboxInjectionStore = injector.get(DbxMapboxInjectionStore);
|
|
@@ -993,6 +1011,8 @@ class DbxMapboxMenuComponent {
|
|
|
993
1011
|
case false:
|
|
994
1012
|
this.matMenuTrigger.closeMenu();
|
|
995
1013
|
break;
|
|
1014
|
+
default:
|
|
1015
|
+
break;
|
|
996
1016
|
}
|
|
997
1017
|
}, ...(ngDevMode ? [{ debugName: "_openCloseEffect" }] : []));
|
|
998
1018
|
active$ = toObservable(this.active);
|
|
@@ -1089,7 +1109,7 @@ function provideMapboxStoreIfParentIsUnavailable() {
|
|
|
1089
1109
|
return {
|
|
1090
1110
|
provide: DbxMapboxMapStore,
|
|
1091
1111
|
useFactory: (parentInjector, dbxMapboxMapStoreInjectionBlock, dbxMapboxMapStore) => {
|
|
1092
|
-
if (!dbxMapboxMapStore || (dbxMapboxMapStore && dbxMapboxMapStoreInjectionBlock
|
|
1112
|
+
if (!dbxMapboxMapStore || (dbxMapboxMapStore && dbxMapboxMapStoreInjectionBlock?.dbxMapboxMapStore === dbxMapboxMapStore)) {
|
|
1093
1113
|
// create a new dbxMapboxMapStore to use
|
|
1094
1114
|
const injector = Injector.create({ providers: [{ provide: DbxMapboxMapStore }], parent: parentInjector });
|
|
1095
1115
|
dbxMapboxMapStore = injector.get(DbxMapboxMapStore);
|
|
@@ -1134,10 +1154,14 @@ class DbxMapboxMarkerComponent {
|
|
|
1134
1154
|
width = 24;
|
|
1135
1155
|
height = 32;
|
|
1136
1156
|
break;
|
|
1157
|
+
default:
|
|
1158
|
+
break;
|
|
1137
1159
|
}
|
|
1138
1160
|
break;
|
|
1139
1161
|
}
|
|
1140
1162
|
break;
|
|
1163
|
+
default:
|
|
1164
|
+
break;
|
|
1141
1165
|
}
|
|
1142
1166
|
if (!height) {
|
|
1143
1167
|
height = width;
|
|
@@ -1149,8 +1173,8 @@ class DbxMapboxMarkerComponent {
|
|
|
1149
1173
|
'background-image': image
|
|
1150
1174
|
};
|
|
1151
1175
|
if (width && height) {
|
|
1152
|
-
style
|
|
1153
|
-
style
|
|
1176
|
+
style['width'] = width + 'px';
|
|
1177
|
+
style['height'] = height + 'px';
|
|
1154
1178
|
style['font-size'] = width + 'px';
|
|
1155
1179
|
}
|
|
1156
1180
|
return style;
|
|
@@ -1168,6 +1192,8 @@ class DbxMapboxMarkerComponent {
|
|
|
1168
1192
|
cssClasses.push('dbx-chip-small');
|
|
1169
1193
|
}
|
|
1170
1194
|
break;
|
|
1195
|
+
default:
|
|
1196
|
+
break;
|
|
1171
1197
|
}
|
|
1172
1198
|
if (!marker?.icon) {
|
|
1173
1199
|
cssClasses.push('dbx-mapbox-marker-no-icon');
|
|
@@ -1400,6 +1426,12 @@ const KNOWN_MAPBOX_STYLES = [
|
|
|
1400
1426
|
];
|
|
1401
1427
|
const MAPBOX_MIN_ZOOM_LEVEL = 0;
|
|
1402
1428
|
const MAPBOX_MAX_ZOOM_LEVEL = 22;
|
|
1429
|
+
/**
|
|
1430
|
+
* Clamps a numeric value to the valid Mapbox zoom level range (0 to 22).
|
|
1431
|
+
*
|
|
1432
|
+
* @param input - The raw zoom level number to clamp.
|
|
1433
|
+
* @returns The zoom level clamped between {@link MAPBOX_MIN_ZOOM_LEVEL} and {@link MAPBOX_MAX_ZOOM_LEVEL}.
|
|
1434
|
+
*/
|
|
1403
1435
|
function mapboxZoomLevel(input) {
|
|
1404
1436
|
return Math.min(Math.max(input, MAPBOX_MIN_ZOOM_LEVEL), MAPBOX_MAX_ZOOM_LEVEL);
|
|
1405
1437
|
}
|