@dereekb/dbx-web 9.23.20 → 9.23.22

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 (41) hide show
  1. package/calendar/esm2020/lib/calendar.base.component.mjs +2 -2
  2. package/calendar/esm2020/lib/calendar.store.mjs +8 -3
  3. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs +9 -4
  4. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  5. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs +9 -4
  6. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  7. package/calendar/lib/calendar.store.d.ts +1 -0
  8. package/calendar/package.json +3 -3
  9. package/esm2020/calendar/lib/calendar.base.component.mjs +2 -2
  10. package/esm2020/calendar/lib/calendar.store.mjs +8 -3
  11. package/esm2020/lib/layout/style/style.mjs +7 -1
  12. package/esm2020/lib/router/layout/navbar/navbar.component.mjs +16 -6
  13. package/esm2020/mapbox/lib/mapbox.rxjs.mjs +1 -1
  14. package/esm2020/mapbox/lib/mapbox.store.mjs +10 -1
  15. package/fesm2015/dereekb-dbx-web-calendar.mjs +9 -4
  16. package/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  17. package/fesm2015/dereekb-dbx-web-mapbox.mjs +57 -53
  18. package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  19. package/fesm2015/dereekb-dbx-web.mjs +20 -4
  20. package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
  21. package/fesm2020/dereekb-dbx-web-calendar.mjs +9 -4
  22. package/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  23. package/fesm2020/dereekb-dbx-web-mapbox.mjs +61 -53
  24. package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  25. package/fesm2020/dereekb-dbx-web.mjs +20 -4
  26. package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
  27. package/lib/layout/style/_style.scss +25 -0
  28. package/lib/layout/style/style.d.ts +1 -1
  29. package/lib/layout/text/_text.scss +5 -0
  30. package/lib/router/layout/navbar/navbar.component.d.ts +7 -1
  31. package/mapbox/esm2020/lib/mapbox.rxjs.mjs +1 -1
  32. package/mapbox/esm2020/lib/mapbox.store.mjs +10 -1
  33. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +57 -53
  34. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  35. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +61 -53
  36. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  37. package/mapbox/lib/mapbox.rxjs.d.ts +2 -1
  38. package/mapbox/lib/mapbox.store.d.ts +3 -1
  39. package/mapbox/package.json +3 -3
  40. package/package.json +3 -3
  41. package/table/package.json +3 -3
@@ -2,9 +2,9 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, Host, Optional, Inject, Component, ChangeDetectionStrategy, SkipSelf, Directive, Injector, ElementRef, ViewChild, Input, NgModule } from '@angular/core';
3
3
  import * as i2 from '@dereekb/dbx-core';
4
4
  import { safeMarkForCheck, safeDetectChanges, AbstractSubscriptionDirective, DbxInjectionComponentModule } from '@dereekb/dbx-core';
5
- import { cleanup, filterMaybe, onTrueToFalse, SubscriptionObject, distinctUntilMapHasDifferentKeys, asObservable } from '@dereekb/rxjs';
6
- import { switchMap, NEVER, defaultIfEmpty, map, tap, EMPTY, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval, Subject, merge, throttleTime, BehaviorSubject, combineLatestWith } from 'rxjs';
7
- import { latLngPointFunction, latLngBoundFunction, latLngBoundFromInput, filterUndefinedValues, isSameLatLngPoint, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, diffLatLngBoundPoints, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, vectorsAreEqual, latLngBoundCenterPoint, addLatLngPoints, latLngPoint, DestroyFunctionObject, getValueFromGetter, LAT_LONG_10M_PRECISION, roundNumberToStepFunction } from '@dereekb/util';
5
+ import { asObservable, cleanup, filterMaybe, onTrueToFalse, SubscriptionObject, distinctUntilMapHasDifferentKeys } from '@dereekb/rxjs';
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';
8
8
  import { ComponentStore } from '@ngrx/component-store';
9
9
  import * as MapboxGl from 'mapbox-gl';
10
10
  import { bounds } from '@mapbox/geo-viewport';
@@ -107,6 +107,56 @@ function mapboxViewportBoundFunction(config) {
107
107
  };
108
108
  }
109
109
 
110
+ /**
111
+ * Filters the input objects based on their center and zoom values.
112
+ *
113
+ * This function caches the bounds computations for each of the input values.
114
+ *
115
+ * @param config
116
+ * @returns
117
+ */
118
+ function filterByMapboxViewportBound(config) {
119
+ const { boundDecisionObs: inputBoundDecisionObs, boundFunctionObs: inputBoundFunctionObs, defaultZoom: inputDefaultZoom = 17, readValue, zoomRounding, precision = LAT_LONG_10M_PRECISION } = config;
120
+ const _latLngPoint = latLngPointFunction({ wrap: false, validate: false, precision });
121
+ const _roundZoom = roundNumberToStepFunction(zoomRounding || { step: 0.5, round: 'floor' });
122
+ const boundDecisionObs = asObservable(inputBoundDecisionObs);
123
+ const boundFunctionObs = asObservable(inputBoundFunctionObs);
124
+ return (input) => {
125
+ return boundFunctionObs.pipe(distinctUntilChanged(), switchMap((viewportBoundFunction) => {
126
+ const cache = new Map();
127
+ return input.pipe(map((values) => {
128
+ return values.map((value) => {
129
+ const item = readValue(value);
130
+ const centerLatLng = _latLngPoint(item.center);
131
+ const zoomStep = _roundZoom(item.zoom || inputDefaultZoom);
132
+ const cacheKey = `${zoomStep}_${centerLatLng.lat}_${centerLatLng.lng}`;
133
+ const cachedValue = cache.get(cacheKey);
134
+ let bound;
135
+ if (!cachedValue) {
136
+ bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });
137
+ cache.set(cacheKey, bound);
138
+ }
139
+ else {
140
+ bound = cachedValue;
141
+ }
142
+ return {
143
+ value,
144
+ bound
145
+ };
146
+ });
147
+ }), combineLatestWith(boundDecisionObs), map(([items, boundFunction]) => {
148
+ const valuesInBounds = [];
149
+ items.forEach((item) => {
150
+ if (boundFunction(item.bound)) {
151
+ valuesInBounds.push(item.value);
152
+ }
153
+ });
154
+ return valuesInBounds;
155
+ }));
156
+ }), shareReplay(1));
157
+ };
158
+ }
159
+
110
160
  /**
111
161
  * Store used for retrieving information.
112
162
  */
@@ -521,6 +571,10 @@ class DbxMapboxMapStore extends ComponentStore {
521
571
  return newCenter;
522
572
  }))));
523
573
  }
574
+ filterByViewportBound(input) {
575
+ const config = typeof input === 'function' ? { readValue: input } : input;
576
+ return filterByMapboxViewportBound(Object.assign(Object.assign({}, config), { boundFunctionObs: this.viewportBoundFunction$, boundDecisionObs: this.overlapsBoundFunction$ }));
577
+ }
524
578
  }
525
579
  DbxMapboxMapStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore, deps: [{ token: DbxMapboxService }], target: i0.ɵɵFactoryTarget.Injectable });
526
580
  DbxMapboxMapStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMapStore });
@@ -1326,56 +1380,6 @@ function dbxMapboxColoredDotStyle(background, color) {
1326
1380
  };
1327
1381
  }
1328
1382
 
1329
- /**
1330
- * Filters the input objects based on their center and zoom values.
1331
- *
1332
- * This function caches the bounds computations for each of the input values.
1333
- *
1334
- * @param config
1335
- * @returns
1336
- */
1337
- function filterByMapboxViewportBound(config) {
1338
- const { boundDecisionObs: inputBoundDecisionObs, boundFunctionObs: inputBoundFunctionObs, defaultZoom: inputDefaultZoom = 17, readValue, zoomRounding, precision = LAT_LONG_10M_PRECISION } = config;
1339
- const _latLngPoint = latLngPointFunction({ wrap: false, validate: false, precision });
1340
- const _roundZoom = roundNumberToStepFunction(zoomRounding || { step: 0.5, round: 'floor' });
1341
- const boundDecisionObs = asObservable(inputBoundDecisionObs);
1342
- const boundFunctionObs = asObservable(inputBoundFunctionObs);
1343
- return (input) => {
1344
- return boundFunctionObs.pipe(distinctUntilChanged(), switchMap((viewportBoundFunction) => {
1345
- const cache = new Map();
1346
- return input.pipe(map((values) => {
1347
- return values.map((value) => {
1348
- const item = readValue(value);
1349
- const centerLatLng = _latLngPoint(item.center);
1350
- const zoomStep = _roundZoom(item.zoom || inputDefaultZoom);
1351
- const cacheKey = `${zoomStep}_${centerLatLng.lat}_${centerLatLng.lng}`;
1352
- const cachedValue = cache.get(cacheKey);
1353
- let bound;
1354
- if (!cachedValue) {
1355
- bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });
1356
- cache.set(cacheKey, bound);
1357
- }
1358
- else {
1359
- bound = cachedValue;
1360
- }
1361
- return {
1362
- value,
1363
- bound
1364
- };
1365
- });
1366
- }), combineLatestWith(boundDecisionObs), map(([items, boundFunction]) => {
1367
- const valuesInBounds = [];
1368
- items.forEach((item) => {
1369
- if (boundFunction(item.bound)) {
1370
- valuesInBounds.push(item.value);
1371
- }
1372
- });
1373
- return valuesInBounds;
1374
- }));
1375
- }), shareReplay(1));
1376
- };
1377
- }
1378
-
1379
1383
  const KNOWN_MAPBOX_STYLES = [
1380
1384
  //
1381
1385
  'mapbox://styles/mapbox/streets-v11',