@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';
@@ -159,7 +159,8 @@ class DbxMapboxMapStore extends ComponentStore {
159
159
  moveState: 'init',
160
160
  zoomState: 'init',
161
161
  rotateState: 'init',
162
- retainContent: true
162
+ retainContent: true,
163
+ useVirtualBound: true
163
164
  });
164
165
  this.dbxMapboxService = dbxMapboxService;
165
166
  this.safeLatLngPoint = latLngPointFunction({ wrap: true });
@@ -425,16 +426,48 @@ class DbxMapboxMapStore extends ComponentStore {
425
426
  }
426
427
  }), shareReplay(1));
427
428
  this.whenInitialized$ = this.isInitialized$.pipe(filter((x) => true), shareReplay(1));
428
- this.isRendering$ = this.whenInitialized$.pipe(switchMap(() => this.lifecycleState$.pipe(map((x) => x === 'render'), distinctUntilChanged(), shareReplay())));
429
- this.isMoving$ = this.whenInitialized$.pipe(switchMap(() => this.moveState$.pipe(map((x) => x === 'moving'), distinctUntilChanged(), shareReplay())));
430
- this.isZooming$ = this.whenInitialized$.pipe(switchMap(() => this.zoomState$.pipe(map((x) => x === 'zooming'), distinctUntilChanged(), shareReplay())));
431
- this.isRotating$ = this.whenInitialized$.pipe(switchMap(() => this.rotateState$.pipe(map((x) => x === 'rotating'), distinctUntilChanged(), shareReplay())));
429
+ this.isRendering$ = this.whenInitialized$.pipe(switchMap(() => this.lifecycleState$.pipe(map((x) => x === 'render'), distinctUntilChanged(), shareReplay(1))));
430
+ this.isMoving$ = this.whenInitialized$.pipe(switchMap(() => this.moveState$.pipe(map((x) => x === 'moving'), distinctUntilChanged(), shareReplay(1))));
431
+ this.isZooming$ = this.whenInitialized$.pipe(switchMap(() => this.zoomState$.pipe(map((x) => x === 'zooming'), distinctUntilChanged(), shareReplay(1))));
432
+ this.isRotating$ = this.whenInitialized$.pipe(switchMap(() => this.rotateState$.pipe(map((x) => x === 'rotating'), distinctUntilChanged(), shareReplay(1))));
432
433
  this._movingTimer = this.movingTimer();
433
434
  this._renderingTimer = this.lifecycleRenderTimer();
434
435
  this.centerNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => this.latLngPoint(x.getCenter())))), shareReplay(1))), shareReplay(1));
435
436
  this.center$ = this.whenInitialized$.pipe(switchMap(() => {
436
437
  return this.isMoving$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.centerNow$.pipe(first())), distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
437
438
  }), shareReplay(1));
439
+ this.minimumVirtualViewportSize$ = this.state$.pipe(map((x) => x.minimumVirtualViewportSize), distinctUntilChanged(isSameVector), shareReplay(1));
440
+ this.currentMapCanvasSize$ = this.state$.pipe(map((x) => x.mapCanvasSize), distinctUntilChanged(isSameVector), shareReplay(1));
441
+ /**
442
+ * The map canvas size with consideration to the virtual viewport size.
443
+ */
444
+ this.mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());
445
+ /**
446
+ * The map canvas size with consideration to the virtual viewport size.
447
+ */
448
+ this.virtualMapCanvasSize$ = this.minimumVirtualViewportSize$.pipe(switchMap((minimumVirtualViewportSize) => {
449
+ if (minimumVirtualViewportSize) {
450
+ return this.minimumMapCanvasSize(minimumVirtualViewportSize);
451
+ }
452
+ else {
453
+ return this.mapCanvasSize$;
454
+ }
455
+ }), distinctUntilChanged(isSameVector), shareReplay(1));
456
+ this.rawViewportBoundFunction$ = this.mapCanvasSize$.pipe(map((mapCanvasSize) => mapboxViewportBoundFunction({ mapCanvasSize })), shareReplay(1));
457
+ this.viewportBoundFunction$ = this.minimumVirtualViewportSize$.pipe(switchMap((minimumVirtualViewportSize) => {
458
+ if (minimumVirtualViewportSize) {
459
+ return this.viewportBoundFunctionWithMinimumSize(minimumVirtualViewportSize);
460
+ }
461
+ else {
462
+ return this.rawViewportBoundFunction$;
463
+ }
464
+ }), shareReplay(1));
465
+ this.virtualBound$ = this.viewportBoundFunction$.pipe(switchMap((fn) => {
466
+ return combineLatest([this.center$, this.zoom$]).pipe(map(([center, zoom]) => fn({
467
+ center,
468
+ zoom
469
+ })));
470
+ }), shareReplay(1));
438
471
  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));
439
472
  this.reverseMargin$ = this.margin$.pipe(map((x) => {
440
473
  if (x) {
@@ -454,7 +487,7 @@ class DbxMapboxMapStore extends ComponentStore {
454
487
  }
455
488
  }));
456
489
  }), shareReplay(1));
457
- this.boundNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => {
490
+ this.rawBoundNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => {
458
491
  const bound = x.getBounds();
459
492
  const boundSw = bound.getSouthWest();
460
493
  const boundNe = bound.getNorthEast();
@@ -462,13 +495,22 @@ class DbxMapboxMapStore extends ComponentStore {
462
495
  const ne = isDefaultLatLngPoint(boundNe) ? neMostLatLngPoint() : { lat: boundNe.lat, lng: boundNe.lng };
463
496
  return this.latLngBound(sw, ne);
464
497
  }))), shareReplay(1))));
465
- this.bound$ = this.whenInitialized$.pipe(switchMap(() => {
466
- return this.isRendering$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.boundNow$.pipe(first())), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
498
+ this.rawBound$ = this.whenInitialized$.pipe(switchMap(() => {
499
+ return this.isRendering$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.rawBoundNow$.pipe(first())), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
467
500
  }));
501
+ this.useVirtualBound$ = this.state$.pipe(map((x) => x.useVirtualBound), distinctUntilChanged(), shareReplay(1));
502
+ this.bound$ = this.useVirtualBound$.pipe(switchMap((useVirtualBound) => {
503
+ if (useVirtualBound) {
504
+ return this.virtualBound$;
505
+ }
506
+ else {
507
+ return this.bound$;
508
+ }
509
+ }), shareReplay(1));
468
510
  this.boundSizing$ = this.bound$.pipe(map((x) => diffLatLngBoundPoints(x)), shareReplay(1));
469
511
  this.boundWrapsAroundWorld$ = this.bound$.pipe(map((x) => latLngBoundWrapsMap(x)), distinctUntilChanged(), shareReplay(1));
470
512
  this.isWithinBoundFunction$ = this.bound$.pipe(map((x) => isWithinLatLngBoundFunction(x)), shareReplay(1));
471
- this.overlapsBoundFunction$ = this.bound$.pipe(map((x) => overlapsLatLngBoundFunction(x)), shareReplay(1));
513
+ this.overlapsBoundFunction$ = this.virtualBound$.pipe(map((x) => overlapsLatLngBoundFunction(x)), shareReplay(1));
472
514
  this.zoomNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => x.getZoom()))), shareReplay(1))));
473
515
  this.zoom$ = this.whenInitialized$.pipe(switchMap(() => {
474
516
  return this.isZooming$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.zoomNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
@@ -483,25 +525,14 @@ class DbxMapboxMapStore extends ComponentStore {
483
525
  }));
484
526
  this.content$ = this.state$.pipe(map((x) => x.content), distinctUntilChanged(), shareReplay(1));
485
527
  this.hasContent$ = this.content$.pipe(map(Boolean));
486
- this.currentMapCanvasSize$ = this.state$.pipe(map((x) => x.mapCanvasSize), distinctUntilChanged((a, b) => a != null && b != null && vectorsAreEqual(a, b)), shareReplay(1));
487
- this.mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());
488
- this.minimumVirtualViewportSize$ = this.state$.pipe(map((x) => x.minimumVirtualViewportSize), distinctUntilChanged(isSameVector), shareReplay(1));
489
- this.rawViewportBoundFunction$ = this.mapCanvasSize$.pipe(map((x) => mapboxViewportBoundFunction({ mapCanvasSize: x })), shareReplay(1));
490
- this.viewportBoundFunction$ = this.minimumVirtualViewportSize$.pipe(switchMap((minimumSize) => {
491
- if (minimumSize) {
492
- return this.viewportBoundFunctionWithMinimumSize(minimumSize);
493
- }
494
- else {
495
- return this.rawViewportBoundFunction$;
496
- }
497
- }), shareReplay(1));
498
528
  this.clickEvent$ = this.state$.pipe(map((x) => x.clickEvent), distinctUntilChanged(), shareReplay(1));
499
529
  this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent), distinctUntilChanged(), shareReplay(1));
500
530
  this.rightClickEvent$ = this.state$.pipe(map((x) => x.rightClickEvent), distinctUntilChanged(), shareReplay(1));
501
531
  // MARK: State Changes
502
532
  this.setMargin = this.updater((state, margin) => ({ ...state, margin: margin && (margin.rightMargin !== 0 || margin.leftMargin !== 0) ? margin : undefined }));
503
533
  this.setMinimumVirtualViewportSize = this.updater((state, minimumVirtualViewportSize) => ({ ...state, minimumVirtualViewportSize }));
504
- this._setMapService = this.updater((state, mapService) => ({ mapService, moveState: 'init', lifecycleState: 'init', zoomState: 'init', rotateState: 'init', retainContent: state.retainContent, content: state.retainContent ? state.content : undefined }));
534
+ this.setUseVirtualBound = this.updater((state, useVirtualBound) => ({ ...state, useVirtualBound }));
535
+ 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 }));
505
536
  this._setLifecycleState = this.updater((state, lifecycleState) => ({ ...state, lifecycleState }));
506
537
  this._setMoveState = this.updater((state, moveState) => ({ ...state, moveState }));
507
538
  this._setZoomState = this.updater((state, zoomState) => ({ ...state, zoomState }));
@@ -526,7 +557,7 @@ class DbxMapboxMapStore extends ComponentStore {
526
557
  else {
527
558
  return of(0);
528
559
  }
529
- }), shareReplay());
560
+ }), shareReplay(1));
530
561
  }
531
562
  lifecycleRenderTimer(period = this.timerRefreshPeriod) {
532
563
  return this.lifecycleState$.pipe(switchMap((x) => {
@@ -536,7 +567,7 @@ class DbxMapboxMapStore extends ComponentStore {
536
567
  else {
537
568
  return of(0);
538
569
  }
539
- }), shareReplay());
570
+ }), shareReplay(1));
540
571
  }
541
572
  atNextIdle() {
542
573
  return this.moveState$.pipe(map((x) => x === 'idle'), first());
@@ -578,6 +609,10 @@ class DbxMapboxMapStore extends ComponentStore {
578
609
  boundDecisionObs: this.overlapsBoundFunction$
579
610
  });
580
611
  }
612
+ minimumMapCanvasSize(minVector) {
613
+ const resizeFn = vectorMinimumSizeResizeFunction(minVector);
614
+ return this.mapCanvasSize$.pipe(map((x) => resizeFn(x)), distinctUntilChanged(isSameVector), shareReplay(1));
615
+ }
581
616
  /**
582
617
  * Creates a MapboxViewportBoundFunction observable that returns the minimum viewport size.
583
618
  *
@@ -816,6 +851,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
816
851
  this._openToggle = new BehaviorSubject(true);
817
852
  this._color = new BehaviorSubject(undefined);
818
853
  this._toggleSub = new SubscriptionObject();
854
+ this.resized$ = this._resized.asObservable();
819
855
  this.side$ = this._side.pipe(distinctUntilChanged(), shareReplay(1));
820
856
  this.mode$ = this._mode.pipe(distinctUntilChanged(), shareReplay(1));
821
857
  this.hasContent$ = combineLatest([this._forceHasContent, this.dbxMapboxMapStore.hasContent$]).pipe(map(([hasContent, forceHasContent]) => hasContent || forceHasContent), distinctUntilChanged(), shareReplay(1));
@@ -853,12 +889,12 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
853
889
  let obs;
854
890
  if (mode === 'push') {
855
891
  obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(tap(([opened]) => {
856
- let { right } = this.container._contentMargins;
857
- this.container.updateContentMargins();
892
+ let { right } = this.drawerContainer._contentMargins;
893
+ this.drawerContainer.updateContentMargins();
858
894
  setTimeout(() => {
859
895
  const flip = opened ? 1 : -1;
860
896
  if (opened) {
861
- right = this.container._contentMargins.right;
897
+ right = this.drawerContainer._contentMargins.right;
862
898
  }
863
899
  right = (right || 0) * flip;
864
900
  const element = this.content.nativeElement;
@@ -881,7 +917,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
881
917
  }
882
918
  else {
883
919
  obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(switchMap((_) => this.dbxMapboxMapStore.mapInstance$), tap((x) => {
884
- this.container.updateContentMargins();
920
+ this.drawerContainer.updateContentMargins();
885
921
  x.triggerRepaint();
886
922
  }));
887
923
  }
@@ -928,15 +964,18 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
928
964
  this._color.next(color);
929
965
  }
930
966
  onResized(event) {
931
- this._resized.next();
967
+ this._resized.next(event);
932
968
  }
933
969
  }
934
970
  DbxMapboxLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutComponent, deps: [{ token: DbxMapboxMapStore }], target: i0.ɵɵFactoryTarget.Component });
935
- 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" }] });
971
+ 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" }] });
936
972
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutComponent, decorators: [{
937
973
  type: Component,
938
- 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"] }]
939
- }], ctorParameters: function () { return [{ type: DbxMapboxMapStore }]; }, propDecorators: { container: [{
974
+ 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"] }]
975
+ }], ctorParameters: function () { return [{ type: DbxMapboxMapStore }]; }, propDecorators: { containerElement: [{
976
+ type: ViewChild,
977
+ args: [MatDrawerContainer, { read: ElementRef }]
978
+ }], drawerContainer: [{
940
979
  type: ViewChild,
941
980
  args: [MatDrawerContainer]
942
981
  }], content: [{
@@ -1274,8 +1313,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
1274
1313
  type: Input
1275
1314
  }] } });
1276
1315
 
1316
+ /**
1317
+ * Directive that synchronizes a map's virtual size with the size of the element.
1318
+ */
1319
+ class DbxMapboxLayoutVirtualResizeSyncComponent extends SubscriptionObject {
1320
+ constructor(dbxMapboxLayoutComponent) {
1321
+ super();
1322
+ this.dbxMapboxLayoutComponent = dbxMapboxLayoutComponent;
1323
+ this.resizedVector$ = this.dbxMapboxLayoutComponent.resized$.pipe(map(() => {
1324
+ const element = this.dbxMapboxLayoutComponent.containerElement.nativeElement;
1325
+ const { clientWidth, clientHeight } = element;
1326
+ return {
1327
+ x: clientWidth,
1328
+ y: clientHeight
1329
+ };
1330
+ }), distinctUntilChanged(isSameVector), shareReplay(1));
1331
+ }
1332
+ ngOnInit() {
1333
+ this.dbxMapboxLayoutComponent.dbxMapboxMapStore.setMinimumVirtualViewportSize(this.resizedVector$);
1334
+ }
1335
+ }
1336
+ 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 });
1337
+ DbxMapboxLayoutVirtualResizeSyncComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxLayoutVirtualResizeSyncComponent, selector: "[dbxMapboxLayoutVirtualResizeSync]", usesInheritance: true, ngImport: i0 });
1338
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutVirtualResizeSyncComponent, decorators: [{
1339
+ type: Directive,
1340
+ args: [{
1341
+ selector: '[dbxMapboxLayoutVirtualResizeSync]'
1342
+ }]
1343
+ }], ctorParameters: function () { return [{ type: DbxMapboxLayoutComponent, decorators: [{
1344
+ type: Host
1345
+ }] }]; } });
1346
+
1277
1347
  const declarations = [
1278
1348
  //
1349
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1279
1350
  DbxMapboxMapDirective,
1280
1351
  DbxMapboxLayoutComponent,
1281
1352
  DbxMapboxLayoutDrawerComponent,
@@ -1301,6 +1372,7 @@ class DbxMapboxModule {
1301
1372
  DbxMapboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1302
1373
  DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxModule, declarations: [
1303
1374
  //
1375
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1304
1376
  DbxMapboxMapDirective,
1305
1377
  DbxMapboxLayoutComponent,
1306
1378
  DbxMapboxLayoutDrawerComponent,
@@ -1319,6 +1391,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
1319
1391
  DbxRouterAnchorModule,
1320
1392
  NgxMapboxGLModule], exports: [
1321
1393
  //
1394
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1322
1395
  DbxMapboxMapDirective,
1323
1396
  DbxMapboxLayoutComponent,
1324
1397
  DbxMapboxLayoutDrawerComponent,
@@ -1393,5 +1466,5 @@ function mapboxZoomLevel(input) {
1393
1466
  * Generated bundle index. Do not edit.
1394
1467
  */
1395
1468
 
1396
- 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 };
1469
+ 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 };
1397
1470
  //# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map