@dereekb/dbx-web 9.5.3 → 9.6.0

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.
@@ -0,0 +1,52 @@
1
+ import { Directive, Injectable, Injector, Optional, SkipSelf } from '@angular/core';
2
+ import { DbxMapboxMapStore } from './mapbox.store';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./mapbox.store";
5
+ /**
6
+ * Token used by provideMapboxStoreIfDoesNotExist() to prevent injecting a parent DbxMapboxMapStore into the child view.
7
+ */
8
+ export class DbxMapboxMapStoreProviderBlock {
9
+ constructor(dbxMapboxMapStore) {
10
+ this.dbxMapboxMapStore = dbxMapboxMapStore;
11
+ }
12
+ }
13
+ DbxMapboxMapStoreProviderBlock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreProviderBlock, deps: [{ token: i1.DbxMapboxMapStore, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
14
+ DbxMapboxMapStoreProviderBlock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreProviderBlock });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreProviderBlock, decorators: [{
16
+ type: Injectable
17
+ }], ctorParameters: function () { return [{ type: i1.DbxMapboxMapStore, decorators: [{
18
+ type: SkipSelf
19
+ }] }]; } });
20
+ export class DbxMapboxMapStoreInjectionBlockDirective {
21
+ }
22
+ DbxMapboxMapStoreInjectionBlockDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreInjectionBlockDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
23
+ DbxMapboxMapStoreInjectionBlockDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxMapStoreInjectionBlockDirective, selector: "[dbxMapboxStoreParentBlocker]", providers: [DbxMapboxMapStoreProviderBlock], ngImport: i0 });
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreInjectionBlockDirective, decorators: [{
25
+ type: Directive,
26
+ args: [{
27
+ selector: '[dbxMapboxStoreParentBlocker]',
28
+ providers: [DbxMapboxMapStoreProviderBlock]
29
+ }]
30
+ }] });
31
+ /**
32
+ * Creates a Provider that initializes a new DbxMapboxMapStore if a parent does not exist.
33
+ *
34
+ * If a DbxMapboxMapStoreInjectionBlock is available in the context, and references the same dbxMapboxMapStore that is attempting to be injected, a new DbxMapboxMapStore is created.
35
+ *
36
+ * @returns
37
+ */
38
+ export function provideMapboxStoreIfParentIsUnavailable() {
39
+ return {
40
+ provide: DbxMapboxMapStore,
41
+ useFactory: (parentInjector, dbxMapboxMapStoreInjectionBlock, dbxMapboxMapStore) => {
42
+ if (!dbxMapboxMapStore || (dbxMapboxMapStore && dbxMapboxMapStoreInjectionBlock != null && dbxMapboxMapStoreInjectionBlock.dbxMapboxMapStore === dbxMapboxMapStore)) {
43
+ // create a new dbxMapboxMapStore to use
44
+ const injector = Injector.create({ providers: [{ provide: DbxMapboxMapStore }], parent: parentInjector });
45
+ dbxMapboxMapStore = injector.get(DbxMapboxMapStore);
46
+ }
47
+ return dbxMapboxMapStore;
48
+ },
49
+ deps: [Injector, [new Optional(), DbxMapboxMapStoreProviderBlock], [new Optional(), new SkipSelf(), DbxMapboxMapStore]]
50
+ };
51
+ }
52
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFwYm94LnN0b3JlLnByb3ZpZGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9kYngtd2ViL21hcGJveC9zcmMvbGliL21hcGJveC5zdG9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ib3hNYXBTdG9yZUluamVjdGlvbkJsb2NrICE9IG51bGwgJiYgZGJ4TWFwYm94TWFwU3RvcmVJbmplY3Rpb25CbG9jay5kYnhNYXBib3hNYXBTdG9yZSA9PT0gZGJ4TWFwYm94TWFwU3RvcmUpKSB7XG4gICAgICAgIC8vIGNyZWF0ZSBhIG5ldyBkYnhNYXBib3hNYXBTdG9yZSB0byB1c2VcbiAgICAgICAgY29uc3QgaW5qZWN0b3IgPSBJbmplY3Rvci5jcmVhdGUoeyBwcm92aWRlcnM6IFt7IHByb3ZpZGU6IERieE1hcGJveE1hcFN0b3JlIH1dLCBwYXJlbnQ6IHBhcmVudEluamVjdG9yIH0pO1xuICAgICAgICBkYnhNYXBib3hNYXBTdG9yZSA9IGluamVjdG9yLmdldChEYnhNYXBib3hNYXBTdG9yZSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBkYnhNYXBib3hNYXBTdG9yZTtcbiAgICB9LFxuICAgIGRlcHM6IFtJbmplY3RvciwgW25ldyBPcHRpb25hbCgpLCBEYnhNYXBib3hNYXBTdG9yZVByb3ZpZGVyQmxvY2tdLCBbbmV3IE9wdGlvbmFsKCksIG5ldyBTa2lwU2VsZigpLCBEYnhNYXBib3hNYXBTdG9yZV1dXG4gIH07XG59XG4iXX0=
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Optional, Inject, Directive, Host, Component, ElementRef, ViewChild, Input, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
+ import { Injectable, Optional, Inject, Directive, Host, Component, ElementRef, ViewChild, Input, ChangeDetectionStrategy, SkipSelf, Injector, NgModule } from '@angular/core';
3
3
  import * as i2$1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { latLngPointFunction, latLngBoundFunction, isSameLatLngPoint, isSameLatLngBound, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, diffLatLngBoundPoints, latLngBoundCenterPoint, addLatLngPoints, latLngPoint, DestroyFunctionObject } from '@dereekb/util';
@@ -160,6 +160,56 @@ class DbxMapboxMapStore extends ComponentStore {
160
160
  return this.mapInstance$.pipe(tap((map) => map.setMaxZoom(zoom)));
161
161
  }));
162
162
  });
163
+ this.setKeyboardDisabled = this.effect((input) => {
164
+ return input.pipe(switchMap((disabled) => {
165
+ return this.mapInstance$.pipe(tap((map) => {
166
+ if (disabled === false) {
167
+ map.keyboard.enable();
168
+ }
169
+ else {
170
+ map.keyboard.disable();
171
+ }
172
+ }));
173
+ }));
174
+ });
175
+ this.setDragRotateDisabled = this.effect((input) => {
176
+ return input.pipe(switchMap((disabled) => {
177
+ return this.mapInstance$.pipe(tap((map) => {
178
+ if (disabled === false) {
179
+ map.dragRotate.enable();
180
+ }
181
+ else {
182
+ map.dragRotate.disable();
183
+ }
184
+ }));
185
+ }));
186
+ });
187
+ this.setDragPanDisabled = this.effect((input) => {
188
+ return input.pipe(switchMap((disabled) => {
189
+ return this.mapInstance$.pipe(tap((map) => {
190
+ if (disabled === false) {
191
+ map.dragPan.enable();
192
+ }
193
+ else {
194
+ map.dragPan.disable();
195
+ }
196
+ }));
197
+ }));
198
+ });
199
+ this.setZoomDisabled = this.effect((input) => {
200
+ return input.pipe(switchMap((disabled) => {
201
+ return this.mapInstance$.pipe(tap((map) => {
202
+ if (disabled === false) {
203
+ map.scrollZoom.enable();
204
+ map.doubleClickZoom.enable();
205
+ }
206
+ else {
207
+ map.scrollZoom.disable();
208
+ map.doubleClickZoom.disable();
209
+ }
210
+ }));
211
+ }));
212
+ });
163
213
  this.setPitch = this.effect((input) => {
164
214
  return input.pipe(switchMap((pitch) => {
165
215
  return this.mapInstance$.pipe(tap((map) => map.setPitch(pitch)));
@@ -450,12 +500,14 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
450
500
  this.dbxMapboxMapStore = dbxMapboxMapStore;
451
501
  this._resized = new Subject();
452
502
  this._updateMargins = new Subject();
503
+ this._forceHasContent = new BehaviorSubject(false);
453
504
  this._side = new BehaviorSubject('right');
454
505
  this._openToggle = new BehaviorSubject(true);
455
506
  this._color = new BehaviorSubject(undefined);
456
507
  this._toggleSub = new SubscriptionObject();
457
508
  this.side$ = this._side.pipe(distinctUntilChanged(), shareReplay(1));
458
- this.opened$ = combineLatest([this.dbxMapboxMapStore.hasContent$, this._openToggle]).pipe(map(([hasContent, open]) => hasContent && open), distinctUntilChanged(), shareReplay(1));
509
+ this.hasContent$ = combineLatest([this._forceHasContent, this.dbxMapboxMapStore.hasContent$]).pipe(map(([hasContent, forceHasContent]) => hasContent || forceHasContent), distinctUntilChanged(), shareReplay(1));
510
+ this.opened$ = combineLatest([this.hasContent$, this._openToggle]).pipe(map(([hasContent, open]) => hasContent && open), distinctUntilChanged(), shareReplay(1));
459
511
  this.position$ = this.side$.pipe(map((x) => (x === 'right' ? 'end' : 'start')), distinctUntilChanged(), shareReplay(1));
460
512
  this.drawerClasses$ = combineLatest([this.side$, this.dbxMapboxMapStore.hasContent$, this.opened$]).pipe(
461
513
  //
@@ -512,6 +564,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
512
564
  this._openToggle.complete();
513
565
  this._color.complete();
514
566
  this._toggleSub.destroy();
567
+ this._forceHasContent.complete();
515
568
  }
516
569
  toggleDrawer(open) {
517
570
  if (open == null) {
@@ -529,6 +582,11 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
529
582
  this._openToggle.next(opened);
530
583
  }
531
584
  }
585
+ set hasContent(hasContent) {
586
+ if (hasContent != null) {
587
+ this._forceHasContent.next(hasContent);
588
+ }
589
+ }
532
590
  set drawerColor(color) {
533
591
  this._color.next(color);
534
592
  }
@@ -537,10 +595,10 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
537
595
  }
538
596
  }
539
597
  DbxMapboxLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutComponent, deps: [{ token: DbxMapboxMapStore }], target: i0.ɵɵFactoryTarget.Component });
540
- DbxMapboxLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxLayoutComponent, selector: "dbx-mapbox-layout", inputs: { side: "side", opened: "opened", drawerColor: "drawerColor" }, viewQueries: [{ propertyName: "container", first: true, predicate: MatDrawerContainer, descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" mode=\"push\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i3.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i3.MatDrawerContent, selector: "mat-drawer-content" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: DbxMapboxLayoutDrawerComponent, selector: "dbx-mapbox-layout-drawer" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }] });
598
+ DbxMapboxLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxLayoutComponent, selector: "dbx-mapbox-layout", inputs: { side: "side", opened: "opened", hasContent: "hasContent", drawerColor: "drawerColor" }, viewQueries: [{ propertyName: "container", first: true, predicate: MatDrawerContainer, descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" mode=\"push\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i3.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i3.MatDrawerContent, selector: "mat-drawer-content" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: DbxMapboxLayoutDrawerComponent, selector: "dbx-mapbox-layout-drawer" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }] });
541
599
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutComponent, decorators: [{
542
600
  type: Component,
543
- args: [{ selector: 'dbx-mapbox-layout', template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" mode=\"push\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"] }]
601
+ args: [{ selector: 'dbx-mapbox-layout', template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" mode=\"push\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"] }]
544
602
  }], ctorParameters: function () { return [{ type: DbxMapboxMapStore }]; }, propDecorators: { container: [{
545
603
  type: ViewChild,
546
604
  args: [MatDrawerContainer]
@@ -551,6 +609,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
551
609
  type: Input
552
610
  }], opened: [{
553
611
  type: Input
612
+ }], hasContent: [{
613
+ type: Input
554
614
  }], drawerColor: [{
555
615
  type: Input
556
616
  }] } });
@@ -645,12 +705,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
645
705
  args: ['dbxMapboxMenu']
646
706
  }] } });
647
707
 
708
+ /**
709
+ * Token used by provideMapboxStoreIfDoesNotExist() to prevent injecting a parent DbxMapboxMapStore into the child view.
710
+ */
711
+ class DbxMapboxMapStoreProviderBlock {
712
+ constructor(dbxMapboxMapStore) {
713
+ this.dbxMapboxMapStore = dbxMapboxMapStore;
714
+ }
715
+ }
716
+ DbxMapboxMapStoreProviderBlock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreProviderBlock, deps: [{ token: DbxMapboxMapStore, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
717
+ DbxMapboxMapStoreProviderBlock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreProviderBlock });
718
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreProviderBlock, decorators: [{
719
+ type: Injectable
720
+ }], ctorParameters: function () {
721
+ return [{ type: DbxMapboxMapStore, decorators: [{
722
+ type: SkipSelf
723
+ }] }];
724
+ } });
725
+ class DbxMapboxMapStoreInjectionBlockDirective {
726
+ }
727
+ DbxMapboxMapStoreInjectionBlockDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreInjectionBlockDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
728
+ DbxMapboxMapStoreInjectionBlockDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxMapStoreInjectionBlockDirective, selector: "[dbxMapboxStoreParentBlocker]", providers: [DbxMapboxMapStoreProviderBlock], ngImport: i0 });
729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStoreInjectionBlockDirective, decorators: [{
730
+ type: Directive,
731
+ args: [{
732
+ selector: '[dbxMapboxStoreParentBlocker]',
733
+ providers: [DbxMapboxMapStoreProviderBlock]
734
+ }]
735
+ }] });
736
+ /**
737
+ * Creates a Provider that initializes a new DbxMapboxMapStore if a parent does not exist.
738
+ *
739
+ * If a DbxMapboxMapStoreInjectionBlock is available in the context, and references the same dbxMapboxMapStore that is attempting to be injected, a new DbxMapboxMapStore is created.
740
+ *
741
+ * @returns
742
+ */
743
+ function provideMapboxStoreIfParentIsUnavailable() {
744
+ return {
745
+ provide: DbxMapboxMapStore,
746
+ useFactory: (parentInjector, dbxMapboxMapStoreInjectionBlock, dbxMapboxMapStore) => {
747
+ if (!dbxMapboxMapStore || (dbxMapboxMapStore && dbxMapboxMapStoreInjectionBlock != null && dbxMapboxMapStoreInjectionBlock.dbxMapboxMapStore === dbxMapboxMapStore)) {
748
+ // create a new dbxMapboxMapStore to use
749
+ const injector = Injector.create({ providers: [{ provide: DbxMapboxMapStore }], parent: parentInjector });
750
+ dbxMapboxMapStore = injector.get(DbxMapboxMapStore);
751
+ }
752
+ return dbxMapboxMapStore;
753
+ },
754
+ deps: [Injector, [new Optional(), DbxMapboxMapStoreProviderBlock], [new Optional(), new SkipSelf(), DbxMapboxMapStore]]
755
+ };
756
+ }
757
+
648
758
  const declarations = [
649
759
  //
650
760
  DbxMapboxMapDirective,
651
761
  DbxMapboxLayoutComponent,
652
762
  DbxMapboxLayoutDrawerComponent,
653
- DbxMapboxMenuComponent
763
+ DbxMapboxMenuComponent,
764
+ DbxMapboxMapStoreInjectionBlockDirective
654
765
  ];
655
766
  class DbxMapboxModule {
656
767
  static forRoot(config) {
@@ -671,7 +782,8 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
671
782
  DbxMapboxMapDirective,
672
783
  DbxMapboxLayoutComponent,
673
784
  DbxMapboxLayoutDrawerComponent,
674
- DbxMapboxMenuComponent
785
+ DbxMapboxMenuComponent,
786
+ DbxMapboxMapStoreInjectionBlockDirective
675
787
  ], imports: [
676
788
  //
677
789
  CommonModule,
@@ -685,7 +797,8 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
685
797
  DbxMapboxMapDirective,
686
798
  DbxMapboxLayoutComponent,
687
799
  DbxMapboxLayoutDrawerComponent,
688
- DbxMapboxMenuComponent
800
+ DbxMapboxMenuComponent,
801
+ DbxMapboxMapStoreInjectionBlockDirective
689
802
  ] });
690
803
  DbxMapboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, imports: [
691
804
  //
@@ -724,10 +837,15 @@ const KNOWN_MAPBOX_STYLES = [
724
837
  'mapbox://styles/mapbox/navigation-day-v1',
725
838
  'mapbox://styles/mapbox/navigation-night-v1'
726
839
  ];
840
+ const MAPBOX_MIN_ZOOM_LEVEL = 0;
841
+ const MAPBOX_MAX_ZOOM_LEVEL = 22;
842
+ function mapboxZoomLevel(input) {
843
+ return Math.min(Math.max(input, MAPBOX_MIN_ZOOM_LEVEL), MAPBOX_MAX_ZOOM_LEVEL);
844
+ }
727
845
 
728
846
  /**
729
847
  * Generated bundle index. Do not edit.
730
848
  */
731
849
 
732
- export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxConfig, DbxMapboxLayoutComponent, DbxMapboxLayoutDrawerComponent, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxMenuComponent, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES };
850
+ export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxConfig, DbxMapboxLayoutComponent, DbxMapboxLayoutDrawerComponent, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxMapStoreInjectionBlockDirective, DbxMapboxMapStoreProviderBlock, DbxMapboxMenuComponent, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES, MAPBOX_MAX_ZOOM_LEVEL, MAPBOX_MIN_ZOOM_LEVEL, mapboxZoomLevel, provideMapboxStoreIfParentIsUnavailable };
733
851
  //# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map