@dereekb/dbx-web 9.24.18 → 9.24.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/calendar/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/mapbox.store.mjs +23 -3
  9. package/fesm2015/dereekb-dbx-web-mapbox.mjs +22 -2
  10. package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  11. package/fesm2015/dereekb-dbx-web.mjs +103 -47
  12. package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
  13. package/fesm2020/dereekb-dbx-web-mapbox.mjs +22 -2
  14. package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  15. package/fesm2020/dereekb-dbx-web.mjs +101 -47
  16. package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
  17. package/lib/dbx-web.module.d.ts +0 -10
  18. package/lib/extension/index.d.ts +1 -0
  19. package/lib/extension/structure/index.d.ts +3 -0
  20. package/lib/extension/structure/structure.body.directive.d.ts +9 -0
  21. package/lib/extension/structure/structure.module.d.ts +9 -0
  22. package/lib/extension/structure/structure.structure.directive.d.ts +15 -0
  23. package/mapbox/esm2020/lib/mapbox.store.mjs +23 -3
  24. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +22 -2
  25. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  26. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +22 -2
  27. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  28. package/mapbox/lib/mapbox.store.d.ts +14 -0
  29. package/mapbox/package.json +3 -3
  30. package/package.json +3 -3
  31. 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, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, diffLatLngBoundPoints, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, vectorsAreEqual, isSameVector, 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';
@@ -485,12 +485,22 @@ class DbxMapboxMapStore extends ComponentStore {
485
485
  this.hasContent$ = this.content$.pipe(map(Boolean));
486
486
  this.currentMapCanvasSize$ = this.state$.pipe(map((x) => x.mapCanvasSize), distinctUntilChanged((a, b) => a != null && b != null && vectorsAreEqual(a, b)), shareReplay(1));
487
487
  this.mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());
488
- this.viewportBoundFunction$ = this.mapCanvasSize$.pipe(map((x) => mapboxViewportBoundFunction({ mapCanvasSize: x })), shareReplay(1));
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));
489
498
  this.clickEvent$ = this.state$.pipe(map((x) => x.clickEvent), distinctUntilChanged(), shareReplay(1));
490
499
  this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent), distinctUntilChanged(), shareReplay(1));
491
500
  this.rightClickEvent$ = this.state$.pipe(map((x) => x.rightClickEvent), distinctUntilChanged(), shareReplay(1));
492
501
  // MARK: State Changes
493
502
  this.setMargin = this.updater((state, margin) => ({ ...state, margin: margin && (margin.rightMargin !== 0 || margin.leftMargin !== 0) ? margin : undefined }));
503
+ this.setMinimumVirtualViewportSize = this.updater((state, minimumVirtualViewportSize) => ({ ...state, minimumVirtualViewportSize }));
494
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 }));
495
505
  this._setLifecycleState = this.updater((state, lifecycleState) => ({ ...state, lifecycleState }));
496
506
  this._setMoveState = this.updater((state, moveState) => ({ ...state, moveState }));
@@ -568,6 +578,16 @@ class DbxMapboxMapStore extends ComponentStore {
568
578
  boundDecisionObs: this.overlapsBoundFunction$
569
579
  });
570
580
  }
581
+ /**
582
+ * Creates a MapboxViewportBoundFunction observable that returns the minimum viewport size.
583
+ *
584
+ * @param minVector
585
+ * @returns
586
+ */
587
+ viewportBoundFunctionWithMinimumSize(minVector) {
588
+ const resizeFn = vectorMinimumSizeResizeFunction(minVector);
589
+ return this.mapCanvasSize$.pipe(map((x) => resizeFn(x)), distinctUntilChanged(isSameVector), map((mapCanvasSize) => mapboxViewportBoundFunction({ mapCanvasSize })), shareReplay(1));
590
+ }
571
591
  }
572
592
  DbxMapboxMapStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore, deps: [{ token: DbxMapboxService }], target: i0.ɵɵFactoryTarget.Injectable });
573
593
  DbxMapboxMapStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore });