@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.
- package/calendar/package.json +2 -2
- package/esm2020/lib/dbx-web.module.mjs +1 -17
- package/esm2020/lib/extension/index.mjs +4 -1
- package/esm2020/lib/extension/structure/index.mjs +4 -0
- package/esm2020/lib/extension/structure/structure.body.directive.mjs +28 -0
- package/esm2020/lib/extension/structure/structure.module.mjs +27 -0
- package/esm2020/lib/extension/structure/structure.structure.directive.mjs +23 -0
- package/esm2020/mapbox/lib/mapbox.store.mjs +23 -3
- package/fesm2015/dereekb-dbx-web-mapbox.mjs +22 -2
- package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/fesm2015/dereekb-dbx-web.mjs +103 -47
- package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-web-mapbox.mjs +22 -2
- package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-web.mjs +101 -47
- package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
- package/lib/dbx-web.module.d.ts +0 -10
- package/lib/extension/index.d.ts +1 -0
- package/lib/extension/structure/index.d.ts +3 -0
- package/lib/extension/structure/structure.body.directive.d.ts +9 -0
- package/lib/extension/structure/structure.module.d.ts +9 -0
- package/lib/extension/structure/structure.structure.directive.d.ts +15 -0
- package/mapbox/esm2020/lib/mapbox.store.mjs +23 -3
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +22 -2
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +22 -2
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/mapbox/lib/mapbox.store.d.ts +14 -0
- package/mapbox/package.json +3 -3
- package/package.json +3 -3
- 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.
|
|
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 });
|