@dereekb/dbx-web 9.23.21 → 9.23.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/calendar/esm2020/lib/calendar.base.component.mjs +2 -2
  2. package/calendar/esm2020/lib/calendar.store.mjs +8 -3
  3. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs +9 -4
  4. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  5. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs +9 -4
  6. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  7. package/calendar/lib/calendar.store.d.ts +1 -0
  8. package/calendar/package.json +3 -3
  9. package/esm2020/calendar/lib/calendar.base.component.mjs +2 -2
  10. package/esm2020/calendar/lib/calendar.store.mjs +8 -3
  11. package/esm2020/mapbox/lib/mapbox.rxjs.mjs +1 -1
  12. package/esm2020/mapbox/lib/mapbox.store.mjs +10 -1
  13. package/fesm2015/dereekb-dbx-web-calendar.mjs +9 -4
  14. package/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  15. package/fesm2015/dereekb-dbx-web-mapbox.mjs +57 -53
  16. package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  17. package/fesm2020/dereekb-dbx-web-calendar.mjs +9 -4
  18. package/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  19. package/fesm2020/dereekb-dbx-web-mapbox.mjs +61 -53
  20. package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  21. package/mapbox/esm2020/lib/mapbox.rxjs.mjs +1 -1
  22. package/mapbox/esm2020/lib/mapbox.store.mjs +10 -1
  23. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +57 -53
  24. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  25. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +61 -53
  26. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  27. package/mapbox/lib/mapbox.rxjs.d.ts +2 -1
  28. package/mapbox/lib/mapbox.store.d.ts +3 -1
  29. package/mapbox/package.json +3 -3
  30. package/package.json +3 -3
  31. package/table/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Component, EventEmitter, Output, NgModule } from '@angular/core';
3
- import { startOfDay, endOfDay, startOfWeek, endOfWeek, startOfMonth, endOfMonth, differenceInDays, isBefore, isAfter, addDays, isSameDay, isSameMonth } from 'date-fns';
3
+ import { startOfDay, endOfDay, startOfWeek, endOfWeek, startOfMonth, endOfMonth, differenceInDays, isAfter, isBefore, addDays, isSameDay, isSameMonth } from 'date-fns';
4
4
  import { isDateInDateRange, isSameDateRange, isSameDateDay, isFullDateRange, clampDateToDateRange, formatToTimeAndDurationString, sortDateRangeStartAscendingCompareFunction } from '@dereekb/date';
5
5
  import { invertDecision, reduceBooleansWithAndFn } from '@dereekb/util';
6
6
  import { ComponentStore } from '@ngrx/component-store';
@@ -50,8 +50,10 @@ function visibleDateRangeForCalendarState(calendarState) {
50
50
  distance = 1;
51
51
  break;
52
52
  }
53
- const isMinDateVisible = navigationRangeLimit?.start != null ? isBefore(start, navigationRangeLimit.start) : false;
54
- const isMaxDateVisible = navigationRangeLimit?.end != null ? isAfter(end, navigationRangeLimit.end) : false;
53
+ const isMinDateVisible = navigationRangeLimit?.start != null ? !isAfter(start, navigationRangeLimit.start) : false;
54
+ const isMaxDateVisible = navigationRangeLimit?.end != null ? !isBefore(end, navigationRangeLimit.end) : false;
55
+ // TODO: Consider changing min/max date visible logical utility to be fully within the current month or not,
56
+ // not just visible, since it can change to a locked out calendar and doesn't feel as UI friendly.
55
57
  return {
56
58
  type,
57
59
  start,
@@ -134,6 +136,9 @@ class DbxCalendarStore extends ComponentStore {
134
136
  this.isTodayInNavigationRangeLimit$ = this.navigationRangeLimit$.pipe(map((x) => isDateInDateRange(new Date(), x ?? {})), distinctUntilChanged(), shareReplay(1));
135
137
  this.canJumpToToday$ = combineLatest([this.isLookingAtToday$, this.isTodayInNavigationRangeLimit$]).pipe(map(([isLookingAtToday, isTodayInNavigationRangeLimit]) => !isLookingAtToday && isTodayInNavigationRangeLimit), distinctUntilChanged(), shareReplay(1));
136
138
  this.canShowPageButtons$ = this.state$.pipe(map((x) => x.showPageButtons && x.navigationRangeLimit && isFullDateRange(x.navigationRangeLimit)), distinctUntilChanged(), shareReplay(1));
139
+ this.showPageButtons$ = combineLatest([this.canShowPageButtons$, this.isLookingAtMinimumDate$, this.isLookingAtMaximumDate$]).pipe(map(([canShowPageButtons, isLookingAtMinimumDate, isLookingAtMaximumDate]) => {
140
+ return canShowPageButtons && !(isLookingAtMinimumDate && isLookingAtMaximumDate);
141
+ }), distinctUntilChanged(), shareReplay(1));
137
142
  // MARK: State Changes
138
143
  /**
139
144
  * Tap a day.
@@ -222,7 +227,7 @@ class DbxCalendarBaseComponent {
222
227
  this.isLookingAtMinimumDate$ = this.calendarStore.isLookingAtMinimumDate$;
223
228
  this.isLookingAtMaximumDate$ = this.calendarStore.isLookingAtMaximumDate$;
224
229
  this.hasMultiplePages$ = this.calendarStore.hasMultiplePages$;
225
- this.showPageButtons$ = this.calendarStore.canShowPageButtons$;
230
+ this.showPageButtons$ = this.calendarStore.showPageButtons$;
226
231
  this.activeDayIsOpen$ = this.calendarStore.eventsForDateState$.pipe(withLatestFrom(this.calendarStore.date$), map(([x, date]) => {
227
232
  if (x.events.length && isSameMonth(x.date, date)) {
228
233
  return !x.dateTappedTwice;
@@ -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.module.ts","../../../../packages/dbx-web/calendar/src/dereekb-dbx-web-calendar.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { clampDateToDateRange, DateRange, isDateInDateRange, isFullDateRange, isSameDateDay, isSameDateRange } from '@dereekb/date';\nimport { invertDecision, Maybe, reduceBooleansWithAndFn } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { CalendarEvent } from 'angular-calendar';\nimport { differenceInDays, addDays, endOfDay, endOfMonth, endOfWeek, isSameDay, startOfDay, startOfMonth, startOfWeek, isBefore, isAfter } from 'date-fns';\nimport { 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 type: CalendarDisplayType;\n start: Date;\n end: Date;\n 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 isMinDateVisible: boolean;\n /**\n * Whether or not the maximum navigation date is visible. This implies that we're at the maximum date.\n */\n isMaxDateVisible: boolean;\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 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 ? isBefore(start, navigationRangeLimit.start) : false;\n const isMaxDateVisible: boolean = navigationRangeLimit?.end != null ? isAfter(end, navigationRangeLimit.end) : false;\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()\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()\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(map((x) => x.events));\n\n // TODO: Filter to be events that will only be displayed based on the current calendar.\n readonly visibleEvents$ = this.state$.pipe(\n map((x) => x.events),\n shareReplay(1)\n );\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(\n // If the date or type changes, check again.\n distinctUntilChanged((a, b) => a?.date === b?.date && a?.type === b?.type),\n map(visibleDateRangeForCalendarState),\n distinctUntilChanged((a, b) => {\n if (a.type === b.type) {\n return isSameDay(a.start, b.start);\n } else {\n return false; // Type changed, date range changed.\n }\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 // 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 { 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 { Component } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { DbxCalendarStore } from './calendar.store';\nimport { combineLatest, map, shareReplay, withLatestFrom } from 'rxjs';\nimport { MatButtonToggleChange } from '@angular/material/button-toggle';\nimport { reduceBooleansWithAnd, reduceBooleansWithAndFn } from '@dereekb/util';\n\n@Component({\n selector: 'dbx-calendar-base',\n templateUrl: './calendar.base.component.html'\n})\nexport class DbxCalendarBaseComponent<T> {\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.canShowPageButtons$;\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 constructor(public readonly calendarStore: DbxCalendarStore<T>) {}\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\">{{ (viewDate$ | async)! | calendarDate: (displayType$ | async) + '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\" fxFlex=\"nogrow\">\n <button *ngIf=\"showTodayButton$ | async\" mat-stroked-button [disabled]=\"!(canJumpToToday$ | async)\" (click)=\"todayClicked()\">Today</button>\n <dbx-button-spacer></dbx-button-spacer>\n <div class=\"d-iblock\" *ngIf=\"hasMultiplePages$ | async\">\n <button *ngIf=\"showPageButtons$ | async\" mat-icon-button [disabled]=\"isLookingAtMinimumDate$ | async\" aria-label=\"first page button\" (click)=\"firstPageButtonClicked()\">\n <mat-icon>first_page</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDate$ | async\" [attr.aria-label]=\"'Previous ' + (displayType$ | async) + ' button'\" (click)=\"previousButtonClicked()\">\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDate$ | async\" [attr.aria-label]=\"'Next' + (displayType$ | async)! + ' button'\" (click)=\"nextButtonClicked()\">\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button *ngIf=\"showPageButtons$ | async\" mat-icon-button [disabled]=\"isLookingAtMaximumDate$ | async\" aria-label=\"last page button\" (click)=\"lastPageButtonClicked()\">\n <mat-icon>last_page</mat-icon>\n </button>\n </div>\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, EventEmitter, Output, OnDestroy } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { CalendarEvent } from 'angular-calendar';\nimport { DbxCalendarStore } from './calendar.store';\nimport { map, shareReplay, withLatestFrom } from 'rxjs';\nimport { MatButtonToggleChange } from '@angular/material/button-toggle';\nimport { DbxCalendarEvent, prepareAndSortCalendarEvents } from './calendar';\n\n@Component({\n selector: 'dbx-calendar',\n templateUrl: './calendar.component.html'\n})\nexport class DbxCalendarComponent<T> implements OnDestroy {\n @Output()\n clickEvent = new EventEmitter<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 );\n\n readonly displayType$ = this.calendarStore.displayType$;\n\n constructor(readonly calendarStore: DbxCalendarStore<T>) {}\n\n ngOnDestroy(): void {\n this.clickEvent.complete();\n }\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]=\"(displayType$ | async)!\" (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]=\"'dbx-calendar-content-' + (displayType$ | async)!\" [ngSwitch]=\"displayType$ | async\">\n <mwl-calendar-month-view *ngSwitchCase=\"'month'\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" [activeDayIsOpen]=\"(activeDayIsOpen$ | async)!\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-month-view>\n <mwl-calendar-week-view *ngSwitchCase=\"'week'\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-week-view>\n <mwl-calendar-day-view *ngSwitchCase=\"'day'\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-day-view>\n </div>\n</dbx-calendar-base>\n","import { NgModule } from '@angular/core';\nimport { DbxCalendarComponent } from './calendar.component';\nimport { CalendarDayModule, CalendarModule, CalendarWeekModule, DateAdapter } from 'angular-calendar';\nimport { CommonModule } from '@angular/common';\nimport { DbxButtonModule, DbxPopoverInteractionModule } from '@dereekb/dbx-web';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { adapterFactory as dateAdapterFactory } from 'angular-calendar/date-adapters/date-fns';\nimport { MatButtonModule } from '@angular/material/button';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { DbxCalendarBaseComponent } from './calendar.base.component';\n\nconst declarations = [\n //\n DbxCalendarBaseComponent,\n DbxCalendarComponent\n];\n\n@NgModule({\n imports: [\n //\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatButtonToggleModule,\n DbxButtonModule,\n DbxPopoverInteractionModule,\n CalendarModule,\n CalendarDayModule,\n FlexLayoutModule,\n CalendarWeekModule\n ],\n declarations,\n exports: declarations\n})\nexport class DbxCalendarModule {}\n\n/**\n * Provides default configuration for the DbxCalendarModule\n */\n@NgModule({\n imports: [CalendarModule.forRoot({ provide: DateAdapter, useFactory: dateAdapterFactory })],\n exports: [DbxCalendarModule]\n})\nexport class DbxCalendarRootModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DbxCalendarStore","i8","i3","i4","i5","i6.DbxCalendarBaseComponent","dateAdapterFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IAQY,oBAIX;AAJD,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,mBAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACb,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,GAI9B,EAAA,CAAA,CAAA,CAAA;AAgDK,SAAU,gCAAgC,CAAC,aAA4B,EAAA;IAC3E,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC;AAC3D,IAAA,IAAI,KAAW,CAAC;AAChB,IAAA,IAAI,GAAS,CAAC;AACd,IAAA,IAAI,QAAgB,CAAC;AAErB,IAAA,QAAQ,IAAI;QACV,KAAK,mBAAmB,CAAC,KAAK;AAC5B,YAAA,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACzE,GAAG,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAClC,QAAQ,GAAG,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,MAAM;QACR,KAAK,mBAAmB,CAAC,IAAI;AAC3B,YAAA,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAC1B,YAAA,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AACvB,YAAA,QAAQ,GAAG,CAAC,CAAC;YACb,MAAM;QACR,KAAK,mBAAmB,CAAC,GAAG;AAC1B,YAAA,KAAK,GAAG,UAAU,C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EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAEA,cAAkB,EAAE,CAAC,CAAC;oBAC3F,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA,CAAA;;;AC3CD;;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.module.ts","../../../../packages/dbx-web/calendar/src/dereekb-dbx-web-calendar.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { clampDateToDateRange, DateRange, isDateInDateRange, isFullDateRange, isSameDateDay, isSameDateRange } from '@dereekb/date';\nimport { invertDecision, Maybe, reduceBooleansWithAndFn } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { CalendarEvent } from 'angular-calendar';\nimport { differenceInDays, addDays, endOfDay, endOfMonth, endOfWeek, isSameDay, startOfDay, startOfMonth, startOfWeek, isBefore, isAfter } from 'date-fns';\nimport { 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 type: CalendarDisplayType;\n start: Date;\n end: Date;\n 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 isMinDateVisible: boolean;\n /**\n * Whether or not the maximum navigation date is visible. This implies that we're at the maximum date.\n */\n isMaxDateVisible: boolean;\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 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()\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()\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(map((x) => x.events));\n\n // TODO: Filter to be events that will only be displayed based on the current calendar.\n readonly visibleEvents$ = this.state$.pipe(\n map((x) => x.events),\n shareReplay(1)\n );\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(\n // If the date or type changes, check again.\n distinctUntilChanged((a, b) => a?.date === b?.date && a?.type === b?.type),\n map(visibleDateRangeForCalendarState),\n distinctUntilChanged((a, b) => {\n if (a.type === b.type) {\n return isSameDay(a.start, b.start);\n } else {\n return false; // Type changed, date range changed.\n }\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 { 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 { Component } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { DbxCalendarStore } from './calendar.store';\nimport { combineLatest, map, shareReplay, withLatestFrom } from 'rxjs';\nimport { MatButtonToggleChange } from '@angular/material/button-toggle';\nimport { reduceBooleansWithAnd, reduceBooleansWithAndFn } from '@dereekb/util';\n\n@Component({\n selector: 'dbx-calendar-base',\n templateUrl: './calendar.base.component.html'\n})\nexport class DbxCalendarBaseComponent<T> {\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 constructor(public readonly calendarStore: DbxCalendarStore<T>) {}\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\">{{ (viewDate$ | async)! | calendarDate: (displayType$ | async) + '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\" fxFlex=\"nogrow\">\n <button *ngIf=\"showTodayButton$ | async\" mat-stroked-button [disabled]=\"!(canJumpToToday$ | async)\" (click)=\"todayClicked()\">Today</button>\n <dbx-button-spacer></dbx-button-spacer>\n <div class=\"d-iblock\" *ngIf=\"hasMultiplePages$ | async\">\n <button *ngIf=\"showPageButtons$ | async\" mat-icon-button [disabled]=\"isLookingAtMinimumDate$ | async\" aria-label=\"first page button\" (click)=\"firstPageButtonClicked()\">\n <mat-icon>first_page</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMinimumDate$ | async\" [attr.aria-label]=\"'Previous ' + (displayType$ | async) + ' button'\" (click)=\"previousButtonClicked()\">\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button mat-icon-button [disabled]=\"isLookingAtMaximumDate$ | async\" [attr.aria-label]=\"'Next' + (displayType$ | async)! + ' button'\" (click)=\"nextButtonClicked()\">\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button *ngIf=\"showPageButtons$ | async\" mat-icon-button [disabled]=\"isLookingAtMaximumDate$ | async\" aria-label=\"last page button\" (click)=\"lastPageButtonClicked()\">\n <mat-icon>last_page</mat-icon>\n </button>\n </div>\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, EventEmitter, Output, OnDestroy } from '@angular/core';\nimport { isSameMonth } from 'date-fns';\nimport { CalendarEvent } from 'angular-calendar';\nimport { DbxCalendarStore } from './calendar.store';\nimport { map, shareReplay, withLatestFrom } from 'rxjs';\nimport { MatButtonToggleChange } from '@angular/material/button-toggle';\nimport { DbxCalendarEvent, prepareAndSortCalendarEvents } from './calendar';\n\n@Component({\n selector: 'dbx-calendar',\n templateUrl: './calendar.component.html'\n})\nexport class DbxCalendarComponent<T> implements OnDestroy {\n @Output()\n clickEvent = new EventEmitter<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 );\n\n readonly displayType$ = this.calendarStore.displayType$;\n\n constructor(readonly calendarStore: DbxCalendarStore<T>) {}\n\n ngOnDestroy(): void {\n this.clickEvent.complete();\n }\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]=\"(displayType$ | async)!\" (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]=\"'dbx-calendar-content-' + (displayType$ | async)!\" [ngSwitch]=\"displayType$ | async\">\n <mwl-calendar-month-view *ngSwitchCase=\"'month'\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" [activeDayIsOpen]=\"(activeDayIsOpen$ | async)!\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-month-view>\n <mwl-calendar-week-view *ngSwitchCase=\"'week'\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-week-view>\n <mwl-calendar-day-view *ngSwitchCase=\"'day'\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (eventClicked)=\"eventClicked('Clicked', $event.event)\"></mwl-calendar-day-view>\n </div>\n</dbx-calendar-base>\n","import { NgModule } from '@angular/core';\nimport { DbxCalendarComponent } from './calendar.component';\nimport { CalendarDayModule, CalendarModule, CalendarWeekModule, DateAdapter } from 'angular-calendar';\nimport { CommonModule } from '@angular/common';\nimport { DbxButtonModule, DbxPopoverInteractionModule } from '@dereekb/dbx-web';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { adapterFactory as dateAdapterFactory } from 'angular-calendar/date-adapters/date-fns';\nimport { MatButtonModule } from '@angular/material/button';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { DbxCalendarBaseComponent } from './calendar.base.component';\n\nconst declarations = [\n //\n DbxCalendarBaseComponent,\n DbxCalendarComponent\n];\n\n@NgModule({\n imports: [\n //\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatButtonToggleModule,\n DbxButtonModule,\n DbxPopoverInteractionModule,\n CalendarModule,\n CalendarDayModule,\n FlexLayoutModule,\n CalendarWeekModule\n ],\n declarations,\n exports: declarations\n})\nexport class DbxCalendarModule {}\n\n/**\n * Provides default configuration for the DbxCalendarModule\n */\n@NgModule({\n imports: [CalendarModule.forRoot({ provide: DateAdapter, useFactory: dateAdapterFactory })],\n exports: [DbxCalendarModule]\n})\nexport class DbxCalendarRootModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DbxCalendarStore","i8","i3","i4","i5","i6.DbxCalendarBaseComponent","dateAdapterFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IAQY,oBAIX;AAJD,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,mBAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACb,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,GAI9B,EAAA,CAAA,CAAA,CAAA;AAgDK,SAAU,gCAAgC,CAAC,aAA4B,EAAA;IAC3E,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,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;;AAEG;;;;"}
@@ -2,9 +2,9 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, Host, Optional, Inject, Component, ChangeDetectionStrategy, SkipSelf, Directive, Injector, ElementRef, ViewChild, Input, NgModule } from '@angular/core';
3
3
  import * as i2 from '@dereekb/dbx-core';
4
4
  import { safeMarkForCheck, safeDetectChanges, AbstractSubscriptionDirective, DbxInjectionComponentModule } from '@dereekb/dbx-core';
5
- import { cleanup, filterMaybe, onTrueToFalse, SubscriptionObject, distinctUntilMapHasDifferentKeys, asObservable } from '@dereekb/rxjs';
6
- import { switchMap, NEVER, defaultIfEmpty, map, tap, EMPTY, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval, Subject, merge, throttleTime, BehaviorSubject, combineLatestWith } from 'rxjs';
7
- import { latLngPointFunction, latLngBoundFunction, latLngBoundFromInput, filterUndefinedValues, isSameLatLngPoint, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, diffLatLngBoundPoints, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, vectorsAreEqual, latLngBoundCenterPoint, addLatLngPoints, latLngPoint, DestroyFunctionObject, getValueFromGetter, LAT_LONG_10M_PRECISION, roundNumberToStepFunction } from '@dereekb/util';
5
+ import { asObservable, cleanup, filterMaybe, onTrueToFalse, SubscriptionObject, distinctUntilMapHasDifferentKeys } from '@dereekb/rxjs';
6
+ import { distinctUntilChanged, switchMap, map, combineLatestWith, shareReplay, NEVER, defaultIfEmpty, tap, EMPTY, of, combineLatest, filter, first, startWith, interval, Subject, merge, throttleTime, BehaviorSubject } from 'rxjs';
7
+ import { LAT_LONG_10M_PRECISION, latLngPointFunction, roundNumberToStepFunction, latLngBoundFunction, latLngBoundFromInput, filterUndefinedValues, isSameLatLngPoint, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, diffLatLngBoundPoints, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, vectorsAreEqual, latLngBoundCenterPoint, addLatLngPoints, latLngPoint, DestroyFunctionObject, getValueFromGetter } from '@dereekb/util';
8
8
  import { ComponentStore } from '@ngrx/component-store';
9
9
  import * as MapboxGl from 'mapbox-gl';
10
10
  import { bounds } from '@mapbox/geo-viewport';
@@ -99,6 +99,56 @@ function mapboxViewportBoundFunction(config) {
99
99
  };
100
100
  }
101
101
 
102
+ /**
103
+ * Filters the input objects based on their center and zoom values.
104
+ *
105
+ * This function caches the bounds computations for each of the input values.
106
+ *
107
+ * @param config
108
+ * @returns
109
+ */
110
+ function filterByMapboxViewportBound(config) {
111
+ const { boundDecisionObs: inputBoundDecisionObs, boundFunctionObs: inputBoundFunctionObs, defaultZoom: inputDefaultZoom = 17, readValue, zoomRounding, precision = LAT_LONG_10M_PRECISION } = config;
112
+ const _latLngPoint = latLngPointFunction({ wrap: false, validate: false, precision });
113
+ const _roundZoom = roundNumberToStepFunction(zoomRounding || { step: 0.5, round: 'floor' });
114
+ const boundDecisionObs = asObservable(inputBoundDecisionObs);
115
+ const boundFunctionObs = asObservable(inputBoundFunctionObs);
116
+ return (input) => {
117
+ return boundFunctionObs.pipe(distinctUntilChanged(), switchMap((viewportBoundFunction) => {
118
+ const cache = new Map();
119
+ return input.pipe(map((values) => {
120
+ return values.map((value) => {
121
+ const item = readValue(value);
122
+ const centerLatLng = _latLngPoint(item.center);
123
+ const zoomStep = _roundZoom(item.zoom || inputDefaultZoom);
124
+ const cacheKey = `${zoomStep}_${centerLatLng.lat}_${centerLatLng.lng}`;
125
+ const cachedValue = cache.get(cacheKey);
126
+ let bound;
127
+ if (!cachedValue) {
128
+ bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });
129
+ cache.set(cacheKey, bound);
130
+ }
131
+ else {
132
+ bound = cachedValue;
133
+ }
134
+ return {
135
+ value,
136
+ bound
137
+ };
138
+ });
139
+ }), combineLatestWith(boundDecisionObs), map(([items, boundFunction]) => {
140
+ const valuesInBounds = [];
141
+ items.forEach((item) => {
142
+ if (boundFunction(item.bound)) {
143
+ valuesInBounds.push(item.value);
144
+ }
145
+ });
146
+ return valuesInBounds;
147
+ }));
148
+ }), shareReplay(1));
149
+ };
150
+ }
151
+
102
152
  /**
103
153
  * Store used for retrieving information.
104
154
  */
@@ -510,6 +560,14 @@ class DbxMapboxMapStore extends ComponentStore {
510
560
  return newCenter;
511
561
  }))));
512
562
  }
563
+ filterByViewportBound(input) {
564
+ const config = typeof input === 'function' ? { readValue: input } : input;
565
+ return filterByMapboxViewportBound({
566
+ ...config,
567
+ boundFunctionObs: this.viewportBoundFunction$,
568
+ boundDecisionObs: this.overlapsBoundFunction$
569
+ });
570
+ }
513
571
  }
514
572
  DbxMapboxMapStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore, deps: [{ token: DbxMapboxService }], target: i0.ɵɵFactoryTarget.Injectable });
515
573
  DbxMapboxMapStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore });
@@ -1294,56 +1352,6 @@ function dbxMapboxColoredDotStyle(background, color) {
1294
1352
  };
1295
1353
  }
1296
1354
 
1297
- /**
1298
- * Filters the input objects based on their center and zoom values.
1299
- *
1300
- * This function caches the bounds computations for each of the input values.
1301
- *
1302
- * @param config
1303
- * @returns
1304
- */
1305
- function filterByMapboxViewportBound(config) {
1306
- const { boundDecisionObs: inputBoundDecisionObs, boundFunctionObs: inputBoundFunctionObs, defaultZoom: inputDefaultZoom = 17, readValue, zoomRounding, precision = LAT_LONG_10M_PRECISION } = config;
1307
- const _latLngPoint = latLngPointFunction({ wrap: false, validate: false, precision });
1308
- const _roundZoom = roundNumberToStepFunction(zoomRounding || { step: 0.5, round: 'floor' });
1309
- const boundDecisionObs = asObservable(inputBoundDecisionObs);
1310
- const boundFunctionObs = asObservable(inputBoundFunctionObs);
1311
- return (input) => {
1312
- return boundFunctionObs.pipe(distinctUntilChanged(), switchMap((viewportBoundFunction) => {
1313
- const cache = new Map();
1314
- return input.pipe(map((values) => {
1315
- return values.map((value) => {
1316
- const item = readValue(value);
1317
- const centerLatLng = _latLngPoint(item.center);
1318
- const zoomStep = _roundZoom(item.zoom || inputDefaultZoom);
1319
- const cacheKey = `${zoomStep}_${centerLatLng.lat}_${centerLatLng.lng}`;
1320
- const cachedValue = cache.get(cacheKey);
1321
- let bound;
1322
- if (!cachedValue) {
1323
- bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });
1324
- cache.set(cacheKey, bound);
1325
- }
1326
- else {
1327
- bound = cachedValue;
1328
- }
1329
- return {
1330
- value,
1331
- bound
1332
- };
1333
- });
1334
- }), combineLatestWith(boundDecisionObs), map(([items, boundFunction]) => {
1335
- const valuesInBounds = [];
1336
- items.forEach((item) => {
1337
- if (boundFunction(item.bound)) {
1338
- valuesInBounds.push(item.value);
1339
- }
1340
- });
1341
- return valuesInBounds;
1342
- }));
1343
- }), shareReplay(1));
1344
- };
1345
- }
1346
-
1347
1355
  const KNOWN_MAPBOX_STYLES = [
1348
1356
  //
1349
1357
  'mapbox://styles/mapbox/streets-v11',