@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';
@@ -496,12 +496,22 @@ class DbxMapboxMapStore extends ComponentStore {
496
496
  this.hasContent$ = this.content$.pipe(map(Boolean));
497
497
  this.currentMapCanvasSize$ = this.state$.pipe(map((x) => x.mapCanvasSize), distinctUntilChanged((a, b) => a != null && b != null && vectorsAreEqual(a, b)), shareReplay(1));
498
498
  this.mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());
499
- this.viewportBoundFunction$ = this.mapCanvasSize$.pipe(map((x) => mapboxViewportBoundFunction({ mapCanvasSize: x })), shareReplay(1));
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));
500
509
  this.clickEvent$ = this.state$.pipe(map((x) => x.clickEvent), distinctUntilChanged(), shareReplay(1));
501
510
  this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent), distinctUntilChanged(), shareReplay(1));
502
511
  this.rightClickEvent$ = this.state$.pipe(map((x) => x.rightClickEvent), distinctUntilChanged(), shareReplay(1));
503
512
  // MARK: State Changes
504
513
  this.setMargin = this.updater((state, margin) => (Object.assign(Object.assign({}, state), { margin: margin && (margin.rightMargin !== 0 || margin.leftMargin !== 0) ? margin : undefined })));
514
+ this.setMinimumVirtualViewportSize = this.updater((state, minimumVirtualViewportSize) => (Object.assign(Object.assign({}, state), { minimumVirtualViewportSize })));
505
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 }));
506
516
  this._setLifecycleState = this.updater((state, lifecycleState) => (Object.assign(Object.assign({}, state), { lifecycleState })));
507
517
  this._setMoveState = this.updater((state, moveState) => (Object.assign(Object.assign({}, state), { moveState })));
@@ -575,6 +585,16 @@ class DbxMapboxMapStore extends ComponentStore {
575
585
  const config = typeof input === 'function' ? { readValue: input } : input;
576
586
  return filterByMapboxViewportBound(Object.assign(Object.assign({}, config), { boundFunctionObs: this.viewportBoundFunction$, boundDecisionObs: this.overlapsBoundFunction$ }));
577
587
  }
588
+ /**
589
+ * Creates a MapboxViewportBoundFunction observable that returns the minimum viewport size.
590
+ *
591
+ * @param minVector
592
+ * @returns
593
+ */
594
+ viewportBoundFunctionWithMinimumSize(minVector) {
595
+ const resizeFn = vectorMinimumSizeResizeFunction(minVector);
596
+ return this.mapCanvasSize$.pipe(map((x) => resizeFn(x)), distinctUntilChanged(isSameVector), map((mapCanvasSize) => mapboxViewportBoundFunction({ mapCanvasSize })), shareReplay(1));
597
+ }
578
598
  }
579
599
  DbxMapboxMapStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore, deps: [{ token: DbxMapboxService }], target: i0.ɵɵFactoryTarget.Injectable });
580
600
  DbxMapboxMapStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore });