@dereekb/dbx-web 9.23.18 → 9.23.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 (68) hide show
  1. package/calendar/esm2020/lib/calendar.base.component.mjs +4 -3
  2. package/calendar/esm2020/lib/calendar.store.mjs +3 -1
  3. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs +5 -2
  4. package/calendar/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  5. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs +5 -2
  6. package/calendar/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  7. package/calendar/lib/calendar.base.component.d.ts +2 -1
  8. package/calendar/lib/calendar.store.d.ts +1 -0
  9. package/calendar/package.json +3 -2
  10. package/esm2020/calendar/lib/calendar.base.component.mjs +4 -3
  11. package/esm2020/calendar/lib/calendar.store.mjs +3 -1
  12. package/esm2020/lib/layout/text/address.component.mjs +6 -5
  13. package/esm2020/lib/router/layout/anchor/anchor.component.mjs +15 -3
  14. package/esm2020/lib/router/layout/sidenav/index.mjs +3 -1
  15. package/esm2020/lib/router/layout/sidenav/sidenav.button.component.mjs +3 -2
  16. package/esm2020/lib/router/layout/sidenav/sidenav.component.mjs +2 -8
  17. package/esm2020/lib/router/layout/sidenav/sidenav.ifdisplaymode.directive.mjs +42 -0
  18. package/esm2020/lib/router/layout/sidenav/sidenav.mjs +8 -0
  19. package/esm2020/lib/router/layout/sidenav/sidenav.module.mjs +6 -4
  20. package/esm2020/lib/router/layout/sidenav/sidenav.page.component.mjs +3 -2
  21. package/esm2020/mapbox/lib/index.mjs +4 -1
  22. package/esm2020/mapbox/lib/mapbox.injection.component.mjs +32 -0
  23. package/esm2020/mapbox/lib/mapbox.injection.store.mjs +39 -0
  24. package/esm2020/mapbox/lib/mapbox.injection.store.provide.mjs +52 -0
  25. package/esm2020/mapbox/lib/mapbox.marker.component.mjs +6 -6
  26. package/esm2020/mapbox/lib/mapbox.marker.mjs +1 -1
  27. package/esm2020/mapbox/lib/mapbox.module.mjs +5 -1
  28. package/fesm2015/dereekb-dbx-web-calendar.mjs +5 -2
  29. package/fesm2015/dereekb-dbx-web-calendar.mjs.map +1 -1
  30. package/fesm2015/dereekb-dbx-web-mapbox.mjs +122 -9
  31. package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  32. package/fesm2015/dereekb-dbx-web.mjs +81 -30
  33. package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
  34. package/fesm2020/dereekb-dbx-web-calendar.mjs +5 -2
  35. package/fesm2020/dereekb-dbx-web-calendar.mjs.map +1 -1
  36. package/fesm2020/dereekb-dbx-web-mapbox.mjs +118 -8
  37. package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  38. package/fesm2020/dereekb-dbx-web.mjs +72 -23
  39. package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
  40. package/lib/router/layout/anchor/anchor.component.d.ts +2 -0
  41. package/lib/router/layout/sidenav/_sidenav.scss +4 -1
  42. package/lib/router/layout/sidenav/index.d.ts +2 -0
  43. package/lib/router/layout/sidenav/sidenav.button.component.d.ts +2 -1
  44. package/lib/router/layout/sidenav/sidenav.component.d.ts +1 -6
  45. package/lib/router/layout/sidenav/sidenav.d.ts +6 -0
  46. package/lib/router/layout/sidenav/sidenav.ifdisplaymode.directive.d.ts +20 -0
  47. package/lib/router/layout/sidenav/sidenav.module.d.ts +19 -18
  48. package/mapbox/esm2020/lib/index.mjs +4 -1
  49. package/mapbox/esm2020/lib/mapbox.injection.component.mjs +32 -0
  50. package/mapbox/esm2020/lib/mapbox.injection.store.mjs +39 -0
  51. package/mapbox/esm2020/lib/mapbox.injection.store.provide.mjs +52 -0
  52. package/mapbox/esm2020/lib/mapbox.marker.component.mjs +6 -6
  53. package/mapbox/esm2020/lib/mapbox.marker.mjs +1 -1
  54. package/mapbox/esm2020/lib/mapbox.module.mjs +5 -1
  55. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +122 -9
  56. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  57. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +118 -8
  58. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  59. package/mapbox/lib/index.d.ts +3 -0
  60. package/mapbox/lib/mapbox.injection.component.d.ts +16 -0
  61. package/mapbox/lib/mapbox.injection.store.d.ts +45 -0
  62. package/mapbox/lib/mapbox.injection.store.provide.d.ts +24 -0
  63. package/mapbox/lib/mapbox.marker.component.d.ts +3 -2
  64. package/mapbox/lib/mapbox.marker.d.ts +4 -3
  65. package/mapbox/lib/mapbox.module.d.ts +14 -13
  66. package/mapbox/package.json +3 -3
  67. package/package.json +3 -3
  68. package/table/package.json +3 -3
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Host, Optional, Inject, Directive, Component, ElementRef, ViewChild, Input, ChangeDetectionStrategy, SkipSelf, Injector, NgModule } from '@angular/core';
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, asObservable } from '@dereekb/rxjs';
5
+ import { cleanup, filterMaybe, onTrueToFalse, SubscriptionObject, distinctUntilMapHasDifferentKeys, asObservable } from '@dereekb/rxjs';
6
6
  import { switchMap, NEVER, defaultIfEmpty, map, tap, EMPTY, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval, Subject, merge, throttleTime, BehaviorSubject, combineLatestWith } from 'rxjs';
7
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';
8
8
  import { ComponentStore } from '@ngrx/component-store';
@@ -570,6 +570,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
570
570
  }]
571
571
  }], ctorParameters: function () { return [{ type: DbxMapboxMapStore }]; } });
572
572
 
573
+ /**
574
+ * Store used for storing injectable content into the map.
575
+ */
576
+ class DbxMapboxInjectionStore extends ComponentStore {
577
+ constructor() {
578
+ super({
579
+ map: new Map()
580
+ });
581
+ this.map$ = this.state$.pipe(map((x) => x.map), distinctUntilMapHasDifferentKeys(), shareReplay(1));
582
+ this.allInjectionConfigs$ = this.map$.pipe(map((x) => Array.from(x.values())), shareReplay(1));
583
+ // MARK: State Changes
584
+ this.addInjectionConfig = this.updater(updateDbxMapboxMapInjectionStoreStateWithInjectionConfig);
585
+ this.removeInjectionConfigWithKey = this.updater(updateDbxMapboxMapInjectionStoreStateWithRemovedKey);
586
+ }
587
+ }
588
+ DbxMapboxInjectionStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
589
+ DbxMapboxInjectionStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStore });
590
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStore, decorators: [{
591
+ type: Injectable
592
+ }], ctorParameters: function () { return []; } });
593
+ function updateDbxMapboxMapInjectionStoreStateWithInjectionConfig(state, config) {
594
+ const map = new Map(state.map).set(config.key, config);
595
+ return Object.assign(Object.assign({}, state), { map });
596
+ }
597
+ function updateDbxMapboxMapInjectionStoreStateWithRemovedKey(state, key) {
598
+ // only create a new state if the key is going to get removed
599
+ if (state.map.has(key)) {
600
+ const map = new Map(state.map);
601
+ map.delete(key);
602
+ state = Object.assign(Object.assign({}, state), { map });
603
+ }
604
+ return state;
605
+ }
606
+
607
+ /**
608
+ * Injects the components configured in the DbxMapboxInjectionStore into the view.
609
+ */
610
+ class DbxMapboxInjectionComponent {
611
+ constructor(dbxMapboxMapKeyInjectionStore, injector) {
612
+ this.dbxMapboxMapKeyInjectionStore = dbxMapboxMapKeyInjectionStore;
613
+ this.injector = injector;
614
+ this.entries$ = this.dbxMapboxMapKeyInjectionStore.allInjectionConfigs$.pipe(shareReplay(1));
615
+ }
616
+ }
617
+ DbxMapboxInjectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionComponent, deps: [{ token: DbxMapboxInjectionStore }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
618
+ DbxMapboxInjectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxInjectionComponent, selector: "dbx-mapbox-injection", ngImport: i0, template: `
619
+ <dbx-injection-array [entries]="entries$ | async"></dbx-injection-array>
620
+ `, isInline: true, dependencies: [{ kind: "component", type: i2.DbxInjectionArrayComponent, selector: "dbx-injection-array", inputs: ["entries"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
621
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionComponent, decorators: [{
622
+ type: Component,
623
+ args: [{
624
+ selector: 'dbx-mapbox-injection',
625
+ template: `
626
+ <dbx-injection-array [entries]="entries$ | async"></dbx-injection-array>
627
+ `,
628
+ changeDetection: ChangeDetectionStrategy.OnPush
629
+ }]
630
+ }], ctorParameters: function () { return [{ type: DbxMapboxInjectionStore }, { type: i0.Injector }]; } });
631
+
632
+ /**
633
+ * Token used by provideMapboxInjectionStoreIfDoesNotExist() to prevent injecting a parent DbxMapboxInjectionStore into the child view.
634
+ */
635
+ class DbxMapboxInjectionStoreProviderBlock {
636
+ constructor(dbxMapboxInjectionStore) {
637
+ this.dbxMapboxInjectionStore = dbxMapboxInjectionStore;
638
+ }
639
+ }
640
+ DbxMapboxInjectionStoreProviderBlock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStoreProviderBlock, deps: [{ token: DbxMapboxInjectionStore, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
641
+ DbxMapboxInjectionStoreProviderBlock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStoreProviderBlock });
642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStoreProviderBlock, decorators: [{
643
+ type: Injectable
644
+ }], ctorParameters: function () {
645
+ return [{ type: DbxMapboxInjectionStore, decorators: [{
646
+ type: SkipSelf
647
+ }] }];
648
+ } });
649
+ class DbxMapboxInjectionStoreInjectionBlockDirective {
650
+ }
651
+ DbxMapboxInjectionStoreInjectionBlockDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStoreInjectionBlockDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
652
+ DbxMapboxInjectionStoreInjectionBlockDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxInjectionStoreInjectionBlockDirective, selector: "[dbxMapboxInjectionStoreParentBlocker]", providers: [DbxMapboxInjectionStoreProviderBlock], ngImport: i0 });
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxInjectionStoreInjectionBlockDirective, decorators: [{
654
+ type: Directive,
655
+ args: [{
656
+ selector: '[dbxMapboxInjectionStoreParentBlocker]',
657
+ providers: [DbxMapboxInjectionStoreProviderBlock]
658
+ }]
659
+ }] });
660
+ /**
661
+ * Creates a Provider that initializes a new DbxMapboxInjectionStore if a parent does not exist.
662
+ *
663
+ * If a DbxMapboxInjectionStoreInjectionBlock is available in the context, and references the same dbxMapboxInjectionStore that is attempting to be injected, a new DbxMapboxInjectionStore is created.
664
+ *
665
+ * @returns
666
+ */
667
+ function provideMapboxInjectionStoreIfParentIsUnavailable() {
668
+ return {
669
+ provide: DbxMapboxInjectionStore,
670
+ useFactory: (parentInjector, dbxMapboxInjectionStoreInjectionBlock, dbxMapboxInjectionStore) => {
671
+ if (!dbxMapboxInjectionStore || (dbxMapboxInjectionStore && dbxMapboxInjectionStoreInjectionBlock != null && dbxMapboxInjectionStoreInjectionBlock.dbxMapboxInjectionStore === dbxMapboxInjectionStore)) {
672
+ // create a new dbxMapboxInjectionStore to use
673
+ const injector = Injector.create({ providers: [{ provide: DbxMapboxInjectionStore }], parent: parentInjector });
674
+ dbxMapboxInjectionStore = injector.get(DbxMapboxInjectionStore);
675
+ }
676
+ return dbxMapboxInjectionStore;
677
+ },
678
+ deps: [Injector, [new Optional(), DbxMapboxInjectionStoreProviderBlock], [new Optional(), new SkipSelf(), DbxMapboxInjectionStore]]
679
+ };
680
+ }
681
+
573
682
  /**
574
683
  * Directive that configures a MapComponent with content from DbxMapboxService. Connects a host MapService to a parent DbxMapboxMapStore if available.
575
684
  */
@@ -994,12 +1103,13 @@ class DbxMapboxMarkerComponent {
994
1103
  return style;
995
1104
  }
996
1105
  get presentation() {
997
- var _a;
998
- return (_a = this._marker.presentation) !== null && _a !== void 0 ? _a : 'normal';
1106
+ var _a, _b;
1107
+ return (_b = (_a = this._marker) === null || _a === void 0 ? void 0 : _a.presentation) !== null && _b !== void 0 ? _b : 'normal';
999
1108
  }
1000
1109
  get presentationClasses() {
1110
+ var _a;
1001
1111
  const presentation = this.presentation;
1002
- const markerClasses = this._marker.markerClasses;
1112
+ const markerClasses = (_a = this._marker) === null || _a === void 0 ? void 0 : _a.markerClasses;
1003
1113
  let cssClasses = '';
1004
1114
  switch (presentation) {
1005
1115
  case 'chip':
@@ -1014,7 +1124,7 @@ class DbxMapboxMarkerComponent {
1014
1124
  cssClasses += ' dbx-mapbox-marker-no-icon';
1015
1125
  }
1016
1126
  if (markerClasses) {
1017
- cssClasses += ` markerClasses`;
1127
+ cssClasses += ` ${markerClasses}`;
1018
1128
  }
1019
1129
  return cssClasses;
1020
1130
  }
@@ -1026,7 +1136,7 @@ class DbxMapboxMarkerComponent {
1026
1136
  DbxMapboxMarkerComponent._latLngPoint = latLngPointFunction({ wrap: true });
1027
1137
  DbxMapboxMarkerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMarkerComponent, deps: [{ token: DbxMapboxChangeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1028
1138
  DbxMapboxMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: { marker: "marker" }, ngImport: i0, template: `
1029
- <mgl-marker [lngLat]="latLng">
1139
+ <mgl-marker *ngIf="marker" [lngLat]="latLng">
1030
1140
  <dbx-anchor [anchor]="anchor">
1031
1141
  <div class="dbx-mapbox-marker" [ngClass]="presentationClasses">
1032
1142
  <div class="dbx-mapbox-marker-icon-content" [ngStyle]="style">
@@ -1040,7 +1150,7 @@ DbxMapboxMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0
1040
1150
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMarkerComponent, decorators: [{
1041
1151
  type: Component,
1042
1152
  args: [{ selector: 'dbx-mapbox-marker', template: `
1043
- <mgl-marker [lngLat]="latLng">
1153
+ <mgl-marker *ngIf="marker" [lngLat]="latLng">
1044
1154
  <dbx-anchor [anchor]="anchor">
1045
1155
  <div class="dbx-mapbox-marker" [ngClass]="presentationClasses">
1046
1156
  <div class="dbx-mapbox-marker-icon-content" [ngStyle]="style">
@@ -1119,6 +1229,7 @@ const declarations = [
1119
1229
  DbxMapboxMapDirective,
1120
1230
  DbxMapboxLayoutComponent,
1121
1231
  DbxMapboxLayoutDrawerComponent,
1232
+ DbxMapboxInjectionComponent,
1122
1233
  DbxMapboxMenuComponent,
1123
1234
  DbxMapboxMarkerComponent,
1124
1235
  DbxMapboxMarkersComponent,
@@ -1143,6 +1254,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
1143
1254
  DbxMapboxMapDirective,
1144
1255
  DbxMapboxLayoutComponent,
1145
1256
  DbxMapboxLayoutDrawerComponent,
1257
+ DbxMapboxInjectionComponent,
1146
1258
  DbxMapboxMenuComponent,
1147
1259
  DbxMapboxMarkerComponent,
1148
1260
  DbxMapboxMarkersComponent,
@@ -1162,6 +1274,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
1162
1274
  DbxMapboxMapDirective,
1163
1275
  DbxMapboxLayoutComponent,
1164
1276
  DbxMapboxLayoutDrawerComponent,
1277
+ DbxMapboxInjectionComponent,
1165
1278
  DbxMapboxMenuComponent,
1166
1279
  DbxMapboxMarkerComponent,
1167
1280
  DbxMapboxMarkersComponent,
@@ -1284,5 +1397,5 @@ function mapboxZoomLevel(input) {
1284
1397
  * Generated bundle index. Do not edit.
1285
1398
  */
1286
1399
 
1287
- export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxChangeDetectorRefService, DbxMapboxChangeService, DbxMapboxConfig, 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, provideMapboxStoreIfParentIsUnavailable };
1400
+ 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 };
1288
1401
  //# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map