@dereekb/dbx-web 9.24.19 → 9.24.21

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 (37) hide show
  1. package/calendar/esm2020/lib/calendar.store.mjs +2 -2
  2. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs +1 -1
  3. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  4. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs +1 -1
  5. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  6. package/calendar/package.json +2 -2
  7. package/esm2020/calendar/lib/calendar.store.mjs +2 -2
  8. package/esm2020/mapbox/lib/index.mjs +2 -1
  9. package/esm2020/mapbox/lib/mapbox.layout.component.mjs +13 -9
  10. package/esm2020/mapbox/lib/mapbox.layout.resize.sync.directive.mjs +38 -0
  11. package/esm2020/mapbox/lib/mapbox.module.mjs +5 -1
  12. package/esm2020/mapbox/lib/mapbox.store.mjs +61 -26
  13. package/fesm2015/dereekb-dbx-web-calendar.mjs +1 -1
  14. package/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  15. package/fesm2015/dereekb-dbx-web-mapbox.mjs +109 -34
  16. package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  17. package/fesm2020/dereekb-dbx-web-calendar.mjs +1 -1
  18. package/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  19. package/fesm2020/dereekb-dbx-web-mapbox.mjs +107 -34
  20. package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  21. package/mapbox/esm2020/lib/index.mjs +2 -1
  22. package/mapbox/esm2020/lib/mapbox.layout.component.mjs +13 -9
  23. package/mapbox/esm2020/lib/mapbox.layout.resize.sync.directive.mjs +38 -0
  24. package/mapbox/esm2020/lib/mapbox.module.mjs +5 -1
  25. package/mapbox/esm2020/lib/mapbox.store.mjs +61 -26
  26. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +109 -34
  27. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  28. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +107 -34
  29. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  30. package/mapbox/lib/index.d.ts +1 -0
  31. package/mapbox/lib/mapbox.layout.component.d.ts +3 -1
  32. package/mapbox/lib/mapbox.layout.resize.sync.directive.d.ts +15 -0
  33. package/mapbox/lib/mapbox.module.d.ts +18 -17
  34. package/mapbox/lib/mapbox.store.d.ts +31 -13
  35. package/mapbox/package.json +3 -3
  36. package/package.json +3 -3
  37. package/table/package.json +3 -3
@@ -4,7 +4,7 @@ import * as i2 from '@dereekb/dbx-core';
4
4
  import { safeMarkForCheck, safeDetectChanges, AbstractSubscriptionDirective, DbxInjectionComponentModule } from '@dereekb/dbx-core';
5
5
  import { asObservable, cleanup, filterMaybe, onTrueToFalse, SubscriptionObject, distinctUntilMapHasDifferentKeys } from '@dereekb/rxjs';
6
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, isSameVector, latLngBoundCenterPoint, addLatLngPoints, vectorMinimumSizeResizeFunction, latLngPoint, DestroyFunctionObject, getValueFromGetter } from '@dereekb/util';
7
+ import { LAT_LONG_10M_PRECISION, latLngPointFunction, roundNumberToStepFunction, latLngBoundFunction, latLngBoundFromInput, filterUndefinedValues, isSameLatLngPoint, isSameVector, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, diffLatLngBoundPoints, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, latLngBoundCenterPoint, addLatLngPoints, vectorMinimumSizeResizeFunction, 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';
@@ -167,7 +167,8 @@ class DbxMapboxMapStore extends ComponentStore {
167
167
  moveState: 'init',
168
168
  zoomState: 'init',
169
169
  rotateState: 'init',
170
- retainContent: true
170
+ retainContent: true,
171
+ useVirtualBound: true
171
172
  });
172
173
  this.dbxMapboxService = dbxMapboxService;
173
174
  this.safeLatLngPoint = latLngPointFunction({ wrap: true });
@@ -436,16 +437,48 @@ class DbxMapboxMapStore extends ComponentStore {
436
437
  }
437
438
  }), shareReplay(1));
438
439
  this.whenInitialized$ = this.isInitialized$.pipe(filter((x) => true), shareReplay(1));
439
- this.isRendering$ = this.whenInitialized$.pipe(switchMap(() => this.lifecycleState$.pipe(map((x) => x === 'render'), distinctUntilChanged(), shareReplay())));
440
- this.isMoving$ = this.whenInitialized$.pipe(switchMap(() => this.moveState$.pipe(map((x) => x === 'moving'), distinctUntilChanged(), shareReplay())));
441
- this.isZooming$ = this.whenInitialized$.pipe(switchMap(() => this.zoomState$.pipe(map((x) => x === 'zooming'), distinctUntilChanged(), shareReplay())));
442
- this.isRotating$ = this.whenInitialized$.pipe(switchMap(() => this.rotateState$.pipe(map((x) => x === 'rotating'), distinctUntilChanged(), shareReplay())));
440
+ this.isRendering$ = this.whenInitialized$.pipe(switchMap(() => this.lifecycleState$.pipe(map((x) => x === 'render'), distinctUntilChanged(), shareReplay(1))));
441
+ this.isMoving$ = this.whenInitialized$.pipe(switchMap(() => this.moveState$.pipe(map((x) => x === 'moving'), distinctUntilChanged(), shareReplay(1))));
442
+ this.isZooming$ = this.whenInitialized$.pipe(switchMap(() => this.zoomState$.pipe(map((x) => x === 'zooming'), distinctUntilChanged(), shareReplay(1))));
443
+ this.isRotating$ = this.whenInitialized$.pipe(switchMap(() => this.rotateState$.pipe(map((x) => x === 'rotating'), distinctUntilChanged(), shareReplay(1))));
443
444
  this._movingTimer = this.movingTimer();
444
445
  this._renderingTimer = this.lifecycleRenderTimer();
445
446
  this.centerNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => this.latLngPoint(x.getCenter())))), shareReplay(1))), shareReplay(1));
446
447
  this.center$ = this.whenInitialized$.pipe(switchMap(() => {
447
448
  return this.isMoving$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.centerNow$.pipe(first())), distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
448
449
  }), shareReplay(1));
450
+ this.minimumVirtualViewportSize$ = this.state$.pipe(map((x) => x.minimumVirtualViewportSize), distinctUntilChanged(isSameVector), shareReplay(1));
451
+ this.currentMapCanvasSize$ = this.state$.pipe(map((x) => x.mapCanvasSize), distinctUntilChanged(isSameVector), shareReplay(1));
452
+ /**
453
+ * The map canvas size with consideration to the virtual viewport size.
454
+ */
455
+ this.mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());
456
+ /**
457
+ * The map canvas size with consideration to the virtual viewport size.
458
+ */
459
+ this.virtualMapCanvasSize$ = this.minimumVirtualViewportSize$.pipe(switchMap((minimumVirtualViewportSize) => {
460
+ if (minimumVirtualViewportSize) {
461
+ return this.minimumMapCanvasSize(minimumVirtualViewportSize);
462
+ }
463
+ else {
464
+ return this.mapCanvasSize$;
465
+ }
466
+ }), distinctUntilChanged(isSameVector), shareReplay(1));
467
+ this.rawViewportBoundFunction$ = this.mapCanvasSize$.pipe(map((mapCanvasSize) => mapboxViewportBoundFunction({ mapCanvasSize })), shareReplay(1));
468
+ this.viewportBoundFunction$ = this.minimumVirtualViewportSize$.pipe(switchMap((minimumVirtualViewportSize) => {
469
+ if (minimumVirtualViewportSize) {
470
+ return this.viewportBoundFunctionWithMinimumSize(minimumVirtualViewportSize);
471
+ }
472
+ else {
473
+ return this.rawViewportBoundFunction$;
474
+ }
475
+ }), shareReplay(1));
476
+ this.virtualBound$ = this.viewportBoundFunction$.pipe(switchMap((fn) => {
477
+ return combineLatest([this.center$, this.zoom$]).pipe(map(([center, zoom]) => fn({
478
+ center,
479
+ zoom
480
+ })));
481
+ }), shareReplay(1));
449
482
  this.margin$ = this.state$.pipe(map((x) => x.margin), distinctUntilChanged((a, b) => a != null && b != null && a.fullWidth === b.fullWidth && a.leftMargin === b.leftMargin && a.rightMargin === b.rightMargin), shareReplay(1));
450
483
  this.reverseMargin$ = this.margin$.pipe(map((x) => {
451
484
  if (x) {
@@ -465,7 +498,7 @@ class DbxMapboxMapStore extends ComponentStore {
465
498
  }
466
499
  }));
467
500
  }), shareReplay(1));
468
- this.boundNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => {
501
+ this.rawBoundNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => {
469
502
  const bound = x.getBounds();
470
503
  const boundSw = bound.getSouthWest();
471
504
  const boundNe = bound.getNorthEast();
@@ -473,13 +506,22 @@ class DbxMapboxMapStore extends ComponentStore {
473
506
  const ne = isDefaultLatLngPoint(boundNe) ? neMostLatLngPoint() : { lat: boundNe.lat, lng: boundNe.lng };
474
507
  return this.latLngBound(sw, ne);
475
508
  }))), shareReplay(1))));
476
- this.bound$ = this.whenInitialized$.pipe(switchMap(() => {
477
- return this.isRendering$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.boundNow$.pipe(first())), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
509
+ this.rawBound$ = this.whenInitialized$.pipe(switchMap(() => {
510
+ return this.isRendering$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.rawBoundNow$.pipe(first())), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
478
511
  }));
512
+ this.useVirtualBound$ = this.state$.pipe(map((x) => x.useVirtualBound), distinctUntilChanged(), shareReplay(1));
513
+ this.bound$ = this.useVirtualBound$.pipe(switchMap((useVirtualBound) => {
514
+ if (useVirtualBound) {
515
+ return this.virtualBound$;
516
+ }
517
+ else {
518
+ return this.bound$;
519
+ }
520
+ }), shareReplay(1));
479
521
  this.boundSizing$ = this.bound$.pipe(map((x) => diffLatLngBoundPoints(x)), shareReplay(1));
480
522
  this.boundWrapsAroundWorld$ = this.bound$.pipe(map((x) => latLngBoundWrapsMap(x)), distinctUntilChanged(), shareReplay(1));
481
523
  this.isWithinBoundFunction$ = this.bound$.pipe(map((x) => isWithinLatLngBoundFunction(x)), shareReplay(1));
482
- this.overlapsBoundFunction$ = this.bound$.pipe(map((x) => overlapsLatLngBoundFunction(x)), shareReplay(1));
524
+ this.overlapsBoundFunction$ = this.virtualBound$.pipe(map((x) => overlapsLatLngBoundFunction(x)), shareReplay(1));
483
525
  this.zoomNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => x.getZoom()))), shareReplay(1))));
484
526
  this.zoom$ = this.whenInitialized$.pipe(switchMap(() => {
485
527
  return this.isZooming$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.zoomNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
@@ -494,25 +536,14 @@ class DbxMapboxMapStore extends ComponentStore {
494
536
  }));
495
537
  this.content$ = this.state$.pipe(map((x) => x.content), distinctUntilChanged(), shareReplay(1));
496
538
  this.hasContent$ = this.content$.pipe(map(Boolean));
497
- this.currentMapCanvasSize$ = this.state$.pipe(map((x) => x.mapCanvasSize), distinctUntilChanged((a, b) => a != null && b != null && vectorsAreEqual(a, b)), shareReplay(1));
498
- this.mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());
499
- this.minimumVirtualViewportSize$ = this.state$.pipe(map((x) => x.minimumVirtualViewportSize), distinctUntilChanged(isSameVector), shareReplay(1));
500
- this.rawViewportBoundFunction$ = this.mapCanvasSize$.pipe(map((x) => mapboxViewportBoundFunction({ mapCanvasSize: x })), shareReplay(1));
501
- this.viewportBoundFunction$ = this.minimumVirtualViewportSize$.pipe(switchMap((minimumSize) => {
502
- if (minimumSize) {
503
- return this.viewportBoundFunctionWithMinimumSize(minimumSize);
504
- }
505
- else {
506
- return this.rawViewportBoundFunction$;
507
- }
508
- }), shareReplay(1));
509
539
  this.clickEvent$ = this.state$.pipe(map((x) => x.clickEvent), distinctUntilChanged(), shareReplay(1));
510
540
  this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent), distinctUntilChanged(), shareReplay(1));
511
541
  this.rightClickEvent$ = this.state$.pipe(map((x) => x.rightClickEvent), distinctUntilChanged(), shareReplay(1));
512
542
  // MARK: State Changes
513
543
  this.setMargin = this.updater((state, margin) => (Object.assign(Object.assign({}, state), { margin: margin && (margin.rightMargin !== 0 || margin.leftMargin !== 0) ? margin : undefined })));
514
544
  this.setMinimumVirtualViewportSize = this.updater((state, minimumVirtualViewportSize) => (Object.assign(Object.assign({}, state), { minimumVirtualViewportSize })));
515
- this._setMapService = this.updater((state, mapService) => ({ mapService, moveState: 'init', lifecycleState: 'init', zoomState: 'init', rotateState: 'init', retainContent: state.retainContent, content: state.retainContent ? state.content : undefined }));
545
+ this.setUseVirtualBound = this.updater((state, useVirtualBound) => (Object.assign(Object.assign({}, state), { useVirtualBound })));
546
+ this._setMapService = this.updater((state, mapService) => ({ mapService, moveState: 'init', lifecycleState: 'init', zoomState: 'init', rotateState: 'init', retainContent: state.retainContent, content: state.retainContent ? state.content : undefined, useVirtualBound: state.useVirtualBound }));
516
547
  this._setLifecycleState = this.updater((state, lifecycleState) => (Object.assign(Object.assign({}, state), { lifecycleState })));
517
548
  this._setMoveState = this.updater((state, moveState) => (Object.assign(Object.assign({}, state), { moveState })));
518
549
  this._setZoomState = this.updater((state, zoomState) => (Object.assign(Object.assign({}, state), { zoomState })));
@@ -537,7 +568,7 @@ class DbxMapboxMapStore extends ComponentStore {
537
568
  else {
538
569
  return of(0);
539
570
  }
540
- }), shareReplay());
571
+ }), shareReplay(1));
541
572
  }
542
573
  lifecycleRenderTimer(period = this.timerRefreshPeriod) {
543
574
  return this.lifecycleState$.pipe(switchMap((x) => {
@@ -547,7 +578,7 @@ class DbxMapboxMapStore extends ComponentStore {
547
578
  else {
548
579
  return of(0);
549
580
  }
550
- }), shareReplay());
581
+ }), shareReplay(1));
551
582
  }
552
583
  atNextIdle() {
553
584
  return this.moveState$.pipe(map((x) => x === 'idle'), first());
@@ -585,6 +616,10 @@ class DbxMapboxMapStore extends ComponentStore {
585
616
  const config = typeof input === 'function' ? { readValue: input } : input;
586
617
  return filterByMapboxViewportBound(Object.assign(Object.assign({}, config), { boundFunctionObs: this.viewportBoundFunction$, boundDecisionObs: this.overlapsBoundFunction$ }));
587
618
  }
619
+ minimumMapCanvasSize(minVector) {
620
+ const resizeFn = vectorMinimumSizeResizeFunction(minVector);
621
+ return this.mapCanvasSize$.pipe(map((x) => resizeFn(x)), distinctUntilChanged(isSameVector), shareReplay(1));
622
+ }
588
623
  /**
589
624
  * Creates a MapboxViewportBoundFunction observable that returns the minimum viewport size.
590
625
  *
@@ -829,6 +864,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
829
864
  this._openToggle = new BehaviorSubject(true);
830
865
  this._color = new BehaviorSubject(undefined);
831
866
  this._toggleSub = new SubscriptionObject();
867
+ this.resized$ = this._resized.asObservable();
832
868
  this.side$ = this._side.pipe(distinctUntilChanged(), shareReplay(1));
833
869
  this.mode$ = this._mode.pipe(distinctUntilChanged(), shareReplay(1));
834
870
  this.hasContent$ = combineLatest([this._forceHasContent, this.dbxMapboxMapStore.hasContent$]).pipe(map(([hasContent, forceHasContent]) => hasContent || forceHasContent), distinctUntilChanged(), shareReplay(1));
@@ -866,12 +902,12 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
866
902
  let obs;
867
903
  if (mode === 'push') {
868
904
  obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(tap(([opened]) => {
869
- let { right } = this.container._contentMargins;
870
- this.container.updateContentMargins();
905
+ let { right } = this.drawerContainer._contentMargins;
906
+ this.drawerContainer.updateContentMargins();
871
907
  setTimeout(() => {
872
908
  const flip = opened ? 1 : -1;
873
909
  if (opened) {
874
- right = this.container._contentMargins.right;
910
+ right = this.drawerContainer._contentMargins.right;
875
911
  }
876
912
  right = (right || 0) * flip;
877
913
  const element = this.content.nativeElement;
@@ -894,7 +930,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
894
930
  }
895
931
  else {
896
932
  obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(switchMap((_) => this.dbxMapboxMapStore.mapInstance$), tap((x) => {
897
- this.container.updateContentMargins();
933
+ this.drawerContainer.updateContentMargins();
898
934
  x.triggerRepaint();
899
935
  }));
900
936
  }
@@ -941,15 +977,18 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
941
977
  this._color.next(color);
942
978
  }
943
979
  onResized(event) {
944
- this._resized.next();
980
+ this._resized.next(event);
945
981
  }
946
982
  }
947
983
  DbxMapboxLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutComponent, deps: [{ token: DbxMapboxMapStore }], target: i0.ɵɵFactoryTarget.Component });
948
- DbxMapboxLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxLayoutComponent, selector: "dbx-mapbox-layout", inputs: { side: "side", mode: "mode", opened: "opened", hasContent: "hasContent", drawerColor: "drawerColor" }, viewQueries: [{ propertyName: "container", first: true, predicate: MatDrawerContainer, descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" [mode]=\"(mode$ | async) || 'side'\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i3.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i3.MatDrawerContent, selector: "mat-drawer-content" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: DbxMapboxLayoutDrawerComponent, selector: "dbx-mapbox-layout-drawer" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }] });
984
+ DbxMapboxLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxLayoutComponent, selector: "dbx-mapbox-layout", inputs: { side: "side", mode: "mode", opened: "opened", hasContent: "hasContent", drawerColor: "drawerColor" }, viewQueries: [{ propertyName: "containerElement", first: true, predicate: MatDrawerContainer, descendants: true, read: ElementRef }, { propertyName: "drawerContainer", first: true, predicate: MatDrawerContainer, descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<mat-drawer-container #containerElement class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" [mode]=\"(mode$ | async) || 'side'\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i3.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i3.MatDrawerContent, selector: "mat-drawer-content" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: DbxMapboxLayoutDrawerComponent, selector: "dbx-mapbox-layout-drawer" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }] });
949
985
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutComponent, decorators: [{
950
986
  type: Component,
951
- args: [{ selector: 'dbx-mapbox-layout', template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" [mode]=\"(mode$ | async) || 'side'\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"] }]
952
- }], ctorParameters: function () { return [{ type: DbxMapboxMapStore }]; }, propDecorators: { container: [{
987
+ args: [{ selector: 'dbx-mapbox-layout', template: "<mat-drawer-container #containerElement class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" [mode]=\"(mode$ | async) || 'side'\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"] }]
988
+ }], ctorParameters: function () { return [{ type: DbxMapboxMapStore }]; }, propDecorators: { containerElement: [{
989
+ type: ViewChild,
990
+ args: [MatDrawerContainer, { read: ElementRef }]
991
+ }], drawerContainer: [{
953
992
  type: ViewChild,
954
993
  args: [MatDrawerContainer]
955
994
  }], content: [{
@@ -1298,8 +1337,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
1298
1337
  type: Input
1299
1338
  }] } });
1300
1339
 
1340
+ /**
1341
+ * Directive that synchronizes a map's virtual size with the size of the element.
1342
+ */
1343
+ class DbxMapboxLayoutVirtualResizeSyncComponent extends SubscriptionObject {
1344
+ constructor(dbxMapboxLayoutComponent) {
1345
+ super();
1346
+ this.dbxMapboxLayoutComponent = dbxMapboxLayoutComponent;
1347
+ this.resizedVector$ = this.dbxMapboxLayoutComponent.resized$.pipe(map(() => {
1348
+ const element = this.dbxMapboxLayoutComponent.containerElement.nativeElement;
1349
+ const { clientWidth, clientHeight } = element;
1350
+ return {
1351
+ x: clientWidth,
1352
+ y: clientHeight
1353
+ };
1354
+ }), distinctUntilChanged(isSameVector), shareReplay(1));
1355
+ }
1356
+ ngOnInit() {
1357
+ this.dbxMapboxLayoutComponent.dbxMapboxMapStore.setMinimumVirtualViewportSize(this.resizedVector$);
1358
+ }
1359
+ }
1360
+ DbxMapboxLayoutVirtualResizeSyncComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutVirtualResizeSyncComponent, deps: [{ token: DbxMapboxLayoutComponent, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1361
+ DbxMapboxLayoutVirtualResizeSyncComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxLayoutVirtualResizeSyncComponent, selector: "[dbxMapboxLayoutVirtualResizeSync]", usesInheritance: true, ngImport: i0 });
1362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutVirtualResizeSyncComponent, decorators: [{
1363
+ type: Directive,
1364
+ args: [{
1365
+ selector: '[dbxMapboxLayoutVirtualResizeSync]'
1366
+ }]
1367
+ }], ctorParameters: function () {
1368
+ return [{ type: DbxMapboxLayoutComponent, decorators: [{
1369
+ type: Host
1370
+ }] }];
1371
+ } });
1372
+
1301
1373
  const declarations = [
1302
1374
  //
1375
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1303
1376
  DbxMapboxMapDirective,
1304
1377
  DbxMapboxLayoutComponent,
1305
1378
  DbxMapboxLayoutDrawerComponent,
@@ -1325,6 +1398,7 @@ class DbxMapboxModule {
1325
1398
  DbxMapboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1326
1399
  DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxModule, declarations: [
1327
1400
  //
1401
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1328
1402
  DbxMapboxMapDirective,
1329
1403
  DbxMapboxLayoutComponent,
1330
1404
  DbxMapboxLayoutDrawerComponent,
@@ -1345,6 +1419,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
1345
1419
  NgxMapboxGLModule
1346
1420
  ], exports: [
1347
1421
  //
1422
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1348
1423
  DbxMapboxMapDirective,
1349
1424
  DbxMapboxLayoutComponent,
1350
1425
  DbxMapboxLayoutDrawerComponent,
@@ -1421,5 +1496,5 @@ function mapboxZoomLevel(input) {
1421
1496
  * Generated bundle index. Do not edit.
1422
1497
  */
1423
1498
 
1424
- export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxChangeDetectorRefService, DbxMapboxChangeService, DbxMapboxConfig, DbxMapboxInjectionComponent, DbxMapboxInjectionStore, DbxMapboxInjectionStoreInjectionBlockDirective, DbxMapboxInjectionStoreProviderBlock, DbxMapboxLayoutComponent, DbxMapboxLayoutDrawerComponent, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxMapStoreInjectionBlockDirective, DbxMapboxMapStoreProviderBlock, DbxMapboxMarkerComponent, DbxMapboxMarkersComponent, DbxMapboxMenuComponent, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES, MAPBOX_MAX_ZOOM_LEVEL, MAPBOX_MIN_ZOOM_LEVEL, dbxMapboxColoredDotStyle, filterByMapboxViewportBound, mapboxViewportBoundFunction, mapboxZoomLevel, provideMapboxInjectionStoreIfParentIsUnavailable, provideMapboxStoreIfParentIsUnavailable, updateDbxMapboxMapInjectionStoreStateWithInjectionConfig, updateDbxMapboxMapInjectionStoreStateWithRemovedKey };
1499
+ export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxChangeDetectorRefService, DbxMapboxChangeService, DbxMapboxConfig, DbxMapboxInjectionComponent, DbxMapboxInjectionStore, DbxMapboxInjectionStoreInjectionBlockDirective, DbxMapboxInjectionStoreProviderBlock, DbxMapboxLayoutComponent, DbxMapboxLayoutDrawerComponent, DbxMapboxLayoutVirtualResizeSyncComponent, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxMapStoreInjectionBlockDirective, DbxMapboxMapStoreProviderBlock, DbxMapboxMarkerComponent, DbxMapboxMarkersComponent, DbxMapboxMenuComponent, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES, MAPBOX_MAX_ZOOM_LEVEL, MAPBOX_MIN_ZOOM_LEVEL, dbxMapboxColoredDotStyle, filterByMapboxViewportBound, mapboxViewportBoundFunction, mapboxZoomLevel, provideMapboxInjectionStoreIfParentIsUnavailable, provideMapboxStoreIfParentIsUnavailable, updateDbxMapboxMapInjectionStoreStateWithInjectionConfig, updateDbxMapboxMapInjectionStoreStateWithRemovedKey };
1425
1500
  //# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map