@dereekb/dbx-form 9.23.18 → 9.23.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/esm2020/mapbox/lib/field/latlng/index.mjs +2 -1
- package/esm2020/mapbox/lib/field/latlng/latlng.field.component.mjs +87 -29
- package/esm2020/mapbox/lib/field/latlng/latlng.field.marker.component.mjs +34 -0
- package/esm2020/mapbox/lib/field/latlng/latlng.field.mjs +6 -3
- package/esm2020/mapbox/lib/field/latlng/latlng.module.mjs +6 -4
- package/fesm2015/dereekb-dbx-form-mapbox.mjs +128 -38
- package/fesm2015/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-mapbox.mjs +126 -38
- package/fesm2020/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/mapbox/esm2020/lib/field/latlng/index.mjs +2 -1
- package/mapbox/esm2020/lib/field/latlng/latlng.field.component.mjs +87 -29
- package/mapbox/esm2020/lib/field/latlng/latlng.field.marker.component.mjs +34 -0
- package/mapbox/esm2020/lib/field/latlng/latlng.field.mjs +6 -3
- package/mapbox/esm2020/lib/field/latlng/latlng.module.mjs +6 -4
- package/mapbox/fesm2015/dereekb-dbx-form-mapbox.mjs +128 -38
- package/mapbox/fesm2015/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/mapbox/fesm2020/dereekb-dbx-form-mapbox.mjs +126 -38
- package/mapbox/fesm2020/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/mapbox/lib/field/latlng/index.d.ts +1 -0
- package/mapbox/lib/field/latlng/latlng.field.component.d.ts +45 -5
- package/mapbox/lib/field/latlng/latlng.field.d.ts +1 -1
- package/mapbox/lib/field/latlng/latlng.field.marker.component.d.ts +12 -0
- package/mapbox/lib/field/latlng/latlng.module.d.ts +11 -10
- package/mapbox/package.json +4 -4
- package/package.json +4 -4
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { formlyField, propsAndConfigForFieldConfig, DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER, validatorsForFieldConfig, DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE, styleWrapper } from '@dereekb/dbx-form';
|
|
2
|
-
import { LAT_LNG_PATTERN, isDefaultLatLngPoint, isValidLatLngPoint, latLngStringFunction, latLngPointFunction, latLngPoint } from '@dereekb/util';
|
|
2
|
+
import { LAT_LNG_PATTERN, isSameLatLngPoint, isDefaultLatLngPoint, isValidLatLngPoint, latLngStringFunction, latLngPointFunction, latLngPoint } from '@dereekb/util';
|
|
3
3
|
import * as i1 from '@dereekb/dbx-web';
|
|
4
4
|
import { mapCompactModeObs, DbxTextModule } from '@dereekb/dbx-web';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { Component, Optional, NgModule } from '@angular/core';
|
|
6
|
+
import { Component, ChangeDetectionStrategy, Optional, NgModule } from '@angular/core';
|
|
7
7
|
import { FieldType } from '@ngx-formly/material';
|
|
8
|
-
import { BehaviorSubject, switchMap, startWith,
|
|
9
|
-
import { SubscriptionObject, filterMaybe } from '@dereekb/rxjs';
|
|
10
|
-
import * as
|
|
11
|
-
import * as i2
|
|
8
|
+
import { combineLatest, map, shareReplay, BehaviorSubject, of, switchMap, startWith, distinctUntilChanged, skipWhile, filter, skip, throttleTime, first } from 'rxjs';
|
|
9
|
+
import { SubscriptionObject, filterMaybe, asObservableFromGetter } from '@dereekb/rxjs';
|
|
10
|
+
import * as i3$1 from '@ng-web-apis/geolocation';
|
|
11
|
+
import * as i2 from '@dereekb/dbx-web/mapbox';
|
|
12
12
|
import { provideMapboxStoreIfParentIsUnavailable, DbxMapboxModule, mapboxZoomLevel, MAPBOX_MIN_ZOOM_LEVEL, MAPBOX_MAX_ZOOM_LEVEL } from '@dereekb/dbx-web/mapbox';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i3 from '@angular/common';
|
|
14
14
|
import { CommonModule } from '@angular/common';
|
|
15
15
|
import * as i5 from '@angular/material/icon';
|
|
16
16
|
import { MatIconModule } from '@angular/material/icon';
|
|
17
17
|
import * as i6 from '@angular/material/button';
|
|
18
18
|
import { MatButtonModule } from '@angular/material/button';
|
|
19
|
-
import * as i4
|
|
19
|
+
import * as i4 from '@angular/forms';
|
|
20
20
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
21
21
|
import * as i8 from '@angular/material/form-field';
|
|
22
22
|
import * as i9 from '@angular/material/input';
|
|
@@ -27,7 +27,7 @@ import * as i1$1 from '@ngx-formly/core';
|
|
|
27
27
|
import { FormlyModule } from '@ngx-formly/core';
|
|
28
28
|
|
|
29
29
|
function mapboxLatLngField(config = {}) {
|
|
30
|
-
const { key = 'latLng', latLngConfig, showMap, zoom, recenterTime, selectLocationOnMapClick } = config;
|
|
30
|
+
const { key = 'latLng', latLngConfig, showMap, zoom, recenterTime, showCenterButton, setCenterOnLocationSet, selectLocationOnMapDrag, selectLocationOnMapClick } = config;
|
|
31
31
|
const fieldConfig = {
|
|
32
32
|
...formlyField({
|
|
33
33
|
key,
|
|
@@ -41,7 +41,10 @@ function mapboxLatLngField(config = {}) {
|
|
|
41
41
|
zoom,
|
|
42
42
|
latLngConfig,
|
|
43
43
|
recenterTime,
|
|
44
|
-
|
|
44
|
+
selectLocationOnMapDrag,
|
|
45
|
+
selectLocationOnMapClick,
|
|
46
|
+
showCenterButton,
|
|
47
|
+
setCenterOnLocationSet
|
|
45
48
|
})
|
|
46
49
|
}),
|
|
47
50
|
...validatorsForFieldConfig({
|
|
@@ -55,13 +58,54 @@ function mapboxLatLngField(config = {}) {
|
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
60
|
|
|
61
|
+
class DbxFormMapboxLatLngFieldMarkerComponent {
|
|
62
|
+
constructor(fieldComponent) {
|
|
63
|
+
this.fieldComponent = fieldComponent;
|
|
64
|
+
this.marker$ = combineLatest([this.fieldComponent.latLng$, this.fieldComponent.markerConfig$]).pipe(map(([latLng, markerConfig]) => {
|
|
65
|
+
if (markerConfig !== false) {
|
|
66
|
+
return { latLng, ...markerConfig };
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
}), shareReplay(1));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
DbxFormMapboxLatLngFieldMarkerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, deps: [{ token: DbxFormMapboxLatLngFieldComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
75
|
+
DbxFormMapboxLatLngFieldMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormMapboxLatLngFieldMarkerComponent, selector: "ng-component", ngImport: i0, template: `
|
|
76
|
+
<dbx-mapbox-marker [marker]="marker$ | async"></dbx-mapbox-marker>
|
|
77
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i2.DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: ["marker"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{
|
|
81
|
+
template: `
|
|
82
|
+
<dbx-mapbox-marker [marker]="marker$ | async"></dbx-mapbox-marker>
|
|
83
|
+
`,
|
|
84
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
85
|
+
}]
|
|
86
|
+
}], ctorParameters: function () { return [{ type: DbxFormMapboxLatLngFieldComponent }]; } });
|
|
87
|
+
|
|
88
|
+
const DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY = 'DbxFormMapboxLatLngFieldComponent';
|
|
89
|
+
const DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG = {
|
|
90
|
+
icon: 'pin_drop'
|
|
91
|
+
};
|
|
92
|
+
/*
|
|
93
|
+
TODO: Re-add menu for picking a new location, including using the current location.
|
|
94
|
+
<button mat-icon-button (click)="useCurrentLocation()" [disabled]="isReadonlyOrDisabled || (useCurrentLocationDisabled$ | async)">
|
|
95
|
+
<mat-icon>my_location</mat-icon>
|
|
96
|
+
</button>
|
|
97
|
+
*/
|
|
58
98
|
class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
59
|
-
constructor(
|
|
99
|
+
constructor(
|
|
100
|
+
//
|
|
101
|
+
compact, dbxMapboxInjectionStore, geolocation$, dbxMapboxMapStore, ngZone, injector) {
|
|
60
102
|
super();
|
|
61
103
|
this.compact = compact;
|
|
104
|
+
this.dbxMapboxInjectionStore = dbxMapboxInjectionStore;
|
|
62
105
|
this.geolocation$ = geolocation$;
|
|
63
106
|
this.dbxMapboxMapStore = dbxMapboxMapStore;
|
|
64
107
|
this.ngZone = ngZone;
|
|
108
|
+
this.injector = injector;
|
|
65
109
|
this.compactClass$ = mapCompactModeObs(this.compact?.mode$, {
|
|
66
110
|
compact: 'dbx-mapbox-input-field-compact'
|
|
67
111
|
});
|
|
@@ -70,13 +114,15 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
70
114
|
this._sub = new SubscriptionObject();
|
|
71
115
|
this._geoSub = new SubscriptionObject();
|
|
72
116
|
this._centerSub = new SubscriptionObject();
|
|
117
|
+
this._flyToCenterSub = new SubscriptionObject();
|
|
73
118
|
this._clickSub = new SubscriptionObject();
|
|
74
119
|
this._zoom = new BehaviorSubject(12);
|
|
120
|
+
this._markerConfig = new BehaviorSubject(of(DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG));
|
|
75
121
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
76
122
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
77
123
|
this.value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
|
|
78
|
-
this.latLng$ = this.value$.pipe(filterMaybe(), map((x) => this._latLngPointFunction(x)), shareReplay(1));
|
|
79
|
-
this.
|
|
124
|
+
this.latLng$ = this.value$.pipe(filterMaybe(), map((x) => this._latLngPointFunction(x)), distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
|
|
125
|
+
this.nonZeroLatLng$ = this.latLng$.pipe(
|
|
80
126
|
/**
|
|
81
127
|
* Center observable passed to the store. Do not pass invalid points.
|
|
82
128
|
*
|
|
@@ -84,6 +130,7 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
84
130
|
*/
|
|
85
131
|
skipWhile(isDefaultLatLngPoint), filter(isValidLatLngPoint));
|
|
86
132
|
this.zoom$ = this._zoom.asObservable();
|
|
133
|
+
this.markerConfig$ = this._markerConfig.asObservable().pipe(switchMap((x) => x), shareReplay(1));
|
|
87
134
|
}
|
|
88
135
|
get zoom() {
|
|
89
136
|
return Math.min(this.field.props.zoom || 12, 18);
|
|
@@ -106,43 +153,63 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
106
153
|
get showMap() {
|
|
107
154
|
return this.field.props.showMap ?? true;
|
|
108
155
|
}
|
|
156
|
+
get selectLocationOnMapDrag() {
|
|
157
|
+
return this.field.props.selectLocationOnMapDrag ?? true;
|
|
158
|
+
}
|
|
109
159
|
get selectLocationOnMapClick() {
|
|
110
160
|
return this.field.props.selectLocationOnMapClick ?? false;
|
|
111
161
|
}
|
|
162
|
+
get setCenterOnLocationSet() {
|
|
163
|
+
return this.field.props.setCenterOnLocationSet ?? true;
|
|
164
|
+
}
|
|
165
|
+
get showCenterButton() {
|
|
166
|
+
return !this.selectLocationOnMapDrag && this.props.showCenterButton !== false;
|
|
167
|
+
}
|
|
112
168
|
get recenterTime() {
|
|
113
169
|
return this.field.props.recenterTime || 10 * 1000;
|
|
114
170
|
}
|
|
115
171
|
get useCurrentLocationDisabled() {
|
|
116
172
|
return this._useCurrentLocationDisabled;
|
|
117
173
|
}
|
|
174
|
+
get mapInjectionKey() {
|
|
175
|
+
return this.field.props.mapInjectionKey;
|
|
176
|
+
}
|
|
177
|
+
get markerConfig() {
|
|
178
|
+
return this.field.props.markerConfig;
|
|
179
|
+
}
|
|
118
180
|
ngOnInit() {
|
|
119
181
|
const latLngPointConfig = { ...this.field.props.latLngConfig, wrap: this.field.props.latLngConfig?.wrap || false, validate: this.field.props.latLngConfig?.validate || false, precisionRounding: this.field.props.latLngConfig?.precisionRounding ?? 'round' };
|
|
120
182
|
this._latLngStringFunction = latLngStringFunction(latLngPointConfig);
|
|
121
183
|
this._latLngPointFunction = latLngPointFunction(latLngPointConfig);
|
|
122
184
|
this._formControlObs.next(this.formControl);
|
|
123
185
|
this._zoom.next(this.zoom);
|
|
124
|
-
|
|
186
|
+
if (this.setCenterOnLocationSet) {
|
|
187
|
+
this._centerSub.subscription = this.dbxMapboxMapStore.setCenter(this.nonZeroLatLng$);
|
|
188
|
+
}
|
|
125
189
|
if (this.showMap) {
|
|
126
190
|
// Set zoom only if showMap is true
|
|
127
191
|
this.dbxMapboxMapStore.setZoom(this.zoom$);
|
|
128
192
|
// recenter periodically
|
|
129
193
|
if (this.recenterTime > 0) {
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
194
|
+
this._flyToCenterSub.subscription = this.dbxMapboxMapStore.center$.pipe(skip(1), throttleTime(this.recenterTime, undefined, { leading: false, trailing: true })).subscribe(() => {
|
|
195
|
+
this.flyToMarker();
|
|
132
196
|
});
|
|
133
197
|
}
|
|
134
198
|
}
|
|
135
199
|
else {
|
|
136
200
|
// use the center of the map to set locations
|
|
137
|
-
|
|
138
|
-
this.dbxMapboxMapStore.
|
|
139
|
-
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
142
|
-
|
|
143
|
-
|
|
201
|
+
if (this.selectLocationOnMapDrag) {
|
|
202
|
+
this._sub.subscription = this.dbxMapboxMapStore.center$.subscribe((center) => {
|
|
203
|
+
this.dbxMapboxMapStore.centerGivenMargin$.pipe(first()).subscribe(() => {
|
|
204
|
+
if (!this.isReadonlyOrDisabled) {
|
|
205
|
+
this.ngZone.run(() => {
|
|
206
|
+
this.setValue(center);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
});
|
|
144
210
|
});
|
|
145
|
-
}
|
|
211
|
+
}
|
|
212
|
+
// enable selecting the location on a map click
|
|
146
213
|
if (this.selectLocationOnMapClick) {
|
|
147
214
|
this._clickSub.subscription = this.dbxMapboxMapStore.clickEvent$.subscribe((x) => {
|
|
148
215
|
if (x?.type === 'click') {
|
|
@@ -154,16 +221,34 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
154
221
|
if (this.props.readonly) {
|
|
155
222
|
this.formControl.disable();
|
|
156
223
|
}
|
|
224
|
+
// Add the marker to the injection store for display
|
|
225
|
+
if (this.dbxMapboxInjectionStore) {
|
|
226
|
+
if (this.markerConfig) {
|
|
227
|
+
this._markerConfig.next(asObservableFromGetter(this.markerConfig, this));
|
|
228
|
+
}
|
|
229
|
+
this.dbxMapboxInjectionStore.addInjectionConfig({
|
|
230
|
+
key: this.mapInjectionKey || DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY,
|
|
231
|
+
injectionConfig: {
|
|
232
|
+
componentClass: DbxFormMapboxLatLngFieldMarkerComponent,
|
|
233
|
+
providers: [{ provide: DbxFormMapboxLatLngFieldComponent, useValue: this }]
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
157
237
|
}
|
|
158
238
|
ngOnDestroy() {
|
|
159
239
|
super.ngOnDestroy();
|
|
160
|
-
this._sub.destroy();
|
|
161
|
-
this._geoSub.destroy();
|
|
162
240
|
this._zoom.complete();
|
|
241
|
+
this._markerConfig.complete();
|
|
163
242
|
this._formControlObs.complete();
|
|
243
|
+
this._sub.destroy();
|
|
244
|
+
this._geoSub.destroy();
|
|
164
245
|
this._centerSub.destroy();
|
|
246
|
+
this._flyToCenterSub.destroy();
|
|
165
247
|
this._clickSub.destroy();
|
|
166
248
|
}
|
|
249
|
+
flyToMarker() {
|
|
250
|
+
this.dbxMapboxMapStore.easeTo(this.nonZeroLatLng$.pipe(first(), map((x) => ({ center: x }))));
|
|
251
|
+
}
|
|
167
252
|
useCurrentLocation() {
|
|
168
253
|
this._geoSub.subscription = this.geolocation$.pipe(first()).subscribe({
|
|
169
254
|
next: (position) => {
|
|
@@ -186,7 +271,7 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
186
271
|
this.formControl.markAsDirty();
|
|
187
272
|
}
|
|
188
273
|
}
|
|
189
|
-
DbxFormMapboxLatLngFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, deps: [{ token: i1.CompactContextStore, optional: true }, { token: i2.
|
|
274
|
+
DbxFormMapboxLatLngFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, deps: [{ token: i1.CompactContextStore, optional: true }, { token: i2.DbxMapboxInjectionStore, optional: true }, { token: i3$1.GeolocationService }, { token: i2.DbxMapboxMapStore }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
190
275
|
DbxFormMapboxLatLngFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormMapboxLatLngFieldComponent, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
|
|
191
276
|
<div class="dbx-mapbox-input-field" [ngClass]="(compactClass$ | async) ?? ''" [formGroup]="formGroup">
|
|
192
277
|
<div *ngIf="showMap" class="dbx-mapbox-input-field-map">
|
|
@@ -195,7 +280,7 @@ DbxFormMapboxLatLngFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion
|
|
|
195
280
|
</mgl-map>
|
|
196
281
|
</div>
|
|
197
282
|
<div class="dbx-mapbox-input-field-input">
|
|
198
|
-
<button mat-icon-button (click)="
|
|
283
|
+
<button *ngIf="showCenterButton" mat-icon-button (click)="flyToMarker()">
|
|
199
284
|
<mat-icon>my_location</mat-icon>
|
|
200
285
|
</button>
|
|
201
286
|
<mat-form-field class="dbx-mapbox-input-field-input-field" appearance="standard">
|
|
@@ -205,7 +290,7 @@ DbxFormMapboxLatLngFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion
|
|
|
205
290
|
</mat-form-field>
|
|
206
291
|
</div>
|
|
207
292
|
</div>
|
|
208
|
-
`, isInline: true, styles: [".dbx-mapbox-input-field .dbx-mapbox-input-field-map{height:220px;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-map mgl-map{height:100%;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-input{display:flex;align-items:center}.dbx-mapbox-input-field .dbx-mapbox-input-field-input .dbx-mapbox-input-field-input-field{width:calc(100% - 40px)}.dbx-mapbox-input-field-compact .dbx-latlng-field-input{min-height:120px;height:300px;max-height:calc(var(--vh100) * .5)}\n"], dependencies: [{ kind: "directive", type:
|
|
293
|
+
`, isInline: true, styles: [".dbx-mapbox-input-field .dbx-mapbox-input-field-map{height:220px;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-map mgl-map{height:100%;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-input{display:flex;align-items:center}.dbx-mapbox-input-field .dbx-mapbox-input-field-input .dbx-mapbox-input-field-input-field{width:calc(100% - 40px)}.dbx-mapbox-input-field-compact .dbx-latlng-field-input{min-height:120px;height:300px;max-height:calc(var(--vh100) * .5)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.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: "directive", type: i2.DbxMapboxMapDirective, selector: "[dbxMapboxMap]" }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.MapComponent, selector: "mgl-map", inputs: ["accessToken", "collectResourceTiming", "crossSourceCollisions", "customMapboxApiUrl", "fadeDuration", "hash", "refreshExpiredTiles", "failIfMajorPerformanceCaveat", "bearingSnap", "interactive", "pitchWithRotate", "clickTolerance", "attributionControl", "logoPosition", "maxTileCacheSize", "localIdeographFontFamily", "preserveDrawingBuffer", "trackResize", "transformRequest", "bounds", "antialias", "locale", "minZoom", "maxZoom", "minPitch", "maxPitch", "scrollZoom", "dragRotate", "touchPitch", "touchZoomRotate", "doubleClickZoom", "keyboard", "dragPan", "boxZoom", "style", "center", "maxBounds", "zoom", "bearing", "pitch", "fitBoundsOptions", "renderWorldCopies", "projection", "movingMethod", "movingOptions", "fitBounds", "fitScreenCoordinates", "centerWithPanTo", "panToOptions", "cursorStyle"], outputs: ["mapResize", "mapRemove", "mapMouseDown", "mapMouseUp", "mapMouseMove", "mapClick", "mapDblClick", "mapMouseOver", "mapMouseOut", "mapContextMenu", "mapTouchStart", "mapTouchEnd", "mapTouchMove", "mapTouchCancel", "mapWheel", "moveStart", "move", "moveEnd", "mapDragStart", "mapDrag", "mapDragEnd", "zoomStart", "zoomEvt", "zoomEnd", "rotateStart", "rotate", "rotateEnd", "pitchStart", "pitchEvt", "pitchEnd", "boxZoomStart", "boxZoomEnd", "boxZoomCancel", "webGlContextLost", "webGlContextRestored", "mapLoad", "idle", "render", "mapError", "data", "styleData", "sourceData", "dataLoading", "styleDataLoading", "sourceDataLoading", "styleImageMissing", "resize", "remove", "mouseDown", "mouseUp", "mouseMove", "click", "dblClick", "mouseOver", "mouseOut", "contextMenu", "touchStart", "touchEnd", "touchMove", "touchCancel", "wheel", "dragStart", "drag", "dragEnd", "load", "error"] }, { kind: "component", type: i10.MarkerComponent, selector: "mgl-marker", inputs: ["offset", "anchor", "clickTolerance", "feature", "lngLat", "draggable", "popupShown", "className", "pitchAlignment", "rotationAlignment"], outputs: ["markerDragStart", "markerDragEnd", "markerDrag", "dragStart", "dragEnd", "drag"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] });
|
|
209
294
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, decorators: [{
|
|
210
295
|
type: Component,
|
|
211
296
|
args: [{ template: `
|
|
@@ -216,7 +301,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
216
301
|
</mgl-map>
|
|
217
302
|
</div>
|
|
218
303
|
<div class="dbx-mapbox-input-field-input">
|
|
219
|
-
<button mat-icon-button (click)="
|
|
304
|
+
<button *ngIf="showCenterButton" mat-icon-button (click)="flyToMarker()">
|
|
220
305
|
<mat-icon>my_location</mat-icon>
|
|
221
306
|
</button>
|
|
222
307
|
<mat-form-field class="dbx-mapbox-input-field-input-field" appearance="standard">
|
|
@@ -229,19 +314,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
229
314
|
`, providers: [provideMapboxStoreIfParentIsUnavailable()], styles: [".dbx-mapbox-input-field .dbx-mapbox-input-field-map{height:220px;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-map mgl-map{height:100%;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-input{display:flex;align-items:center}.dbx-mapbox-input-field .dbx-mapbox-input-field-input .dbx-mapbox-input-field-input-field{width:calc(100% - 40px)}.dbx-mapbox-input-field-compact .dbx-latlng-field-input{min-height:120px;height:300px;max-height:calc(var(--vh100) * .5)}\n"] }]
|
|
230
315
|
}], ctorParameters: function () { return [{ type: i1.CompactContextStore, decorators: [{
|
|
231
316
|
type: Optional
|
|
232
|
-
}] }, { type: i2.
|
|
317
|
+
}] }, { type: i2.DbxMapboxInjectionStore, decorators: [{
|
|
318
|
+
type: Optional
|
|
319
|
+
}] }, { type: i3$1.GeolocationService }, { type: i2.DbxMapboxMapStore }, { type: i0.NgZone }, { type: i0.Injector }]; } });
|
|
233
320
|
|
|
234
321
|
class DbxFormMapboxLatLngModule {
|
|
235
322
|
}
|
|
236
323
|
DbxFormMapboxLatLngModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
237
|
-
DbxFormMapboxLatLngModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, declarations: [DbxFormMapboxLatLngFieldComponent], imports: [CommonModule,
|
|
324
|
+
DbxFormMapboxLatLngModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, declarations: [DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngFieldMarkerComponent], imports: [CommonModule,
|
|
238
325
|
MatIconModule,
|
|
239
326
|
MatButtonModule,
|
|
240
327
|
DbxTextModule,
|
|
241
328
|
DbxMapboxModule,
|
|
242
329
|
FormsModule,
|
|
243
330
|
ReactiveFormsModule,
|
|
244
|
-
MatInputModule, i1$1.FormlyModule, NgxMapboxGLModule] });
|
|
331
|
+
MatInputModule, i1$1.FormlyModule, NgxMapboxGLModule], exports: [DbxFormMapboxLatLngFieldMarkerComponent] });
|
|
245
332
|
DbxFormMapboxLatLngModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [CommonModule,
|
|
246
333
|
MatIconModule,
|
|
247
334
|
MatButtonModule,
|
|
@@ -271,7 +358,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
271
358
|
}),
|
|
272
359
|
NgxMapboxGLModule
|
|
273
360
|
],
|
|
274
|
-
declarations: [DbxFormMapboxLatLngFieldComponent]
|
|
361
|
+
declarations: [DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngFieldMarkerComponent],
|
|
362
|
+
exports: [DbxFormMapboxLatLngFieldMarkerComponent]
|
|
275
363
|
}]
|
|
276
364
|
}] });
|
|
277
365
|
|
|
@@ -395,7 +483,7 @@ class DbxFormMapboxZoomFieldComponent extends FieldType {
|
|
|
395
483
|
this.formControl.markAsDirty();
|
|
396
484
|
}
|
|
397
485
|
}
|
|
398
|
-
DbxFormMapboxZoomFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, deps: [{ token: i1.CompactContextStore, optional: true }, { token: i2
|
|
486
|
+
DbxFormMapboxZoomFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, deps: [{ token: i1.CompactContextStore, optional: true }, { token: i2.DbxMapboxService }, { token: i2.DbxMapboxMapStore }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
399
487
|
DbxFormMapboxZoomFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormMapboxZoomFieldComponent, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
|
|
400
488
|
<div class="dbx-mapbox-input-field" [ngClass]="(compactClass$ | async) ?? ''" [formGroup]="formGroup">
|
|
401
489
|
<div *ngIf="showMap" class="dbx-mapbox-input-field-map">
|
|
@@ -408,7 +496,7 @@ DbxFormMapboxZoomFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
|
|
|
408
496
|
</mat-form-field>
|
|
409
497
|
</div>
|
|
410
498
|
</div>
|
|
411
|
-
`, isInline: true, styles: [".dbx-mapbox-input-field .dbx-mapbox-input-field-map{height:220px;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-map mgl-map{height:100%;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-input{display:flex;align-items:center}.dbx-mapbox-input-field .dbx-mapbox-input-field-input .dbx-mapbox-input-field-input-field{width:calc(100% - 40px)}.dbx-mapbox-input-field-compact .dbx-latlng-field-input{min-height:120px;height:300px;max-height:calc(var(--vh100) * .5)}\n"], dependencies: [{ kind: "directive", type:
|
|
499
|
+
`, isInline: true, styles: [".dbx-mapbox-input-field .dbx-mapbox-input-field-map{height:220px;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-map mgl-map{height:100%;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-input{display:flex;align-items:center}.dbx-mapbox-input-field .dbx-mapbox-input-field-input .dbx-mapbox-input-field-input-field{width:calc(100% - 40px)}.dbx-mapbox-input-field-compact .dbx-latlng-field-input{min-height:120px;height:300px;max-height:calc(var(--vh100) * .5)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DbxMapboxMapDirective, selector: "[dbxMapboxMap]" }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i4.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.MapComponent, selector: "mgl-map", inputs: ["accessToken", "collectResourceTiming", "crossSourceCollisions", "customMapboxApiUrl", "fadeDuration", "hash", "refreshExpiredTiles", "failIfMajorPerformanceCaveat", "bearingSnap", "interactive", "pitchWithRotate", "clickTolerance", "attributionControl", "logoPosition", "maxTileCacheSize", "localIdeographFontFamily", "preserveDrawingBuffer", "trackResize", "transformRequest", "bounds", "antialias", "locale", "minZoom", "maxZoom", "minPitch", "maxPitch", "scrollZoom", "dragRotate", "touchPitch", "touchZoomRotate", "doubleClickZoom", "keyboard", "dragPan", "boxZoom", "style", "center", "maxBounds", "zoom", "bearing", "pitch", "fitBoundsOptions", "renderWorldCopies", "projection", "movingMethod", "movingOptions", "fitBounds", "fitScreenCoordinates", "centerWithPanTo", "panToOptions", "cursorStyle"], outputs: ["mapResize", "mapRemove", "mapMouseDown", "mapMouseUp", "mapMouseMove", "mapClick", "mapDblClick", "mapMouseOver", "mapMouseOut", "mapContextMenu", "mapTouchStart", "mapTouchEnd", "mapTouchMove", "mapTouchCancel", "mapWheel", "moveStart", "move", "moveEnd", "mapDragStart", "mapDrag", "mapDragEnd", "zoomStart", "zoomEvt", "zoomEnd", "rotateStart", "rotate", "rotateEnd", "pitchStart", "pitchEvt", "pitchEnd", "boxZoomStart", "boxZoomEnd", "boxZoomCancel", "webGlContextLost", "webGlContextRestored", "mapLoad", "idle", "render", "mapError", "data", "styleData", "sourceData", "dataLoading", "styleDataLoading", "sourceDataLoading", "styleImageMissing", "resize", "remove", "mouseDown", "mouseUp", "mouseMove", "click", "dblClick", "mouseOver", "mouseOut", "contextMenu", "touchStart", "touchEnd", "touchMove", "touchCancel", "wheel", "dragStart", "drag", "dragEnd", "load", "error"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] });
|
|
412
500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, decorators: [{
|
|
413
501
|
type: Component,
|
|
414
502
|
args: [{ template: `
|
|
@@ -426,7 +514,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
426
514
|
`, providers: [provideMapboxStoreIfParentIsUnavailable()], styles: [".dbx-mapbox-input-field .dbx-mapbox-input-field-map{height:220px;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-map mgl-map{height:100%;width:100%}.dbx-mapbox-input-field .dbx-mapbox-input-field-input{display:flex;align-items:center}.dbx-mapbox-input-field .dbx-mapbox-input-field-input .dbx-mapbox-input-field-input-field{width:calc(100% - 40px)}.dbx-mapbox-input-field-compact .dbx-latlng-field-input{min-height:120px;height:300px;max-height:calc(var(--vh100) * .5)}\n"] }]
|
|
427
515
|
}], ctorParameters: function () { return [{ type: i1.CompactContextStore, decorators: [{
|
|
428
516
|
type: Optional
|
|
429
|
-
}] }, { type: i2
|
|
517
|
+
}] }, { type: i2.DbxMapboxService }, { type: i2.DbxMapboxMapStore }, { type: i0.NgZone }]; } });
|
|
430
518
|
|
|
431
519
|
class DbxFormMapboxZoomModule {
|
|
432
520
|
}
|
|
@@ -488,5 +576,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
488
576
|
* Generated bundle index. Do not edit.
|
|
489
577
|
*/
|
|
490
578
|
|
|
491
|
-
export { DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngModule, DbxFormMapboxModule, DbxFormMapboxZoomFieldComponent, DbxFormMapboxZoomModule, mapboxLatLngField, mapboxZoomField };
|
|
579
|
+
export { DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY, DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG, DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngFieldMarkerComponent, DbxFormMapboxLatLngModule, DbxFormMapboxModule, DbxFormMapboxZoomFieldComponent, DbxFormMapboxZoomModule, mapboxLatLngField, mapboxZoomField };
|
|
492
580
|
//# sourceMappingURL=dereekb-dbx-form-mapbox.mjs.map
|