@dereekb/dbx-web 9.24.18 → 9.24.20

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 (43) hide show
  1. package/calendar/package.json +2 -2
  2. package/esm2020/lib/dbx-web.module.mjs +1 -17
  3. package/esm2020/lib/extension/index.mjs +4 -1
  4. package/esm2020/lib/extension/structure/index.mjs +4 -0
  5. package/esm2020/lib/extension/structure/structure.body.directive.mjs +28 -0
  6. package/esm2020/lib/extension/structure/structure.module.mjs +27 -0
  7. package/esm2020/lib/extension/structure/structure.structure.directive.mjs +23 -0
  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 +66 -11
  13. package/fesm2015/dereekb-dbx-web-mapbox.mjs +114 -19
  14. package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  15. package/fesm2015/dereekb-dbx-web.mjs +103 -47
  16. package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
  17. package/fesm2020/dereekb-dbx-web-mapbox.mjs +112 -19
  18. package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  19. package/fesm2020/dereekb-dbx-web.mjs +101 -47
  20. package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
  21. package/lib/dbx-web.module.d.ts +0 -10
  22. package/lib/extension/index.d.ts +1 -0
  23. package/lib/extension/structure/index.d.ts +3 -0
  24. package/lib/extension/structure/structure.body.directive.d.ts +9 -0
  25. package/lib/extension/structure/structure.module.d.ts +9 -0
  26. package/lib/extension/structure/structure.structure.directive.d.ts +15 -0
  27. package/mapbox/esm2020/lib/index.mjs +2 -1
  28. package/mapbox/esm2020/lib/mapbox.layout.component.mjs +13 -9
  29. package/mapbox/esm2020/lib/mapbox.layout.resize.sync.directive.mjs +38 -0
  30. package/mapbox/esm2020/lib/mapbox.module.mjs +5 -1
  31. package/mapbox/esm2020/lib/mapbox.store.mjs +66 -11
  32. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +114 -19
  33. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  34. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +112 -19
  35. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  36. package/mapbox/lib/index.d.ts +1 -0
  37. package/mapbox/lib/mapbox.layout.component.d.ts +3 -1
  38. package/mapbox/lib/mapbox.layout.resize.sync.directive.d.ts +15 -0
  39. package/mapbox/lib/mapbox.module.d.ts +18 -17
  40. package/mapbox/lib/mapbox.store.d.ts +36 -4
  41. package/mapbox/package.json +3 -3
  42. package/package.json +3 -3
  43. 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, latLngBoundCenterPoint, addLatLngPoints, 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 });
@@ -446,6 +447,38 @@ class DbxMapboxMapStore extends ComponentStore {
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,15 +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.viewportBoundFunction$ = this.mapCanvasSize$.pipe(map((x) => mapboxViewportBoundFunction({ mapCanvasSize: x })), shareReplay(1));
500
539
  this.clickEvent$ = this.state$.pipe(map((x) => x.clickEvent), distinctUntilChanged(), shareReplay(1));
501
540
  this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent), distinctUntilChanged(), shareReplay(1));
502
541
  this.rightClickEvent$ = this.state$.pipe(map((x) => x.rightClickEvent), distinctUntilChanged(), shareReplay(1));
503
542
  // MARK: State Changes
504
543
  this.setMargin = this.updater((state, margin) => (Object.assign(Object.assign({}, state), { margin: margin && (margin.rightMargin !== 0 || margin.leftMargin !== 0) ? margin : undefined })));
505
- this._setMapService = this.updater((state, mapService) => ({ mapService, moveState: 'init', lifecycleState: 'init', zoomState: 'init', rotateState: 'init', retainContent: state.retainContent, content: state.retainContent ? state.content : undefined }));
544
+ this.setMinimumVirtualViewportSize = this.updater((state, minimumVirtualViewportSize) => (Object.assign(Object.assign({}, state), { minimumVirtualViewportSize })));
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 }));
506
547
  this._setLifecycleState = this.updater((state, lifecycleState) => (Object.assign(Object.assign({}, state), { lifecycleState })));
507
548
  this._setMoveState = this.updater((state, moveState) => (Object.assign(Object.assign({}, state), { moveState })));
508
549
  this._setZoomState = this.updater((state, zoomState) => (Object.assign(Object.assign({}, state), { zoomState })));
@@ -575,6 +616,20 @@ class DbxMapboxMapStore extends ComponentStore {
575
616
  const config = typeof input === 'function' ? { readValue: input } : input;
576
617
  return filterByMapboxViewportBound(Object.assign(Object.assign({}, config), { boundFunctionObs: this.viewportBoundFunction$, boundDecisionObs: this.overlapsBoundFunction$ }));
577
618
  }
619
+ minimumMapCanvasSize(minVector) {
620
+ const resizeFn = vectorMinimumSizeResizeFunction(minVector);
621
+ return this.mapCanvasSize$.pipe(map((x) => resizeFn(x)), distinctUntilChanged(isSameVector), shareReplay(1));
622
+ }
623
+ /**
624
+ * Creates a MapboxViewportBoundFunction observable that returns the minimum viewport size.
625
+ *
626
+ * @param minVector
627
+ * @returns
628
+ */
629
+ viewportBoundFunctionWithMinimumSize(minVector) {
630
+ const resizeFn = vectorMinimumSizeResizeFunction(minVector);
631
+ return this.mapCanvasSize$.pipe(map((x) => resizeFn(x)), distinctUntilChanged(isSameVector), map((mapCanvasSize) => mapboxViewportBoundFunction({ mapCanvasSize })), shareReplay(1));
632
+ }
578
633
  }
579
634
  DbxMapboxMapStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore, deps: [{ token: DbxMapboxService }], target: i0.ɵɵFactoryTarget.Injectable });
580
635
  DbxMapboxMapStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore });
@@ -809,6 +864,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
809
864
  this._openToggle = new BehaviorSubject(true);
810
865
  this._color = new BehaviorSubject(undefined);
811
866
  this._toggleSub = new SubscriptionObject();
867
+ this.resized$ = this._resized.asObservable();
812
868
  this.side$ = this._side.pipe(distinctUntilChanged(), shareReplay(1));
813
869
  this.mode$ = this._mode.pipe(distinctUntilChanged(), shareReplay(1));
814
870
  this.hasContent$ = combineLatest([this._forceHasContent, this.dbxMapboxMapStore.hasContent$]).pipe(map(([hasContent, forceHasContent]) => hasContent || forceHasContent), distinctUntilChanged(), shareReplay(1));
@@ -846,12 +902,12 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
846
902
  let obs;
847
903
  if (mode === 'push') {
848
904
  obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(tap(([opened]) => {
849
- let { right } = this.container._contentMargins;
850
- this.container.updateContentMargins();
905
+ let { right } = this.drawerContainer._contentMargins;
906
+ this.drawerContainer.updateContentMargins();
851
907
  setTimeout(() => {
852
908
  const flip = opened ? 1 : -1;
853
909
  if (opened) {
854
- right = this.container._contentMargins.right;
910
+ right = this.drawerContainer._contentMargins.right;
855
911
  }
856
912
  right = (right || 0) * flip;
857
913
  const element = this.content.nativeElement;
@@ -874,7 +930,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
874
930
  }
875
931
  else {
876
932
  obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(switchMap((_) => this.dbxMapboxMapStore.mapInstance$), tap((x) => {
877
- this.container.updateContentMargins();
933
+ this.drawerContainer.updateContentMargins();
878
934
  x.triggerRepaint();
879
935
  }));
880
936
  }
@@ -921,15 +977,18 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
921
977
  this._color.next(color);
922
978
  }
923
979
  onResized(event) {
924
- this._resized.next();
980
+ this._resized.next(event);
925
981
  }
926
982
  }
927
983
  DbxMapboxLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutComponent, deps: [{ token: DbxMapboxMapStore }], target: i0.ɵɵFactoryTarget.Component });
928
- 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" }] });
929
985
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxLayoutComponent, decorators: [{
930
986
  type: Component,
931
- 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"] }]
932
- }], 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: [{
933
992
  type: ViewChild,
934
993
  args: [MatDrawerContainer]
935
994
  }], content: [{
@@ -1278,8 +1337,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
1278
1337
  type: Input
1279
1338
  }] } });
1280
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
+
1281
1373
  const declarations = [
1282
1374
  //
1375
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1283
1376
  DbxMapboxMapDirective,
1284
1377
  DbxMapboxLayoutComponent,
1285
1378
  DbxMapboxLayoutDrawerComponent,
@@ -1305,6 +1398,7 @@ class DbxMapboxModule {
1305
1398
  DbxMapboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1306
1399
  DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxModule, declarations: [
1307
1400
  //
1401
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1308
1402
  DbxMapboxMapDirective,
1309
1403
  DbxMapboxLayoutComponent,
1310
1404
  DbxMapboxLayoutDrawerComponent,
@@ -1325,6 +1419,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
1325
1419
  NgxMapboxGLModule
1326
1420
  ], exports: [
1327
1421
  //
1422
+ DbxMapboxLayoutVirtualResizeSyncComponent,
1328
1423
  DbxMapboxMapDirective,
1329
1424
  DbxMapboxLayoutComponent,
1330
1425
  DbxMapboxLayoutDrawerComponent,
@@ -1401,5 +1496,5 @@ function mapboxZoomLevel(input) {
1401
1496
  * Generated bundle index. Do not edit.
1402
1497
  */
1403
1498
 
1404
- 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 };
1405
1500
  //# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map